summaryrefslogtreecommitdiff
authorzecke <zecke>2004-08-22 21:35:22 (UTC)
committer zecke <zecke>2004-08-22 21:35:22 (UTC)
commit8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5 (patch) (unidiff)
treecaf4d5d4cab240f2e7653b394666c5e2fb178798
parent2304c546ec73f2643621f04d61128c2686812cd1 (diff)
downloadopie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.zip
opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.tar.gz
opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.tar.bz2
Reload InputMethods when LauncherSettings changed InputMethod Options
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/inputmethods.cpp20
-rw-r--r--core/launcher/inputmethods.h1
-rw-r--r--core/launcher/taskbar.cpp13
-rw-r--r--core/launcher/taskbar.h5
-rw-r--r--core/settings/launcher/inputmethodsettings.cpp29
-rw-r--r--core/settings/launcher/inputmethodsettings.h9
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
@@ -68,53 +68,49 @@ int InputMethod::operator >(const InputMethod& o) const
68 return name() > o.name(); 68 return name() > o.name();
69} 69}
70int InputMethod::operator <=(const InputMethod& o) const 70int InputMethod::operator <=(const InputMethod& o) const
71{ 71{
72 return name() <= o.name(); 72 return name() <= o.name();
73} 73}
74 74
75 75
76/* 76/*
77 Slightly hacky: We use WStyle_Tool as a flag to say "this widget 77 Slightly hacky: We use WStyle_Tool as a flag to say "this widget
78 belongs to the IM system, so clicking it should not cause a reset". 78 belongs to the IM system, so clicking it should not cause a reset".
79 */ 79 */
80class IMToolButton : public QToolButton 80class IMToolButton : public QToolButton
81{ 81{
82public: 82public:
83 IMToolButton::IMToolButton( QWidget *parent ) : QToolButton( parent ) 83 IMToolButton::IMToolButton( QWidget *parent ) : QToolButton( parent )
84 { setWFlags( WStyle_Tool ); } 84 { setWFlags( WStyle_Tool ); }
85}; 85};
86 86
87 87
88InputMethods::InputMethods( QWidget *parent ) : 88InputMethods::InputMethods( QWidget *parent ) :
89 QWidget( parent, "InputMethods", WStyle_Tool | WStyle_Customize ), 89 QWidget( parent, "InputMethods", WStyle_Tool | WStyle_Customize ),
90 mkeyboard(0), imethod(0) 90 mkeyboard(0), imethod(0)
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
98 setBackgroundMode( PaletteBackground ); 94 setBackgroundMode( PaletteBackground );
99 QHBoxLayout *hbox = new QHBoxLayout( this ); 95 QHBoxLayout *hbox = new QHBoxLayout( this );
100 96
101 kbdButton = new IMToolButton( this); 97 kbdButton = new IMToolButton( this);
102 kbdButton->setFocusPolicy(NoFocus); 98 kbdButton->setFocusPolicy(NoFocus);
103 kbdButton->setToggleButton( TRUE ); 99 kbdButton->setToggleButton( TRUE );
104 if (parent->sizeHint().height() > 0) 100 if (parent->sizeHint().height() > 0)
105 kbdButton->setFixedHeight( parent->sizeHint().height() ); 101 kbdButton->setFixedHeight( parent->sizeHint().height() );
106 kbdButton->setFixedWidth( 32 ); 102 kbdButton->setFixedWidth( 32 );
107 kbdButton->setAutoRaise( TRUE ); 103 kbdButton->setAutoRaise( TRUE );
108 kbdButton->setUsesBigPixmap( TRUE ); 104 kbdButton->setUsesBigPixmap( TRUE );
109 hbox->addWidget( kbdButton ); 105 hbox->addWidget( kbdButton );
110 connect( kbdButton, SIGNAL(toggled(bool)), this, SLOT(showKbd(bool)) ); 106 connect( kbdButton, SIGNAL(toggled(bool)), this, SLOT(showKbd(bool)) );
111 107
112 kbdChoice = new IMToolButton( this ); 108 kbdChoice = new IMToolButton( this );
113 kbdChoice->setFocusPolicy(NoFocus); 109 kbdChoice->setFocusPolicy(NoFocus);
114 kbdChoice->setPixmap( QPixmap( (const char **)tri_xpm ) ); 110 kbdChoice->setPixmap( QPixmap( (const char **)tri_xpm ) );
115 if (parent->sizeHint().height() > 0) 111 if (parent->sizeHint().height() > 0)
116 kbdChoice->setFixedHeight( parent->sizeHint().height() ); 112 kbdChoice->setFixedHeight( parent->sizeHint().height() );
117 kbdChoice->setFixedWidth( 13 ); 113 kbdChoice->setFixedWidth( 13 );
118 kbdChoice->setAutoRaise( TRUE ); 114 kbdChoice->setAutoRaise( TRUE );
119 hbox->addWidget( kbdChoice ); 115 hbox->addWidget( kbdChoice );
120 connect( kbdChoice, SIGNAL(clicked()), this, SLOT(chooseKbd()) ); 116 connect( kbdChoice, SIGNAL(clicked()), this, SLOT(chooseKbd()) );
@@ -511,49 +507,49 @@ void InputMethods::chooseMethod(InputMethod* im)
511 if ( im ) 507 if ( im )
512 imButton->raiseWidget(im->widget); 508 imButton->raiseWidget(im->widget);
513 else 509 else
514 imButton->hide(); //### good UI? make sure it is shown again! 510 imButton->hide(); //### good UI? make sure it is shown again!
515 } 511 }
516} 512}
517 513
518void InputMethods::qcopReceive( const QCString &msg, const QByteArray &data ) 514void InputMethods::qcopReceive( const QCString &msg, const QByteArray &data )
519{ 515{
520 if ( imethod && imethod->newIM ) 516 if ( imethod && imethod->newIM )
521 imethod->extInterface->qcopReceive( msg, data ); 517 imethod->extInterface->qcopReceive( msg, data );
522} 518}
523 519
524 520
525void InputMethods::showKbd( bool on ) 521void InputMethods::showKbd( bool on )
526{ 522{
527 if ( !mkeyboard ) 523 if ( !mkeyboard )
528 return; 524 return;
529 525
530 if ( on ) 526 if ( on )
531 { 527 {
532 mkeyboard->resetState(); 528 mkeyboard->resetState();
533 529
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;
537 int top = mapToGlobal( QPoint() ).y() - height; 533 int top = mapToGlobal( QPoint() ).y() - height;
538 534
539 if ( inputWidgetStyle & QWidget::WStyle_DialogBorder ) 535 if ( inputWidgetStyle & QWidget::WStyle_DialogBorder )
540 { 536 {
541 odebug << "InputMethods: reading geometry." << oendl; 537 odebug << "InputMethods: reading geometry." << oendl;
542 Config cfg( "Launcher" ); 538 Config cfg( "Launcher" );
543 cfg.setGroup( "InputMethods" ); 539 cfg.setGroup( "InputMethods" );
544 int l = cfg.readNumEntry( "absX", -1 ); 540 int l = cfg.readNumEntry( "absX", -1 );
545 int t = cfg.readNumEntry( "absY", -1 ); 541 int t = cfg.readNumEntry( "absY", -1 );
546 int w = cfg.readNumEntry( "absWidth", -1 ); 542 int w = cfg.readNumEntry( "absWidth", -1 );
547 int h = cfg.readNumEntry( "absHeight", -1 ); 543 int h = cfg.readNumEntry( "absHeight", -1 );
548 544
549 if ( l > -1 && t > -1 && w > -1 && h > -1 ) 545 if ( l > -1 && t > -1 && w > -1 && h > -1 )
550 { 546 {
551 odebug << "InputMethods: config values ( " << l << ", " << t << ", " << w << ", " << h << " ) are ok." << oendl; 547 odebug << "InputMethods: config values ( " << l << ", " << t << ", " << w << ", " << h << " ) are ok." << oendl;
552 left = l; 548 left = l;
553 top = t; 549 top = t;
554 width = w; 550 width = w;
555 height = h; 551 height = h;
556 } 552 }
557 else 553 else
558 { 554 {
559 odebug << "InputMethods: config values are new or not ok." << oendl; 555 odebug << "InputMethods: config values are new or not ok." << oendl;
@@ -587,35 +583,45 @@ void InputMethods::showKbd( bool on )
587 mkeyboard->widget->hide(); 583 mkeyboard->widget->hide();
588 } 584 }
589 585
590 emit inputToggled( on ); 586 emit inputToggled( on );
591} 587}
592 588
593bool InputMethods::shown() const 589bool InputMethods::shown() const
594{ 590{
595 return mkeyboard && mkeyboard->widget->isVisible(); 591 return mkeyboard && mkeyboard->widget->isVisible();
596} 592}
597 593
598QString InputMethods::currentShown() const 594QString InputMethods::currentShown() const
599{ 595{
600 return mkeyboard && mkeyboard->widget->isVisible() 596 return mkeyboard && mkeyboard->widget->isVisible()
601 ? mkeyboard->name() : QString::null; 597 ? mkeyboard->name() : QString::null;
602} 598}
603 599
604void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool press, bool repeat ) 600void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool press, bool repeat )
605{ 601{
606#if defined(Q_WS_QWS) 602#if defined(Q_WS_QWS)
607 QWSServer::sendKeyEvent( unicode, scancode, mod, press, repeat ); 603 QWSServer::sendKeyEvent( unicode, scancode, mod, press, repeat );
608#endif 604#endif
609} 605}
610 606
611bool InputMethods::eventFilter( QObject* o, QEvent* e ) 607bool InputMethods::eventFilter( QObject* , QEvent* e )
612{ 608{
613 if ( e->type() == QEvent::Close ) 609 if ( e->type() == QEvent::Close )
614 { 610 {
615 ( (QCloseEvent*) e )->ignore(); 611 ( (QCloseEvent*) e )->ignore();
616 showKbd( false ); 612 showKbd( false );
617 kbdButton->setOn( false ); 613 kbdButton->setOn( false );
618 return true; 614 return true;
619 } 615 }
620 return false; 616 return false;
621} 617}
618
619void 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
@@ -53,48 +53,49 @@ struct InputMethod
53 inline QUnknownInterface *iface() { return newIM ? (QUnknownInterface *)extInterface : (QUnknownInterface *)interface; } 53 inline QUnknownInterface *iface() { return newIM ? (QUnknownInterface *)extInterface : (QUnknownInterface *)interface; }
54 inline void resetState() { if ( !newIM ) interface->resetState(); } 54 inline void resetState() { if ( !newIM ) interface->resetState(); }
55 55
56 int operator <(const InputMethod& o) const; 56 int operator <(const InputMethod& o) const;
57 int operator >(const InputMethod& o) const; 57 int operator >(const InputMethod& o) const;
58 int operator <=(const InputMethod& o) const; 58 int operator <=(const InputMethod& o) const;
59}; 59};
60 60
61class InputMethods : public QWidget 61class InputMethods : public QWidget
62{ 62{
63 Q_OBJECT 63 Q_OBJECT
64public: 64public:
65 InputMethods( QWidget * ); 65 InputMethods( QWidget * );
66 ~InputMethods(); 66 ~InputMethods();
67 67
68 QRect inputRect() const; 68 QRect inputRect() const;
69 bool shown() const; 69 bool shown() const;
70 QString currentShown() const; // name of interface 70 QString currentShown() const; // name of interface
71 void showInputMethod(const QString& id); 71 void showInputMethod(const QString& id);
72 void showInputMethod(); 72 void showInputMethod();
73 void hideInputMethod(); 73 void hideInputMethod();
74 void unloadInputMethods(); 74 void unloadInputMethods();
75 void loadInputMethods(); 75 void loadInputMethods();
76 virtual bool eventFilter( QObject *, QEvent * ); 76 virtual bool eventFilter( QObject *, QEvent * );
77 void readConfig();
77 78
78signals: 79signals:
79 void inputToggled( bool on ); 80 void inputToggled( bool on );
80 81
81private slots: 82private slots:
82 void chooseKbd(); 83 void chooseKbd();
83 void chooseIm(); 84 void chooseIm();
84 void showKbd( bool ); 85 void showKbd( bool );
85 void resetStates(); 86 void resetStates();
86 void sendKey( ushort unicode, ushort scancode, ushort modifiers, bool, bool ); 87 void sendKey( ushort unicode, ushort scancode, ushort modifiers, bool, bool );
87 void qcopReceive( const QCString &msg, const QByteArray &data ); 88 void qcopReceive( const QCString &msg, const QByteArray &data );
88 89
89private: 90private:
90 void setPreferedHandlers(); 91 void setPreferedHandlers();
91 /*static */QStringList plugins()const; 92 /*static */QStringList plugins()const;
92 /*static */void installTranslator( const QString& ); 93 /*static */void installTranslator( const QString& );
93 void unloadMethod( QValueList<InputMethod>& ); 94 void unloadMethod( QValueList<InputMethod>& );
94 void chooseMethod(InputMethod* im); 95 void chooseMethod(InputMethod* im);
95 void chooseKeyboard(InputMethod* im); 96 void chooseKeyboard(InputMethod* im);
96 void updateKeyboards(InputMethod *im); 97 void updateKeyboards(InputMethod *im);
97 98
98private: 99private:
99 QToolButton *kbdButton; 100 QToolButton *kbdButton;
100 QToolButton *kbdChoice; 101 QToolButton *kbdChoice;
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
@@ -155,51 +155,50 @@ public:
155 } 155 }
156 void paintEvent( QPaintEvent * ) 156 void paintEvent( QPaintEvent * )
157 { 157 {
158 int y = (height()-sizeHint().height())/2; 158 int y = (height()-sizeHint().height())/2;
159 QPainter p(this); 159 QPainter p(this);
160 if ( nl ) 160 if ( nl )
161 p.drawPixmap(1,y,nl_pm); 161 p.drawPixmap(1,y,nl_pm);
162 if ( cl ) 162 if ( cl )
163 p.drawPixmap(1,y+nl_pm.height()+1,cl_pm); 163 p.drawPixmap(1,y+nl_pm.height()+1,cl_pm);
164 } 164 }
165private: 165private:
166 QPixmap nl_pm, cl_pm; 166 QPixmap nl_pm, cl_pm;
167 bool nl, cl; 167 bool nl, cl;
168}; 168};
169 169
170//--------------------------------------------------------------------------- 170//---------------------------------------------------------------------------
171 171
172TaskBar::~TaskBar() 172TaskBar::~TaskBar()
173{ 173{
174} 174}
175 175
176 176
177TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) 177TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader)
178{ 178{
179 Config cfg( "Launcher" ); 179 /* Read InputMethod Config */
180 cfg.setGroup( "InputMethods" ); 180 readConfig();
181 resizeRunningApp = cfg.readBoolEntry( "Resize", true );
182 181
183 sm = new StartMenu( this ); 182 sm = new StartMenu( this );
184 connect( sm, SIGNAL(tabSelected(const QString&)), this, 183 connect( sm, SIGNAL(tabSelected(const QString&)), this,
185 SIGNAL(tabSelected(const QString&)) ); 184 SIGNAL(tabSelected(const QString&)) );
186 185
187 inputMethods = new InputMethods( this ); 186 inputMethods = new InputMethods( this );
188 connect( inputMethods, SIGNAL(inputToggled(bool)), 187 connect( inputMethods, SIGNAL(inputToggled(bool)),
189 this, SLOT(calcMaxWindowRect()) ); 188 this, SLOT(calcMaxWindowRect()) );
190 189
191 stack = new QWidgetStack( this ); 190 stack = new QWidgetStack( this );
192 stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); 191 stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
193 label = new QLabel(stack); 192 label = new QLabel(stack);
194 193
195 runningAppBar = new RunningAppBar(stack); 194 runningAppBar = new RunningAppBar(stack);
196 stack->raiseWidget(runningAppBar); 195 stack->raiseWidget(runningAppBar);
197 196
198 waitIcon = new Wait( this ); 197 waitIcon = new Wait( this );
199 (void) new AppIcons( this ); 198 (void) new AppIcons( this );
200 199
201 sysTray = new SysTray( this ); 200 sysTray = new SysTray( this );
202 201
203 /* ### FIXME plugin loader and safe mode */ 202 /* ### FIXME plugin loader and safe mode */
204#if 0 203#if 0
205 if (PluginLoader::inSafeMode()) 204 if (PluginLoader::inSafeMode())
@@ -314,67 +313,75 @@ void TaskBar::calcMaxWindowRect()
314 QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) ); 313 QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) );
315 #else 314 #else
316 QWSServer::setMaxWindowRect( wr ); 315 QWSServer::setMaxWindowRect( wr );
317 #endif 316 #endif
318 #endif 317 #endif
319 } 318 }
320} 319}
321 320
322void TaskBar::receive( const QCString &msg, const QByteArray &data ) 321void TaskBar::receive( const QCString &msg, const QByteArray &data )
323{ 322{
324 QDataStream stream( data, IO_ReadOnly ); 323 QDataStream stream( data, IO_ReadOnly );
325 if ( msg == "message(QString)" ) { 324 if ( msg == "message(QString)" ) {
326 QString text; 325 QString text;
327 stream >> text; 326 stream >> text;
328 setStatusMessage( text ); 327 setStatusMessage( text );
329 } else if ( msg == "hideInputMethod()" ) { 328 } else if ( msg == "hideInputMethod()" ) {
330 inputMethods->hideInputMethod(); 329 inputMethods->hideInputMethod();
331 } else if ( msg == "showInputMethod()" ) { 330 } else if ( msg == "showInputMethod()" ) {
332 inputMethods->showInputMethod(); 331 inputMethods->showInputMethod();
333 } else if ( msg == "showInputMethod(QString)" ) { 332 } else if ( msg == "showInputMethod(QString)" ) {
334 QString name; 333 QString name;
335 stream >> name; 334 stream >> name;
336 inputMethods->showInputMethod(name); 335 inputMethods->showInputMethod(name);
337 } else if ( msg == "reloadInputMethods()" ) { 336 } else if ( msg == "reloadInputMethods()" ) {
337 readConfig();
338 inputMethods->readConfig();
338 inputMethods->loadInputMethods(); 339 inputMethods->loadInputMethods();
339 } else if ( msg == "reloadApplets()" ) { 340 } else if ( msg == "reloadApplets()" ) {
340 sysTray->clearApplets(); 341 sysTray->clearApplets();
341 sm->createMenu(); 342 sm->createMenu();
342 sysTray->addApplets(); 343 sysTray->addApplets();
343 }else if ( msg == "toggleMenu()" ) { 344 }else if ( msg == "toggleMenu()" ) {
344 if ( sm-> launchMenu-> isVisible() ) 345 if ( sm-> launchMenu-> isVisible() )
345 sm-> launch(); 346 sm-> launch();
346 else 347 else
347 QCopEnvelope e( "QPE/System", "toggleApplicationMenu()" ); 348 QCopEnvelope e( "QPE/System", "toggleApplicationMenu()" );
348 }else if ( msg == "toggleStartMenu()" ) 349 }else if ( msg == "toggleStartMenu()" )
349 sm->launch(); 350 sm->launch();
350} 351}
351 352
352void TaskBar::setApplicationState( const QString &name, ServerInterface::ApplicationState state ) 353void TaskBar::setApplicationState( const QString &name, ServerInterface::ApplicationState state )
353{ 354{
354 if ( state == ServerInterface::Launching ) 355 if ( state == ServerInterface::Launching )
355 runningAppBar->applicationLaunched( name ); 356 runningAppBar->applicationLaunched( name );
356 else if ( state == ServerInterface::Terminated ) 357 else if ( state == ServerInterface::Terminated )
357 runningAppBar->applicationTerminated( name ); 358 runningAppBar->applicationTerminated( name );
358} 359}
359 360
360void TaskBar::toggleNumLockState() 361void TaskBar::toggleNumLockState()
361{ 362{
362 if ( lockState ) lockState->toggleNumLockState(); 363 if ( lockState ) lockState->toggleNumLockState();
363} 364}
364 365
365void TaskBar::toggleCapsLockState() 366void TaskBar::toggleCapsLockState()
366{ 367{
367 if ( lockState ) lockState->toggleCapsLockState(); 368 if ( lockState ) lockState->toggleCapsLockState();
368} 369}
369 370
370void TaskBar::toggleSymbolInput() 371void TaskBar::toggleSymbolInput()
371{ 372{
372 QString unicodeInput = qApp->translate( "InputMethods", "Unicode" ); 373 QString unicodeInput = qApp->translate( "InputMethods", "Unicode" );
373 if ( inputMethods->currentShown() == unicodeInput ) { 374 if ( inputMethods->currentShown() == unicodeInput ) {
374 inputMethods->hideInputMethod(); 375 inputMethods->hideInputMethod();
375 } else { 376 } else {
376 inputMethods->showInputMethod( unicodeInput ); 377 inputMethods->showInputMethod( unicodeInput );
377 } 378 }
378} 379}
379 380
381void 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
@@ -44,44 +44,47 @@ public:
44 ~TaskBar(); 44 ~TaskBar();
45 45
46 void launchStartMenu() { if (sm) sm->launch(); } 46 void launchStartMenu() { if (sm) sm->launch(); }
47 void refreshStartMenu() { if (sm) sm->refreshMenu(); } 47 void refreshStartMenu() { if (sm) sm->refreshMenu(); }
48 void setApplicationState( const QString &name, ServerInterface::ApplicationState state ); 48 void setApplicationState( const QString &name, ServerInterface::ApplicationState state );
49 49
50signals: 50signals:
51 void tabSelected(const QString&); 51 void tabSelected(const QString&);
52 52
53public slots: 53public slots:
54 void startWait(); 54 void startWait();
55 void stopWait(const QString&); 55 void stopWait(const QString&);
56 void stopWait(); 56 void stopWait();
57 57
58 void clearStatusBar(); 58 void clearStatusBar();
59 void toggleNumLockState(); 59 void toggleNumLockState();
60 void toggleCapsLockState(); 60 void toggleCapsLockState();
61 void toggleSymbolInput(); 61 void toggleSymbolInput();
62 void calcMaxWindowRect(); 62 void calcMaxWindowRect();
63 63
64protected: 64protected:
65 void resizeEvent( QResizeEvent * ); 65 void resizeEvent( QResizeEvent * );
66 void styleChange( QStyle & ); 66 void styleChange( QStyle & );
67 void setStatusMessage( const QString &text ); 67 void setStatusMessage( const QString &text );
68 68
69private slots: 69private slots:
70 void receive( const QCString &msg, const QByteArray &data ); 70 void receive( const QCString &msg, const QByteArray &data );
71 71
72private: 72private:
73 void readConfig();
74
75private:
73 QTimer *waitTimer; 76 QTimer *waitTimer;
74 Wait *waitIcon; 77 Wait *waitIcon;
75 InputMethods *inputMethods; 78 InputMethods *inputMethods;
76 SysTray *sysTray; 79 SysTray *sysTray;
77 RunningAppBar* runningAppBar; 80 RunningAppBar* runningAppBar;
78 QWidgetStack *stack; 81 QWidgetStack *stack;
79 QTimer *clearer; 82 QTimer *clearer;
80 QLabel *label; 83 QLabel *label;
81 LockKeyState* lockState; 84 LockKeyState* lockState;
82 StartMenu *sm; 85 StartMenu *sm;
83 bool resizeRunningApp; 86 bool resizeRunningApp;
84}; 87};
85 88
86 89
87#endif // TASKBAR_H 90#endif // TASKBAR_H
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
@@ -10,79 +10,98 @@
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
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>
40#include <qwhatsthis.h> 41#include <qwhatsthis.h>
41 42
42 43
43InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name ) 44InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name )
44{ 45{
45 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); 46 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 );
46 47
47 _resize = new QCheckBox( tr( "Resize application on Popup" ), this ); 48 _resize = new QCheckBox( tr( "Resize application on Popup" ), this );
48 _float = new QCheckBox( tr( "Enable floating and resizing" ), this ); 49 _float = new QCheckBox( tr( "Enable floating and resizing" ), this );
49 50
50 QHBoxLayout* hbox = new QHBoxLayout( lay, 4 ); 51 QHBoxLayout* hbox = new QHBoxLayout( lay, 4 );
51 hbox->addWidget( new QLabel( "Initial Width:", this ) ); 52 hbox->addWidget( new QLabel( "Initial Width:", this ) );
52 _size = new QSpinBox( 10, 100, 10, this ); 53 _size = new QSpinBox( 10, 100, 10, this );
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
@@ -21,37 +21,40 @@
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
25 25
26*/ 26*/
27 27
28#ifndef __IMETHOD_SETTINGS_H__ 28#ifndef __IMETHOD_SETTINGS_H__
29#define __IMETHOD_SETTINGS_H__ 29#define __IMETHOD_SETTINGS_H__
30 30
31#include <qwidget.h> 31#include <qwidget.h>
32 32
33class QCheckBox; 33class QCheckBox;
34class QSpinBox; 34class QSpinBox;
35 35
36class InputMethodSettings : public QWidget 36class InputMethodSettings : public QWidget
37{ 37{
38 Q_OBJECT 38 Q_OBJECT
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