Merge lp:~ajalkane/ubuntu-filemanager-app/unlock-to-header into lp:ubuntu-filemanager-app

Proposed by Arto Jalkanen on 2014-10-28
Status: Merged
Approved by: David Planella on 2014-10-28
Approved revision: 316
Merged at revision: 317
Proposed branch: lp:~ajalkane/ubuntu-filemanager-app/unlock-to-header
Merge into: lp:ubuntu-filemanager-app
Diff against target: 78 lines (+26/-24)
2 files modified
src/app/qml/ui/AuthenticationDialog.qml (+1/-1)
src/app/qml/ui/FolderListPage.qml (+25/-23)
To merge this branch: bzr merge lp:~ajalkane/ubuntu-filemanager-app/unlock-to-header
Reviewer Review Type Date Requested Status
David Planella 2014-10-28 Approve on 2014-10-28
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2014-10-28
Review via email: mp+239919@code.launchpad.net

Commit message

Bug 1386254: move unlock button to header action. Added short explanation
to unlock dialog.

Description of the change

Bug 1386254: move unlock button to header action. Added short explanation
to unlock dialog.

To post a comment you must log in.
David Planella (dpm) wrote :

LGTM, passes tests, tested it to work with the emulator.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/qml/ui/AuthenticationDialog.qml'
2--- src/app/qml/ui/AuthenticationDialog.qml 2014-09-20 10:49:51 +0000
3+++ src/app/qml/ui/AuthenticationDialog.qml 2014-10-28 22:30:13 +0000
4@@ -24,7 +24,7 @@
5
6 title: i18n.tr("Authentication required")
7
8- text: i18n.tr("Enter password:")
9+ text: i18n.tr("Password is required to access all files")
10
11 signal passwordEntered(string password)
12
13
14=== modified file 'src/app/qml/ui/FolderListPage.qml'
15--- src/app/qml/ui/FolderListPage.qml 2014-10-24 23:41:57 +0000
16+++ src/app/qml/ui/FolderListPage.qml 2014-10-28 22:30:13 +0000
17@@ -108,6 +108,31 @@
18 iconName: "find"
19 text: i18n.tr("Go To")
20 onTriggered: PopupUtils.open(Qt.resolvedUrl("GoToDialog.qml"), parent)
21+ },
22+ Action {
23+ id: unlockButton
24+ iconName: "lock"
25+ text: i18n.tr("Unlock full access")
26+ visible: pageModel.onlyMTPPaths
27+ onTriggered: {
28+ console.log("Full access clicked")
29+ var authDialog = PopupUtils.open(Qt.resolvedUrl("AuthenticationDialog.qml"),
30+ folderListPage)
31+
32+ authDialog.passwordEntered.connect(function(password) {
33+ if (pamAuthentication.validatePasswordToken(password)) {
34+ console.log("Authenticated for full access")
35+ pageModel.onlyMTPPaths = false
36+ } else {
37+ PopupUtils.open(Qt.resolvedUrl("NotifyDialog.qml"), folderListPage,
38+ {
39+ title: i18n.tr("Authentication failed")
40+ })
41+
42+ console.log("Could not authenticate")
43+ }
44+ })
45+ }
46 }
47 ]
48 flickable: !sidebar.expanded ?
49@@ -308,29 +333,6 @@
50 cancelFileSelector()
51 }
52 }
53- Button {
54- text: i18n.tr("Unlock full access")
55- visible: pageModel.onlyMTPPaths
56- onClicked: {
57- console.log("Full access clicked")
58- var authDialog = PopupUtils.open(Qt.resolvedUrl("AuthenticationDialog.qml"),
59- folderListPage)
60-
61- authDialog.passwordEntered.connect(function(password) {
62- if (pamAuthentication.validatePasswordToken(password)) {
63- console.log("Authenticated for full access")
64- pageModel.onlyMTPPaths = false
65- } else {
66- PopupUtils.open(Qt.resolvedUrl("NotifyDialog.qml"), folderListPage,
67- {
68- title: i18n.tr("Authentication failed")
69- })
70-
71- console.log("Could not authenticate")
72- }
73- })
74- }
75- }
76 }
77
78 FolderIconView {

Subscribers

People subscribed via source and target branches