Merge branch 'master' into dev_local
authorZoltan Papp <zoltan.papp@ixonos.com>
Mon, 1 Jun 2009 06:41:31 +0000 (09:41 +0300)
committerZoltan Papp <zoltan.papp@ixonos.com>
Mon, 1 Jun 2009 06:41:31 +0000 (09:41 +0300)
src/BusinessLogic/Engine.cpp
src/BusinessLogic/Engine.h
src/BusinessLogic/UIManager.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.cpp
src/UserInterface/Views/RoomStatusIndicatorWidget.h

index eb0d09f..da479c2 100644 (file)
@@ -166,31 +166,15 @@ void Engine::roomStatusInfoNeeded(Room *aRoom)
        ( ( indexOfNextMeeting != -1 ) ? iMeetings.at( indexOfNextMeeting )->startsAt().time() : Engine::endOfTheDay );
 
        //currently works only for deafult room
-//     if( aRoom->equals( *(defaultRoom() ) ) )
-//             iWindowManager->roomStatusChanged( aRoom, status, until );
-}
-
-/*
-void Engine::fetchMeetings()
-{
-       qDebug() << "Engine::fetchMeetings for " << iCurrentRoom;
-       QDateTime from( iWindowManager->weeklyView()->beginnigOfShownWeek() );
-       QDateTime to( from.addDays( 7 ) );
-       // fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() );
-       // Signal is connected to the currentRoomChanged slot which keeps the iCurrentRoom up to date
-       fetchMeetings( from, to, iCurrentRoom );
+       if ( aRoom->equals( *(iCurrentRoom) ) )
+       {
+               emit roomStatusChanged( status, until );
+       }
 }
-*/
 
 void Engine::fetchMeetingDetails( Meeting *aMeeting )
 {
        qDebug() << "Engine::fetchMeetingDetails( Meeting* )";
-/*     iWindowManager->showProgressBar(tr("Please Wait"), true);
-       iWindowManager->updateProgressBar(tr("Fetching Meeting Details...") );
-       connect(iWindowManager, 
-       SIGNAL( progressBarCancelled() ), this, 
-       SLOT( fetchMeetingDetailsCancelled() ));
-       iCommunication->fetchMeetingDetails( *aMeeting); */
        iCommunication->fetchMeetingDetails( *aMeeting );
 }
 
@@ -217,7 +201,7 @@ void Engine::meetingsFetched( const QList<Meeting*> &aMeetings )
        }
 
        // refresh room status info
-       roomStatusInfoNeeded( defaultRoom() );
+       roomStatusInfoNeeded( iCurrentRoom /*defaultRoom()*/ );
 }
 
 void Engine::errorHandler( int aCode, const QString &aAddInfo )
@@ -251,8 +235,7 @@ void Engine::shownWeekChanged( QDate aFrom )
        QDateTime from( aFrom );
        QDateTime to( aFrom.addDays( 7 ), QTime( 23, 59 ) );
        qDebug() << "[Engine::shownWeekChanged] <From " << aFrom.toString( "d.m. h:mm" ) << " to " << to.toString( "d.m. h:mm" ) << ">";
-       iCommunication->fetchMeetings( from, to, *defaultRoom() );
-//     fetchMeetings( from, to, iWindowManager->weeklyView()->currentRoom() );
+       iCommunication->fetchMeetings( from, to, *iCurrentRoom/*defaultRoom()*/ );
 }
 
 void Engine::changeDeviceMode()
@@ -385,4 +368,5 @@ void Engine::currentRoomChanged(Room *aRoom)
 {
        qDebug() << "[Engine::currentRoomChanged] <invoked>";
        iCurrentRoom = aRoom;
+       roomStatusInfoNeeded( iCurrentRoom );
 }
\ No newline at end of file
index a2f7020..6bacdd8 100644 (file)
@@ -41,6 +41,8 @@ public:
 
 signals:
 
+       void roomStatusChanged( Room::Status aStatus, QTime aUntil );
+
 private slots:
        //! Slot. Closes the application.
        /*!
@@ -67,12 +69,6 @@ private slots:
         * \param aAddInfo Possible addition info.
         */
        void errorHandler( int aCode, const QString &aAddInfo = "" );
-       //! Slot. Fetches meetings from the server.
-       /*!
-        * Slot. Fetches meetings from the server. Parameters are hard coded: the meetings of the default
-        * room from current and +/- 2 weeks are fetched.
-        */
-//     void fetchMeetings();
        //! Slot. Saves fetched meetings to the current instance's local storage.
        /*!
         * Slot. Saves fetched meetings to the current instance's local storage. Meetings are soted in a
index 7016138..da6b93b 100644 (file)
@@ -89,7 +89,9 @@ void UIManager::createSettingsView()
 
 void UIManager::createRoomStatusIndicator()
 {
-       iRoomStatusIndicator = new RoomStatusIndicatorWidget( iEngine->defaultRoom(), Room::FreeStatus, QTime::currentTime(), iEngine->iConfiguration->displaySettings()->dateFormat() );
+       iRoomStatusIndicator = new RoomStatusIndicatorWidget( iEngine->defaultRoom(), Room::FreeStatus, QTime::currentTime(), iEngine->iConfiguration->displaySettings()->timeFormat() );
+       connect( iEngine, SIGNAL( roomStatusChanged( Room::Status, QTime ) ), this, SLOT( statusChanged( Room::Status, QTime ) ) );
+       connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), iRoomStatusIndicator, SLOT( currentRoomChanged( Room * ) ) );
 }
 
 void UIManager::createPasswordDialog()
@@ -253,6 +255,10 @@ void UIManager::updateTime(QDateTime aDateTime)
        {
                iWeeklyView->setCurrentDateTime( aDateTime );
        }
+       if ( iRoomStatusIndicator != 0 )
+       {
+               iRoomStatusIndicator->setCurrentTime( aDateTime.time() );
+       }
 }
 
 void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus )
index e3ba648..89f65f1 100644 (file)
@@ -132,6 +132,7 @@ void RoomStatusIndicatorWidget::setCurrentTime( QTime aCurrentTime )
 \r
 void RoomStatusIndicatorWidget::statusChanged( const Room::Status aStatus, const QTime aUntil )\r
 {\r
+       qDebug() << "[RoomStatusIndicatorWidget::statusChanged] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";\r
        iStatusLabel->setText( tr( "is %1" ).arg( statusToText( aStatus ) ) );\r
        if ( aUntil == RoomStatusIndicatorWidget::endOfTheDay )\r
        {\r
index 4740f1f..4d8966c 100644 (file)
@@ -60,6 +60,8 @@ public slots:
         */\r
        void statusChanged( const Room::Status aStatus, const QTime aUntil );\r
        \r
+       void currentRoomChanged( Room *aRoom );\r
+       \r
        void viewResized(const QSize &newSize, const QSize &oldSize) { }\r
 \r
        void connectionEstablished();\r