src/hbinput/inputwidgets/hbinputsettinglist.cpp
changeset 21 4633027730f5
parent 7 923ff622b8b9
child 23 e6ad4ef83b23
--- a/src/hbinput/inputwidgets/hbinputsettinglist.cpp	Tue Jul 06 14:36:53 2010 +0300
+++ b/src/hbinput/inputwidgets/hbinputsettinglist.cpp	Wed Aug 18 10:05:37 2010 +0300
@@ -68,10 +68,11 @@
     HbInputLanguage mSecondaryLanguage;
     QList<QString> mPredictionValues;
     HbInputMethodSelectionList *mInputMethodSelectionList;
+    bool mIsPredictionDisabled;
 };
 
 HbInputSettingListPrivate::HbInputSettingListPrivate()
- : mLanguageButton(0), mPredictionButton(0), mOptionList(0), mInputMethodSelectionList(0)
+ : mLanguageButton(0), mPredictionButton(0), mOptionList(0), mInputMethodSelectionList(0), mIsPredictionDisabled(false)
 {
 }
 
@@ -193,6 +194,7 @@
 
     // Make sure the input settings list never steals focus.
     setFlag(QGraphicsItem::ItemIsPanel, true);
+    d->mActivePopup = false;
     setActive(false);
 
     connect(d->mLanguageButton, SIGNAL(clicked(bool)), this, SLOT(languageButtonClicked()));
@@ -240,6 +242,15 @@
     } else if (d->mOptionList->count() == 2 && !showInputMethod) {
         delete d->mOptionList->takeItem(0);
     }
+
+    HbInputMethod* input = HbInputMethod::activeInputMethod();
+
+    if (input && input->focusObject() && input->focusObject()->editorInterface().inputConstraints() & HbEditorConstraintLatinAlphabetOnly){
+        setLanguageSelectionEnabled(false);
+    } else {
+        setLanguageSelectionEnabled(true);
+    }
+
 }
 
 /*!
@@ -287,7 +298,6 @@
         emit inputSettingsButtonClicked();
     } else {
         HbInputLanguage language = d->mPrimaryLanguage;
-        bool oldPLangSupportsPrediction = (predFactory->predictionEngineForLanguage(language) != NULL);
         d->mPrimaryLanguage = d->mSecondaryLanguage;
         d->mSecondaryLanguage = language;
 
@@ -295,8 +305,13 @@
         bool langSupportsPrediction = (predFactory->predictionEngineForLanguage(d->mPrimaryLanguage) != NULL);
         HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(d->mSecondaryLanguage);
 
-        if (oldPLangSupportsPrediction != langSupportsPrediction) {
-            settings->setPredictiveInputStatusForActiveKeyboard(langSupportsPrediction);
+		bool predictionStatus = settings->predictiveInputStatusForActiveKeyboard();
+        if (!langSupportsPrediction && predictionStatus) {
+            d->mIsPredictionDisabled = true;
+            settings->setPredictiveInputStatusForActiveKeyboard(false);
+        } else if(d->mIsPredictionDisabled){
+            settings->setPredictiveInputStatusForActiveKeyboard(true);
+            d->mIsPredictionDisabled = false;
         }
     }