-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 ) : | |||
91 | { | 91 | { |
92 | Config cfg( "Launcher" ); | 92 | readConfig(); |
93 | cfg.setGroup( "InputMethods" ); | ||
94 | inputWidgetStyle = QWidget::WStyle_Customize | QWidget::WStyle_StaysOnTop | QWidget::WGroupLeader | QWidget::WStyle_Tool; | ||
95 | inputWidgetStyle |= cfg.readBoolEntry( "Float", false ) ? QWidget::WStyle_DialogBorder : 0; | ||
96 | inputWidgetWidth = cfg.readNumEntry( "Width", 100 ); | ||
97 | 93 | ||
@@ -534,3 +530,3 @@ void InputMethods::showKbd( bool on ) | |||
534 | int height = QMIN( mkeyboard->widget->sizeHint().height(), 134 ); | 530 | int height = QMIN( mkeyboard->widget->sizeHint().height(), 134 ); |
535 | int width = qApp->desktop()->width() * (inputWidgetWidth*0.01); | 531 | int width = static_cast<int>( qApp->desktop()->width() * (inputWidgetWidth*0.01) ); |
536 | int left = 0; | 532 | int left = 0; |
@@ -610,3 +606,3 @@ void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool pr | |||
610 | 606 | ||
611 | bool InputMethods::eventFilter( QObject* o, QEvent* e ) | 607 | bool InputMethods::eventFilter( QObject* , QEvent* e ) |
612 | { | 608 | { |
@@ -621 +617,11 @@ bool InputMethods::eventFilter( QObject* o, QEvent* e ) | |||
621 | } | 617 | } |
618 | |||
619 | void InputMethods::readConfig() { | ||
620 | Config cfg( "Launcher" ); | ||
621 | cfg.setGroup( "InputMethods" ); | ||
622 | |||
623 | inputWidgetStyle = QWidget::WStyle_Customize | QWidget::WStyle_StaysOnTop | QWidget::WGroupLeader | QWidget::WStyle_Tool; | ||
624 | inputWidgetStyle |= cfg.readBoolEntry( "Float", false ) ? | ||
625 | QWidget::WStyle_DialogBorder : 0; | ||
626 | inputWidgetWidth = cfg.readNumEntry( "Width", 100 ); | ||
627 | } | ||
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: | |||
76 | virtual bool eventFilter( QObject *, QEvent * ); | 76 | virtual bool eventFilter( QObject *, QEvent * ); |
77 | void readConfig(); | ||
77 | 78 | ||
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 | |||
178 | { | 178 | { |
179 | Config cfg( "Launcher" ); | 179 | /* Read InputMethod Config */ |
180 | cfg.setGroup( "InputMethods" ); | 180 | readConfig(); |
181 | resizeRunningApp = cfg.readBoolEntry( "Resize", true ); | ||
182 | 181 | ||
@@ -337,2 +336,4 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data ) | |||
337 | } else if ( msg == "reloadInputMethods()" ) { | 336 | } else if ( msg == "reloadInputMethods()" ) { |
337 | readConfig(); | ||
338 | inputMethods->readConfig(); | ||
338 | inputMethods->loadInputMethods(); | 339 | inputMethods->loadInputMethods(); |
@@ -379,2 +380,8 @@ void TaskBar::toggleSymbolInput() | |||
379 | 380 | ||
381 | void TaskBar::readConfig() { | ||
382 | Config cfg( "Launcher" ); | ||
383 | cfg.setGroup( "InputMethods" ); | ||
384 | resizeRunningApp = cfg.readBoolEntry( "Resize", true ); | ||
385 | } | ||
386 | |||
380 | #include "taskbar.moc" | 387 | #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: | |||
67 | void setStatusMessage( const QString &text ); | 67 | void setStatusMessage( const QString &text ); |
68 | 68 | ||
69 | private slots: | 69 | private slots: |
@@ -72,2 +72,5 @@ private slots: | |||
72 | private: | 72 | private: |
73 | void readConfig(); | ||
74 | |||
75 | private: | ||
73 | QTimer *waitTimer; | 76 | 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 @@ | |||
33 | #include <opie2/odebug.h> | 33 | #include <opie2/odebug.h> |
34 | #include <qpe/qcopenvelope_qws.h> | ||
34 | 35 | ||
@@ -58,5 +59,13 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW | |||
58 | cfg.setGroup( "InputMethods" ); | 59 | cfg.setGroup( "InputMethods" ); |
59 | _resize->setChecked( cfg.readBoolEntry( "Resize", true ) ); | 60 | |
60 | _float->setChecked( cfg.readBoolEntry( "Float", false ) ); | 61 | /* |
61 | _size->setValue( cfg.readNumEntry( "Width", 100 ) ); | 62 | * load the values to see if something was changed |
63 | */ | ||
64 | _wasResize = cfg.readBoolEntry( "Resize", true ); | ||
65 | _wasFloat = cfg.readBoolEntry( "Float", false ); | ||
66 | _wasWidth = cfg.readNumEntry( "Width", 100 ); | ||
67 | |||
68 | _resize->setChecked( _wasResize ); | ||
69 | _float ->setChecked( _wasFloat ); | ||
70 | _size ->setValue( _wasWidth ); | ||
62 | 71 | ||
@@ -73,4 +82,11 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW | |||
73 | 82 | ||
74 | void InputMethodSettings::appletChanged() | 83 | bool InputMethodSettings::changed()const{ |
75 | { | 84 | if ( _wasResize != _resize->isChecked() ) |
85 | return true; | ||
86 | else if ( _wasFloat != _float->isChecked() ) | ||
87 | return true; | ||
88 | else if ( _wasWidth != _size->value() ) | ||
89 | return true; | ||
90 | else | ||
91 | return false; | ||
76 | } | 92 | } |
@@ -86,2 +102,5 @@ void InputMethodSettings::accept() | |||
86 | cfg.write(); | 102 | cfg.write(); |
103 | |||
104 | if ( changed() ) | ||
105 | QCopEnvelope( "QPE/TaskBar", "reloadInputMethods()" ); | ||
87 | } | 106 | } |
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 | |||
44 | 44 | ||
45 | protected slots: | ||
46 | void appletChanged ( ); | ||
47 | |||
48 | protected: | 45 | protected: |
@@ -54,2 +51,8 @@ class InputMethodSettings : public QWidget | |||
54 | QSpinBox* _size; | 51 | QSpinBox* _size; |
52 | |||
53 | private: | ||
54 | bool changed()const; | ||
55 | bool _wasResize : 1; | ||
56 | bool _wasFloat : 1; | ||
57 | int _wasWidth; | ||
55 | }; | 58 | }; |