mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 11:37:56 -04:00
Saves settings tab for reopen
Settings tab is saved to be reopened on startup.
This commit is contained in:
parent
60cc7f1dde
commit
9bd598b00e
@ -207,7 +207,9 @@ void KiwixApp::restoreTabs()
|
|||||||
{
|
{
|
||||||
for (const auto &zimUrl : tabsToOpen)
|
for (const auto &zimUrl : tabsToOpen)
|
||||||
{
|
{
|
||||||
if (zimUrl.isEmpty())
|
if (zimUrl == "SettingsTab")
|
||||||
|
getTabWidget()->openOrSwitchToSettingsTab();
|
||||||
|
else if (zimUrl.isEmpty())
|
||||||
getTabWidget()->createNewTab(true, true);
|
getTabWidget()->createNewTab(true, true);
|
||||||
else
|
else
|
||||||
openUrl(QUrl(zimUrl));
|
openUrl(QUrl(zimUrl));
|
||||||
|
@ -81,6 +81,7 @@ void TabBar::openOrSwitchToSettingsTab()
|
|||||||
insertTab(index,QIcon(":/icons/settings.svg"), gt("settings"));
|
insertTab(index,QIcon(":/icons/settings.svg"), gt("settings"));
|
||||||
setCloseTabButton(index);
|
setCloseTabButton(index);
|
||||||
setCurrentIndex(index);
|
setCurrentIndex(index);
|
||||||
|
KiwixApp::instance()->saveListOfOpenTabs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabBar::setStackedWidget(QStackedWidget *widget) {
|
void TabBar::setStackedWidget(QStackedWidget *widget) {
|
||||||
@ -275,6 +276,8 @@ QStringList TabBar::getTabUrls() const {
|
|||||||
{
|
{
|
||||||
if (ZimView* zv = qobject_cast<ZimView*>(mp_stackedWidget->widget(index)))
|
if (ZimView* zv = qobject_cast<ZimView*>(mp_stackedWidget->widget(index)))
|
||||||
idList.push_back(zv->getWebView()->url().url());
|
idList.push_back(zv->getWebView()->url().url());
|
||||||
|
else if (qobject_cast<SettingsView*>(mp_stackedWidget->widget(index)))
|
||||||
|
idList.push_back("SettingsTab");
|
||||||
}
|
}
|
||||||
return idList;
|
return idList;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user