Subversion Repositories ExamClock

Rev

Blame | Last modification | View Log | RSS feed

#-----------------------------------------------------------------------------
# Name:        mainwindow.py
# Purpose:
#
# Author:      Ron Wellsted
#
# Created:     2015-10-13
# Copyright:   (c) 2015
# Licence:     GPL 3.0
#-----------------------------------------------------------------------------
# Date      Author          Modification
#-----------------------------------------------------------------------------
# -*- coding: utf-8 -*-
from PyQt4 import uic, QtGui
from PyQt4.QtCore import pyqtSlot

(Ui_MainWindow, QMainWindow) = uic.loadUiType('mainwindow.ui')

class MainWindow (QMainWindow):
    """MainWindow inherits QMainWindow"""
    _ini = None

    def __init__ (self, parent = None):
        QMainWindow.__init__(self, parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

    def closeEvent(self, event):
        if QtGui.QMessageBox.question(self, 'Confirmation', 'Close application ?', \
                QtGui.QMessageBox.Yes, QtGui.QMessageBox.No) != QtGui.QMessageBox.Yes:
            event.ignore()
        else:
            event.accept()

    @pyqtSlot()
    def slotHelpAbout(self):
        from HelpAbout import HelpAbout
        dlg = HelpAbout(self)
        dlg.exec_()