def reject(self): """ Run when the dialog is canceled. """ LanguageManager.auto_language = True LanguageManager.set_language(False, False) return QtGui.QDialog.reject(self)
def accept(self): """ Run when the dialog is OKed. """ # It's the first row so must be Automatic if self.language_combo_box.currentIndex() == 0: LanguageManager.auto_language = True LanguageManager.set_language(False, False) else: LanguageManager.auto_language = False action = create_action(None, self.language_combo_box.currentText()) LanguageManager.set_language(action, False) return QtGui.QDialog.accept(self)