-rw-r--r-- | core/launcher/inputmethods.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp index 003dc77..da98e07 100644 --- a/core/launcher/inputmethods.cpp +++ b/core/launcher/inputmethods.cpp | |||
@@ -20,2 +20,3 @@ | |||
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_LANGLIST | ||
21 | #include "inputmethods.h" | 22 | #include "inputmethods.h" |
@@ -26,2 +27,3 @@ | |||
26 | #include <qpe/qlibrary.h> | 27 | #include <qpe/qlibrary.h> |
28 | #include <qpe/global.h> | ||
27 | 29 | ||
@@ -180,7 +182,9 @@ void InputMethods::loadInputMethods() | |||
180 | inputMethodList.append( input ); | 182 | inputMethodList.append( input ); |
181 | QString lang = getenv( "LANG" ); | 183 | |
182 | QTranslator * trans = new QTranslator(qApp); | ||
183 | QString type = (*it).left( (*it).find(".") ); | 184 | QString type = (*it).left( (*it).find(".") ); |
185 | QStringList langs = Global::languageList(); | ||
186 | for (QStringList::ConstIterator lit = langs.begin(); lit!=langs.end(); ++lit) { | ||
187 | QString lang = *lit; | ||
188 | QTranslator * trans = new QTranslator(qApp); | ||
184 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 189 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
185 | qDebug("tr for inputmethod: %s", tfn.latin1() ); | ||
186 | if ( trans->load( tfn )) | 190 | if ( trans->load( tfn )) |
@@ -189,2 +193,3 @@ void InputMethods::loadInputMethods() | |||
189 | delete trans; | 193 | delete trans; |
194 | } | ||
190 | } else { | 195 | } else { |
@@ -209,3 +214,17 @@ void InputMethods::loadInputMethods() | |||
209 | if ( !inputMethodList.isEmpty() ) { | 214 | if ( !inputMethodList.isEmpty() ) { |
215 | Config cfg("qpe"); | ||
216 | cfg.setGroup("InputMethod"); | ||
217 | QString curMethod = cfg.readEntry("current",""); | ||
218 | if(curMethod.isEmpty()) { | ||
210 | method = &inputMethodList[0]; | 219 | method = &inputMethodList[0]; |
220 | } else { | ||
221 | int i = 0; | ||
222 | QValueList<InputMethod>::Iterator it; | ||
223 | for ( it = inputMethodList.begin(); it != inputMethodList.end(); ++it, i++ ) { | ||
224 | if((*it).interface->name() == curMethod) { | ||
225 | method = &inputMethodList[i]; | ||
226 | // qDebug(curMethod); | ||
227 | } | ||
228 | } | ||
229 | } | ||
211 | kbdButton->setPixmap( *method->interface->icon() ); | 230 | kbdButton->setPixmap( *method->interface->icon() ); |
@@ -251,2 +270,5 @@ void InputMethods::chooseMethod(InputMethod* im) | |||
251 | method = im; | 270 | method = im; |
271 | Config cfg("qpe"); | ||
272 | cfg.setGroup("InputMethod"); | ||
273 | cfg.writeEntry("current", method->interface->name()); | ||
252 | kbdButton->setPixmap( *method->interface->icon() ); | 274 | kbdButton->setPixmap( *method->interface->icon() ); |