151 // setGraphicsEffect(effect); |
151 // setGraphicsEffect(effect); |
152 #endif |
152 #endif |
153 |
153 |
154 connect(d->mLanguageButton, SIGNAL(clicked(bool)), this, SLOT(languageButtonClicked())); |
154 connect(d->mLanguageButton, SIGNAL(clicked(bool)), this, SLOT(languageButtonClicked())); |
155 connect(d->mPredictionButton, SIGNAL(clicked(bool)), this, SLOT(predictionButtonClicked())); |
155 connect(d->mPredictionButton, SIGNAL(clicked(bool)), this, SLOT(predictionButtonClicked())); |
156 connect(d->mOptionList, SIGNAL(activated(HbListWidgetItem *)), this, SLOT(listItemActivated(HbListWidgetItem *))); |
156 connect(d->mOptionList, SIGNAL(activated(HbListWidgetItem*)), this, SLOT(listItemActivated(HbListWidgetItem*))); |
|
157 connect(d->mOptionList, SIGNAL(longPressed(HbListWidgetItem*, const QPointF&)), this, SLOT(listItemActivated(HbListWidgetItem*))); |
157 |
158 |
158 HbInputSettingProxy *settings = HbInputSettingProxy::instance(); |
159 HbInputSettingProxy *settings = HbInputSettingProxy::instance(); |
159 connect(settings, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), this, SLOT(primaryLanguageChanged(const HbInputLanguage &))); |
160 connect(settings, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), this, SLOT(primaryLanguageChanged(const HbInputLanguage &))); |
160 connect(settings, SIGNAL(globalSecondaryInputLanguageChanged(const HbInputLanguage &)), this, SLOT(secondaryLanguageChanged(const HbInputLanguage &))); |
161 connect(settings, SIGNAL(globalSecondaryInputLanguageChanged(const HbInputLanguage &)), this, SLOT(secondaryLanguageChanged(const HbInputLanguage &))); |
161 connect(settings, SIGNAL(predictiveInputStateChanged(int)), this, SLOT(predictionStatusChanged(int))); |
162 connect(settings, SIGNAL(predictiveInputStateChanged(HbKeyboardSettingFlags, bool)), this, SLOT(predictionStatusChanged(HbKeyboardSettingFlags, bool))); |
162 |
|
163 connect(this, SIGNAL(aboutToClose()), this, SLOT(saveSettings())); |
|
164 } |
163 } |
165 |
164 |
166 /*! |
165 /*! |
167 Destructs the object. |
166 Destructs the object. |
168 */ |
167 */ |
169 HbInputSettingList::~HbInputSettingList() |
168 HbInputSettingList::~HbInputSettingList() |
170 { |
169 { |
171 } |
170 } |
172 |
171 |
173 /*! |
172 /*! |
174 Opens the setting list |
173 \deprecated HbInputSettingList::showSettingList() |
|
174 is deprecated. Use updateSettingList and open functions instead. |
175 */ |
175 */ |
176 void HbInputSettingList::showSettingList() |
176 void HbInputSettingList::showSettingList() |
|
177 { |
|
178 } |
|
179 |
|
180 /*! |
|
181 Updates settings list with current values |
|
182 */ |
|
183 void HbInputSettingList::updateSettingList() |
177 { |
184 { |
178 Q_D(HbInputSettingList); |
185 Q_D(HbInputSettingList); |
179 |
186 |
180 HbInputSettingProxy *settings = HbInputSettingProxy::instance(); |
187 HbInputSettingProxy *settings = HbInputSettingProxy::instance(); |
181 d->mPrimaryLanguage = settings->globalInputLanguage(); |
188 d->mPrimaryLanguage = settings->globalInputLanguage(); |
182 d->mSecondaryLanguage = settings->globalSecondaryInputLanguage(); |
189 d->mSecondaryLanguage = settings->globalSecondaryInputLanguage(); |
183 |
190 |
184 d->mLanguageButton->setText(d->mPrimaryLanguage.localisedName()); |
191 d->mLanguageButton->setText(d->mPrimaryLanguage.localisedName()); |
185 d->mPredictionButton->setText(d->mPredictionValues.at(settings->predictiveInputStatus())); |
192 d->mPredictionButton->setText(d->mPredictionValues.at(settings->predictiveInputStatusForActiveKeyboard())); |
186 |
193 |
187 QList<HbInputMethodDescriptor> customList = HbInputMethod::listCustomInputMethods(); |
194 QList<HbInputMethodDescriptor> customList = HbInputMethod::listCustomInputMethods(); |
188 bool showInputMethod = true; |
195 bool showInputMethod = true; |
189 if (customList.count() < 1) { |
196 if (customList.count() < 1) { |
190 showInputMethod = false; |
197 showInputMethod = false; |
231 } else { |
236 } else { |
232 HbInputLanguage language = d->mPrimaryLanguage; |
237 HbInputLanguage language = d->mPrimaryLanguage; |
233 d->mPrimaryLanguage = d->mSecondaryLanguage; |
238 d->mPrimaryLanguage = d->mSecondaryLanguage; |
234 d->mSecondaryLanguage = language; |
239 d->mSecondaryLanguage = language; |
235 |
240 |
236 primaryLanguageChanged(d->mPrimaryLanguage); |
241 HbInputSettingProxy::instance()->setGlobalInputLanguage(d->mPrimaryLanguage); |
|
242 HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(d->mSecondaryLanguage); |
|
243 |
|
244 if (!HbPredictionFactory::instance()->predictionEngineForLanguage(d->mPrimaryLanguage)) { |
|
245 HbInputSettingProxy::instance()->setPredictiveInputStatus(false); |
|
246 } |
237 } |
247 } |
238 |
248 |
239 close(); |
249 close(); |
240 } |
250 } |
241 |
251 |
242 /*! |
252 /*! |
243 Toggles prediction state |
253 Toggles prediction state |
244 */ |
254 */ |
245 void HbInputSettingList::predictionButtonClicked() |
255 void HbInputSettingList::predictionButtonClicked() |
246 { |
256 { |
247 HbInputSettingProxy *settings = HbInputSettingProxy::instance(); |
257 HbInputSettingProxy::instance()->togglePrediction(); |
248 settings->setPredictiveInputStatus(!settings->predictiveInputStatus()); |
|
249 |
258 |
250 close(); |
259 close(); |
251 } |
260 } |
252 |
261 |
253 /*! |
262 /*! |
286 |
295 |
287 d->mSecondaryLanguage = HbInputLanguage(newLanguage); |
296 d->mSecondaryLanguage = HbInputLanguage(newLanguage); |
288 } |
297 } |
289 |
298 |
290 /*! |
299 /*! |
|
300 \deprecated HbInputSettingList::predictionStatusChanged(int) |
|
301 is deprecated. Use predictionStatusChanged(bool) instead. |
|
302 |
291 Updates prediction button text |
303 Updates prediction button text |
292 */ |
304 */ |
293 void HbInputSettingList::predictionStatusChanged(int newStatus) |
305 void HbInputSettingList::predictionStatusChanged(int newStatus) |
294 { |
306 { |
295 Q_D(HbInputSettingList); |
307 Q_UNUSED(newStatus); |
296 |
308 } |
297 d->mPredictionButton->setText(d->mPredictionValues.at(newStatus)); |
309 |
298 } |
310 /*! |
299 |
311 Updates prediction button text |
300 /*! |
312 */ |
301 Stores the current language selection |
313 void HbInputSettingList::predictionStatusChanged(HbKeyboardSettingFlags keyboardType, bool newStatus) |
|
314 { |
|
315 Q_D(HbInputSettingList); |
|
316 Q_UNUSED(keyboardType); |
|
317 Q_UNUSED(newStatus); |
|
318 |
|
319 bool status = HbInputSettingProxy::instance()->predictiveInputStatusForActiveKeyboard(); |
|
320 d->mPredictionButton->setText(d->mPredictionValues.at(status)); |
|
321 } |
|
322 |
|
323 /*! |
|
324 \deprecated HbInputSettingList::saveSettings() |
|
325 is deprecated. Will be removed. |
302 */ |
326 */ |
303 void HbInputSettingList::saveSettings() |
327 void HbInputSettingList::saveSettings() |
304 { |
328 { |
305 Q_D(HbInputSettingList); |
|
306 |
|
307 HbInputSettingProxy *settings = HbInputSettingProxy::instance(); |
|
308 HbPredictionFactory *predFactory = HbPredictionFactory::instance(); |
|
309 |
|
310 if (d->mPrimaryLanguage != settings->globalInputLanguage()) { |
|
311 settings->setGlobalInputLanguage(d->mPrimaryLanguage); |
|
312 settings->setGlobalSecondaryInputLanguage(d->mSecondaryLanguage); |
|
313 if(!predFactory->predictionEngineForLanguage(d->mPrimaryLanguage)) { |
|
314 predictionStatusChanged(false); |
|
315 settings->setPredictiveInputStatus(false); |
|
316 } |
|
317 } |
|
318 } |
329 } |
319 |
330 |
320 // End of file |
331 // End of file |
321 |
|