summaryrefslogtreecommitdiff
path: root/src/historymenu.cpp
diff options
context:
space:
mode:
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();
+ }
}