summaryrefslogtreecommitdiff
path: root/src/historymenu.cpp
diff options
context:
space:
mode:
authorPanagiotis Papadopoulos <pano_90@gmx.net>2009-06-21 23:08:53 +0200
committerPanagiotis Papadopoulos <pano_90@gmx.net>2009-06-21 23:08:53 +0200
commit4e4c628ca96fb9cc2810cfd1c93ce4db2ed77c2d (patch)
tree933b7f75f631da867c342bbf86cb3b0d68e2d6fe /src/historymenu.cpp
parentModified strings in the WebKit settings a bit (diff)
parent0.1.6 version with new notifying system (diff)
downloadrekonq-4e4c628ca96fb9cc2810cfd1c93ce4db2ed77c2d.tar.xz
Merge commit 'rekonq-master/master'
Diffstat (limited to 'src/historymenu.cpp')
-rw-r--r--src/historymenu.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/historymenu.cpp b/src/historymenu.cpp
index 234236ac..b5edae3f 100644
--- a/src/historymenu.cpp
+++ b/src/historymenu.cpp
@@ -19,16 +19,22 @@
* ============================================================ */
+// Auto Includes
#include "historymenu.h"
#include "historymenu.moc"
+// Local Includes
#include "application.h"
-#include "historydialog.h"
+#include "mainwindow.h"
+// Qt Includes
#include <QtGui/QWidget>
#include <QtCore/QModelIndex>
+// KDE Includes
#include <KUrl>
+#include <KMessageBox>
+
HistoryMenu::HistoryMenu(QWidget *parent)
: ModelMenu(parent)
@@ -69,21 +75,23 @@ void HistoryMenu::postPopulated()
if (m_history->history().count() > 0)
addSeparator();
- KAction *showAllAction = new KAction(i18n("Show All History"), this);
- connect(showAllAction, SIGNAL(triggered()), this, SLOT(showHistoryDialog()));
+ QAction *showAllAction = Application::instance()->mainWindow()->actionByName("show_history_panel");
addAction(showAllAction);
KAction *clearAction = new KAction(i18n("Clear History"), this);
- connect(clearAction, SIGNAL(triggered()), m_history, SLOT(clear()));
+ connect(clearAction, SIGNAL(triggered()), this, SLOT(clearHistory()));
addAction(clearAction);
}
-void HistoryMenu::showHistoryDialog()
+void HistoryMenu::clearHistory()
{
- HistoryDialog *dialog = new HistoryDialog(this);
- connect(dialog, SIGNAL(openUrl(const KUrl&)), this, SIGNAL(openUrl(const KUrl&)));
- dialog->show();
+ int res = KMessageBox::warningYesNo(this, i18n("Are you sure you want to delete history?"), i18n("History") );
+
+ if (res == KMessageBox::Yes)
+ {
+ m_history->clear();
+ }
}