equal
deleted
inserted
replaced
33 #include <hbaction.h> |
33 #include <hbaction.h> |
34 #include <hbmainwindow.h> |
34 #include <hbmainwindow.h> |
35 #include <hbinstance.h> |
35 #include <hbinstance.h> |
36 #include <hbeffect.h> |
36 #include <hbeffect.h> |
37 #include <hbinputregioncollector_p.h> |
37 #include <hbinputregioncollector_p.h> |
|
38 #include <hbinputmainwindow_p.h> |
38 |
39 |
39 #include "hbinputspellquerydialog.h" |
40 #include "hbinputspellquerydialog.h" |
40 #include "hbinputmodehandler.h" |
41 #include "hbinputmodehandler.h" |
41 |
42 |
42 static const qint16 MAXUDBWORDSIZE = 64; |
43 static const qint16 MAXUDBWORDSIZE = 64; |
91 } |
92 } |
92 // execute the spell dialog |
93 // execute the spell dialog |
93 mSavedFocusObject = focusObject->object(); |
94 mSavedFocusObject = focusObject->object(); |
94 mSavedEditorText = editorText; |
95 mSavedEditorText = editorText; |
95 mDidHandleFinish = false; |
96 mDidHandleFinish = false; |
96 mainWindow()->setProperty("SpellQueryLaunched", true); |
97 HbInputMainWindow::instance()->lockFocus(); |
97 open(this,SLOT(dialogClosed(HbAction*))); |
98 open(this,SLOT(dialogClosed(HbAction*))); |
98 mPrimaryAction = qobject_cast<HbAction*>(actions().first()); |
99 mPrimaryAction = qobject_cast<HbAction*>(actions().first()); |
99 |
100 |
100 // Open keypad for the spell query |
101 // Open keypad for the spell query |
101 QInputContext *ic = qApp->inputContext(); |
102 QInputContext *ic = qApp->inputContext(); |
106 } |
107 } |
107 } |
108 } |
108 |
109 |
109 void HbInputSpellQuery::dialogClosed(HbAction* action) |
110 void HbInputSpellQuery::dialogClosed(HbAction* action) |
110 { |
111 { |
111 mainWindow()->setProperty("SpellQueryLaunched", false); |
|
112 //There are multiple dialog closed event received. This will make sure we handle finish |
112 //There are multiple dialog closed event received. This will make sure we handle finish |
113 //only once |
113 //only once |
114 if(mDidHandleFinish) { |
114 if(mDidHandleFinish) { |
115 return; |
115 return; |
116 } else { |
116 } else { |
131 } |
131 } |
132 //Need to disable effects as asynchronous hide will commit the word otherwise. |
132 //Need to disable effects as asynchronous hide will commit the word otherwise. |
133 HbEffect::disable(this); |
133 HbEffect::disable(this); |
134 hide(); |
134 hide(); |
135 HbEffect::enable(this); |
135 HbEffect::enable(this); |
136 |
136 |
|
137 HbInputMainWindow::instance()->unlockFocus(); |
|
138 |
137 mPredictionHandler->spellQueryDialogClosed(mSavedFocusObject,closeReason,string); |
139 mPredictionHandler->spellQueryDialogClosed(mSavedFocusObject,closeReason,string); |
138 mSavedFocusObject = 0; |
140 mSavedFocusObject = 0; |
139 mSavedEditorText.clear(); |
141 mSavedEditorText.clear(); |
140 mPrimaryAction = 0; |
142 mPrimaryAction = 0; |
141 } |
143 } |