# class for main window
import PyQt4
+import sys
+
import biacv_mainwindow_ui as bui
import biacv_lang as lang
import biacv_data as data
self.ismodified = False
self.setWindowTitle ("BiaCV - untitled")
+ # on window closing
+ def closeEvent (self, event):
+ if self.ismodified is True:
+ ans = PyQt4.QtGui.QMessageBox.question (self, lang.CONFIRM, lang.CONFIRM_DISCARD_SAVE,
+ PyQt4.QtGui.QMessageBox.Yes, PyQt4.QtGui.QMessageBox.No)
+ # ignore event if not confirmed
+ if ans <> PyQt4.QtGui.QMessageBox.Yes:
+ event.ignore ()
+
+ # on file exit
+ def on_exit (self):
+ # call the close event
+ self.close()
+
# function to open a file
def on_file_open (self):
# if modified, confirm