src/hbinput/inputwidgets/hbinputsettingwidget.cpp
changeset 30 80e4d18b72f5
parent 23 e6ad4ef83b23
equal deleted inserted replaced
28:b7da29130b0e 30:80e4d18b72f5
    41 #include "hbinputsettingproxy_p.h"
    41 #include "hbinputsettingproxy_p.h"
    42 #include <hbinputmethoddescriptor.h>
    42 #include <hbinputmethoddescriptor.h>
    43 #include <hbinputmethod.h>
    43 #include <hbinputmethod.h>
    44 #include <hbmainwindow.h>
    44 #include <hbmainwindow.h>
    45 
    45 
       
    46 /*!
       
    47 @stable
       
    48 @hbinput
       
    49 \class HbInputSettingWidget
       
    50 \brief Displays settings for Hb inputs.
       
    51 
       
    52 This is a input settings widget to be embedded in e.g. control panel view or input settings popup.
       
    53 */
       
    54 
    46 const QString statusOff = QObject::tr("Off");
    55 const QString statusOff = QObject::tr("Off");
    47 const QString statusOn = QObject::tr("On");
    56 const QString statusOn = QObject::tr("On");
    48 const QString bestPrediction = QObject::tr("Best prediction");
    57 const QString bestPrediction = QObject::tr("Best prediction");
    49 const QString exactTyping = QObject::tr("Exact typing");
    58 const QString exactTyping = QObject::tr("Exact typing");
    50 
    59 
   418         mHwrSpeedItem->setContentWidgetData(QString("objectName"), QString("handwriting_speed"));
   427         mHwrSpeedItem->setContentWidgetData(QString("objectName"), QString("handwriting_speed"));
   419         mForm->addConnection(mHwrSpeedItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setHwrSpeed(int)));
   428         mForm->addConnection(mHwrSpeedItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setHwrSpeed(int)));
   420 
   429 
   421         mCnDefaultLanguageItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Default language for keyboard input"));
   430         mCnDefaultLanguageItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Default language for keyboard input"));
   422         mChineseInputGroup->appendChild(mCnDefaultLanguageItem);
   431         mChineseInputGroup->appendChild(mCnDefaultLanguageItem);
   423         int defaultLanguageIndex = HbInputSettingProxy::instance()->useWesternDefaultKeypadForChinese()?1:0;
   432         int defaultLanguageIndex = HbInputSettingProxy::instance()->useWesternDefaultKeypadForChinese() ? 1 : 0;
   424         mCnDefaultLanguageItem->setContentWidgetData(QString("items"), mCnDefaultLanguageNames);
   433         mCnDefaultLanguageItem->setContentWidgetData(QString("items"), mCnDefaultLanguageNames);
   425         mCnDefaultLanguageItem->setContentWidgetData(QString("currentIndex"), defaultLanguageIndex);
   434         mCnDefaultLanguageItem->setContentWidgetData(QString("currentIndex"), defaultLanguageIndex);
   426         mCnDefaultLanguageItem->setContentWidgetData(QString("objectName"), QString("default_language_for_keyboard_input"));
   435         mCnDefaultLanguageItem->setContentWidgetData(QString("objectName"), QString("default_language_for_keyboard_input"));
   427         mForm->addConnection(mCnDefaultLanguageItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setDefaultLanguageForKeyboardInput(int)));
   436         mForm->addConnection(mCnDefaultLanguageItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setDefaultLanguageForKeyboardInput(int)));
   428     }
   437     }
   474         mPrimaryCandidateItem->setContentWidgetData(QString("text"), exactTyping);
   483         mPrimaryCandidateItem->setContentWidgetData(QString("text"), exactTyping);
   475         mPrimaryCandidateItem->setContentWidgetData(QString("additionalText"), bestPrediction);
   484         mPrimaryCandidateItem->setContentWidgetData(QString("additionalText"), bestPrediction);
   476     }
   485     }
   477 
   486 
   478     if(mChineseInputGroup && mCnDefaultLanguageItem) {
   487     if(mChineseInputGroup && mCnDefaultLanguageItem) {
   479         int defaultLanguageIndex = HbInputSettingProxy::instance()->useWesternDefaultKeypadForChinese()?1:0;
   488         int defaultLanguageIndex = HbInputSettingProxy::instance()->useWesternDefaultKeypadForChinese() ? 1 : 0;
   480         mCnDefaultLanguageItem->setContentWidgetData(QString("currentIndex"), defaultLanguageIndex);
   489         mCnDefaultLanguageItem->setContentWidgetData(QString("currentIndex"), defaultLanguageIndex);
   481     }
   490     }
   482 }
   491 }
   483 
   492 
   484 /*!
   493 /*!
   586 
   595 
   587     if (mPrimaryInputLanguage.language() == QLocale::Chinese) {
   596     if (mPrimaryInputLanguage.language() == QLocale::Chinese) {
   588         createChineseSettingGroup(mModel);
   597         createChineseSettingGroup(mModel);
   589     }
   598     }
   590     mForm->setModel(mModel);
   599     mForm->setModel(mModel);
       
   600 
       
   601     // expand language selection
       
   602     QModelIndex index = mModel->indexFromItem(mLanguageGroup);
       
   603     mForm->setExpanded(index, true);
       
   604 
   591     QObject::connect(mModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), q, SLOT(dataChange(QModelIndex, QModelIndex)));
   605     QObject::connect(mModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), q, SLOT(dataChange(QModelIndex, QModelIndex)));
   592 }
   606 }
   593 
   607 
   594 /*!
   608 /*!
   595 Fills given list with language names in the language list
   609 Fills given list with language names in the language list