Merge lp:~ibelieve/ubuntu-filemanager-app/improved-ui into lp:ubuntu-filemanager-app

Proposed by Michael Spencer
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 43
Merged at revision: 37
Proposed branch: lp:~ibelieve/ubuntu-filemanager-app/improved-ui
Merge into: lp:ubuntu-filemanager-app
Diff against target: 332 lines (+92/-56)
9 files modified
FileDetailsPopover.qml (+15/-3)
FolderListDelegate.qml (+2/-2)
FolderListPage.qml (+34/-21)
FolderListView.qml (+13/-4)
filemanager.qmlproject (+1/-1)
tests/autopilot/ubuntu_filemanager_app/emulators/main_window.py (+4/-5)
tests/autopilot/ubuntu_filemanager_app/emulators/ubuntusdk.py (+4/-6)
tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py (+2/-0)
ubuntu-filemanager-app.qml (+17/-14)
To merge this branch: bzr merge lp:~ibelieve/ubuntu-filemanager-app/improved-ui
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Arto Jalkanen Approve
Review via email: mp+171569@code.launchpad.net

Commit message

Improved UI

Description of the change

This improves the UI in several ways, including:

* Converts the icons to using the Humanity theme & uses correct size
* Fixes the margins in the file details popover
* Adds a better page title and location header
* Uses ubuntu-mobile icons for the toolbar

This also replaces usage of ToolbarActions with ToolbarItems.

To post a comment you must log in.
Revision history for this message
Arto Jalkanen (ajalkane) wrote :

Thank you for the excellent changes!

review: Approve
Revision history for this message
Arto Jalkanen (ajalkane) wrote :

As a side note to your previous merge request, by your tests it seems that the memory consumption is not a big issue. So if you see some advantage in using page stack for navigation I'm not opposed to approving such a merge.

Revision history for this message
Michael Spencer (ibelieve) wrote :

I sent a message to the ubuntu-phone mailing asking for input about what would be the best navigation model to represent a hierarchy of data such as the file system. For now though, I decided to take out the page stack because I have some ideas for a flat tab-based layout, such as being able to open multiple tabs (useful , etc. Depending on what designers say, I might submit a merge request for a page stack-based layout.

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

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-04-17 17:55:41 +0000
3+++ FileDetailsPopover.qml 2013-06-27 14:24:25 +0000
4@@ -23,6 +23,8 @@
5 id: root
6 property var model
7
8+ contentHeight: contents.height + 2 * contents.anchors.margins
9+
10 function dateTimeFormat(dateTime) {
11 return Qt.formatDateTime(dateTime, Qt.DefaultLocaleShortDate)
12 }
13@@ -52,19 +54,29 @@
14 }
15
16 Column {
17- anchors.margins: units.gu(2)
18+ id: contents
19+ spacing: units.gu(1)
20+ anchors {
21+ margins: units.gu(2)
22+ left: parent.left
23+ right: parent.right
24+ top: parent.top
25+ }
26+
27 Row {
28+ spacing: units.gu(1)
29 Image {
30 // TODO: how to get proper icon?
31 source: model.isDir
32- ? "/usr/share/icons/gnome/48x48/apps/file-manager.png"
33- : "/usr/share/icons/gnome/48x48/mimetypes/text-x-preview.png"
34+ ? "/usr/share/icons/Humanity/places/48/folder.svg"
35+ : "/usr/share/icons/Humanity/mimes/48/empty.svg"
36 }
37 Label {
38 text: model.fileName
39 anchors.verticalCenter: parent.verticalCenter
40 }
41 }
42+
43 Grid {
44 columns: 2
45 spacing: units.gu(1)
46
47=== modified file 'FolderListDelegate.qml'
48--- FolderListDelegate.qml 2013-05-31 12:23:54 +0000
49+++ FolderListDelegate.qml 2013-06-27 14:24:25 +0000
50@@ -23,12 +23,12 @@
51 ListItem.Subtitled {
52 objectName: "folder" + index
53 text: model.fileName
54- subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? " " + fileSize : "")
55+ subText: Qt.formatDateTime(model.modifiedDate, Qt.DefaultLocaleShortDate) + (!model.isDir ? ", " + fileSize : "")
56 // FIXME: hard coded path for icon, assumes Ubuntu desktop icon available.
57 // Nemo mobile has icon provider. Have to figure out what's the proper way
58 // to get "system wide" icons in Ubuntu Touch, or if we have to use
59 // icons packaged into the application. Both folder and individual
60 // files will need an icon.
61- icon: model.isDir ? "/usr/share/icons/gnome/22x22/apps/file-manager.png" : ""
62+ icon: model.isDir ? "/usr/share/icons/Humanity/places/48/folder.svg" : "/usr/share/icons/Humanity/mimes/48/empty.svg"
63 progression: model.isDir
64 }
65
66=== modified file 'FolderListPage.qml'
67--- FolderListPage.qml 2013-06-14 05:20:24 +0000
68+++ FolderListPage.qml 2013-06-27 14:24:25 +0000
69@@ -24,9 +24,25 @@
70 id: root
71 anchors.fill: parent
72
73+ property string folder
74+ title: folderName(pageModel.path)
75+ property string homeFolder: pageModel.homePath()
76+
77+ function folderName(folder) {
78+ if (folder === pageModel.homePath()) {
79+ return "Home"
80+ } else if (folder === "/") {
81+ return folder
82+ } else {
83+ return folder.substr(folder.lastIndexOf('/') + 1)
84+ }
85+ }
86+
87+ property bool loading: pageModel.awaitingResults
88+
89 FolderListModel {
90 id: pageModel
91- path: homePath()
92+ path: root.folder
93 }
94
95 Component {
96@@ -46,22 +62,21 @@
97 }
98 }
99
100- tools: ToolbarActions {
101+ tools: ToolbarItems {
102 id: toolbar
103- lock: true
104- active: true
105+ locked: true
106+ opened: true
107
108- back: Action {
109- text: i18n.tr("Up")
110- // TODO: temporary
111- iconSource: "/usr/share/icons/Humanity/actions/48/up.svg"
112+ back: ToolbarButton {
113+ text: "Up"
114+ iconSource: "/usr/share/icons/ubuntu-mobile/actions/scalable/keyboard-caps.svg"
115+ visible: folder != "/"
116 onTriggered: {
117- pageModel.path = pageModel.parentPath
118- console.log("Up triggered")
119+ goTo(pageModel.parentPath)
120 }
121- visible: pageModel.path != "/"
122 }
123- Action {
124+
125+ ToolbarButton {
126 text: i18n.tr("Paste" + " (" + pageModel.clipboardUrlsCounter + ")")
127 // TODO: temporary
128 iconSource: "/usr/share/icons/Humanity/actions/48/edit-paste.svg"
129@@ -83,22 +98,24 @@
130
131 // IMPROVE: would rather have this as more hidden, in a separate menu that has
132 // file manipulation operations
133- Action {
134+ ToolbarButton {
135 text: i18n.tr("Create folder")
136 // TODO: temporary
137- iconSource: "/usr/share/icons/Humanity/actions/48/folder-new.svg"
138+ iconSource: "/usr/share/icons/ubuntu-mobile/actions/scalable/add.svg"
139 onTriggered: {
140 print(text)
141 PopupUtils.open(createFolderDialog, root)
142 }
143 }
144
145- Action {
146+ ToolbarButton {
147 text: i18n.tr("Home")
148 // TODO: temporary
149- iconSource: "/usr/share/icons/Humanity/actions/48/go-home.svg"
150+ iconSource: "/usr/share/icons/ubuntu-mobile/actions/scalable/go-to.svg"
151 onTriggered: {
152- pageModel.path = pageModel.homePath()
153+ goHome()
154+
155+ //pageModel.path = pageModel.homePath()
156 console.log("Home triggered")
157 }
158 }
159@@ -120,10 +137,6 @@
160
161 FolderListView {
162 id: folderListView
163- header: Label {
164- text: pageModel.path
165- fontSize: "large"
166- }
167
168 clip: true
169
170
171=== modified file 'FolderListView.qml'
172--- FolderListView.qml 2013-05-16 19:45:36 +0000
173+++ FolderListView.qml 2013-06-27 14:24:25 +0000
174@@ -17,6 +17,7 @@
175 */
176 import QtQuick 2.0
177 import Ubuntu.Components 0.1
178+import Ubuntu.Components.ListItems 0.1
179 import Ubuntu.Components.Popups 0.1
180 import org.nemomobile.folderlistmodel 1.0
181
182@@ -24,16 +25,22 @@
183 id: root
184
185 property FolderListModel folderListModel
186- property string path: folderListModel.path
187+ property string folderPath: folderListModel.path
188 model: folderListModel
189
190+ header: Caption {
191+ objectName: "directoryHeader"
192+ text: (root.count == 1 ? i18n.tr("%1 (%2 file)").arg(root.folderPath).arg(root.count) :
193+ i18n.tr("%1 (%2 files)").arg(root.folderPath).arg(root.count))
194+ }
195+
196 Component {
197 id: confirmSingleDeleteDialog
198 ConfirmDialog {
199 property string filePath
200 property string fileName
201- title: i18n.tr("Delete?")
202- text: i18n.tr("Are you sure you want to permanently delete") + " '" + fileName + "'?"
203+ title: i18n.tr("Delete")
204+ text: i18n.tr("Are you sure you want to permanently delete '%1'?").arg(fileName)
205
206 onAccepted: {
207 console.log("Delete accepted for filePath, fileName", filePath, fileName)
208@@ -88,6 +95,8 @@
209
210 ActionSelectionPopover {
211 id: actionSelectionPopover
212+ objectName: "fileActionsPopover"
213+
214 property var model
215 actions: ActionList {
216 Action {
217@@ -166,7 +175,7 @@
218 if (model.isDir) {
219 if (model.isReadable && model.isExecutable) {
220 console.log("Changing to dir", model.filePath)
221- folderListModel.path = model.filePath
222+ goTo(model.filePath)
223 } else {
224 PopupUtils.open(Qt.resolvedUrl("NotifyDialog.qml"), delegate,
225 {
226
227=== modified file 'filemanager.qmlproject'
228--- filemanager.qmlproject 2013-02-12 16:28:09 +0000
229+++ filemanager.qmlproject 2013-06-27 14:24:25 +0000
230@@ -3,7 +3,7 @@
231 import QmlProject 1.1
232
233 Project {
234- mainFile: "filemanager.qml"
235+ mainFile: "ubuntu-filemanager-app.qml"
236
237 /* Include .qml, .js, and image files from current directory and subdirectories */
238 QmlFiles {
239
240=== modified file 'tests/autopilot/ubuntu_filemanager_app/emulators/main_window.py'
241--- tests/autopilot/ubuntu_filemanager_app/emulators/main_window.py 2013-06-14 05:49:28 +0000
242+++ tests/autopilot/ubuntu_filemanager_app/emulators/main_window.py 2013-06-27 14:24:25 +0000
243@@ -21,10 +21,9 @@
244 return self.app.select_many("Subtitled")[index]
245
246 def get_action_popover(self):
247- return self.app.select_single("ActionSelectionPopover")
248+ # Returns all instances, but with current one as first index
249+ return self.app.select_many("ActionSelectionPopover")[0]
250
251 def get_current_folder_name(self):
252- # XXX the label with the folder name doesn't have an objectName.
253- # See bug #1190855.
254- return self.app.select_single('FolderListView').select_many(
255- 'Label')[0].text
256+ return self.app.select_single('FolderListView').folderPath
257+
258
259=== modified file 'tests/autopilot/ubuntu_filemanager_app/emulators/ubuntusdk.py'
260--- tests/autopilot/ubuntu_filemanager_app/emulators/ubuntusdk.py 2013-06-14 05:20:24 +0000
261+++ tests/autopilot/ubuntu_filemanager_app/emulators/ubuntusdk.py 2013-06-27 14:24:25 +0000
262@@ -69,12 +69,10 @@
263 if not toolbar.opened:
264 self.open_toolbar()
265 row = toolbar.select_single("QQuickRow")
266- loaderList = row.select_many("QQuickLoader")
267- for loader in loaderList:
268- buttonList = loader.select_many("Button")
269- for button in buttonList:
270- if button.text == buttonLabel:
271- return button
272+ buttonList = row.select_many("ActionItem")
273+ for button in buttonList:
274+ if button.text == buttonLabel:
275+ return button
276
277 def click_toolbar_button(self, buttonLabel):
278 """Clicks the toolbar button with buttonLabel"""
279
280=== modified file 'tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py'
281--- tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-06-14 05:51:37 +0000
282+++ tests/autopilot/ubuntu_filemanager_app/tests/test_filemanager.py 2013-06-27 14:24:25 +0000
283@@ -52,6 +52,8 @@
284 # created one. See bug #1190676.
285 # TODO when the bug is fixed, remove the next line.
286 self.ubuntusdk.click_toolbar_button('Home')
287+ while self.app.select_single('FolderListPage').loading:
288+ pass
289 return path
290
291 def test_open_directory(self):
292
293=== modified file 'ubuntu-filemanager-app.qml'
294--- ubuntu-filemanager-app.qml 2013-05-16 19:45:36 +0000
295+++ ubuntu-filemanager-app.qml 2013-06-27 14:24:25 +0000
296@@ -33,19 +33,22 @@
297 width: units.gu(50)
298 height: units.gu(75)
299
300- Tabs {
301- id: tabs
302- anchors.fill: parent
303-
304- // First tab begins here
305- Tab {
306- objectName: "folderListPage"
307-
308- title: i18n.tr("File Manager")
309-
310- // Tab content begins here
311- page: FolderListPage {
312- }
313- }
314+ FolderListPage {
315+ objectName: "folderPage"
316+ id: folderPage
317+
318+ folder: homeFolder
319+
320+ function goHome() {
321+ // FIXME: Get the user's home folder without requiring an instance
322+ // of a FolderListModel
323+ goTo(homeFolder)
324+ }
325+
326+ function goTo(location) {
327+ // FIXME: Why is this needed? Folder doesn't seem to refresh without it
328+ folder = ""
329+ folder = location
330+ }
331 }
332 }

Subscribers

People subscribed via source and target branches