From: Jan Lapinkataja Date: Fri, 22 May 2009 12:53:38 +0000 (+0300) Subject: Progress bar related updating X-Git-Url: http://vcs.maemo.org/git/?p=qtmeetings;a=commitdiff_plain;h=deb6aee06a80416a24a64c2ac6349a2341acdc39 Progress bar related updating --- diff --git a/src/BusinessLogic/Engine.cpp b/src/BusinessLogic/Engine.cpp index bbee693..a61006c 100644 --- a/src/BusinessLogic/Engine.cpp +++ b/src/BusinessLogic/Engine.cpp @@ -323,10 +323,11 @@ void Engine::passwordEntered( PasswordDialog::PasswordStatus aPasswordStatus ) { case PasswordDialog::Correct : { - iWindowManager->showProgressBar( "Changing current operation mode." ); + iWindowManager->showProgressBar( "Changing current operation mode.", true ); connect( iWindowManager, SIGNAL( progressBarCancelled() ), this, SLOT( progressBarCancelled() ) ); connect( iDevice, SIGNAL( changingMode( const QString & ) ), iWindowManager, SLOT( updateProgressBar( const QString & ) ) ); + connect( iDevice, SIGNAL( changingModeFailed() ), this, SLOT( progressBarCancelled() ) ); iDevice->changeMode( true ); break; } diff --git a/src/IO/DeviceControl/DeviceConfigurator.cpp b/src/IO/DeviceControl/DeviceConfigurator.cpp index 4fa515e..76e17ce 100644 --- a/src/IO/DeviceControl/DeviceConfigurator.cpp +++ b/src/IO/DeviceControl/DeviceConfigurator.cpp @@ -17,7 +17,7 @@ DeviceConfigurator::~DeviceConfigurator() } bool DeviceConfigurator::toggleScreenSwitchOff( bool aEnable ) -{ +{ qDebug() << "DeviceConfigurator::toggleScreenSwitchOff( bool )"; QString command = "gconftool-2"; QStringList args; diff --git a/src/IO/DeviceControl/DeviceManager.cpp b/src/IO/DeviceControl/DeviceManager.cpp index c4b6a64..6c6eb27 100644 --- a/src/IO/DeviceControl/DeviceManager.cpp +++ b/src/IO/DeviceControl/DeviceManager.cpp @@ -178,11 +178,12 @@ void DeviceManager::toggleErrorSending( bool aToggle ) void DeviceManager::modeChanged() { if( iModeToggler != 0 ) { - if ( iModeToggler->success() ) { //mode changing went well - delete iModeToggler; - iModeToggler = 0; + if ( iModeToggler->success() ) //mode changing went well iConfigurator->restartDevice(); - } + else + emit changingModeFailed(); + delete iModeToggler; + iModeToggler = 0; } //in case device restarting fails we just continue diff --git a/src/IO/DeviceControl/DeviceManager.h b/src/IO/DeviceControl/DeviceManager.h index f4c8ec8..4d5aaa7 100644 --- a/src/IO/DeviceControl/DeviceManager.h +++ b/src/IO/DeviceControl/DeviceManager.h @@ -112,6 +112,11 @@ signals: * \param aMessage Explains the sub-change */ void changingMode( const QString &aMessage ); + //! Signal. Emitted if the operation mode change fails. + /*! + * Signal. Emitted if the operation mode change fails. + */ + void changingModeFailed(); private slots: //! Slot. Handles "full screen"-hardware key presses. diff --git a/src/UserInterface/Utils/ProgressBar.cpp b/src/UserInterface/Utils/ProgressBar.cpp index 835e5eb..6ab9fe2 100755 --- a/src/UserInterface/Utils/ProgressBar.cpp +++ b/src/UserInterface/Utils/ProgressBar.cpp @@ -33,6 +33,7 @@ ProgressBar::ProgressBar( const QString &aText, bool aCancellable, QWidget *aPar connect( buttonCancel, SIGNAL( pressed() ), this, SIGNAL( cancel() ) ); } mainLayout->addLayout( subLayout ); + mainLayout->setAlignment( Qt::AlignCenter ); setLayout( mainLayout ); } diff --git a/src/UserInterface/WindowManager.cpp b/src/UserInterface/WindowManager.cpp index 535434b..924392e 100644 --- a/src/UserInterface/WindowManager.cpp +++ b/src/UserInterface/WindowManager.cpp @@ -188,6 +188,7 @@ void WindowManager::showProgressBar( const QString &aText, bool aCancellable ) qDebug() << "WindowManager::showProgressBar( const QString & )"; if( iProgressBar == 0 ) { iProgressBar = new ProgressBar( aText, aCancellable ); + iProgressBar->setFixedSize( 600, 125 ); iProgressBar->show(); connect( iProgressBar, SIGNAL( cancel() ), this, SIGNAL( progressBarCancelled() ) ); }