summaryrefslogtreecommitdiff
path: root/core/launcher
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/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/launcher') (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
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
@@ -89,11 +89,7 @@ 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 );
@@ -532,7 +528,7 @@ void InputMethods::showKbd( bool 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;
@@ -608,7 +604,7 @@ void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool pr
#endif
}
-bool InputMethods::eventFilter( QObject* o, QEvent* e )
+bool InputMethods::eventFilter( QObject* , QEvent* e )
{
if ( e->type() == QEvent::Close )
{
@@ -619,3 +615,13 @@ bool InputMethods::eventFilter( QObject* o, QEvent* e )
}
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
@@ -74,6 +74,7 @@ public:
void unloadInputMethods();
void loadInputMethods();
virtual bool eventFilter( QObject *, QEvent * );
+ void readConfig();
signals:
void inputToggled( bool on );
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
@@ -176,9 +176,8 @@ 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,
@@ -335,6 +334,8 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data )
stream >> name;
inputMethods->showInputMethod(name);
} else if ( msg == "reloadInputMethods()" ) {
+ readConfig();
+ inputMethods->readConfig();
inputMethods->loadInputMethods();
} else if ( msg == "reloadApplets()" ) {
sysTray->clearApplets();
@@ -377,4 +378,10 @@ void TaskBar::toggleSymbolInput()
}
}
+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
@@ -65,11 +65,14 @@ 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;