summaryrefslogtreecommitdiff
path: root/core/settings
authorzecke <zecke>2004-08-22 21:35:22 (UTC)
committer zecke <zecke>2004-08-22 21:35:22 (UTC)
commit8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5 (patch) (side-by-side diff)
treecaf4d5d4cab240f2e7653b394666c5e2fb178798 /core/settings
parent2304c546ec73f2643621f04d61128c2686812cd1 (diff)
downloadopie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.zip
opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.tar.gz
opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.tar.bz2
Reload InputMethods when LauncherSettings changed InputMethod Options
Diffstat (limited to 'core/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/inputmethodsettings.cpp29
-rw-r--r--core/settings/launcher/inputmethodsettings.h9
2 files changed, 30 insertions, 8 deletions
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
@@ -31,6 +31,7 @@
/* OPIE */
#include <qpe/config.h>
#include <opie2/odebug.h>
+#include <qpe/qcopenvelope_qws.h>
/* QT */
#include <qspinbox.h>
@@ -56,9 +57,17 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW
Config cfg( "Launcher" );
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 );
lay->addWidget( _resize );
lay->addWidget( _float );
@@ -71,8 +80,15 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW
QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) );
}
-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;
}
void InputMethodSettings::accept()
@@ -84,5 +100,8 @@ void InputMethodSettings::accept()
cfg.writeEntry( "Float", _float->isChecked() );
cfg.writeEntry( "Width", _size->value() );
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
@@ -42,9 +42,6 @@ class InputMethodSettings : public QWidget
void accept ( );
- protected slots:
- void appletChanged ( );
-
protected:
void init ( );
@@ -52,6 +49,12 @@ class InputMethodSettings : public QWidget
QCheckBox* _resize;
QCheckBox* _float;
QSpinBox* _size;
+
+ private:
+ bool changed()const;
+ bool _wasResize : 1;
+ bool _wasFloat : 1;
+ int _wasWidth;
};
#endif