Mercurial > hg > octave-lyh
changeset 15460:7f36f7dc25b2
save and restore the columns order and width of the workspace-view
* workspace-view.cc: restore columns state in constructor and save in destructor
author | Torsten <ttl@justmail.de> |
---|---|
date | Sun, 30 Sep 2012 12:55:25 +0200 |
parents | 1cc42df8ede7 |
children | 1e64aff609c3 |
files | libgui/src/workspace-view.cc |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/workspace-view.cc +++ b/libgui/src/workspace-view.cc @@ -26,6 +26,7 @@ #include "workspace-view.h" #include "resource-manager.h" +#include <QHeaderView> #include <QHBoxLayout> #include <QVBoxLayout> #include <QPushButton> @@ -68,6 +69,10 @@ _explicit_collapse.global = settings->value ("workspaceview/global_collapsed", false).toBool ();; _explicit_collapse.persistent = settings->value ("workspaceview/persistent_collapsed", false).toBool ();; + // Initialize column order and width of the workspace + + _workspace_tree_view->header ()->restoreState (settings->value("workspaceview/column_state").toByteArray ()); + // Connect signals and slots. connect (this, SIGNAL (visibilityChanged (bool)), this, SLOT(handle_visibility_changed (bool))); @@ -94,6 +99,7 @@ settings->setValue("workspaceview/local_collapsed", _explicit_collapse.local); settings->setValue("workspaceview/global_collapsed", _explicit_collapse.global); settings->setValue("workspaceview/persistent_collapsed", _explicit_collapse.persistent); + settings->setValue("workspaceview/column_state", _workspace_tree_view->header ()->saveState ()); } void