Bug fix: Don't close program when closing a window while main window is

minimized
This commit is contained in:
Kiooeht 2014-01-11 00:19:14 -08:00
parent e29791402d
commit be901f46e8
2 changed files with 9 additions and 9 deletions

View file

@ -35,8 +35,6 @@ Bugs
* Closing a timeclone doesn't actually cease for everyone else
* Kill Zalgo
* Random invisible, tiny links to last link at end of every message
* Clicking link to invite-only memo crashes
* Close when banned from memo when main PC window minimized
* Chums not appearing on chumroll when initals are the same? (bS)
* Recognize IRC 471, 473, 474 and 475
* memo links aren't case sensitive

View file

@ -982,10 +982,11 @@ class TrollSlumWindow(QtGui.QFrame):
unblockChumSignal = QtCore.pyqtSignal(QtCore.QString)
class PesterWindow(MovingWindow):
def __init__(self, options, parent=None):
def __init__(self, options, parent=None, app=None):
MovingWindow.__init__(self, parent,
(QtCore.Qt.CustomizeWindowHint |
QtCore.Qt.FramelessWindowHint))
self.app = app
self.convos = CaseInsensitiveDict()
self.memos = CaseInsensitiveDict()
self.tabconvo = None
@ -1056,7 +1057,7 @@ class PesterWindow(MovingWindow):
exitaction = QtGui.QAction(self.theme["main/menus/client/exit"], self)
self.exitaction = exitaction
self.connect(exitaction, QtCore.SIGNAL('triggered()'),
self, QtCore.SLOT('close()'))
self.app, QtCore.SLOT('quit()'))
userlistaction = QtGui.QAction(self.theme["main/menus/client/userlist"], self)
self.userlistaction = userlistaction
self.connect(userlistaction, QtCore.SIGNAL('triggered()'),
@ -2472,7 +2473,7 @@ class PesterWindow(MovingWindow):
self, QtCore.SLOT('closeToTray()'));
elif old == 2: # quit
self.disconnect(button, QtCore.SIGNAL('clicked()'),
self, QtCore.SLOT('close()'));
self.app, QtCore.SLOT('quit()'));
if setting == 0: # minimize to taskbar
self.connect(button, QtCore.SIGNAL('clicked()'),
@ -2482,7 +2483,7 @@ class PesterWindow(MovingWindow):
self, QtCore.SLOT('closeToTray()'));
elif setting == 2: # quit
self.connect(button, QtCore.SIGNAL('clicked()'),
self, QtCore.SLOT('close()'));
self.app, QtCore.SLOT('quit()'));
@QtCore.pyqtSlot()
def themeSelectOverride(self):
@ -2704,6 +2705,7 @@ class MainProgram(QtCore.QObject):
QtCore.QObject.__init__(self)
self.app = QtGui.QApplication(sys.argv)
self.app.setApplicationName("Pesterchum 3.14")
self.app.setQuitOnLastWindowClosed(False)
options = self.oppts(sys.argv[1:])
@ -2716,7 +2718,7 @@ class MainProgram(QtCore.QObject):
print "Warning: No sound! %s" % (e)
else:
print "Warning: No sound!"
self.widget = PesterWindow(options)
self.widget = PesterWindow(options, app=self.app)
self.widget.show()
self.trayicon = PesterTray(PesterIcon(self.widget.theme["main/icon"]), self.widget, self.app)
@ -2738,7 +2740,7 @@ class MainProgram(QtCore.QObject):
self.widget, QtCore.SLOT('showMinimized()'))
exitAction = QtGui.QAction("EXIT", self)
self.trayicon.connect(exitAction, QtCore.SIGNAL('triggered()'),
self.widget, QtCore.SLOT('close()'))
self.app, QtCore.SLOT('quit()'))
self.traymenu.addAction(miniAction)
self.traymenu.addAction(exitAction)
@ -2951,7 +2953,7 @@ Click this message to never see this again.")
widget.loadingscreen = LoadingScreen(widget)
widget.loadingscreen.loadinglabel.setText(msg)
self.connect(widget.loadingscreen, QtCore.SIGNAL('rejected()'),
widget, QtCore.SLOT('close()'))
widget.app, QtCore.SLOT('quit()'))
self.connect(self.widget.loadingscreen, QtCore.SIGNAL('tryAgain()'),
self, QtCore.SLOT('tryAgain()'))
if hasattr(self, 'irc') and self.irc.registeredIRC: