X-Git-Url: https://gitweb.stoutner.com/?p=PrivacyBrowserPC.git;a=blobdiff_plain;f=src%2Fwindows%2FBrowserWindow.cpp;h=03ababcb877893de2941c9cd409d92bd4d8d45e3;hp=e2dd30109863fe8b8a4a7414aacd3a757ff5afc9;hb=9514cabb5648123b68264e595e9ffef6261bd215;hpb=27ddfe8833b1ebaf499755135aa5cbfc72acb802 diff --git a/src/windows/BrowserWindow.cpp b/src/windows/BrowserWindow.cpp index e2dd301..03ababc 100644 --- a/src/windows/BrowserWindow.cpp +++ b/src/windows/BrowserWindow.cpp @@ -149,9 +149,9 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow() domainSettingsActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("network-server-symbolic"))); // Update the on-the-fly menus. - connect(browserViewPointer, SIGNAL(userAgentUpdated(QString)), this, SLOT(updateOnTheFlyUserAgent(QString))); - connect(browserViewPointer, SIGNAL(zoomFactorUpdated(double)), this, SLOT(updateOnTheFlyZoomFactor(double))); - connect(browserViewPointer, SIGNAL(searchEngineUpdated(QString)), this, SLOT(updateOnTheFlySearchEngine(QString))); + connect(browserViewPointer, SIGNAL(updateUserAgentActions(QString)), this, SLOT(updateUserAgentActions(QString))); + connect(browserViewPointer, SIGNAL(updateZoomFactorAction(double)), this, SLOT(updateZoomFactorAction(double))); + connect(browserViewPointer, SIGNAL(updateSearchEngineActions(QString)), this, SLOT(updateSearchEngineActions(QString))); // Apply the on-the-fly settings when selected. connect(userAgentActionGroupPointer, SIGNAL(triggered(QAction*)), browserViewPointer, SLOT(applyOnTheFlyUserAgent(QAction*))); @@ -192,9 +192,19 @@ BrowserWindow::BrowserWindow() : KXmlGuiWindow() // 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); + // Update the status bar with the URL when a link is hovered. connect(browserViewPointer, SIGNAL(linkHovered(QString)), statusBarPointer, SLOT(showMessage(QString))); + // Update the progress bar. + connect(browserViewPointer, SIGNAL(showProgressBar(const int)), this, SLOT(showProgressBar(const int))); + connect(browserViewPointer, SIGNAL(hideProgressBar()), progressBarPointer, SLOT(hide())); + // Get the URL line edit palettes. noDomainSettingsPalette = urlLineEditPointer->palette(); domainSettingsPalette = urlLineEditPointer->palette(); @@ -253,7 +263,7 @@ void BrowserWindow::getZoomFactorFromUser() browserViewPointer->applyOnTheFlyZoomFactor(newZoomFactor); // Update the on-the-fly action text. - updateOnTheFlyZoomFactor(newZoomFactor); + updateZoomFactorAction(newZoomFactor); } } @@ -305,6 +315,15 @@ void BrowserWindow::refresh() const browserViewPointer->refresh(); } +void BrowserWindow::showProgressBar(const int &progress) const +{ + // Set the progress bar value. + progressBarPointer->setValue(progress); + + // Show the progress bar. + progressBarPointer->show(); +} + void BrowserWindow::toggleJavaScript() const { // Remove the focus from the URL line edit. @@ -409,7 +428,7 @@ void BrowserWindow::updateJavaScriptAction(const bool &isEnabled) const else javaScriptActionPointer->setIcon(QIcon(":/icons/privacy-mode")); } -void BrowserWindow::updateOnTheFlySearchEngine(const QString &searchEngine) const +void BrowserWindow::updateSearchEngineActions(const QString &searchEngine) const { // Initialize the custom search engine flag. bool customSearchEngine = false; @@ -466,7 +485,7 @@ void BrowserWindow::updateOnTheFlySearchEngine(const QString &searchEngine) cons } } -void BrowserWindow::updateOnTheFlyUserAgent(const QString &userAgent) const +void BrowserWindow::updateUserAgentActions(const QString &userAgent) const { // Initialize the custom user agent flag. bool customUserAgent = false; @@ -508,10 +527,10 @@ void BrowserWindow::updateOnTheFlyUserAgent(const QString &userAgent) const } } -void BrowserWindow::updateOnTheFlyZoomFactor(const double &zoomFactor) +void BrowserWindow::updateZoomFactorAction(const double &zoomFactor) { // Set the current zoom factor. - currentZoomFactor = Settings::zoomFactor(); + currentZoomFactor = 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());