Add support to Managed Software Center.app for InstallRequiresLogout preference.

This commit is contained in:
Greg Neagle
2014-06-18 22:52:59 -07:00
parent 197c15b293
commit ba1108afac
3 changed files with 7 additions and 3 deletions
@@ -260,7 +260,7 @@ class MSUMainWindowController(NSWindowController):
page_url = self.webView.mainFrameURL()
filename = NSURL.URLWithString_(page_url).lastPathComponent()
name = os.path.splitext(filename)[0]
key, p, quoted_value = name.partition('-')
key, p, value = name.partition('-')
if key == 'detail':
# optional item detail page
self.webView.reload_(self)
@@ -138,7 +138,10 @@ def _build_update_list():
def updatesRequireLogout():
'''Return True if any item in the update list requires a logout'''
'''Return True if any item in the update list requires a logout or if
Munki's InstallRequiresLogout preference is true.'''
if munki.installRequiresLogout():
return True
return len([item for item in getUpdateList()
if 'Logout' in item.get('RestartAction', '')]) > 0
@@ -564,7 +564,8 @@ def getRestartActionForUpdateList(update_list):
if [item for item in update_list if 'Restart' in item.get('RestartAction', '')]:
# found at least one item containing 'Restart' in its RestartAction
return NSLocalizedString(u"Restart Required", u"Require Restart message")
if [item for item in update_list if 'Logout' in item.get('RestartAction', '')]:
if ([item for item in update_list if 'Logout' in item.get('RestartAction', '')]
or munki.installRequiresLogout()):
# found at least one item containing 'Logout' in its RestartAction
return NSLocalizedString(u"Logout Required", u"Require Logout message")
else: