Merge lp:~ibelieve/ubuntu-filemanager-app/sidebar into lp:ubuntu-filemanager-app

Proposed by Michael Spencer
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 65
Merged at revision: 57
Proposed branch: lp:~ibelieve/ubuntu-filemanager-app/sidebar
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~ibelieve/ubuntu-filemanager-app/advanced-options
Diff against target: 1290 lines (+708/-207)
13 files modified
FileDetailsPopover.qml (+11/-0)
FolderListDelegate.qml (+1/-0)
FolderListPage.qml (+213/-103)
FolderListView.qml (+74/-76)
GoToDialog.qml (+89/-0)
OptionsPopover.qml (+38/-4)
PlacesPopover.qml (+10/-1)
PlacesSidebar.qml (+105/-0)
SettingsSheet.qml (+5/-1)
Sidebar.qml (+75/-0)
tests/autopilot/ubuntu_filemanager_app/emulators.py (+35/-6)
tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py (+47/-15)
ubuntu-filemanager-app.qml (+5/-1)
To merge this branch: bzr merge lp:~ibelieve/ubuntu-filemanager-app/sidebar
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+178783@code.launchpad.net

This proposal supersedes a proposal from 2013-08-06.

Commit message

Added sidebar for desktop/tablet mode and Suru theme

Description of the change

Added a sidebar for desktop/tablet mode that makes going to bookmarked places easy (like in Nautilus), and the initial dark-gray gradient Suru theme by Victor Thompson.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:57
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mdspencer/ubuntu-filemanager-app/sidebar/+merge/178783/+edit-commit-message

http://91.189.93.70:8080/job/ubuntu-filemanager-app-ci/21/
Executed test runs:
    SUCCESS: http://91.189.93.70:8080/job/ubuntu-filemanager-app-precise-amd64-ci/19
    SUCCESS: http://91.189.93.70:8080/job/ubuntu-filemanager-app-quantal-amd64-ci/22
    SUCCESS: http://91.189.93.70:8080/job/ubuntu-filemanager-app-raring-amd64-ci/22
    SUCCESS: http://91.189.93.70:8080/job/ubuntu-filemanager-app-saucy-amd64-ci/19

Click here to trigger a rebuild:
http://91.189.93.70:8080/job/ubuntu-filemanager-app-ci/21/rebuild

review: Needs Fixing (continuous-integration)
58. By Michael Spencer

Fixed visibility of actions in the folder actions popover

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
59. By Michael Spencer

Added initial Suru theme and some hacks to make it work by Victor Thompson

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
60. By Michael Spencer

Improved file action selection popover

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
61. By Michael Spencer

Fixed how the action selection popover worked

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
62. By Michael Spencer

Fixed action popovers

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
63. By Michael Spencer

Improved autopilot tests to work with the sidebar

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

This is really great looking. I love the added responsive layout! Awesome work!

As an improvement for the future, I think it'd be cool if the current path at the top of the app could "clip" or anchor to the top of the MainView as you scroll down. As an added bonus, then maybe the current path could be editable so it could replace the "Go To" toolbar icon and the text box in the "Places" toolbar popover.

64. By Michael Spencer

Fixed pep8 and pyflakes errors and worked on fixing autopilot tests

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
65. By Michael Spencer

Completely fixed all autopilot tests

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

All good from my perspective. Thanks for getting the tests in shape again :-) I want to run on my device before approving

Revision history for this message
Nicholas Skaggs (nskaggs) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'FileDetailsPopover.qml'
2--- FileDetailsPopover.qml 2013-07-26 03:44:12 +0000
3+++ FileDetailsPopover.qml 2013-08-09 18:43:12 +0000
4@@ -78,6 +78,7 @@
5 anchors.verticalCenter: parent.verticalCenter
6
7 text: folderName(root.path)
8+ color: Theme.palette.normal.overlayText
9 font.bold: true
10 }
11 }
12@@ -88,40 +89,50 @@
13
14 Label {
15 text: i18n.tr("Path:")
16+ color: Theme.palette.normal.overlayText
17 }
18
19 Label {
20 objectName: "pathLabel"
21 text: root.path
22+ color: Theme.palette.normal.overlayText
23 }
24
25 Label {
26 text: model.isDir ? i18n.tr("Contents:")
27 : i18n.tr("Size:")
28+ color: Theme.palette.normal.overlayText
29 }
30 Label {
31 text: model.fileSize
32+ color: Theme.palette.normal.overlayText
33 }
34
35 Label {
36 text: i18n.tr("Accessed:")
37+ color: Theme.palette.normal.overlayText
38 }
39 Label {
40 text: dateTimeFormat(model.accessedDate)
41+ color: Theme.palette.normal.overlayText
42 }
43
44 Label {
45 text: i18n.tr("Modified:")
46+ color: Theme.palette.normal.overlayText
47 }
48 Label {
49 text: dateTimeFormat(model.modifiedDate)
50+ color: Theme.palette.normal.overlayText
51 }
52
53 Label {
54 text: i18n.tr("Permissions:")
55+ color: Theme.palette.normal.overlayText
56 }
57 Label {
58 text: permissionsToString(model)
59+ color: Theme.palette.normal.overlayText
60 }
61
62 }
63
64=== modified file 'FolderListDelegate.qml'
65--- FolderListDelegate.qml 2013-07-01 13:51:05 +0000
66+++ FolderListDelegate.qml 2013-08-09 18:43:12 +0000
67@@ -24,6 +24,7 @@
68 objectName: "folder" + index
69
70 property string fileName: model.fileName
71+ property string filePath: path
72
73 text: model.fileName
74 subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
75
76=== modified file 'FolderListPage.qml'
77--- FolderListPage.qml 2013-08-09 18:43:12 +0000
78+++ FolderListPage.qml 2013-08-09 18:43:12 +0000
79@@ -18,6 +18,7 @@
80 import QtQuick 2.0
81 import Ubuntu.Components 0.1
82 import Ubuntu.Components.Popups 0.1
83+import Ubuntu.Components.ListItems 0.1
84 import org.nemomobile.folderlistmodel 1.0
85
86 Page {
87@@ -198,72 +199,104 @@
88 }
89 }
90
91- ActionSelectionPopover {
92- id: folderActionsPopover
93- objectName: "folderActionsPopover"
94-
95- actions: ActionList {
96- Action {
97- text: i18n.tr("Create New Folder")
98- onTriggered: {
99- print(text)
100-
101- PopupUtils.open(createFolderDialog, root)
102- }
103- }
104-
105- // TODO: Disabled until backend supports creating files
106-// Action {
107-// text: i18n.tr("Create New File")
108-// onTriggered: {
109-// print(text)
110-
111-// PopupUtils.open(createFileDialog, root)
112-// }
113-// }
114-
115- Action {
116- text: pageModel.clipboardUrlsCounter === 0
117- ? i18n.tr("Paste")
118- : pageModel.clipboardUrlsCounter === 1
119- ? i18n.tr("Paste %1 File").arg(pageModel.clipboardUrlsCounter)
120- : i18n.tr("Paste %1 Files").arg(pageModel.clipboardUrlsCounter)
121- onTriggered: {
122- console.log("Pasting to current folder items of count " + pageModel.clipboardUrlsCounter)
123- PopupUtils.open(Qt.resolvedUrl("FileOperationProgressDialog.qml"),
124- root,
125- {
126- title: i18n.tr("Paste files"),
127- folderListModel: pageModel
128- }
129- )
130-
131-
132- pageModel.paste()
133- }
134-
135- // FIXME: This property is depreciated and doesn't seem to work!
136- //visible: pageModel.clipboardUrlsCounter > 0
137-
138- enabled: pageModel.clipboardUrlsCounter > 0
139- }
140-
141- Action {
142- text: i18n.tr("Properties")
143- onTriggered: {
144- print(text)
145- PopupUtils.open(Qt.resolvedUrl("FileDetailsPopover.qml"),
146- root,
147- { "model": pageModel
148- }
149- )
150- }
151+ Component {
152+ id: folderActionsPopoverComponent
153+ ActionSelectionPopover {
154+ id: folderActionsPopover
155+ objectName: "folderActionsPopover"
156+
157+ grabDismissAreaEvents: true
158+
159+ actions: ActionList {
160+ Action {
161+ text: i18n.tr("Create New Folder")
162+ onTriggered: {
163+ print(text)
164+
165+ PopupUtils.open(createFolderDialog, root)
166+ }
167+ }
168+
169+ // TODO: Disabled until backend supports creating files
170+ // Action {
171+ // text: i18n.tr("Create New File")
172+ // onTriggered: {
173+ // print(text)
174+
175+ // PopupUtils.open(createFileDialog, root)
176+ // }
177+ // }
178+
179+ Action {
180+ text: pageModel.clipboardUrlsCounter === 0
181+ ? i18n.tr("Paste")
182+ : pageModel.clipboardUrlsCounter === 1
183+ ? i18n.tr("Paste %1 File").arg(pageModel.clipboardUrlsCounter)
184+ : i18n.tr("Paste %1 Files").arg(pageModel.clipboardUrlsCounter)
185+ onTriggered: {
186+ console.log("Pasting to current folder items of count " + pageModel.clipboardUrlsCounter)
187+ PopupUtils.open(Qt.resolvedUrl("FileOperationProgressDialog.qml"),
188+ root,
189+ {
190+ title: i18n.tr("Paste files"),
191+ folderListModel: pageModel
192+ }
193+ )
194+
195+
196+ pageModel.paste()
197+ }
198+
199+ // FIXME: This property is depreciated and doesn't seem to work!
200+ //visible: pageModel.clipboardUrlsCounter > 0
201+
202+ enabled: pageModel.clipboardUrlsCounter > 0
203+ }
204+
205+ // TODO: Disabled until support for opening apps is added
206+ Action {
207+ text: i18n.tr("Open in Terminal")
208+ onTriggered: {
209+ print(text)
210+
211+ // Is this the way it will work??
212+ Qt.openUrlExternally("app://terminal")
213+ }
214+
215+ enabled: showAdvancedFeatures && false
216+ }
217+
218+ Action {
219+ text: i18n.tr("Properties")
220+ onTriggered: {
221+ print(text)
222+ PopupUtils.open(Qt.resolvedUrl("FileDetailsPopover.qml"),
223+ root,
224+ { "model": pageModel
225+ }
226+ )
227+ }
228+ }
229+ }
230+
231+ delegate: Empty {
232+ id: listItem
233+ Label {
234+ text: listItem.text
235+ anchors {
236+ verticalCenter: parent.verticalCenter
237+ horizontalCenter: parent.horizontalCenter
238+ }
239+ wrapMode: Text.Wrap
240+ color: Theme.palette.normal.overlayText
241+ }
242+
243+ /*! \internal */
244+ onTriggered: folderActionsPopover.hide()
245+ visible: listItem.enabled
246+ height: visible ? implicitHeight : 0
247 }
248 }
249-
250- // Without this the popover jumps up at the start of the application. SDK bug?
251- // Bug report has been made of these https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1152270
252- visible: false
253 }
254
255 Component {
256@@ -324,8 +357,7 @@
257
258 onTriggered: {
259 print(text)
260- folderActionsPopover.caller = caller
261- folderActionsPopover.show();
262+ PopupUtils.open(folderActionsPopoverComponent, caller)
263 }
264 }
265
266@@ -341,6 +373,19 @@
267 }
268
269 ToolbarButton {
270+ visible: wideAspect
271+ objectName: "goTo"
272+ text: i18n.tr("Go To")
273+ iconSource: "icons/location.png"
274+ onTriggered: {
275+ print(text)
276+
277+ PopupUtils.open(Qt.resolvedUrl("GoToDialog.qml"), caller)
278+ }
279+ }
280+
281+ ToolbarButton {
282+ visible: !wideAspect
283 objectName: "places"
284 text: i18n.tr("Places")
285 iconSource: "icons/location.png"
286@@ -362,43 +407,108 @@
287 }
288 }
289
290- Column {
291- anchors.centerIn: parent
292- Label {
293- text: i18n.tr("No files")
294- fontSize: "large"
295- visible: folderListView.count == 0 && !pageModel.awaitingResults
296- }
297- ActivityIndicator {
298- running: pageModel.awaitingResults
299- width: units.gu(8)
300- height: units.gu(8)
301- }
302- }
303-
304- FolderListView {
305- id: folderListView
306-
307- clip: true
308-
309- folderListModel: pageModel
310- anchors.fill: parent
311- // IMPROVE: this should work (?), but it doesn't. Height is undefined. Anyway in previous
312- // SDK version the parent size was properly initialized. Now the size of toolbar is not taken into
313- // account and apparently you can't even query toolbar's height.
314- // anchors.bottomMargin: toolbar.height
315- // Now in newer SDK (raring 19.07.2013) locked&opened toolbar is taken into
316- // account in some fashion, but the extra space left to the bottom without this
317- // bottomMargin definition seems to be exactly what is the height of Header's gray
318- // separator bar. This ugly workaround seems to give correct height for view at least on desktop.
319- // Bug report on this:
320- // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1202881
321- // This bug report also affects this, as if the toolbar is hidden by default
322- // then there is no problem:
323- // https://bugs.launchpad.net/ubuntu-filemanager-app/+bug/1198861
324- // Hard-code it for now. Not nice at all:
325- anchors.bottomMargin: units.gu(-2)
326- }
327+ flickable: !wideAspect ? folderListView : null
328+
329+ PlacesSidebar {
330+ id: sidebar
331+ objectName: "placesSidebar"
332+
333+ anchors {
334+ top: parent.top
335+ topMargin: units.gu(9.5)
336+ bottom: parent.bottom
337+ bottomMargin: units.gu(-2)
338+ }
339+
340+ expanded: wideAspect
341+ }
342+
343+ Item {
344+ id: contents
345+ anchors {
346+ top: parent.top
347+ bottom: parent.bottom
348+ left: sidebar.right
349+ right: parent.right
350+
351+ // IMPROVE: this should work (?), but it doesn't. Height is undefined. Anyway in previous
352+ // SDK version the parent size was properly initialized. Now the size of toolbar is not taken into
353+ // account and apparently you can't even query toolbar's height.
354+ // anchors.bottomMargin: toolbar.height
355+ // Now in newer SDK (raring 19.07.2013) locked&opened toolbar is taken into
356+ // account in some fashion, but the extra space left to the bottom without this
357+ // bottomMargin definition seems to be exactly what is the height of Header's gray
358+ // separator bar. This ugly workaround seems to give correct height for view at least on desktop.
359+ // Bug report on this:
360+ // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1202881
361+ // This bug report also affects this, as if the toolbar is hidden by default
362+ // then there is no problem:
363+ // https://bugs.launchpad.net/ubuntu-filemanager-app/+bug/1198861
364+ // Hard-code it for now. Not nice at all:
365+ bottomMargin: units.gu(-2)
366+ }
367+
368+ Column {
369+ anchors.centerIn: parent
370+ Label {
371+ text: i18n.tr("No files")
372+ fontSize: "large"
373+ visible: folderListView.count == 0 && !pageModel.awaitingResults
374+ }
375+ ActivityIndicator {
376+ running: pageModel.awaitingResults
377+ width: units.gu(8)
378+ height: units.gu(8)
379+ }
380+ }
381+
382+ FolderListView {
383+ id: folderListView
384+
385+ clip: true
386+
387+ folderListModel: pageModel
388+ anchors.fill: parent
389+ }
390+ }
391+
392+ states: [
393+ State {
394+ name: "wide"
395+ when: wideAspect
396+ PropertyChanges {
397+ target: tools
398+ locked: true
399+ opened: true
400+ }
401+
402+ PropertyChanges {
403+ target: folderListView
404+
405+ anchors.top: contents.top
406+ anchors.topMargin: units.gu(9.5)
407+ topMargin: 0
408+ }
409+
410+ PropertyChanges {
411+ target: contents
412+ anchors.top: root.top
413+ anchors.topMargin: 0
414+ }
415+ },
416+
417+ //FIXME: This should automatically be calculated - is there a way to remove it?
418+ State {
419+ name: ""
420+
421+ PropertyChanges {
422+ target: folderListView
423+
424+ topMargin: units.gu(9.5)
425+ }
426+ }
427+
428+ ]
429
430 // Errors from model
431 Connections {
432
433=== modified file 'FolderListView.qml'
434--- FolderListView.qml 2013-07-11 22:40:40 +0000
435+++ FolderListView.qml 2013-08-09 18:43:12 +0000
436@@ -94,82 +94,79 @@
437 }
438 }
439
440- ActionSelectionPopover {
441- id: actionSelectionPopover
442- objectName: "fileActionsPopover"
443-
444- property var model
445- actions: ActionList {
446- Action {
447- text: i18n.tr("Cut")
448- // TODO: temporary
449- iconSource: "/usr/share/icons/Humanity/actions/48/edit-cut.svg"
450- onTriggered: {
451- console.log("Cut on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)
452- model.cutIndex(actionSelectionPopover.model.index)
453- console.log("CliboardUrlsCounter after copy", folderListModel.clipboardUrlsCounter)
454- }
455- }
456-
457- Action {
458- text: i18n.tr("Copy")
459- // TODO: temporary.
460- iconSource: "/usr/share/icons/Humanity/actions/48/edit-copy.svg"
461-
462- onTriggered: {
463- console.log("Copy on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)
464- model.copyIndex(actionSelectionPopover.model.index)
465- console.log("CliboardUrlsCounter after copy", folderListModel.clipboardUrlsCounter)
466- }
467- }
468-
469- Action {
470- text: i18n.tr("Delete")
471- // TODO: temporary
472- iconSource: "/usr/share/icons/Humanity/actions/48/edit-delete.svg"
473- onTriggered: {
474- print(text)
475- PopupUtils.open(confirmSingleDeleteDialog, actionSelectionPopover.caller,
476- { "filePath" : actionSelectionPopover.model.filePath,
477- "fileName" : actionSelectionPopover.model.fileName }
478- )
479- }
480- }
481-
482- Action {
483- text: i18n.tr("Rename")
484- // TODO: temporary
485- iconSource: "/usr/share/icons/Humanity/actions/48/rotate.svg"
486- onTriggered: {
487- print(text)
488- PopupUtils.open(confirmRenameDialog, actionSelectionPopover.caller,
489- { "modelRow" : actionSelectionPopover.model.index,
490- "inputText" : actionSelectionPopover.model.fileName
491- })
492- }
493- }
494-
495- Action {
496- text: i18n.tr("Properties")
497- onTriggered: {
498- print(text)
499- PopupUtils.open(Qt.resolvedUrl("FileDetailsPopover.qml"),
500- actionSelectionPopover.caller,
501- { "model": actionSelectionPopover.model
502- }
503- )
504+ Component {
505+ id: actionSelectionPopoverComponent
506+
507+ ActionSelectionPopover {
508+ id: actionSelectionPopover
509+ objectName: "fileActionsPopover"
510+
511+ grabDismissAreaEvents: true
512+
513+ property var model
514+ actions: ActionList {
515+ Action {
516+ text: i18n.tr("Cut")
517+ // TODO: temporary
518+ iconSource: "/usr/share/icons/Humanity/actions/48/edit-cut.svg"
519+ onTriggered: {
520+ console.log("Cut on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)
521+ pageModel.cutIndex(actionSelectionPopover.model.index)
522+ console.log("CliboardUrlsCounter after copy", folderListModel.clipboardUrlsCounter)
523+ }
524+ }
525+
526+ Action {
527+ text: i18n.tr("Copy")
528+ // TODO: temporary.
529+ iconSource: "/usr/share/icons/Humanity/actions/48/edit-copy.svg"
530+
531+ onTriggered: {
532+ console.log("Copy on row called for", actionSelectionPopover.model.fileName, actionSelectionPopover.model.index)
533+ pageModel.copyIndex(actionSelectionPopover.model.index)
534+ console.log("CliboardUrlsCounter after copy", folderListModel.clipboardUrlsCounter)
535+ }
536+ }
537+
538+ Action {
539+ text: i18n.tr("Delete")
540+ // TODO: temporary
541+ iconSource: "/usr/share/icons/Humanity/actions/48/edit-delete.svg"
542+ onTriggered: {
543+ print(text)
544+ PopupUtils.open(confirmSingleDeleteDialog, actionSelectionPopover.caller,
545+ { "filePath" : actionSelectionPopover.model.filePath,
546+ "fileName" : actionSelectionPopover.model.fileName }
547+ )
548+ }
549+ }
550+
551+ Action {
552+ text: i18n.tr("Rename")
553+ // TODO: temporary
554+ iconSource: "/usr/share/icons/Humanity/actions/48/rotate.svg"
555+ onTriggered: {
556+ print(text)
557+ PopupUtils.open(confirmRenameDialog, actionSelectionPopover.caller,
558+ { "modelRow" : actionSelectionPopover.model.index,
559+ "inputText" : actionSelectionPopover.model.fileName
560+ })
561+ }
562+ }
563+
564+ Action {
565+ text: i18n.tr("Properties")
566+ onTriggered: {
567+ print(text)
568+ PopupUtils.open(Qt.resolvedUrl("FileDetailsPopover.qml"),
569+ actionSelectionPopover.caller,
570+ { "model": actionSelectionPopover.model
571+ }
572+ )
573+ }
574 }
575 }
576 }
577- // TODO: problem: clicking outside popup makes the click go through to the
578- // folder listview, so for example you'd change directory while only trying
579- // to dismiss the popup. Maybe SDK bug, if not have to do workarounds.
580- // grabDismissAreaEvents seemed promising, but at least with onPressAndHold
581- // makes background view scroll when moving mouse as if mouse button was still down.
582- // grabDismissAreaEvents: false
583- // Without this the popover jumps up at the start of the application. SDK bug?
584- // Bug report has been made of these https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1152270
585- visible: false
586 }
587
588 delegate: FolderListDelegate {
589@@ -201,9 +198,10 @@
590
591 onPressAndHold: {
592 console.log("FolderListDelegate onPressAndHold")
593- actionSelectionPopover.caller = delegate
594- actionSelectionPopover.model = model
595- actionSelectionPopover.show();
596+ PopupUtils.open(actionSelectionPopoverComponent, delegate,
597+ {
598+ model: model
599+ })
600 }
601 }
602
603
604=== added file 'GoToDialog.qml'
605--- GoToDialog.qml 1970-01-01 00:00:00 +0000
606+++ GoToDialog.qml 2013-08-09 18:43:12 +0000
607@@ -0,0 +1,89 @@
608+/*
609+ * Copyright (C) 2013 Canonical Ltd
610+ *
611+ * This program is free software: you can redistribute it and/or modify
612+ * it under the terms of the GNU General Public License version 3 as
613+ * published by the Free Software Foundation.
614+ *
615+ * This program is distributed in the hope that it will be useful,
616+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
617+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
618+ * GNU General Public License for more details.
619+ *
620+ * You should have received a copy of the GNU General Public License
621+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
622+ *
623+ * Authored by: Michael Spencer <spencers1993@gmail.com>
624+ */
625+import QtQuick 2.0
626+import Ubuntu.Components 0.1
627+import Ubuntu.Components.Popups 0.1
628+
629+Dialog {
630+ id: root
631+
632+ title: i18n.tr("Go To Location")
633+
634+ text: i18n.tr("Enter a location to go to:")
635+
636+ TextField {
637+ id: locationField
638+
639+ inputMethodHints: Qt.ImhNoAutoUppercase
640+
641+ property bool valid: pathExists(text)
642+
643+ text: fileView.path
644+
645+ placeholderText: i18n.tr("Location...")
646+
647+ onAccepted: goButton.clicked()
648+ }
649+
650+ Button {
651+ id: goButton
652+ objectName: "goButton"
653+
654+ gradient: Gradient {
655+ GradientStop {
656+ position: 0
657+ color: "green"//Qt.rgba(0,0.7,0,1)
658+ }
659+
660+ GradientStop {
661+ position: 1
662+ color: Qt.rgba(0.3,0.7,0.3,1)
663+ }
664+ }
665+
666+ text: i18n.tr("Go")
667+ enabled: locationField.acceptableInput && locationField.valid
668+
669+ onClicked: {
670+ print("User switched to:", locationField.text)
671+ goTo(locationField.text)
672+ PopupUtils.close(root)
673+ }
674+ }
675+
676+ Button {
677+ objectName: "cancelButton"
678+ text: i18n.tr("Cancel")
679+
680+ gradient: Gradient {
681+ GradientStop {
682+ position: 0
683+ color: "gray"
684+ }
685+
686+ GradientStop {
687+ position: 1
688+ color: "lightgray"
689+ }
690+ }
691+
692+ onClicked: {
693+ PopupUtils.close(root)
694+ }
695+ }
696+}
697
698=== modified file 'OptionsPopover.qml'
699--- OptionsPopover.qml 2013-08-09 18:43:12 +0000
700+++ OptionsPopover.qml 2013-08-09 18:43:12 +0000
701@@ -35,7 +35,15 @@
702 id: showHiddenFileCheckBox
703 objectName: "showHiddenFileCheckBox"
704
705- text: i18n.tr("Show Hidden Files")
706+ Label {
707+ text: i18n.tr("Show Hidden Files")
708+ fontSize: "medium"
709+ color: Theme.palette.normal.overlayText
710+ anchors.left: parent.left
711+ anchors.leftMargin: units.gu(2)
712+ anchors.verticalCenter: parent.verticalCenter
713+ }
714+
715 control: CheckBox {
716 anchors.verticalCenter: parent.verticalCenter
717
718@@ -47,7 +55,16 @@
719 }
720
721 ValueSelector {
722- text: i18n.tr("Sort By")
723+ Label {
724+ text: i18n.tr("Sort By")
725+ fontSize: "medium"
726+ color: Theme.palette.normal.overlayText
727+ anchors.left: parent.left
728+ anchors.leftMargin: units.gu(2)
729+ anchors.top: parent.top
730+ anchors.topMargin: units.gu(1.6)
731+ }
732+
733 selectedIndex: values.indexOf(fileView.sortingMethod)
734 values: [
735 i18n.tr("Name"),
736@@ -60,7 +77,16 @@
737 }
738
739 ValueSelector {
740- text: i18n.tr("Sort Order")
741+ Label {
742+ text: i18n.tr("Sort Order")
743+ fontSize: "medium"
744+ color: Theme.palette.normal.overlayText
745+ anchors.left: parent.left
746+ anchors.leftMargin: units.gu(2)
747+ anchors.top: parent.top
748+ anchors.topMargin: units.gu(1.7)
749+ }
750+
751 selectedIndex: sortAccending ? 0 : 1
752 values: [
753 i18n.tr("Ascending"),
754@@ -74,7 +100,15 @@
755
756 Standard {
757 visible: showAdvancedFeatures
758- text: i18n.tr("Filter")
759+
760+ Label {
761+ text: i18n.tr("Filter")
762+ fontSize: "medium"
763+ color: Theme.palette.normal.overlayText
764+ anchors.left: parent.left
765+ anchors.leftMargin: units.gu(2)
766+ anchors.verticalCenter: parent.verticalCenter
767+ }
768
769 TextField {
770 id: filterField
771
772=== modified file 'PlacesPopover.qml'
773--- PlacesPopover.qml 2013-07-08 22:23:29 +0000
774+++ PlacesPopover.qml 2013-08-09 18:43:12 +0000
775@@ -124,13 +124,22 @@
776 model: places
777
778 delegate: Standard {
779- text: folderName(path)
780+ Label {
781+ anchors.left: parent.left
782+ anchors.leftMargin: units.gu(8)
783+ anchors.verticalCenter: parent.verticalCenter
784+ text: folderName(path)
785+ color: selected ? UbuntuColors.orange : Theme.palette.normal.overlayText
786+ }
787+
788 icon: model.icon || fileIcon(model.path, true)
789
790 onClicked: {
791 PopupUtils.close(root)
792 goTo(model.path)
793 }
794+
795+ selected: folder === path
796 }
797 }
798 }
799
800=== added file 'PlacesSidebar.qml'
801--- PlacesSidebar.qml 1970-01-01 00:00:00 +0000
802+++ PlacesSidebar.qml 2013-08-09 18:43:12 +0000
803@@ -0,0 +1,105 @@
804+/*
805+ * Copyright (C) 2013 Canonical Ltd
806+ *
807+ * This program is free software: you can redistribute it and/or modify
808+ * it under the terms of the GNU General Public License version 3 as
809+ * published by the Free Software Foundation.
810+ *
811+ * This program is distributed in the hope that it will be useful,
812+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
813+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
814+ * GNU General Public License for more details.
815+ *
816+ * You should have received a copy of the GNU General Public License
817+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
818+ *
819+ * Authored by: Michael Spencer <spencers1993@gmail.com>
820+ */
821+import QtQuick 2.0
822+import Ubuntu.Components 0.1
823+import Ubuntu.Components.ListItems 0.1
824+import Ubuntu.Components.Popups 0.1
825+
826+Sidebar {
827+ id: root
828+
829+ color: "gray"
830+
831+ width: units.gu(25)
832+
833+ ListModel {
834+ id: places
835+
836+ ListElement {
837+ path: "~"
838+ }
839+
840+ ListElement {
841+ path: "~/Documents"
842+ }
843+
844+ ListElement {
845+ path: "~/Downloads"
846+ }
847+
848+ ListElement {
849+ path: "~/Music"
850+ }
851+
852+ ListElement {
853+ path: "~/Pictures"
854+ }
855+
856+ ListElement {
857+ path: "~/Videos"
858+ }
859+
860+ ListElement {
861+ path: "/"
862+ }
863+ }
864+
865+ Column {
866+ anchors {
867+ left: parent.left
868+ right: parent.right
869+ top: parent.top
870+ }
871+
872+ Header {
873+// Label {
874+// anchors.left: parent.left
875+// anchors.leftMargin: units.gu(1)
876+// anchors.verticalCenter: parent.verticalCenter
877+ text: i18n.tr("Places")
878+// color: Theme.palette.normal.overlayText
879+// }
880+ }
881+
882+ Repeater {
883+ id: placesList
884+ objectName: "placesList"
885+
886+ model: places
887+
888+ delegate: Standard {
889+// Label {
890+// anchors.left: parent.left
891+// anchors.leftMargin: units.gu(8)
892+// anchors.verticalCenter: parent.verticalCenter
893+ text: folderName(path)
894+// color: Theme.palette.normal.overlayText
895+// }
896+ icon: model.icon || fileIcon(model.path, true)
897+
898+ onClicked: {
899+ goTo(model.path)
900+ }
901+
902+ height: units.gu(5)
903+
904+ selected: folder === path
905+ }
906+ }
907+ }
908+}
909
910=== modified file 'SettingsSheet.qml'
911--- SettingsSheet.qml 2013-08-09 18:43:12 +0000
912+++ SettingsSheet.qml 2013-08-09 18:43:12 +0000
913@@ -14,7 +14,11 @@
914
915 title: i18n.tr("Settings")
916
917- contentsHeight: parent.height
918+ Binding {
919+ target: root.__foreground
920+ property: "minHeight"
921+ value: Math.max(units.gu(75), root.contentsHeight)
922+ }
923
924 Column {
925 anchors.fill: parent
926
927=== added file 'Sidebar.qml'
928--- Sidebar.qml 1970-01-01 00:00:00 +0000
929+++ Sidebar.qml 2013-08-09 18:43:12 +0000
930@@ -0,0 +1,75 @@
931+/*
932+ * Copyright (C) 2013 Canonical Ltd
933+ *
934+ * This program is free software: you can redistribute it and/or modify
935+ * it under the terms of the GNU General Public License version 3 as
936+ * published by the Free Software Foundation.
937+ *
938+ * This program is distributed in the hope that it will be useful,
939+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
940+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
941+ * GNU General Public License for more details.
942+ *
943+ * You should have received a copy of the GNU General Public License
944+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
945+ *
946+ * Authored by: Michael Spencer <spencers1993@gmail.com>
947+ */
948+
949+import QtQuick 2.0
950+import Ubuntu.Components 0.1
951+import Ubuntu.Components.ListItems 0.1
952+
953+Rectangle {
954+ //color: "lightgray"
955+
956+ property bool expanded: true
957+
958+ Item {
959+ ThinDivider {
960+ rotation: 90
961+
962+ //Rectangle {
963+ //color: "lightgray"
964+
965+ //width: 1
966+ width: parent.height
967+ height: 2
968+ anchors {
969+ left: undefined
970+ right: undefined
971+ centerIn: parent
972+ }
973+ }
974+ width: 2
975+
976+ anchors {
977+ top: parent.top
978+ bottom: parent.bottom
979+ right: parent.right
980+ rightMargin: 0
981+ }
982+ }
983+
984+ width: units.gu(35)
985+
986+
987+ x: expanded ? 0 : -width
988+
989+ Behavior on x {
990+ PropertyAnimation {
991+ duration: 250
992+ }
993+ }
994+
995+ default property alias contents: contents.data
996+
997+ Item {
998+ id: contents
999+
1000+ anchors {
1001+ fill: parent
1002+ rightMargin: 1
1003+ }
1004+ }
1005+}
1006
1007=== modified file 'tests/autopilot/ubuntu_filemanager_app/emulators.py'
1008--- tests/autopilot/ubuntu_filemanager_app/emulators.py 2013-07-26 17:12:14 +0000
1009+++ tests/autopilot/ubuntu_filemanager_app/emulators.py 2013-08-09 18:43:12 +0000
1010@@ -29,7 +29,9 @@
1011
1012 def get_folder_list_page(self):
1013 """Return the FolderListPage emulator of the MainView."""
1014- return self.select_single(FolderListPage)
1015+ page = self.select_single(FolderListPage)
1016+ page.main_view = self
1017+ return page
1018
1019 def get_file_actions_popover(self):
1020 """Return the ActionSelectionPopover emulator of the file actions."""
1021@@ -43,10 +45,15 @@
1022
1023 def get_places_popover(self):
1024 """Return the Places popover."""
1025- # XXX It would be easier if the places popover was an object that
1026- # inherits from Popover, like the ActionSelectionPopover does.
1027- # --elopio - 2013-07-25
1028- return self.select_single('Popover', objectName='placesPopover')
1029+ if not(self.wideAspect):
1030+ # XXX It would be easier if the places popover was an object
1031+ # that inherits from Popover, like the
1032+ # ActionSelectionPopover does.
1033+ # --elopio - 2013-07-25
1034+ return self.select_single('Popover', objectName='placesPopover')
1035+ else:
1036+ raise ValueError(
1037+ 'Places sidebar is hidden in wide mode.')
1038
1039 def get_file_details_popover(self):
1040 """Return the FileDetailsPopover emulator."""
1041@@ -63,6 +70,18 @@
1042 return dialog
1043
1044
1045+class Sidebar(toolkit_emulators.UbuntuUIToolkitEmulatorBase):
1046+ """PlacesSidebar Autopilot emulator."""
1047+
1048+ def get_place(self, text):
1049+ places = self.select_many('Standard')
1050+ for place in places:
1051+ if place.text == text:
1052+ return place
1053+ raise ValueError(
1054+ 'Place "{0}" not found.'.format(text))
1055+
1056+
1057 class FolderListPage(toolkit_emulators.UbuntuUIToolkitEmulatorBase):
1058 """FolderListPage Autopilot emulator."""
1059
1060@@ -76,7 +95,9 @@
1061 :parameter index: The index of file or folder.
1062
1063 """
1064- return self.select_many(FolderListDelegate)[index]
1065+ file_ = self.select_many(FolderListDelegate)[index]
1066+ file_.list_view = self.select_single(FolderListView)
1067+ return file_
1068
1069 def get_file_by_name(self, name):
1070 """Return the FolderListDelegate emulator of the file or folder.
1071@@ -87,6 +108,7 @@
1072 files = self.select_many(FolderListDelegate)
1073 for file_ in files:
1074 if file_.fileName == name:
1075+ file_.list_view = self.select_single(FolderListView)
1076 return file_
1077 raise ValueError(
1078 'File with name "{0}" not found.'.format(name))
1079@@ -97,6 +119,13 @@
1080 def get_number_of_files_from_header(self):
1081 return self.select_single(FolderListView).get_number_of_files()
1082
1083+ def get_sidebar(self):
1084+ if self.main_view.wideAspect:
1085+ return self.select_single(Sidebar)
1086+ else:
1087+ raise ValueError(
1088+ 'Places sidebar is hidden in wide mode.')
1089+
1090
1091 class FolderListView(toolkit_emulators.UbuntuUIToolkitEmulatorBase):
1092 """FolderListView Autopilot emulator."""
1093
1094=== modified file 'tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py'
1095--- tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-07-26 18:40:15 +0000
1096+++ tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-08-09 18:43:12 +0000
1097@@ -27,6 +27,7 @@
1098 from autopilot import process
1099 from autopilot.matchers import Eventually
1100 from testtools.matchers import Equals
1101+from testtools.matchers import NotEquals
1102
1103 from ubuntu_filemanager_app.tests import FileManagerTestCase
1104
1105@@ -127,6 +128,15 @@
1106 self.assertThat(
1107 self.main_view.get_file_action_dialog, Eventually(Equals(None)))
1108
1109+ def _open_directory(self, item):
1110+ expected_path = item.filePath
1111+ list_view = item.list_view
1112+
1113+ #item.open_directory()
1114+ self.pointing_device.click_object(item)
1115+ self.assertThat(
1116+ list_view.get_current_path, Eventually(Equals(expected_path)))
1117+
1118 def test_open_file(self):
1119 self._make_file_in_home()
1120
1121@@ -163,7 +173,7 @@
1122 dir_path = self._make_directory_in_home()
1123 first_dir = self._get_file_by_index(0)
1124
1125- first_dir.open_directory()
1126+ self._open_directory(first_dir)
1127
1128 folder_list_page = self.main_view.get_folder_list_page()
1129 self.assertThat(
1130@@ -187,8 +197,14 @@
1131
1132 def _do_action_on_file(self, file_, action):
1133 file_.open_actions_popover()
1134+ self.assertThat(
1135+ self.main_view.get_file_actions_popover,
1136+ Eventually(NotEquals(None)))
1137 file_actions_popover = self.main_view.get_file_actions_popover()
1138 file_actions_popover.click_button(action)
1139+ self.assertThat(
1140+ self.main_view.get_file_actions_popover,
1141+ Eventually(Equals(None)))
1142
1143 def _cancel_confirm_dialog(self):
1144 confirm_dialog = self.main_view.get_confirm_dialog()
1145@@ -222,9 +238,11 @@
1146 self._cancel_confirm_dialog()
1147
1148 self.assertThat(
1149- self.main_view.get_confirm_dialog, Eventually(Equals(None)))
1150+ self.main_view.get_confirm_dialog,
1151+ Eventually(Equals(None)))
1152 self.assertThat(
1153- lambda: first_file.fileName, Eventually(Equals(file_name)))
1154+ lambda: first_file.fileName,
1155+ Eventually(Equals(file_name)))
1156
1157 def test_rename_file(self):
1158 self._make_file_in_home()
1159@@ -334,7 +352,7 @@
1160 # Go to the destination directory.
1161 destination_dir = folder_list_page.get_file_by_name(
1162 destination_dir_name)
1163- destination_dir.open_directory()
1164+ self._open_directory(destination_dir)
1165
1166 # Paste the directory.
1167 toolbar = self.main_view.open_toolbar()
1168@@ -342,7 +360,9 @@
1169
1170 folder_actions_popover = self.main_view.get_folder_actions_popover()
1171 folder_actions_popover.click_button('Paste 1 File')
1172- self.main_view.get_folder_actions_popover().visible.wait_for(False)
1173+ self.assertThat(
1174+ self.main_view.get_folder_actions_popover,
1175+ Eventually(Equals(None)))
1176
1177 # Check that the directory is there.
1178 self._assert_number_of_files(1)
1179@@ -376,7 +396,7 @@
1180 # Go to the destination directory.
1181 destination_dir = folder_list_page.get_file_by_name(
1182 destination_dir_name)
1183- destination_dir.open_directory()
1184+ self._open_directory(destination_dir)
1185
1186 # Paste the directory.
1187 toolbar = self.main_view.open_toolbar()
1188@@ -384,7 +404,9 @@
1189
1190 folder_actions_popover = self.main_view.get_folder_actions_popover()
1191 folder_actions_popover.click_button('Paste 1 File')
1192- self.main_view.get_folder_actions_popover().visible.wait_for(False)
1193+ self.assertThat(
1194+ self.main_view.get_folder_actions_popover,
1195+ Eventually(Equals(None)))
1196
1197 # Check that the directory is there.
1198 self._assert_number_of_files(1)
1199@@ -419,7 +441,7 @@
1200 # Go to the destination directory.
1201 destination_dir = folder_list_page.get_file_by_name(
1202 destination_dir_name)
1203- destination_dir.open_directory()
1204+ self._open_directory(destination_dir)
1205
1206 # Paste the file.
1207 toolbar = self.main_view.open_toolbar()
1208@@ -427,7 +449,10 @@
1209
1210 folder_actions_popover = self.main_view.get_folder_actions_popover()
1211 folder_actions_popover.click_button('Paste 1 File')
1212- self.main_view.get_folder_actions_popover().visible.wait_for(False)
1213+
1214+ self.assertThat(
1215+ self.main_view.get_folder_actions_popover,
1216+ Eventually(Equals(None)))
1217
1218 # Check that the file is there.
1219 self._assert_number_of_files(1)
1220@@ -459,7 +484,7 @@
1221 # Go to the destination directory.
1222 destination_dir = folder_list_page.get_file_by_name(
1223 destination_dir_name)
1224- destination_dir.open_directory()
1225+ self._open_directory(destination_dir)
1226
1227 # Paste the file.
1228 toolbar = self.main_view.open_toolbar()
1229@@ -467,7 +492,9 @@
1230
1231 folder_actions_popover = self.main_view.get_folder_actions_popover()
1232 folder_actions_popover.click_button('Paste 1 File')
1233- self.main_view.get_folder_actions_popover().visible.wait_for(False)
1234+ self.assertThat(
1235+ self.main_view.get_folder_actions_popover,
1236+ Eventually(Equals(None)))
1237
1238 # Check that the file is there.
1239 self._assert_number_of_files(1)
1240@@ -488,7 +515,7 @@
1241 def test_go_up(self):
1242 self._make_directory_in_home()
1243 first_dir = self._get_file_by_index(0)
1244- first_dir.open_directory()
1245+ self._open_directory(first_dir)
1246
1247 toolbar = self.main_view.open_toolbar()
1248 toolbar.click_button('up')
1249@@ -519,9 +546,14 @@
1250 # objectName on the ListElement. This is reported at
1251 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1205201
1252 # --elopio - 2013-07-25
1253- self.main_view.open_toolbar()
1254- self.main_view.get_toolbar().click_button('places')
1255- place = self._get_place(text)
1256+ place = None
1257+ if self.main_view.wideAspect:
1258+ place = (self.main_view.get_folder_list_page().get_sidebar()
1259+ .get_place(text))
1260+ else:
1261+ self.main_view.open_toolbar()
1262+ self.main_view.get_toolbar().click_button('places')
1263+ place = self._get_place(text)
1264 self.pointing_device.click_object(place)
1265
1266 def _get_place(self, text):
1267
1268=== modified file 'ubuntu-filemanager-app.qml'
1269--- ubuntu-filemanager-app.qml 2013-08-09 18:43:12 +0000
1270+++ ubuntu-filemanager-app.qml 2013-08-09 18:43:12 +0000
1271@@ -32,7 +32,7 @@
1272 objectName: "filemanager"
1273 applicationName: "ubuntu-filemanager-app"
1274
1275- width: units.gu(50)
1276+ width: units.gu(100)
1277 height: units.gu(75)
1278
1279 property alias filemanager: root
1280@@ -47,6 +47,10 @@
1281 // Individual settings, used for bindings
1282 property bool showAdvancedFeatures: false
1283
1284+ headerColor: "#303030"
1285+ backgroundColor: "#505050"
1286+ footerColor: "#707070"
1287+
1288 FolderListPage {
1289 id: folderPage
1290 objectName: "folderPage"

Subscribers

People subscribed via source and target branches