X-Git-Url: https://harishankar.org/repos/?p=biacv.git;a=blobdiff_plain;f=biacv_mainwindow.py;h=801928e9786e8fcf96c336112aae67a04ccd9f0b;hp=6ec4d1ad7f3fcd4fd4fc72514930a2a646d28ebe;hb=af2f737f8a7fd79ae16607a18a0936bb74281caf;hpb=a08089c1801da4caf5126d2d50af02a025b081b7 diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 6ec4d1a..801928e 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -9,6 +9,30 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.setupUi (self) self.currentfile = None + # add a language to the list of languages known + def on_add_lang (self): + # check if the language is set + if self.language.text () == "": + PyQt4.QtGui.QMessageBox.critical (self, "Cannot add", "A required field is missing.") + return + langitem = PyQt4.QtGui.QTreeWidgetItem ( + [ + self.language.text (), + str (self.canspeak.isChecked ()), + str (self.canreadwrite.isChecked ()), + str (self.isproficient.isChecked ()) + ] + ) + self.languageslist.addTopLevelItem (langitem) + self.reset_language_fields () + + # reset the language fields + def reset_language_fields (self): + self.language.setText ("") + self.canspeak.setChecked (True) + self.canreadwrite.setChecked (False) + self.isproficient.setChecked (False) + # update the skill set button event def on_update_skill (self): # get the selected item