on xenial help sign in
Bundle of fixes
commite7b1494429cd253eaffd4e90de57dbe6cb8e0849 authorMichael Terry <michael.terry@canonical.com> dateTue 18 Nov 2014, 21:09 (12 years ago) parentfc251ea
6 files changed+55−36
plugins/AccountsService/AccountsService.cpp+11−1 plugins/Wizard/System.cpp+10−3 qml/Components/Dialogs.qml+17−21 qml/Wizard/Pages.qml+5−6 qml/Wizard/Pages/10-welcome.qml−1 qml/Wizard/Wizard.qml+12−4
plugins/AccountsService/AccountsService.cpp+11−1
@@ -19,12 +19,13 @@
1919#include "AccountsService.h"
2020#include "AccountsServiceDBusAdaptor.h"
2121
22+#include <QFile>
2223#include <QStringList>
2324
2425AccountsService::AccountsService(QObject* parent)
2526 : QObject(parent),
2627 m_service(new AccountsServiceDBusAdaptor(this)),
27− m_user(qgetenv("USER")),
28+ m_user(""),
2829 m_demoEdges(false),
2930 m_enableLauncherWhileLocked(false),
3031 m_enableIndicatorsWhileLocked(false),
@@ -38,6 +39,8 @@ AccountsService::AccountsService(QObject* parent)
3839 this, SLOT(propertiesChanged(const QString &, const QString &, const QStringList &)));
3940 connect(m_service, SIGNAL(maybeChanged(const QString &)),
4041 this, SLOT(maybeChanged(const QString &)));
42+
43+ setUser(qgetenv("USER"));
4144}
4245
4346QString AccountsService::user() const
@@ -47,6 +50,9 @@ QString AccountsService::user() const
4750
4851void AccountsService::setUser(const QString &user)
4952{
53+ if (user.isEmpty() || m_user == user)
54+ return;
55+
5056 m_user = user;
5157 Q_EMIT userChanged();
5258
@@ -187,6 +193,10 @@ void AccountsService::updateHereEnabled()
187193void AccountsService::updateHereLicensePath()
188194{
189195 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+
190200 if (m_hereLicensePath != hereLicensePath) {
191201 m_hereLicensePath = hereLicensePath;
192202 Q_EMIT hereLicensePathChanged();
plugins/Wizard/System.cpp+10−3
@@ -48,11 +48,16 @@ bool System::wizardEnabled() const
4848
4949void System::setWizardEnabled(bool enabled)
5050{
51+ if (wizardEnabled() == enabled)
52+ return;
53+
5154 if (enabled) {
5255 QFile::remove(wizardEnabledPath());
5356 } else {
5457 QDir(wizardEnabledPath()).mkpath("..");
5558 QFile(wizardEnabledPath()).open(QIODevice::WriteOnly);
59+ m_fsWatcher.addPath(wizardEnabledPath());
60+ wizardEnabledChanged();
5661 }
5762}
5863
@@ -79,9 +84,11 @@ void System::updateSessionLanguage(const QString &locale)
7984 setSessionVariable("LANG", locale);
8085 setSessionVariable("LC_ALL", locale);
8186
82− // Indicators and OSK need to pick up new language
87+ // Restart bits of the session to pick up new language.
8388 QProcess::startDetached("sh -c \"initctl emit indicator-services-end; \
84− stop maliit-server; \
89+ initctl stop scope-registry; \
90+ initctl stop smart-scopes-proxy; \
8591 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\"");
8794}
qml/Components/Dialogs.qml+17−21
@@ -24,10 +24,6 @@ import Ubuntu.Components.Popups 0.1
2424Item {
2525 id: root
2626
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−
3127 function onPowerKeyPressed() {
3228 // FIXME: event.isAutoRepeat is always false on Nexus 4.
3329 // So we use powerKeyTimer.running to avoid the PowerOff key repeat
@@ -71,17 +67,17 @@ Item {
7167 id: logoutDialog
7268 Dialog {
7369 id: dialogueLogout
74− title: i18n.dtr(root.domain, "Log out")
75− text: i18n.dtr(root.domain, "Are you sure you want to log out?")
70+ title: i18n.tr("Log out")
71+ text: i18n.tr("Are you sure you want to log out?")
7672 Button {
77− text: i18n.dtr(root.domain, "No")
73+ text: i18n.tr("No")
7874 onClicked: {
7975 PopupUtils.close(dialogueLogout);
8076 d.dialogShown = false;
8177 }
8278 }
8379 Button {
84− text: i18n.dtr(root.domain, "Yes")
80+ text: i18n.tr("Yes")
8581 onClicked: {
8682 DBusUnitySessionService.Logout();
8783 PopupUtils.close(dialogueLogout);
@@ -95,17 +91,17 @@ Item {
9591 id: shutdownDialog
9692 Dialog {
9793 id: dialogueShutdown
98− title: i18n.dtr(root.domain, "Shut down")
99− text: i18n.dtr(root.domain, "Are you sure you want to shut down?")
94+ title: i18n.tr("Shut down")
95+ text: i18n.tr("Are you sure you want to shut down?")
10096 Button {
101− text: i18n.dtr(root.domain, "No")
97+ text: i18n.tr("No")
10298 onClicked: {
10399 PopupUtils.close(dialogueShutdown);
104100 d.dialogShown = false;
105101 }
106102 }
107103 Button {
108− text: i18n.dtr(root.domain, "Yes")
104+ text: i18n.tr("Yes")
109105 onClicked: {
110106 dBusUnitySessionServiceConnection.closeAllApps();
111107 DBusUnitySessionService.Shutdown();
@@ -120,17 +116,17 @@ Item {
120116 id: rebootDialog
121117 Dialog {
122118 id: dialogueReboot
123− title: i18n.dtr(root.domain, "Reboot")
124− text: i18n.dtr(root.domain, "Are you sure you want to reboot?")
119+ title: i18n.tr("Reboot")
120+ text: i18n.tr("Are you sure you want to reboot?")
125121 Button {
126− text: i18n.dtr(root.domain, "No")
122+ text: i18n.tr("No")
127123 onClicked: {
128124 PopupUtils.close(dialogueReboot)
129125 d.dialogShown = false;
130126 }
131127 }
132128 Button {
133− text: i18n.dtr(root.domain, "Yes")
129+ text: i18n.tr("Yes")
134130 onClicked: {
135131 dBusUnitySessionServiceConnection.closeAllApps();
136132 DBusUnitySessionService.Reboot();
@@ -145,10 +141,10 @@ Item {
145141 id: powerDialog
146142 Dialog {
147143 id: dialoguePower
148− title: i18n.dtr(root.domain, "Power")
149− text: i18n.dtr(root.domain, "Are you sure you would like\nto power off?")
144+ title: i18n.tr("Power")
145+ text: i18n.tr("Are you sure you would like\nto power off?")
150146 Button {
151− text: i18n.dtr(root.domain, "Power off")
147+ text: i18n.tr("Power off")
152148 onClicked: {
153149 dBusUnitySessionServiceConnection.closeAllApps();
154150 PopupUtils.close(dialoguePower);
@@ -158,7 +154,7 @@ Item {
158154 color: UbuntuColors.red
159155 }
160156 Button {
161− text: i18n.dtr(root.domain, "Restart")
157+ text: i18n.tr("Restart")
162158 onClicked: {
163159 dBusUnitySessionServiceConnection.closeAllApps();
164160 DBusUnitySessionService.Reboot();
@@ -168,7 +164,7 @@ Item {
168164 color: UbuntuColors.green
169165 }
170166 Button {
171− text: i18n.dtr(root.domain, "Cancel")
167+ text: i18n.tr("Cancel")
172168 onClicked: {
173169 PopupUtils.close(dialoguePower);
174170 d.dialogShown = false;
qml/Wizard/Pages.qml+5−6
@@ -20,10 +20,12 @@ import Ubuntu.SystemSettings.SecurityPrivacy 1.0
2020import Wizard 0.1
2121import "../Components"
2222
23−Showable {
23+Item {
2424 // The background wallpaper to use
2525 property string background
2626
27+ signal quit()
28+
2729 ////
2830
2931 id: root
@@ -34,14 +36,12 @@ Showable {
3436 property int passwordMethod: UbuntuSecurityPrivacyPanel.Passcode
3537 property string password: ""
3638
37− hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
38−
3939 UbuntuSecurityPrivacyPanel {
4040 id: securityPrivacy
4141 }
4242
4343 function quitWizard() {
44− var errorMsg = "" //securityPrivacy.setSecurity("", password, passwordMethod)
44+ var errorMsg = securityPrivacy.setSecurity("", password, passwordMethod)
4545 if (errorMsg !== "") {
4646 // Ignore (but log) any errors, since we're past where the user set
4747 // the method. Worst case, we just leave the user with a swipe
@@ -49,8 +49,7 @@ Showable {
4949 console.log("Error setting security method:", errorMsg)
5050 }
5151
52− System.wizardEnabled = false;
53− hide();
52+ quit();
5453 }
5554
5655 MouseArea { // eat anything that gets past widgets
qml/Wizard/Pages/10-welcome.qml−1
@@ -72,7 +72,6 @@ LocalComponents.Page {
7272 listview.currentIndex = index
7373 combo.expanded = false
7474 i18n.language = plugin.languageCodes[index]
75− i18n.domain = i18n.domain
7675 }
7776 }
7877 }
qml/Wizard/Wizard.qml+12−4
@@ -17,8 +17,9 @@
1717import QtQuick 2.3
1818import Ubuntu.Components 1.1
1919import Wizard 0.1
20+import "../Components"
2021
21−Item {
22+Showable {
2223 // The background wallpaper to use
2324 property string background
2425
@@ -26,15 +27,22 @@ Item {
2627
2728 id: root
2829
30+ hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
31+
32+ onRequiredChanged: {
33+ if (!required) {
34+ System.wizardEnabled = false;
35+ }
36+ }
37+
2938 Loader {
3039 id: loader
3140 anchors.fill: parent
32− property bool itemRequired // avoids a binding loop on item.required
33− active: System.wizardEnabled || itemRequired
41+ active: System.wizardEnabled
3442 sourceComponent: Pages {
3543 anchors.fill: parent
3644 background: root.background
37− onRequiredChanged: loader.itemRequired = required
45+ onQuit: root.hide()
3846 }
3947 }
4048}