From 237d3a8bc9ed6be7196115e0c7b640ca59349b1d Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Thu, 24 Dec 2020 16:32:14 +1100 Subject: Add 'view source' to right-click context menu --- src/mainwindow.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mainwindow.cpp') 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(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(this->ui->browser_tabs->currentWidget()); - if(tab != nullptr) { - tab->openSourceView(); - } + this->viewPageSource(); } -- cgit v1.2.3