From: Harishankar Date: Tue, 6 Dec 2011 05:12:17 +0000 (+0530) Subject: File Save As functionality implemented X-Git-Url: https://harishankar.org/repos/?a=commitdiff_plain;h=41ec06537e95d26566994964b79ad50afa232be5;p=biacv.git File Save As functionality implemented Completed the File -> Save As... functionality in the GUI. --- diff --git a/biacv_mainwindow.py b/biacv_mainwindow.py index 4a98c2d..681469d 100644 --- a/biacv_mainwindow.py +++ b/biacv_mainwindow.py @@ -62,6 +62,19 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): # set the window title self.setWindowTitle ("BiaCV - " + self.currentfile) + # function to save a file as a new document + def on_file_save_as (self): + savefilename = PyQt4.QtGui.QFileDialog.getSaveFileName (self, + lang.SAVE_TITLE) + + # if save file name is not none + if savefilename <> "": + mydata = self.get_document_data () + mydata.save_data (savefilename) + self.ismodified = False + self.currentfile = savefilename + self.setWindowTitle ("BiaCV - " + self.currentfile) + # function to save a file def on_file_save (self): # only save modified file @@ -75,7 +88,7 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow): if savefilename <> "": mydata = self.get_document_data () - mydata.save_data (self.currentfile) + mydata.save_data (savefilename) self.ismodified = False self.currentfile = savefilename self.setWindowTitle ("BiaCV - " + self.currentfile) diff --git a/biacv_mainwindow.ui b/biacv_mainwindow.ui index 9670324..9be86cd 100644 --- a/biacv_mainwindow.ui +++ b/biacv_mainwindow.ui @@ -1025,8 +1025,8 @@ on_add_education() - 426 - 189 + 70 + 98 730 @@ -1041,8 +1041,8 @@ on_delete_education() - 658 - 189 + 100 + 98 728 @@ -1058,7 +1058,7 @@ 100 - 217 + 102 726 @@ -1073,8 +1073,8 @@ on_update_education() - 579 - 189 + 85 + 98 728 @@ -1090,7 +1090,7 @@ 100 - 217 + 102 729 @@ -1105,8 +1105,8 @@ on_change_currentemployment() - 328 - 136 + 80 + 88 728 @@ -1121,8 +1121,8 @@ on_add_profession() - 309 - 216 + 61 + 99 729 @@ -1138,7 +1138,7 @@ 99 - 244 + 103 727 @@ -1154,7 +1154,7 @@ 99 - 244 + 103 729 @@ -1169,8 +1169,8 @@ on_delete_profession() - 596 - 216 + 99 + 99 729 @@ -1185,8 +1185,8 @@ on_update_profession() - 453 - 216 + 80 + 99 726 @@ -1201,8 +1201,8 @@ on_add_skill() - 207 - 234 + 51 + 96 730 @@ -1217,8 +1217,8 @@ on_delete_skill() - 566 - 234 + 99 + 96 728 @@ -1234,7 +1234,7 @@ 99 - 261 + 102 730 @@ -1250,7 +1250,7 @@ 99 - 261 + 102 726 @@ -1265,8 +1265,8 @@ on_update_skill() - 386 - 234 + 75 + 96 728 @@ -1281,8 +1281,8 @@ on_add_lang() - 468 - 132 + 107 + 110 729 @@ -1297,8 +1297,8 @@ on_delete_lang() - 656 - 132 + 107 + 110 733 @@ -1313,8 +1313,8 @@ on_select_lang() - 94 - 160 + 98 + 110 730 @@ -1329,8 +1329,8 @@ on_select_lang() - 94 - 160 + 98 + 110 730 @@ -1345,8 +1345,8 @@ on_update_lang() - 591 - 132 + 107 + 110 729 @@ -1634,7 +1634,7 @@ 99 - 101 + 89 0 @@ -1649,8 +1649,8 @@ on_document_modified() - 86 - 297 + 90 + 102 2 @@ -1665,8 +1665,8 @@ on_document_modified() - 90 - 333 + 94 + 103 1 @@ -1722,6 +1722,22 @@ + + actionSave_As + triggered() + biacv_mainwindow + on_file_save_as() + + + -1 + -1 + + + 364 + 248 + + + on_add_education() @@ -1745,5 +1761,6 @@ on_file_new() on_file_save() on_file_open() + on_file_save_as() diff --git a/biacv_mainwindow_ui.py b/biacv_mainwindow_ui.py index 5b34a9b..504b102 100644 --- a/biacv_mainwindow_ui.py +++ b/biacv_mainwindow_ui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'biacv_mainwindow.ui' # -# Created: Mon Dec 5 20:12:17 2011 +# Created: Tue Dec 6 10:37:09 2011 # by: PyQt4 UI code generator 4.8.6 # # WARNING! All changes made in this file will be lost! @@ -609,6 +609,7 @@ class Ui_biacv_mainwindow(object): QtCore.QObject.connect(self.action_New, QtCore.SIGNAL(_fromUtf8("triggered()")), biacv_mainwindow.on_file_new) QtCore.QObject.connect(self.action_Save, QtCore.SIGNAL(_fromUtf8("triggered()")), biacv_mainwindow.on_file_save) QtCore.QObject.connect(self.action_Open, QtCore.SIGNAL(_fromUtf8("triggered()")), biacv_mainwindow.on_file_open) + QtCore.QObject.connect(self.actionSave_As, QtCore.SIGNAL(_fromUtf8("triggered()")), biacv_mainwindow.on_file_save_as) QtCore.QMetaObject.connectSlotsByName(biacv_mainwindow) def retranslateUi(self, biacv_mainwindow):