@@ -1,246 +0,0 @@
2− * Copyright (C) 2013 Canonical, Ltd.
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
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 General Public License for more details.
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
19−import Ubuntu.Components 1.1
20−import Ubuntu.SystemSettings.SecurityPrivacy 1.0
21−import Unity.Application 0.1
22−import Unity.Notifications 1.0 as NotificationBackend
23−import Unity.Session 0.1
25−import "file:///usr/share/unity8/Notifications" as Notifications // FIXME This should become a module or go away
26−import "file:///usr/share/unity8/Components" as UnityComponents
34− // These should be set by a security page and we apply the settings when
35− // the user exits the wizard.
36− property int passwordMethod: UbuntuSecurityPrivacyPanel.Passcode
37− property string password: ""
39− Component.onCompleted: {
40− Theme.name = "Ubuntu.Components.Themes.SuruGradient"
41− // A visible selected background looks bad in ListItem widgets with our theme
42− Theme.palette.selected.background = "#00000000"
43− i18n.domain = "unity8"
46− UbuntuSecurityPrivacyPanel {
50− function quitWizard() {
51− // Immediately go to black to give quick feedback
52− blackCover.visible = true
54− var errorMsg = securityPrivacy.setSecurity("", password, passwordMethod)
55− if (errorMsg !== "") {
56− // Ignore (but log) any errors, since we're past where the user set
57− // the method. Worst case, we just leave the user with a swipe
58− // security method and they fix it in the system settings.
59− console.log("Error setting security method:", errorMsg)
65− // This is just a little screen to immediately go to black once the wizard
66− // is done, to give quick feedback to the user.
77− headerColor: "#57365E"
78− backgroundColor: "#A55263"
79− footerColor: "#D75669"
80− anchorToKeyboard: true
81− useDeprecatedToolbar: false
85− schema.id: "org.gnome.desktop.background"
90− // Use x/y/height/width instead of anchors so that we don't adjust
91− // the image when the OSK appears.
96− source: background.pictureUri
97− fillMode: Image.PreserveAspectCrop
98− visible: status === Image.Ready
105− // If we've opened any extra (non-main) pages, pop them before
106− // continuing so back button returns to the previous main page.
107− while (pageList.index < pageStack.depth - 1)
109− load(pageList.next())
113− if (pageList.index >= pageStack.depth - 1)
114− pageList.prev() // update pageList.index, but not for extra pages
116− if (!currentPage || currentPage.opacity === 0) { // undo skipped pages
119− currentPage.enabled = true
123− function load(path) {
125− currentPage.enabled = false
128− // First load it invisible, check that we should actually use
129− // this page, and either skip it or continue.
130− push(path, {"opacity": 0, "enabled": false})
132− // Check for immediate skip or not. We may have to wait for
133− // skipValid to be assigned (see Connections object below)
137− function _checkSkip() {
138− if (!currentPage) { // may have had a parse error
140− } else if (currentPage.skipValid) {
141− if (currentPage.skip) {
144− currentPage.opacity = 1
145− currentPage.enabled = true
151− target: pageStack.currentPage
152− onSkipValidChanged: pageStack._checkSkip()
155− Component.onCompleted: next()
160− id: modalNotificationBackground
161− visible: notifications.useModal && (notifications.state == "narrow")
162− anchors.fill: parent
166− anchors.fill: parent
171− anchors.fill: parent
174− Notifications.Notifications {
176− model: NotificationBackend.Model
181− bottom: parent.bottom
186− when: parent.width <= units.gu(60)
187− AnchorChanges { target: notifications; anchors.left: parent.left }
191− when: parent.width > units.gu(60)
192− AnchorChanges { target: notifications; anchors.left: undefined }
193− PropertyChanges { target: notifications; width: units.gu(38) }
198− UnityComponents.Dialogs {
200− anchors.fill: parent
202− onPowerOffClicked: {
203− shutdownFadeOutRectangle.enabled = true;
204− shutdownFadeOutRectangle.visible = true;
205− shutdownFadeOut.start();
210− id: shutdownFadeOutRectangle
215− anchors.fill: parent
217− NumberAnimation on opacity {
222− if (shutdownFadeOutRectangle.enabled && shutdownFadeOutRectangle.visible) {
223− DBusUnitySessionService.Shutdown();
230− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
231− dialogs.onPowerKeyPressed();
232− event.accepted = true;
234− event.accepted = false;
239− if (event.key == Qt.Key_PowerOff || event.key == Qt.Key_PowerDown) {
240− dialogs.onPowerKeyReleased();
241− event.accepted = true;
243− event.accepted = false;