Hook up dialog and get working

This commit is contained in:
Tim Bentley 2011-03-02 17:53:26 +00:00
parent a10ad04254
commit b34726e790
2 changed files with 11 additions and 11 deletions

View File

@ -287,7 +287,7 @@ def main():
FirstTimeForm().exec_()
if not options.no_error_form:
sys.excepthook = app.hookException
sys.exit()#(app.run())
sys.exit(app.run())
if __name__ == u'__main__':
"""

View File

@ -39,6 +39,7 @@ class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
QtGui.QDialog.__init__(self, parent)
self.setupUi(self)
self.qmList = LanguageManager.get_qm_list()
self.LanguageComboBox.addItem(u'Automatic')
for key in sorted(self.qmList.keys()):
self.LanguageComboBox.addItem(key)
@ -49,19 +50,18 @@ class FirstTimeLanguageForm(QtGui.QDialog, Ui_FirstTimeLanguageDialog):
return QtGui.QDialog.exec_(self)
def accept(self):
print "Accept"
# if self.autoLanguageCheckBox.checkState() == QtCore.Qt.Checked:
# LanguageManager.auto_language = True
# LanguageManager.set_language(False, False)
# else:
# LanguageManager.auto_language = False
# action = QtGui.QAction(None)
# action.setObjectName(unicode(self.LanguageComboBox.currentText()))
# LanguageManager.set_language(action, False)
# It's the first row so must be Automatic
if self.LanguageComboBox.currentIndex() == 0:
LanguageManager.auto_language = True
LanguageManager.set_language(False, False)
else:
LanguageManager.auto_language = False
action = QtGui.QAction(None)
action.setObjectName(unicode(self.LanguageComboBox.currentText()))
LanguageManager.set_language(action, False)
return QtGui.QDialog.accept(self)
def reject(self):
print "Reject"
LanguageManager.auto_language = True
LanguageManager.set_language(False, False)
return QtGui.QDialog.reject(self)