Routed infotab button signals out
authorJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Mon, 19 Apr 2010 10:11:23 +0000 (13:11 +0300)
committerJukka Saastamoinen <juksa@czc6303cj1.ixonos.local>
Mon, 19 Apr 2010 10:11:23 +0000 (13:11 +0300)
src/ui/infotab.cpp
src/ui/infotab.h

index 8b7a1e3..48e2f8f 100644 (file)
@@ -12,10 +12,10 @@ InfoTab::InfoTab(QWidget *parent)
     QLabel *m_clockLabel = new QLabel;
     QLabel *m_envelopeLabel = new QLabel;
     QLabel *m_compassLabel = new QLabel;
-    QToolButton *sendLocationButton = new QToolButton;
+    QToolButton *updateFriendsButton = new QToolButton;
     QToolButton *updateStatusMessageButton = new QToolButton;
 
-    sendLocationButton->setIcon(QIcon(QPixmap(":/resources/reload_icon.png")));
+    updateFriendsButton->setIcon(QIcon(QPixmap(":/resources/reload_icon.png")));
     updateStatusMessageButton->setIcon(QIcon(QPixmap(":/resources/sendPosition_icon.png")));
 
     m_clockLabel->setPixmap(QPixmap(":/resources/clock_small.png"));
@@ -29,9 +29,11 @@ InfoTab::InfoTab(QWidget *parent)
     m_layout->addWidget(m_timeLabel,1,2,1,1);
     m_layout->addWidget(m_messageLabel,2,2,1,1);
     m_layout->addWidget(m_addressLabel,3,2,1,1);
-    m_layout->addWidget(sendLocationButton,0,3,2,1);
+    m_layout->addWidget(updateFriendsButton,0,3,2,1);
     m_layout->addWidget(updateStatusMessageButton,1,3,2,1);
 
+    connect(updateStatusMessageButton,SIGNAL(clicked()),this,SLOT(messageUpdate()));
+    connect(updateFriendsButton,SIGNAL(clicked()),this,SLOT(updateFriendsStatus()));
 }
 
 InfoTab::~InfoTab()
@@ -120,3 +122,15 @@ void InfoTab::setTime(const QString &tim)
     m_time = tim;
     m_timeLabel->setText(m_time);
 }
+
+void InfoTab::messageUpdate()
+{
+    emit launchMessageUpdate();
+    qDebug() << __PRETTY_FUNCTION__;
+}
+
+void InfoTab::updateFriendsStatus()
+{
+    emit launchUpdateFriendsStatus();
+    qDebug() << __PRETTY_FUNCTION__;
+}
index 7459229..1820dec 100644 (file)
@@ -84,6 +84,28 @@ public slots:
     * @param usernam Reference to user name
     */
     void setUserName(const QString &usernam);
+private slots:
+    /**
+    * @brief Slot function to forward messageUpdate launch signal
+    *
+    */
+    void messageUpdate();
+    /**
+    * @brief Slot function to forward friends status update signal
+    *
+    */
+    void updateFriendsStatus();
+signals:
+    /**
+    * @brief Signal to launch manual message update dialog
+    *
+    */
+    void launchMessageUpdate();
+    /**
+    * @brief Signal to refresh friends statuses
+    * @todo: Connect to friends lists when ready
+    */
+    void launchUpdateFriendsStatus();
 private:
     QLabel *m_userPicture;    ///< Shows the user's avatar
     QLabel *m_userNameLabel;  ///< Shows the user's name