--- 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 <QComboBox>
+#include <QMenuBar>
#include <QMessageBox>
#include <QDebug>
@@ -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;
}
--- 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;
};