aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/browsertab.cpp10
-rw-r--r--src/mainwindow.cpp13
-rw-r--r--src/mainwindow.hpp2
-rw-r--r--src/mainwindow.ui2
4 files changed, 21 insertions, 6 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index 1c9bcd6..e88225b 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -1192,11 +1192,19 @@ void BrowserTab::on_text_browser_customContextMenuRequested(const QPoint &pos)
menu.addSeparator();
QAction * copy = menu.addAction("Copy to clipboard");
- copy->setShortcut(QKeySequence("Ctrl-C"));
+ copy->setShortcut(QKeySequence("Ctrl+C"));
connect(copy, &QAction::triggered, [this]() {
this->ui->text_browser->copy();
});
+ menu.addSeparator();
+
+ QAction * viewsrc = menu.addAction("View document source");
+ viewsrc->setShortcut(QKeySequence("Ctrl+U"));
+ connect(viewsrc, &QAction::triggered, [this]() {
+ mainWindow->viewPageSource();
+ });
+
menu.exec(ui->text_browser->mapToGlobal(pos));
}
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();
}
diff --git a/src/mainwindow.hpp b/src/mainwindow.hpp
index 6cfee9f..75e814b 100644
--- a/src/mainwindow.hpp
+++ b/src/mainwindow.hpp
@@ -32,6 +32,8 @@ public:
void setUrlPreview(QUrl const & url);
+ void viewPageSource();
+
private slots:
void on_browser_tabs_currentChanged(int index);
diff --git a/src/mainwindow.ui b/src/mainwindow.ui
index ea7c7cd..5698074 100644
--- a/src/mainwindow.ui
+++ b/src/mainwindow.ui
@@ -392,7 +392,7 @@
</action>
<action name="actionShow_document_source">
<property name="text">
- <string>Show document source</string>
+ <string>View document source</string>
</property>
</action>
</widget>