diff options
-rw-r--r-- | src/mainwindow.cpp | 8 | ||||
-rw-r--r-- | src/mainwindow.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index abc3fcd5..20ee31f8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -288,7 +288,7 @@ void MainWindow::setupActions() 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))); + connect(a, SIGNAL(triggered(bool)), this, SLOT(slotPrivateBrowsing(bool))); // ================ history related actions m_historyBackAction = new KAction(KIcon("go-previous"), i18n("Back"), this); @@ -524,7 +524,7 @@ void MainWindow::printRequested(QWebFrame *frame) void MainWindow::slotPrivateBrowsing(bool enable) { QWebSettings *settings = QWebSettings::globalSettings(); - if (enable) + if (enable && !settings->testAttribute(QWebSettings::PrivateBrowsingEnabled)) { QString title = i18n("Are you sure you want to turn on private browsing?"); QString text = "<b>" + title + i18n("</b><br><br>When private browsing is turned on," @@ -535,8 +535,8 @@ void MainWindow::slotPrivateBrowsing(bool enable) " Until you close the window, you can still click the Back and Forward buttons" \ " to return to the web pages you have opened."); - int button = KMessageBox::questionYesNo(this, text, title); - if (button == KMessageBox::Ok) + int button = KMessageBox::questionYesNo(this, text, title); + if (button == KMessageBox::Yes) { settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true); } diff --git a/src/mainwindow.h b/src/mainwindow.h index 411cbe6c..7fcc432c 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -102,7 +102,6 @@ private slots: void slotFileOpen(); void slotFilePrintPreview(); void slotFilePrint(); - void slotPrivateBrowsing(bool); void slotFileSaveAs(); void printRequested(QWebFrame *frame); @@ -120,6 +119,7 @@ private slots: // Tools Menu slots void slotToggleInspector(bool enable); + void slotPrivateBrowsing(bool enable); // Settings Menu slots void slotShowMenubar(bool enable); |