Merge lp:~michael-sheldon/ubuntu-keyboard/fix-1358224 into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 224
Merged at revision: 224
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-1358224
Merge into: lp:ubuntu-keyboard
Diff against target: 207 lines (+115/-10)
5 files modified
qml/keys/LanguageMenu.qml (+12/-8)
src/plugin/greeterstatus.cpp (+54/-0)
src/plugin/greeterstatus.h (+41/-0)
src/plugin/inputmethod_p.h (+4/-0)
src/plugin/plugin.pro (+4/-2)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-1358224
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+234661@code.launchpad.net

Commit message

Hide the settings option in the keyboard's language menu when the phone is locked.

Description of the change

Hide the settings option in the keyboard's language menu when the phone is locked.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ubuntu-keyboard) on device or emulator?

 * Yes

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed UI labels, did you update the pot file?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Revision history for this message
Bill Filler (bfiller) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?
yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/<package-name>) on device or emulator?
yes

Did CI run pass? If not, please explain why.
yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?
yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/sr/src/database_sr.db'
0Binary files plugins/sr/src/database_sr.db 2014-09-10 14:57:12 +0000 and plugins/sr/src/database_sr.db 2014-09-15 10:38:09 +0000 differ0Binary files plugins/sr/src/database_sr.db 2014-09-10 14:57:12 +0000 and plugins/sr/src/database_sr.db 2014-09-15 10:38:09 +0000 differ
=== modified file 'qml/keys/LanguageMenu.qml'
--- qml/keys/LanguageMenu.qml 2014-08-26 17:26:33 +0000
+++ qml/keys/LanguageMenu.qml 2014-09-15 10:38:09 +0000
@@ -53,16 +53,20 @@
53 maliit_input_method.activeLanguage = modelData53 maliit_input_method.activeLanguage = modelData
54 canvas.languageMenuShown = false;54 canvas.languageMenuShown = false;
55 }55 }
56 }56 }
5757
58 footer: ListItem.Standard {58 Component {
59 text: i18n.tr("Settings")59 id: settingsItem
60 onClicked: {60 ListItem.Standard {
61 Qt.openUrlExternally("settings:///system/language")61 text: i18n.tr("Settings")
62 canvas.languageMenuShown = false;62 onClicked: {
63 maliit_input_method.hide();63 Qt.openUrlExternally("settings:///system/language")
64 canvas.languageMenuShown = false;
65 maliit_input_method.hide();
66 }
64 }67 }
65 }68 }
69 footer: greeter_status.greeterActive ? null : settingsItem
66 }70 }
6771
68 function languageIdToName(languageId)72 function languageIdToName(languageId)
6973
=== added file 'src/plugin/greeterstatus.cpp'
--- src/plugin/greeterstatus.cpp 1970-01-01 00:00:00 +0000
+++ src/plugin/greeterstatus.cpp 2014-09-15 10:38:09 +0000
@@ -0,0 +1,54 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <QDBusConnection>
18#include <QDBusInterface>
19#include <QDBusReply>
20#include "greeterstatus.h"
21
22GreeterStatus::GreeterStatus(QObject *parent) : QObject(parent)
23{
24 QDBusConnection connection = QDBusConnection::sessionBus();
25 QDBusInterface greeterPropsIface("com.canonical.UnityGreeter",
26 "/",
27 "org.freedesktop.DBus.Properties");
28 QDBusReply<QVariant> reply = greeterPropsIface.call("Get", "com.canonical.UnityGreeter", "IsActive");
29 m_greeterActive = reply.isValid() && reply.value().toBool();
30 connection.connect("com.canonical.UnityGreeter",
31 "/",
32 "org.freedesktop.DBus.Properties",
33 "PropertiesChanged",
34 this,
35 SLOT(greeterPropertiesChanged(QString, QVariantMap, QStringList)));
36}
37
38bool GreeterStatus::greeterActive() const
39{
40 return m_greeterActive;
41}
42
43void GreeterStatus::greeterPropertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated)
44{
45 Q_UNUSED(invalidated);
46
47 if (interface == "com.canonical.UnityGreeter") {
48 if (changed.contains("IsActive")) {
49 m_greeterActive = changed.value("IsActive").toBool();
50 Q_EMIT greeterActiveChanged();
51 }
52 }
53}
54
055
=== added file 'src/plugin/greeterstatus.h'
--- src/plugin/greeterstatus.h 1970-01-01 00:00:00 +0000
+++ src/plugin/greeterstatus.h 2014-09-15 10:38:09 +0000
@@ -0,0 +1,41 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef GREETERSTATUS_H
18#define GREETERSTATUS_H
19
20#include <QObject>
21
22class GreeterStatus : public QObject
23{
24 Q_OBJECT
25 Q_PROPERTY(bool greeterActive READ greeterActive NOTIFY greeterActiveChanged)
26
27public:
28 GreeterStatus(QObject *parent = 0);
29 bool greeterActive() const;
30
31Q_SIGNALS:
32 void greeterActiveChanged();
33
34private Q_SLOTS:
35 void greeterPropertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated);
36
37private:
38 bool m_greeterActive;
39};
40
41#endif // GREETERSTATUS_H
042
=== modified file 'src/plugin/inputmethod_p.h'
--- src/plugin/inputmethod_p.h 2014-09-09 11:26:52 +0000
+++ src/plugin/inputmethod_p.h 2014-09-15 10:38:09 +0000
@@ -3,6 +3,7 @@
33
4#include "logic/layoutupdater.h"4#include "logic/layoutupdater.h"
5#include "editor.h"5#include "editor.h"
6#include "greeterstatus.h"
6#include "keyboardgeometry.h"7#include "keyboardgeometry.h"
7#include "keyboardsettings.h"8#include "keyboardsettings.h"
89
@@ -60,6 +61,7 @@
6061
61 KeyboardGeometry *m_geometry;62 KeyboardGeometry *m_geometry;
62 KeyboardSettings m_settings;63 KeyboardSettings m_settings;
64 GreeterStatus *m_greeterStatus;
6365
64 WordRibbon* wordRibbon;66 WordRibbon* wordRibbon;
6567
@@ -82,6 +84,7 @@
82 , keyboardState("CHARACTERS")84 , keyboardState("CHARACTERS")
83 , m_geometry(new KeyboardGeometry(q))85 , m_geometry(new KeyboardGeometry(q))
84 , m_settings()86 , m_settings()
87 , m_greeterStatus(new GreeterStatus())
85 , wordRibbon(new WordRibbon)88 , wordRibbon(new WordRibbon)
86 , previous_position(-1)89 , previous_position(-1)
87 {90 {
@@ -174,6 +177,7 @@
174 qml_context->setContextProperty("maliit_event_handler", &event_handler);177 qml_context->setContextProperty("maliit_event_handler", &event_handler);
175 qml_context->setContextProperty("maliit_wordribbon", wordRibbon);178 qml_context->setContextProperty("maliit_wordribbon", wordRibbon);
176 qml_context->setContextProperty("maliit_word_engine", editor.wordEngine());179 qml_context->setContextProperty("maliit_word_engine", editor.wordEngine());
180 qml_context->setContextProperty("greeter_status", m_greeterStatus);
177 }181 }
178182
179183
180184
=== modified file 'src/plugin/plugin.pro'
--- src/plugin/plugin.pro 2013-12-19 15:55:17 +0000
+++ src/plugin/plugin.pro 2014-09-15 10:38:09 +0000
@@ -14,9 +14,9 @@
14DEFINES += MALIIT_DEFAULT_PROFILE=\\\"$$MALIIT_DEFAULT_PROFILE\\\"14DEFINES += MALIIT_DEFAULT_PROFILE=\\\"$$MALIIT_DEFAULT_PROFILE\\\"
1515
16contains(QT_MAJOR_VERSION, 4) {16contains(QT_MAJOR_VERSION, 4) {
17 QT = core gui17 QT = core gui dbus
18} else {18} else {
19 QT = core gui widgets quick qml19 QT = core gui widgets quick qml dbus
20}20}
2121
22CONFIG += \22CONFIG += \
@@ -27,6 +27,7 @@
27 inputmethod.h \27 inputmethod.h \
28 inputmethod_p.h \28 inputmethod_p.h \
29 editor.h \29 editor.h \
30 greeterstatus.h \
30 keyboardgeometry.h \31 keyboardgeometry.h \
31 keyboardsettings.h \32 keyboardsettings.h \
32# updatenotifier.h \33# updatenotifier.h \
@@ -36,6 +37,7 @@
36 plugin.cpp \37 plugin.cpp \
37 inputmethod.cpp \38 inputmethod.cpp \
38 editor.cpp \39 editor.cpp \
40 greeterstatus.cpp \
39 keyboardgeometry.cpp \41 keyboardgeometry.cpp \
40 keyboardsettings.cpp \42 keyboardsettings.cpp \
41# updatenotifier.cpp \43# updatenotifier.cpp \

Subscribers

People subscribed via source and target branches