diff --git a/memos.py b/memos.py index ac20036..88d704d 100644 --- a/memos.py +++ b/memos.py @@ -1032,7 +1032,11 @@ class PesterMemo(PesterConvo): for b in msgbox.buttons(): if msgbox.buttonRole(b) == QtGui.QMessageBox.AcceptRole: # We found the 'OK' button, set it as the default + b.setDefault(True) b.setAutoDefault(True) + # Actually set it as the selected option, since we're + # already stealing focus + b.setFocus() break ret = msgbox.exec_() if ret == QtGui.QMessageBox.Ok: diff --git a/menus.py b/menus.py index 98e7813..20ba529 100644 --- a/menus.py +++ b/menus.py @@ -1763,6 +1763,9 @@ class LoadingScreen(QtGui.QDialog): layout_1.addWidget(self.ok) self.layout.addLayout(layout_1) self.setLayout(self.layout) + # Help reduce the number of accidental Pesterchum closures... :| + self.cancel.setDefault(False) + self.ok.setDefault(True) def hideReconnect(self): self.ok.hide() diff --git a/pesterchum.py b/pesterchum.py index e816388..4697fb3 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -2058,8 +2058,12 @@ class PesterWindow(MovingWindow): # Find the Cancel button and make it default for b in msgbox.buttons(): if msgbox.buttonRole(b) == QtGui.QMessageBox.RejectRole: - # We found the 'Cancel' button, set it as the default + # We found the 'OK' button, set it as the default + b.setDefault(True) b.setAutoDefault(True) + # Actually set it as the selected option, since we're + # already stealing focus + b.setFocus() break ret = msgbox.exec_() if ret == QtGui.QMessageBox.Ok: