-rw-r--r-- | core/launcher/inputmethods.cpp | 20 | ||||
-rw-r--r-- | core/launcher/inputmethods.h | 1 | ||||
-rw-r--r-- | core/launcher/taskbar.cpp | 13 | ||||
-rw-r--r-- | core/launcher/taskbar.h | 5 | ||||
-rw-r--r-- | core/settings/launcher/inputmethodsettings.cpp | 29 | ||||
-rw-r--r-- | core/settings/launcher/inputmethodsettings.h | 9 |
6 files changed, 58 insertions, 19 deletions
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp index a0e8939..7e99796 100644 --- a/core/launcher/inputmethods.cpp +++ b/core/launcher/inputmethods.cpp @@ -91,7 +91,3 @@ InputMethods::InputMethods( QWidget *parent ) : { - Config cfg( "Launcher" ); - cfg.setGroup( "InputMethods" ); - inputWidgetStyle = QWidget::WStyle_Customize | QWidget::WStyle_StaysOnTop | QWidget::WGroupLeader | QWidget::WStyle_Tool; - inputWidgetStyle |= cfg.readBoolEntry( "Float", false ) ? QWidget::WStyle_DialogBorder : 0; - inputWidgetWidth = cfg.readNumEntry( "Width", 100 ); + readConfig(); @@ -534,3 +530,3 @@ void InputMethods::showKbd( bool on ) int height = QMIN( mkeyboard->widget->sizeHint().height(), 134 ); - int width = qApp->desktop()->width() * (inputWidgetWidth*0.01); + int width = static_cast<int>( qApp->desktop()->width() * (inputWidgetWidth*0.01) ); int left = 0; @@ -610,3 +606,3 @@ void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool pr -bool InputMethods::eventFilter( QObject* o, QEvent* e ) +bool InputMethods::eventFilter( QObject* , QEvent* e ) { @@ -621 +617,11 @@ bool InputMethods::eventFilter( QObject* o, QEvent* e ) } + +void InputMethods::readConfig() { + Config cfg( "Launcher" ); + cfg.setGroup( "InputMethods" ); + + inputWidgetStyle = QWidget::WStyle_Customize | QWidget::WStyle_StaysOnTop | QWidget::WGroupLeader | QWidget::WStyle_Tool; + inputWidgetStyle |= cfg.readBoolEntry( "Float", false ) ? + QWidget::WStyle_DialogBorder : 0; + inputWidgetWidth = cfg.readNumEntry( "Width", 100 ); +} diff --git a/core/launcher/inputmethods.h b/core/launcher/inputmethods.h index 55ac020..2e0b1e8 100644 --- a/core/launcher/inputmethods.h +++ b/core/launcher/inputmethods.h @@ -76,2 +76,3 @@ public: virtual bool eventFilter( QObject *, QEvent * ); + void readConfig(); diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index abe238f..63361fe 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp @@ -178,5 +178,4 @@ TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOn { - Config cfg( "Launcher" ); - cfg.setGroup( "InputMethods" ); - resizeRunningApp = cfg.readBoolEntry( "Resize", true ); + /* Read InputMethod Config */ + readConfig(); @@ -337,2 +336,4 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data ) } else if ( msg == "reloadInputMethods()" ) { + readConfig(); + inputMethods->readConfig(); inputMethods->loadInputMethods(); @@ -379,2 +380,8 @@ void TaskBar::toggleSymbolInput() +void TaskBar::readConfig() { + Config cfg( "Launcher" ); + cfg.setGroup( "InputMethods" ); + resizeRunningApp = cfg.readBoolEntry( "Resize", true ); +} + #include "taskbar.moc" diff --git a/core/launcher/taskbar.h b/core/launcher/taskbar.h index ed558b1..be5fda8 100644 --- a/core/launcher/taskbar.h +++ b/core/launcher/taskbar.h @@ -67,3 +67,3 @@ protected: void setStatusMessage( const QString &text ); - + private slots: @@ -72,2 +72,5 @@ private slots: private: + void readConfig(); + +private: QTimer *waitTimer; diff --git a/core/settings/launcher/inputmethodsettings.cpp b/core/settings/launcher/inputmethodsettings.cpp index 0422075..125b178 100644 --- a/core/settings/launcher/inputmethodsettings.cpp +++ b/core/settings/launcher/inputmethodsettings.cpp @@ -33,2 +33,3 @@ #include <opie2/odebug.h> +#include <qpe/qcopenvelope_qws.h> @@ -58,5 +59,13 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW cfg.setGroup( "InputMethods" ); - _resize->setChecked( cfg.readBoolEntry( "Resize", true ) ); - _float->setChecked( cfg.readBoolEntry( "Float", false ) ); - _size->setValue( cfg.readNumEntry( "Width", 100 ) ); + + /* + * load the values to see if something was changed + */ + _wasResize = cfg.readBoolEntry( "Resize", true ); + _wasFloat = cfg.readBoolEntry( "Float", false ); + _wasWidth = cfg.readNumEntry( "Width", 100 ); + + _resize->setChecked( _wasResize ); + _float ->setChecked( _wasFloat ); + _size ->setValue( _wasWidth ); @@ -73,4 +82,11 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW -void InputMethodSettings::appletChanged() -{ +bool InputMethodSettings::changed()const{ + if ( _wasResize != _resize->isChecked() ) + return true; + else if ( _wasFloat != _float->isChecked() ) + return true; + else if ( _wasWidth != _size->value() ) + return true; + else + return false; } @@ -86,2 +102,5 @@ void InputMethodSettings::accept() cfg.write(); + + if ( changed() ) + QCopEnvelope( "QPE/TaskBar", "reloadInputMethods()" ); } diff --git a/core/settings/launcher/inputmethodsettings.h b/core/settings/launcher/inputmethodsettings.h index 486ee5e..2ae43f2 100644 --- a/core/settings/launcher/inputmethodsettings.h +++ b/core/settings/launcher/inputmethodsettings.h @@ -44,5 +44,2 @@ class InputMethodSettings : public QWidget - protected slots: - void appletChanged ( ); - protected: @@ -54,2 +51,8 @@ class InputMethodSettings : public QWidget QSpinBox* _size; + + private: + bool changed()const; + bool _wasResize : 1; + bool _wasFloat : 1; + int _wasWidth; }; |