Skip to content

Commit 39503be

Browse files
committed
Addd a placeholder delete dialog
1 parent 6697650 commit 39503be

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

po/io.papyros.files.pot

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: \n"
1010
"Report-Msgid-Bugs-To: [email protected]\n"
11-
"POT-Creation-Date: 2015-02-24 22:27-0600\n"
11+
"POT-Creation-Date: 2015-03-01 13:15-0600\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -18,7 +18,7 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919

2020
#: ../build/po/io.papyros.files.desktop.in.in.h:1
21-
#: ../build/src/app/qml/main.qml:25 ../src/app/qml/main.qml:25
21+
#: ../build/src/app/qml/main.qml:26 ../src/app/qml/main.qml:26
2222
#: io.papyros.files.desktop.in.in.h:1
2323
msgid "Files"
2424
msgstr ""
@@ -42,23 +42,23 @@ msgstr ""
4242
msgid "No files"
4343
msgstr ""
4444

45-
#: ../build/src/app/qml/components/InfoSidebar.qml:110
46-
#: ../src/app/qml/components/InfoSidebar.qml:110
45+
#: ../build/src/app/qml/components/InfoSidebar.qml:114
46+
#: ../src/app/qml/components/InfoSidebar.qml:114
4747
msgid "Location"
4848
msgstr ""
4949

50-
#: ../build/src/app/qml/components/InfoSidebar.qml:121
51-
#: ../src/app/qml/components/InfoSidebar.qml:121
50+
#: ../build/src/app/qml/components/InfoSidebar.qml:125
51+
#: ../src/app/qml/components/InfoSidebar.qml:125
5252
msgid "Type"
5353
msgstr ""
5454

55-
#: ../build/src/app/qml/components/InfoSidebar.qml:142
56-
#: ../src/app/qml/components/InfoSidebar.qml:142
55+
#: ../build/src/app/qml/components/InfoSidebar.qml:146
56+
#: ../src/app/qml/components/InfoSidebar.qml:146
5757
msgid "Contents"
5858
msgstr ""
5959

60-
#: ../build/src/app/qml/components/InfoSidebar.qml:142
61-
#: ../src/app/qml/components/InfoSidebar.qml:142
60+
#: ../build/src/app/qml/components/InfoSidebar.qml:146
61+
#: ../src/app/qml/components/InfoSidebar.qml:146
6262
msgid "Size"
6363
msgstr ""
6464

src/app/qml/components/InfoSidebar.qml

+4
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ PageSidebar {
6868

6969
Action {
7070
iconName: "action/delete"
71+
onTriggered: confirmAction("", "Are you sure you want to delete \"%1\"?"
72+
.arg(selectedFile.fileName), "Delete").done(function() {
73+
print("Deleting file!")
74+
})
7175
}
7276
]
7377

src/app/qml/main.qml

+22
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818
import QtQuick 2.2
1919
import Material 0.1
20+
import Material.Extras 0.1
2021
import Material.ListItems 0.1 as ListItem
2122

2223
ApplicationWindow {
@@ -28,9 +29,30 @@ ApplicationWindow {
2829
primaryColor: Palette.colors.blue["500"]
2930
}
3031

32+
function confirmAction(title, text, primaryButton, color) {
33+
confirmDialog.promise = new Promises.Promise()
34+
35+
confirmDialog.title = title
36+
confirmDialog.text = text
37+
confirmDialog.positiveButtonText = primaryButton
38+
39+
confirmDialog.show()
40+
41+
return confirmDialog.promise
42+
}
43+
3144
Component.onCompleted: visible = true
3245

3346
initialPage: FolderPage {
3447
id: folderPage
3548
}
49+
50+
Dialog {
51+
id: confirmDialog
52+
53+
property var promise
54+
55+
onAccepted: promise.resolve()
56+
onRejected: promise.reject()
57+
}
3658
}

0 commit comments

Comments
 (0)