aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2020-12-24 16:32:14 +1100
committerFelix Queißner <felix@ib-queissner.de>2020-12-24 09:21:59 +0100
commit237d3a8bc9ed6be7196115e0c7b640ca59349b1d (patch)
treeb038f16f524b409f42a4e4d815b36c5a5630265d /src/mainwindow.cpp
parenteb4b49245ece1bf1e3d04fcd25e6968b482ff285 (diff)
downloadkristall-237d3a8bc9ed6be7196115e0c7b640ca59349b1d.tar.gz
Add 'view source' to right-click context menu
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 706394e..6d1964a 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -143,6 +143,14 @@ void MainWindow::setUrlPreview(const QUrl &url)
}
}
+void MainWindow::viewPageSource()
+{
+ BrowserTab * tab = qobject_cast<BrowserTab*>(this->ui->browser_tabs->currentWidget());
+ if(tab != nullptr) {
+ tab->openSourceView();
+ }
+}
+
void MainWindow::on_browser_tabs_currentChanged(int index)
{
if(index >= 0) {
@@ -477,8 +485,5 @@ void MainWindow::on_actionManage_Certificates_triggered()
void MainWindow::on_actionShow_document_source_triggered()
{
- BrowserTab * tab = qobject_cast<BrowserTab*>(this->ui->browser_tabs->currentWidget());
- if(tab != nullptr) {
- tab->openSourceView();
- }
+ this->viewPageSource();
}