Clear posted Notification Center notifications when updates.html is displayed; no matter the mechanism

This commit is contained in:
Greg Neagle
2017-04-21 13:28:08 -05:00
parent 72b719c004
commit e5a3fa419a

View File

@@ -620,6 +620,11 @@ class MSCMainWindowController(NSWindowController):
NSURL.fileURLWithPath_(html_file),
NSURLRequestReloadIgnoringLocalCacheData, 10)
self.webView.mainFrame().loadRequest_(request)
if url_fragment == 'updates.html':
# clear all earlier update notifications
NSUserNotificationCenter.defaultUserNotificationCenter(
).removeAllDeliveredNotifications()
def setNoPageCache(self):
'''We disable the back/forward page cache because
@@ -1214,8 +1219,6 @@ class MSCMainWindowController(NSWindowController):
'''Called by Navigate menu item'''
self.load_page('updates.html')
self._alertedUserToOutstandingUpdates = True
# clear all earlier update notifications
NSUserNotificationCenter.defaultUserNotificationCenter().removeAllDeliveredNotifications()
@IBAction
def softwareToolbarButtonClicked_(self, sender):