summaryrefslogtreecommitdiff
path: root/core/launcher/inputmethods.cpp
Unidiff
Diffstat (limited to 'core/launcher/inputmethods.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/inputmethods.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp
index 683f1e2..19e799a 100644
--- a/core/launcher/inputmethods.cpp
+++ b/core/launcher/inputmethods.cpp
@@ -100,98 +100,98 @@ InputMethods::InputMethods( QWidget *parent ) :
100 100
101 setBackgroundMode( PaletteBackground ); 101 setBackgroundMode( PaletteBackground );
102 QHBoxLayout *hbox = new QHBoxLayout( this ); 102 QHBoxLayout *hbox = new QHBoxLayout( this );
103 103
104 kbdButton = new IMToolButton( this); 104 kbdButton = new IMToolButton( this);
105 kbdButton->setFocusPolicy(NoFocus); 105 kbdButton->setFocusPolicy(NoFocus);
106 kbdButton->setToggleButton( TRUE ); 106 kbdButton->setToggleButton( TRUE );
107 if (parent->sizeHint().height() > 0) 107 if (parent->sizeHint().height() > 0)
108 kbdButton->setFixedHeight( parent->sizeHint().height() ); 108 kbdButton->setFixedHeight( parent->sizeHint().height() );
109 kbdButton->setFixedWidth( 32 ); 109 kbdButton->setFixedWidth( 32 );
110 kbdButton->setAutoRaise( TRUE ); 110 kbdButton->setAutoRaise( TRUE );
111 kbdButton->setUsesBigPixmap( TRUE ); 111 kbdButton->setUsesBigPixmap( TRUE );
112 hbox->addWidget( kbdButton ); 112 hbox->addWidget( kbdButton );
113 connect( kbdButton, SIGNAL(toggled(bool)), this, SLOT(showKbd(bool)) ); 113 connect( kbdButton, SIGNAL(toggled(bool)), this, SLOT(showKbd(bool)) );
114 114
115 kbdChoice = new IMToolButton( this ); 115 kbdChoice = new IMToolButton( this );
116 kbdChoice->setFocusPolicy(NoFocus); 116 kbdChoice->setFocusPolicy(NoFocus);
117 kbdChoice->setPixmap( QPixmap( (const char **)tri_xpm ) ); 117 kbdChoice->setPixmap( QPixmap( (const char **)tri_xpm ) );
118 if (parent->sizeHint().height() > 0) 118 if (parent->sizeHint().height() > 0)
119 kbdChoice->setFixedHeight( parent->sizeHint().height() ); 119 kbdChoice->setFixedHeight( parent->sizeHint().height() );
120 kbdChoice->setFixedWidth( 13 ); 120 kbdChoice->setFixedWidth( 13 );
121 kbdChoice->setAutoRaise( TRUE ); 121 kbdChoice->setAutoRaise( TRUE );
122 hbox->addWidget( kbdChoice ); 122 hbox->addWidget( kbdChoice );
123 connect( kbdChoice, SIGNAL(clicked()), this, SLOT(chooseKbd()) ); 123 connect( kbdChoice, SIGNAL(clicked()), this, SLOT(chooseKbd()) );
124 124
125 connect( (QPEApplication*)qApp, SIGNAL(clientMoused()), 125 connect( (QPEApplication*)qApp, SIGNAL(clientMoused()),
126 this, SLOT(resetStates()) ); 126 this, SLOT(resetStates()) );
127 127
128 128
129 imButton = new QWidgetStack( this ); // later a widget stack 129 imButton = new QWidgetStack( this ); // later a widget stack
130 imButton->setFocusPolicy(NoFocus); 130 imButton->setFocusPolicy(NoFocus);
131 if (parent->sizeHint().height() > 0) 131 if (parent->sizeHint().height() > 0)
132 imButton->setFixedHeight( parent->sizeHint().height() ); 132 imButton->setFixedHeight( parent->sizeHint().height() );
133 hbox->addWidget(imButton); 133 hbox->addWidget(imButton);
134 134
135 imChoice = new QToolButton( this ); 135 imChoice = new QToolButton( this );
136 imChoice->setFocusPolicy(NoFocus); 136 imChoice->setFocusPolicy(NoFocus);
137 imChoice->setPixmap( QPixmap( (const char **)tri_xpm ) ); 137 imChoice->setPixmap( QPixmap( (const char **)tri_xpm ) );
138 if (parent->sizeHint().height() > 0) 138 if (parent->sizeHint().height() > 0)
139 imChoice->setFixedHeight( parent->sizeHint().height() ); 139 imChoice->setFixedHeight( parent->sizeHint().height() );
140 imChoice->setFixedWidth( 13 ); 140 imChoice->setFixedWidth( 13 );
141 imChoice->setAutoRaise( TRUE ); 141 imChoice->setAutoRaise( TRUE );
142 hbox->addWidget( imChoice ); 142 hbox->addWidget( imChoice );
143 connect( imChoice, SIGNAL(clicked()), this, SLOT(chooseIm()) ); 143 connect( imChoice, SIGNAL(clicked()), this, SLOT(chooseIm()) );
144 144
145 loadInputMethods(); 145 loadInputMethods();
146 146
147 QCopChannel *channel = new QCopChannel( "QPE/IME", this ); 147 QCopChannel *channel = new QCopChannel( "QPE/IME", this );
148 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 148 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
149 this, SLOT(qcopReceive(const QCString&, const QByteArray&)) ); 149 this, SLOT(qcopReceive(const QCString&,const QByteArray&)) );
150} 150}
151 151
152InputMethods::~InputMethods() 152InputMethods::~InputMethods()
153{ 153{
154 Config cfg("qpe"); 154 Config cfg("qpe");
155 cfg.setGroup("InputMethod"); 155 cfg.setGroup("InputMethod");
156 if (imethod) 156 if (imethod)
157 cfg.writeEntry("im", imethod->name() ); 157 cfg.writeEntry("im", imethod->name() );
158 if (mkeyboard) 158 if (mkeyboard)
159 cfg.writeEntry("current", mkeyboard->name() ); 159 cfg.writeEntry("current", mkeyboard->name() );
160 160
161 unloadInputMethods(); 161 unloadInputMethods();
162} 162}
163 163
164void InputMethods::hideInputMethod() 164void InputMethods::hideInputMethod()
165{ 165{
166 kbdButton->setOn( FALSE ); 166 kbdButton->setOn( FALSE );
167} 167}
168 168
169void InputMethods::showInputMethod() 169void InputMethods::showInputMethod()
170{ 170{
171 kbdButton->setOn( TRUE ); 171 kbdButton->setOn( TRUE );
172} 172}
173 173
174void InputMethods::showInputMethod(const QString& name) 174void InputMethods::showInputMethod(const QString& name)
175{ 175{
176 int i = 0; 176 int i = 0;
177 QValueList<InputMethod>::Iterator it; 177 QValueList<InputMethod>::Iterator it;
178 InputMethod *im = 0; 178 InputMethod *im = 0;
179 for ( it = inputMethodList.begin(); it != inputMethodList.end(); ++it, i++ ) { 179 for ( it = inputMethodList.begin(); it != inputMethodList.end(); ++it, i++ ) {
180 QString lname = (*it).libName.mid((*it).libName.findRev('/') + 1); 180 QString lname = (*it).libName.mid((*it).libName.findRev('/') + 1);
181 if ( (*it).name() == name || lname == name ) { 181 if ( (*it).name() == name || lname == name ) {
182 im = &(*it); 182 im = &(*it);
183 break; 183 break;
184 } 184 }
185 } 185 }
186 if ( im ) 186 if ( im )
187 chooseKeyboard(im); 187 chooseKeyboard(im);
188} 188}
189 189
190void InputMethods::resetStates() 190void InputMethods::resetStates()
191{ 191{
192 if ( mkeyboard && !mkeyboard->newIM ) 192 if ( mkeyboard && !mkeyboard->newIM )
193 mkeyboard->interface->resetState(); 193 mkeyboard->interface->resetState();
194} 194}
195 195
196QRect InputMethods::inputRect() const 196QRect InputMethods::inputRect() const
197{ 197{