Add about dialog
[qquiz] / src / quiz.cpp
index 967c896..b0e3eaf 100644 (file)
@@ -31,6 +31,7 @@ question::~question() {
 
 quiz::quiz() : current(NULL), subset(0), correct(0)  {
        QAction *choose;
+       QAction *about;
 
        window = new QWidget();
        window->setWindowTitle(QApplication::translate("Qtquiz", "Qtquiz"));
@@ -39,7 +40,11 @@ quiz::quiz() : current(NULL), subset(0), correct(0)  {
        choose = new QAction("Open", window);
        QObject::connect(choose, SIGNAL(triggered()), this, SLOT(choose_quiz()));
 
+       about = new QAction("About", window);
+       QObject::connect(about, SIGNAL(triggered()), this, SLOT(about()));
+
        menu->addAction(choose);
+       menu->addAction(about);
        window->show();
 
        retrieve_quizzes();
@@ -438,3 +443,17 @@ void quiz::end() {
                }
        }
 }
+
+void quiz::about() {
+       QString message = "";
+       QString version;
+
+       message.append(APP_NAME);
+       message.append("-");
+       version = version.setNum(APP_VERSION);
+       message.append(version);
+       message.append("\n by ");
+       message.append(AUTHOR);
+       QMessageBox::about ( window, tr("About"), message);
+}
+