summaryrefslogtreecommitdiffstats
path: root/src/library/mixxxlibraryfeature.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/mixxxlibraryfeature.cpp')
-rw-r--r--src/library/mixxxlibraryfeature.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/library/mixxxlibraryfeature.cpp b/src/library/mixxxlibraryfeature.cpp
index 47c6e5d562..1e33a20b5e 100644
--- a/src/library/mixxxlibraryfeature.cpp
+++ b/src/library/mixxxlibraryfeature.cpp
@@ -4,6 +4,9 @@
#include "library/mixxxlibraryfeature.h"
#include <QtDebug>
+#ifdef __ENGINEPRIME__
+#include <QMenu>
+#endif
#include "library/basetrackcache.h"
#include "library/dao/trackschema.h"
@@ -21,6 +24,9 @@
#include "sources/soundsourceproxy.h"
#include "util/dnd.h"
#include "widget/wlibrary.h"
+#ifdef __ENGINEPRIME__
+#include "widget/wlibrarysidebar.h"
+#endif
MixxxLibraryFeature::MixxxLibraryFeature(Library* pLibrary,
UserSettingsPointer pConfig)
@@ -107,6 +113,14 @@ MixxxLibraryFeature::MixxxLibraryFeature(Library* pLibrary,
pRootItem->appendChild(kHiddenTitle);
m_childModel.setRootItem(std::move(pRootItem));
+
+#ifdef __ENGINEPRIME__
+ m_pExportLibraryAction = make_parented<QAction>(tr("Export to External Library"), this);
+ connect(m_pExportLibraryAction.get(),
+ &QAction::triggered,
+ this,
+ &MixxxLibraryFeature::slotExportLibrary);
+#endif
}
void MixxxLibraryFeature::bindLibraryWidget(WLibrary* pLibraryWidget,
@@ -152,6 +166,13 @@ void MixxxLibraryFeature::refreshLibraryModels() {
}
}
+#ifdef __ENGINEPRIME__
+void MixxxLibraryFeature::bindSidebarWidget(WLibrarySidebar* pSidebarWidget) {
+ // store the sidebar widget pointer for later use in onRightClick
+ m_pSidebarWidget = pSidebarWidget;
+}
+#endif
+
void MixxxLibraryFeature::activate() {
qDebug() << "MixxxLibraryFeature::activate()";
emit showTrackModel(m_pLibraryTableModel);
@@ -183,3 +204,15 @@ bool MixxxLibraryFeature::dragMoveAccept(QUrl url) {
return SoundSourceProxy::isUrlSupported(url) ||
Parser::isPlaylistFilenameSupported(url.toLocalFile());
}
+
+#ifdef __ENGINEPRIME__
+void MixxxLibraryFeature::onRightClick(const QPoint& globalPos) {
+ QMenu menu(m_pSidebarWidget);
+ menu.addAction(m_pExportLibraryAction.get());
+ menu.exec(globalPos);
+}
+
+void MixxxLibraryFeature::slotExportLibrary() {
+ emit exportLibrary();
+}
+#endif