Clear entry line when charging a new quiz
[qquiz] / src / quiz.cpp
index 967c896..311ca13 100644 (file)
@@ -31,15 +31,21 @@ question::~question() {
 
 quiz::quiz() : current(NULL), subset(0), correct(0)  {
        QAction *choose;
+       QAction *about;
 
        window = new QWidget();
-       window->setWindowTitle(QApplication::translate("Qtquiz", "Qtquiz"));
+       window->setWindowTitle(QApplication::translate("Qquiz", "Qquiz"));
 
        menu = new QMenuBar(window);
        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->resize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
        window->show();
 
        retrieve_quizzes();
@@ -112,6 +118,7 @@ void quiz::choose_quiz() {
                        questions.clear();
                        subset = 0;
                        correct = 0;
+                       line->clear();
                } else {
                        init_gui();
                }
@@ -438,3 +445,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);
+}
+