summaryrefslogtreecommitdiff
path: root/core/launcher
Unidiff
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
@@ -86,17 +86,13 @@ public:
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);
@@ -529,13 +525,13 @@ void InputMethods::showKbd( bool on )
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;
@@ -605,17 +601,27 @@ void InputMethods::sendKey( ushort unicode, ushort scancode, ushort mod, bool pr
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
@@ -71,12 +71,13 @@ public:
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();
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()
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 );
@@ -332,12 +331,14 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data )
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()" ) {
@@ -374,7 +375,13 @@ void TaskBar::toggleSymbolInput()
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
@@ -62,17 +62,20 @@ public slots:
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;