| 1 |
import QtQuick 2.4 |
| 2 |
import Lomiri.Components 1.3 |
| 3 |
import Lomiri.Components.Popups 1.3 |
| 4 |
|
| 5 |
Dialog { |
| 6 |
id: dialog |
| 7 |
modal: true |
| 8 |
title: i18n.tr("Open file") |
| 9 |
text: i18n.tr("What do you want to do with the clicked file?") |
| 10 |
property var model |
| 11 |
|
| 12 |
property bool previewButtonVisible: false |
| 13 |
property bool extractButtonVisible: false |
| 14 |
|
| 15 |
signal showPreview() |
| 16 |
signal extractArchive() |
| 17 |
signal openWith() |
| 18 |
signal showProperties() |
| 19 |
|
| 20 |
Button { |
| 21 |
id: previewButton |
| 22 |
text: i18n.tr("Preview") |
| 23 |
color: theme.palette.normal.positive |
| 24 |
visible: previewButtonVisible |
| 25 |
onClicked: { |
| 26 |
PopupUtils.close(dialog) |
| 27 |
showPreview() |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
Button { |
| 32 |
id: extractButton |
| 33 |
text: i18n.tr("Extract archive") |
| 34 |
visible: extractButtonVisible |
| 35 |
color: theme.palette.normal.positive |
| 36 |
onClicked: { |
| 37 |
PopupUtils.close(dialog) |
| 38 |
extractArchive() |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
Button { |
| 43 |
id: openExternallyButton |
| 44 |
text: i18n.tr("Open with another app") |
| 45 |
color: !extractButtonVisible && !previewButtonVisible |
| 46 |
? theme.palette.normal.positive |
| 47 |
: theme.name == "Lomiri.Components.Themes.Ambiance" |
| 48 |
? LomiriColors.graphite |
| 49 |
: LomiriColors.ash |
| 50 |
onClicked: { |
| 51 |
PopupUtils.close(dialog) |
| 52 |
openWith() |
| 53 |
} |
| 54 |
} |
| 55 |
|
| 56 |
Button { |
| 57 |
id: propertiesButton |
| 58 |
text: i18n.tr("Properties") |
| 59 |
onClicked: { |
| 60 |
PopupUtils.close(dialog) |
| 61 |
showProperties() |
| 62 |
} |
| 63 |
} |
| 64 |
|
| 65 |
Button { |
| 66 |
id: cancelButton |
| 67 |
text: i18n.tr("Cancel") |
| 68 |
onClicked: { |
| 69 |
PopupUtils.close(dialog) |
| 70 |
} |
| 71 |
} |
| 72 |
} |