if ( iEngine == 0 ) return;
if ( iWindowManager == 0 ) return;
- qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
-
createWeeklyView();
createSettingsView();
createRoomStatusIndicator();
createPasswordDialog();
createProgressBar();
createMeetingInfoDialog();
-
- qDebug() << "[UIManager::ctor] <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>";
}
UIManager::~UIManager()
iWindowManager->showView( iWeeklyView );
}
-void UIManager::showProgressBar( QString aText )
-{
- if ( iProgressBar != 0 )
- {
- iProgressBar->update( aText );
- iWindowManager->showDialog( iProgressBar );
- }
-}
-
// ===============================================
// INITIALIZE THE UIMANAGER
void UIManager::createWeeklyView()
// Connect signals to engine
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 * ) ) );
}
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().addSecs(100000000), iEngine->iConfiguration->displaySettings()->timeFormat() );
+
+ // Connect engine signals
+ connect( iEngine, SIGNAL( roomStatusChanged( Room::Status, QTime ) ), iRoomStatusIndicator, SLOT( statusChanged( Room::Status, QTime ) ) );
+ connect( iWeeklyView, SIGNAL( currentRoomChanged( Room * ) ), iRoomStatusIndicator, SLOT( currentRoomChanged( Room * ) ) );
}
void UIManager::createPasswordDialog()
{
- iPasswordDialog = new PasswordDialog( iEngine->iConfiguration->adminPassword(), tr("UIManager::createPasswordDialog"), tr("UIManager::createPasswordDialog") );
-
+ iPasswordDialog = new PasswordDialog( iEngine->iConfiguration->adminPassword(), "", tr("Enter password") );
connect( iPasswordDialog, SIGNAL( passwordEntered( PasswordDialog::PasswordStatus ) ), this, SLOT( passwordEntered( PasswordDialog::PasswordStatus ) ) );
}
void UIManager::connectCommunicationManager( CommunicationManager *aCommunicationManager )
{
-// connect( aCommunicationManager, SIGNAL( meetingDetailsFetched( Meeting & ) ), this, SLOT( meetingDetailsFetched( Meeting & ) ) );
+ connect( aCommunicationManager, SIGNAL( meetingDetailsFetched( Meeting & ) ), this, SLOT( meetingDetailsFetched( Meeting & ) ) );
connect( aCommunicationManager, SIGNAL( meetingsFetched( const QList<Meeting *> & ) ), this, SLOT( meetingsFetched( const QList<Meeting *> & ) ) );
}
{
if ( iProgressBar != 0 )
{
- iProgressBar->update( tr("Fetching meeting info...") );
- iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
+ iProgressBar->update( tr( "Fetching meeting info..." ), tr( "Please wait" ) );
+ iProgressBar->toggleCancellable( true );
+ iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
}
}
{
iProgressBar->close(); // Close it in case it's visible
}
- // iMeetingInfo->setMeeting( &aDetailedMeeting );
+ iEngine->stopIdleTimeCounter(); // Timer restarted when the dialog is dismissed.
MeetingInfoDialog *tmp = new MeetingInfoDialog( &aDetailedMeeting );
- iWindowManager->showDialog( static_cast<QDialog *>( tmp/*iMeetingInfo*/ ) );
+ iWindowManager->showDialog( static_cast<QDialog *>( tmp ) );
+
+// TODO : We should use the member variable and implement correctly the setMeeting() method !!!
+// iMeetingInfo->setMeeting( &aDetailedMeeting );
+// iWindowManager->showDialog( static_cast<QDialog *>( iMeetingInfo ) );
}
}
void UIManager::changeModeOrdered( DeviceManager::OperationMode aMode )
{
qDebug() << "[UIManager::changeModeOrdered] <Invoked>";
-
- QString message = tr( "You are about to change operation mode to %1." )
- .arg( iEngine->iDevice->operationModeToString( aMode ) );
if ( iPasswordDialog != 0 )
{
- // TODO : Set the new text for password dialog
+ QString text = tr( "You are about to change operation mode to %1." )
+ .arg( iEngine->iDevice->operationModeToString( aMode ) );
+ iPasswordDialog->update( text );
iWindowManager->showDialog( static_cast<QDialog *>( iPasswordDialog ) );
}
}
void UIManager::currentRoomChanged(Room *aRoom)
{
+ qDebug() << "[UIManager::currentRoomChanged] <Invoked>";
if ( iWeeklyView != 0 )
{
QDateTime from = QDateTime( iWeeklyView->beginnigOfShownWeek() );
{
iWeeklyView->setCurrentDateTime( aDateTime );
}
+ if ( iRoomStatusIndicator != 0 )
+ {
+ iRoomStatusIndicator->setCurrentTime( aDateTime.time() );
+ }
}
void UIManager::passwordEntered( PasswordDialog::PasswordStatus aStatus )
// Show the progress bar..
if ( iProgressBar != 0 )
{
- iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false );
+ iProgressBar->update( tr( "" ), tr( "Changing operation mode" ) );
+ iProgressBar->toggleCancellable( false );
+ iWindowManager->showDialog( static_cast<QDialog *>( iProgressBar ), false, false );
}
// ... and initiate the mode changing
iEngine->changeDeviceMode( true );