mirror of
https://github.com/munki/munki.git
synced 2026-02-06 23:30:03 -06:00
More changes to enable localization
git-svn-id: http://munki.googlecode.com/svn/trunk@920 a4e17f2e-e282-11dd-95e1-755cbddbdd66
This commit is contained in:
@@ -124,9 +124,11 @@ class MSUAppDelegate(NSObject):
|
||||
#NSLog(u"Building table of available updates.")
|
||||
self.buildUpdateTableData()
|
||||
if self._optionalInstalls:
|
||||
#NSLog(u"Building table of optional software.")
|
||||
NSLog(u"Building table of optional software.")
|
||||
self.buildOptionalInstallsData()
|
||||
#NSLog(u"Showing main window.")
|
||||
self.mainWindowController.theWindow.makeKeyAndOrderFront_(self)
|
||||
#NSLog(u"Main window was made key and ordered front")
|
||||
if self._listofupdates:
|
||||
return
|
||||
# no list of updates; let's check the LastCheckResult for more info
|
||||
@@ -230,6 +232,7 @@ class MSUAppDelegate(NSObject):
|
||||
if showRemovalDetail:
|
||||
item["display_name"] = ((item.get("display_name") or item.get("name", ""))
|
||||
+ NSLocalizedString(u" (will be removed)", None))
|
||||
item["description"] = NSLocalizedString(u"This item will be removed.", None)
|
||||
updatelist.append(item)
|
||||
if not showRemovalDetail:
|
||||
row = {}
|
||||
|
||||
@@ -39,10 +39,12 @@ class MSUOptionalInstallsViewController(NSViewController):
|
||||
"status": "", "original_status": ""}])
|
||||
|
||||
def optionallist(self):
|
||||
#NSLog(u"MSUOptionalInstallsViewController.optionallist")
|
||||
return self._optionallist
|
||||
objc.accessor(optionallist) # PyObjC KVO hack
|
||||
|
||||
def setOptionallist_(self, newlist):
|
||||
#NSLog(u"MSUOptionalInstallsViewController.setOptionallist_")
|
||||
self._optionallist = NSArray.arrayWithArray_(newlist)
|
||||
objc.accessor(setOptionallist_) # PyObjC KVO hack
|
||||
|
||||
@@ -52,6 +54,7 @@ class MSUOptionalInstallsViewController(NSViewController):
|
||||
#self.updateAddRemoveBtnState()
|
||||
|
||||
def updateRowStatus(self):
|
||||
#NSLog(u"MSUOptionalInstallsViewController.updateRowStatus")
|
||||
if len(self.array_controller.selectedObjects()):
|
||||
row = self.array_controller.selectedObjects()[0]
|
||||
if row['managed'] == row['original_managed']:
|
||||
@@ -98,6 +101,7 @@ class MSUOptionalInstallsViewController(NSViewController):
|
||||
NSApp.delegate().addOrRemoveOptionalSoftware()
|
||||
|
||||
def updateDescriptionView(self):
|
||||
#NSLog(u"MSUOptionalInstallsViewController.updateDescriptionView")
|
||||
if len(self.array_controller.selectedObjects()):
|
||||
row = self.array_controller.selectedObjects()[0]
|
||||
description = row.get("description","")
|
||||
@@ -112,5 +116,6 @@ class MSUOptionalInstallsViewController(NSViewController):
|
||||
self.descriptionView.mainFrame().loadHTMLString_baseURL_(u"", None)
|
||||
|
||||
def tableViewSelectionDidChange_(self, sender):
|
||||
#NSLog(u"MSUOptionalInstallsViewController.tableViewSelectionDidChange_")
|
||||
self.performSelectorOnMainThread_withObject_waitUntilDone_(self.updateDescriptionView, None, NO)
|
||||
|
||||
|
||||
@@ -221,13 +221,13 @@ class MSUStatusWindowController(NSObject):
|
||||
self.window.orderFront_(self)
|
||||
return ""
|
||||
if message.startswith(u"TITLE: "):
|
||||
self.window.setTitle_(message[7:])
|
||||
self.window.setTitle_(NSLocalizedString(message[7:], None))
|
||||
return ""
|
||||
if message.startswith(u"MESSAGE: "):
|
||||
self.messageFld.setStringValue_(message[9:])
|
||||
self.messageFld.setStringValue_(NSLocalizedString(message[9:], None))
|
||||
return ""
|
||||
if message.startswith(u"DETAIL: "):
|
||||
self.detailFld.setStringValue_(message[8:])
|
||||
self.detailFld.setStringValue_(NSLocalizedString(message[8:], None))
|
||||
return ""
|
||||
if message.startswith(u"PERCENT: "):
|
||||
self.setPercentageDone(message[9:])
|
||||
|
||||
@@ -36,14 +36,18 @@ class MSUupdatesViewController(NSViewController):
|
||||
updateNowBtn = IBOutlet()
|
||||
|
||||
_updatelist = NSArray.arrayWithArray_([{"image": NSImage.imageNamed_("Empty.png"),
|
||||
"name": "", "version": "", "size": "",
|
||||
"name": "",
|
||||
"version": "",
|
||||
"size": "",
|
||||
"description": ""}])
|
||||
|
||||
def updatelist(self):
|
||||
#NSLog(u"MSUupdatesViewController.updatelist")
|
||||
return self._updatelist
|
||||
objc.accessor(updatelist) # PyObjC KVO hack
|
||||
|
||||
def setUpdatelist_(self, newlist):
|
||||
#NSLog(u"MSUupdatesViewController.setUpdatelist_")
|
||||
self._updatelist = NSArray.arrayWithArray_(newlist)
|
||||
objc.accessor(setUpdatelist_) # PyObjC KVO hack
|
||||
|
||||
@@ -64,6 +68,7 @@ class MSUupdatesViewController(NSViewController):
|
||||
NSApp.delegate().buildOptionalInstallsData()
|
||||
|
||||
def updateDescriptionView(self):
|
||||
#NSLog(u"MSUupdatesViewController.updateDescriptionView")
|
||||
if len(self.array_controller.selectedObjects()):
|
||||
row = self.array_controller.selectedObjects()[0]
|
||||
description = row.get("description","")
|
||||
@@ -77,6 +82,7 @@ class MSUupdatesViewController(NSViewController):
|
||||
self.descriptionView.mainFrame().loadHTMLString_baseURL_(u"", None)
|
||||
|
||||
def tableViewSelectionDidChange_(self, sender):
|
||||
#NSLog(u"MSUupdatesViewController.tableViewSelectionDidChange_")
|
||||
self.performSelectorOnMainThread_withObject_waitUntilDone_(self.updateDescriptionView, None, NO)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user