~kokoye2007/ubuntu-keyboard/ubuntu-keyboard

« back to all changes in this revision

Viewing changes to src/plugin/inputmethod.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Michael Sheldon, Łukasz 'sil2100' Zemczak
  • Date: 2014-04-15 15:17:13 UTC
  • mfrom: (1.1.36)
  • Revision ID: package-import@ubuntu.com-20140415151713-ta3la9r2aigdk1sm
Tags: 0.99.trunk.phablet2+14.04.20140415-0ubuntu1
[ Michael Sheldon ]
* Implement capital letters for Pinyin keyboard, ignore auto-
  capitalisation and always display word ribbon when using Pinyin
  regardless of input hints. (LP: #1281384)
* Switch back to normal character mode if in shifted mode after
  entering extended characters. (LP: #1264860)

[ Łukasz 'sil2100' Zemczak ]
* Quick-fix: play key feedback sound on key-press for all used keys.
  The fix is not really sophisticated, but these parts of code might
  change soon anyway (LP: #1306160)

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include "models/wordribbon.h"
38
38
#include "models/layout.h"
39
39
 
 
40
#include "logic/abstractlanguagefeatures.h"
40
41
// #include "logic/layouthelper.h"
41
42
//#include "logic/style.h"
42
43
 
245
246
    bool enabled = d->m_settings.autoCapitalization();
246
247
    enabled &= d->contentType == FreeTextContentType;
247
248
    bool valid = true;
248
 
    bool autocap = d->host->autoCapitalizationEnabled(valid);
 
249
    bool autocap = d->host->autoCapitalizationEnabled(valid) && d->editor.wordEngine()->languageFeature()->autoCapsAvailable();
249
250
    enabled &= autocap;
250
251
 
251
252
    if (enabled != d->autocapsEnabled) {
341
342
 
342
343
    bool emitPredictionEnabled = false;
343
344
 
344
 
    bool newPredictionEnabled = inputMethodHost()->predictionEnabled(valid);
 
345
    bool newPredictionEnabled = inputMethodHost()->predictionEnabled(valid) 
 
346
                                || d->editor.wordEngine()->languageFeature()->alwaysShowSuggestions();
345
347
 
346
348
    if (!valid)
347
349
        newPredictionEnabled = true;