X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FBusinessLogic%2FEngine.cpp;h=e52979964082c59235bf45668837130f7ff03cfc;hb=1148d4487882be86017d0210a61d3d1b60d86676;hp=6e677c4dc0508b572d90ee76e8f51725ec26ba8b;hpb=a4efac92adf76a72d0bacc30eb99b79d148588d6;p=qtmeetings diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index 6e677c4..e529799 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -35,6 +35,9 @@ Engine::Engine() : connect( iWindowManager, SIGNAL( meetingActivated( Meeting * ) ), this, SLOT( fetchMeetingDetails( Meeting * ) ) ); connect( iWindowManager, SIGNAL( currentRoomChanged( Room * ) ), this, SLOT( currentRoomChanged( Room * ) ) ); connect( iWindowManager, SIGNAL( shownWeekChanged( QDate ) ), this, SLOT( shownWeekChanged( QDate ) ) ); + connect( iWindowManager, SIGNAL( passwordEntered( PasswordDialog::PasswordStatus ) ), + this, SLOT( passwordEntered( PasswordDialog::PasswordStatus ) ) ); + connect( iWindowManager, SIGNAL( progressBarCancelled() ), this, SLOT( progressBarCancelled() ) ); // initialize communication iCommunication = new CommunicationManager( *(iConfiguration->connectionSettings()) ); @@ -287,3 +290,35 @@ void Engine::changeModeOrdered( DeviceManager::OperationMode aMode ) iWindowManager->showPasswordDialog( iConfiguration->adminPassword(), message ); } + +void Engine::passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus ) +{ + qDebug() << "Engine::passwordEntered( PasswordDialog::PasswordStatus )"; + iWindowManager->closePasswordDialog(); + + switch ( aPasswordStatus ) + { + case PasswordDialog::Correct : + { + iWindowManager->showProgressBar( "Changing current operation mode." ); + break; + } + case PasswordDialog::Incorrect : + { + iWindowManager->error( tr( "Incorrect password." ) ); + iDevice->handleKeyPresses( true ); + break; + } + default : //case PasswordDialog::Canceled + { + iDevice->handleKeyPresses( true ); + } + } +} + +void Engine::progressBarCancelled() +{ + //TODO: cancel the on-going event + iWindowManager->closeProgressBar(); + iDevice->handleKeyPresses( true ); +}