Open the last selected tab on restart

This commit is contained in:
fourtf
2018-04-10 15:59:53 +02:00
parent d0a71f37ed
commit c5a47ed24e
3 changed files with 26 additions and 8 deletions
+10
View File
@@ -186,6 +186,11 @@ void WindowManager::initialize()
tab->getTab()->useDefaultTitle = false;
}
// selected
if (tab_obj.value("selected").toBool(false)) {
window.getNotebook().select(tab);
}
// load splits
int colNr = 0;
for (QJsonValue column_val : tab_obj.value("splits").toArray()) {
@@ -251,6 +256,11 @@ void WindowManager::save()
tab_obj.insert("title", tab->getTab()->getTitle());
}
// selected
if (window->getNotebook().getSelectedPage() == tab) {
tab_obj.insert("selected", true);
}
// splits
QJsonArray columns_arr;
std::vector<std::vector<widgets::Split *>> columns = tab->getColumns();