From 3b22acd838008fd54234acc475edca434510b501 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Tue, 10 Oct 2023 12:28:18 -0700 Subject: [PATCH] Add bookmarks. https://redmine.stoutner.com/issues/968 --- doc/index.docbook | 3351 ++++++++++++++++--------------- src/dialogs/AddBookmarkDialog.h | 2 +- src/dialogs/AddFolderDialog.h | 2 +- src/main.cpp | 2 +- src/ui.rcs/browserwindowui.rc | 4 - src/windows/BrowserWindow.cpp | 119 +- src/windows/BrowserWindow.h | 6 +- 7 files changed, 1835 insertions(+), 1651 deletions(-) diff --git a/doc/index.docbook b/doc/index.docbook index a89f652..fd5d536 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -23,1646 +23,1829 @@ - - - Translatable Entity"> - ]> - - The &privacybrowser; Handbook - - - &Soren.Stoutner; &Soren.Stoutner.mail; - - - - - - 2016-2017, 2021-2023 - &Soren.Stoutner; - - - - &FDLNotice; - - - 2023-06-13 - - - &privacybrowser; version 0.4 - - - - - - &privacybrowser; is a web browser that respects your privacy. - - - - The only way to prevent data from being abused is to prevent it from being collected in the first place. - - - - - - KDE - privacy - browser - - - - - - Introduction - - - &privacybrowser; is currently in an early alpha state. - Most of the features are not yet implemented, but I thought it would be useful to publish it so that users can track the progress and submit feedback. - - - - To distinguish between the Android and the PC version, the website, issue tracker, - and code base refer to this version as Privacy Browser PC. - - - - The best place to discuss the development of Privacy Browser is on the forum. - I also frequently post on my Mastodon account regarding the development status. - - - - - Qt WebEngine - - - Privacy Browser uses Qt WebEngine to render websites. - Qt WebEngine is based on the Chromium Blink source code. - Because Privacy Browser is built on the KDE Framework, - it currently uses the Qt 5 packages. - - - - The current Qt 5 packages are in long-term support mode. - From a feature perspective, Qt WebEngine 5.15.x is based on Chromium 87.0.4280.144. - Security fixes are backported every few months with each release. - - + + The &privacybrowser; Handbook - - - Bugs and Missing Features - - - There is a list of feature requests and known bugs at redmine.stoutner.com. - Users should anticipate that all the current features of Privacy Browser Android - will also be implemented in Privacy Browser PC. - There is no need at this point to create features requests for these as they will be added as I start working on each feature and have a better idea of how they will be implemented. - However, each feature that has already been implemented should be bug free. - If you discover a bug that is not already documented at redmine.stoutner.com please add it. - - - - Below is a list of known prominent bugs or missing features in this alpha release. - - - - The page zoom is momentarily reset every time a new URL is loaded. - If domain settings change the user agent, loading of the new URL is interrupted and the - previous site is reloaded. - Browser error messages are not displayed unless JavaScript is enabled. - Bookmarks are not yet implemented. - Blocklists are not yet implemented. - - - - - - - Using &privacybrowser; - - - - - - - - Screenshot - - - - - - - JavaScript - - - JavaScript allows web pages to run scripts (programs) on your device. It allows web pages to function more like apps, but it also allows web pages to spy on you. - Most of the tracking on the internet does not work when JavaScript is disabled. - JavaScript can be toggled by clicking on the privacy shield, which is blue if JavaScript is disabled and red when it is enabled. - - - - - - JavaScript - - - - + + &Soren.Stoutner; &Soren.Stoutner.mail; - - - Local Storage + + - - Local storage - in Privacy Browser encompasses cookies, DOM storage, IndexedDB, service workers, and the filesystem API. - Local storage can be toggled through an action on the toolbar. - + + 2016-2017, 2021-2023 + &Soren.Stoutner; + - - - Cookies + + &FDLNotice; - - Cookies - allow websites to store small pieces of information for a specific host that are sent in the HTTP header every time the browser connects to that host. - Privacy Browser allows a maximum of 180 cookies with a maximum size of 4096 bytes per cookie to be set per domain. - Cookies are often used to track users across the web, particularly third-party cookies (which are completely blocked in Privacy Browser). - They are also used as a security mechanism on websites where you log in to identify it is you as you browse from page to page on a site. - + + 2023-10-10 - - - - - - - Cookies - - - + + &privacybrowser; version 0.5 - - The cookies dialog is opened from . - Durable cookies are shared with all tabs that are opened after they are made durable and are preserved even when Privacy Browser is restarted. - This allows users to stay logged in to sites of their choosing. No cookies are durable by default. Making a cookie durable requires specific user interaction. - + + + + &privacybrowser; is a web browser that respects your privacy. + - - All other cookies are specific to the tab where they are created and are destroyed when the tab is closed. - - + + The only way to prevent data from being abused is to prevent it from being collected in the first place. + + + + + + KDE + privacy + browser + + - - - DOM storage + + + Introduction - DOM (Document Object Model) storage, also knows as web storage, allows web pages to store information on a client device. - The storage capacity is larger than for cookies and the data is not automatically sent in the headers with every HTTP request. - In Privacy Browser, each website is allowed to store a 5 MB of data in DOM storage. - DOM storage requires JavaScript to function, and, in addition, requires an extra toggle to be enabled. - In Privacy Browser, DOM storage is limited to the tab where it is created and is destroyed when the tab is closed. + &privacybrowser; is currently in an early alpha state. + Most of the features are not yet implemented, but I thought it would be useful to publish it so that users can track the progress and submit feedback. - - - - - IndexedDB - IndexedDB - provides web pages with a local database where they can store “significant amounts of structured data”. - There is disagreement on the internet about the maximum size of an IndexedDB database, probably because the various rendering engines keep changing their mind. - But it is usually listed at somewhere between 20% and 80% of your entire hard drive with each individual domain limited to some segment of that. - IndexedDB requires JavaScript to function. - In Privacy Browser, this database is limited to the tab where it is created and is destroyed when the tab is closed. + To distinguish between the Android and the PC version, the website, issue tracker, + and code base refer to this version as Privacy Browser PC. - - - - - Service Workers - Service workers are offline JavaScript proxies of a website. They have their own cache that is usually hidden and hard to clear. - They were designed by people who want the web browser to become the operating system and run full “apps”. - In Privacy Browser, service workers are limited to the tab where they are created and are destroyed when the tab is closed. + The best place to discuss the development of Privacy Browser is on the forum. + I also frequently post on my Mastodon account regarding the development status. - - - - Filesystem API + + + Qt WebEngine + + + Privacy Browser uses Qt WebEngine to render websites. + Qt WebEngine is based on the Chromium Blink source code. + Because Privacy Browser is built on the KDE Framework, + it currently uses the Qt 5 packages. + + + + The current Qt 5 packages are in long-term support mode. + From a feature perspective, Qt WebEngine 5.15.x is based on Chromium 87.0.4280.144. + Security fixes are backported every few months with each release. + + + + + + Bugs and Missing Features + + + There is a list of feature requests and known bugs at redmine.stoutner.com. + Users should anticipate that all the current features of Privacy Browser Android + will also be implemented in Privacy Browser PC. + There is no need at this point to create features requests for these as they will be added as I start working on each feature and have a better idea of how they will be implemented. + However, each feature that has already been implemented should be bug free. + If you discover a bug that is not already documented at redmine.stoutner.com please add it. + + + + Below is a list of known prominent bugs or missing features in this alpha release. + + + + The page zoom is momentarily reset every time a new URL is loaded. + If domain settings change the user agent, loading of the new URL is interrupted and the + previous site is reloaded. + Browser error messages are not displayed unless JavaScript is enabled. + Filter lists are not yet implemented. + + + + + + + Using &privacybrowser; - The filesystem API grants the browser direct access to the files on your system. - Like service workers, the filesystem API is a summarily bad idea thought up by those who want the browser to become an operating system. - Even when JavaScript and local storage are enabled, the filesystem API does not work in Privacy Browser. + + + + + + + Screenshot + + - - - - - - User Agent - - - The user agent is a text string that is sent as part of every HTTP header that identifies the browser to the web server. - Privacy Browser's default user agent is PrivacyBrowser/1.0. - Qt WebEngine 5.15.12’s default user agent is Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.15.12 Chrome/87.0.4280.144 Safari/537.36. - - - - Over the years user agents have become quite lengthy, - partially because they tend to include a brief history of the internet. - In the modern world they serve almost no good purpose, but some web developers still think they need them so they can send different version of their website to different browsers. - Some servers refuse to function correctly if they don't like the user agent that is sent. - - - - At some point in the future Privacy Browser will send no user agent by default. - Not only is that currently impossible because the Qt WebEngine doesn't allow you to not send a user agent (I will probably have to fork it to enable that functionality), - but even web servers that don't care what the user agent is often refuse to send an answer if there is no user agent at all. - Getting rid of this relic of the internet is going to take some time and a retraining of common expectations. - - - - - - Domain Settings - - - Domain setting make it easy to automatically change JavaScript, local storage, user agent, and other settings when the domain changes. - Domain settings for the current domain can be accessed through the domain settings button at the far right of the URL line edit. - Domain settings for all domains can be accessed through . When domain settings are active, the URL line edit will have a green background. - - - - - - HTTP Pings - - - HTTP hyperlinks can have an extra ping attribute that sends a POST request to a different URL. - These HTTP pings are commonly used for tracking. - Most browsers send HTTP pings without informing the user - in any way - (despite what The Register article says, current versions of FireFox also happily send HTTP pings). - - - - Privacy Browser blocks all HTTP pings and presents a dialog informing the user every time the current tab attempts to send one. - Hopefully, as more people become aware of what HTTP pings are, web sites will become more embarrassed about using them. - This is a classic example of how those who wrote the HTTP specs do not have the best interests of internet users at heart. I would like the day to come when this is removed from both the internet and the spec. - Here is an example of me raising the issue with F-Droid. - - - - - - Spell Checking - - - Privacy Browser uses the binary .bdic Hunspell dictionary format utilized by Qt WebEngine - which was created by Google for Chromium. - Debian’s Hunspell dictionary language packages are slowly adding support for the .bdic format. Those which have are listed by Privacy Browser as suggested packages. - - - Once a .bdic dictionary is installed, it can be enabled in Privacy Browser’s settings. - - - - - - - Command Reference - - - - Main Window - - - - File - - - - - - - - &Ctrl;T - - File - New Tab - - - - - - Create a new tab. - - - - - - - - - - &Ctrl;N - - File - New Window - - - - - - Create a new window. - - - - - - - - - - &Ctrl;P - - File - Print - - - - - - Print the document. - - - - - - - - - - &Ctrl;&Shift;P - - File - Print Preview - - - - - - Display the print preview dialog. - - - - - - - - - - &Ctrl;Q - - File - Quit - - - - - - Quit &privacybrowser;. - - - - - - - - - Edit - - - - - - - - &Ctrl;F - - Edit - Find - - - - - - Display the find toolbar and focus the find text line edit. If the toolbar is already displayed, the find text line edit is refocused and the text it contains is selected. - - - - - - - - - - - F3 - - Edit - Find Next - - - - - - Find the next entry on the page that matches the specified text. This action is only displayed if the find toolbar is visible. - - - - - - - - - - &Shift;F3 - - Edit - Find Previous - - - - - - Find the previous entry on the page that matches the specified text. This action is only displayed if the find toolbar is visible. - - - - - - - - - View - - - - - - - - &Ctrl;+ - - View - Zoom In - - - - - - Increment the zoom factor by 0.25. Valid factors range from 0.25 to 5.00. - - - - - - - - - - - &Ctrl;- - - View - Zoom Out - - - - - - Decrement the zoom factor by 0.25. Valid factors range from 0.25 to 5.00. - - - - - - - - - - F5 - - View - Refresh - - - - - - Reload the website in the current tab. - - - - - - - - - - &Ctrl;F5 - - View - Reload and Bypass Cache - - - - - - Reload the website in the current tab bypassing any information in the cache and loading everything from the webserver. - - - - - - - - - - &Ctrl;U - - View - View Source - - - - - - Toggle between viewing the source and viewing the rendered website. - - - - - - - - - - &Ctrl;&Shift;U - - View - View Source in New Tab> - - - - - - Open a new tab displaying the source of the current tab, or a new tab displaying the rendered version if the source is already displayed. Note that right-clicking on the background of a rendered website will display a context menu with a "View page source" entry, which performs the first of these actions. - - - - - - - - - - &Ctrl;&Shift;F - - View - Full Screen Mode - - - - - - Toggle full screen mode. This performs the same action as . - - - - - - - - - Go - - - - - - - - &Alt;Left - - Go - Back - - - - - - Navigate back one step in the current tab’s history. The action is disabled if it is not possible to go back. - - - - - - - - - - &Alt;Right - - Go - Forward - - - - - - Navigate forward one step in the current tab’s history. The action is disabled if it is not possible to go forward. - - - - - - - - - - &Alt;Home - - Go - Home - - - - - - Load the home page in the current tab. - - - - - - - - - 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. - - - - + + + JavaScript + + + JavaScript allows web pages to run scripts (programs) on your device. It allows web pages to function more like apps, but it also allows web pages to spy on you. + Most of the tracking on the internet does not work when JavaScript is disabled. + JavaScript can be toggled by clicking on the privacy shield, which is blue if JavaScript is disabled and red when it is enabled. + + + + + + + JavaScript + + + + + + + + Local Storage + + + Local storage + in Privacy Browser encompasses cookies, DOM storage, IndexedDB, service workers, and the filesystem API. + Local storage can be toggled through an action on the toolbar. + + + + + Cookies - - - User Agent - - - - - - - - &Ctrl;&Alt;P - - On-The-Fly Settings - User Agent - Privacy Browser - - - - - - Use the Privacy Browser user agent for the current tab. - - - - - - - - - - &Ctrl;&Alt;W - - On-The-Fly Settings - User Agent - WebEngine Default - - - - - - Use the WebEngine Default user agent for the current tab. - - - - - - - - - - &Ctrl;&Alt;F - - On-The-Fly Settings - User Agent - Firefox on Linux - - - - - - Use the Firefox on Linux user agent for the current tab. - - - - - - - - - - &Ctrl;&Alt;C - - On-The-Fly Settings - User Agent - Chromium on Linux - - - - - - Use the Chromium on Linux user agent for the current tab. - - - - - - - - - - &Ctrl;&Alt;&Shift;F - - On-The-Fly Settings - User Agent - Firefox on Windows - - - - - Use the Firefox on Windows user agent for the current tab. + Cookies + allow websites to store small pieces of information for a specific host that are sent in the HTTP header every time the browser connects to that host. + Privacy Browser allows a maximum of 180 cookies with a maximum size of 4096 bytes per cookie to be set per domain. + Cookies are often used to track users across the web, particularly third-party cookies (which are completely blocked in Privacy Browser). + They are also used as a security mechanism on websites where you log in to identify it is you as you browse from page to page on a site. - - - - - - - - - &Ctrl;&Alt;&Shift;C - - On-The-Fly Settings - User Agent - Chrome on Windows - - - - - - Use the Chrome on Windows user agent for the current tab. - - - - - - - - - - &Ctrl;&Alt;E - - On-The-Fly Settings - User Agent - Edge on Windows - - - - - - Use the Edge on Windows user agent for the current tab. - - - - - - - - - - &Ctrl;&Alt;S - - On-The-Fly Settings - User Agent - Safari on macOS - - - - - - Use the Safari on macOS user agent for the current tab. - - - - - - - - - - &Alt;&Shift;C - - On-The-Fly Settings - User Agent - Custom - - - - - - Use the custom user agent for the current tab. This action is only active if a custom user agent is set in the settings. - - - - - - - - - Zoom - - - - - - - - &Ctrl;&Alt;Z - - On-The-Fly Settings - Zoom Factor - - - - + - Display the zoom factor dialog. + + + + + + + Cookies + + - - - - - - - - Search Engine - - - - - - - - &Ctrl;&Shift;M - - On-The-Fly Settings - Search Engine - Mojeek - - - - + - Use Mojeek as the search engine. + The cookies dialog is opened from . + Durable cookies are shared with all tabs that are opened after they are made durable and are preserved even when Privacy Browser is restarted. + This allows users to stay logged in to sites of their choosing. No cookies are durable by default. Making a cookie durable requires specific user interaction. - - - - - - - - - &Ctrl;&Shift;O - - On-The-Fly Settings - Search Engine - Monocles - - - - + - Use Mojeek as the search engine. + All other cookies are specific to the tab where they are created and are destroyed when the tab is closed. - - - - - - - - - &Ctrl;&Shift;E - - On-The-Fly Settings - Search Engine - MetaGer - - - - + + + + + DOM storage + - Use MetaGer as the search engine. + DOM (Document Object Model) storage, also knows as web storage, + allows web pages to store information on a client device. + The storage capacity is larger than for cookies and the data is not automatically sent in the headers with every HTTP request. + In Privacy Browser, each website is allowed to store a 5 MB of data in DOM storage. + DOM storage requires JavaScript to function, and, in addition, requires an extra toggle to be enabled. + In Privacy Browser, DOM storage is limited to the tab where it is created and is destroyed when the tab is closed. - - - - - - - - - &Ctrl;&Shift;G - - On-The-Fly Settings - Search Engine - Google - - - - + + + + + IndexedDB + - Use Google as the search engine. + IndexedDB + provides web pages with a local database where they can store “significant amounts of structured data”. + There is disagreement on the internet about the maximum size of an IndexedDB database, probably because the various rendering engines keep changing their mind. + But it is usually listed at somewhere between 20% and 80% of your entire hard drive with each individual domain limited to some segment of that. + IndexedDB requires JavaScript to function. + In Privacy Browser, this database is limited to the tab where it is created and is destroyed when the tab is closed. - - - - - - - - - &Ctrl;&Shift;B - - On-The-Fly Settings - Search Engine - Bing - - - - + + + + + Service Workers + - Use Bing as the search engine. + Service workers are offline JavaScript proxies of a website. + They have their own cache that is usually hidden and hard to clear. + They were designed by people who want the web browser to become the operating system and run full “apps”. + In Privacy Browser, service workers are limited to the tab where they are created and are destroyed when the tab is closed. - - - - - - - - - &Ctrl;&Shift;Y - - On-The-Fly Settings - Search Engine - Yahoo - - - - + + + + + Filesystem API + - Use Yahoo as the search engine. + The filesystem API grants the browser direct access to the files on your system. + Like service workers, the filesystem API is a summarily bad idea thought up by those who want the browser to become an operating system. + Even when JavaScript and local storage are enabled, the filesystem API does not work in Privacy Browser. - - - - - - - - - &Ctrl;&Shift;C - - On-The-Fly Settings - Search Engine - Custom - - - - + + + + + + User Agent + + + The user agent is a text string that is sent as part of every HTTP header that identifies the browser to the web server. + Privacy Browser's default user agent is PrivacyBrowser/1.0. + Qt WebEngine 5.15.15’s default user agent is Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.15.15 Chrome/87.0.4280.144 Safari/537.36. + + + + Over the years user agents have become quite lengthy, + partially because they tend to include a brief history of the internet. + In the modern world they serve almost no good purpose, but some web developers still think they need them so they can send different version of their website to different browsers. + Some servers refuse to function correctly if they don't like the user agent that is sent. + + + + At some point in the future Privacy Browser will send no user agent by default. + Not only is that currently impossible because the Qt WebEngine doesn't allow you to not send a user agent (I will probably have to fork it to enable that functionality), + but even web servers that don't care what the user agent is often refuse to send an answer if there is no user agent at all. + Getting rid of this relic of the internet is going to take some time and a retraining of common expectations. + + + + + + Domain Settings + + + Domain setting make it easy to automatically change JavaScript, local storage, user agent, and other settings when the domain changes. + Domain settings for the current domain can be accessed through the domain settings button at the far right of the URL line edit. + Domain settings for all domains can be accessed through . When domain settings are active, the URL line edit will have a green background. + + + + + + HTTP Pings + + + HTTP hyperlinks can have an extra ping attribute that sends a POST request to a different URL. + These HTTP pings are commonly used for tracking. + Most browsers send HTTP pings without informing the user + in any way + (despite what The Register article says, current versions of FireFox also happily send HTTP pings). + + + + Privacy Browser blocks all HTTP pings and presents a dialog informing the user every time the current tab attempts to send one. + Hopefully, as more people become aware of what HTTP pings are, web sites will become more embarrassed about using them. + This is a classic example of how those who wrote the HTTP specs do not have the best interests of internet users at heart. + I would like the day to come when this is removed from both the internet and the spec. + Here is an example of me raising the issue with F-Droid. + + + + + + Spell Checking + + + Privacy Browser uses the binary .bdic Hunspell dictionary format + utilized by Qt WebEngine + which was created by Google for Chromium. + Debian’s Hunspell dictionary language packages are slowly adding support for the .bdic format. Those which have are listed by Privacy Browser as suggested packages. + + + + Once a .bdic dictionary is installed, it can be enabled in Privacy Browser’s settings. + + + + + + + Command Reference + + + + Main Window + + + + File + + + + + + + + &Ctrl;T + + + File + + New Tab + + + + + + Create a new tab. + + + + + + + + + + &Ctrl;N + + + File + + New Window + + + + + + Create a new window. + + + + + + + + + + &Ctrl;P + + + File + + Print + + + + + + Print the document. + + + + + + + + + + &Ctrl;&Shift;P + + + File + + Print Preview + + + + + + Display the print preview dialog. + + + + + + + + + + &Ctrl;Q + + + File + + Quit + + + + + + Quit &privacybrowser;. + + + + + + + + + Edit + + + + + + + + &Ctrl;F + + + Edit + + Find + + + + + + Display the find toolbar and focus the find text line edit. If the toolbar is already displayed, the find text line edit is refocused and the text it contains is selected. + + + + + + + + + + + F3 + + + Edit + + Find Next + + + + + + Find the next entry on the page that matches the specified text. This action is only displayed if the find toolbar is visible. + + + + + + + + + + &Shift;F3 + + + Edit + + Find Previous + + + + + + Find the previous entry on the page that matches the specified text. This action is only displayed if the find toolbar is visible. + + + + + + + + + View + + + + + + + + &Ctrl;+ + + + View + + Zoom In + + + + + + Increment the zoom factor by 0.25. Valid factors range from 0.25 to 5.00. + + + + + + + + + + + &Ctrl;- + + + View + + Zoom Out + + + + + + Decrement the zoom factor by 0.25. Valid factors range from 0.25 to 5.00. + + + + + + + + + + F5 + + + View + + Refresh + + + + + + Reload the website in the current tab. + + + + + + + + + + &Ctrl;F5 + + + View + + Reload and Bypass Cache + + + + + + Reload the website in the current tab bypassing any information in the cache and loading everything from the webserver. + + + + + + + + + + &Ctrl;U + + + View + + View Source + + + + + + Toggle between viewing the source and viewing the rendered website. + + + + + + + + + + &Ctrl;&Shift;U + + + View + + View Source in New Tab> + + + + + + Open a new tab displaying the source of the current tab, or a new tab displaying the rendered version if the source is already displayed. + Note that right-clicking on the background of a rendered website will display a context menu with a "View page source" entry, which performs the first of these actions. + + + + + + + + + + &Ctrl;&Shift;F + + + View + + Full Screen Mode + + + + + + Toggle full screen mode. This performs the same action as . + + + + + + + + + Go + + + + + + + + &Alt;Left + + + Go + + Back + + + + + + Navigate back one step in the current tab’s history. The action is disabled if it is not possible to go back. + + + + + + + + + + &Alt;Right + + + Go + + Forward + + + + + + Navigate forward one step in the current tab’s history. The action is disabled if it is not possible to go forward. + + + + + + + + + + &Alt;Home + + + Go + + Home + + + + + + Load the home page in the current tab. + + + + + + + + + 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 + + + + + + + + &Ctrl;&Alt;P + + + On-The-Fly Settings + + User Agent + + Privacy Browser + + + + + + Use the Privacy Browser user agent for the current tab. + + + + + + + + + + &Ctrl;&Alt;W + + + On-The-Fly Settings + + User Agent + + WebEngine Default + + + + + + Use the WebEngine Default user agent for the current tab. + + + + + + + + + + &Ctrl;&Alt;F + + + On-The-Fly Settings + + User Agent + + Firefox on Linux + + + + + + Use the Firefox on Linux user agent for the current tab. + + + + + + + + + + &Ctrl;&Alt;C + + + On-The-Fly Settings + + User Agent + + Chromium on Linux + + + + + + Use the Chromium on Linux user agent for the current tab. + + + + + + + + + + &Ctrl;&Alt;&Shift;F + + + On-The-Fly Settings + + User Agent + + Firefox on Windows + + + + + + Use the Firefox on Windows user agent for the current tab. + + + + + + + + + + &Ctrl;&Alt;&Shift;C + + + On-The-Fly Settings + + User Agent + + Chrome on Windows + + + + + + Use the Chrome on Windows user agent for the current tab. + + + + + + + + + + &Ctrl;&Alt;E + + + On-The-Fly Settings + + User Agent + + Edge on Windows + + + + + + Use the Edge on Windows user agent for the current tab. + + + + + + + + + + &Ctrl;&Alt;S + + + On-The-Fly Settings + + User Agent + + Safari on macOS + + + + + + Use the Safari on macOS user agent for the current tab. + + + + + + + + + + &Alt;&Shift;C + + + On-The-Fly Settings + + User Agent + + Custom + + + + + + Use the custom user agent for the current tab. This action is only active if a custom user agent is set in the settings. + + + + + + + + + Zoom + + + + + + + + &Ctrl;&Alt;Z + + + On-The-Fly Settings + + Zoom Factor + + + + + + Display the zoom factor dialog. + + + + + + + + + Search Engine + + + + + + + + &Ctrl;&Shift;M + + + On-The-Fly Settings + + Search Engine + + Mojeek + + + + + + Use Mojeek as the search engine. + + + + + + + + + + &Ctrl;&Shift;O + + + On-The-Fly Settings + + Search Engine + + Monocles + + + + + + Use Mojeek as the search engine. + + + + + + + + + + &Ctrl;&Shift;E + + + On-The-Fly Settings + + Search Engine + + MetaGer + + + + + + Use MetaGer as the search engine. + + + + + + + + + + &Ctrl;&Shift;G + + + On-The-Fly Settings + + Search Engine + + Google + + + + + + Use Google as the search engine. + + + + + + + + + + &Ctrl;&Shift;B + + + On-The-Fly Settings + + Search Engine + + Bing + + + + + + Use Bing as the search engine. + + + + + + + + + + &Ctrl;&Shift;Y + + + On-The-Fly Settings + + Search Engine + + Yahoo + + + + + + Use Yahoo as the search engine. + + + + + + + + + + &Ctrl;&Shift;C + + + On-The-Fly Settings + + Search Engine + + Custom + + + + + + Use the custom search engine. This action is only active if a custom search engine is set in the settings. + + + + + + + + + + Bookmarks + + + + + + + + &Ctrl;&Alt;&Shift;B + + + Bookmarks + + Edit Bookamrks + + + + + + Open the bookmark editing dialog. + + + + + + + + + + &Ctrl;B + + + Bookmarks + + Add Bookmark + + + + + + Add a new bookmark. + + + + + + + + + + &Meta;F + + + Bookmarks + + Add Folder + + + + + + Add a bookmark folder. The meta key on most keyboards is the Windows key. + + + + + + + + + + &Ctrl;&Alt;B + + + Bookmarks + + View Bookmarks Toolbar + + + + + + Toggle the visibility of the bookmarks toolbar. + + + + + + + + + Settings + + + + + + + + &Ctrl;&Shift;D + + + Settings + + Domain Settings + + + + + + + Display the domain settings dialog. + + + + + + + + + + &Ctrl;; + + + Settings + + Cookies + + + + + + Display the cookies dialog. + + + + + + + + + Common Settings and Help Entries + - Use the custom search engine. This action is only active if a custom search engine is set in the settings. + &privacybrowser; has many common &kde; Settings and Help menu items. + For more information read the sections about the Settings Menu + and Help Menu. - - - - - - - - - Bookmarks - - - - - - - - &Ctrl;B - - Bookmarks - Add Bookmark - - - - - - Add a new bookmark. - - - - - - - - - Settings - - - - - - - - &Ctrl;&Shift;D - - Settings - Domain Settings - - - - - - Display the domain settings dialog. - - - - - - - - - - - &Ctrl;; - - Settings - Cookies - - - - - - Display the cookies dialog. - - - - - - - - - Common Settings and Help Entries + + + + + Other Commands + + + + + + + &Ctrl;+S + + + + + + Toggle find case sensitive if the find toolbar is visible. + + + + + + + + + &Ctrl;+&Shift;+Click + + + + + + Open link in new tab. This performs the same action as right-clicking on the link and selecting “Open link in new tab”. + + + + + + + + + &Ctrl;+Click + + + + + + Open link in new background tab. This performs the same action as right-clicking on the link and selecting “Open link in new background tab”. + + + + + + + + + &Shift;+Click + + + + + + Open link in new window. This performs the same action as right-clicking on the link and selecting “Open link in new window”. + + + + + + + + + &Alt;+Click + + + + + + Save link. This performs the same action as right-clicking on the link and selecting “Save link”. + + + + + + + + + F11 + + + + + + Toggle full screen mode. This performs the same action as . + + + + + + + + + &Esc; + + + + + + Escape runs the first command that applies from the following list. + + + + + + Exit full screen browsing. + + + + + + Clear the find text line edit and the find text highlights. + + + + + + Hide the find text toolbar. + + + + + + + + + + + + Cookies Dialog - &privacybrowser; has many common &kde; Settings and Help menu items. - For more information read the sections about the Settings Menu - and Help Menu. + The cookies dialog is accessed through (see ). - - - - - Other Commands - - - - - - - &Ctrl;+S - - - - - - Toggle find case sensitive if the find toolbar is visible. - - - - - - - - - &Ctrl;+&Shift;+Click - - - - - - Open link in new tab. This performs the same action as right-clicking on the link and selecting “Open link in new tab”. - - - - - - - - - &Ctrl;+Click - - - - - - Open link in new background tab. This performs the same action as right-clicking on the link and selecting “Open link in new background tab”. - - - - - - - - - &Shift;+Click - - - - - - Open link in new window. This performs the same action as right-clicking on the link and selecting “Open link in new window”. - - - - - - - - - &Alt;+Click - - - - - - Save link. This performs the same action as right-clicking on the link and selecting “Save link”. - - - - - - - - - F11 - - - - - - Toggle full screen mode. This performs the same action as . - - - - - - - - - &Esc; - - - - - - Escape runs the first command that applies from the following list. - - - - - - Exit full screen browsing. - - - - - - Clear the find text line edit and the find text highlights. - - - - - - Hide the find text toolbar. - - - - - - - - - - - Cookies Dialog - - - The cookies dialog is accessed through (see ). - - - - Commands - - - - - - - A - - - - - - Open the add cookie dialog. - - - - - - - - - E - - - - - - Open the edit cookie dialog. This command is only valid if a cookie is currently selected. - - - - - - - - - D or - - - - - - Delete the currently selected cookies. A dialog will confirm the deletion before it is processed. - - - - - - - - - L - - - - - - Delete all the cookies. A dialog will confirm the deletion before it is processed. - - - - - - - - - C or &Ctrl;Q - - - - - - Close the cookies dialog. - - - - - + + Commands + + + + + + + A + + + + + + Open the add cookie dialog. + + + + + + + + + E + + + + + + Open the edit cookie dialog. This command is only valid if a cookie is currently selected. + + + + + + + + + D or + + + + + + Delete the currently selected cookies. A dialog will confirm the deletion before it is processed. + + + + + + + + + L + + + + + + Delete all the cookies. A dialog will confirm the deletion before it is processed. + + + + + + + + + C or &Ctrl;Q + + + + + + Close the cookies dialog. + + + + + - Save Dialog - - - The save dialog pops up when a download is initiated. - - - - Commands - - - - - - - S - - - - - - Save the file. - - - - - - - - - C or &Ctrl;Q - - - - - - Close the save dialog without saving the file. - - - - - - - - - - - Changelog - - - - <ulink url="https://www.stoutner.com/privacy-browser-pc-0-4/">0.4</ulink> - - <ulink url="https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=commitdiff;h=b4c8c8d02113d14c2a07751eb3b0c1bdeec7abb4">13 June 2023</ulink> - - - Add a setting to control spatial navigation. - Add an action to reload and bypass cache. - Fix a crash if one Privacy Browser window is closed while a tab within it is loading. - Add keyboard+click commands to the Handbook. - - - - - - <ulink url="https://www.stoutner.com/privacy-browser-pc-0-3/">0.3</ulink> - - <ulink url="https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=commitdiff;h=ace098e8677ac0d6468b825c73e65b82c0d6993e">8 May 2023</ulink> - - - Add the changelog to the Handbook. - Add the missing current domain settings icon on Gnome and Xfce. - Make changes to build on Guix. - - - - - - <ulink url="https://www.stoutner.com/privacy-browser-pc-0-2/">0.2</ulink> - - <ulink url="https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=commitdiff;h=44b5d3a1f6a5e7fc2aa8530845f26eba7bc26f9a">17 April 2023</ulink> - - - Fix a crash on GNOME when downloading a file with local storage disabled. - Fix problems with missing - icons on GNOME. - Display an animated favorite icon while a webpage is loading. - Fix the Handbook on non-KDE systems. - Change the order of entries in the WebEngine context menu. - Make spellcheck languages easier to click on. - Only generate a HTTP ping dialog if the request is made by the current tab. - Add a section to the Handbook about HTTP pings. - - + Save Dialog - - - <ulink url="https://www.stoutner.com/privacy-browser-pc-0-1/">0.1</ulink> - - <ulink url="https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=commitdiff;h=73459c6685ec5e58d776f2594c9b587802363b1c">11 March 2023</ulink> + + The save dialog pops up when a download is initiated. + - - Initial release. - - - - - - - Questions and Answers - - - - - - Why are there no questions? - - - - Because Privacy Browser is so perfectly designed that none have ever been asked. Also, because this is an alpha release and nobody has had a chance to ask them yet. ;) - - - - - - - - Credits and License - - - Privacy Browser PC copyright 2016-2017,2021-2023 Soren Stoutner soren@stoutner.com. - - - - - Program - - - The source code is available at gitweb.stoutner.com - or by running git clone https://git.stoutner.com/PrivacyBrowserPC.git. - - - - Translators: - - Translations will be added in a future release. - - - - - &underGPL; + + Commands + + + + + + + S + + + + + + Save the file. + + + + + + + + + C or &Ctrl;Q + + + + + + Close the save dialog without saving the file. + + + + + + + + + + Changelog + + + + <ulink url="https://www.stoutner.com/privacy-browser-pc-0-4/">0.4</ulink> - + <ulink url="https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=commitdiff;h=b4c8c8d02113d14c2a07751eb3b0c1bdeec7abb4">13 June 2023</ulink> + + + Add a setting to control spatial navigation. + Add an action to reload and bypass cache. + Fix a crash if one Privacy Browser window is closed while a tab within it is loading. + Add keyboard+click commands to the Handbook. + + + + + + <ulink url="https://www.stoutner.com/privacy-browser-pc-0-3/">0.3</ulink> - + <ulink url="https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=commitdiff;h=ace098e8677ac0d6468b825c73e65b82c0d6993e">8 May 2023</ulink> + + + Add the changelog to the Handbook. + Add the missing current domain settings icon on Gnome and Xfce. + Make changes to build on Guix. + + + + + + <ulink url="https://www.stoutner.com/privacy-browser-pc-0-2/">0.2</ulink> - + <ulink url="https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=commitdiff;h=44b5d3a1f6a5e7fc2aa8530845f26eba7bc26f9a">17 April 2023</ulink> + + + Fix a crash on GNOME when downloading a file with local storage disabled. + Fix problems with missing + icons on GNOME. + Display an animated favorite icon while a webpage is loading. + Fix the Handbook on non-KDE systems. + Change the order of entries in the WebEngine context menu. + Make spellcheck languages easier to click on. + Only generate a HTTP ping dialog if the request is made by the current tab. + Add a section to the Handbook about HTTP pings. + + + + + + <ulink url="https://www.stoutner.com/privacy-browser-pc-0-1/">0.1</ulink> - + <ulink url="https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=commitdiff;h=73459c6685ec5e58d776f2594c9b587802363b1c">11 March 2023</ulink> + + + Initial release. + + + + + + + Questions and Answers + + + + + + + Why are there no questions? + + + + + + Because Privacy Browser is so perfectly designed that none have ever been asked. Also, because this is an alpha release and nobody has had a chance to ask them yet. ;) + + + + + + + + + Credits and License - - - Documentation - - - doc/index.docbook and src/com.stoutner.privacybrowser.appdata.xml are released under the - GFDL-1.3 license with no Front-Cover or Back-Cover Texts or Invariant Sections. - All other documentation is released under the GPLv3+ license. - - - - &underFDL; - + + Privacy Browser PC copyright 2016-2017,2021-2023 Soren Stoutner soren@stoutner.com. + - - - Icons - - - - - - - - Privacy Browser - - - - - - - - - JavaScript - - - - - - - - - Privacy Browser Monochrome - - - - are derived from security and language, which are part of the Android Material icon set - and are released under the Apache License 2.0. Modifications copyright 2016-2017,2021-2023 Soren Stoutner. - The resulting images are released under the GPLv3+ license. - - - - - - - - - Loading - - - - comes from FlutterLoadingGIFs - where it is named cupertino_activity_indicator_selective.gif. - It is released under the Zero-Clause BSD License. - - - + + + Program + + + The source code is available at gitweb.stoutner.com + or by running git clone https://git.stoutner.com/PrivacyBrowserPC.git. + + + + Translators: + + + + Translations will be added in a future release. + + + + + + + &underGPL; + + + + + Documentation + + + doc/index.docbook and src/com.stoutner.privacybrowser.appdata.xml are released under the + GFDL-1.3 license with no Front-Cover or Back-Cover Texts or Invariant Sections. + All other documentation is released under the GPLv3+ license. + + + + &underFDL; + + + + + Icons + + + + + + + + + + Privacy Browser + + + + + + + + + + + + JavaScript + + + + + + + + + + + + Privacy Browser Monochrome + + + + + are derived from security and language, which are part of the Android Material icon set + and are released under the Apache License 2.0. Modifications copyright 2016-2017,2021-2023 Soren Stoutner. + The resulting images are released under the GPLv3+ license. + + + + + + + + + + + Loading + + + + + comes from FlutterLoadingGIFs + where it is named cupertino_activity_indicator_selective.gif. + It is released under the Zero-Clause BSD License. + + + diff --git a/src/dialogs/AddBookmarkDialog.h b/src/dialogs/AddBookmarkDialog.h index 18c3ca1..71e8165 100644 --- a/src/dialogs/AddBookmarkDialog.h +++ b/src/dialogs/AddBookmarkDialog.h @@ -36,7 +36,7 @@ class AddBookmarkDialog : public QDialog public: // The primary constructor. - explicit AddBookmarkDialog(const QString &bookmarkName, const QString &bookmarkUrl, const QIcon &favoriteIcon, const double parentFolderId = 0); + explicit AddBookmarkDialog(const QString &bookmarkName, const QString &bookmarkUrl, const QIcon &favoriteIcon, const double parentFolderId); signals: // The signals. diff --git a/src/dialogs/AddFolderDialog.h b/src/dialogs/AddFolderDialog.h index 2dc05df..3397b68 100644 --- a/src/dialogs/AddFolderDialog.h +++ b/src/dialogs/AddFolderDialog.h @@ -36,7 +36,7 @@ class AddFolderDialog : public QDialog public: // The primary constructor. - explicit AddFolderDialog(const QIcon ¤tWebsiteFavoriteIcon, const double parentFolderId = 0); + explicit AddFolderDialog(const QIcon ¤tWebsiteFavoriteIcon, const double parentFolderId); signals: // The signals. diff --git a/src/main.cpp b/src/main.cpp index 726d3fb..3cedc08 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) KCrash::initialize(); // Instantiate about data, setting the component name, the display name, and the version. - KAboutData aboutData(QStringLiteral("privacybrowser"), i18nc("Program Name", "Privacy Browser"), QStringLiteral("0.4")); + KAboutData aboutData(QStringLiteral("privacybrowser"), i18nc("Program Name", "Privacy Browser"), QStringLiteral("0.5")); // Add the author name, job description, email address, and website. aboutData.addAuthor(i18nc("Developer Information", "Soren Stoutner"),i18nc("Developer Information", "Principal developer"), QStringLiteral("soren@stoutner.com"), diff --git a/src/ui.rcs/browserwindowui.rc b/src/ui.rcs/browserwindowui.rc index 1d61322..c0e5a19 100644 --- a/src/ui.rcs/browserwindowui.rc +++ b/src/ui.rcs/browserwindowui.rc @@ -83,10 +83,6 @@ - - - - diff --git a/src/windows/BrowserWindow.cpp b/src/windows/BrowserWindow.cpp index 6b313f2..805b592 100644 --- a/src/windows/BrowserWindow.cpp +++ b/src/windows/BrowserWindow.cpp @@ -66,7 +66,7 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) setCentralWidget(tabWidgetPointer); // Get a handle for the action collection. - KActionCollection *actionCollectionPointer = this->actionCollection(); + actionCollectionPointer = this->actionCollection(); // Add the standard actions. KStandardAction::print(tabWidgetPointer, SLOT(print()), actionCollectionPointer); @@ -79,7 +79,6 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) QAction *backActionPointer = KStandardAction::back(this, SLOT(back()), actionCollectionPointer); QAction *forwardActionPointer = KStandardAction::forward(this, SLOT(forward()), actionCollectionPointer); KStandardAction::home(this, SLOT(home()), actionCollectionPointer); - KStandardAction::addBookmark(this, SLOT(showAddBookmarkDialog()), actionCollectionPointer); QAction *editBookmarksActionPointer = KStandardAction::editBookmarks(this, SLOT(editBookmarks()), actionCollectionPointer); KStandardAction::preferences(this, SLOT(showSettingsDialog()), actionCollectionPointer); KStandardAction::find(this, SLOT(showFindTextActions()), actionCollectionPointer); @@ -113,7 +112,6 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) searchEngineBingActionPointer = actionCollectionPointer->addAction(QLatin1String("search_engine_bing")); searchEngineYahooActionPointer = actionCollectionPointer->addAction(QLatin1String("search_engine_yahoo")); searchEngineCustomActionPointer = actionCollectionPointer->addAction(QLatin1String("search_engine_custom")); - QAction *addFolderPointer = actionCollectionPointer->addAction(QLatin1String("add_folder")); viewBookmarksToolBarActionPointer = actionCollectionPointer->addAction(QLatin1String("view_bookmarks_toolbar")); QAction *domainSettingsActionPointer = actionCollectionPointer->addAction(QLatin1String("domain_settings")); cookiesActionPointer = actionCollectionPointer->addAction(QLatin1String("cookies")); @@ -193,7 +191,6 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) searchEngineGoogleActionPointer->setText(i18nc("Search engine", "Google")); searchEngineBingActionPointer->setText(i18nc("Search engine", "Bing")); searchEngineYahooActionPointer->setText(i18nc("Search engine", "Yahoo")); - addFolderPointer->setText(i18nc("Add folder", "Add Folder")); viewBookmarksToolBarActionPointer->setText(i18nc("View bookmarks toolbar", "View Bookmarks Toolbar")); domainSettingsActionPointer->setText(i18nc("Domain Settings action", "Domain Settings")); cookiesActionPointer->setText(i18nc("The Cookies action, which also displays the number of cookies", "Cookies - %1", 0)); @@ -228,7 +225,6 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) searchEngineYahooActionPointer->setIcon(QIcon::fromTheme(QLatin1String("im-yahoo"), QIcon::fromTheme(QLatin1String("edit-find")))); searchEngineCustomActionPointer->setIcon(QIcon::fromTheme(QLatin1String("edit-find"))); zoomFactorActionPointer->setIcon(QIcon::fromTheme(QLatin1String("zoom-fit-best"))); - addFolderPointer->setIcon(QIcon::fromTheme(QLatin1String("folder-add"))); viewBookmarksToolBarActionPointer->setIcon(QIcon::fromTheme(QLatin1String("bookmarks"))); domainSettingsActionPointer->setIcon(QIcon::fromTheme(QLatin1String("settings-configure"), QIcon::fromTheme(QLatin1String("preferences-desktop")))); cookiesActionPointer->setIcon(QIcon::fromTheme(QLatin1String("preferences-web-browser-cookies"), QIcon::fromTheme(QLatin1String("appointment-new")))); @@ -265,7 +261,6 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) 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 ctrlAltShiftBKeySequence = QKeySequence(i18nc("The edit bookmarks key sequence.", "Ctrl+Alt+Shift+B")); - QKeySequence altFKeySequence = QKeySequence(i18nc("The add folder key sequence.", "Alt+F")); QKeySequence ctrlAltBKeySequence = QKeySequence(i18nc("The view bookmarks toolbar key sequence.", "Ctrl+Alt+B")); QKeySequence ctrlShiftDKeySequence = QKeySequence(i18nc("The domain settings key sequence.", "Ctrl+Shift+D")); QKeySequence ctrlSemicolonKeySequence = QKeySequence(i18nc("The cookies dialog key sequence.", "Ctrl+;")); @@ -300,7 +295,6 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) actionCollectionPointer->setDefaultShortcut(searchEngineYahooActionPointer, ctrlShiftYKeySequence); actionCollectionPointer->setDefaultShortcut(searchEngineCustomActionPointer, ctrlShiftCKeySequence); actionCollectionPointer->setDefaultShortcut(editBookmarksActionPointer, ctrlAltShiftBKeySequence); - actionCollectionPointer->setDefaultShortcut(addFolderPointer, altFKeySequence); actionCollectionPointer->setDefaultShortcut(viewBookmarksToolBarActionPointer, ctrlAltBKeySequence); actionCollectionPointer->setDefaultShortcut(domainSettingsActionPointer, ctrlShiftDKeySequence); actionCollectionPointer->setDefaultShortcut(cookiesActionPointer, ctrlSemicolonKeySequence); @@ -313,7 +307,6 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) connect(viewSourceActionPointer, SIGNAL(triggered()), this, SLOT(toggleViewSource())); connect(viewSourceInNewTabActionPointer, SIGNAL(triggered()), this, SLOT(toggleViewSourceInNewTab())); connect(zoomFactorActionPointer, SIGNAL(triggered()), this, SLOT(getZoomFactorFromUser())); - connect(addFolderPointer, SIGNAL(triggered()), this, SLOT(showAddFolderDialog())); connect(viewBookmarksToolBarActionPointer, SIGNAL(triggered()), this, SLOT(toggleViewBookmarksToolBar())); connect(cookiesActionPointer, SIGNAL(triggered()), this, SLOT(showCookiesDialog())); connect(domainSettingsActionPointer, SIGNAL(triggered()), this, SLOT(showDomainSettingsDialog())); @@ -523,6 +516,7 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) bookmarksMenuPointer->addSeparator(); // Initialize the current bookmarks lists. + finalBookmarkFolderMenuActionList = QList *>(); bookmarksMenuActionList = QList *>(); bookmarksMenuSubmenuList = QList *>(); bookmarksToolBarActionList = QList(); @@ -558,7 +552,7 @@ BrowserWindow::BrowserWindow(bool firstWindow, QString *initialUrlStringPointer) } } -void BrowserWindow::addFinalBookmarkFolderMenuEntries(QMenu *menuPointer, double folderId) +void BrowserWindow::addFinalBookmarkFolderMenuActions(QMenu *menuPointer, double folderId) { // Get the database ID. int folderDatabaseId = BookmarksDatabase::getFolderDatabaseId(folderId); @@ -567,7 +561,7 @@ void BrowserWindow::addFinalBookmarkFolderMenuEntries(QMenu *menuPointer, double menuPointer->addSeparator(); // Add the add bookmark action to the menu. - menuPointer->addAction(QIcon::fromTheme(QLatin1String("bookmark-new")), i18nc("The add bookmark action", "Add Bookmark"), [=] + QAction *addBookmarkActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("bookmark-new")), i18nc("The add bookmark action", "Add Bookmark"), [=] { // Instantiate an add bookmark dialog. AddBookmarkDialog *addBookmarkDialogPointer = new AddBookmarkDialog(tabWidgetPointer->getCurrentTabTitle(), tabWidgetPointer->getCurrentTabUrl(), @@ -582,7 +576,7 @@ void BrowserWindow::addFinalBookmarkFolderMenuEntries(QMenu *menuPointer, double ); // Add the add folder action to the menu. - menuPointer->addAction(QIcon::fromTheme(QLatin1String("folder-add")), i18nc("The add folder action", "Add Folder"), [=] + QAction *addFolderActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("folder-add")), i18nc("The add folder action", "Add Folder"), [=] { // Instantiate an add folder dialog. AddFolderDialog *addFolderDialogPointer = new AddFolderDialog(tabWidgetPointer->getCurrentTabFavoritIcon(), folderId); @@ -599,7 +593,7 @@ void BrowserWindow::addFinalBookmarkFolderMenuEntries(QMenu *menuPointer, double menuPointer->addSeparator(); // Add the open folder in new tabs action to the menu. - menuPointer->addAction(QIcon::fromTheme(QLatin1String("tab-new")), i18nc("The open folder in new tabs action", "Open Folder in New Tabs"), [=] + QAction *openFolderInNewTabsActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("tab-new")), i18nc("The open folder in new tabs action", "Open Folder in New Tabs"), [=] { // Get all the folder URLs. QList *folderUrlsListPointer = BookmarksDatabase::getAllFolderUrls(folderId); @@ -611,7 +605,8 @@ void BrowserWindow::addFinalBookmarkFolderMenuEntries(QMenu *menuPointer, double ); // Add the open folder in background tabs action to the menu. - menuPointer->addAction(QIcon::fromTheme(QLatin1String("tab-new")), i18nc("The open folder in background tabs action", "Open Folder in Background Tabs"), [=] + QAction *openFolderInBackgroundTabsActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("tab-new")), + i18nc("The open folder in background tabs action", "Open Folder in Background Tabs"), [=] { // Get all the folder URLs. QList *folderUrlsListPointer = BookmarksDatabase::getAllFolderUrls(folderId); @@ -623,7 +618,7 @@ void BrowserWindow::addFinalBookmarkFolderMenuEntries(QMenu *menuPointer, double ); // Add the open folder in new window action to the menu. - menuPointer->addAction(QIcon::fromTheme(QLatin1String("window-new")), i18nc("The open folder in new window action", "Open Folder in New Window"), [=] + QAction *openFolderInNewWindowActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("window-new")), i18nc("The open folder in new window action", "Open Folder in New Window"), [=] { // Get all the folder URLs. QList *folderUrlsListPointer = BookmarksDatabase::getAllFolderUrls(folderId); @@ -646,31 +641,38 @@ void BrowserWindow::addFinalBookmarkFolderMenuEntries(QMenu *menuPointer, double // Add a separator. menuPointer->addSeparator(); - // Add the edit folder action to the menu. - menuPointer->addAction(QIcon::fromTheme(QLatin1String("edit-entry")), i18nc("The edit folder action", "Edit Folder"), [=] - { - // Get the current tab favorite icon. - QIcon currentTabFavoriteIcon = tabWidgetPointer->getCurrentTabFavoritIcon(); + // Add the edit folder action to the menu if this is not the root bookmark menu. + if (folderId != 0) + { + QAction *editFolderActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("edit-entry")), i18nc("The edit folder action", "Edit Folder"), [=] + { + // Get the current tab favorite icon. + QIcon currentTabFavoriteIcon = tabWidgetPointer->getCurrentTabFavoritIcon(); - // Instantiate an edit folder dialog. - QDialog *editFolderDialogPointer = new EditFolderDialog(folderDatabaseId, currentTabFavoriteIcon); + // Instantiate an edit folder dialog. + QDialog *editFolderDialogPointer = new EditFolderDialog(folderDatabaseId, currentTabFavoriteIcon); - // Show the dialog. - editFolderDialogPointer->show(); + // Show the dialog. + editFolderDialogPointer->show(); - // Process bookmark events. - connect(editFolderDialogPointer, SIGNAL(folderSaved()), this, SLOT(populateBookmarks())); - } - ); + // Process bookmark events. + connect(editFolderDialogPointer, SIGNAL(folderSaved()), this, SLOT(populateBookmarks())); + } + ); + + // Add the action to the beginning of the final bookmark folder menu action list. + finalBookmarkFolderMenuActionList.prepend(new QPair(menuPointer, editFolderActionPointer)); + } // Add the delete folder action to the menu. - menuPointer->addAction(QIcon::fromTheme(QLatin1String("delete")), i18nc("Delete folder context menu entry", "Delete Folder"), [=] + QAction *deleteFolderActionPointer = menuPointer->addAction(QIcon::fromTheme(QLatin1String("delete")), i18nc("Delete folder context menu entry", "Delete Folder"), [=] { // Create an items to delete list. QList* itemsToDeleteListPointer = new QList; - // Add the folder to the list of items to delete. - itemsToDeleteListPointer->append(folderDatabaseId); + // Add the folder to the list of items to delete if it is not the root folder. + if (folderId != 0) + itemsToDeleteListPointer->append(folderDatabaseId); // Add the folder contents to the list of items to delete. itemsToDeleteListPointer->append(*BookmarksDatabase::getFolderContentsDatabaseIdsRecursively(folderId)); @@ -717,6 +719,26 @@ void BrowserWindow::addFinalBookmarkFolderMenuEntries(QMenu *menuPointer, double } } ); + + // Add the key sequences if this is the root bookmarks menu. + if (folderId == 0) + { + // Create the key sequences. + QKeySequence ctrlBKeySequence = QKeySequence(i18nc("The add bookmark key sequence.", "Ctrl+B")); + QKeySequence metaFKeySequence = QKeySequence(i18nc("The add folder key sequence.", "Meta+F")); + + // Set the action key sequences. + actionCollectionPointer->setDefaultShortcut(addBookmarkActionPointer, ctrlBKeySequence); + actionCollectionPointer->setDefaultShortcut(addFolderActionPointer, metaFKeySequence); + } + + // Add the actions to the beginning of the final bookmark folder menu action list. + finalBookmarkFolderMenuActionList.prepend(new QPair(menuPointer, addBookmarkActionPointer)); + finalBookmarkFolderMenuActionList.prepend(new QPair(menuPointer, addFolderActionPointer)); + finalBookmarkFolderMenuActionList.prepend(new QPair(menuPointer, openFolderInNewTabsActionPointer)); + finalBookmarkFolderMenuActionList.prepend(new QPair(menuPointer, openFolderInBackgroundTabsActionPointer)); + finalBookmarkFolderMenuActionList.prepend(new QPair(menuPointer, openFolderInNewWindowActionPointer)); + finalBookmarkFolderMenuActionList.prepend(new QPair(menuPointer, deleteFolderActionPointer)); } void BrowserWindow::addOrEditDomainSettings() const @@ -973,6 +995,13 @@ void BrowserWindow::newWindow() const void BrowserWindow::populateBookmarks() { + // Remove all the final bookmark folder menu actions. + for (QPair *finalBookmarkFolderMenuActionPair : finalBookmarkFolderMenuActionList) + { + // Remove the action. + finalBookmarkFolderMenuActionPair->first->removeAction(finalBookmarkFolderMenuActionPair->second); + } + // Remove all the current menu bookmarks. for (QPair *bookmarkMenuActionPairPointer : bookmarksMenuActionList) { @@ -1066,7 +1095,7 @@ void BrowserWindow::populateBookmarksMenuSubfolders(const double folderId, QMenu } // Add the extra items at the bottom of the menu. - addFinalBookmarkFolderMenuEntries(menuPointer, folderId); + addFinalBookmarkFolderMenuActions(menuPointer, folderId); } void BrowserWindow::populateBookmarksToolBar() @@ -1129,7 +1158,7 @@ void BrowserWindow::populateBookmarksToolBar() for (QPair *menuAndFolderIdPairPointer : bookmarksToolBarMenuList) { // Populate the final bookmarks menu entries. - addFinalBookmarkFolderMenuEntries(menuAndFolderIdPairPointer->first, menuAndFolderIdPairPointer->second); + addFinalBookmarkFolderMenuActions(menuAndFolderIdPairPointer->first, menuAndFolderIdPairPointer->second); } } @@ -1205,30 +1234,6 @@ void BrowserWindow::reloadAndBypassCache() const tabWidgetPointer->refresh(); } -void BrowserWindow::showAddBookmarkDialog() const -{ - // Instantiate an add bookmark dialog. - AddBookmarkDialog *addBookmarkDialogPointer = new AddBookmarkDialog(tabWidgetPointer->getCurrentTabTitle(), tabWidgetPointer->getCurrentTabUrl(), tabWidgetPointer->getCurrentTabFavoritIcon()); - - // Update the displayed bookmarks when a new one is added. - connect(addBookmarkDialogPointer, SIGNAL(bookmarkAdded()), this, SLOT(populateBookmarks())); - - // Show the dialog. - addBookmarkDialogPointer->show(); -} - -void BrowserWindow::showAddFolderDialog() const -{ - // Instantiate an add folder dialog. - AddFolderDialog *addFolderDialogPointer = new AddFolderDialog(tabWidgetPointer->getCurrentTabFavoritIcon()); - - // Update the displayed bookmarks when a folder is added. - connect(addFolderDialogPointer, SIGNAL(folderAdded()), this, SLOT(populateBookmarks())); - - // Show the dialog. - addFolderDialogPointer->show(); -} - void BrowserWindow::showBookmarkContextMenu(const QPoint &point) { // Get the bookmark action. @@ -1247,7 +1252,7 @@ void BrowserWindow::showBookmarkContextMenu(const QPoint &point) if (BookmarksDatabase::isFolder(databaseId)) // A folder was clicked. { // Populate the final bookmarks menu entries. - addFinalBookmarkFolderMenuEntries(bookmarkContextMenuPointer, BookmarksDatabase::getFolderId(databaseId)); + addFinalBookmarkFolderMenuActions(bookmarkContextMenuPointer, BookmarksDatabase::getFolderId(databaseId)); } else // A bookmark was clicked. { diff --git a/src/windows/BrowserWindow.h b/src/windows/BrowserWindow.h index 722fc1c..c4e0464 100644 --- a/src/windows/BrowserWindow.h +++ b/src/windows/BrowserWindow.h @@ -70,8 +70,6 @@ private Q_SLOTS: void populateBookmarks(); void refresh() const; void reloadAndBypassCache() const; - void showAddBookmarkDialog() const; - void showAddFolderDialog() const; void showBookmarkContextMenu(const QPoint &point); void showCookiesDialog(); void showDownloadLocationBrowseDialog() const; @@ -108,6 +106,7 @@ private Q_SLOTS: private: // The private variables. + KActionCollection *actionCollectionPointer; QAction *bookmarkedActionPointer; QList *> bookmarksMenuActionList; QMenu *bookmarksMenuPointer; @@ -128,6 +127,7 @@ private: double defaultZoomFactor; QAction *domStorageActionPointer; QComboBox *downloadLocationComboBoxPointer; + QList *> finalBookmarkFolderMenuActionList; QAction *findCaseSensitiveActionPointer; QAction *findNextActionPointer; QAction *findPreviousActionPointer; @@ -179,7 +179,7 @@ private: QPushButton *zoomPlusButtonPointer; // The private functions. - void addFinalBookmarkFolderMenuEntries(QMenu *menuPointer, double folderId); + void addFinalBookmarkFolderMenuActions(QMenu *menuPointer, double folderId); void populateBookmarksMenuSubfolders(const double folderId, QMenu *menuPointer); void populateBookmarksToolBar(); void populateBookmarksToolBarSubfolders(const double folderId, QMenu *menuPointer); -- 2.45.2