diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputcommondialogs.cpp --- a/src/hbinput/inputwidgets/hbinputcommondialogs.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputcommondialogs.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputcommondialogs.h" + #include #include @@ -31,8 +33,7 @@ #include #include #include - -#include "hbinputcommondialogs.h" +#include /// @cond @@ -51,35 +52,33 @@ */ HbInputLanguage HbInputCommonDialogs::showLanguageSelectionDialog(QLocale::Language selectedLanguage, const QList languageList) { - HbSelectionDialog* langDialog = new HbSelectionDialog(); + HbSelectionDialog *langDialog = new HbSelectionDialog(); langDialog->setObjectName("Language dialog"); -#if QT_VERSION >= 0x040600 // Make sure the language dialog never steals focus. langDialog->setFlag(QGraphicsItem::ItemIsPanel, true); langDialog->setActive(false); -#endif - HbInputSettingProxy* settings = HbInputSettingProxy::instance(); + HbInputSettingProxy *settings = HbInputSettingProxy::instance(); HbInputLanguage currentLang = settings->globalInputLanguage(); QList languages; if (languageList.count() == 0) { HbInputUtils::listSupportedInputLanguages(languages); } else { - languages=languageList; + languages = languageList; } - - qStableSort(languages.begin(), languages.end(), caseInsensitiveLessThanForHbInputLanguage); - QList listItems; - HbListWidgetItem* item = 0; - foreach( HbInputLanguage language, languages ) { - QString langName = language.localisedName(); + + qStableSort(languages.begin(), languages.end(), caseInsensitiveLessThanForHbInputLanguage); + QList listItems; + HbListWidgetItem *item = 0; + foreach(HbInputLanguage language, languages) { + QString langName = language.localisedName(); if (langName.length() == 0) { langName = QString("Unknown"); } item = new HbListWidgetItem(); item->setText(langName); - if (language == currentLang ) { + if (language == currentLang) { QList selected; selected.append(listItems.count()); langDialog->setSelectedItems(selected); @@ -97,12 +96,13 @@ langDialog->setDismissPolicy(HbPopup::NoDismiss); langDialog->setModal(true); //langDialog->exec(); TODO + HbInputRegionCollector::instance()->attach(langDialog); //TODO: needed to check from action which button was pressed (ok, cancel) //HbAction* action = langDialog->exec(); if (langDialog->selectedItems().count()) { int selection = langDialog->selectedItems().at(0).toInt(); HbInputLanguage result; - if(languages.at(selection).language() == QLocale::Chinese) { + if (languages.at(selection).language() == QLocale::Chinese) { result = languages.at(selection); } else { result = languages.at(selection).language(); @@ -122,26 +122,24 @@ { Q_UNUSED(language); - HbSelectionDialog* methodDialog = new HbSelectionDialog(); + HbSelectionDialog *methodDialog = new HbSelectionDialog(); methodDialog->setObjectName("Input method dialog"); -#if QT_VERSION >= 0x040600 // Make sure the language dialog never steals focus. methodDialog->setFlag(QGraphicsItem::ItemIsPanel, true); methodDialog->setActive(false); -#endif QList customList = HbInputMethod::listCustomInputMethods(); - QList listItems; - HbListWidgetItem* item = new HbListWidgetItem(); + QList listItems; + HbListWidgetItem *item = new HbListWidgetItem(); QString methodName("Default"); item->setText(methodName); listItems.append(item); //for (int i=0; isetDismissPolicy(HbPopup::NoDismiss); methodDialog->setModal(true); //methodDialog->exec(); TODO + HbInputRegionCollector::instance()->attach(methodDialog); //TODO: needed to check from action which button was pressed (ok, cancel) //HbAction* action = langDialog->exec(); @@ -161,9 +160,9 @@ if (methodDialog->selectedItems().count()) { int selection = methodDialog->selectedItems().first().toInt(); if (selection == 0) { - result.setDefault(); + result.setDefault(); } else { - result = customList[selection-1]; + result = customList[selection-1]; } }