diff options
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 |