Mercurial > hg > svcore
changeset 372:d31b4ccb7ddb
* Update remaining editable layers to support proper realignment on copy/paste
* Permit pasting when no suitable layer is current: create a new layer on paste
* Add preference for showing the splash screen or not
* Rename spectrogram smoothing prefs (partly following Craig's suggestions)
author | Chris Cannam |
---|---|
date | Wed, 06 Feb 2008 14:15:09 +0000 |
parents | d77e1fa49e26 |
children | 0a44caddd9fe |
files | base/Preferences.cpp base/Preferences.h |
diffstat | 2 files changed, 38 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/base/Preferences.cpp Wed Feb 06 12:49:49 2008 +0000 +++ b/base/Preferences.cpp Wed Feb 06 14:15:09 2008 +0000 @@ -46,7 +46,8 @@ m_tempDirRoot(""), m_resampleOnLoad(false), m_viewFontSize(10), - m_backgroundMode(BackgroundFromTheme) + m_backgroundMode(BackgroundFromTheme), + m_showSplash(true) { QSettings settings; settings.beginGroup("Preferences"); @@ -64,6 +65,7 @@ m_viewFontSize = settings.value ("view-font-size", int(QApplication::font().pointSize() * 0.9)) .toInt(); + m_showSplash = settings.value("show-splash", true).toBool(); settings.endGroup(); settings.beginGroup("TempDirectory"); @@ -89,6 +91,7 @@ props.push_back("Temporary Directory Root"); props.push_back("Background Mode"); props.push_back("View Font Size"); + props.push_back("Show Splash Screen"); return props; } @@ -96,7 +99,7 @@ Preferences::getPropertyLabel(const PropertyName &name) const { if (name == "Spectrogram Smoothing") { - return tr("Spectrogram y-axis smoothing:"); + return tr("Spectrogram y-axis interpolation:"); } if (name == "Tuning Frequency") { return tr("Frequency of concert A"); @@ -125,6 +128,9 @@ if (name == "View Font Size") { return tr("Font size for text overlays"); } + if (name == "Show Splash Screen") { + return tr("Show splash screen on startup"); + } return name; } @@ -162,6 +168,9 @@ if (name == "View Font Size") { return RangeProperty; } + if (name == "Show Splash Screen") { + return ToggleProperty; + } return InvalidProperty; } @@ -217,6 +226,10 @@ return int(m_viewFontSize); } + if (name == "Show Splash Screen") { + if (deflt) *deflt = 1; + } + return 0; } @@ -251,8 +264,8 @@ if (name == "Spectrogram Smoothing") { switch (value) { case NoSpectrogramSmoothing: return tr("None - blocky but accurate"); - case SpectrogramInterpolated: return tr("Interpolate - fast but fuzzy"); - case SpectrogramZeroPadded: return tr("Zero pad FFT - slow but clear"); + case SpectrogramInterpolated: return tr("Linear - fast but fuzzy"); + case SpectrogramZeroPadded: return tr("4 x Oversampled - slow but clear"); } } if (name == "Background Mode") { @@ -297,6 +310,8 @@ setBackgroundMode(BackgroundMode(value)); } else if (name == "View Font Size") { setViewFontSize(value); + } else if (name == "Show Splash Screen") { + setShowSplash(value ? true : false); } } @@ -441,3 +456,18 @@ } } +void +Preferences::setShowSplash(bool show) +{ + if (m_showSplash != show) { + + m_showSplash = show; + + QSettings settings; + settings.beginGroup("Preferences"); + settings.setValue("show-splash", show); + settings.endGroup(); + emit propertyChanged("Show Splash Screen"); + } +} +
--- a/base/Preferences.h Wed Feb 06 12:49:49 2008 +0000 +++ b/base/Preferences.h Wed Feb 06 14:15:09 2008 +0000 @@ -69,6 +69,8 @@ }; BackgroundMode getBackgroundMode() const { return m_backgroundMode; } + bool getShowSplash() const { return m_showSplash; } + public slots: virtual void setProperty(const PropertyName &, int); @@ -82,6 +84,7 @@ void setResampleOnLoad(bool); void setBackgroundMode(BackgroundMode mode); void setViewFontSize(int size); + void setShowSplash(bool); private: Preferences(); // may throw DirectoryCreationFailed @@ -99,6 +102,7 @@ bool m_resampleOnLoad; int m_viewFontSize; BackgroundMode m_backgroundMode; + bool m_showSplash; }; #endif