Added functionality for hide and show user information
authorKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Fri, 3 Sep 2010 13:06:28 +0000 (16:06 +0300)
committerKatri Kaikkonen <katri.kaikkonen@ixonos.com>
Fri, 3 Sep 2010 13:06:28 +0000 (16:06 +0300)
Reviewed by Sami Rämö

src/ui/mainwindow.cpp
src/ui/userinfo.h
src/ui/userinfopanel.cpp
src/ui/userinfopanel.h

index e99cf6b..776177c 100644 (file)
    USA.
 */
 
+#include <QtAlgorithms>
+#include <QtWebKit>
+
 #include <QAction>
 #include <QApplication>
 #include <QMenuBar>
 #include <QMessageBox>
-#include <QtAlgorithms>
-#include <QtWebKit>
 
-///< @todo sort
-#include "facebookservice/facebookauthentication.h"
-#include "map/mapcommon.h"
-#include "map/mapview.h"
 #include "common.h"
 #include "error.h"
+#include "facebookservice/facebookauthentication.h"
 #include "friendlistpanel.h"
 #include "fullscreenbutton.h"
 #include "indicatorbuttonpanel.h"
 #include "locationsearchpanel.h"
 #include "logindialog.h"
+#include "map/mapcommon.h"
+#include "map/mapview.h"
 #include "mapscale.h"
 #include "panelcommon.h"
 #include "routingpanel.h"
-#include "tabbedpanel.h"
 #include "searchdialog.h"
 #include "settingsdialog.h"
+#include "tabbedpanel.h"
 #include "userinfopanel.h"
 #include "zoombuttonpanel.h"
 
@@ -757,6 +757,7 @@ void MainWindow::loggedIn(bool logged)
         m_password.clear();
 
         m_loginAct->setText(tr("Login"));
+        m_userInfoPanel->showUserInfo(false);
     }
     updateItemVisibility();
 }
index a7b52c9..e15e917 100644 (file)
@@ -234,10 +234,8 @@ private:
 
     QPoint m_mousePosition;                 ///< Current mouse press position
 
-    QString m_address;                      ///< Address from where the new message was sent
     QString m_backupMessage;                ///< Backup of users message
     QString m_messageText;                  ///< User's message
-    QString m_time;                         ///< Time when the new message was sent
     QString m_userName;                     ///< User's name
 
     GeoCoordinate m_coordinates;            ///< User current coordinates
index 2c48092..6ed5ff8 100644 (file)
@@ -97,6 +97,14 @@ UserInfoPanel::UserInfoPanel(QWidget *parent)
 
     connect(updateStatusMessageButton, SIGNAL(clicked()),
             m_userInfo, SLOT(messageUpdate()));
+
+}
+
+void UserInfoPanel::showUserInfo(bool logged)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    m_userInfo->setVisible(logged);
 }
 
 void UserInfoPanel::userDataReceived(User *user)
@@ -110,5 +118,7 @@ void UserInfoPanel::userDataReceived(User *user)
         m_userInfo->setAddress(user->address());
         m_userInfo->setTime(user->timestamp());
         m_userInfo->setCoordinates(user->coordinates());
+
+        m_userInfo->show();
     }
 }
index 50bdb9a..df11c04 100644 (file)
@@ -53,6 +53,13 @@ public:
  ******************************************************************************/
 public slots:
     /**
+     * @brief show / hide user information
+     *
+     * @param show true if userinfo should be shown
+     */
+    void showUserInfo(bool show);
+
+    /**
      * @brief Slot to capture returning user data from situareService
      *
      * @param user
@@ -64,6 +71,11 @@ public slots:
  ******************************************************************************/
 signals:
     /**
+     * @brief Signal for collapse user info
+     */
+    void collapse();
+
+    /**
      * @brief Signal for finding user.
      *
      * @param coordinates user geo coordinates
@@ -71,11 +83,6 @@ signals:
     void findUser(const GeoCoordinate &coordinates);
 
     /**
-     * @brief Signal for collapse user info
-     */
-    void collapse();
-
-    /**
      * @brief Signal that used to inform user that his message/location update tp Situare server
      *        was failed.
      *        This signal is originally sended from UserInfo