summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-07-25 03:22:15 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-07-26 12:00:20 +0200
commitfdc0144fe2df0b49dc1252ca068180c17929845a (patch)
tree695e09aa4a20055d720f88c99c544c2b156eeee3 /src
parentUpdated TODO (diff)
downloadrekonq-fdc0144fe2df0b49dc1252ca068180c17929845a.tar.xz
Clear Private Data 1st implementation
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/mainwindow.cpp54
-rw-r--r--src/mainwindow.h3
3 files changed, 55 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 73ef1dc0..4fed658f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -45,6 +45,7 @@ KDE4_ADD_UI_FILES( rekonq_SRCS
settings_privacy.ui
settings_proxy.ui
settings_webkit.ui
+ cleardata.ui
)
KDE4_ADD_KCFG_FILES( rekonq_SRCS rekonq.kcfgc )
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 27b9a65b..2d809162 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -42,6 +42,9 @@
#include "urlbar.h"
#include "stackedurlbar.h"
+// Ui Includes
+#include "ui_cleardata.h"
+
// KDE Includes
#include <KUrl>
#include <KStatusBar>
@@ -320,6 +323,11 @@ void MainWindow::setupActions()
a->setShortcuts(QApplication::isRightToLeft() ? KStandardShortcut::tabNext() : KStandardShortcut::tabPrev());
actionCollection()->addAction(QLatin1String("show_prev_tab"), a);
connect(a, SIGNAL(triggered(bool)), m_view, SLOT(previousTab()));
+
+ // clear private data action
+ a = new KAction(KIcon("edit-clear"), i18n("Clear private data"), this);
+ actionCollection()->addAction(QLatin1String("clear_private_data"), a);
+ connect(a, SIGNAL(triggered(bool)), this, SLOT(clearPrivateData()));
}
@@ -331,16 +339,17 @@ void MainWindow::setupTools()
toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::SaveAs)));
toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Print)));
toolsMenu->addAction(actionByName(KStandardAction::name(KStandardAction::Find)));
-
- toolsMenu->addSeparator();
KActionMenu *webMenu = new KActionMenu(KIcon("applications-development-web"), i18n("Web Development"), this);
webMenu->addAction(actionByName(QLatin1String("web_inspector")));
webMenu->addAction(actionByName(QLatin1String("page_source")));
toolsMenu->addAction(webMenu);
+
+ toolsMenu->addSeparator();
toolsMenu->addAction(actionByName(QLatin1String("private_browsing")));
-
+ toolsMenu->addAction(actionByName(QLatin1String("clear_private_data")));
+
toolsMenu->addSeparator();
toolsMenu->addAction(actionByName(QLatin1String("show_history_panel")));
@@ -929,3 +938,42 @@ void MainWindow::notifyMessage(const QString &msg, Rekonq::Notify status)
m_popup->show(p);
}
+
+
+void MainWindow::clearPrivateData()
+{
+ QPointer<KDialog> dialog = new KDialog(this, Qt::Sheet);
+ dialog->setButtons(KDialog::Ok | KDialog::Cancel);
+
+ Ui::ClearDataWidget clearWidget;
+ QWidget widget;
+ clearWidget.setupUi(&widget);
+
+ dialog->setMainWidget(&widget);
+
+ if (dialog->exec() == KDialog::Ok)
+ {
+ if(clearWidget.clearHistory->isChecked())
+ {
+ Application::historyManager()->clear();
+ }
+
+ if(clearWidget.clearCookies->isChecked())
+ {
+ Application::cookieJar()->clear();
+ }
+
+ if(clearWidget.clearCachedPages->isChecked())
+ {
+ Application::historyManager()->clear();
+ }
+
+ if(clearWidget.clearWebIcons->isChecked())
+ {
+ Application::historyManager()->clear();
+ }
+ }
+ delete dialog;
+}
+
+ \ No newline at end of file
diff --git a/src/mainwindow.h b/src/mainwindow.h
index aa00e274..85d272e7 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -132,6 +132,9 @@ private slots:
void slotShowMenubar(bool enable);
void slotPreferences();
+ // clear private data
+ void clearPrivateData();
+
private:
MainView *m_view;
FindBar *m_findBar;