author | zecke <zecke> | 2004-08-22 21:35:22 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-22 21:35:22 (UTC) |
commit | 8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5 (patch) (side-by-side diff) | |
tree | caf4d5d4cab240f2e7653b394666c5e2fb178798 /core/launcher | |
parent | 2304c546ec73f2643621f04d61128c2686812cd1 (diff) | |
download | opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.zip opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.tar.gz opie-8b5ab9a283c219aaba84a8b23adc6c3d29cef7d5.tar.bz2 |
Reload InputMethods when LauncherSettings changed InputMethod Options
-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 |
4 files changed, 28 insertions, 11 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 @@ -86,17 +86,13 @@ public: InputMethods::InputMethods( QWidget *parent ) : QWidget( parent, "InputMethods", WStyle_Tool | WStyle_Customize ), mkeyboard(0), imethod(0) { - 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(); setBackgroundMode( PaletteBackground ); QHBoxLayout *hbox = new QHBoxLayout( this ); kbdButton = new IMToolButton( this); kbdButton->setFocusPolicy(NoFocus); @@ -529,13 +525,13 @@ void InputMethods::showKbd( bool on ) if ( on ) { mkeyboard->resetState(); 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; int top = mapToGlobal( QPoint() ).y() - height; if ( inputWidgetStyle & QWidget::WStyle_DialogBorder ) { odebug << "InputMethods: reading geometry." << oendl; @@ -605,17 +601,27 @@ void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool pr { #if defined(Q_WS_QWS) QWSServer::sendKeyEvent( unicode, scancode, mod, press, repeat ); #endif } -bool InputMethods::eventFilter( QObject* o, QEvent* e ) +bool InputMethods::eventFilter( QObject* , QEvent* e ) { if ( e->type() == QEvent::Close ) { ( (QCloseEvent*) e )->ignore(); showKbd( false ); kbdButton->setOn( false ); return true; } return false; } + +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 @@ -71,12 +71,13 @@ public: void showInputMethod(const QString& id); void showInputMethod(); void hideInputMethod(); void unloadInputMethods(); void loadInputMethods(); virtual bool eventFilter( QObject *, QEvent * ); + void readConfig(); signals: void inputToggled( bool on ); private slots: void chooseKbd(); 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 @@ -173,15 +173,14 @@ TaskBar::~TaskBar() { } TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) { - Config cfg( "Launcher" ); - cfg.setGroup( "InputMethods" ); - resizeRunningApp = cfg.readBoolEntry( "Resize", true ); + /* Read InputMethod Config */ + readConfig(); sm = new StartMenu( this ); connect( sm, SIGNAL(tabSelected(const QString&)), this, SIGNAL(tabSelected(const QString&)) ); inputMethods = new InputMethods( this ); @@ -332,12 +331,14 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data ) inputMethods->showInputMethod(); } else if ( msg == "showInputMethod(QString)" ) { QString name; stream >> name; inputMethods->showInputMethod(name); } else if ( msg == "reloadInputMethods()" ) { + readConfig(); + inputMethods->readConfig(); inputMethods->loadInputMethods(); } else if ( msg == "reloadApplets()" ) { sysTray->clearApplets(); sm->createMenu(); sysTray->addApplets(); }else if ( msg == "toggleMenu()" ) { @@ -374,7 +375,13 @@ void TaskBar::toggleSymbolInput() inputMethods->hideInputMethod(); } else { inputMethods->showInputMethod( unicodeInput ); } } +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 @@ -62,17 +62,20 @@ public slots: void calcMaxWindowRect(); protected: void resizeEvent( QResizeEvent * ); void styleChange( QStyle & ); void setStatusMessage( const QString &text ); - + private slots: void receive( const QCString &msg, const QByteArray &data ); private: + void readConfig(); + +private: QTimer *waitTimer; Wait *waitIcon; InputMethods *inputMethods; SysTray *sysTray; RunningAppBar* runningAppBar; QWidgetStack *stack; |