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
This commit is contained in:
csoler 2014-11-02 20:21:01 +00:00
parent 16be0a16f9
commit d07a26f96d

View File

@ -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;