diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-09-25 18:02:23 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:05 +0100 |
commit | 02d9b5fe590303e540c1ff9111e0cfe3194f7e7d (patch) | |
tree | f2515238feb6593efc89621805046cca4d24b968 /src/webwindow | |
parent | Don't overwrite downloads by default (diff) | |
download | rekonq-02d9b5fe590303e540c1ff9111e0cfe3194f7e7d.tar.xz |
New Private Browsing mode :D
Diffstat (limited to 'src/webwindow')
-rw-r--r-- | src/webwindow/webwindow.cpp | 20 | ||||
-rw-r--r-- | src/webwindow/webwindow.h | 5 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp index 9e276271..592000c9 100644 --- a/src/webwindow/webwindow.cpp +++ b/src/webwindow/webwindow.cpp @@ -81,6 +81,7 @@ WebWindow::WebWindow(QWidget *parent, WebPage *pg) , m_popup(new QLabel(this)) , m_hidePopupTimer(new QTimer(this)) , _ac(new KActionCollection(this)) + , _isPrivateBrowsing(false) { if (pg) { @@ -248,10 +249,8 @@ void WebWindow::setupActions() actionCollection()->addAction(QL1S("page_source"), a); connect(a, SIGNAL(triggered(bool)), this, SLOT(viewPageSource())); - a = new KAction(KIcon("view-media-artist"), i18n("Private &Browsing"), this); - a->setCheckable(true); -// FIXME connect(a, SIGNAL(triggered(bool)), this, SLOT(setPrivateBrowsingMode(bool))); - a->setShortcut(Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_P); + a = new KAction(KIcon("view-media-artist"), i18n("New Private Window"), this); + connect(a, SIGNAL(triggered(bool)), rApp, SLOT(newPrivateBrowsingWindow())); actionCollection()->addAction(QL1S("private_browsing"), a); a = new KAction(KIcon("edit-clear"), i18n("Clear Private Data..."), this); @@ -845,3 +844,16 @@ void WebWindow::toggleBookmarksToolbar(bool b) a->setChecked(b); rApp->bookmarksToolbarToggled(b); } + + +bool WebWindow::isPrivateBrowsing() +{ + return _isPrivateBrowsing; +} + + +void WebWindow::setPrivateBrowsing(bool on) +{ + _tab->page()->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, on); + _isPrivateBrowsing = on; +} diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h index 35de3f10..affa5cb1 100644 --- a/src/webwindow/webwindow.h +++ b/src/webwindow/webwindow.h @@ -83,12 +83,15 @@ public: virtual KActionCollection *actionCollection() const; QAction *actionByName(const QString &name); + bool isPrivateBrowsing(); + private: void setupActions(); void setupTools(); public Q_SLOTS: void setWidgetsHidden(bool hide); + void setPrivateBrowsing(bool); private Q_SLOTS: void webLoadProgress(int); @@ -158,6 +161,8 @@ private: QTimer *m_hidePopupTimer; KActionCollection *_ac; + + bool _isPrivateBrowsing; }; #endif // WEB_WINDOW |