Added file filter for BiaCV files
authorHarishankar <v.harishankar@gmail.com>
Sat, 10 Dec 2011 04:58:32 +0000 (10:28 +0530)
committerHarishankar <v.harishankar@gmail.com>
Sat, 10 Dec 2011 04:58:32 +0000 (10:28 +0530)
Added a file filter for save and open dialog for BiaCV files.
The default extension is .biacv

biacv_lang.py
biacv_mainwindow.py

index cbac4ac..c9cf4e4 100644 (file)
@@ -17,4 +17,6 @@ ABOUT_TITLE = "About BiaCV"
 ABOUT_TEXT = """BiaCV - A resume creator/editor
 
 Copyright 2011 V.Harishankar <hari@harishankar.net>.
 ABOUT_TEXT = """BiaCV - A resume creator/editor
 
 Copyright 2011 V.Harishankar <hari@harishankar.net>.
-Licensed under the GNU GPL v3."""
\ No newline at end of file
+Licensed under the GNU GPL v3."""
+
+BIACV_FILE_FILTER = "BiaCV document(*.biacv);;All files(*.*)"
\ No newline at end of file
index f9e79b3..a68652c 100644 (file)
@@ -78,7 +78,8 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                                return
 
                # open file dialog
                                return
 
                # open file dialog
-               openfilename = PyQt4.QtGui.QFileDialog.getOpenFileName (self, lang.OPEN_TITLE)
+               openfilename = PyQt4.QtGui.QFileDialog.getOpenFileName (self, lang.OPEN_TITLE,
+                               filter = lang.BIACV_FILE_FILTER)
                # if no open file name then return
                if openfilename == "":
                        return
                # if no open file name then return
                if openfilename == "":
                        return
@@ -121,7 +122,7 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
        # function to save a file as a new document
        def on_file_save_as (self):
                savefilename = PyQt4.QtGui.QFileDialog.getSaveFileName (self,
        # function to save a file as a new document
        def on_file_save_as (self):
                savefilename = PyQt4.QtGui.QFileDialog.getSaveFileName (self,
-                       lang.SAVE_TITLE)
+                       lang.SAVE_TITLE, filter=lang.BIACV_FILE_FILTER)
 
                # if save file name is not none
                if savefilename <> "":
 
                # if save file name is not none
                if savefilename <> "":
@@ -140,7 +141,7 @@ class Biacv_mainwindow (PyQt4.QtGui.QMainWindow, bui.Ui_biacv_mainwindow):
                # if no current file get file name from file save dialog
                if self.currentfile is None:
                        savefilename = PyQt4.QtGui.QFileDialog.getSaveFileName (self,
                # if no current file get file name from file save dialog
                if self.currentfile is None:
                        savefilename = PyQt4.QtGui.QFileDialog.getSaveFileName (self,
-                               lang.SAVE_TITLE)
+                               lang.SAVE_TITLE, filter=lang.BIACV_FILE_FILTER)
 
                        if savefilename <> "":
                                mydata = self.get_document_data ()
 
                        if savefilename <> "":
                                mydata = self.get_document_data ()