From b19f1410a9f0f0a0b6c9141fe399a98248eed594 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 7 Apr 2009 21:17:14 +0200 Subject: Fixed Webkit settings, removing tools actions (no use case in settings, for me) Private Browsing & Web Inspector. Fixed that actions in tools menu --- src/mainwindow.cpp | 24 ++++++++++++------------ src/mainwindow.h | 2 +- src/rekonq.kcfg | 6 ------ src/settings.cpp | 2 -- src/settings_webkit.ui | 42 ++++++++++++++---------------------------- 5 files changed, 27 insertions(+), 49 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d58208ba..54d632d2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -217,11 +217,6 @@ void MainWindow::setupActions() actionCollection()->addAction(QLatin1String("open_location"), a); connect(a, SIGNAL(triggered(bool)) , this, SLOT(slotOpenLocation())); - a = new KAction(KIcon("view-media-artist"), i18n("Private &Browsing"), this); - a->setCheckable(true); - actionCollection()->addAction(QLatin1String("private_browsing"), a); - connect(a, SIGNAL(triggered(bool)) , this, SLOT(slotPrivateBrowsing())); - a = new KAction(KIcon("zoom-in"), i18n("&Enlarge Font"), this); a->setShortcut(KShortcut(Qt::CTRL | Qt::Key_Plus)); actionCollection()->addAction(QLatin1String("bigger_font"), a); @@ -241,11 +236,17 @@ void MainWindow::setupActions() actionCollection()->addAction(QLatin1String("page_source"), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotViewPageSource())); + // ================ Tools (WebKit) Actions a = new KAction(KIcon("tools-report-bug"), i18n("Web &Inspector"), this); a->setCheckable(true); actionCollection()->addAction(QLatin1String("web_inspector"), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(slotToggleInspector(bool))); + a = new KAction(KIcon("view-media-artist"), i18n("Private &Browsing"), this); + a->setCheckable(true); + actionCollection()->addAction(QLatin1String("private_browsing"), a); + connect(a, SIGNAL(triggered(bool)) , this, SLOT(slotPrivateBrowsing(bool))); + // ================ history related actions m_historyBackAction = new KAction(KIcon("go-previous"), i18n("Back"), this); m_historyBackMenu = new KMenu(this); @@ -344,10 +345,8 @@ void MainWindow::slotUpdateConfiguration() defaultSettings->setAttribute(QWebSettings::JavascriptEnabled, ReKonfig::javascriptEnabled()); defaultSettings->setAttribute(QWebSettings::JavaEnabled, ReKonfig::javaEnabled()); defaultSettings->setAttribute(QWebSettings::PluginsEnabled, ReKonfig::pluginsEnabled()); - defaultSettings->setAttribute(QWebSettings::PrivateBrowsingEnabled, ReKonfig::privateBrowsingEnabled()); defaultSettings->setAttribute(QWebSettings::JavascriptCanOpenWindows, ReKonfig::javascriptCanOpenWindows()); defaultSettings->setAttribute(QWebSettings::JavascriptCanAccessClipboard, ReKonfig::javascriptCanAccessClipboard()); - defaultSettings->setAttribute(QWebSettings::DeveloperExtrasEnabled, ReKonfig::developerExtrasEnabled()); defaultSettings->setAttribute(QWebSettings::LinksIncludedInFocusChain, ReKonfig::linksIncludedInFocusChain()); defaultSettings->setAttribute(QWebSettings::ZoomTextOnly, ReKonfig::zoomTextOnly()); defaultSettings->setAttribute(QWebSettings::PrintElementBackgrounds, ReKonfig::printElementBackgrounds()); @@ -359,7 +358,6 @@ void MainWindow::slotUpdateConfiguration() Application::networkAccessManager()->loadSettings(); Application::cookieJar()->loadSettings(); Application::historyManager()->loadSettings(); - } @@ -545,16 +543,14 @@ void MainWindow::printRequested(QWebFrame *frame) } -void MainWindow::slotPrivateBrowsing() +void MainWindow::slotPrivateBrowsing(bool enable) { QWebSettings *settings = QWebSettings::globalSettings(); - bool pb = settings->testAttribute(QWebSettings::PrivateBrowsingEnabled); - if (!pb) + if (enable) { QString title = i18n("Are you sure you want to turn on private browsing?"); QString text = "" + title + i18n("

When private browsing in turned on," " webpages are not added to the history," - " items are automatically removed from the Downloads window," \ " new cookies are not stored, current cookies can't be accessed," \ " site icons wont be stored, session wont be saved, " \ " and searches are not addded to the pop-up menu in the Google search box." \ @@ -566,6 +562,10 @@ void MainWindow::slotPrivateBrowsing() { settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); } + else + { + actionCollection()->action("private_browsing")->setChecked(false); + } } else { diff --git a/src/mainwindow.h b/src/mainwindow.h index dc01d990..c062e86b 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -91,7 +91,7 @@ private slots: void slotFileOpen(); void slotFilePrintPreview(); void slotFilePrint(); - void slotPrivateBrowsing(); + void slotPrivateBrowsing(bool); void slotFileSaveAs(); void printRequested(QWebFrame *frame); diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index 6b74f47e..a7b7f848 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -81,18 +81,12 @@ true - - false - true false - - false - true diff --git a/src/settings.cpp b/src/settings.cpp index 7dc01d83..5922d786 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -140,10 +140,8 @@ void SettingsDialog::setWebSettingsToolTips() d->webkitUi.kcfg_javascriptEnabled->setToolTip(i18n("Enables the running of JavaScript programs.") ); d->webkitUi.kcfg_javaEnabled->setToolTip(i18n("Enables Java applets.") ); d->webkitUi.kcfg_pluginsEnabled->setToolTip(i18n("Enables plugins in web pages.") ); - d->webkitUi.kcfg_privateBrowsingEnabled->setToolTip(i18n("Prevents WebKit from recording visited pages in the history.") ); d->webkitUi.kcfg_javascriptCanOpenWindows->setToolTip(i18n("Allows JavaScript programs to opening new windows.") ); d->webkitUi.kcfg_javascriptCanAccessClipboard->setToolTip(i18n("Allows JavaScript programs to reading/writing to the clipboard.") ); - d->webkitUi.kcfg_developerExtrasEnabled->setToolTip(i18n("Enables extra tools for Web developers") ); d->webkitUi.kcfg_linksIncludedInFocusChain->setToolTip(i18n("Includes hyperlinks in the keyboard focus chain.") ); d->webkitUi.kcfg_zoomTextOnly->setToolTip(i18n("Applies the zoom factor on a frame to only the text or all content.") ); d->webkitUi.kcfg_printElementBackgrounds->setToolTip(i18n("Draws also background color and images when the page is printed.") ); diff --git a/src/settings_webkit.ui b/src/settings_webkit.ui index 0452ec8a..362e392a 100644 --- a/src/settings_webkit.ui +++ b/src/settings_webkit.ui @@ -6,8 +6,8 @@ 0 0 - 559 - 400 + 564 + 360 @@ -27,7 +27,7 @@ - + Qt::Vertical @@ -35,9 +35,9 @@ - + - Developer Extras + Links included in focus chain @@ -49,9 +49,9 @@ - + - Links included in focus chain + Zoom Text Only @@ -63,9 +63,9 @@ - + - Zoom Text Only + Print element Backgrounds @@ -77,48 +77,34 @@ - - - Print element Backgrounds - - - - - - - Private Browsing - - - - Offline storage Database - + Javascript can open windows - + Offline Web Application Cache - + Javascript can access clipboard - + Local storage database @@ -136,7 +122,7 @@ 20 - 159 + 146 -- cgit v1.2.1