Commit description: Moved update dialog from listview to mainwindow
authorKaj Wallin <kaj.wallin@ixonos.com>
Mon, 26 Apr 2010 10:41:44 +0000 (13:41 +0300)
committerKaj Wallin <kaj.wallin@ixonos.com>
Mon, 26 Apr 2010 10:41:44 +0000 (13:41 +0300)
Reviewed by:

src/engine/engine.cpp
src/ui/listviewscreen.cpp
src/ui/listviewscreen.h
src/ui/mainwindow.cpp
src/ui/mainwindow.h

index 625b873..e356fca 100644 (file)
 SituareEngine::SituareEngine(QMainWindow *parent)
     : QObject(parent)
 {
-    m_loggedIn = false;
-    m_facebookAuthenticator = new FacebookAuthentication();
-
     m_networkManager = new QNetworkAccessManager;
     m_situareService = new SituareService(this,m_networkManager);
+
+    m_loggedIn = false;
+    m_facebookAuthenticator = new FacebookAuthentication();
     connect(m_facebookAuthenticator, SIGNAL(credentialsReady()), this, SLOT(loginOk()));
     connect(m_facebookAuthenticator, SIGNAL(userExit()), this, SLOT(loginScreenClosed()));
 }
index 8e62d0a..5080439 100644 (file)
@@ -42,7 +42,7 @@ ListViewScreen::ListViewScreen(QWidget *parent)
     m_personalInfo->setTime("1 hour ago");
     m_personalInfo->setAddress("Kiviharjunlenkki 1E, 91910 Oulu");
 
-    m_locationDialog = new UpdateLocationDialog(this);
+
     m_widgetProxy = new QGraphicsProxyWidget();
     m_widgetProxy->setWidget(m_personalInfo);
 
@@ -123,5 +123,5 @@ ListViewScreen::~ListViewScreen()
 void ListViewScreen::updateMessage()
 {
    qDebug() << __PRETTY_FUNCTION__;
-   m_locationDialog->exec();
+//   m_locationDialog->exec();
 }
index 2d746ab..b2cfc3d 100644 (file)
@@ -27,7 +27,7 @@
 #include <QtGui>
 #include "infotab.h"
 #include "pixmap.h"
-#include "updatelocation/updatelocationdialog.h"
+
 
 /**
 * @brief List View class. Used for displaying List of friends
@@ -62,9 +62,11 @@ public slots:
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
+public:
+    InfoTab *m_personalInfo;    ///< Personal info tab
+
 private:
     QVBoxLayout *m_vbox;    ///< Holds the graphics view
-    InfoTab *m_personalInfo;    ///< Personal info tab
     Pixmap *m_arrowbutton;    ///< Button which reveals/hides the info tab when pressed
     QGraphicsProxyWidget *m_widgetProxy; ///< Embeds InfoTab to graphics view
     QAbstractTransition *m_trans1;    ///< Animation transition from hidden state to visible
@@ -73,7 +75,6 @@ private:
     QPropertyAnimation *m_anim2;    ///< Animation for arrowbutton from hidden to visible
     QPropertyAnimation *m_anim3;    ///< Animation for infotab from visible to hidden
     QPropertyAnimation *m_anim4;    ///< Animation for arrowbutton from visible to hidden
-    UpdateLocationDialog *m_locationDialog; ///< Message dialog
 };
 
 #endif // LISTVIEWTAB_H
index 0989d00..3fec4ce 100644 (file)
@@ -43,10 +43,13 @@ MainWindow::MainWindow(QWidget *parent)
     connect(m_situareEngine, SIGNAL(engine_showMainWindow()), this, SLOT(show()));
     connect(m_situareEngine, SIGNAL(engine_closeMainWindow()), this, SLOT(close()));
 
+    m_locationDialog = new UpdateLocationDialog(this);
 //    connect(m_listViewScreen->m_personalInfo,
 //            SIGNAL(launchUpdateFriendsStatus()),
 //            m_situareEngine,
 //            SLOT(updateFriendsList()));
+    connect(m_listViewScreen->m_personalInfo,SIGNAL(launchMessageUpdate()),
+            this,SLOT(openLocationUpdateDialog()));
 
     m_situareEngine->start();
 }
@@ -117,3 +120,8 @@ void MainWindow::switchView(int nextIndex)
             break;
     }
 }
+void MainWindow::openLocationUpdateDialog()
+{
+    qDebug() << __PRETTY_FUNCTION__;
+    m_locationDialog->exec();
+}
index 742ca1b..4a94811 100644 (file)
@@ -34,6 +34,7 @@
 #include "engine/engine.h"
 #include "listviewscreen.h"
 #include "mapviewscreen.h"
+#include "updatelocation/updatelocationdialog.h"
 
 class QLabel;
 class QStackedWidget;
@@ -93,7 +94,7 @@ private:
     void switchView(int);
 
 private slots:
-
+    void openLocationUpdateDialog();
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
@@ -107,6 +108,8 @@ private:
     QAction *m_toListViewAct; ///< Action to trigger switch to list view
     QAction *m_toMapViewAct; ///< Action to trigger switch to map view
     QMenu *m_viewMenu; ///< Object that hold the view menu items
+
+    UpdateLocationDialog *m_locationDialog; ///< Message dialog
 };
 
 #endif // MAINWINDOW_H