Changeset View
Changeset View
Standalone View
Standalone View
src/qml/ApplicationMenu.qml
Show All 11 Lines | |||||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | * Lesser General Public License for more details. | 13 | * Lesser General Public License for more details. | ||
14 | * | 14 | * | ||
15 | * You should have received a copy of the GNU Lesser General Public License | 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/>. | 16 | * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.7 | 19 | import QtQuick 2.7 | ||
20 | //explore menu from Qt 5.10 once we can require it, but it is item-based | 20 | import QtQuick.Controls 2.3 | ||
21 | import QtQuick.Controls 1.4 | | |||
22 | import org.kde.elisa 1.0 | 21 | import org.kde.elisa 1.0 | ||
23 | 22 | | |||
24 | Menu { | 23 | Menu { | ||
25 | id: applicationMenu | 24 | id: applicationMenu | ||
26 | title: i18nc("open application menu", "Application Menu") | 25 | title: i18nc("open application menu", "Application Menu") | ||
27 | 26 | | |||
28 | property var helpAction: elisa.action("help_contents") | 27 | property var helpAction: elisa.action("help_contents") | ||
29 | property var quitApplication: elisa.action("file_quit") | 28 | property var quitApplication: elisa.action("file_quit") | ||
30 | property var reportBugAction: elisa.action("help_report_bug") | 29 | property var reportBugAction: elisa.action("help_report_bug") | ||
31 | property var aboutAppAction: elisa.action("help_about_app") | 30 | property var aboutAppAction: elisa.action("help_about_app") | ||
32 | property var configureShortcutsAction: elisa.action("options_configure_keybinding") | 31 | property var configureShortcutsAction: elisa.action("options_configure_keybinding") | ||
33 | property var configureAction: elisa.action("options_configure") | 32 | property var configureAction: elisa.action("options_configure") | ||
34 | property var togglePlaylistAction: elisa.action("toggle_playlist") | 33 | property var togglePlaylistAction: elisa.action("toggle_playlist") | ||
35 | 34 | | |||
36 | MenuItem { | 35 | Action { | ||
37 | text: i18nc("Refresh Music Collection application menu entry", "Refresh Music Collection") | 36 | text: i18nc("Refresh Music Collection application menu entry", "Refresh Music Collection") | ||
38 | iconName: "collection-rescan-amarok" | 37 | icon.name: "collection-rescan-amarok" | ||
39 | onTriggered: elisa.musicManager.resetMusicData() | 38 | onTriggered: elisa.musicManager.resetMusicData() | ||
40 | } | 39 | } | ||
41 | 40 | | |||
42 | MenuSeparator { | 41 | MenuSeparator { | ||
43 | } | 42 | } | ||
44 | 43 | | |||
45 | MenuItem { | 44 | Action { | ||
46 | text: configureAction.text | 45 | text: configureAction.text | ||
47 | shortcut: configureAction.shortcut | 46 | shortcut: configureAction.shortcut | ||
48 | iconName: elisa.iconName(configureAction.icon) | 47 | icon.name: elisa.iconName(configureAction.icon) | ||
49 | onTriggered: configureAction.trigger() | 48 | onTriggered: configureAction.trigger() | ||
50 | visible: configureAction.text !== "" | | |||
51 | } | 49 | } | ||
52 | 50 | | |||
53 | MenuItem { | 51 | Action { | ||
54 | text: configureShortcutsAction.text | 52 | text: configureShortcutsAction.text | ||
55 | shortcut: configureShortcutsAction.shortcut | 53 | shortcut: configureShortcutsAction.shortcut | ||
56 | iconName: elisa.iconName(configureShortcutsAction.icon) | 54 | icon.name: elisa.iconName(configureShortcutsAction.icon) | ||
57 | onTriggered: configureShortcutsAction.trigger() | 55 | onTriggered: configureShortcutsAction.trigger() | ||
58 | visible: configureShortcutsAction.text !== "" | | |||
59 | } | 56 | } | ||
60 | 57 | | |||
61 | MenuItem { | 58 | Action { | ||
62 | shortcut: togglePlaylistAction.shortcut | 59 | shortcut: togglePlaylistAction.shortcut | ||
63 | text: contentView.showPlaylist ? i18nc("Hide playlist", "Hide Playlist") : i18nc("Show playlist", "Show Playlist") | 60 | text: contentView.showPlaylist ? i18nc("Hide playlist", "Hide Playlist") : i18nc("Show playlist", "Show Playlist") | ||
64 | iconName: "view-media-playlist" | 61 | icon.name: "view-media-playlist" | ||
65 | onTriggered: contentView.showPlaylist = !contentView.showPlaylist | 62 | onTriggered: contentView.showPlaylist = !contentView.showPlaylist | ||
66 | enabled: contentView.currentViewIndex != 0 | 63 | enabled: contentView.currentViewIndex != 0 | ||
67 | } | 64 | } | ||
68 | 65 | | |||
69 | MenuSeparator { | 66 | MenuSeparator { | ||
70 | visible: reportBugAction.text !== "" | 67 | visible: reportBugAction.text !== "" | ||
71 | } | 68 | } | ||
72 | 69 | | |||
73 | MenuItem { | 70 | Action { | ||
74 | text: reportBugAction.text | 71 | text: reportBugAction.text | ||
75 | shortcut: reportBugAction.shortcut | 72 | shortcut: reportBugAction.shortcut | ||
76 | iconName: elisa.iconName(reportBugAction.icon) | 73 | icon.name: elisa.iconName(reportBugAction.icon) | ||
77 | onTriggered: reportBugAction.trigger() | 74 | onTriggered: reportBugAction.trigger() | ||
78 | visible: reportBugAction.text !== "" | | |||
79 | } | 75 | } | ||
80 | 76 | | |||
81 | MenuSeparator { | 77 | MenuSeparator { | ||
82 | visible: helpAction.text !== "" | 78 | visible: helpAction.text !== "" | ||
83 | } | 79 | } | ||
84 | 80 | | |||
85 | MenuItem { | 81 | Action { | ||
86 | text: helpAction.text | 82 | text: helpAction.text | ||
87 | shortcut: helpAction.shortcut | 83 | shortcut: helpAction.shortcut | ||
88 | iconName: elisa.iconName(helpAction.icon) | 84 | icon.name: elisa.iconName(helpAction.icon) | ||
89 | onTriggered: helpAction.trigger() | 85 | onTriggered: helpAction.trigger() | ||
90 | visible: helpAction.text !== "" | | |||
91 | } | 86 | } | ||
92 | 87 | | |||
93 | MenuItem { | 88 | Action { | ||
94 | text: aboutAppAction.text | 89 | text: aboutAppAction.text | ||
95 | shortcut: aboutAppAction.shortcut | 90 | shortcut: aboutAppAction.shortcut | ||
96 | iconName: elisa.iconName(aboutAppAction.icon) | 91 | icon.name: elisa.iconName(aboutAppAction.icon) | ||
97 | onTriggered: aboutAppAction.trigger() | 92 | onTriggered: aboutAppAction.trigger() | ||
98 | visible: aboutAppAction.text !== "" | | |||
99 | } | 93 | } | ||
100 | 94 | | |||
101 | MenuSeparator { | 95 | MenuSeparator { | ||
102 | visible: quitApplication.text !== "" | 96 | visible: quitApplication.text !== "" | ||
103 | } | 97 | } | ||
104 | 98 | | |||
105 | MenuItem { | 99 | Action { | ||
106 | text: quitApplication.text | 100 | text: quitApplication.text | ||
107 | shortcut: quitApplication.shortcut | 101 | shortcut: quitApplication.shortcut | ||
108 | iconName: elisa.iconName(quitApplication.icon) | 102 | icon.name: elisa.iconName(quitApplication.icon) | ||
109 | onTriggered: quitApplication.trigger() | 103 | onTriggered: quitApplication.trigger() | ||
110 | visible: quitApplication.text !== "" | | |||
111 | } | 104 | } | ||
112 | } | 105 | } |