summaryrefslogtreecommitdiff
path: root/core/settings/launcher
authorzecke <zecke>2004-08-22 21:35:22 (UTC)
committer zecke <zecke>2004-08-22 21:35:22 (UTC)
commit8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5 (patch) (unidiff)
treecaf4d5d4cab240f2e7653b394666c5e2fb178798 /core/settings/launcher
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/launcher') (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
@@ -28,12 +28,13 @@
28 28
29#include "inputmethodsettings.h" 29#include "inputmethodsettings.h"
30 30
31/* OPIE */ 31/* OPIE */
32#include <qpe/config.h> 32#include <qpe/config.h>
33#include <opie2/odebug.h> 33#include <opie2/odebug.h>
34#include <qpe/qcopenvelope_qws.h>
34 35
35/* QT */ 36/* QT */
36#include <qspinbox.h> 37#include <qspinbox.h>
37#include <qcheckbox.h> 38#include <qcheckbox.h>
38#include <qlayout.h> 39#include <qlayout.h>
39#include <qlabel.h> 40#include <qlabel.h>
@@ -53,36 +54,54 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW
53 _size->setSuffix( "%" ); 54 _size->setSuffix( "%" );
54 hbox->addWidget( _size ); 55 hbox->addWidget( _size );
55 hbox->addStretch(); 56 hbox->addStretch();
56 57
57 Config cfg( "Launcher" ); 58 Config cfg( "Launcher" );
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
63 lay->addWidget( _resize ); 72 lay->addWidget( _resize );
64 lay->addWidget( _float ); 73 lay->addWidget( _float );
65 lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); 74 lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) );
66 75
67 lay->addStretch(); 76 lay->addStretch();
68 77
69 QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) ); 78 QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) );
70 QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) ); 79 QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) );
71 QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) ); 80 QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) );
72} 81}
73 82
74void InputMethodSettings::appletChanged() 83bool 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}
77 93
78void InputMethodSettings::accept() 94void InputMethodSettings::accept()
79{ 95{
80 odebug << "InputMethodSettings::accept()" << oendl; 96 odebug << "InputMethodSettings::accept()" << oendl;
81 Config cfg( "Launcher" ); 97 Config cfg( "Launcher" );
82 cfg.setGroup( "InputMethods" ); 98 cfg.setGroup( "InputMethods" );
83 cfg.writeEntry( "Resize", _resize->isChecked() ); 99 cfg.writeEntry( "Resize", _resize->isChecked() );
84 cfg.writeEntry( "Float", _float->isChecked() ); 100 cfg.writeEntry( "Float", _float->isChecked() );
85 cfg.writeEntry( "Width", _size->value() ); 101 cfg.writeEntry( "Width", _size->value() );
86 cfg.write(); 102 cfg.write();
103
104 if ( changed() )
105 QCopEnvelope( "QPE/TaskBar", "reloadInputMethods()" );
87} 106}
88 107
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
@@ -39,19 +39,22 @@ class InputMethodSettings : public QWidget
39 39
40 public: 40 public:
41 InputMethodSettings ( QWidget *parent = 0, const char *name = 0 ); 41 InputMethodSettings ( QWidget *parent = 0, const char *name = 0 );
42 42
43 void accept ( ); 43 void accept ( );
44 44
45 protected slots:
46 void appletChanged ( );
47
48 protected: 45 protected:
49 void init ( ); 46 void init ( );
50 47
51 private: 48 private:
52 QCheckBox* _resize; 49 QCheckBox* _resize;
53 QCheckBox* _float; 50 QCheckBox* _float;
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};
56 59
57#endif 60#endif