mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-08-03 20:56:49 -04:00
openHomePage code to standalone function
This commit is contained in:
parent
a7c19105f9
commit
76bb8228ee
@ -41,11 +41,7 @@ TabBar::TabBar(QWidget *parent) :
|
|||||||
this->closeTab(currentIndex());
|
this->closeTab(currentIndex());
|
||||||
});
|
});
|
||||||
connect(getAction(KiwixApp::OpenHomePageAction), &QAction::triggered,
|
connect(getAction(KiwixApp::OpenHomePageAction), &QAction::triggered,
|
||||||
this, [=]() {
|
this, &TabBar::openHomePage);
|
||||||
auto current = this->currentWebView();
|
|
||||||
QUITIFNULL(current);
|
|
||||||
current->setUrl("zim://" + current->zimId() + ".zim/");
|
|
||||||
});
|
|
||||||
connect(getAction(KiwixApp::SettingAction), &QAction::triggered,
|
connect(getAction(KiwixApp::SettingAction), &QAction::triggered,
|
||||||
this, &TabBar::openOrSwitchToSettingsTab);
|
this, &TabBar::openOrSwitchToSettingsTab);
|
||||||
|
|
||||||
@ -66,6 +62,12 @@ TabBar::TabBar(QWidget *parent) :
|
|||||||
this, SLOT(onTabMoved(int,int)), Qt::DirectConnection);
|
this, SLOT(onTabMoved(int,int)), Qt::DirectConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabBar::openHomePage() {
|
||||||
|
auto current = this->currentWebView();
|
||||||
|
QUITIFNULL(current);
|
||||||
|
current->setUrl("zim://" + current->zimId() + ".zim/");
|
||||||
|
}
|
||||||
|
|
||||||
void TabBar::openOrSwitchToSettingsTab()
|
void TabBar::openOrSwitchToSettingsTab()
|
||||||
{
|
{
|
||||||
SettingsView* view = KiwixApp::instance()->getSettingsManager()->getView();
|
SettingsView* view = KiwixApp::instance()->getSettingsManager()->getView();
|
||||||
|
@ -62,6 +62,7 @@ signals:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void closeTab(int index);
|
void closeTab(int index);
|
||||||
|
void openHomePage();
|
||||||
void openOrSwitchToSettingsTab();
|
void openOrSwitchToSettingsTab();
|
||||||
void fullScreenRequested(QWebEngineFullScreenRequest request);
|
void fullScreenRequested(QWebEngineFullScreenRequest request);
|
||||||
void on_webview_titleChanged(const QString& title);
|
void on_webview_titleChanged(const QString& title);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user