added refresh on statusbar click
authorRisto Lintinen <lintiri@lintiri-desktop.(none)>
Wed, 26 Aug 2009 11:57:11 +0000 (14:57 +0300)
committerRisto Lintinen <lintiri@lintiri-desktop.(none)>
Wed, 26 Aug 2009 11:57:11 +0000 (14:57 +0300)
src/BusinessLogic/Engine.cpp
src/BusinessLogic/UIManager.cpp
src/UserInterface/Components/BorderedBarWidget.cpp
src/UserInterface/Components/BorderedBarWidget.h
src/UserInterface/Views/RoomStatusIndicatorWidget.cpp
src/UserInterface/Views/WeeklyViewWidget.cpp
src/UserInterface/Views/WeeklyViewWidget.h

index 9fd0c6c..6cf5ee4 100644 (file)
@@ -421,7 +421,7 @@ void Engine::tick( QDateTime aCurrentDateTime )
 void Engine::updateRoomInfo()
 {
        qDebug() << "ENGINE::: updateMeetings";
-       roomStatusInfoNeeded(iCurrentRoom);
+       iUIManager->currentRoomChanged( iCurrentRoom );
 }
 
 void Engine::configurationChanged()
index 0913697..1c58381 100644 (file)
@@ -75,6 +75,7 @@ void UIManager::createWeeklyView()
        connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), this, SLOT( currentRoomChanged( Room * ) ) );
        connect( iWeeklyView, SIGNAL( meetingActivated( Meeting * ) ), this, SLOT( showMeetingProgressBar( Meeting * ) ) );
        // Connect signals to engine
+       connect( iWeeklyView, SIGNAL( refreshButtonClicked() ), iEngine, SLOT( updateRoomInfo() ) );
        connect( iWeeklyView, SIGNAL( meetingActivated( Meeting * ) ), iEngine, SLOT( fetchMeetingDetails( Meeting * ) ) );
        connect( iWeeklyView, SIGNAL( shownWeekChanged( QDate ) ), iEngine, SLOT( shownWeekChanged( QDate ) ) );
        connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), iEngine, SLOT( currentRoomChanged( Room * ) ) );
index 67356e4..0b92511 100644 (file)
@@ -94,6 +94,12 @@ void BorderedBarWidget::paintEvent(QPaintEvent *)
        iRightLabel->setGeometry( rect() );
 }
 
+void BorderedBarWidget::mousePressEvent( QMouseEvent * )
+{
+       emit ( clicked() );
+}
+
+
 void BorderedBarWidget::drawCorner( QPainter &aPainter, QPoint &aCenter )
 {
        QRadialGradient radialGrad(QPointF(aCenter), iBorderWidth);
index c97b18a..c3e56bf 100644 (file)
@@ -86,6 +86,10 @@ public:
         */
     void setPixmap( QPixmap aPixmap, TextPosition aPos = RightAlign );
 
+signals:
+
+       void clicked();
+
 private:
        //! Draws the borders.
        /*!
@@ -115,6 +119,8 @@ protected:
         */
     virtual void paintEvent(QPaintEvent *);
 
+    void mousePressEvent( QMouseEvent * );
+
 private:
        //! Palette for storing colors.
     QPalette iPalette;
index be37768..2ee240e 100644 (file)
@@ -163,8 +163,7 @@ void RoomStatusIndicatorWidget::setConnectionStatus( QDateTime aCurrentTime, boo
 
                if (!aConnected)
                {
-                       iStatusBar->setText( tr("Disconnected").arg(aLastUpdated.toString(iTimeFormat))
-                                       , BorderedBarWidget::LeftAlign );
+                       iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign );
                }
                else
                {
index 82d18c2..1596933 100644 (file)
@@ -76,6 +76,8 @@ WeeklyViewWidget::WeeklyViewWidget( QDateTime aCurrentDateTime, Configuration *a
        iStatusBar->setFixedHeight( 36 );\r
        iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign );\r
 \r
+       connect( iStatusBar, SIGNAL( clicked() ), this, SIGNAL( refreshButtonClicked() ) );\r
+\r
        iSchedule = new ScheduleWidget( aCurrentDateTime, iConfiguration->displaySettings(), this );\r
        connect( iSchedule, SIGNAL( shownWeekChanged( QDate ) ), this, SIGNAL( shownWeekChanged( QDate ) ) );\r
        connect( iSchedule, SIGNAL( meetingActivated( Meeting* ) ), this, SIGNAL( meetingActivated( Meeting* ) ) );\r
@@ -238,9 +240,7 @@ void WeeklyViewWidget::setConnectionStatus( QDateTime aCurrentTime, bool aConnec
                iStatusBar->setText( tr("Disconnected") , BorderedBarWidget::LeftAlign );\r
        else if ( !aConnected )\r
        {\r
-               iStatusBar->setText( tr("Disconnected")\r
-                               .arg(aLastUpdated.toString(iConfiguration->displaySettings()->timeFormat()))\r
-                               , BorderedBarWidget::LeftAlign );\r
+               iStatusBar->setText( tr("Disconnected"), BorderedBarWidget::LeftAlign );\r
        }\r
        else\r
        {\r
index a9632a2..5ea4bf6 100644 (file)
@@ -103,6 +103,13 @@ signals:
         * Signal is emited when settings button is clicked.
         */
        void settingsButtonClicked();
+
+       //! Signals
+       /*!
+        * Signal is emited when refresh button is clicked.
+        */
+       void refreshButtonClicked();
+
        
        //! Signal. Emitted if the shown week has been changed.
        /*!