Skip to content

Commit

Permalink
feat(preferences): (un-)check serato metadata export conditionally
Browse files Browse the repository at this point in the history
This will make the behavior clear visually that serato metadata
can only be exported if the general metadata export is also
enabled.
  • Loading branch information
Swiftb0y committed Aug 3, 2023
1 parent d79df88 commit c0ea823
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/preferences/dialog/dlgpreflibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ void DlgPrefLibrary::slotUpdate() {
ConfigKey("[Library]","SyncTrackMetadataExport"), false));
checkBox_SeratoMetadataExport->setChecked(m_pConfig->getValue(
ConfigKey("[Library]", "SeratoMetadataExport"), false));
setSeratoMetadataEnabled(checkBox_SyncTrackMetadataExport->isChecked());
checkBox_use_relative_path->setChecked(m_pConfig->getValue(
ConfigKey("[Library]","UseRelativePathOnExport"), false));
checkBox_show_rhythmbox->setChecked(m_pConfig->getValue(
Expand Down Expand Up @@ -444,7 +445,16 @@ void DlgPrefLibrary::slotSearchDebouncingTimeoutMillisChanged(int searchDebounci
}

void DlgPrefLibrary::slotSyncTrackMetadataExportToggled() {
if (isVisible() && checkBox_SyncTrackMetadataExport->isChecked()) {
bool shouldSyncTrackMetadata = checkBox_SyncTrackMetadataExport->isChecked();
if (isVisible() && shouldSyncTrackMetadata) {
mixxx::DlgTrackMetadataExport::showMessageBoxOncePerSession();
}
setSeratoMetadataEnabled(shouldSyncTrackMetadata);
}

void DlgPrefLibrary::setSeratoMetadataEnabled(bool shouldSyncTrackMetadata) {
checkBox_SeratoMetadataExport->setEnabled(shouldSyncTrackMetadata);
if (!shouldSyncTrackMetadata) {
checkBox_SeratoMetadataExport->setChecked(false);
}
}
1 change: 1 addition & 0 deletions src/preferences/dialog/dlgpreflibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class DlgPrefLibrary : public DlgPreferencePage, public Ui::DlgPrefLibraryDlg {
private:
void initializeDirList();
void setLibraryFont(const QFont& font);
void setSeratoMetadataEnabled(bool shouldSyncTrackMetadata);

QStandardItemModel m_dirListModel;
UserSettingsPointer m_pConfig;
Expand Down

0 comments on commit c0ea823

Please sign in to comment.