forked from openlp/openlp
Fix bug #1247661 by restoring the main window when it was previously minimized and user switch to OpenLP from another app.
This commit is contained in:
parent
109030c2c2
commit
252701451d
@ -220,8 +220,15 @@ class OpenLP(QtGui.QApplication):
|
|||||||
log.debug(u'Got open file event for %s!', file_name)
|
log.debug(u'Got open file event for %s!', file_name)
|
||||||
self.args.insert(0, unicode(file_name))
|
self.args.insert(0, unicode(file_name))
|
||||||
return True
|
return True
|
||||||
else:
|
# Mac OS X should restore app window when user clicked on the OpenLP icon
|
||||||
return QtGui.QApplication.event(self, event)
|
# 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):
|
def set_up_logging(log_path):
|
||||||
|
Loading…
Reference in New Issue
Block a user