Make the reconnect dialog require a pause before it's allowed to quit
This commit is contained in:
parent
195b59f29e
commit
40a818a22f
1 changed files with 16 additions and 1 deletions
17
menus.py
17
menus.py
|
@ -1766,11 +1766,26 @@ class LoadingScreen(QtGui.QDialog):
|
|||
# Help reduce the number of accidental Pesterchum closures... :|
|
||||
self.cancel.setDefault(False)
|
||||
self.ok.setDefault(True)
|
||||
self.ok.setFocus()
|
||||
self.timer = None
|
||||
|
||||
def hideReconnect(self):
|
||||
def hideReconnect(self, safe=True):
|
||||
self.ok.hide()
|
||||
if safe:
|
||||
# Set a timer so that we don't immediately disconnect anyway.
|
||||
self.cancel.setEnabled(False)
|
||||
# A few seconds should be enough.
|
||||
self.timer = QtCore.QTimer.singleShot(2000, self,
|
||||
QtCore.SLOT('enableQuit()'))
|
||||
|
||||
def showReconnect(self):
|
||||
self.ok.show()
|
||||
# Again...stop accidental closes.
|
||||
self.ok.setFocus()
|
||||
|
||||
@QtCore.pyqtSlot()
|
||||
def enableQuit(self):
|
||||
self.cancel.setEnabled(True)
|
||||
|
||||
tryAgain = QtCore.pyqtSignal()
|
||||
|
||||
|
|
Loading…
Reference in a new issue