summaryrefslogtreecommitdiff
path: root/src/tabwindow
diff options
context:
space:
mode:
Diffstat (limited to 'src/tabwindow')
-rw-r--r--src/tabwindow/tabwindow.cpp17
-rw-r--r--src/tabwindow/tabwindow.h8
2 files changed, 20 insertions, 5 deletions
diff --git a/src/tabwindow/tabwindow.cpp b/src/tabwindow/tabwindow.cpp
index a0f43fa1..cd4ec8ce 100644
--- a/src/tabwindow/tabwindow.cpp
+++ b/src/tabwindow/tabwindow.cpp
@@ -29,6 +29,7 @@
#include "tabwindow.moc"
// Local Includes
+#include "application.h"
#include "webpage.h"
#include "webwindow.h"
#include "tabbar.h"
@@ -59,10 +60,11 @@
#include <QWebSettings>
-TabWindow::TabWindow(bool withTab, QWidget *parent)
+TabWindow::TabWindow(bool withTab, bool PrivateBrowsingMode, QWidget *parent)
: RekonqWindow(parent)
, _addTabButton(new QToolButton(this))
, _openedTabsCounter(0)
+ , _isPrivateBrowsing(PrivateBrowsingMode)
{
setContentsMargins(0, 0, 0, 0);
@@ -140,6 +142,9 @@ WebWindow *TabWindow::prepareNewTab(WebPage *page)
{
WebWindow *tab = new WebWindow(this, page);
+ if (_isPrivateBrowsing)
+ tab->setPrivateBrowsing(true);
+
connect(tab, SIGNAL(titleChanged(QString)), this, SLOT(tabTitleChanged(QString)));
connect(tab, SIGNAL(loadStarted()), this, SLOT(tabLoadStarted()));
@@ -171,8 +176,8 @@ void TabWindow::loadUrl(const KUrl &url, Rekonq::OpenType type, TabHistory *hist
break;
case Rekonq::NewWindow:
- // TODO
-// emit loadUrlInNewWindow(url);
+ case Rekonq::NewPrivateWindow:
+ rApp->loadUrl(url, type);
return;
case Rekonq::CurrentTab:
@@ -500,3 +505,9 @@ void TabWindow::setFullScreen(bool makeFullScreen)
_addTabButton->setVisible(!makeFullScreen);
KToggleFullScreenAction::setFullScreen(this, makeFullScreen);
}
+
+
+bool TabWindow::isPrivateBrowsingWindowMode()
+{
+ return _isPrivateBrowsing;
+}
diff --git a/src/tabwindow/tabwindow.h b/src/tabwindow/tabwindow.h
index 882ca4e9..459621c1 100644
--- a/src/tabwindow/tabwindow.h
+++ b/src/tabwindow/tabwindow.h
@@ -59,17 +59,19 @@ class TabWindow : public RekonqWindow
Q_OBJECT
public:
- TabWindow(bool withTab = true, QWidget *parent = 0);
+ TabWindow(bool withTab = true, bool PrivateBrowsingMode = false, QWidget *parent = 0);
WebWindow* currentWebWindow() const;
WebWindow* webWindow(int index) const;
TabBar* tabBar() const;
+ bool isPrivateBrowsingWindowMode();
+
public Q_SLOTS:
void loadUrl(const KUrl &, Rekonq::OpenType type = Rekonq::CurrentTab, TabHistory *history = 0);
void newCleanTab();
-
+
private:
/**
* Prepares the new WebWindow to be open
@@ -109,6 +111,8 @@ private:
int _openedTabsCounter;
QList<TabHistory> m_recentlyClosedTabs;
+
+ bool _isPrivateBrowsing;
};
#endif // TAB_WINDOW