KStandardAction::quit(qApp, SLOT(closeAllWindows()), actionCollectionPointer);
zoomInActionPointer = KStandardAction::zoomIn(this, SLOT(incrementZoom()), actionCollectionPointer);
zoomOutActionPointer = KStandardAction::zoomOut(this, SLOT(decrementZoom()), actionCollectionPointer);
- KStandardAction::redisplay(this, SLOT(refresh()), actionCollectionPointer);
+ refreshActionPointer = KStandardAction::redisplay(this, SLOT(refresh()), actionCollectionPointer);
fullScreenActionPointer = KStandardAction::fullScreen(this, SLOT(toggleFullScreen()), this, actionCollectionPointer);
QAction *backActionPointer = KStandardAction::back(this, SLOT(back()), actionCollectionPointer);
QAction *forwardActionPointer = KStandardAction::forward(this, SLOT(forward()), actionCollectionPointer);
QAction *saveArchiveActionPointer = actionCollectionPointer->addAction(QLatin1String("save_archive"));
zoomDefaultActionPointer = actionCollectionPointer->addAction(QLatin1String("zoom_default"));
QAction *reloadAndBypassCacheActionPointer = actionCollectionPointer->addAction(QLatin1String("reload_and_bypass_cache"));
+ stopActionPointer = actionCollectionPointer->addAction(QLatin1String("stop"));
viewSourceActionPointer = actionCollectionPointer->addAction(QLatin1String("view_source"));
viewSourceInNewTabActionPointer = actionCollectionPointer->addAction(QLatin1String("view_source_in_new_tab"));
developerToolsActionPointer = actionCollectionPointer->addAction(QLatin1String("developer_tools"));
saveArchiveActionPointer->setText(i18nc("Save archive action", "Save Archive"));
zoomDefaultActionPointer->setText(i18nc("Zoom default action", "Zoom Default"));
reloadAndBypassCacheActionPointer->setText(i18nc("Reload and bypass cache action", "Reload and Bypass Cache"));
+ stopActionPointer->setText(i18nc("Stop action", "Stop"));
viewSourceActionPointer->setText(i18nc("View source action", "View Source"));
viewSourceInNewTabActionPointer->setText(i18nc("View source in new tab action", "View Source in New Tab"));
developerToolsActionPointer->setText(i18nc("Developer tools action", "Developer Tools"));
saveArchiveActionPointer->setIcon(QIcon::fromTheme(QLatin1String("document-save")));
zoomDefaultActionPointer->setIcon(QIcon::fromTheme(QLatin1String("zoom-fit-best")));
reloadAndBypassCacheActionPointer->setIcon(QIcon::fromTheme(QLatin1String("view-refresh")));
+ stopActionPointer->setIcon(QIcon::fromTheme(QLatin1String("process-stop")));
viewSourceActionPointer->setIcon(QIcon::fromTheme(QLatin1String("view-choose"), QIcon::fromTheme(QLatin1String("accessories-text-editor"))));
viewSourceInNewTabActionPointer->setIcon(QIcon::fromTheme(QLatin1String("view-choose"), QIcon::fromTheme(QLatin1String("accessories-text-editor"))));
developerToolsActionPointer->setIcon(QIcon::fromTheme(QLatin1String("add-subtitle"), QIcon::fromTheme("system-run")));
domStorageActionPointer->setIcon(QIcon::fromTheme(QLatin1String("code-class"), QIcon(QLatin1String("/usr/share/icons/gnome/32x32/actions/gtk-unindent-ltr.png"))));
- userAgentPrivacyBrowserActionPointer->setIcon(QIcon(":/icons/privacy-mode.svg"));
- userAgentWebEngineDefaultActionPointer->setIcon(QIcon::fromTheme(QLatin1String("qtlogo"), QIcon::fromTheme(QLatin1String("user-group-properties"), QIcon::fromTheme(QLatin1String("contact-new")))));
+ userAgentPrivacyBrowserActionPointer->setIcon(QIcon(QLatin1String(":/icons/privacy-mode.svg")));
+ userAgentWebEngineDefaultActionPointer->setIcon(QIcon::fromTheme(QLatin1String("qtlogo"), QIcon::fromTheme(QLatin1String("user-group-properties"),
+ QIcon::fromTheme(QLatin1String("contact-new")))));
userAgentFirefoxLinuxActionPointer->setIcon(QIcon::fromTheme(QLatin1String("firefox-esr"), QIcon::fromTheme(QLatin1String("user-group-properties"),
QIcon::fromTheme(QLatin1String("contact-new")))));
userAgentChromiumLinuxActionPointer->setIcon(QIcon::fromTheme(QLatin1String("chromium"), QIcon::fromTheme(QLatin1String("user-group-properties"), QIcon::fromTheme(QLatin1String("contact-new")))));
QKeySequence ctrlAKeySequence = QKeySequence(i18nc("The save archive key sequence.", "Ctrl+A"));
QKeySequence ctrl0KeySequence = QKeySequence(i18nc("The zoom default key sequence.", "Ctrl+0"));
QKeySequence ctrlF5KeySequence = QKeySequence(i18nc("The reload and bypass cache key sequence.", "Ctrl+F5"));
+ QKeySequence ctrlShiftXKeySequence = QKeySequence(i18nc("The stop key sequence.", "Ctrl+Shift+X"));
QKeySequence ctrlUKeySequence = QKeySequence(i18nc("The view source key sequence.", "Ctrl+U"));
QKeySequence ctrlShiftUKeySequence = QKeySequence(i18nc("The view source in new tab key sequence.", "Ctrl+Shift+U"));
QKeySequence f12KeySequence = QKeySequence(i18nc("The developer tools key sequence.", "F12"));
actionCollectionPointer->setDefaultShortcut(saveArchiveActionPointer, ctrlAKeySequence);
actionCollectionPointer->setDefaultShortcut(zoomDefaultActionPointer, ctrl0KeySequence);
actionCollectionPointer->setDefaultShortcut(reloadAndBypassCacheActionPointer, ctrlF5KeySequence);
+ actionCollectionPointer->setDefaultShortcut(stopActionPointer, ctrlShiftXKeySequence);
actionCollectionPointer->setDefaultShortcut(viewSourceActionPointer, ctrlUKeySequence);
actionCollectionPointer->setDefaultShortcut(viewSourceInNewTabActionPointer, ctrlShiftUKeySequence);
actionCollectionPointer->setDefaultShortcut(developerToolsActionPointer, f12KeySequence);
connect(saveArchiveActionPointer, SIGNAL(triggered()), tabWidgetPointer, SLOT(saveArchive()));
connect(zoomDefaultActionPointer, SIGNAL(triggered()), this, SLOT(zoomDefault()));
connect(reloadAndBypassCacheActionPointer, SIGNAL(triggered()), this, SLOT(reloadAndBypassCache()));
+ connect(stopActionPointer, SIGNAL(triggered()), tabWidgetPointer, SLOT(stop()));
connect(viewSourceActionPointer, SIGNAL(triggered()), this, SLOT(toggleViewSource()));
connect(viewSourceInNewTabActionPointer, SIGNAL(triggered()), this, SLOT(toggleViewSourceInNewTab()));
connect(developerToolsActionPointer, SIGNAL(triggered()), this, SLOT(toggleDeveloperTools()));
// Update the progress bar.
connect(tabWidgetPointer, SIGNAL(showProgressBar(const int)), this, SLOT(showProgressBar(const int)));
- connect(tabWidgetPointer, SIGNAL(hideProgressBar()), progressBarPointer, SLOT(hide()));
+ connect(tabWidgetPointer, SIGNAL(hideProgressBar()), this, SLOT(hideProgressBar()));
// Update the URL line edit focus.
connect(tabWidgetPointer, SIGNAL(clearUrlLineEditFocus()), this, SLOT(clearUrlLineEditFocus()));
tabWidgetPointer->home();
}
+void BrowserWindow::hideProgressBar() const
+{
+ // Hide the progress bar.
+ progressBarPointer->hide();
+
+ // Disable and hide the stop action.
+ stopActionPointer->setEnabled(false);
+ stopActionPointer->setVisible(false);
+
+ // Enable and show the refresh action.
+ refreshActionPointer->setEnabled(true);
+ refreshActionPointer->setVisible(true);
+}
+
void BrowserWindow::incrementZoom()
{
// Update the current zoom factor.
// Show the progress bar.
progressBarPointer->show();
+
+ // Disable and hide the refresh action.
+ refreshActionPointer->setEnabled(false);
+ refreshActionPointer->setVisible(false);
+
+ // Enable and show the stop action.
+ stopActionPointer->setEnabled(true);
+ stopActionPointer->setVisible(true);
}
void BrowserWindow::showSettingsDialog()