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 2, 2023
1 parent ac5f7be commit 64a8e1d
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 @@ -241,6 +241,7 @@ void DlgPrefLibrary::slotUpdate() {
m_pConfig->getValue(kSyncTrackMetadataConfigKey, false));
checkBox_SeratoMetadataExport->setChecked(
m_pConfig->getValue(kSyncSeratoMetadataConfigKey, false));
setSeratoMetadataEnabled(checkBox_SyncTrackMetadata->isChecked());
checkBox_use_relative_path->setChecked(m_pConfig->getValue(
kUseRelativePathOnExportConfigKey, false));

Expand Down Expand Up @@ -574,7 +575,16 @@ void DlgPrefLibrary::slotBpmColumnPrecisionChanged(int bpmPrecision) {
}

void DlgPrefLibrary::slotSyncTrackMetadataToggled() {
if (isVisible() && checkBox_SyncTrackMetadata->isChecked()) {
bool shouldSyncTrackMetadata = checkBox_SyncTrackMetadata->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 @@ -68,6 +68,7 @@ class DlgPrefLibrary : public DlgPreferencePage, public Ui::DlgPrefLibraryDlg {
void initializeDirList();
void setLibraryFont(const QFont& font);
void updateSearchLineEditHistoryOptions();
void setSeratoMetadataEnabled(bool shouldSyncTrackMetadata);

QStandardItemModel m_dirListModel;
UserSettingsPointer m_pConfig;
Expand Down

0 comments on commit 64a8e1d

Please sign in to comment.