Fixed handling of plain text descriptions so that line breaks and other whitespace is displayed properly.

Fixed bogus "You software is up to date" alert when there were Apple Software Updates to install.

git-svn-id: http://munki.googlecode.com/svn/trunk@600 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
Greg Neagle
2010-07-22 22:38:52 +00:00
parent c5011e04c5
commit 8cf50e6b51
5 changed files with 24 additions and 9 deletions
@@ -21,8 +21,8 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="633"/>
<integer value="389"/>
<integer value="633"/>
<integer value="29"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
@@ -1076,6 +1076,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>WebKitDefaultFixedFontSize</string>
<string>WebKitDefaultFontSize</string>
<string>WebKitFixedFont</string>
<string>WebKitJavaEnabled</string>
<string>WebKitJavaScriptCanOpenWindowsAutomatically</string>
<string>WebKitJavaScriptEnabled</string>
@@ -1087,6 +1088,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="12"/>
<integer value="12"/>
<string>Lucida Grande</string>
<boolean value="NO"/>
<boolean value="NO"/>
<boolean value="NO"/>
@@ -1431,7 +1433,6 @@
<reference key="NSHScroller" ref="563381393"/>
<reference key="NSContentView" ref="720875694"/>
<reference key="NSHeaderClipView" ref="307161175"/>
<reference key="NSCornerView" ref="97640332"/>
<bytes key="NSScrollAmts">QSAAAEEgAABBmAAAQZgAAA</bytes>
</object>
<object class="WebView" id="800312662">
+2 -2
View File
@@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>3.0</string>
<string>3.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>3.0</string>
<string>3.0.1</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
@@ -118,10 +118,12 @@ class MSUAppDelegate(NSObject):
self.buildUpdateTableData()
if self._optionalInstalls:
self.buildOptionalInstallsData()
self.mainWindowController.theWindow.makeKeyAndOrderFront_(self)
if self._listofupdates:
return
# no list of updates; let's check the LastCheckResult for more info
prefs = munki.getManagedInstallsPrefs()
lastCheckResult = prefs.get("LastCheckResult")
self.mainWindowController.theWindow.makeKeyAndOrderFront_(self)
if lastCheckResult == 0:
self.noUpdatesAlert()
elif lastCheckResult == 1:
@@ -93,8 +93,13 @@ class MSUOptionalInstallsViewController(NSViewController):
def tableViewSelectionDidChange_(self, sender):
if self.array_controller.selectedObjects():
row = self.array_controller.selectedObjects()[0]
self.descriptionView.mainFrame().loadHTMLString_baseURL_(row.get("description",""), None)
description = row.get("description","")
if "</html>" in description or "</HTML>" in description:
self.descriptionView.mainFrame().loadHTMLString_baseURL_(description, None)
else:
self.descriptionView.mainFrame().loadData_MIMEType_textEncodingName_baseURL_(
buffer(description),
u"text/plain", u"utf-8", None)
self.updateRowStatus()
else:
self.descriptionView.mainFrame().loadHTMLString_baseURL_(u"", None)
@@ -64,7 +64,14 @@ class MSUupdatesViewController(NSViewController):
def tableViewSelectionDidChange_(self, sender):
if self.array_controller.selectedObjects():
row = self.array_controller.selectedObjects()[0]
self.descriptionView.mainFrame().loadHTMLString_baseURL_(row.get("description",""), None)
description = row.get("description","")
if "</html>" in description or "</HTML>" in description:
self.descriptionView.mainFrame().loadHTMLString_baseURL_(description, None)
else:
self.descriptionView.mainFrame().loadData_MIMEType_textEncodingName_baseURL_(
buffer(description),
u"text/plain", u"utf-8", None)
else:
self.descriptionView.mainFrame().loadHTMLString_baseURL_(u"", None)