Changeset View
Changeset View
Standalone View
Standalone View
src/qml/NativeApplicationMenu.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2016-2018 Matthieu Gallien <matthieu_gallien@yahoo.fr> | ||||
3 | * Copyright 2018 Alexander Stippich <a.stippich@gmx.net> | ||||
4 | * | ||||
5 | * This program is free software: you can redistribute it and/or | ||||
6 | * modify it under the terms of the GNU Lesser General Public | ||||
7 | * License as published by the Free Software Foundation; either | ||||
8 | * version 3 of the License, or (at your option) any later version. | ||||
9 | * | ||||
10 | * This program is distributed in the hope that it will be useful, | ||||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
13 | * Lesser General Public License for more details. | ||||
14 | * | ||||
15 | * You should have received a copy of the GNU Lesser General Public License | ||||
16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||||
17 | */ | ||||
18 | | ||||
19 | import QtQuick 2.7 | ||||
20 | //explore menu from Qt 5.10 once we can require it, but it is item-based | ||||
21 | import Qt.labs.platform 1.0 | ||||
22 | import org.kde.elisa 1.0 | ||||
23 | | ||||
24 | Menu { | ||||
25 | id: applicationMenu | ||||
26 | title: i18nc("open application menu", "Application Menu") | ||||
27 | | ||||
28 | property var helpAction: elisa.action("help_contents") | ||||
29 | property var quitApplication: elisa.action("file_quit") | ||||
30 | property var reportBugAction: elisa.action("help_report_bug") | ||||
31 | property var aboutAppAction: elisa.action("help_about_app") | ||||
32 | property var configureShortcutsAction: elisa.action("options_configure_keybinding") | ||||
33 | property var configureAction: elisa.action("options_configure") | ||||
34 | property var togglePlaylistAction: elisa.action("toggle_playlist") | ||||
35 | | ||||
36 | MenuItem { | ||||
37 | text: i18nc("Refresh Music Collection application menu entry", "Refresh Music Collection") | ||||
38 | iconName: "collection-rescan-amarok" | ||||
39 | onTriggered: elisa.musicManager.resetMusicData() | ||||
40 | } | ||||
41 | | ||||
42 | MenuSeparator { | ||||
43 | } | ||||
44 | | ||||
45 | MenuItem { | ||||
46 | text: configureAction.text | ||||
47 | shortcut: configureAction.shortcut | ||||
48 | iconName: elisa.iconName(configureAction.icon) | ||||
49 | onTriggered: configureAction.trigger() | ||||
50 | visible: configureAction.text !== "" | ||||
51 | } | ||||
52 | | ||||
53 | MenuItem { | ||||
54 | text: configureShortcutsAction.text | ||||
55 | shortcut: configureShortcutsAction.shortcut | ||||
56 | iconName: elisa.iconName(configureShortcutsAction.icon) | ||||
57 | onTriggered: configureShortcutsAction.trigger() | ||||
58 | visible: configureShortcutsAction.text !== "" | ||||
59 | } | ||||
60 | | ||||
61 | MenuItem { | ||||
62 | shortcut: togglePlaylistAction.shortcut | ||||
63 | text: contentView.showPlaylist ? i18nc("Hide playlist", "Hide Playlist") : i18nc("Show playlist", "Show Playlist") | ||||
64 | iconName: "view-media-playlist" | ||||
65 | onTriggered: contentView.showPlaylist = !contentView.showPlaylist | ||||
66 | enabled: contentView.currentViewIndex != 0 | ||||
67 | } | ||||
68 | | ||||
69 | MenuSeparator { | ||||
70 | visible: reportBugAction.text !== "" | ||||
71 | } | ||||
72 | | ||||
73 | MenuItem { | ||||
74 | text: reportBugAction.text | ||||
75 | shortcut: reportBugAction.shortcut | ||||
76 | iconName: elisa.iconName(reportBugAction.icon) | ||||
77 | onTriggered: reportBugAction.trigger() | ||||
78 | visible: reportBugAction.text !== "" | ||||
79 | } | ||||
80 | | ||||
81 | MenuSeparator { | ||||
82 | visible: helpAction.text !== "" | ||||
83 | } | ||||
84 | | ||||
85 | MenuItem { | ||||
86 | text: helpAction.text | ||||
87 | shortcut: helpAction.shortcut | ||||
88 | iconName: elisa.iconName(helpAction.icon) | ||||
89 | onTriggered: helpAction.trigger() | ||||
90 | visible: helpAction.text !== "" | ||||
91 | } | ||||
92 | | ||||
93 | MenuItem { | ||||
94 | text: aboutAppAction.text | ||||
95 | shortcut: aboutAppAction.shortcut | ||||
96 | iconName: elisa.iconName(aboutAppAction.icon) | ||||
97 | onTriggered: aboutAppAction.trigger() | ||||
98 | visible: aboutAppAction.text !== "" | ||||
99 | } | ||||
100 | | ||||
101 | MenuSeparator { | ||||
102 | visible: quitApplication.text !== "" | ||||
103 | } | ||||
104 | | ||||
105 | MenuItem { | ||||
106 | text: quitApplication.text | ||||
107 | shortcut: quitApplication.shortcut | ||||
108 | iconName: elisa.iconName(quitApplication.icon) | ||||
109 | onTriggered: quitApplication.trigger() | ||||
110 | visible: quitApplication.text !== "" | ||||
111 | } | ||||
112 | } |