on xenial help sign in
Bundle of fixes
e7b1494Michael Terry
plugins/AccountsService/AccountsService.cpp+11−1
@@ -19,12 +19,13 @@
19#include "AccountsService.h"
19#include "AccountsService.h"
20#include "AccountsServiceDBusAdaptor.h"
20#include "AccountsServiceDBusAdaptor.h"
21
21
22+#include <QFile>
22#include <QStringList>
23#include <QStringList>
23
24
24AccountsService::AccountsService(QObject* parent)
25AccountsService::AccountsService(QObject* parent)
25 : QObject(parent),
26 : QObject(parent),
26 m_service(new AccountsServiceDBusAdaptor(this)),
27 m_service(new AccountsServiceDBusAdaptor(this)),
27− m_user(qgetenv("USER")),
28+ m_user(""),
28 m_demoEdges(false),
29 m_demoEdges(false),
29 m_enableLauncherWhileLocked(false),
30 m_enableLauncherWhileLocked(false),
30 m_enableIndicatorsWhileLocked(false),
31 m_enableIndicatorsWhileLocked(false),
@@ -38,6 +39,8 @@ AccountsService::AccountsService(QObject* parent)
38 this, SLOT(propertiesChanged(const QString &, const QString &, const QStringList &)));
39 this, SLOT(propertiesChanged(const QString &, const QString &, const QStringList &)));
39 connect(m_service, SIGNAL(maybeChanged(const QString &)),
40 connect(m_service, SIGNAL(maybeChanged(const QString &)),
40 this, SLOT(maybeChanged(const QString &)));
41 this, SLOT(maybeChanged(const QString &)));
42+
43+ setUser(qgetenv("USER"));
41}
44}
42
45
43QString AccountsService::user() const
46QString AccountsService::user() const
@@ -47,6 +50,9 @@ QString AccountsService::user() const
47
50
48void AccountsService::setUser(const QString &user)
51void AccountsService::setUser(const QString &user)
49{
52{
53+ if (user.isEmpty() || m_user == user)
54+ return;
55+
50 m_user = user;
56 m_user = user;
51 Q_EMIT userChanged();
57 Q_EMIT userChanged();
52
58
@@ -187,6 +193,10 @@ void AccountsService::updateHereEnabled()
187void AccountsService::updateHereLicensePath()
193void AccountsService::updateHereLicensePath()
188{
194{
189 QString hereLicensePath = m_service->getUserProperty(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseBasePath").toString();
195 QString hereLicensePath = m_service->getUserProperty(m_user, "com.ubuntu.location.providers.here.AccountsService", "LicenseBasePath").toString();
196+
197+ if (!hereLicensePath.isEmpty() && !QFile::exists(hereLicensePath))
198+ hereLicensePath = "";
199+
190 if (m_hereLicensePath != hereLicensePath) {
200 if (m_hereLicensePath != hereLicensePath) {
191 m_hereLicensePath = hereLicensePath;
201 m_hereLicensePath = hereLicensePath;
192 Q_EMIT hereLicensePathChanged();
202 Q_EMIT hereLicensePathChanged();
plugins/Wizard/System.cpp+10−3
@@ -48,11 +48,16 @@ bool System::wizardEnabled() const
48
48
49void System::setWizardEnabled(bool enabled)
49void System::setWizardEnabled(bool enabled)
50{
50{
51+ if (wizardEnabled() == enabled)
52+ return;
53+
51 if (enabled) {
54 if (enabled) {
52 QFile::remove(wizardEnabledPath());
55 QFile::remove(wizardEnabledPath());
53 } else {
56 } else {
54 QDir(wizardEnabledPath()).mkpath("..");
57 QDir(wizardEnabledPath()).mkpath("..");
55 QFile(wizardEnabledPath()).open(QIODevice::WriteOnly);
58 QFile(wizardEnabledPath()).open(QIODevice::WriteOnly);
59+ m_fsWatcher.addPath(wizardEnabledPath());
60+ wizardEnabledChanged();
56 }
61 }
57}
62}
58
63
@@ -79,9 +84,11 @@ void System::updateSessionLanguage(const QString &locale)
79 setSessionVariable("LANG", locale);
84 setSessionVariable("LANG", locale);
80 setSessionVariable("LC_ALL", locale);
85 setSessionVariable("LC_ALL", locale);
81
86
82− // Indicators and OSK need to pick up new language
87+ // Restart bits of the session to pick up new language.
83 QProcess::startDetached("sh -c \"initctl emit indicator-services-end; \
88 QProcess::startDetached("sh -c \"initctl emit indicator-services-end; \
84− stop maliit-server; \
89+ initctl stop scope-registry; \
90+ initctl stop smart-scopes-proxy; \
85 initctl emit --no-wait indicator-services-start; \
91 initctl emit --no-wait indicator-services-start; \
86− initctl start --no-wait maliit-server\"");
92+ initctl restart --no-wait maliit-server; \
93+ initctl restart --no-wait unity8-dash\"");
87}
94}
qml/Components/Dialogs.qml+17−21
@@ -24,10 +24,6 @@ import Ubuntu.Components.Popups 0.1
24Item {
24Item {
25 id: root
25 id: root
26
26
27− // Explicitly use the right domain for this widget because it might be used
28− // in other applications like the welcome wizard.
29− readonly property string domain: "unity8"
30−
31 function onPowerKeyPressed() {
27 function onPowerKeyPressed() {
32 // FIXME: event.isAutoRepeat is always false on Nexus 4.
28 // FIXME: event.isAutoRepeat is always false on Nexus 4.
33 // So we use powerKeyTimer.running to avoid the PowerOff key repeat
29 // So we use powerKeyTimer.running to avoid the PowerOff key repeat
@@ -71,17 +67,17 @@ Item {
71 id: logoutDialog
67 id: logoutDialog
72 Dialog {
68 Dialog {
73 id: dialogueLogout
69 id: dialogueLogout
74− title: i18n.dtr(root.domain, "Log out")
70+ title: i18n.tr("Log out")
75− text: i18n.dtr(root.domain, "Are you sure you want to log out?")
71+ text: i18n.tr("Are you sure you want to log out?")
76 Button {
72 Button {
77− text: i18n.dtr(root.domain, "No")
73+ text: i18n.tr("No")
78 onClicked: {
74 onClicked: {
79 PopupUtils.close(dialogueLogout);
75 PopupUtils.close(dialogueLogout);
80 d.dialogShown = false;
76 d.dialogShown = false;
81 }
77 }
82 }
78 }
83 Button {
79 Button {
84− text: i18n.dtr(root.domain, "Yes")
80+ text: i18n.tr("Yes")
85 onClicked: {
81 onClicked: {
86 DBusUnitySessionService.Logout();
82 DBusUnitySessionService.Logout();
87 PopupUtils.close(dialogueLogout);
83 PopupUtils.close(dialogueLogout);
@@ -95,17 +91,17 @@ Item {
95 id: shutdownDialog
91 id: shutdownDialog
96 Dialog {
92 Dialog {
97 id: dialogueShutdown
93 id: dialogueShutdown
98− title: i18n.dtr(root.domain, "Shut down")
94+ title: i18n.tr("Shut down")
99− text: i18n.dtr(root.domain, "Are you sure you want to shut down?")
95+ text: i18n.tr("Are you sure you want to shut down?")
100 Button {
96 Button {
101− text: i18n.dtr(root.domain, "No")
97+ text: i18n.tr("No")
102 onClicked: {
98 onClicked: {
103 PopupUtils.close(dialogueShutdown);
99 PopupUtils.close(dialogueShutdown);
104 d.dialogShown = false;
100 d.dialogShown = false;
105 }
101 }
106 }
102 }
107 Button {
103 Button {
108− text: i18n.dtr(root.domain, "Yes")
104+ text: i18n.tr("Yes")
109 onClicked: {
105 onClicked: {
110 dBusUnitySessionServiceConnection.closeAllApps();
106 dBusUnitySessionServiceConnection.closeAllApps();
111 DBusUnitySessionService.Shutdown();
107 DBusUnitySessionService.Shutdown();
@@ -120,17 +116,17 @@ Item {
120 id: rebootDialog
116 id: rebootDialog
121 Dialog {
117 Dialog {
122 id: dialogueReboot
118 id: dialogueReboot
123− title: i18n.dtr(root.domain, "Reboot")
119+ title: i18n.tr("Reboot")
124− text: i18n.dtr(root.domain, "Are you sure you want to reboot?")
120+ text: i18n.tr("Are you sure you want to reboot?")
125 Button {
121 Button {
126− text: i18n.dtr(root.domain, "No")
122+ text: i18n.tr("No")
127 onClicked: {
123 onClicked: {
128 PopupUtils.close(dialogueReboot)
124 PopupUtils.close(dialogueReboot)
129 d.dialogShown = false;
125 d.dialogShown = false;
130 }
126 }
131 }
127 }
132 Button {
128 Button {
133− text: i18n.dtr(root.domain, "Yes")
129+ text: i18n.tr("Yes")
134 onClicked: {
130 onClicked: {
135 dBusUnitySessionServiceConnection.closeAllApps();
131 dBusUnitySessionServiceConnection.closeAllApps();
136 DBusUnitySessionService.Reboot();
132 DBusUnitySessionService.Reboot();
@@ -145,10 +141,10 @@ Item {
145 id: powerDialog
141 id: powerDialog
146 Dialog {
142 Dialog {
147 id: dialoguePower
143 id: dialoguePower
148− title: i18n.dtr(root.domain, "Power")
144+ title: i18n.tr("Power")
149− text: i18n.dtr(root.domain, "Are you sure you would like\nto power off?")
145+ text: i18n.tr("Are you sure you would like\nto power off?")
150 Button {
146 Button {
151− text: i18n.dtr(root.domain, "Power off")
147+ text: i18n.tr("Power off")
152 onClicked: {
148 onClicked: {
153 dBusUnitySessionServiceConnection.closeAllApps();
149 dBusUnitySessionServiceConnection.closeAllApps();
154 PopupUtils.close(dialoguePower);
150 PopupUtils.close(dialoguePower);
@@ -158,7 +154,7 @@ Item {
158 color: UbuntuColors.red
154 color: UbuntuColors.red
159 }
155 }
160 Button {
156 Button {
161− text: i18n.dtr(root.domain, "Restart")
157+ text: i18n.tr("Restart")
162 onClicked: {
158 onClicked: {
163 dBusUnitySessionServiceConnection.closeAllApps();
159 dBusUnitySessionServiceConnection.closeAllApps();
164 DBusUnitySessionService.Reboot();
160 DBusUnitySessionService.Reboot();
@@ -168,7 +164,7 @@ Item {
168 color: UbuntuColors.green
164 color: UbuntuColors.green
169 }
165 }
170 Button {
166 Button {
171− text: i18n.dtr(root.domain, "Cancel")
167+ text: i18n.tr("Cancel")
172 onClicked: {
168 onClicked: {
173 PopupUtils.close(dialoguePower);
169 PopupUtils.close(dialoguePower);
174 d.dialogShown = false;
170 d.dialogShown = false;
qml/Wizard/Pages.qml+5−6
@@ -20,10 +20,12 @@ import Ubuntu.SystemSettings.SecurityPrivacy 1.0
20import Wizard 0.1
20import Wizard 0.1
21import "../Components"
21import "../Components"
22
22
23−Showable {
23+Item {
24 // The background wallpaper to use
24 // The background wallpaper to use
25 property string background
25 property string background
26
26
27+ signal quit()
28+
27 ////
29 ////
28
30
29 id: root
31 id: root
@@ -34,14 +36,12 @@ Showable {
34 property int passwordMethod: UbuntuSecurityPrivacyPanel.Passcode
36 property int passwordMethod: UbuntuSecurityPrivacyPanel.Passcode
35 property string password: ""
37 property string password: ""
36
38
37− hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
38−
39 UbuntuSecurityPrivacyPanel {
39 UbuntuSecurityPrivacyPanel {
40 id: securityPrivacy
40 id: securityPrivacy
41 }
41 }
42
42
43 function quitWizard() {
43 function quitWizard() {
44− var errorMsg = "" //securityPrivacy.setSecurity("", password, passwordMethod)
44+ var errorMsg = securityPrivacy.setSecurity("", password, passwordMethod)
45 if (errorMsg !== "") {
45 if (errorMsg !== "") {
46 // Ignore (but log) any errors, since we're past where the user set
46 // Ignore (but log) any errors, since we're past where the user set
47 // the method. Worst case, we just leave the user with a swipe
47 // the method. Worst case, we just leave the user with a swipe
@@ -49,8 +49,7 @@ Showable {
49 console.log("Error setting security method:", errorMsg)
49 console.log("Error setting security method:", errorMsg)
50 }
50 }
51
51
52− System.wizardEnabled = false;
52+ quit();
53− hide();
54 }
53 }
55
54
56 MouseArea { // eat anything that gets past widgets
55 MouseArea { // eat anything that gets past widgets
qml/Wizard/Pages/10-welcome.qml−1
@@ -72,7 +72,6 @@ LocalComponents.Page {
72 listview.currentIndex = index
72 listview.currentIndex = index
73 combo.expanded = false
73 combo.expanded = false
74 i18n.language = plugin.languageCodes[index]
74 i18n.language = plugin.languageCodes[index]
75− i18n.domain = i18n.domain
76 }
75 }
77 }
76 }
78 }
77 }
qml/Wizard/Wizard.qml+12−4
@@ -17,8 +17,9 @@
17import QtQuick 2.3
17import QtQuick 2.3
18import Ubuntu.Components 1.1
18import Ubuntu.Components 1.1
19import Wizard 0.1
19import Wizard 0.1
20+import "../Components"
20
21
21−Item {
22+Showable {
22 // The background wallpaper to use
23 // The background wallpaper to use
23 property string background
24 property string background
24
25
@@ -26,15 +27,22 @@ Item {
26
27
27 id: root
28 id: root
28
29
30+ hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
31+
32+ onRequiredChanged: {
33+ if (!required) {
34+ System.wizardEnabled = false;
35+ }
36+ }
37+
29 Loader {
38 Loader {
30 id: loader
39 id: loader
31 anchors.fill: parent
40 anchors.fill: parent
32− property bool itemRequired // avoids a binding loop on item.required
33− active: System.wizardEnabled || itemRequired
41+ active: System.wizardEnabled
34 sourceComponent: Pages {
42 sourceComponent: Pages {
35 anchors.fill: parent
43 anchors.fill: parent
36 background: root.background
44 background: root.background
37− onRequiredChanged: loader.itemRequired = required
45+ onQuit: root.hide()
38 }
46 }
39 }
47 }
40}
48}