mirror of
https://github.com/munki/munki.git
synced 2026-04-24 05:49:42 -05:00
Add support to Managed Software Center.app for InstallRequiresLogout preference.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user