X-Git-Url: https://harishankar.org/repos/?p=biacv.git;a=blobdiff_plain;f=biacv_mainwindow.py;fp=biacv_mainwindow.py;h=1bd6563db48aa310aa4909e41fc6dec9ad17ff56;hp=0f0f9ada407a04206497ab8b9bad1d63c8c52632;hb=6f0fce4b0186aea9896ac6f30b2385bfba3771d2;hpb=1cba1db3870933e5cb54854806d179a7ecb1f7f8 diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 0f0f9ad..1bd6563 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -10,6 +10,13 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): PyQt4.QtGui.QMainWindow.__init__ (self) self.setupUi (self) self.currentfile = None + self.ismodified = False + + # when the document is modified + def on_document_modified (self): + # set the document modified flag + self.ismodified = True + print "True" # update a language in the list of languages def on_update_lang (self): @@ -28,6 +35,9 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): selitem.setText (2, str (self.canreadwrite.isChecked ())) selitem.setText (3, str (self.isproficient.isChecked ())) + # modified the document + self.ismodified = True + # selecting a language from the list of languages def on_select_lang (self): # set the language fields from the selected item @@ -48,6 +58,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.languageslist.takeTopLevelItem (self.languageslist.indexOfTopLevelItem (item)) self.reset_language_fields () + # set the modified flag + self.ismodified = True # add a language to the list of languages known def on_add_lang (self): @@ -66,6 +78,9 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.languageslist.addTopLevelItem (langitem) self.reset_language_fields () + # set the modified flag + self.ismodified = True + # set the language fields from the selected item def set_language_fields (self): selitems = self.languageslist.selectedItems () @@ -98,6 +113,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): selitem.setText (0, self.skillsettitle.text ()) selitem.setText (1, self.skilldescription.toPlainText ()) + # set the modified flag + self.ismodified = True # selecting a skill from the list event def on_select_skill (self): @@ -129,6 +146,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.skillslist.takeTopLevelItem (self.skillslist.indexOfTopLevelItem (item)) self.reset_skillset_fields () + # set the modified flag + self.ismodified = True # add skill set button is clicked def on_add_skill (self): @@ -144,6 +163,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): ) self.skillslist.addTopLevelItem (skillitem) self.reset_skillset_fields () + # set the modified flag + self.ismodified = True # clear the skill set fields def reset_skillset_fields (self): @@ -178,6 +199,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): selitem.setText (2, leavedatestr) selitem.setText (3, self.organization.text ()) selitem.setText (4, self.additionalinfo.text ()) + # set the modified flag + self.ismodified = True # delete professional history button is clicked def on_delete_profession (self): @@ -194,6 +217,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): for item in selitems: self.professionlist.takeTopLevelItem (self.professionlist.indexOfTopLevelItem (item)) self.reset_profession_fields () + # set the modified flag + self.ismodified = True # add professional history button is clicked def on_add_profession (self): @@ -224,6 +249,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.professionlist.addTopLevelItem (professionitem) self.reset_profession_fields () + # set the modified flag + self.ismodified = True # when selection of profession list is changed def on_select_profession (self): @@ -279,6 +306,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): for item in selitems: self.educationlist.takeTopLevelItem (self.educationlist.indexOfTopLevelItem (item)) self.reset_education_fields () + # set the modified flag + self.ismodified = True # selection is changed def on_select_education (self): @@ -303,6 +332,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): selitem.setText (3, self.university.text ()) selitem.setText (4, self.grade.text ()) selitem.setText (5, str (self.percentage.value ())) + # set the modified flag + self.ismodified = True # add educational qualification button def on_add_education (self): @@ -321,6 +352,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): self.educationlist.addTopLevelItem (educationitem) # clear the fields self.reset_education_fields () + # set the modified flag + self.ismodified = True # set fields in the education tab from current selected item def set_education_fields (self):