( ( 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 );
}
}
// refresh room status info
- roomStatusInfoNeeded( defaultRoom() );
+ roomStatusInfoNeeded( iCurrentRoom /*defaultRoom()*/ );
}
void Engine::errorHandler( int aCode, const QString &aAddInfo )
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()
{
qDebug() << "[Engine::currentRoomChanged] <invoked>";
iCurrentRoom = aRoom;
+ roomStatusInfoNeeded( iCurrentRoom );
}
\ No newline at end of file
signals:
+ void roomStatusChanged( Room::Status aStatus, QTime aUntil );
+
private slots:
//! Slot. Closes the application.
/*!
* \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
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()
{
iWeeklyView->setCurrentDateTime( aDateTime );
}
+ if ( iRoomStatusIndicator != 0 )
+ {
+ iRoomStatusIndicator->setCurrentTime( aDateTime.time() );
+ }
}
void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus )