-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add shared QML application menu and action proxies #16849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
xARSENICx
wants to merge
8
commits into
mixxxdj:main
Choose a base branch
from
xARSENICx:feat/qml-menu-action-bridge
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
887b8ff
feat(qml): expose library menu actions
xARSENICx 6b97aca
feat(qml): expose player menu helpers
xARSENICx dfbc018
feat(qml): add application menu proxy
xARSENICx 171a15a
feat(qml): add native application menu
xARSENICx 27dd4e0
fix(qml): create developer menu after completion
xARSENICx c24b480
fix(qml): preserve native preferences action
xARSENICx b8d9701
fix(qml): fix platform menu handling and deck-dependent actions
xARSENICx c044be1
fix(qml): follow active deck layout in application menus
xARSENICx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| import Mixxx 1.0 as Mixxx | ||
| import QtQuick | ||
| import QtQuick.Controls | ||
| import QtQuick.Dialogs | ||
| import QtQuick.Window | ||
|
|
||
| Item { | ||
| id: root | ||
|
|
||
| required property ApplicationWindow applicationWindow | ||
| readonly property bool fullScreen: applicationWindow.visibility === Window.FullScreen | ||
| property int pendingDeck: 1 | ||
|
|
||
| signal showDeveloperToolsRequested | ||
|
|
||
| function loadTrackToDeck(deck) { | ||
| pendingDeck = deck; | ||
| const playControl = [deck1PlayControl, deck2PlayControl, deck3PlayControl, deck4PlayControl][deck - 1]; | ||
| if (playControl && playControl.value > 0) { | ||
| confirmLoadDialog.text = qsTr("Deck %1 is currently playing a track.\nAre you sure you want to load a new track?").arg(deck); | ||
| confirmLoadDialog.open(); | ||
| } else { | ||
| openTrackFileDialog(); | ||
| } | ||
| } | ||
| function openTrackFileDialog() { | ||
| trackFileDialog.title = qsTr("Load track to Deck %1").arg(pendingDeck); | ||
| trackFileDialog.currentFolder = Mixxx.PlayerManager.initialTrackDirectoryUrl; | ||
| Qt.callLater(function() { | ||
| trackFileDialog.open(); | ||
| }); | ||
| } | ||
| function toggleFullScreen() { | ||
| applicationWindow.visibility = applicationWindow.visibility === Window.FullScreen ? Window.Windowed : Window.FullScreen; | ||
| } | ||
| function showAbout() { | ||
| aboutDialog.open(); | ||
| } | ||
| function showKeywheel() { | ||
| keywheelDialog.open(); | ||
| } | ||
|
|
||
| FileDialog { | ||
| id: trackFileDialog | ||
|
|
||
| fileMode: FileDialog.OpenFile | ||
| nameFilters: Mixxx.PlayerManager.supportedAudioFileNameFilters | ||
|
|
||
| onAccepted: Mixxx.PlayerManager.loadLocationUrlToDeck(selectedFile, root.pendingDeck) | ||
| } | ||
| MessageDialog { | ||
| id: confirmLoadDialog | ||
|
|
||
| buttons: MessageDialog.Yes | MessageDialog.No | ||
| title: Mixxx.Application.applicationName | ||
|
|
||
| onAccepted: root.openTrackFileDialog() | ||
| } | ||
| MessageDialog { | ||
| id: aboutDialog | ||
|
|
||
| buttons: MessageDialog.Ok | ||
| informativeText: qsTr("%1\n%2").arg(Mixxx.Application.platform).arg("https://mixxx.org") | ||
| text: qsTr("%1 %2").arg(Mixxx.Application.applicationName).arg(Mixxx.Application.version) | ||
| title: qsTr("About %1").arg(Mixxx.Application.applicationName) | ||
| } | ||
| Dialog { | ||
| id: keywheelDialog | ||
|
|
||
| height: Math.min(620, root.applicationWindow.height - 80) | ||
| modal: false | ||
| standardButtons: Dialog.Close | ||
| title: qsTr("Keywheel") | ||
| width: height | ||
| x: Math.round((root.applicationWindow.width - width) / 2) | ||
| y: Math.round((root.applicationWindow.height - height) / 2) | ||
|
|
||
| contentItem: Image { | ||
| fillMode: Image.PreserveAspectFit | ||
| source: "../images/keywheel/keywheel.svg" | ||
| } | ||
| } | ||
| Mixxx.ControlProxy { | ||
| id: deck1PlayControl | ||
|
|
||
| group: "[Channel1]" | ||
| key: "play" | ||
| } | ||
| Mixxx.ControlProxy { | ||
| id: deck2PlayControl | ||
|
|
||
| group: "[Channel2]" | ||
| key: "play" | ||
| } | ||
| Mixxx.ControlProxy { | ||
| id: deck3PlayControl | ||
|
|
||
| group: "[Channel3]" | ||
| key: "play" | ||
| } | ||
| Mixxx.ControlProxy { | ||
| id: deck4PlayControl | ||
|
|
||
| group: "[Channel4]" | ||
| key: "play" | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import Mixxx 1.0 as Mixxx | ||
| import QtQuick | ||
| import QtQuick.Dialogs | ||
|
|
||
| MessageDialog { | ||
| id: root | ||
|
|
||
| buttons: MessageDialog.Ok | ||
|
|
||
| Connections { | ||
| function onLibraryScanSummaryAvailable(title, text, informativeText) { | ||
| root.title = title; | ||
| root.text = text; | ||
| root.informativeText = informativeText; | ||
| root.open(); | ||
| } | ||
|
|
||
| target: Mixxx.Library | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.