+ connect(cookiesActionPointer, SIGNAL(triggered()), this, SLOT(showCookiesDialog()));
+ connect(domainSettingsActionPointer, SIGNAL(triggered()), this, SLOT(showDomainSettingsDialog()));
+
+ // Connect the URL toolbar actions.
+ connect(javaScriptActionPointer, SIGNAL(triggered()), this, SLOT(toggleJavaScript()));
+ connect(localStorageActionPointer, SIGNAL(triggered()), this, SLOT(toggleLocalStorage()));
+ connect(domStorageActionPointer, SIGNAL(triggered()), this, SLOT(toggleDomStorage()));
+
+ // Update the URL toolbar actions.
+ connect(tabWidgetPointer, SIGNAL(updateBackAction(bool)), backActionPointer, SLOT(setEnabled(bool)));
+ connect(tabWidgetPointer, SIGNAL(updateForwardAction(bool)), forwardActionPointer, SLOT(setEnabled(bool)));
+ connect(tabWidgetPointer, SIGNAL(updateJavaScriptAction(bool)), this, SLOT(updateJavaScriptAction(bool)));
+ connect(tabWidgetPointer, SIGNAL(updateLocalStorageAction(bool)), this, SLOT(updateLocalStorageAction(bool)));
+ connect(tabWidgetPointer, SIGNAL(updateDomStorageAction(bool)), this, SLOT(updateDomStorageAction(bool)));
+
+ // Connect the find text actions.
+ connect(findCaseSensitiveActionPointer, SIGNAL(triggered()), this, SLOT(toggleFindCaseSensitive()));
+
+ // Setup the GUI based on the browser_window_ui.rc file.
+ setupGUI(StandardWindowOption::Default, ("browser_window_ui.rc"));
+
+ // Get lists of the actions' associated widgets.
+ QList<QWidget*> userAgentAssociatedWidgetsPointerList = userAgentPrivacyBrowserActionPointer->associatedWidgets();
+ QList<QWidget*> searchEngineAssociatedWidgetsPointerList = searchEngineMojeekActionPointer->associatedWidgets();
+
+ // Get the menu widget pointers. It is the second entry, after the main window.
+ QWidget *userAgentMenuWidgetPointer = userAgentAssociatedWidgetsPointerList[1];
+ QWidget *searchEngineMenuWidgetPointer = searchEngineAssociatedWidgetsPointerList[1];
+
+ // Get the menu pointers.
+ QMenu *userAgentMenuPointer = qobject_cast<QMenu*>(userAgentMenuWidgetPointer);
+ QMenu *searchEngineMenuPointer = qobject_cast<QMenu*>(searchEngineMenuWidgetPointer);
+
+ // Get the menu actions.
+ userAgentMenuActionPointer = userAgentMenuPointer->menuAction();
+ searchEngineMenuActionPointer = searchEngineMenuPointer->menuAction();
+
+ // Get handles for the toolbars.
+ navigationToolBarPointer = toolBar(QStringLiteral("navigation_toolbar"));
+ urlToolBarPointer = toolBar(QStringLiteral("url_toolbar"));
+
+ // Create the line edits.
+ urlLineEditPointer = new KLineEdit();
+ findTextLineEditPointer = new KLineEdit();
+
+ // Get the line edit size policies.
+ QSizePolicy urlLineEditSizePolicy = urlLineEditPointer->sizePolicy();
+ QSizePolicy findTextLineEditSizePolicy = findTextLineEditPointer->sizePolicy();
+
+ // Set the URL line edit horizontal stretch to be five times the find text line edit stretch.
+ urlLineEditSizePolicy.setHorizontalStretch(5);
+ findTextLineEditSizePolicy.setHorizontalStretch(1);
+
+ // Set the policies.
+ urlLineEditPointer->setSizePolicy(urlLineEditSizePolicy);
+ findTextLineEditPointer->setSizePolicy(findTextLineEditSizePolicy);
+
+ // Set the widths.
+ urlLineEditPointer->setMinimumWidth(350);
+ findTextLineEditPointer->setMinimumWidth(200);
+ findTextLineEditPointer->setMaximumWidth(350);
+
+ // Set the placehold text.
+ urlLineEditPointer->setPlaceholderText(i18nc("The URL line edit placeholder text", "URL or Search Terms"));
+ findTextLineEditPointer->setPlaceholderText(i18nc("The find line edit placeholder text", "Find Text"));
+
+ // Show the clear button on the find line edit.
+ findTextLineEditPointer->setClearButtonEnabled(true);
+
+ // Add an edit or add domain settings action to the URL line edit.
+ QAction *addOrEditDomainSettingsActionPointer = urlLineEditPointer->addAction(QIcon::fromTheme("settings-configure"), QLineEdit::TrailingPosition);
+
+ // Add or edit the current domain settings.
+ connect(addOrEditDomainSettingsActionPointer, SIGNAL(triggered()), this, SLOT(addOrEditDomainSettings()));
+
+ // Create a find text label pointer.
+ findTextLabelPointer = new QLabel();
+
+ // Set the default label text.
+ findTextLabelPointer->setText(QStringLiteral(" ") + i18nc("Default find results.", "0/0") + QStringLiteral(" "));
+
+ // Insert the widgets into the toolbars.
+ urlToolBarPointer->insertWidget(javaScriptActionPointer, urlLineEditPointer);
+ urlToolBarPointer->insertWidget(findNextActionPointer, findTextLineEditPointer);
+ urlToolBarPointer->insertWidget(findNextActionPointer, findTextLabelPointer);
+
+ // Load a new URL from the URL line edit.
+ connect(urlLineEditPointer, SIGNAL(returnKeyPressed(const QString)), this, SLOT(loadUrlFromLineEdit(const QString)));
+
+ // Find text as it is typed.
+ connect(findTextLineEditPointer, SIGNAL(textEdited(const QString &)), tabWidgetPointer, SLOT(findText(const QString &)));
+
+ // Find next if the enter key is pressed.
+ connect(findTextLineEditPointer, SIGNAL(returnKeyPressed(const QString &)), tabWidgetPointer, SLOT(findText(const QString &)));
+
+ // Update find text when switching tabs.
+ connect(tabWidgetPointer, SIGNAL(updateFindText(const QString &, const bool)), this, SLOT(updateFindText(const QString &, const bool)));
+
+ // Update the find text results.
+ connect(tabWidgetPointer, SIGNAL(updateFindTextResults(const QWebEngineFindTextResult &)), this, SLOT(updateFindTextResults(const QWebEngineFindTextResult &)));
+
+ // Update the URL line edit on page loads.
+ connect(tabWidgetPointer, SIGNAL(updateUrlLineEdit(QUrl)), this, SLOT(updateUrlLineEdit(QUrl)));
+
+ // Update the window title.
+ connect(tabWidgetPointer, SIGNAL(updateWindowTitle(const QString)), this, SLOT(updateWindowTitle(const QString)));
+
+ // Get a handle for the status bar.
+ QStatusBar *statusBarPointer = statusBar();
+
+ // Create a progress bar.
+ progressBarPointer = new QProgressBar();
+
+ // Add the progress bar to to the status bar.
+ statusBarPointer->addPermanentWidget(progressBarPointer);