# HG changeset patch # User John Kern # Date 1281738831 25200 # Node ID 33e489bb74879022f973bb2bca633a15de89818c # Parent a9f1d0e213846f2d1eb88104849d7beed4013fbb add options menu diff -r a9f1d0e21384 -r 33e489bb7487 contactengine/mainwindow.cpp --- a/contactengine/mainwindow.cpp Fri Aug 13 13:03:12 2010 -0700 +++ b/contactengine/mainwindow.cpp Fri Aug 13 15:33:51 2010 -0700 @@ -1,4 +1,5 @@ #include +#include #include #include @@ -24,11 +25,29 @@ ui->comboBox->addItems(this->ce->dataSources()); ui->listView->setModel(this->ce); + + this->createMenus(); +} + +void MainWindow::createMenus() + { + verAction = new QAction(tr("&Version"),this); + menuBar()->addAction(verAction); + connect(verAction, SIGNAL(triggered()),this, SLOT(displayVersion())); + + exitAction = new QAction(tr("&Exit"),this); + menuBar()->addAction(exitAction); + connect(exitAction, SIGNAL(triggered()),this, SLOT(close())); + } + +void MainWindow::displayVersion() +{ + QMessageBox::information(this,"Qt Version", qVersion()); } void MainWindow::errorOccurred(QString errMsg) { - QMessageBox::warning(this,"Err Routed",errMsg); + QMessageBox::information(this,"Err Routed",errMsg); qDebug() << errMsg << endl; } diff -r a9f1d0e21384 -r 33e489bb7487 contactengine/mainwindow.h --- a/contactengine/mainwindow.h Fri Aug 13 13:03:12 2010 -0700 +++ b/contactengine/mainwindow.h Fri Aug 13 15:33:51 2010 -0700 @@ -15,11 +15,16 @@ public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); + void createMenus(); public slots: void errorOccurred(QString errMsg); + void displayVersion(); + private: + QAction *verAction; + QAction *exitAction; Ui::MainWindow *ui; ContactsEngine *ce; };