From d07a26f96dc51b6ddba78c792cdcaa176cdbfc41 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Nov 2014 20:21:01 +0000 Subject: [PATCH] saving tool button position (patch from Phenom) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7659 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MainWindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 976f95f07..a49387514 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -226,10 +226,10 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags) //ui->stackPages->setCurrentIndex(Settings->getLastPageInMainWindow()); setNewPage(Settings->getLastPageInMainWindow()); /* Load listWidget postion */ - QByteArray geometry = Settings->valueFromGroup("MainWindow", "SplitterState", QByteArray()).toByteArray(); - if (geometry.isEmpty() == false) { - ui->splitter->restoreState(geometry); - } + QByteArray state = Settings->valueFromGroup("MainWindow", "SplitterState", QByteArray()).toByteArray(); + if (!state.isEmpty()) ui->splitter->restoreState(state); + state = Settings->valueFromGroup("MainWindow", "State", QByteArray()).toByteArray(); + if (!state.isEmpty()) restoreState(state); /** StatusBar section ********/ /* initialize combobox in status bar */ @@ -311,6 +311,7 @@ MainWindow::~MainWindow() Settings->setLastPageInMainWindow(ui->stackPages->currentIndex()); /* Save listWidget position */ Settings->setValueToGroup("MainWindow", "SplitterState", ui->splitter->saveState()); + Settings->setValueToGroup("MainWindow", "State", saveState()); delete peerstatus; delete natstatus;