1
0
Fork 0

GUI: save and restore deleted tab state

This commit is contained in:
Duncan Ogilvie 2017-12-18 02:03:14 +01:00
parent 0f1916cc2e
commit ed1dd3c6c1
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 13 additions and 0 deletions

View File

@ -540,6 +540,8 @@ void MainWindow::setTab(QWidget* widget)
return;
}
}
//TODO: restore configuration index
}
void MainWindow::loadTabDefaultOrder()
@ -608,7 +610,9 @@ void MainWindow::saveWindowSettings()
for(int i = 0; i < mWidgetList.size(); i++)
{
bool isDetached = detachedTabWindows.contains(mWidgetList[i].widget);
bool isDeleted = !isDetached && mTabWidget->indexOf(mWidgetList[i].widget) == -1;
BridgeSettingSetUint("Detached Windows", mWidgetList[i].nativeName.toUtf8().constData(), isDetached);
BridgeSettingSetUint("Deleted Tabs", mWidgetList[i].nativeName.toUtf8().constData(), isDeleted);
if(isDetached)
BridgeSettingSet("Tab Window Settings", mWidgetList[i].nativeName.toUtf8().constData(),
mWidgetList[i].widget->parentWidget()->saveGeometry().toBase64().data());
@ -649,6 +653,15 @@ void MainWindow::loadWindowSettings()
}
}
// 'Restore' deleted tabs
for(int i = 0; i < mWidgetList.size(); i++)
{
duint isDeleted = 0;
BridgeSettingGetUint("Deleted Tabs", mWidgetList[i].nativeName.toUtf8().constData(), &isDeleted);
if(isDeleted)
mTabWidget->DeleteTab(mTabWidget->indexOf(mWidgetList[i].widget));
}
mCpuWidget->loadWindowSettings();
mSymbolView->loadWindowSettings();
}