diff --git a/CHANGELOG b/CHANGELOG index aa57f0ce1eb..0014407d483 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ ==== 2.2.4 2020-mm-dd ==== +* Store default recording format after "Restore Defaults" lp:1857806 #2414 * Prevent infinite loop when decoding corrupt MP3 files #2417 * Add workaround for broken libshout versions #2040 #2438 * Speed up purging of tracks lp:1845837 #2393 diff --git a/src/preferences/dialog/dlgprefrecord.cpp b/src/preferences/dialog/dlgprefrecord.cpp index 1fd089ae131..a2fb2faafc6 100644 --- a/src/preferences/dialog/dlgprefrecord.cpp +++ b/src/preferences/dialog/dlgprefrecord.cpp @@ -61,7 +61,7 @@ DlgPrefRecord::DlgPrefRecord(QWidget* parent, UserSettingsPointer pConfig) m_pConfig->set(ConfigKey(RECORDING_PREF_KEY, "Encoding"), ConfigValue(m_selFormat.internalName)); } - setupEncoderUI(m_selFormat); + setupEncoderUI(); // Setting Metadata loadMetaData(); @@ -160,7 +160,7 @@ void DlgPrefRecord::slotUpdate() break; } } - setupEncoderUI(m_selFormat); + setupEncoderUI(); loadMetaData(); @@ -178,8 +178,9 @@ void DlgPrefRecord::slotUpdate() void DlgPrefRecord::slotResetToDefaults() { m_formatButtons.first()->setChecked(true); - setupEncoderUI(EncoderFactory::getFactory().getFormatFor( - m_formatButtons.first()->objectName())); + m_selFormat = EncoderFactory::getFactory().getFormatFor( + m_formatButtons.first()->objectName()); + setupEncoderUI(); // TODO (XXX): It would be better that a defaultSettings() method is added // to the EncoderSettings interface so that we know which option to set m_optionWidgets.first()->setChecked(true); @@ -218,12 +219,13 @@ void DlgPrefRecord::slotFormatChanged() { QObject *senderObj = sender(); m_selFormat = EncoderFactory::getFactory().getFormatFor(senderObj->objectName()); - setupEncoderUI(m_selFormat); + setupEncoderUI(); } -void DlgPrefRecord::setupEncoderUI(Encoder::Format selformat) -{ - EncoderSettingsPointer settings = EncoderFactory::getFactory().getEncoderSettings(selformat, m_pConfig); +void DlgPrefRecord::setupEncoderUI() { + EncoderSettingsPointer settings = + EncoderFactory::getFactory().getEncoderSettings( + m_selFormat, m_pConfig); if (settings->usesQualitySlider()) { LabelQuality->setVisible(true); SliderQuality->setVisible(true); diff --git a/src/preferences/dialog/dlgprefrecord.h b/src/preferences/dialog/dlgprefrecord.h index f9acff46fbc..29696a87a7b 100644 --- a/src/preferences/dialog/dlgprefrecord.h +++ b/src/preferences/dialog/dlgprefrecord.h @@ -42,7 +42,7 @@ class DlgPrefRecord : public DlgPreferencePage, public Ui::DlgPrefRecordDlg { void retainSizeFor(QWidget* widget); inline void showWidget(QWidget* widget); inline void hideWidget(QWidget* widget); - void setupEncoderUI(Encoder::Format selformat); + void setupEncoderUI(); void loadMetaData(); void updateTextQuality(); void updateTextCompression();