diff options
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/mainwindow.cpp | 54 | ||||
-rw-r--r-- | src/mainwindow.h | 3 |
4 files changed, 56 insertions, 3 deletions
@@ -18,3 +18,4 @@ TO 0.2 release - no reKonfig in loadUrl * history menu - clear private data +- BKO
\ No newline at end of file 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; |