</listitem>
</varlistentry>
+ <!-- Restore URL text. -->
+ <varlistentry id="restore-url-text">
+ <term>
+ <command>
+ &Ctrl;+&Shift;+<keycap>R</keycap>
+ </command>
+ </term>
+
+ <listitem>
+ <para>
+ Restore the URL text (if it has been edited) to the URL that is currently displayed in the tab.
+ </para>
+ </listitem>
+ </varlistentry>
+
<!-- Escape. -->
<varlistentry id="escape">
<term>
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
+ * along with Privacy Browser PC. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef FILTER_LIST_HELPER_H
// The public variables.
QVector<int> blockedRequestsVector = {0, 0, 0, 0, 0, 0};
std::list<QNetworkCookie> *cookieListPointer = new std::list<QNetworkCookie>;
+ QString currentUrlText = QLatin1String("");
double defaultZoomFactor = 1.00;
QString domainSettingsName = QLatin1String("");
bool easyListEnabled = true;
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
+ * along with Privacy Browser PC. If not, see <https://www.gnu.org/licenses/>.
*/
// Application headers.
currentPrivacyWebEngineViewPointer->stop();
}
+void TabWidget::storeCurrentUrlText(const QString &urlText) const
+{
+ // Store the current URL text in the privacy WebEngine view.
+ currentPrivacyWebEngineViewPointer->currentUrlText = urlText;
+}
+
void TabWidget::toggleDeveloperTools(const bool enabled) const
{
// Get a handle for the current developer tools WebEngine.
void TabWidget::updateUiWithTabSettings()
{
+ // Clear the URL line edit focus.
+ emit clearUrlLineEditFocus();
+
// Update the current WebEngine pointers.
currentPrivacyWebEngineViewPointer = qTabWidgetPointer->currentWidget()->findChild<PrivacyWebEngineView *>();
currentWebEngineSettingsPointer = currentPrivacyWebEngineViewPointer->settings();
currentWebEngineHistoryPointer = currentWebEnginePagePointer->history();
currentWebEngineCookieStorePointer = currentWebEngineProfilePointer->cookieStore();
- // Clear the URL line edit focus.
- emit clearUrlLineEditFocus();
-
// Get a handle for the development tools WebEngine view.
DevToolsWebEngineView *devToolsWebEngineViewPointer = qTabWidgetPointer->currentWidget()->findChild<DevToolsWebEngineView *>();
// Update the URL.
emit updateWindowTitle(currentPrivacyWebEngineViewPointer->title());
emit updateDomainSettingsIndicator(currentPrivacyWebEngineViewPointer->domainSettingsName != QLatin1String(""));
- emit updateUrlLineEdit(currentPrivacyWebEngineViewPointer->url());
+ emit updateUrlLineEdit(currentPrivacyWebEngineViewPointer->currentUrlText);
// Update the find text.
emit updateFindText(currentPrivacyWebEngineViewPointer->findString, currentPrivacyWebEngineViewPointer->findCaseSensitive);
void reloadAndBypassCache() const;
void saveArchive();
void stop() const;
+ void storeCurrentUrlText(const QString &urlText) const;
void toggleEasyList() const;
void toggleEasyPrivacy() const;
void toggleFanboysAnnoyanceList() const;
bookmarkedActionPointer = urlLineEditPointer->addAction(QIcon::fromTheme(QLatin1String("non-starred-symbolic")), QLineEdit::LeadingPosition);
QAction *addOrEditDomainSettingsActionPointer = urlLineEditPointer->addAction(QIcon::fromTheme(QLatin1String("settings-configure"), QIcon::fromTheme(QLatin1String("preferences-desktop"))),
QLineEdit::TrailingPosition);
+ restoreUrlTextActionPointer = urlLineEditPointer->addAction(QIcon::fromTheme(QLatin1String("edit-undo")), QLineEdit::TrailingPosition);
// Set the bookmarked action pointer to be checkable.
bookmarkedActionPointer->setCheckable(true);
// Connect the URL line edit actions.
connect(bookmarkedActionPointer, SIGNAL(triggered()), this, SLOT(toggleBookmark()));
connect(addOrEditDomainSettingsActionPointer, SIGNAL(triggered()), this, SLOT(addOrEditDomainSettings()));
+ connect(restoreUrlTextActionPointer, SIGNAL(triggered()), this, SLOT(restoreUrlText()));
// Create a find text label pointer.
findTextLabelPointer = new QLabel();
// Update the window title.
connect(tabWidgetPointer, SIGNAL(updateWindowTitle(const QString)), this, SLOT(updateWindowTitle(const QString)));
+ // Store the URL line edit when it changes.
+ connect(urlLineEditPointer, SIGNAL(textChanged(const QString &)), this, SLOT(processUrlTextChanges(const QString &)));
+
// Get a handle for the status bar.
QStatusBar *statusBarPointer = statusBar();
// Create keyboard shortcuts.
QShortcut *f11ShortcutPointer = new QShortcut(QKeySequence(i18nc("The toggle full screen shortcut.", "F11")), this);
+ QShortcut *ctrlShiftRShortcut = new QShortcut(QKeySequence(i18nc("The restore URL text key sequence.", "Ctrl+Shift+R")), this);
QShortcut *escapeShortcutPointer = new QShortcut(QKeySequence::Cancel, this);
// Connect the keyboard shortcuts.
connect(f11ShortcutPointer, SIGNAL(activated()), fullScreenActionPointer, SLOT(trigger()));
+ connect(ctrlShiftRShortcut, SIGNAL(activated()), restoreUrlTextActionPointer, SLOT(trigger()));
connect(escapeShortcutPointer, SIGNAL(activated()), this, SLOT(escape()));
// Get a handle for the Bookmarks menu.
}
}
+void BrowserWindow::processUrlTextChanges(const QString &newUrlText) const
+{
+ // Update the visibility of the restore URL text action pointer.
+ restoreUrlTextActionPointer->setVisible(newUrlText != tabWidgetPointer->getCurrentTabUrl());
+
+ // Store the new URL text in the WebEngine View.
+ tabWidgetPointer->storeCurrentUrlText(newUrlText);
+}
+
void BrowserWindow::refresh() const
{
// Remove the focus from the URL line edit.
tabWidgetPointer->refresh();
}
+void BrowserWindow::restoreUrlText() const
+{
+ // Restore the URL text to the current URL.
+ urlLineEditPointer->setText(tabWidgetPointer->getCurrentTabUrl());
+}
+
void BrowserWindow::showBookmarkContextMenu(const QPoint &point)
{
// Get the bookmark action.
void openWithChromium() const;
void openWithFirefox() const;
void populateBookmarksInAllWindows() const;
+ void processUrlTextChanges(const QString &newUrlText) const;
void refresh() const;
void reloadAndBypassCache() const;
+ void restoreUrlText() const;
void showBookmarkContextMenu(const QPoint &point);
void showCookiesDialog();
void showDomainSettingsDialog();
QProgressBar *progressBarPointer;
QAction *refreshActionPointer;
QAction *requestsActionPointer;
+ QAction *restoreUrlTextActionPointer;
QAction *searchEngineMenuActionPointer;
QAction *searchEngineMojeekActionPointer;
QAction *searchEngineMonoclesActionPointer;