contactengine/mainwindow.cpp
changeset 34 93c5a58496b6
parent 30 33e489bb7487
child 37 1ced6e446fd4
--- a/contactengine/mainwindow.cpp	Mon Aug 16 15:57:18 2010 -0700
+++ b/contactengine/mainwindow.cpp	Wed Aug 18 16:39:30 2010 -0700
@@ -13,6 +13,8 @@
     ui(new Ui::MainWindow)
 {
     ui->setupUi(this);
+    this->createMenus();
+
     this->ce = new ContactsEngine(this);
 
     connect(this->ce, SIGNAL(errorOccurred(QString)),
@@ -26,11 +28,20 @@
     ui->comboBox->addItems(this->ce->dataSources());
     ui->listView->setModel(this->ce);
 
-    this->createMenus();
+    this->details = new DetailsGV(this,ui->graphicsView);
+    connect(this->details,SIGNAL(closeMe()),this,SLOT(close()));
+    connect(this->details,SIGNAL(backToList()),this, SLOT(displayList()));
+
+    ui->stackedWidget->setCurrentIndex(MainWindow::EListPage);
+
 }
 
 void MainWindow::createMenus()
     {
+        detailsAction = new QAction(tr("&Details"),this);
+        menuBar()->addAction(detailsAction);
+        connect(detailsAction, SIGNAL(triggered()),this, SLOT(displayDetails()));
+
         verAction = new QAction(tr("&Version"),this);
         menuBar()->addAction(verAction);
         connect(verAction, SIGNAL(triggered()),this, SLOT(displayVersion()));
@@ -40,6 +51,16 @@
         connect(exitAction, SIGNAL(triggered()),this, SLOT(close()));
     }
 
+void MainWindow::displayDetails()
+{
+    ui->stackedWidget->setCurrentIndex(MainWindow::EDetailsGV);
+}
+
+void MainWindow::displayList()
+{
+    ui->stackedWidget->setCurrentIndex(MainWindow::EListPage);
+}
+
 void MainWindow::displayVersion()
 {
     QMessageBox::information(this,"Qt Version", qVersion());