mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-08-03 12:46:29 -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());
|
||||
});
|
||||
connect(getAction(KiwixApp::OpenHomePageAction), &QAction::triggered,
|
||||
this, [=]() {
|
||||
auto current = this->currentWebView();
|
||||
QUITIFNULL(current);
|
||||
current->setUrl("zim://" + current->zimId() + ".zim/");
|
||||
});
|
||||
this, &TabBar::openHomePage);
|
||||
connect(getAction(KiwixApp::SettingAction), &QAction::triggered,
|
||||
this, &TabBar::openOrSwitchToSettingsTab);
|
||||
|
||||
@ -66,6 +62,12 @@ TabBar::TabBar(QWidget *parent) :
|
||||
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()
|
||||
{
|
||||
SettingsView* view = KiwixApp::instance()->getSettingsManager()->getView();
|
||||
|
@ -62,6 +62,7 @@ signals:
|
||||
|
||||
public slots:
|
||||
void closeTab(int index);
|
||||
void openHomePage();
|
||||
void openOrSwitchToSettingsTab();
|
||||
void fullScreenRequested(QWebEngineFullScreenRequest request);
|
||||
void on_webview_titleChanged(const QString& title);
|
||||
|
Loading…
x
Reference in New Issue
Block a user