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
@@ -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)