1 #pragma once 2 3 #include <QWidget> 4 5 #include "control/controlproxy.h" 6 #include "preferences/colorpaletteeditor.h" 7 #include "preferences/colorpalettesettings.h" 8 #include "preferences/dialog/dlgpreferencepage.h" 9 #include "preferences/dialog/ui_dlgprefcolorsdlg.h" 10 #include "preferences/usersettings.h" 11 #include "util/parented_ptr.h" 12 13 class DlgReplaceCueColor; 14 class Library; 15 16 class DlgPrefColors : public DlgPreferencePage, public Ui::DlgPrefColorsDlg { 17 Q_OBJECT 18 public: 19 DlgPrefColors(QWidget* parent, UserSettingsPointer pConfig, Library* pLibrary); 20 virtual ~DlgPrefColors(); 21 22 public slots: 23 /// Called when the preference dialog (not this page) is shown to the user. 24 void slotUpdate() override; 25 /// Called when the user clicks the global "Apply" button. 26 void slotApply() override; 27 /// Called when the user clicks the global "Reset to Defaults" button. 28 void slotResetToDefaults() override; 29 30 signals: 31 void apply(const QString&); 32 33 private slots: 34 void slotHotcuePaletteIndexChanged(int paletteIndex); 35 void trackPaletteUpdated(const QString& palette); 36 void hotcuePaletteUpdated(const QString& palette); 37 void palettesUpdated(); 38 void slotReplaceCueColorClicked(); 39 void slotEditTrackPaletteClicked(); 40 void slotEditHotcuePaletteClicked(); 41 42 private: 43 /// Loads the config keys and sets the widgets in the dialog to match 44 void loadSettings(); 45 void openColorPaletteEditor( 46 const QString& paletteName, 47 bool editHotcuePalette); 48 QPixmap drawPalettePreview(const QString& paletteName); 49 QIcon drawHotcueColorByPaletteIcon(const QString& paletteName); 50 void restoreComboBoxes( 51 const QString& hotcueColors, 52 const QString& trackColors, 53 int defaultColor); 54 55 const UserSettingsPointer m_pConfig; 56 ColorPaletteSettings m_colorPaletteSettings; 57 // Pointer to color replace dialog 58 DlgReplaceCueColor* m_pReplaceCueColorDlg; 59 }; 60