Updated some changes to userinfo
authorKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Mon, 17 May 2010 05:30:56 +0000 (08:30 +0300)
committerKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Mon, 17 May 2010 05:30:56 +0000 (08:30 +0300)
src/ui/mainwindow.cpp
src/ui/mainwindow.h
src/ui/mapviewscreen.cpp
src/ui/mapviewscreen.h
src/ui/userinfo.cpp
src/ui/userinfo.h
src/ui/userpanel.cpp
src/ui/userpanel.h

index 46c04d5..25d79fb 100644 (file)
@@ -56,9 +56,9 @@ MainWindow::MainWindow(QWidget *parent)
     m_locationDialog = new UpdateLocationDialog(this);
 
     connect(this, SIGNAL(reverseGeoReady(QString)),
-            m_locationDialog, SLOT(setAddress(QString)));
-    connect(m_locationDialog, SIGNAL(statusUpdate(QString, bool)),
-            this, SIGNAL(statusUpdate(QString, bool)));
+            m_mapViewScreen, SIGNAL(reverseGeoReady(QString)));
+    connect(m_mapViewScreen, SIGNAL(statusUpdate(QString,bool)),
+            this, SIGNAL(statusUpdate(QString,bool)));
 
     connect(this, SIGNAL(userLocationReady(User*)),
             m_mapViewScreen, SIGNAL(userLocationReady(User*)));
@@ -77,6 +77,12 @@ MainWindow::MainWindow(QWidget *parent)
     connect(this, SIGNAL(zoomOutKeyPressed()),
             m_mapViewScreen, SIGNAL(zoomOutKeyPressed()));
 
+    connect(m_mapViewScreen, SIGNAL(requestReverseGeo()),
+            this, SIGNAL(requestReverseGeo()));
+
+    connect(m_mapViewScreen, SIGNAL(refreshUserData()),
+            this, SIGNAL(refreshUserData()));
+
     this->toggleProgressIndicator(true);
 
     grabZoomKeys(true);
@@ -129,14 +135,6 @@ void MainWindow::createMenus()
     m_viewMenu->setObjectName(tr("Menu"));
 }
 
-void MainWindow::openLocationUpdateDialog()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    emit requestReverseGeo();
-    m_locationDialog->exec();
-}
-
 void MainWindow::openSettingsDialog()
 {
     qDebug() << __PRETTY_FUNCTION__;
index d444322..764768d 100644 (file)
@@ -191,12 +191,6 @@ private slots:
     */
     void loadDone(bool done);
 
-    /**
-    * @brief Private slot, which starts UpdateLocationDialog
-    *
-    */
-    void openLocationUpdateDialog();
-
 /*******************************************************************************
  * SIGNALS
  ******************************************************************************/
index 7aeb178..6e32f92 100644 (file)
@@ -88,7 +88,19 @@ MapViewScreen::MapViewScreen(QWidget *parent)
             this, SLOT(locationChanged()));
 
     connect(this, SIGNAL(userLocationReady(User*)),
-            m_userPanel, SLOT(receiveUserData(User*)));
+            m_userPanel, SLOT(userDataReceived(User*)));
+
+    connect(m_userPanel, SIGNAL(requestReverseGeo()),
+            this, SIGNAL(requestReverseGeo()));
+
+    connect(this, SIGNAL(reverseGeoReady(QString)),
+            m_userPanel, SIGNAL(reverseGeoReady(QString)));
+
+    connect(m_userPanel, SIGNAL(statusUpdate(QString,bool)),
+            this, SIGNAL(statusUpdate(QString,bool)));
+
+    connect(m_userPanel, SIGNAL(refreshUserData()),
+            this, SIGNAL(refreshUserData()));
 
     QHBoxLayout *mapViewLayout = new QHBoxLayout;
 
index e5959a3..40c2103 100644 (file)
@@ -114,6 +114,25 @@ signals:
       */
     void zoomOutKeyPressed();
 
+    void requestReverseGeo();
+
+    /**
+    * @brief Signals, when address data is ready
+    *
+    * @param address Street address
+    */
+    void reverseGeoReady(const QString &address);
+
+    /**
+    * @brief Signal Signal for requestLocationUpdate from SituareEngine via MainWindow class
+    *
+    * @param status Status message
+    * @param publish Publish on Facebook
+    */
+    void statusUpdate(const QString &status, const bool &publish);
+
+    void refreshUserData();
+
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
index fa6c507..113bba0 100644 (file)
@@ -82,6 +82,7 @@ UserInfo::UserInfo(QWidget *parent)
 
     m_nameLabel = new QLabel();
     m_nameLabel->setFixedHeight(IMAGE_HEIGHT);
+    m_nameLabel->setAlignment(Qt::AlignHCenter);
 
     m_updatedLabel = new QLabel();
     m_updatedLabel->setWordWrap(true);
@@ -115,9 +116,9 @@ UserInfo::UserInfo(QWidget *parent)
     connect(updateStatusMessageButton,SIGNAL(clicked()),
             this,SLOT(messageUpdate()));
     connect(updateFriendsButton,SIGNAL(clicked()),
-            this,SLOT(updateFriendsStatus()));
+            this, SIGNAL(refreshUserData()));
 
-    setFont(NOKIA_FONT_SMALL);
+    this->setFont(NOKIA_FONT_SMALL);
     m_nameLabel->setFont(NOKIA_FONT_NORMAL);
     QPalette itemPalette = palette();
     itemPalette.setColor(QPalette::Foreground, COLOR_GRAY);
@@ -126,23 +127,19 @@ UserInfo::UserInfo(QWidget *parent)
     namePalette.setColor(QPalette::Foreground, Qt::white);
     m_nameLabel->setPalette(namePalette);
 
-    m_nameLabel->setText("");
-
-    this->setMaximumHeight(300);
+    this->setMinimumHeight(300);
 
     m_backgroundTopImage.load(":/res/images/list_item_top.png");
     m_backgroundMiddleImage.load(":/res/images/list_item_middle.png");
     m_backgroundBottomImage.load(":/res/images/list_item_bottom.png");
 }
 
-
-
 void UserInfo::setUserName(const QString &name)
 {
     qDebug() << __PRETTY_FUNCTION__;
     qDebug() << name;
 
-    m_nameLabel->setText(name);
+//    m_nameLabel->setText(name);
 
 //     shortenTexts();
 }
@@ -161,7 +158,7 @@ void UserInfo::setMessageText(const QString &text)
     if(m_messageText == text)
       return;
     m_messageText = text;
-    m_statusTextLabel->setText(m_messageText);
+//    m_statusTextLabel->setText(m_messageText);
 //    shortenTexts();
 }
 
@@ -169,7 +166,7 @@ void UserInfo::setAddress(const QString &addr)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
-    m_locationLabel->setText(addr);
+//    m_locationLabel->setText(addr);
 //    shortenTexts();
 }
 
@@ -178,8 +175,9 @@ void UserInfo::setTime(const QString &tim)
     if(m_time == tim)
       return;
     m_time = tim;
-    m_updatedLabel->setText(m_time);
+//    m_updatedLabel->setText(m_time);
     shortenTexts();
+    setText(false);
 }
 
 void UserInfo::shortenTexts()
@@ -247,14 +245,14 @@ void UserInfo::mouseReleaseEvent(QMouseEvent *event)
 
     if ((abs(m_mousePosition.y() - event->pos().y()) <= MOUSE_PRESS_AREA_WIDTH) &&
         (abs(m_mousePosition.x() - event->pos().x()) <= MOUSE_PRESS_AREA_HEIGHT)) {
-        if (m_expanded) {
-            setText(false);
-            m_expanded = false;
-        }
-        else {
-            setText(true);
-            m_expanded = true;
-        }
+//        if (m_expanded) {
+//            setText(false);
+//            m_expanded = false;
+//        }
+//        else {
+//            setText(true);
+//            m_expanded = true;
+//        }
     }
 }
 void UserInfo::paintEvent(QPaintEvent *aPaintEvent)
@@ -297,12 +295,20 @@ void UserInfo::mousePressEvent(QMouseEvent *event)
 void UserInfo::messageUpdate()
 {
     qDebug() << __PRETTY_FUNCTION__;
+
     m_locationDialog = new UpdateLocationDialog(this);
+    emit requestReverseGeo();
+
+    connect(this, SIGNAL(reverseGeoReady(QString)),
+            m_locationDialog, SLOT(setAddress(QString)));
+    connect(m_locationDialog, SIGNAL(statusUpdate(QString, bool)),
+            this, SIGNAL(statusUpdate(QString, bool)));
+
     m_locationDialog->show();
 }
 
-void UserInfo::updateFriendsStatus()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-    //emit launchUpdateFriendsStatus();
-}
+//void UserInfo::updateFriendsStatus()
+//{
+//    qDebug() << __PRETTY_FUNCTION__;
+//    //emit launchUpdateFriendsStatus();
+//}
index ef5b8cf..a1fb578 100644 (file)
@@ -120,11 +120,11 @@ private slots:
     * Text length is defined by MAXIMUM_CHARS.
     */
     void shortenTexts();
-    /**
-    * @brief Slot function to forward friends status update signal
-    *
-    */
-    void updateFriendsStatus();
+//    /**
+//    * @brief Slot function to forward friends status update signal
+//    *
+//    */
+//    void updateFriendsStatus();
 
 signals:
     /**
@@ -138,6 +138,25 @@ signals:
     */
     void launchUpdateFriendsStatus();
 
+    void requestReverseGeo();
+
+    /**
+    * @brief Signals, when address data is ready
+    *
+    * @param address Street address
+    */
+    void reverseGeoReady(const QString &address);
+
+    /**
+    * @brief Signal Signal for requestLocationUpdate from SituareEngine via MainWindow class
+    *
+    * @param status Status message
+    * @param publish Publish on Facebook
+    */
+    void statusUpdate(const QString &status, const bool &publish);
+
+    void refreshUserData();
+
 /******************************************************************************
 * DATA MEMBERS
 ******************************************************************************/
index 99eeaa8..b5297ac 100644 (file)
@@ -63,6 +63,18 @@ UserInfoPanel::UserInfoPanel(QWidget *parent)
             m_userPanelSlidingBar, SIGNAL(clicked()), m_userPanelStateClosed);
     m_userPanelTransitionClose->addAnimation(new QPropertyAnimation(this, "pos", this));
 
+    connect(m_userInfo,SIGNAL(requestReverseGeo()),
+            this, SIGNAL(requestReverseGeo()));
+
+    connect(this, SIGNAL(reverseGeoReady(QString)),
+            m_userInfo, SIGNAL(reverseGeoReady(QString)));
+
+    connect(m_userInfo, SIGNAL(statusUpdate(QString,bool)),
+            this, SIGNAL(statusUpdate(QString,bool)));
+
+    connect(m_userInfo, SIGNAL(refreshUserData()),
+            this, SIGNAL(refreshUserData()));
+
     m_userPanelStateMachine->start();
     setObjectName("UserPanel");
 }
index 06db4f8..7e12200 100644 (file)
@@ -61,6 +61,27 @@ public slots:
     */
     void reDrawUserPanel(int width, int height);
 
+signals:
+
+    void requestReverseGeo();
+
+    /**
+    * @brief Signals, when address data is ready
+    *
+    * @param address Street address
+    */
+    void reverseGeoReady(const QString &address);
+
+    /**
+    * @brief Signal Signal for requestLocationUpdate from SituareEngine via MainWindow class
+    *
+    * @param status Status message
+    * @param publish Publish on Facebook
+    */
+    void statusUpdate(const QString &status, const bool &publish);
+
+    void refreshUserData();
+
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/