+ connect(tabWidgetPointer, SIGNAL(updateDomainSettingsIndicator(const bool)), this, SLOT(updateDomainSettingsIndicator(const bool)));
+
+ // Process full screen requests.
+ connect(tabWidgetPointer, SIGNAL(fullScreenRequested(bool)), this, SLOT(fullScreenRequested(bool)));
+
+ // Create keyboard shortcuts.
+ QShortcut *ctrlTShortcutPointer = new QShortcut(QKeySequence(i18nc("The open new tab shortcut.", "Ctrl+t")), this);
+ QShortcut *f11ShortcutPointer = new QShortcut(QKeySequence(i18nc("The toggle full screen shortcut.", "F11")), this);
+ QShortcut *escapeShortcutPointer = new QShortcut(QKeySequence::Cancel, this);
+
+ // Connect the keyboard shortcuts to the actions.
+ connect(ctrlTShortcutPointer, SIGNAL(activated()), tabWidgetPointer, SLOT(addTab()));
+ connect(f11ShortcutPointer, SIGNAL(activated()), fullScreenActionPointer, SLOT(trigger()));
+ connect(escapeShortcutPointer, SIGNAL(activated()), this, SLOT(escape()));
+
+ // Populate the UI.
+ // This must be done here, because otherwise, if a URL is loaded, like a local file, that does not trigger a call to TabWidget::applyDomainSettings, the UI will not be fully populated.
+ updateJavaScriptAction(Settings::javaScriptEnabled());
+ updateLocalStorageAction(Settings::localStorageEnabled());
+ updateDomStorageAction(Settings::domStorageEnabled());
+ updateUserAgentActions(UserAgentHelper::getUserAgentFromDatabaseName(Settings::userAgent()), true);
+ updateZoomFactorAction(Settings::zoomFactor());
+
+ // Load the initial website if this is the first window.
+ if (firstWindow)
+ tabWidgetPointer->loadInitialWebsite();
+}
+
+void BrowserWindow::addOrEditDomainSettings() const
+{
+ // Remove the focus from the URL line edit.
+ urlLineEditPointer->clearFocus();
+
+ // Create the domain settings dialog pointer.
+ DomainSettingsDialog *domainSettingsDialogPointer;
+
+ // Get the current domain settings name.
+ QString ¤tDomainSettingsName = tabWidgetPointer->getDomainSettingsName();
+
+ // Run the commands according to the current domain settings status.
+ if (currentDomainSettingsName == QStringLiteral("")) // Domain settings are not currently applied.
+ {
+ // Instruct the domain settings dialog to add a new domain.
+ domainSettingsDialogPointer = new DomainSettingsDialog(DomainSettingsDialog::ADD_DOMAIN, currentUrl.host());
+ }
+ else // Domain settings are currently applied.
+ {
+ // Instruct the domain settings dialog to edit the current domain.
+ domainSettingsDialogPointer = new DomainSettingsDialog(DomainSettingsDialog::EDIT_DOMAIN, currentDomainSettingsName);
+ }
+
+ // Set the dialog window title.
+ domainSettingsDialogPointer->setWindowTitle(i18nc("The domain settings dialog title", "Domain Settings"));
+
+ // Set the modality.
+ domainSettingsDialogPointer->setWindowModality(Qt::WindowModality::WindowModal);;
+
+ // Show the dialog.
+ domainSettingsDialogPointer->show();