Mercurial > hg > octave-nkf
changeset 14997:2d6766e93f7b gui
The GUI now remembers when categories in the workspace view have been closed. Bug #36885
* workspace-view: Added code to save and load the state of collapsing categories.
author | Jacob Dawid <jacob.dawid@gmail.com> |
---|---|
date | Fri, 20 Jul 2012 16:45:10 -0400 |
parents | c2afeeb35f4d |
children | de3a318128f2 |
files | gui/src/workspace-view.cc gui/src/workspace-view.h |
diffstat | 2 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/src/workspace-view.cc +++ b/gui/src/workspace-view.cc @@ -16,6 +16,7 @@ */ #include "workspace-view.h" +#include "resource-manager.h" #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> @@ -49,10 +50,10 @@ widget ()->setLayout (layout); // Initialize collapse/expand state of the workspace subcategories. - _explicit_collapse.local = false; - _explicit_collapse.global = false; - _explicit_collapse.persistent = false; - _explicit_collapse.hidden = false; + _explicit_collapse.local = resource_manager::instance ()->get_settings ()->value ("workspaceview/local_collapsed", false).toBool (); + _explicit_collapse.global = resource_manager::instance ()->get_settings ()->value ("workspaceview/global_collapsed", false).toBool ();; + _explicit_collapse.persistent = resource_manager::instance ()->get_settings ()->value ("workspaceview/persistent_collapsed", false).toBool ();; + _explicit_collapse.hidden = resource_manager::instance ()->get_settings ()->value ("workspaceview/hidden_collapsed", false).toBool ();; // Connect signals and slots. connect (this, SIGNAL (visibilityChanged (bool)), @@ -71,6 +72,14 @@ } +workspace_view::~workspace_view () +{ + resource_manager::instance ()->get_settings ()->setValue("workspaceview/local_collapsed", _explicit_collapse.local); + resource_manager::instance ()->get_settings ()->setValue("workspaceview/global_collapsed", _explicit_collapse.global); + resource_manager::instance ()->get_settings ()->setValue("workspaceview/persistent_collapsed", _explicit_collapse.persistent); + resource_manager::instance ()->get_settings ()->setValue("workspaceview/hidden_collapsed", _explicit_collapse.hidden); +} + void workspace_view::handle_visibility_changed (bool visible) {