diff base/Preferences.cpp @ 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 722bc705775a
children 98a480c5f410
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");
+    }
+}
+