// Display dialogs.
connect(zoomFactorActionPointer, SIGNAL(triggered()), this, SLOT(getZoomFactorFromUser()));
- // Set the current zoom factor.
- currentZoomFactor = Settings::zoomFactor();
-
- // Initialize the on-the-fly menus, as the slot connections had not been created when MainView was constructed.
- updateOnTheFlyZoomFactor(currentZoomFactor);
- updateOnTheFlySearchEngine(Settings::searchEngine());
-
// Update the status bar with the URL when a link is hovered.
connect(mainViewPointer, SIGNAL(linkHovered(QString)), this, SLOT(updateStatusBar(QString)));
// Setup the GUI based on the privacybrowserui.rc file.
setupGUI();
+
+ // Load the initial webstie.
+ mainViewPointer->loadInitialWebsite();
}
void BrowserWindow::fileNew() const
}
}
-void BrowserWindow::updateOnTheFlyZoomFactor(const double &zoomFactor) const
+void BrowserWindow::updateOnTheFlyZoomFactor(const double &zoomFactor)
{
+ // Set the current zoom factor.
+ currentZoomFactor = Settings::zoomFactor();
+
// Update the zoom factor action text, formatting the double with 2 decimal places.
zoomFactorActionPointer->setText(ki18nc("@action", "Zoom Factor - %1").subs(zoomFactor, 0, '0', 2).toString());
}
void settingsConfigure();
void updateOnTheFlySearchEngine(const QString &searchEngine) const;
void updateOnTheFlyUserAgent(const QString &userAgent) const;
- void updateOnTheFlyZoomFactor(const double &zoomFactor) const;
+ void updateOnTheFlyZoomFactor(const double &zoomFactor);
void updateSearchEngineLabel(const QString &searchEngineString) const;
void updateStatusBar(const QString &statusBarMessage) const;
void updateUserAgentLabel(const QString &userAgentName) const;
// Don't allow JavaScript to open windows.
webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, false);
- // Apply the application settings.
- applyApplicationSettings();
-
// Set the focus on the WebEngine view.
webEngineViewPointer->setFocus();
-
- // Get the arguments.
- QStringList argumentsStringList = qApp->arguments();
-
- // Check to see if the arguments lists contains a URL.
- if (argumentsStringList.size() > 1)
- {
- // Load the URL from the arguments list.
- webEngineViewPointer->setUrl(QUrl::fromUserInput(argumentsStringList.at(1)));
- }
- else
- {
- // Load the homepage.
- goHome();
- }
}
void MainView::applyApplicationSettings()
webEngineViewPointer->setUrl(QUrl::fromUserInput(Settings::homepage()));
}
+void MainView::loadInitialWebsite()
+{
+ // Apply the application settings.
+ applyApplicationSettings();
+
+ // Get the arguments.
+ QStringList argumentsStringList = qApp->arguments();
+
+ // Check to see if the arguments lists contains a URL.
+ if (argumentsStringList.size() > 1)
+ {
+ // Load the URL from the arguments list.
+ webEngineViewPointer->setUrl(QUrl::fromUserInput(argumentsStringList.at(1)));
+ }
+ else
+ {
+ // Load the homepage.
+ goHome();
+ }
+}
+
void MainView::loadUrlFromTextBox(QString urlFromUser) const
{
// Remove the focus from the URL line edit.
// The public functions.
void applyOnTheFlyZoomFactor(const double &zoomFactor) const;
+ void loadInitialWebsite();
signals:
// The signals.