Set the default window size.
[PrivacyBrowserPC.git] / src / windows / BrowserWindow.cpp
index d83dd69b5e515b12a2baf6fa9cd3e8689ac93d7a..77bb43b021f112e656da12f42dc731bc9815bcf8 100644 (file)
@@ -46,9 +46,13 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     KActionCollection *actionCollectionPointer = this->actionCollection();
 
     // Add the standard actions.
+    QAction *backActionPointer = KStandardAction::back(this, SLOT(back()), actionCollectionPointer);
+    QAction *forwardActionPointer = KStandardAction::forward(this, SLOT(forward()), actionCollectionPointer);
+    KStandardAction::home(this, SLOT(home()), actionCollectionPointer);
     KStandardAction::openNew(this, SLOT(fileNew()), actionCollectionPointer);
     KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollectionPointer);
     KStandardAction::preferences(this, SLOT(settingsConfigure()), actionCollectionPointer);
+    KStandardAction::redisplay(this, SLOT(refresh()), actionCollectionPointer);
 
     // Add the custom actions.
     userAgentPrivacyBrowserActionPointer = actionCollectionPointer->addAction(QStringLiteral("user_agent_privacy_browser"));
@@ -67,10 +71,6 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     searchEngineBingActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_bing"));
     searchEngineYahooActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_yahoo"));
     searchEngineCustomActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_custom"));
-    backActionPointer = actionCollectionPointer->addAction(QStringLiteral("back"));
-    forwardActionPointer = actionCollectionPointer->addAction(QStringLiteral("forward"));
-    refreshActionPointer = actionCollectionPointer->addAction(QStringLiteral("refresh"));
-    homeActionPointer = actionCollectionPointer->addAction(QStringLiteral("home"));
     javaScriptActionPointer = actionCollectionPointer->addAction(QStringLiteral("javascript"));
     domainSettingsActionPointer = actionCollectionPointer->addAction(QStringLiteral("domain_settings"));
 
@@ -126,18 +126,11 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     searchEngineGoogleActionPointer->setText(i18nc("Search engine", "Google"));
     searchEngineBingActionPointer->setText(i18nc("Search engine", "Bing"));
     searchEngineYahooActionPointer->setText(i18nc("Search engine", "Yahoo"));
-    backActionPointer->setText(i18nc("Back button", "Back"));
-    forwardActionPointer->setText(i18nc("Forward button", "Forward"));
-    refreshActionPointer->setText(i18nc("Refresh button", "Refresh"));
-    homeActionPointer->setText(i18nc("Home button", "Home"));
     javaScriptActionPointer->setText(i18nc("JavaScript button", "JavaScript"));
     domainSettingsActionPointer->setText(i18nc("Domain Settings button", "Domain Settings"));
 
     // Set the action icons.
-    backActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("arrow-left")));
-    forwardActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("arrow-right")));
-    refreshActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
-    homeActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("home")));
+    //refreshActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
     domainSettingsActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("network-server-symbolic")));
 
     // Update the on-the-fly menus.
@@ -153,10 +146,6 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow()
     connect(zoomFactorActionPointer, SIGNAL(triggered()), this, SLOT(getZoomFactorFromUser()));
 
     // Connect the URL toolbar actions.
-    connect(backActionPointer, SIGNAL(triggered()), this, SLOT(back()));
-    connect(forwardActionPointer, SIGNAL(triggered()), this, SLOT(forward()));
-    connect(refreshActionPointer, SIGNAL(triggered()), this, SLOT(refresh()));
-    connect(homeActionPointer, SIGNAL(triggered()), this, SLOT(home()));
     connect(javaScriptActionPointer, SIGNAL(triggered()), this, SLOT(toggleJavaScript()));
     connect(domainSettingsActionPointer, SIGNAL(triggered()), this, SLOT(openDomainSettings()));
 
@@ -310,6 +299,12 @@ void BrowserWindow::toggleJavaScript() const
     browserViewPointer->toggleJavaScript();
 }
 
+QSize BrowserWindow::sizeHint() const
+{
+    // Return the default window size.
+    return QSize(1500, 1200);
+}
+
 void BrowserWindow::settingsConfigure()
 {
     // Check to make sure the dialog box isn't already displayed.