Mercurial > hg > svcore
diff base/Preferences.cpp @ 277:3b8008d09541
* Add a colour database, and Add New Colour function to the colour combo
in property box. The colour property is only correctly handled in the
waveform layer so far.
* Add en_GB translation, to translate those annoying Color texts in the
Qt colour picker dialog.
author | Chris Cannam |
---|---|
date | Wed, 11 Jul 2007 17:21:37 +0000 |
parents | d7eeffbb8aaf |
children | c022976d18e8 |
line wrap: on
line diff
--- a/base/Preferences.cpp Thu Jul 05 11:07:01 2007 +0000 +++ b/base/Preferences.cpp Wed Jul 11 17:21:37 2007 +0000 @@ -39,7 +39,8 @@ m_tuningFrequency(440), m_propertyBoxLayout(VerticallyStacked), m_windowType(HanningWindow), - m_resampleQuality(1) + m_resampleQuality(1), + m_omitRecentTemps(true) { QSettings settings; settings.beginGroup("Preferences"); @@ -67,6 +68,7 @@ props.push_back("Property Box Layout"); props.push_back("Window Type"); props.push_back("Resample Quality"); + props.push_back("Omit Temporaries from Recent Files"); return props; } @@ -88,6 +90,9 @@ if (name == "Resample Quality") { return tr("Playback resampler type"); } + if (name == "Omit Temporaries from Recent Files") { + return tr("Omit Temporaries from Recent Files"); + } return name; } @@ -109,6 +114,9 @@ if (name == "Resample Quality") { return ValueProperty; } + if (name == "Omit Temporaries from Recent Files") { + return ToggleProperty; + } return InvalidProperty; } @@ -146,6 +154,10 @@ return m_resampleQuality; } + if (name == "Omit Temporaries from Recent Files") { + if (deflt) *deflt = 1; + } + return 0; } @@ -213,6 +225,8 @@ setWindowType(WindowType(value)); } else if (name == "Resample Quality") { setResampleQuality(value); + } else if (name == "Omit Temporaries from Recent Files") { + setOmitTempsFromRecentFiles(value ? true : false); } } @@ -284,3 +298,16 @@ emit propertyChanged("Resample Quality"); } } + +void +Preferences::setOmitTempsFromRecentFiles(bool omit) +{ + if (m_omitRecentTemps != omit) { + m_omitRecentTemps = omit; + QSettings settings; + settings.beginGroup("Preferences"); + settings.setValue("omit-recent-temporaries", omit); + settings.endGroup(); + emit propertyChanged("Omit Temporaries from Recent Files"); + } +}