summaryrefslogtreecommitdiffstats
path: root/src/library/export/dlglibraryexport.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/export/dlglibraryexport.h')
-rw-r--r--src/library/export/dlglibraryexport.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/library/export/dlglibraryexport.h b/src/library/export/dlglibraryexport.h
new file mode 100644
index 0000000000..364acb2b94
--- /dev/null
+++ b/src/library/export/dlglibraryexport.h
@@ -0,0 +1,64 @@
+#pragma once
+
+#include <QDialog>
+#include <QLineEdit>
+#include <QListWidget>
+#include <QRadioButton>
+#include <QTreeWidget>
+#include <QWidget>
+#include <memory>
+
+#include "library/export/engineprimeexportrequest.h"
+#include "library/trackset/crate/crateid.h"
+#include "preferences/usersettings.h"
+#include "util/optional.h"
+#include "util/parented_ptr.h"
+
+class TrackCollectionManager;
+
+namespace mixxx {
+
+/// The DlgLibraryExport class is a UI window that gathers information from
+/// the user about how they would like to export the Mixxx library.
+///
+/// Currently, the dialog only supports exporting to the Engine Library format,
+/// but in future it is expected that this dialog could be expanded to include
+/// other formats, and generate different export signals accordingly.
+class DlgLibraryExport : public QDialog {
+ Q_OBJECT
+
+ public:
+ DlgLibraryExport(
+ QWidget* parent,
+ UserSettingsPointer pConfig,
+ TrackCollectionManager* pTrackCollectionManager);
+
+ /// Set the specified crate to be selected for export on the dialog. If no
+ /// crate is provided (i.e. `std::nullopt`), then the dialog will be ready
+ // to export the whole library. If an unknown crate is provided, then no
+ /// action is taken.
+ void setSelectedCrate(std::optional<CrateId> crateId);
+
+ signals:
+ /// The startEnginePrimeExport signal is emitted when sufficient information
+ /// has been gathered from the user to kick off an Engine Prime export, and
+ /// details of the request are provided as part of the signal.
+ void startEnginePrimeExport(EnginePrimeExportRequest) const;
+
+ private slots:
+ void browseExportDirectory();
+ void exportRequested();
+
+ private:
+ UserSettingsPointer m_pConfig;
+ TrackCollectionManager* m_pTrackCollectionManager;
+
+ parented_ptr<QRadioButton> m_pWholeLibraryRadio;
+ parented_ptr<QRadioButton> m_pCratesRadio;
+ parented_ptr<QListWidget> m_pCratesList;
+ parented_ptr<QLineEdit> m_pBaseDirectoryTextField;
+ parented_ptr<QLineEdit> m_pDatabaseDirectoryTextField;
+ parented_ptr<QLineEdit> m_pMusicDirectoryTextField;
+};
+
+} // namespace mixxx