Added GUI option to reset all encoder settings.
This commit is contained in:
parent
822e1e1ffb
commit
94d6d16ce3
@ -117,6 +117,7 @@ IDR_WAVE_SHUTDOWN WAVE "res\\sounds\\shutdown.wav"
|
|||||||
IDR_WAVE_BEEP WAVE "res\\sounds\\beep.wav"
|
IDR_WAVE_BEEP WAVE "res\\sounds\\beep.wav"
|
||||||
IDR_WAVE_BEEP_LONG WAVE "res\\sounds\\beep2.wav"
|
IDR_WAVE_BEEP_LONG WAVE "res\\sounds\\beep2.wav"
|
||||||
IDR_WAVE_WAITING WAVE "res\\sounds\\waiting.wav"
|
IDR_WAVE_WAITING WAVE "res\\sounds\\waiting.wav"
|
||||||
|
IDR_WAVE_BLAST WAVE "res\\sounds\\blast.wav"
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -31,7 +31,7 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>MainWindow</name>
|
<name>MainWindow</name>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="729"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="726"/>
|
||||||
<source>%n file(s) have been rejected, because read access was not granted!</source>
|
<source>%n file(s) have been rejected, because read access was not granted!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n file have been rejected, because read access was not granted!</numerusform>
|
<numerusform>%n file have been rejected, because read access was not granted!</numerusform>
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="733"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="730"/>
|
||||||
<source>%n file(s) have been rejected, because they are dummy CDDA files!</source>
|
<source>%n file(s) have been rejected, because they are dummy CDDA files!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n file have been rejected, because they are dummy CDDA files!</numerusform>
|
<numerusform>%n file have been rejected, because they are dummy CDDA files!</numerusform>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="737"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="734"/>
|
||||||
<source>%n file(s) have been rejected, because they appear to be Cue Sheet images!</source>
|
<source>%n file(s) have been rejected, because they appear to be Cue Sheet images!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n file have been rejected, because they appear to be Cue Sheet images!</numerusform>
|
<numerusform>%n file have been rejected, because they appear to be Cue Sheet images!</numerusform>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="741"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="738"/>
|
||||||
<source>%n file(s) have been rejected, because the file format could not be recognized!</source>
|
<source>%n file(s) have been rejected, because the file format could not be recognized!</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n file have been rejected, because the file format could not be recognized!</numerusform>
|
<numerusform>%n file have been rejected, because the file format could not be recognized!</numerusform>
|
||||||
@ -63,7 +63,7 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message numerus="yes">
|
<message numerus="yes">
|
||||||
<location filename="../../src/Dialog_MainWindow.cpp" line="4217"/>
|
<location filename="../../src/Dialog_MainWindow.cpp" line="4244"/>
|
||||||
<source>%n Instance(s)</source>
|
<source>%n Instance(s)</source>
|
||||||
<translation>
|
<translation>
|
||||||
<numerusform>%n Instance</numerusform>
|
<numerusform>%n Instance</numerusform>
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1318,6 +1318,76 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelResetEncoders">
|
||||||
|
<property name="palette">
|
||||||
|
<palette>
|
||||||
|
<active>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>255</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</active>
|
||||||
|
<inactive>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>0</red>
|
||||||
|
<green>0</green>
|
||||||
|
<blue>255</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</inactive>
|
||||||
|
<disabled>
|
||||||
|
<colorrole role="WindowText">
|
||||||
|
<brush brushstyle="SolidPattern">
|
||||||
|
<color alpha="255">
|
||||||
|
<red>120</red>
|
||||||
|
<green>120</green>
|
||||||
|
<blue>120</blue>
|
||||||
|
</color>
|
||||||
|
</brush>
|
||||||
|
</colorrole>
|
||||||
|
</disabled>
|
||||||
|
</palette>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>50</weight>
|
||||||
|
<bold>false</bold>
|
||||||
|
<underline>true</underline>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="cursor">
|
||||||
|
<cursorShape>PointingHandCursor</cursorShape>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_67">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>5</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="labelCompressionHelp">
|
<widget class="QLabel" name="labelCompressionHelp">
|
||||||
<property name="palette">
|
<property name="palette">
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#define VER_LAMEXP_MINOR_LO 8
|
#define VER_LAMEXP_MINOR_LO 8
|
||||||
#define VER_LAMEXP_TYPE Beta
|
#define VER_LAMEXP_TYPE Beta
|
||||||
#define VER_LAMEXP_PATCH 1
|
#define VER_LAMEXP_PATCH 1
|
||||||
#define VER_LAMEXP_BUILD 1318
|
#define VER_LAMEXP_BUILD 1319
|
||||||
#define VER_LAMEXP_CONFG 1288
|
#define VER_LAMEXP_CONFG 1288
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -162,6 +162,7 @@ while(0)
|
|||||||
#define FSLINK(PATH) QString("<a href=\"file:///%1\">%2</a>").arg(PATH).arg(QString(PATH).replace("-", "−"))
|
#define FSLINK(PATH) QString("<a href=\"file:///%1\">%2</a>").arg(PATH).arg(QString(PATH).replace("-", "−"))
|
||||||
//#define USE_NATIVE_FILE_DIALOG (lamexp_themes_enabled() || ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) < QSysInfo::WV_XP))
|
//#define USE_NATIVE_FILE_DIALOG (lamexp_themes_enabled() || ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) < QSysInfo::WV_XP))
|
||||||
#define CENTER_CURRENT_OUTPUT_FOLDER_DELAYED QTimer::singleShot(125, this, SLOT(centerOutputFolderModel()))
|
#define CENTER_CURRENT_OUTPUT_FOLDER_DELAYED QTimer::singleShot(125, this, SLOT(centerOutputFolderModel()))
|
||||||
|
#define RESET_SETTING(OBJ,NAME) (OBJ)->NAME((OBJ)->NAME##Default())
|
||||||
|
|
||||||
static const DWORD IDM_ABOUTBOX = 0xEFF0;
|
static const DWORD IDM_ABOUTBOX = 0xEFF0;
|
||||||
|
|
||||||
@ -364,14 +365,10 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S
|
|||||||
ui->radioButtonEncoderOpus->setChecked(m_settings->compressionEncoder() == SettingsModel::OpusEncoder);
|
ui->radioButtonEncoderOpus->setChecked(m_settings->compressionEncoder() == SettingsModel::OpusEncoder);
|
||||||
ui->radioButtonEncoderDCA->setChecked(m_settings->compressionEncoder() == SettingsModel::DCAEncoder);
|
ui->radioButtonEncoderDCA->setChecked(m_settings->compressionEncoder() == SettingsModel::DCAEncoder);
|
||||||
ui->radioButtonEncoderPCM->setChecked(m_settings->compressionEncoder() == SettingsModel::PCMEncoder);
|
ui->radioButtonEncoderPCM->setChecked(m_settings->compressionEncoder() == SettingsModel::PCMEncoder);
|
||||||
|
|
||||||
//ui->radioButtonModeQuality->setChecked(m_settings->compressionRCMode() == SettingsModel::VBRMode);
|
|
||||||
//ui->radioButtonModeAverageBitrate->setChecked(m_settings->compressionRCMode() == SettingsModel::ABRMode);
|
|
||||||
//ui->radioButtonConstBitrate->setChecked(m_settings->compressionRCMode() == SettingsModel::CBRMode);
|
|
||||||
//ui->sliderBitrate->setValue(m_settings->compressionBitrate());
|
|
||||||
|
|
||||||
m_evenFilterCompressionTab = new CustomEventFilter();
|
m_evenFilterCompressionTab = new CustomEventFilter();
|
||||||
ui->labelCompressionHelp->installEventFilter(m_evenFilterCompressionTab);
|
ui->labelCompressionHelp->installEventFilter(m_evenFilterCompressionTab);
|
||||||
|
ui->labelResetEncoders ->installEventFilter(m_evenFilterCompressionTab);
|
||||||
|
|
||||||
connect(m_encoderButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(updateEncoder(int)));
|
connect(m_encoderButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(updateEncoder(int)));
|
||||||
connect(m_modeButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(updateRCMode(int)));
|
connect(m_modeButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(updateRCMode(int)));
|
||||||
@ -3878,6 +3875,36 @@ void MainWindow::compressionTabEventOccurred(QWidget *sender, QEvent *event)
|
|||||||
{
|
{
|
||||||
QDesktopServices::openUrl(helpUrl);
|
QDesktopServices::openUrl(helpUrl);
|
||||||
}
|
}
|
||||||
|
else if((sender == ui->labelResetEncoders) && (event->type() == QEvent::MouseButtonPress))
|
||||||
|
{
|
||||||
|
if(m_settings->soundsEnabled())
|
||||||
|
{
|
||||||
|
PlaySound(MAKEINTRESOURCE(IDR_WAVE_BLAST), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
|
||||||
|
}
|
||||||
|
|
||||||
|
RESET_SETTING(m_settings, compressionBitrateAacEnc);
|
||||||
|
RESET_SETTING(m_settings, compressionBitrateAften);
|
||||||
|
RESET_SETTING(m_settings, compressionBitrateDcaEnc);
|
||||||
|
RESET_SETTING(m_settings, compressionBitrateLAME);
|
||||||
|
RESET_SETTING(m_settings, compressionBitrateOggEnc);
|
||||||
|
RESET_SETTING(m_settings, compressionBitrateOpusEnc);
|
||||||
|
|
||||||
|
RESET_SETTING(m_settings, compressionRCModeAacEnc);
|
||||||
|
RESET_SETTING(m_settings, compressionRCModeAften);
|
||||||
|
RESET_SETTING(m_settings, compressionRCModeLAME);
|
||||||
|
RESET_SETTING(m_settings, compressionRCModeOggEnc);
|
||||||
|
RESET_SETTING(m_settings, compressionRCModeOpusEnc);
|
||||||
|
|
||||||
|
RESET_SETTING(m_settings, compressionVbrLevelAacEnc);
|
||||||
|
RESET_SETTING(m_settings, compressionVbrLevelAften);
|
||||||
|
RESET_SETTING(m_settings, compressionVbrLevelFLAC);
|
||||||
|
RESET_SETTING(m_settings, compressionVbrLevelLAME);
|
||||||
|
RESET_SETTING(m_settings, compressionVbrLevelOggEnc);
|
||||||
|
|
||||||
|
m_settings->compressionEncoder(SettingsModel::MP3Encoder);
|
||||||
|
ui->radioButtonEncoderMP3->setChecked(true);
|
||||||
|
QTimer::singleShot(0, this, SLOT(updateEncoder()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========================================================
|
// =========================================================
|
||||||
@ -4394,6 +4421,11 @@ void MainWindow::overwriteModeChanged(int id)
|
|||||||
*/
|
*/
|
||||||
void MainWindow::resetAdvancedOptionsButtonClicked(void)
|
void MainWindow::resetAdvancedOptionsButtonClicked(void)
|
||||||
{
|
{
|
||||||
|
if(m_settings->soundsEnabled())
|
||||||
|
{
|
||||||
|
PlaySound(MAKEINTRESOURCE(IDR_WAVE_BLAST), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC);
|
||||||
|
}
|
||||||
|
|
||||||
ui->sliderLameAlgoQuality->setValue(m_settings->lameAlgoQualityDefault());
|
ui->sliderLameAlgoQuality->setValue(m_settings->lameAlgoQualityDefault());
|
||||||
ui->spinBoxBitrateManagementMin->setValue(m_settings->bitrateManagementMinRateDefault());
|
ui->spinBoxBitrateManagementMin->setValue(m_settings->bitrateManagementMinRateDefault());
|
||||||
ui->spinBoxBitrateManagementMax->setValue(m_settings->bitrateManagementMaxRateDefault());
|
ui->spinBoxBitrateManagementMax->setValue(m_settings->bitrateManagementMaxRateDefault());
|
||||||
@ -4409,6 +4441,7 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
|
|||||||
ui->comboBoxAftenDRCMode->setCurrentIndex(m_settings->aftenDynamicRangeCompressionDefault());
|
ui->comboBoxAftenDRCMode->setCurrentIndex(m_settings->aftenDynamicRangeCompressionDefault());
|
||||||
ui->comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEqualizationModeDefault());
|
ui->comboBoxNormalizationMode->setCurrentIndex(m_settings->normalizationFilterEqualizationModeDefault());
|
||||||
ui->comboBoxOpusFramesize->setCurrentIndex(m_settings->opusFramesizeDefault());
|
ui->comboBoxOpusFramesize->setCurrentIndex(m_settings->opusFramesizeDefault());
|
||||||
|
|
||||||
SET_CHECKBOX_STATE(ui->checkBoxBitrateManagement, m_settings->bitrateManagementEnabledDefault());
|
SET_CHECKBOX_STATE(ui->checkBoxBitrateManagement, m_settings->bitrateManagementEnabledDefault());
|
||||||
SET_CHECKBOX_STATE(ui->checkBoxNeroAAC2PassMode, m_settings->neroAACEnable2PassDefault());
|
SET_CHECKBOX_STATE(ui->checkBoxNeroAAC2PassMode, m_settings->neroAACEnable2PassDefault());
|
||||||
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilter, m_settings->normalizationFilterEnabledDefault());
|
SET_CHECKBOX_STATE(ui->checkBoxNormalizationFilter, m_settings->normalizationFilterEnabledDefault());
|
||||||
@ -4418,6 +4451,7 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
|
|||||||
SET_CHECKBOX_STATE(ui->checkBoxRenameOutput, m_settings->renameOutputFilesEnabledDefault());
|
SET_CHECKBOX_STATE(ui->checkBoxRenameOutput, m_settings->renameOutputFilesEnabledDefault());
|
||||||
SET_CHECKBOX_STATE(ui->checkBoxForceStereoDownmix, m_settings->forceStereoDownmixDefault());
|
SET_CHECKBOX_STATE(ui->checkBoxForceStereoDownmix, m_settings->forceStereoDownmixDefault());
|
||||||
SET_CHECKBOX_STATE(ui->checkBoxOpusDisableResample, m_settings->opusDisableResampleDefault());
|
SET_CHECKBOX_STATE(ui->checkBoxOpusDisableResample, m_settings->opusDisableResampleDefault());
|
||||||
|
|
||||||
ui->lineEditCustomParamLAME->setText(m_settings->customParametersLAMEDefault());
|
ui->lineEditCustomParamLAME->setText(m_settings->customParametersLAMEDefault());
|
||||||
ui->lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEncDefault());
|
ui->lineEditCustomParamOggEnc->setText(m_settings->customParametersOggEncDefault());
|
||||||
ui->lineEditCustomParamNeroAAC->setText(m_settings->customParametersAacEncDefault());
|
ui->lineEditCustomParamNeroAAC->setText(m_settings->customParametersAacEncDefault());
|
||||||
@ -4425,9 +4459,11 @@ void MainWindow::resetAdvancedOptionsButtonClicked(void)
|
|||||||
ui->lineEditCustomParamOpus->setText(m_settings->customParametersFLACDefault());
|
ui->lineEditCustomParamOpus->setText(m_settings->customParametersFLACDefault());
|
||||||
ui->lineEditCustomTempFolder->setText(QDir::toNativeSeparators(m_settings->customTempPathDefault()));
|
ui->lineEditCustomTempFolder->setText(QDir::toNativeSeparators(m_settings->customTempPathDefault()));
|
||||||
ui->lineEditRenamePattern->setText(m_settings->renameOutputFilesPatternDefault());
|
ui->lineEditRenamePattern->setText(m_settings->renameOutputFilesPatternDefault());
|
||||||
|
|
||||||
if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_KeepBoth) ui->radioButtonOverwriteModeKeepBoth->click();
|
if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_KeepBoth) ui->radioButtonOverwriteModeKeepBoth->click();
|
||||||
if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_SkipFile) ui->radioButtonOverwriteModeSkipFile->click();
|
if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_SkipFile) ui->radioButtonOverwriteModeSkipFile->click();
|
||||||
if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_Replaces) ui->radioButtonOverwriteModeReplaces->click();
|
if(m_settings->overwriteModeDefault() == SettingsModel::Overwrite_Replaces) ui->radioButtonOverwriteModeReplaces->click();
|
||||||
|
|
||||||
customParamsChanged();
|
customParamsChanged();
|
||||||
ui->scrollArea->verticalScrollBar()->setValue(0);
|
ui->scrollArea->verticalScrollBar()->setValue(0);
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ private slots:
|
|||||||
void toneAdjustTrebleChanged(double value);
|
void toneAdjustTrebleChanged(double value);
|
||||||
void toneAdjustTrebleReset(void);
|
void toneAdjustTrebleReset(void);
|
||||||
void updateBitrate(int value);
|
void updateBitrate(int value);
|
||||||
void updateEncoder(int id);
|
void updateEncoder(int id = 0);
|
||||||
void updateLameAlgoQuality(int value);
|
void updateLameAlgoQuality(int value);
|
||||||
void updateMaximumInstances(int value);
|
void updateMaximumInstances(int value);
|
||||||
void updateRCMode(int id);
|
void updateRCMode(int id);
|
||||||
|
@ -200,9 +200,9 @@ SettingsModel::SettingsModel(void)
|
|||||||
m_cacheDirty = new QSet<QString>();
|
m_cacheDirty = new QSet<QString>();
|
||||||
|
|
||||||
//Create settings
|
//Create settings
|
||||||
m_settings = new QSettings(configPath, QSettings::IniFormat);
|
m_configFile = new QSettings(configPath, QSettings::IniFormat);
|
||||||
const QString groupKey = QString().sprintf("LameXP_%u%02u%05u", lamexp_version_major(), lamexp_version_minor(), lamexp_version_confg());
|
const QString groupKey = QString().sprintf("LameXP_%u%02u%05u", lamexp_version_major(), lamexp_version_minor(), lamexp_version_confg());
|
||||||
QStringList childGroups = m_settings->childGroups();
|
QStringList childGroups = m_configFile->childGroups();
|
||||||
|
|
||||||
//Clean-up settings
|
//Clean-up settings
|
||||||
while(!childGroups.isEmpty())
|
while(!childGroups.isEmpty())
|
||||||
@ -219,13 +219,13 @@ SettingsModel::SettingsModel(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
qWarning("Deleting obsolete group from config: %s", current.toUtf8().constData());
|
qWarning("Deleting obsolete group from config: %s", current.toUtf8().constData());
|
||||||
REMOVE_GROUP(m_settings, current);
|
REMOVE_GROUP(m_configFile, current);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Setup settings
|
//Setup settings
|
||||||
m_settings->beginGroup(groupKey);
|
m_configFile->beginGroup(groupKey);
|
||||||
m_settings->setValue(g_settingsId_versionNumber, QApplication::applicationVersion());
|
m_configFile->setValue(g_settingsId_versionNumber, QApplication::applicationVersion());
|
||||||
m_settings->sync();
|
m_configFile->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@ -239,7 +239,7 @@ SettingsModel::~SettingsModel(void)
|
|||||||
LAMEXP_DELETE(m_cache);
|
LAMEXP_DELETE(m_cache);
|
||||||
LAMEXP_DELETE(m_cacheDirty);
|
LAMEXP_DELETE(m_cacheDirty);
|
||||||
LAMEXP_DELETE(m_cacheLock);
|
LAMEXP_DELETE(m_cacheLock);
|
||||||
LAMEXP_DELETE(m_settings);
|
LAMEXP_DELETE(m_configFile);
|
||||||
LAMEXP_DELETE(m_defaultLanguage);
|
LAMEXP_DELETE(m_defaultLanguage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,7 +467,7 @@ QVariant SettingsModel::loadValue(const QString &key, const QVariant &defaultVal
|
|||||||
|
|
||||||
if(!m_cache->contains(key))
|
if(!m_cache->contains(key))
|
||||||
{
|
{
|
||||||
const QVariant storedValue = m_settings->value(key, defaultValue);
|
const QVariant storedValue = m_configFile->value(key, defaultValue);
|
||||||
m_cache->insert(key, storedValue);
|
m_cache->insert(key, storedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,15 +480,19 @@ void SettingsModel::flushValues(void)
|
|||||||
|
|
||||||
if(!m_cacheDirty->isEmpty())
|
if(!m_cacheDirty->isEmpty())
|
||||||
{
|
{
|
||||||
QHash<QString, QVariant>::ConstIterator iter;
|
QSet<QString>::ConstIterator iter;
|
||||||
for(iter = m_cache->constBegin(); iter != m_cache->constEnd(); iter++)
|
for(iter = m_cacheDirty->constBegin(); iter != m_cacheDirty->constEnd(); iter++)
|
||||||
{
|
{
|
||||||
if(m_cacheDirty->contains(iter.key()))
|
if(m_cache->contains(*iter))
|
||||||
{
|
{
|
||||||
m_settings->setValue(iter.key(), iter.value());
|
m_configFile->setValue((*iter), m_cache->value(*iter));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qWarning("Could not find '%s' in cache, but it has been marked as dirty!", (*iter).toUtf8().constData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_settings->sync();
|
m_configFile->sync();
|
||||||
m_cacheDirty->clear();
|
m_cacheDirty->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ public:
|
|||||||
void syncNow(void);
|
void syncNow(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSettings *m_settings;
|
QSettings *m_configFile;
|
||||||
QHash<QString, QVariant> *m_cache;
|
QHash<QString, QVariant> *m_cache;
|
||||||
QSet<QString> *m_cacheDirty;
|
QSet<QString> *m_cacheDirty;
|
||||||
QMutex *m_cacheLock;
|
QMutex *m_cacheLock;
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#define IDR_WAVE_BEEP 673
|
#define IDR_WAVE_BEEP 673
|
||||||
#define IDR_WAVE_BEEP_LONG 674
|
#define IDR_WAVE_BEEP_LONG 674
|
||||||
#define IDR_WAVE_WAITING 675
|
#define IDR_WAVE_WAITING 675
|
||||||
|
#define IDR_WAVE_BLAST 676
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Next default values for new objects
|
* Next default values for new objects
|
||||||
|
Loading…
Reference in New Issue
Block a user