Skip to content

Commit 2d5be33

Browse files
Merge pull request #16699 from xARSENICx/agent/remove-qml-deck-track-menu
Remove qt wideget deck track menu from QML
2 parents f834416 + 3c1020c commit 2d5be33

2 files changed

Lines changed: 0 additions & 93 deletions

File tree

src/qml/qmllibraryproxy.cpp

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#include "qml/qmllibraryproxy.h"
22

33
#include <QAbstractItemModel>
4-
#include <QCursor>
5-
#include <QPoint>
64
#include <QQmlEngine>
75
#include <cmath>
86

@@ -16,9 +14,7 @@
1614
#include "qmltrackproxy.h"
1715
#include "track/cue.h"
1816
#include "track/track.h"
19-
#include "track/track_decl.h"
2017
#include "util/assert.h"
21-
#include "widget/wtrackmenu.h"
2218

2319
namespace mixxx {
2420
namespace qml {
@@ -122,48 +118,6 @@ void QmlLibraryProxy::analyze(const QmlTrackProxy* track) const {
122118
emit s_pLibrary->analyzeTracks({track->internal()->getId()});
123119
}
124120

125-
void QmlLibraryProxy::showDeckTrackMenu(
126-
QmlTrackProxy* track,
127-
const QString& group,
128-
const QString& property,
129-
int globalXPosition,
130-
int globalYPosition) {
131-
VERIFY_OR_DEBUG_ASSERT(track && track->internal()) {
132-
return;
133-
}
134-
135-
ensureDeckTrackMenu();
136-
VERIFY_OR_DEBUG_ASSERT(m_pDeckTrackMenu) {
137-
return;
138-
}
139-
140-
m_pDeckTrackMenu->loadTrack(track->internal(), group);
141-
m_pDeckTrackMenu->updateMenus();
142-
m_pDeckTrackMenu->setTrackPropertyName(property);
143-
const QPoint globalPosition = globalXPosition >= 0 && globalYPosition >= 0
144-
? QPoint(globalXPosition, globalYPosition)
145-
: QCursor::pos();
146-
m_pDeckTrackMenu->popup(globalPosition);
147-
}
148-
149-
void QmlLibraryProxy::showDeckTrackProperties(
150-
QmlTrackProxy* track,
151-
const QString& group,
152-
const QString& property) {
153-
VERIFY_OR_DEBUG_ASSERT(track && track->internal()) {
154-
return;
155-
}
156-
157-
ensureDeckTrackMenu();
158-
VERIFY_OR_DEBUG_ASSERT(m_pDeckTrackMenu) {
159-
return;
160-
}
161-
162-
m_pDeckTrackMenu->loadTrack(track->internal(), group);
163-
m_pDeckTrackMenu->setTrackPropertyName(property);
164-
m_pDeckTrackMenu->slotShowDlgTrackInfo();
165-
}
166-
167121
QString QmlLibraryProxy::deckHotcueLabel(
168122
QmlTrackProxy* track,
169123
int hotcueNumber) const {
@@ -300,38 +254,6 @@ void QmlLibraryProxy::cleanupDeckHotcuePopup(
300254
}
301255
}
302256

303-
void QmlLibraryProxy::ensureDeckTrackMenu() {
304-
if (m_pDeckTrackMenu) {
305-
return;
306-
}
307-
308-
VERIFY_OR_DEBUG_ASSERT(s_pLibrary && QmlConfigProxy::get()) {
309-
return;
310-
}
311-
312-
m_pDeckTrackMenu = std::make_unique<WTrackMenu>(
313-
nullptr,
314-
QmlConfigProxy::get(),
315-
s_pLibrary.get(),
316-
WTrackMenu::kDeckTrackMenuFeatures);
317-
connect(m_pDeckTrackMenu.get(),
318-
&WTrackMenu::trackMenuVisible,
319-
this,
320-
[this](bool visible) {
321-
ControlObject::set(
322-
ConfigKey(m_pDeckTrackMenu->getDeckGroup(), kShowTrackMenuKey),
323-
visible ? 1.0 : 0.0);
324-
});
325-
connect(m_pDeckTrackMenu.get(),
326-
&WTrackMenu::saveCurrentViewState,
327-
s_pLibrary.get(),
328-
&Library::slotSaveCurrentViewState);
329-
connect(m_pDeckTrackMenu.get(),
330-
&WTrackMenu::restoreCurrentViewStateOrIndex,
331-
s_pLibrary.get(),
332-
&Library::slotRestoreCurrentViewState);
333-
}
334-
335257
// static
336258
QmlLibraryProxy* QmlLibraryProxy::create(QQmlEngine* pQmlEngine, QJSEngine* pJsEngine) {
337259
// The implementation of this method is mostly taken from the code example

src/qml/qmllibraryproxy.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
class Library;
1212
class KeyboardEventFilter;
13-
class WTrackMenu;
1413

1514
namespace mixxx {
1615
namespace qml {
@@ -46,16 +45,6 @@ class QmlLibraryProxy : public QObject {
4645

4746
QmlLibraryTrackListModel* model() const;
4847
Q_INVOKABLE void analyze(const mixxx::qml::QmlTrackProxy* track) const;
49-
Q_INVOKABLE void showDeckTrackMenu(
50-
mixxx::qml::QmlTrackProxy* track,
51-
const QString& group,
52-
const QString& property,
53-
int globalXPosition,
54-
int globalYPosition);
55-
Q_INVOKABLE void showDeckTrackProperties(
56-
mixxx::qml::QmlTrackProxy* track,
57-
const QString& group,
58-
const QString& property);
5948
Q_INVOKABLE QString deckHotcueLabel(
6049
mixxx::qml::QmlTrackProxy* track,
6150
int hotcueNumber) const;
@@ -73,12 +62,8 @@ class QmlLibraryProxy : public QObject {
7362
int hotcueNumber);
7463

7564
private:
76-
void ensureDeckTrackMenu();
77-
7865
static inline std::shared_ptr<Library> s_pLibrary;
7966
static inline std::shared_ptr<KeyboardEventFilter> s_pKeyboard;
80-
81-
std::unique_ptr<WTrackMenu> m_pDeckTrackMenu;
8267
};
8368

8469
} // namespace qml

0 commit comments

Comments
 (0)