changeset 593:aaa3be825207 integration_library

Merge from branch "toggle"
author mathieub <mathieu.barthet@eecs.qmul.ac.uk>
date Mon, 25 Jul 2011 18:55:57 +0100
parents 4806715f7a19 (current diff) 707d43018f59 (diff)
children 5fa210337bee
files
diffstat 2 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/view/ViewManager.cpp	Tue Jun 14 15:27:05 2011 +0100
+++ b/view/ViewManager.cpp	Mon Jul 25 18:55:57 2011 +0100
@@ -48,7 +48,8 @@
     m_illuminateLocalFeatures(true),
     m_showWorkTitle(false),
     m_lightPalette(QApplication::palette()),
-    m_darkPalette(QApplication::palette())
+    m_darkPalette(QApplication::palette()),
+    m_minimalModeEnabled(0)
 {
     QSettings settings;
     settings.beginGroup("MainWindow");
@@ -637,3 +638,19 @@
     return dark;
 }
 
+void
+ViewManager::setMinimalModeEnabled(bool enabled)
+{
+    if (m_minimalModeEnabled != enabled) {
+        m_minimalModeEnabled = enabled;
+        emit minimalModeEnabledChanged();
+        if (enabled) emit activity("Activates minimal mode");
+        else emit activity("Activates full mode");
+    }
+
+    QSettings settings;
+    settings.beginGroup("MainWindow");
+    settings.setValue("minimal-mode-enabled", m_minimalModeEnabled);
+    settings.endGroup();
+}
+
--- a/view/ViewManager.h	Tue Jun 14 15:27:05 2011 +0100
+++ b/view/ViewManager.h	Mon Jul 25 18:55:57 2011 +0100
@@ -188,6 +188,9 @@
     void setGlobalDarkBackground(bool dark);
     bool getGlobalDarkBackground() const;
 
+    void setMinimalModeEnabled(bool enable);
+    bool getMinimalModeEnabled() const { return m_minimalModeEnabled; };
+
 signals:
     /** Emitted when user causes the global centre frame to change. */
     void globalCentreFrameChanged(unsigned long frame);
@@ -238,6 +241,11 @@
     /** Emitted when any loggable activity has occurred. */
     void activity(QString);
 
+    /** Emitted when the view mode has been toggled. */
+    //no slot associated yet with this signal but may be useful;
+    //changes currently handled by the slot MainWindow::toggleViewMode()
+    void minimalModeEnabledChanged();
+
 public slots:
     void viewCentreFrameChanged(unsigned long, bool, PlaybackFollowMode);
     void viewZoomLevelChanged(unsigned long, bool);
@@ -297,6 +305,8 @@
     bool m_illuminateLocalFeatures;
     bool m_showWorkTitle;
 
+    bool m_minimalModeEnabled;
+
     QPalette m_lightPalette;
     QPalette m_darkPalette;
 };