]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/windows/BrowserWindow.cpp
Enable opening links in new windows.
[PrivacyBrowserPC.git] / src / windows / BrowserWindow.cpp
index acf72db504019702db450969a89e17523b0a0681..064c7eda22b7a70c4152306250e4fcd257f8bb30 100644 (file)
@@ -40,7 +40,7 @@
 #include <QStatusBar>
 
 // Construct the class.
-BrowserWindow::BrowserWindow() : KXmlGuiWindow()
+BrowserWindow::BrowserWindow(bool firstWindow) : KXmlGuiWindow()
 {
     // Initialize the variables.
     javaScriptEnabled = false;
@@ -247,6 +247,9 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     // 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();
 
@@ -289,8 +292,9 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     connect(f11ShortcutPointer, SIGNAL(activated()), fullScreenActionPointer, SLOT(trigger()));
     connect(escapeShortcutPointer, SIGNAL(activated()), this, SLOT(escape()));
 
-    // Load the initial website.
-    tabWidgetPointer->loadInitialWebsite();
+    // Load the initial website if this is the first window.
+    if (firstWindow)
+        tabWidgetPointer->loadInitialWebsite();
 }
 
 void BrowserWindow::addOrEditDomainSettings() const
@@ -943,3 +947,9 @@ void BrowserWindow::updateUserAgentLabel(const QString &userAgentDatabaseName) c
     // Update the user agent label.
     userAgentLabelPointer->setText(UserAgentHelper::getUserAgentFromDatabaseName(userAgentDatabaseName));
 }
+
+void BrowserWindow::updateWindowTitle(const QString &title)
+{
+    // Update the window title.
+    setWindowTitle(title);
+}