From 697f5cae65577dcdf01cfa85840de8d44d835358 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Thu, 27 Jul 2023 17:32:08 -0700 Subject: [PATCH] Add keyboard shortcuts for the URL toolbar actions. https://redmine.stoutner.com/issues/1037 --- doc/index.docbook | 76 ++++++++++++++++++++++++++++++++++- src/ui.rcs/browserwindowui.rc | 4 ++ src/windows/BrowserWindow.cpp | 14 +++++-- 3 files changed, 90 insertions(+), 4 deletions(-) diff --git a/doc/index.docbook b/doc/index.docbook index a784979..9a41b3e 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -722,6 +722,65 @@ On-The-Fly Settings + + + + + + + &Ctrl;J + + On-The-Fly Settings + JavaScript + + + + + + Toggle JavaScript in the current tab. + + + + + + + + + + &Ctrl;L + + On-The-Fly Settings + Local Storage + + + + + + Toggle local storage in the current tab. + + + + + + + + + + &Ctrl;D + + On-The-Fly Settings + DOM Storage + + + + + + Toggle DOM storage in the current tab. + + + + + User Agent @@ -1093,7 +1152,7 @@ - &Ctrl;D + &Ctrl;&Shift;D Settings Domain Settings @@ -1145,6 +1204,21 @@ Other Commands + + + + + &Ctrl;+S + + + + + + Toggle find case sensitive if the find toolbar is visible. + + + + diff --git a/src/ui.rcs/browserwindowui.rc b/src/ui.rcs/browserwindowui.rc index 7a9e090..1a79d69 100644 --- a/src/ui.rcs/browserwindowui.rc +++ b/src/ui.rcs/browserwindowui.rc @@ -50,6 +50,10 @@ On-The-Fly Settings + + + + diff --git a/src/windows/BrowserWindow.cpp b/src/windows/BrowserWindow.cpp index 1277e77..b897aa9 100644 --- a/src/windows/BrowserWindow.cpp +++ b/src/windows/BrowserWindow.cpp @@ -181,7 +181,7 @@ BrowserWindow::BrowserWindow(bool firstWindow) : KXmlGuiWindow() localStorageActionPointer->setText(i18nc("The Local Storage action", "Local Storage")); domStorageActionPointer->setText(i18nc("DOM Storage action", "DOM Storage")); findCaseSensitiveActionPointer->setText(i18nc("Find Case Sensitive action", "Find Case Sensitive")); - hideFindTextActionPointer->setText(i18nc("Hide Find Text action", "Hide Find Text")); + hideFindTextActionPointer->setText(i18nc("Hide Find Text action (the text should include the language-specific escape keyboard shortcut).", "Hide Find Text (Esc)")); // Set the action icons. Gnome doesn't contain some of the icons that KDE has. // The toolbar icons don't pick up unless the size is explicit, probably because the toolbar ends up being an intermediate size. @@ -224,6 +224,10 @@ BrowserWindow::BrowserWindow(bool firstWindow) : KXmlGuiWindow() QKeySequence ctrlUKeySequence = QKeySequence(i18nc("The view source key sequence.", "Ctrl+U")); QKeySequence ctrlShiftUKeySequence = QKeySequence(i18nc("The view source in new tab key sequence.", "Ctrl+Shift+U")); QKeySequence ctrlShiftPKeySequence = QKeySequence(i18nc("The print preview key sequence.", "Ctrl+Shift+P")); + QKeySequence ctrlJKeySequence = QKeySequence(i18nc("The JavaScript key sequence.", "Ctrl+J")); + QKeySequence ctrlLKeySequence = QKeySequence(i18nc("The local storage key sequence.", "Ctrl+L")); + QKeySequence ctrlDKeySequence = QKeySequence(i18nc("The DOM storage key sequence.", "Ctrl+D")); + QKeySequence ctrlSKeySequence = QKeySequence(i18nc("The find case sensitive key sequence.", "Ctrl+S")); QKeySequence ctrlAltPKeySequence = QKeySequence(i18nc("The Privacy Browser user agent key sequence.", "Ctrl+Alt+P")); QKeySequence ctrlAltWKeySequence = QKeySequence(i18nc("The WebEngine Default user agent key sequence.", "Ctrl+Alt+W")); QKeySequence ctrlAltFKeySequence = QKeySequence(i18nc("The Firefox on Linux user agent key sequence.", "Ctrl+Alt+F")); @@ -241,7 +245,7 @@ BrowserWindow::BrowserWindow(bool firstWindow) : KXmlGuiWindow() QKeySequence ctrlShiftBKeySequence = QKeySequence(i18nc("The Bing search engine key sequence.", "Ctrl+Shift+B")); QKeySequence ctrlShiftYKeySequence = QKeySequence(i18nc("The Yahoo search engine key sequence.", "Ctrl+Shift+Y")); QKeySequence ctrlShiftCKeySequence = QKeySequence(i18nc("The custom search engine key sequence.", "Ctrl+Shift+C")); - QKeySequence ctrlDKeySequence = QKeySequence(i18nc("The domain settings key sequence.", "Ctrl+D")); + QKeySequence ctrlShiftDKeySequence = QKeySequence(i18nc("The domain settings key sequence.", "Ctrl+Shift+D")); QKeySequence ctrlSemicolonKeySequence = QKeySequence(i18nc("The cookies dialog key sequence.", "Ctrl+;")); // Set the action key sequences. @@ -252,6 +256,10 @@ BrowserWindow::BrowserWindow(bool firstWindow) : KXmlGuiWindow() actionCollectionPointer->setDefaultShortcut(viewSourceActionPointer, ctrlUKeySequence); actionCollectionPointer->setDefaultShortcut(viewSourceInNewTabActionPointer, ctrlShiftUKeySequence); actionCollectionPointer->setDefaultShortcut(printPreviewActionPointer, ctrlShiftPKeySequence); + actionCollectionPointer->setDefaultShortcut(javaScriptActionPointer, ctrlJKeySequence); + actionCollectionPointer->setDefaultShortcut(localStorageActionPointer, ctrlLKeySequence); + actionCollectionPointer->setDefaultShortcut(domStorageActionPointer, ctrlDKeySequence); + actionCollectionPointer->setDefaultShortcut(findCaseSensitiveActionPointer, ctrlSKeySequence); actionCollectionPointer->setDefaultShortcut(userAgentPrivacyBrowserActionPointer, ctrlAltPKeySequence); actionCollectionPointer->setDefaultShortcut(userAgentWebEngineDefaultActionPointer, ctrlAltWKeySequence); actionCollectionPointer->setDefaultShortcut(userAgentFirefoxLinuxActionPointer, ctrlAltFKeySequence); @@ -269,7 +277,7 @@ BrowserWindow::BrowserWindow(bool firstWindow) : KXmlGuiWindow() actionCollectionPointer->setDefaultShortcut(searchEngineBingActionPointer, ctrlShiftBKeySequence); actionCollectionPointer->setDefaultShortcut(searchEngineYahooActionPointer, ctrlShiftYKeySequence); actionCollectionPointer->setDefaultShortcut(searchEngineCustomActionPointer, ctrlShiftCKeySequence); - actionCollectionPointer->setDefaultShortcut(domainSettingsActionPointer, ctrlDKeySequence); + actionCollectionPointer->setDefaultShortcut(domainSettingsActionPointer, ctrlShiftDKeySequence); actionCollectionPointer->setDefaultShortcut(cookiesActionPointer, ctrlSemicolonKeySequence); // Execute the actions. -- 2.45.2