Merge remote-tracking branch 'Munki_Origin/Munki2' into Munki2

This commit is contained in:
Richard Lafontaine
2014-08-08 11:06:56 -04:00
6 changed files with 36 additions and 35 deletions

View File

@@ -88,7 +88,7 @@ class AlertController(NSObject):
self._force_warning_btns[NSAlertDefaultReturn],
self._force_warning_btns[NSAlertAlternateReturn],
nil,
infoText)
u"%@", infoText)
alert.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(
self.window, self, self.forceLogoutWarningDidEnd_returnCode_contextInfo_, nil)
@@ -111,7 +111,7 @@ class AlertController(NSObject):
NSLocalizedString(u"OK", u"OK button title"),
nil,
nil,
NSLocalizedString(
u"%@", NSLocalizedString(
(u"There are additional pending updates to install or remove."),
u"Additional Pending Updates detail"))
alert.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(
@@ -133,7 +133,7 @@ class AlertController(NSObject):
NSLocalizedString(u"Log out and update", u"Log out and Update button text"),
NSLocalizedString(u"Cancel", u"Cancel button title"),
nil,
NSLocalizedString(
u"%@", NSLocalizedString(
(u"A restart is required after updating. Please be patient "
"as there may be a short delay at the login window. Log "
"out and update now?"), u"Restart Required detail"))
@@ -146,7 +146,7 @@ class AlertController(NSObject):
NSLocalizedString(u"Log out and update", u"Log out and Update button text"),
NSLocalizedString(u"Cancel", u"Cancel button title"),
nil,
NSLocalizedString(
u"%@", NSLocalizedString(
(u"A logout is required before updating. Please be patient "
"as there may be a short delay at the login window. Log "
"out and update now?"), u"Logout Required detail"))
@@ -188,7 +188,7 @@ class AlertController(NSObject):
NSLocalizedString(u"Cancel", u"Cancel button title"),
nil,
nil,
NSLocalizedString(
u"%@", NSLocalizedString(
(u"There are other users logged into this computer.\n"
"Updating now could cause other users to lose their "
"work.\n\nPlease try again later after the other users "
@@ -223,31 +223,30 @@ class AlertController(NSObject):
if item['user'] != current_user]
my_apps = [item['display_name'] for item in running_apps
if item['user'] == current_user]
msulog.log("MSC", "conflicting_apps", ','.join(other_users_apps + my_apps))
if other_users_apps:
detailText = NSLocalizedString(
(u"Other logged in users are using the following applications. "
"Try updating later when they are no longer in use:\n\n%s"),
u"Other Users Blocking Apps Running detail")
alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
NSLocalizedString(
u"Applications in use by others", u"Other Users Blocking Apps Running title"),
NSLocalizedString(u"OK", u'OKButtonText'),
nil,
nil,
NSLocalizedString(
(u"Other logged in users are using the following applications. "
"Try updating later when they are no longer in use:\n\n%s"),
u"Other Users Blocking Apps Running detail")
% '\n'.join(set(other_users_apps)))
u"%@", detailText % u'\n'.join(set(other_users_apps)))
else:
detailText = NSLocalizedString((u"You must quit the following applications before "
"proceeding with installation or removal:\n\n%s"),
u"Blocking Apps Running detail")
alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
NSLocalizedString(
u"Conflicting applications running", u"Blocking Apps Running title"),
NSLocalizedString(u"OK", u"OK button title"),
nil,
nil,
NSLocalizedString(
(u"You must quit the following applications before "
"proceeding with installation or removal:\n\n%s"),
u"Blocking Apps Running detail")
% '\n'.join(set(my_apps)))
msulog.log("MSC", "conflicting_apps", ','.join(other_users_apps + my_apps))
u"%@", detailText % u'\n'.join(set(my_apps)))
alert.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(
self.window, self,
self.blockingAppsRunningAlertDidEnd_returnCode_contextInfo_,
@@ -329,7 +328,7 @@ class AlertController(NSObject):
NSLocalizedString(u"Continue", u"Continue button text"),
NSLocalizedString(u"Cancel", u"Cancel button title"),
nil,
NSLocalizedString(
u"%@", NSLocalizedString(
(u"For best results, you should connect your computer to a "
"power source before updating. Are you sure you want to "
"continue the update?"), u"No Power Source Warning detail"))

View File

@@ -113,7 +113,7 @@ class MSUMainWindowController(NSWindowController):
NSLocalizedString(u"Quit", u"Quit button title"),
nil,
NSLocalizedString(u"Update now", u"Update Now button title"),
alertDetail)
u"%@", alertDetail)
alert.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(
self.window(), self,
self.updateAlertDidEnd_returnCode_contextInfo_, objc.nil)
@@ -217,7 +217,7 @@ class MSUMainWindowController(NSWindowController):
# show the alert sheet
self.window().makeKeyAndOrderFront_(self)
alert = NSAlert.alertWithMessageText_defaultButton_alternateButton_otherButton_informativeTextWithFormat_(
alertMessageText, OKButtonTitle, nil, nil, detailText)
alertMessageText, OKButtonTitle, nil, nil, u"%@", detailText)
alert.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(
self.window(), self,
self.munkiSessionErrorAlertDidEnd_returnCode_contextInfo_, nil)

View File

@@ -206,7 +206,7 @@ class MSUStatusController(NSObject):
NSLocalizedString(u"Restart", u"Restart button title"),
nil,
nil,
NSLocalizedString(
u"%@", NSLocalizedString(
u"Software installed or removed requires a restart. You will "
"have a chance to save open documents.", u"Restart Required alert detail"))
alert.beginSheetModalForWindow_modalDelegate_didEndSelector_contextInfo_(
@@ -222,7 +222,7 @@ class MSUStatusController(NSObject):
def setMessage_(self, messageText):
'''Display main status message'''
self._status_message = messageText
self._status_message = NSLocalizedString(messageText, None)
document = self.statusWindowController.webView.mainFrameDocument()
if document:
spinner = document.getElementById_('updates-progress-spinner')
@@ -236,7 +236,7 @@ class MSUStatusController(NSObject):
def setDetail_(self, detailText):
'''Display status detail'''
self._status_detail = detailText
self._status_detail = NSLocalizedString(detailText, None)
document = self.statusWindowController.webView.mainFrameDocument()
if document:
spinner = document.getElementById_('updates-progress-spinner')

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5053" systemVersion="13D65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5053" systemVersion="13E28" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1060" defaultVersion="1060" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5053"/>
@@ -239,7 +239,7 @@
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button focusRingType="none" id="782">
<rect key="frame" x="171" y="7" width="64" height="14"/>
<rect key="frame" x="167" y="7" width="72" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="squareTextured" title="My Items" bezelStyle="texturedSquare" imagePosition="overlaps" alignment="center" state="on" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="783">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -247,7 +247,7 @@
</buttonCell>
</button>
<button focusRingType="none" id="TMK-lk-F15">
<rect key="frame" x="246" y="7" width="64" height="14"/>
<rect key="frame" x="242" y="7" width="72" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="squareTextured" title="Updates" bezelStyle="texturedSquare" imagePosition="overlaps" alignment="center" state="on" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="Lha-uh-PEV">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -255,7 +255,7 @@
</buttonCell>
</button>
<button focusRingType="none" id="781">
<rect key="frame" x="94" y="7" width="64" height="14"/>
<rect key="frame" x="91" y="7" width="72" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="squareTextured" title="Categories" bezelStyle="texturedSquare" imagePosition="overlaps" alignment="center" state="on" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="784">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -263,7 +263,7 @@
</buttonCell>
</button>
<button focusRingType="none" id="780">
<rect key="frame" x="19" y="7" width="64" height="14"/>
<rect key="frame" x="15" y="7" width="72" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="squareTextured" title="Software" bezelStyle="texturedSquare" imagePosition="overlaps" alignment="center" state="on" focusRingType="none" imageScaling="proportionallyDown" inset="2" id="785">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>

View File

@@ -216,7 +216,7 @@ def build_list_page(category=None, developer=None, filter=None):
'''Build page listing available optional items'''
items = MunkiItems.getOptionalInstallItems()
header = u'All items'
header = NSLocalizedString(u'All items', u'AllItemsHeaderText')
page_name = u'category-all.html'
if category == 'all':
category = None
@@ -239,10 +239,11 @@ def build_list_page(category=None, developer=None, filter=None):
category=category, developer=developer, filter=filter)
# make HTML for Categories pop-up menu
all_categories_label = NSLocalizedString(u'All Categories', u'AllCategoriesLabel')
if category:
categories_html = u'<option>All Categories</option>\n'
categories_html = u'<option>%s</option>\n' % all_categories_label
else:
categories_html = u'<option selected>All Categories</option>\n'
categories_html = u'<option selected>%s</option>\n' % all_categories_label
for item in sorted(category_list):
if item == category:
@@ -342,7 +343,7 @@ def build_list_page_items_html(category=None, developer=None, filter=None):
def build_categories_page():
'''Build page showing available categories and some items in each one'''
all_items = MunkiItems.getOptionalInstallItems()
header = u'Categories'
header = NSLocalizedString(u'Categories', u'CategoriesHeaderText')
page_name = u'categories.html'
category_list = []
for item in all_items:
@@ -350,8 +351,9 @@ def build_categories_page():
category_list.append(item['category'])
item_html = build_category_items_html()
categories_html = u'<option selected>All Categories</option>\n'
all_categories_label = NSLocalizedString(u'All Categories', u'AllCategoriesLabel')
categories_html = u'<option selected>%s</option>\n' % all_categories_label
for item in sorted(category_list):
categories_html += u'<option>%s</option>\n' % item

View File

@@ -290,10 +290,10 @@ class MSUStatusWindowController(NSObject):
self.window, self, self.restartAlertDidEnd_returnCode_contextInfo_, nil)
def setMessage_(self, messageText):
self.messageFld.setStringValue_(messageText)
self.messageFld.setStringValue_(NSLocalizedString(messageText, None))
def setDetail_(self, detailText):
self.detailFld.setStringValue_(detailText)
self.detailFld.setStringValue_(NSLocalizedString(detailText, None))
def getStopBtnState(self):
return self.stopBtnState