# HG changeset patch # User Chris Cannam # Date 1202307309 0 # Node ID d31b4ccb7ddb98695ca13e8435db12d3d981dfb2 # Parent d77e1fa49e26fe4b35a8406e66f09dc3a3910c37 * 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) diff -r d77e1fa49e26 -r d31b4ccb7ddb base/Preferences.cpp --- 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"); + } +} + diff -r d77e1fa49e26 -r d31b4ccb7ddb base/Preferences.h --- 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