Workaround for OSX for the bug #1247661 with the dock icon click.

bzr-revno: 2189
This commit is contained in:
Martin Zibricky 2014-02-01 08:15:47 +00:00 committed by Tim Bentley
commit dc3795212b
1 changed files with 9 additions and 2 deletions

View File

@ -220,8 +220,15 @@ class OpenLP(QtGui.QApplication):
log.debug(u'Got open file event for %s!', file_name)
self.args.insert(0, unicode(file_name))
return True
else:
return QtGui.QApplication.event(self, event)
# Mac OS X should restore app window when user clicked on the OpenLP icon
# in the Dock bar. However, OpenLP constists of multiple windows and this
# does not work. This workaround fixes that.
# The main OpenLP window is restored when it was previously minimized.
elif event.type() == QtCore.QEvent.ApplicationActivate:
if sys.platform.startswith('darwin') and self.mainWindow.isMinimized():
self.mainWindow.showNormal()
return True
return QtGui.QApplication.event(self, event)
def set_up_logging(log_path):