Merge lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-legacy into lp:ubuntu-keyboard
- ubuntu-keyboard-legacy
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-legacy |
Merge into: | lp:ubuntu-keyboard |
Diff against target: |
955 lines (+176/-131) 18 files modified
debian/ubuntu-keyboard-tests.install (+0/-1) qml/Keyboard.qml (+0/-5) src/lib/logic/eventhandler.cpp (+14/-7) src/lib/logic/eventhandler.h (+18/-6) src/lib/logic/layoutupdater.cpp (+8/-8) src/lib/logic/layoutupdater.h (+8/-6) src/lib/logic/logic.pri (+6/-6) src/lib/models/wordribbon.cpp (+32/-0) src/lib/models/wordribbon.h (+10/-0) src/plugin/inputmethod.cpp (+25/-15) src/plugin/inputmethod.h (+0/-1) src/plugin/inputmethod_p.h (+37/-60) src/plugin/plugin.pro (+2/-2) src/view/setup.cpp (+8/-7) src/view/setup.h (+2/-2) tests/unittests/ut_editor/ut_editor.cpp (+1/-1) tests/unittests/ut_word-candidates/ut_word-candidates.cpp (+4/-3) ubuntu-keyboard.pro (+1/-1) |
To merge this branch: | bzr merge lp:~thomas-moenicke/ubuntu-keyboard/ubuntu-keyboard-legacy |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+199675@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-01-21.
Commit message
removing legacy code
Description of the change
removing legacy code
- 128. By Thomas Moenicke
-
ciao model!
PS Jenkins bot (ps-jenkins) wrote : | # |
- 129. By Thomas Moenicke
-
removed LayoutGroup
- 130. By Thomas Moenicke
-
removed files from buildsystem: layoutupdater, layouthelper, keyboardloader, updatenotifier
- 131. By Thomas Moenicke
-
disabled benchmark
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:128
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 132. By Thomas Moenicke
-
removed obsolete style stuff
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:132
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 133. By Thomas Moenicke
-
TEMP_DISABLED is LEGACY_
CODE_TO_ BE_REMOVED
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:133
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 134. By Thomas Moenicke
-
removed benchmark from debian package
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:134
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 135. By Thomas Moenicke
-
enabled all plugins for jenkins
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:135
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:134
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
Preview Diff
1 | === modified file 'debian/ubuntu-keyboard-tests.install' |
2 | --- debian/ubuntu-keyboard-tests.install 2013-09-13 13:41:03 +0000 |
3 | +++ debian/ubuntu-keyboard-tests.install 2013-12-20 12:24:25 +0000 |
4 | @@ -1,3 +1,2 @@ |
5 | -usr/bin/ubuntu-keyboard-benchmark |
6 | /usr/share/maliit/tests/ubuntu-keyboard |
7 | |
8 | |
9 | === modified file 'qml/Keyboard.qml' |
10 | --- qml/Keyboard.qml 2013-11-15 14:19:50 +0000 |
11 | +++ qml/Keyboard.qml 2013-12-20 12:24:25 +0000 |
12 | @@ -41,7 +41,6 @@ |
13 | objectName: "fullScreenItem" |
14 | |
15 | property variant input_method: maliit_input_method |
16 | - property variant layout: maliit_layout |
17 | property variant event_handler: maliit_event_handler |
18 | |
19 | onHeightChanged: calculateSize(); |
20 | @@ -77,10 +76,6 @@ |
21 | |
22 | visible: true |
23 | |
24 | - // Expose details for use with Autopilot. |
25 | - //readonly property var layoutState: layout.keyboard_state |
26 | - //readonly property string activeView: layout.activeView |
27 | - |
28 | property int contentOrientation: maliit_geometry.orientation |
29 | onContentOrientationChanged: fullScreenItem.reportKeyboardVisibleRect(); |
30 | |
31 | |
32 | === modified file 'src/lib/logic/eventhandler.cpp' |
33 | --- src/lib/logic/eventhandler.cpp 2013-11-07 17:43:22 +0000 |
34 | +++ src/lib/logic/eventhandler.cpp 2013-12-20 12:24:25 +0000 |
35 | @@ -35,7 +35,7 @@ |
36 | |
37 | namespace MaliitKeyboard { |
38 | namespace Logic { |
39 | - |
40 | +#ifdef TEMP_DISABLED |
41 | class EventHandlerPrivate |
42 | { |
43 | public: |
44 | @@ -55,23 +55,28 @@ |
45 | Q_ASSERT(new_layout != 0); |
46 | Q_ASSERT(new_updater != 0); |
47 | } |
48 | - |
49 | +#endif |
50 | |
51 | //! \brief Performs event handling for Model::Layout instance, using a LayoutUpdater instance. |
52 | //! |
53 | //! Does not take ownership of either layout or updater. |
54 | -EventHandler::EventHandler(Model::Layout * const layout, |
55 | +EventHandler::EventHandler( |
56 | +#ifdef TEMP_DISABLED |
57 | + Model::Layout * const layout, |
58 | LayoutUpdater * const updater, |
59 | +#endif |
60 | QObject *parent) |
61 | : QObject(parent) |
62 | +#ifdef TEMP_DISABLED |
63 | , d_ptr(new EventHandlerPrivate(layout, updater)) |
64 | +#endif |
65 | {} |
66 | |
67 | |
68 | EventHandler::~EventHandler() |
69 | {} |
70 | |
71 | - |
72 | +#ifdef TEMP_DISABLED |
73 | void EventHandler::onExtendedKeysShown(const Key &key) |
74 | { |
75 | Q_D(EventHandler); |
76 | @@ -170,7 +175,6 @@ |
77 | Q_EMIT keyReleased(normal_key); |
78 | } |
79 | |
80 | - |
81 | void EventHandler::onPressAndHold(int index) |
82 | { |
83 | Q_D(EventHandler); |
84 | @@ -193,6 +197,7 @@ |
85 | |
86 | Q_EMIT keyLongPressed(key); |
87 | } |
88 | +#endif |
89 | |
90 | void EventHandler::onWordCandidatePressed(QString word) |
91 | { |
92 | @@ -205,13 +210,14 @@ |
93 | WordCandidate candidate(WordCandidate::SourcePrediction, word); |
94 | Q_EMIT wordCandidateReleased(candidate); |
95 | } |
96 | - |
97 | +#ifdef TEMP_DISABLED |
98 | void EventHandler::onLanguageChangeRequested(QString languageId) |
99 | { |
100 | Q_D(EventHandler); |
101 | |
102 | d->updater->setActiveKeyboardId(languageId); |
103 | } |
104 | +#endif |
105 | |
106 | void EventHandler::onKeyPressed(QString label, QString action) |
107 | { |
108 | @@ -243,6 +249,7 @@ |
109 | Q_EMIT keyReleased(key); |
110 | } |
111 | |
112 | +#ifdef TEMP_DISABLED |
113 | void EventHandler::onKeyEntered(QString label) |
114 | { |
115 | Key key; |
116 | @@ -259,7 +266,7 @@ |
117 | |
118 | Q_EMIT keyExited(key); |
119 | } |
120 | - |
121 | +#endif |
122 | |
123 | |
124 | }} // namespace Logic, MaliitKeyboard |
125 | |
126 | === modified file 'src/lib/logic/eventhandler.h' |
127 | --- src/lib/logic/eventhandler.h 2013-10-15 11:49:10 +0000 |
128 | +++ src/lib/logic/eventhandler.h 2013-12-20 12:24:25 +0000 |
129 | @@ -46,22 +46,29 @@ |
130 | namespace Logic { |
131 | |
132 | class LayoutUpdater; |
133 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
134 | class EventHandlerPrivate; |
135 | +#endif |
136 | |
137 | class EventHandler |
138 | : public QObject |
139 | { |
140 | Q_OBJECT |
141 | Q_DISABLE_COPY(EventHandler) |
142 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
143 | Q_DECLARE_PRIVATE(EventHandler) |
144 | +#endif |
145 | |
146 | public: |
147 | - explicit EventHandler(Model::Layout * const layout, |
148 | + explicit EventHandler( |
149 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
150 | + Model::Layout * const layout, |
151 | LayoutUpdater * const updater, |
152 | +#endif |
153 | QObject *parent = 0); |
154 | virtual ~EventHandler(); |
155 | |
156 | - |
157 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
158 | Q_SLOT void onExtendedKeysShown(const Key &key); |
159 | Q_SIGNAL void extendedKeysShown(const Key &key); |
160 | |
161 | @@ -70,30 +77,35 @@ |
162 | Q_INVOKABLE void onPressed(int index); |
163 | Q_INVOKABLE void onReleased(int index); |
164 | Q_INVOKABLE void onPressAndHold(int index); |
165 | - |
166 | +#endif |
167 | Q_INVOKABLE void onWordCandidatePressed(QString word); |
168 | Q_INVOKABLE void onWordCandidateReleased(QString word); |
169 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
170 | Q_INVOKABLE void onLanguageChangeRequested(QString languageId); |
171 | - |
172 | Q_INVOKABLE void onKeyEntered(QString label); |
173 | Q_INVOKABLE void onKeyExited(QString label); |
174 | +#endif |
175 | Q_INVOKABLE void onKeyPressed(QString label, QString action = QString()); |
176 | Q_INVOKABLE void onKeyReleased(QString label, QString action = QString()); |
177 | |
178 | // Key signals: |
179 | Q_SIGNAL void keyPressed(const Key &key); |
180 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
181 | Q_SIGNAL void keyLongPressed(const Key &key); |
182 | +#endif |
183 | Q_SIGNAL void keyReleased(const Key &key); |
184 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
185 | Q_SIGNAL void keyEntered(const Key &key); |
186 | Q_SIGNAL void keyExited(const Key &key); |
187 | - |
188 | +#endif |
189 | Q_SIGNAL void wordCandidatePressed(const WordCandidate &candidate); |
190 | Q_SIGNAL void wordCandidateReleased(const WordCandidate &candidate); |
191 | |
192 | Q_SIGNAL void languageChangeRequested(QString languageId); |
193 | - |
194 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
195 | private: |
196 | const QScopedPointer<EventHandlerPrivate> d_ptr; |
197 | +#endif |
198 | }; |
199 | |
200 | }} // namespace Logic, MaliitKeyboard |
201 | |
202 | === modified file 'src/lib/logic/layoutupdater.cpp' |
203 | --- src/lib/logic/layoutupdater.cpp 2013-11-07 17:43:22 +0000 |
204 | +++ src/lib/logic/layoutupdater.cpp 2013-12-20 12:24:25 +0000 |
205 | @@ -92,7 +92,7 @@ |
206 | area.setSize(QSize(a->keyAreaWidth(orientation), a->wordRibbonHeight(orientation))); |
207 | ribbon->setArea(area); |
208 | } |
209 | - |
210 | +#ifdef TEMP_DISABLED |
211 | bool updateWordRibbon(LayoutHelper *layout, |
212 | const WordCandidate &candidate, |
213 | const StyleAttributes *attributes, |
214 | @@ -118,7 +118,7 @@ |
215 | |
216 | return false; |
217 | } |
218 | - |
219 | +#endif |
220 | QRect adjustedRect(const QRect &rect, const QMargins &margins) |
221 | { |
222 | return rect.adjusted(margins.left(), margins.top(), -margins.right(), -margins.bottom()); |
223 | @@ -280,7 +280,7 @@ |
224 | Q_D(LayoutUpdater); |
225 | d->style = style; |
226 | } |
227 | - |
228 | +#ifdef TEMP_DISABLED |
229 | bool LayoutUpdater::isWordRibbonVisible() const |
230 | { |
231 | Q_D(const LayoutUpdater); |
232 | @@ -299,7 +299,7 @@ |
233 | Q_EMIT wordRibbonVisibleChanged(visible); |
234 | } |
235 | } |
236 | - |
237 | +#endif |
238 | //! \brief Modify visual appearance of a key, depending on state. |
239 | //! |
240 | //! Uses the currently active style and the key action to decide the visual |
241 | @@ -435,7 +435,7 @@ |
242 | d->layout->setExtendedPanel(KeyArea()); |
243 | d->layout->setActivePanel(LayoutHelper::CenterPanel); |
244 | } |
245 | - |
246 | +#ifdef TEMP_DISABLED |
247 | void LayoutUpdater::onWordCandidatesChanged(const WordCandidateList &candidates) |
248 | { |
249 | Q_D(LayoutUpdater); |
250 | @@ -463,12 +463,12 @@ |
251 | d->layout->wordRibbon()->appendCandidate(word_candidate); |
252 | } |
253 | } |
254 | - |
255 | +#endif |
256 | void LayoutUpdater::onExtendedKeysShown(const Key &main_key) |
257 | { |
258 | Q_UNUSED(main_key); |
259 | } |
260 | - |
261 | +#ifdef TEMP_DISABLED |
262 | void LayoutUpdater::onWordCandidatePressed(const WordCandidate &candidate) |
263 | { |
264 | Q_D(LayoutUpdater); |
265 | @@ -494,7 +494,7 @@ |
266 | } |
267 | } |
268 | } |
269 | - |
270 | +#endif |
271 | void LayoutUpdater::syncLayoutToView() |
272 | { |
273 | Q_D(const LayoutUpdater); |
274 | |
275 | === modified file 'src/lib/logic/layoutupdater.h' |
276 | --- src/lib/logic/layoutupdater.h 2013-07-19 12:05:07 +0000 |
277 | +++ src/lib/logic/layoutupdater.h 2013-12-20 12:24:25 +0000 |
278 | @@ -52,10 +52,11 @@ |
279 | Q_OBJECT |
280 | Q_DISABLE_COPY(LayoutUpdater) |
281 | Q_DECLARE_PRIVATE(LayoutUpdater) |
282 | +#ifdef TEMP_DISABLED |
283 | Q_PROPERTY(bool wordRibbonVisible READ isWordRibbonVisible |
284 | WRITE setWordRibbonVisible |
285 | NOTIFY wordRibbonVisibleChanged) |
286 | - |
287 | +#endif |
288 | public: |
289 | explicit LayoutUpdater(QObject *parent = 0); |
290 | virtual ~LayoutUpdater(); |
291 | @@ -71,11 +72,11 @@ |
292 | Q_SLOT void setOrientation(LayoutHelper::Orientation orientation); |
293 | |
294 | void setStyle(const SharedStyle &style); |
295 | - |
296 | +#ifdef TEMP_DISABLED |
297 | bool isWordRibbonVisible() const; |
298 | Q_SLOT void setWordRibbonVisible(bool visible); |
299 | Q_SIGNAL void wordRibbonVisibleChanged(bool visible); |
300 | - |
301 | +#endif |
302 | Key modifyKey(const Key &key, |
303 | KeyDescription::State state) const; |
304 | |
305 | @@ -89,18 +90,19 @@ |
306 | Q_SLOT void onKeyExited(const Key &key); |
307 | Q_SLOT void clearActiveKeysAndMagnifier(); |
308 | Q_SLOT void resetOnKeyboardClosed(); |
309 | +#ifdef TEMP_DISABLED |
310 | Q_SLOT void onWordCandidatesChanged(const WordCandidateList &candidates); |
311 | - |
312 | +#endif |
313 | // ExtendedKeyArea signal handlers: |
314 | Q_SLOT void onExtendedKeysShown(const Key &main_key); |
315 | - |
316 | +#ifdef TEMP_DISABLED |
317 | // WordCandidate signal handlers: |
318 | Q_SLOT void onWordCandidatePressed(const WordCandidate &candidate); |
319 | Q_SLOT void onWordCandidateReleased(const WordCandidate &candidate); |
320 | |
321 | Q_SIGNAL void wordCandidateSelected(const QString &candidate); |
322 | Q_SIGNAL void userCandidateSelected(const QString &candidate); |
323 | - |
324 | +#endif |
325 | Q_SIGNAL void addToUserDictionary(); |
326 | |
327 | Q_SIGNAL void keyboardTitleChanged(const QString &title); |
328 | |
329 | === modified file 'src/lib/logic/logic.pri' |
330 | --- src/lib/logic/logic.pri 2013-12-12 17:10:53 +0000 |
331 | +++ src/lib/logic/logic.pri 2013-12-20 12:24:25 +0000 |
332 | @@ -1,9 +1,9 @@ |
333 | LOGIC_DIR = ./logic |
334 | |
335 | HEADERS += \ |
336 | - logic/layouthelper.h \ |
337 | - logic/layoutupdater.h \ |
338 | - logic/keyboardloader.h \ |
339 | +# logic/layouthelper.h \ |
340 | +# logic/layoutupdater.h \ |
341 | +# logic/keyboardloader.h \ |
342 | logic/style.h \ |
343 | logic/abstractwordengine.h \ |
344 | logic/wordengine.h \ |
345 | @@ -12,9 +12,9 @@ |
346 | logic/languageplugininterface.h \ |
347 | |
348 | SOURCES += \ |
349 | - logic/layouthelper.cpp \ |
350 | - logic/layoutupdater.cpp \ |
351 | - logic/keyboardloader.cpp \ |
352 | +# logic/layouthelper.cpp \ |
353 | +# logic/layoutupdater.cpp \ |
354 | +# logic/keyboardloader.cpp \ |
355 | logic/style.cpp \ |
356 | logic/abstractwordengine.cpp \ |
357 | logic/wordengine.cpp \ |
358 | |
359 | === modified file 'src/lib/models/wordribbon.cpp' |
360 | --- src/lib/models/wordribbon.cpp 2013-08-09 15:22:29 +0000 |
361 | +++ src/lib/models/wordribbon.cpp 2013-12-20 12:24:25 +0000 |
362 | @@ -153,4 +153,36 @@ |
363 | Q_EMIT enabledChanged(m_enabled); |
364 | } |
365 | |
366 | +void WordRibbon::onWordCandidatePressed(const WordCandidate &candidate) |
367 | +{ |
368 | + appendCandidate(candidate); |
369 | +} |
370 | + |
371 | +//! \todo implement WordRibbon::onWordCandidateReleased() |
372 | +void WordRibbon::onWordCandidateReleased(const WordCandidate &candidate) |
373 | +{ |
374 | + if (candidate.source() == WordCandidate::SourcePrediction |
375 | + || candidate.source() == WordCandidate::SourceSpellChecking) { |
376 | + Q_EMIT wordCandidateSelected(candidate.word()); |
377 | + } else if (candidate.source() == WordCandidate::SourceUser) { |
378 | + Q_EMIT userCandidateSelected(candidate.word()); |
379 | + } |
380 | +} |
381 | + |
382 | +void WordRibbon::onWordCandidatesChanged(const WordCandidateList &candidates) |
383 | +{ |
384 | + clearCandidates(); |
385 | + |
386 | + for (int index = 0; index < candidates.count(); ++index) { |
387 | + WordCandidate word_candidate(candidates.at(index)); |
388 | + appendCandidate(word_candidate); |
389 | + } |
390 | +} |
391 | + |
392 | +void WordRibbon::setWordRibbonVisible(bool visible) |
393 | +{ |
394 | + Q_UNUSED(visible); |
395 | + clearCandidates(); |
396 | +} |
397 | + |
398 | } // namespace MaliitKeyboard |
399 | |
400 | === modified file 'src/lib/models/wordribbon.h' |
401 | --- src/lib/models/wordribbon.h 2013-08-09 15:22:29 +0000 |
402 | +++ src/lib/models/wordribbon.h 2013-12-20 12:24:25 +0000 |
403 | @@ -86,6 +86,16 @@ |
404 | bool enabled() const; |
405 | void setEnabled(bool enabled); |
406 | |
407 | + //! impl. from LayoutUpdater |
408 | + Q_SLOT void onWordCandidatePressed(const WordCandidate &candidate); |
409 | + Q_SLOT void onWordCandidateReleased(const WordCandidate &candidate); |
410 | + Q_SLOT void onWordCandidatesChanged(const WordCandidateList &candidates); |
411 | + |
412 | + Q_SIGNAL void wordCandidateSelected(const QString &candidate); |
413 | + Q_SIGNAL void userCandidateSelected(const QString &candidate); |
414 | + |
415 | + Q_SLOT void setWordRibbonVisible(bool visible); |
416 | + |
417 | Q_SIGNALS: |
418 | void enabledChanged(bool enabled); |
419 | }; |
420 | |
421 | === modified file 'src/plugin/inputmethod.cpp' |
422 | --- src/plugin/inputmethod.cpp 2013-11-21 13:26:12 +0000 |
423 | +++ src/plugin/inputmethod.cpp 2013-12-20 12:24:25 +0000 |
424 | @@ -37,8 +37,8 @@ |
425 | #include "models/wordribbon.h" |
426 | #include "models/layout.h" |
427 | |
428 | -#include "logic/layouthelper.h" |
429 | -#include "logic/style.h" |
430 | +// #include "logic/layouthelper.h" |
431 | +//#include "logic/style.h" |
432 | |
433 | #include "view/setup.h" |
434 | |
435 | @@ -83,19 +83,19 @@ |
436 | d->view->setGeometry(qGuiApp->primaryScreen()->geometry()); |
437 | |
438 | // FIXME: Reconnect feedback instance. |
439 | - Setup::connectAll(&d->layout.event_handler, &d->layout.updater, &d->editor); |
440 | - |
441 | + Setup::connectAll(&d->event_handler, &d->editor); |
442 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
443 | connect(&d->layout.helper, SIGNAL(centerPanelChanged(KeyArea,Logic::KeyOverrides)), |
444 | &d->layout.model, SLOT(setKeyArea(KeyArea))); |
445 | - |
446 | +#endif |
447 | connect(&d->editor, SIGNAL(autoCapsActivated()), this, SIGNAL(activateAutocaps())); |
448 | |
449 | connect(this, SIGNAL(contentTypeChanged(TextContentType)), this, SLOT(setContentType(TextContentType))); |
450 | connect(this, SIGNAL(activeLanguageChanged(QString)), d->editor.wordEngine(), SLOT(onLanguageChanged(QString))); |
451 | connect(d->m_geometry, SIGNAL(visibleRectChanged()), this, SLOT(onVisibleRectChanged())); |
452 | - |
453 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
454 | d->registerStyleSetting(host); |
455 | - |
456 | +#endif |
457 | d->registerFeedbackSetting(); |
458 | d->registerAutoCorrectSetting(); |
459 | d->registerAutoCapsSetting(); |
460 | @@ -143,6 +143,7 @@ |
461 | InputMethod::subViews(Maliit::HandlerState state) const |
462 | { |
463 | Q_UNUSED(state) |
464 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
465 | Q_D(const InputMethod); |
466 | |
467 | QList<MInputMethodSubView> views; |
468 | @@ -155,6 +156,9 @@ |
469 | } |
470 | |
471 | return views; |
472 | +#endif |
473 | + QList<MInputMethodSubView> views; |
474 | + return views; |
475 | } |
476 | |
477 | // called by settings change/language change |
478 | @@ -166,8 +170,10 @@ |
479 | Q_D(InputMethod); |
480 | |
481 | // FIXME: Perhaps better to let both LayoutUpdater share the same KeyboardLoader instance? |
482 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
483 | d->layout.updater.setActiveKeyboardId(id); |
484 | d->layout.model.setActiveView(id); |
485 | +#endif |
486 | |
487 | d->registerSystemLanguage(); |
488 | setActiveLanguage(d->systemLanguage); |
489 | @@ -178,7 +184,7 @@ |
490 | Q_UNUSED(state) |
491 | Q_D(const InputMethod); |
492 | |
493 | - return d->layout.updater.activeKeyboardId(); |
494 | + return d->activeLanguage; |
495 | } |
496 | |
497 | void InputMethod::handleFocusChange(bool focusIn) |
498 | @@ -211,26 +217,26 @@ |
499 | |
500 | bool InputMethod::imExtensionEvent(MImExtensionEvent *event) |
501 | { |
502 | - Q_D(InputMethod); |
503 | - |
504 | if (not event or event->type() != MImExtensionEvent::Update) { |
505 | return false; |
506 | } |
507 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
508 | + Q_D(InputMethod); |
509 | |
510 | MImUpdateEvent *update_event(static_cast<MImUpdateEvent *>(event)); |
511 | |
512 | d->notifier.notify(update_event); |
513 | - |
514 | +#endif |
515 | return true; |
516 | } |
517 | - |
518 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
519 | void InputMethod::onStyleSettingChanged() |
520 | { |
521 | Q_D(InputMethod); |
522 | d->style->setProfile(d->settings.style->value().toString()); |
523 | d->layout.model.setImageDirectory(d->style->directory(Style::Images)); |
524 | } |
525 | - |
526 | +#endif |
527 | void InputMethod::onAutoCorrectSettingChanged() |
528 | { |
529 | Q_D(InputMethod); |
530 | @@ -264,7 +270,7 @@ |
531 | d->truncateEnabledLanguageLocales(d->m_settings.enabledLanguages()); |
532 | Q_EMIT enabledLanguagesChanged(d->enabledLanguages); |
533 | } |
534 | - |
535 | +// todo remove |
536 | void InputMethod::setKeyOverrides(const QMap<QString, QSharedPointer<MKeyOverride> > &overrides) |
537 | { |
538 | Q_D(InputMethod); |
539 | @@ -291,9 +297,11 @@ |
540 | overriden_keys.insert(i.key(), overrideToKey(override)); |
541 | } |
542 | } |
543 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
544 | d->notifier.notifyOverride(overriden_keys); |
545 | +#endif |
546 | } |
547 | - |
548 | +// todo remove |
549 | void InputMethod::updateKey(const QString &key_id, |
550 | const MKeyOverride::KeyOverrideAttributes changed_attributes) |
551 | { |
552 | @@ -308,7 +316,9 @@ |
553 | Logic::KeyOverrides overrides_update; |
554 | |
555 | overrides_update.insert(key_id, override_key); |
556 | +#ifdef LEGACY_CODE_TO_BE_REMOVED |
557 | d->notifier.notifyOverride(overrides_update, true); |
558 | +#endif |
559 | } |
560 | } |
561 | |
562 | |
563 | === modified file 'src/plugin/inputmethod.h' |
564 | --- src/plugin/inputmethod.h 2013-11-15 14:19:50 +0000 |
565 | +++ src/plugin/inputmethod.h 2013-12-20 12:24:25 +0000 |
566 | @@ -119,7 +119,6 @@ |
567 | void windowGeometryRectChanged(QRect rect); |
568 | |
569 | private: |
570 | - Q_SLOT void onStyleSettingChanged(); |
571 | Q_SLOT void onAutoCorrectSettingChanged(); |
572 | Q_SLOT void onEnabledLanguageSettingsChanged(); |
573 | Q_SLOT void updateAutoCaps(); |
574 | |
575 | === modified file 'src/plugin/inputmethod_p.h' |
576 | --- src/plugin/inputmethod_p.h 2013-11-21 13:26:12 +0000 |
577 | +++ src/plugin/inputmethod_p.h 2013-12-20 12:24:25 +0000 |
578 | @@ -1,12 +1,11 @@ |
579 | |
580 | #include "inputmethod.h" |
581 | |
582 | +#include "logic/layoutupdater.h" |
583 | #include "editor.h" |
584 | #include "keyboardgeometry.h" |
585 | #include "keyboardsettings.h" |
586 | -#include "updatenotifier.h" |
587 | |
588 | -#include "logic/layoutupdater.h" |
589 | #include "logic/eventhandler.h" |
590 | #include "logic/wordengine.h" |
591 | |
592 | @@ -25,30 +24,6 @@ |
593 | typedef QSharedPointer<MKeyOverride> SharedOverride; |
594 | typedef QMap<QString, SharedOverride>::const_iterator OverridesIterator; |
595 | |
596 | -class Settings |
597 | -{ |
598 | -public: |
599 | - ScopedSetting style; |
600 | -}; |
601 | - |
602 | -class LayoutGroup |
603 | -{ |
604 | -public: |
605 | - Logic::LayoutHelper helper; |
606 | - Logic::LayoutUpdater updater; |
607 | - Model::Layout model; |
608 | - Logic::EventHandler event_handler; |
609 | - |
610 | - explicit LayoutGroup(); |
611 | -}; |
612 | - |
613 | -LayoutGroup::LayoutGroup() |
614 | - : helper() |
615 | - , updater() |
616 | - , model() |
617 | - , event_handler(&model, &updater) |
618 | -{} |
619 | - |
620 | QQuickView *createWindow(MAbstractInputMethodHost *host) |
621 | { |
622 | QScopedPointer<QQuickView> view(new QQuickView); |
623 | @@ -68,11 +43,8 @@ |
624 | public: |
625 | InputMethod* q; |
626 | Editor editor; |
627 | - SharedStyle style; |
628 | - UpdateNotifier notifier; |
629 | QMap<QString, SharedOverride> key_overrides; |
630 | - Settings settings; |
631 | - LayoutGroup layout; |
632 | + Logic::EventHandler event_handler; |
633 | MAbstractInputMethodHost* host; |
634 | QQuickView* view; |
635 | UbuntuApplicationApiWrapper* applicationApiWrapper; |
636 | @@ -88,15 +60,14 @@ |
637 | KeyboardGeometry *m_geometry; |
638 | KeyboardSettings m_settings; |
639 | |
640 | + WordRibbon* wordRibbon; |
641 | + |
642 | explicit InputMethodPrivate(InputMethod * const _q, |
643 | MAbstractInputMethodHost *host) |
644 | : q(_q) |
645 | , editor(EditorOptions(), new Model::Text, new Logic::WordEngine) |
646 | - , style(new Style) |
647 | - , notifier() |
648 | , key_overrides() |
649 | - , settings() |
650 | - , layout() |
651 | + , event_handler() |
652 | , host(host) |
653 | , view(0) |
654 | , applicationApiWrapper(new UbuntuApplicationApiWrapper) |
655 | @@ -109,6 +80,7 @@ |
656 | , appsCurrentOrientation(qGuiApp->primaryScreen()->orientation()) |
657 | , m_geometry(new KeyboardGeometry(q)) |
658 | , m_settings() |
659 | + , wordRibbon(new WordRibbon) |
660 | { |
661 | applicationApiWrapper->setGeometryItem(m_geometry); |
662 | |
663 | @@ -116,26 +88,33 @@ |
664 | |
665 | editor.setHost(host); |
666 | |
667 | - layout.updater.setLayout(&layout.helper); |
668 | - |
669 | - layout.updater.setStyle(style); |
670 | - |
671 | +#ifdef TEMP_DISABLED |
672 | const QSize &screen_size(view->screen()->size()); |
673 | layout.helper.setScreenSize(screen_size); |
674 | layout.helper.setAlignment(Logic::LayoutHelper::Bottom); |
675 | - |
676 | - QObject::connect(&layout.event_handler, SIGNAL(wordCandidatePressed(WordCandidate)), |
677 | - &layout.updater, SLOT( onWordCandidatePressed(WordCandidate) )); |
678 | - |
679 | - QObject::connect(&layout.event_handler, SIGNAL(wordCandidateReleased(WordCandidate)), |
680 | - &layout.updater, SLOT( onWordCandidateReleased(WordCandidate) )); |
681 | +#endif |
682 | + //! connect wordRibbon |
683 | + QObject::connect(&event_handler, SIGNAL(wordCandidatePressed(WordCandidate)), |
684 | + wordRibbon, SLOT( onWordCandidatePressed(WordCandidate) )); |
685 | + |
686 | + QObject::connect(&event_handler, SIGNAL(wordCandidateReleased(WordCandidate)), |
687 | + wordRibbon, SLOT( onWordCandidateReleased(WordCandidate) )); |
688 | + |
689 | + QObject::connect(&editor, SIGNAL(wordCandidatesChanged(WordCandidateList)), |
690 | + wordRibbon, SLOT(onWordCandidatesChanged(WordCandidateList))); |
691 | + |
692 | + QObject::connect(wordRibbon, SIGNAL(wordCandidateSelected(QString)), |
693 | + &editor, SLOT(replaceAndCommitPreedit(QString))); |
694 | + |
695 | + QObject::connect(wordRibbon, SIGNAL(userCandidateSelected(QString)), |
696 | + &editor, SLOT(addToUserDictionary(QString))); |
697 | |
698 | QObject::connect(&editor, SIGNAL(preeditEnabledChanged(bool)), |
699 | - &layout.updater, SLOT(setWordRibbonVisible(bool))); |
700 | + wordRibbon, SLOT(setWordRibbonVisible(bool))); |
701 | |
702 | - QObject::connect(&layout.updater, SIGNAL(wordCandidateSelected(QString)), |
703 | + QObject::connect(wordRibbon, SIGNAL(wordCandidateSelected(QString)), |
704 | editor.wordEngine(), SLOT(onWordCandidateSelected(QString))); |
705 | - |
706 | +#ifdef TEMP_DISABLED //this is also connected in inputmethod.cpp |
707 | QObject::connect(&layout.updater, SIGNAL(languageChanged(QString)), |
708 | editor.wordEngine(), SLOT(onLanguageChanged(QString))); |
709 | |
710 | @@ -143,7 +122,7 @@ |
711 | &layout.model, SLOT(setState(Model::Layout::State))); |
712 | |
713 | connectToNotifier(); |
714 | - |
715 | +#endif |
716 | #ifdef DISABLED_FLAGS_FROM_SURFACE |
717 | view->setFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint |
718 | | Qt::X11BypassWindowManagerHint | Qt::WindowDoesNotAcceptFocus); |
719 | @@ -197,24 +176,22 @@ |
720 | { |
721 | m_geometry->setOrientation(screenOrientation); |
722 | } |
723 | - |
724 | +#ifdef TEMP_DISABLED |
725 | void connectToNotifier() |
726 | { |
727 | - #ifdef TEMP_DISABLED |
728 | QObject::connect(¬ifier, SIGNAL(cursorPositionChanged(int, QString)), |
729 | &editor, SLOT(onCursorPositionChanged(int, QString))); |
730 | - #endif |
731 | + |
732 | QObject::connect(¬ifier, SIGNAL(keysOverriden(Logic::KeyOverrides, bool)), |
733 | &layout.helper, SLOT(onKeysOverriden(Logic::KeyOverrides, bool))); |
734 | } |
735 | - |
736 | +#endif |
737 | void setContextProperties(QQmlContext *qml_context) |
738 | { |
739 | qml_context->setContextProperty("maliit_input_method", q); |
740 | qml_context->setContextProperty("maliit_geometry", m_geometry); |
741 | - qml_context->setContextProperty("maliit_layout", &layout.model); |
742 | - qml_context->setContextProperty("maliit_event_handler", &layout.event_handler); |
743 | - qml_context->setContextProperty("maliit_wordribbon", layout.helper.wordRibbon()); |
744 | + qml_context->setContextProperty("maliit_event_handler", &event_handler); |
745 | + qml_context->setContextProperty("maliit_wordribbon", wordRibbon); |
746 | qml_context->setContextProperty("maliit_word_engine", editor.wordEngine()); |
747 | } |
748 | |
749 | @@ -222,7 +199,8 @@ |
750 | /* |
751 | * register settings |
752 | */ |
753 | - |
754 | +#ifdef TEMP_REMOVED |
755 | + //! probably not needed anymore |
756 | void registerStyleSetting(MAbstractInputMethodHost *host) |
757 | { |
758 | QVariantMap attributes; |
759 | @@ -241,7 +219,7 @@ |
760 | // Call manually for the first time to initialize dependent values: |
761 | q->onStyleSettingChanged(); |
762 | } |
763 | - |
764 | +#endif |
765 | void registerFeedbackSetting() |
766 | { |
767 | QObject::connect(&m_settings, SIGNAL(keyPressFeedbackChanged()), |
768 | @@ -290,12 +268,12 @@ |
769 | systemLanguage.truncate(2); |
770 | Q_EMIT q->systemLanguageChanged(systemLanguage); |
771 | } |
772 | - |
773 | +#ifdef TEMP_DISABLED |
774 | void onScreenSizeChange(const QSize &size) |
775 | { |
776 | layout.helper.setScreenSize(size); |
777 | } |
778 | - |
779 | +#endif |
780 | void closeOskWindow() |
781 | { |
782 | if (!view->isVisible()) |
783 | @@ -305,7 +283,6 @@ |
784 | |
785 | m_geometry->setShown(false); |
786 | |
787 | - layout.updater.resetOnKeyboardClosed(); |
788 | editor.clearPreedit(); |
789 | |
790 | view->setVisible(false); |
791 | |
792 | === modified file 'src/plugin/plugin.pro' |
793 | --- src/plugin/plugin.pro 2013-11-13 15:19:04 +0000 |
794 | +++ src/plugin/plugin.pro 2013-12-20 12:24:25 +0000 |
795 | @@ -29,7 +29,7 @@ |
796 | editor.h \ |
797 | keyboardgeometry.h \ |
798 | keyboardsettings.h \ |
799 | - updatenotifier.h \ |
800 | +# updatenotifier.h \ |
801 | ubuntuapplicationapiwrapper.h \ |
802 | |
803 | SOURCES += \ |
804 | @@ -38,7 +38,7 @@ |
805 | editor.cpp \ |
806 | keyboardgeometry.cpp \ |
807 | keyboardsettings.cpp \ |
808 | - updatenotifier.cpp \ |
809 | +# updatenotifier.cpp \ |
810 | ubuntuapplicationapiwrapper.cpp \ |
811 | |
812 | target.path += $${MALIIT_PLUGINS_DIR} |
813 | |
814 | === modified file 'src/view/setup.cpp' |
815 | --- src/view/setup.cpp 2013-11-13 15:19:04 +0000 |
816 | +++ src/view/setup.cpp 2013-12-20 12:24:25 +0000 |
817 | @@ -37,7 +37,7 @@ |
818 | #include "models/wordcandidate.h" |
819 | #include "models/text.h" |
820 | |
821 | -#include "logic/layouthelper.h" |
822 | +//#include "logic/layouthelper.h" |
823 | #include "logic/layoutupdater.h" |
824 | #include "logic/eventhandler.h" |
825 | |
826 | @@ -45,11 +45,12 @@ |
827 | namespace Setup { |
828 | |
829 | void connectAll(Logic::EventHandler *event_handler, |
830 | - Logic::LayoutUpdater *updater, |
831 | AbstractTextEditor *editor) |
832 | { |
833 | connectEventHandlerToTextEditor(event_handler, editor); |
834 | +#ifdef TEMP_DISABLED |
835 | connectLayoutUpdaterToTextEditor(updater, editor); |
836 | +#endif |
837 | } |
838 | |
839 | void connectEventHandlerToTextEditor(Logic::EventHandler *event_handler, |
840 | @@ -60,20 +61,21 @@ |
841 | |
842 | QObject::connect(event_handler, SIGNAL(keyReleased(Key)), |
843 | editor, SLOT(onKeyReleased(Key))); |
844 | - |
845 | +#ifdef TEMP_DISABLED |
846 | QObject::connect(event_handler, SIGNAL(keyEntered(Key)), |
847 | editor, SLOT(onKeyEntered(Key))); |
848 | |
849 | QObject::connect(event_handler, SIGNAL(keyExited(Key)), |
850 | editor, SLOT(onKeyExited(Key))); |
851 | +#endif |
852 | } |
853 | - |
854 | +#ifdef TEMP_DISABLED |
855 | void connectLayoutUpdaterToTextEditor(Logic::LayoutUpdater *updater, |
856 | AbstractTextEditor *editor) |
857 | { |
858 | QObject::connect(updater, SIGNAL(wordCandidateSelected(QString)), |
859 | editor, SLOT(replaceAndCommitPreedit(QString))); |
860 | - |
861 | + // could not find any emit for this signal |
862 | QObject::connect(updater, SIGNAL(addToUserDictionary()), |
863 | editor, SLOT(showUserCandidate())); |
864 | |
865 | @@ -85,9 +87,8 @@ |
866 | |
867 | QObject::connect(editor, SIGNAL(wordCandidatesChanged(WordCandidateList)), |
868 | updater, SLOT(onWordCandidatesChanged(WordCandidateList))); |
869 | - |
870 | QObject::connect(editor, SIGNAL(autoCapsActivated()), |
871 | updater, SIGNAL(autoCapsActivated())); |
872 | } |
873 | - |
874 | +#endif |
875 | }} // namespace Setup, MaliitKeyboard |
876 | |
877 | === modified file 'src/view/setup.h' |
878 | --- src/view/setup.h 2013-11-13 15:19:04 +0000 |
879 | +++ src/view/setup.h 2013-12-20 12:24:25 +0000 |
880 | @@ -51,14 +51,14 @@ |
881 | namespace Setup { |
882 | |
883 | void connectAll(Logic::EventHandler *event_handler, |
884 | - Logic::LayoutUpdater *updater, |
885 | AbstractTextEditor *editor); |
886 | |
887 | void connectEventHandlerToTextEditor(Logic::EventHandler *event_handler, |
888 | AbstractTextEditor *editor); |
889 | - |
890 | +#ifdef TEMP_DISABLED |
891 | void connectLayoutUpdaterToTextEditor(Logic::LayoutUpdater *updater, |
892 | AbstractTextEditor *editor); |
893 | +#endif |
894 | }} // namespace Setup, MaliitKeyboard |
895 | |
896 | #endif // MALIIT_KEYBOARD_SETUP_H |
897 | |
898 | === modified file 'tests/unittests/ut_editor/ut_editor.cpp' |
899 | --- tests/unittests/ut_editor/ut_editor.cpp 2013-12-11 14:46:33 +0000 |
900 | +++ tests/unittests/ut_editor/ut_editor.cpp 2013-12-20 12:24:25 +0000 |
901 | @@ -36,7 +36,7 @@ |
902 | #include "plugin/editor.h" |
903 | #include "models/key.h" |
904 | #include "models/text.h" |
905 | -#include "logic/layouthelper.h" |
906 | +//#include "logic/layouthelper.h" |
907 | #include "logic/layoutupdater.h" |
908 | #include "logic/style.h" |
909 | #include "view/setup.h" |
910 | |
911 | === modified file 'tests/unittests/ut_word-candidates/ut_word-candidates.cpp' |
912 | --- tests/unittests/ut_word-candidates/ut_word-candidates.cpp 2013-11-21 15:10:35 +0000 |
913 | +++ tests/unittests/ut_word-candidates/ut_word-candidates.cpp 2013-12-20 12:24:25 +0000 |
914 | @@ -36,9 +36,9 @@ |
915 | #include "plugin/editor.h" |
916 | #include "models/key.h" |
917 | #include "models/text.h" |
918 | -#include "logic/layouthelper.h" |
919 | +//#include "logic/layouthelper.h" |
920 | #include "logic/layoutupdater.h" |
921 | -#include "logic/style.h" |
922 | +//#include "logic/style.h" |
923 | #include "view/setup.h" |
924 | |
925 | #include <QtCore> |
926 | @@ -196,7 +196,7 @@ |
927 | QCOMPARE(spy.count(), 4); |
928 | QCOMPARE(host.commitStringHistory(), QString("ab c ")); |
929 | } |
930 | - |
931 | +#ifdef TEMP_DISABLED |
932 | Q_SLOT void testWordRibbonVisible() |
933 | { |
934 | Editor editor(EditorOptions(), new Model::Text, new Logic::WordEngineProbe); |
935 | @@ -239,6 +239,7 @@ |
936 | QCOMPARE(updater.isWordRibbonVisible(), false); |
937 | QCOMPARE(layout.wordRibbon()->candidates().isEmpty(), true); |
938 | } |
939 | +#endif |
940 | }; |
941 | |
942 | QTEST_MAIN(TestWordCandidates) |
943 | |
944 | === modified file 'ubuntu-keyboard.pro' |
945 | --- ubuntu-keyboard.pro 2013-11-19 14:47:21 +0000 |
946 | +++ ubuntu-keyboard.pro 2013-12-20 12:24:25 +0000 |
947 | @@ -93,7 +93,7 @@ |
948 | src \ |
949 | data \ |
950 | qml \ |
951 | - benchmark \ |
952 | +# benchmark \ |
953 | plugins \ |
954 | |
955 | !notests { |
FAILED: Continuous integration, rev:127 jenkins. qa.ubuntu. com/job/ ubuntu- keyboard- ci/299/ jenkins. qa.ubuntu. com/job/ ubuntu- keyboard- trusty- amd64-ci/ 128/console jenkins. qa.ubuntu. com/job/ ubuntu- keyboard- trusty- armhf-ci/ 128/console jenkins. qa.ubuntu. com/job/ ubuntu- keyboard- trusty- i386-ci/ 127/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- keyboard- ci/299/ rebuild
http://