Merge lp:~ajalkane/ubuntu-filemanager-app/filedetails into lp:ubuntu-filemanager-app

Proposed by Arto Jalkanen
Status: Merged
Approved by: Arto Jalkanen
Approved revision: 12
Merged at revision: 11
Proposed branch: lp:~ajalkane/ubuntu-filemanager-app/filedetails
Merge into: lp:ubuntu-filemanager-app
Diff against target: 122 lines (+78/-7)
2 files modified
FileDetailsPopover.qml (+73/-3)
FolderListView.qml (+5/-4)
To merge this branch: bzr merge lp:~ajalkane/ubuntu-filemanager-app/filedetails
Reviewer Review Type Date Requested Status
Arto Jalkanen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+153246@code.launchpad.net

Commit message

Initial file details popover

Description of the change

Initial file details popover

To post a comment you must log in.
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
Arto Jalkanen (ajalkane) wrote :

It's raw, but better to get in than be left out.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'FileDetailsPopover.qml'
--- FileDetailsPopover.qml 2013-03-05 20:48:28 +0000
+++ FileDetailsPopover.qml 2013-03-13 21:23:19 +0000
@@ -4,11 +4,81 @@
44
5Popover {5Popover {
6 id: root6 id: root
7 property string filePath7 property var model
8
9 function dateTimeFormat(dateTime) {
10 return Qt.formatDateTime(dateTime, Qt.DefaultLocaleShortDate)
11 }
12
13 function permissionsToString(model) {
14 var permissions = []
15 if (model.isReadable) {
16 permissions.push(i18n.tr("Readable"))
17 }
18 if (model.isWritable) {
19 permissions.push(i18n.tr("Writable"))
20 }
21 if (model.isExecutable) {
22 permissions.push(i18n.tr("Executable"))
23 }
24
25 // Now why does this not work?
26 // return permissions.join(", ")
27 var permStr = ""
28 for (var i = 0; i < permissions.length; ++i) {
29 if (permStr.length > 0) {
30 permStr += ", "
31 }
32 permStr += permissions[i]
33 }
34 return permStr
35 }
836
9 Column {37 Column {
10 Label {38 anchors.margins: units.gu(2)
11 text: "\n\nTODO file details for " + filePath + "\n\n"39 Row {
40 Image {
41 // TODO: how to get proper icon?
42 source: model.isDir
43 ? "/usr/share/icons/gnome/48x48/apps/file-manager.png"
44 : "/usr/share/icons/gnome/48x48/mimetypes/text-x-preview.png"
45 }
46 Label {
47 text: model.fileName
48 anchors.verticalCenter: parent.verticalCenter
49 }
50 }
51 Grid {
52 columns: 2
53 spacing: units.gu(1)
54 Label {
55 text: i18n.tr("Size:")
56 }
57 Label {
58 text: model.fileSize
59 }
60
61 Label {
62 text: i18n.tr("Created:")
63 }
64 Label {
65 text: dateTimeFormat(model.creationDate)
66 }
67
68 Label {
69 text: i18n.tr("Modified:")
70 }
71 Label {
72 text: dateTimeFormat(model.modifiedDate)
73 }
74
75 Label {
76 text: i18n.tr("Permissions:")
77 }
78 Label {
79 text: permissionsToString(model)
80 }
81
12 }82 }
13 }83 }
14}84}
1585
=== modified file 'FolderListView.qml'
--- FolderListView.qml 2013-03-12 20:10:44 +0000
+++ FolderListView.qml 2013-03-13 21:23:19 +0000
@@ -12,8 +12,7 @@
1212
13 ActionSelectionPopover {13 ActionSelectionPopover {
14 id: actionSelectionPopover14 id: actionSelectionPopover
15 property string filePath15 property var model
16
17 actions: ActionList {16 actions: ActionList {
18 Action {17 Action {
19 text: i18n.tr("Add as bookmark")18 text: i18n.tr("Add as bookmark")
@@ -26,7 +25,9 @@
26 print(text)25 print(text)
27 PopupUtils.open(Qt.resolvedUrl("FileDetailsPopover.qml"),26 PopupUtils.open(Qt.resolvedUrl("FileDetailsPopover.qml"),
28 actionSelectionPopover.caller,27 actionSelectionPopover.caller,
29 { "filePath": actionSelectionPopover.filePath } )28 { "model": actionSelectionPopover.model
29 }
30 )
30 }31 }
31 }32 }
32 }33 }
@@ -79,7 +80,7 @@
79 onPressAndHold: {80 onPressAndHold: {
80 console.log("FolderListDelegate onPressAndHold")81 console.log("FolderListDelegate onPressAndHold")
81 actionSelectionPopover.caller = delegate82 actionSelectionPopover.caller = delegate
82 actionSelectionPopover.filePath = filePath83 actionSelectionPopover.model = model
83 actionSelectionPopover.show();84 actionSelectionPopover.show();
84 }85 }
85 }86 }

Subscribers

People subscribed via source and target branches