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; }