From f3d3fb6041a870901ba5cf36fb49d46e577cf0d1 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 19 Jun 2009 19:08:00 +0200 Subject: Removed unuseful history dialog. We use just history panel, from now on.. --- src/historymenu.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/historymenu.cpp') diff --git a/src/historymenu.cpp b/src/historymenu.cpp index 234236ac..df8bb756 100644 --- a/src/historymenu.cpp +++ b/src/historymenu.cpp @@ -23,7 +23,6 @@ #include "historymenu.moc" #include "application.h" -#include "historydialog.h" #include #include @@ -70,7 +69,7 @@ void HistoryMenu::postPopulated() addSeparator(); KAction *showAllAction = new KAction(i18n("Show All History"), this); - connect(showAllAction, SIGNAL(triggered()), this, SLOT(showHistoryDialog())); +// connect(showAllAction, SIGNAL(triggered()), this, SLOT(showHistoryDialog())); addAction(showAllAction); KAction *clearAction = new KAction(i18n("Clear History"), this); @@ -79,14 +78,6 @@ void HistoryMenu::postPopulated() } -void HistoryMenu::showHistoryDialog() -{ - HistoryDialog *dialog = new HistoryDialog(this); - connect(dialog, SIGNAL(openUrl(const KUrl&)), this, SIGNAL(openUrl(const KUrl&))); - dialog->show(); -} - - void HistoryMenu::setInitialActions(QList actions) { m_initialActions = actions; -- cgit v1.2.1 From 205e89597c14473f34ace33c30d503eb9b7cf7e7 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 09:46:23 +0200 Subject: History Panel Action fix --- src/historymenu.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/historymenu.cpp') diff --git a/src/historymenu.cpp b/src/historymenu.cpp index df8bb756..8d75324d 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 "mainwindow.h" +// Qt Includes #include #include +// KDE Includes #include + HistoryMenu::HistoryMenu(QWidget *parent) : ModelMenu(parent) , m_history(0) @@ -68,8 +74,7 @@ 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); -- cgit v1.2.1 From 33ac88b25eeb188617da4e445e34eddefbfa8b86 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sat, 20 Jun 2009 10:36:31 +0200 Subject: RFC. History Menu Revisited. --- src/historymenu.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/historymenu.cpp') diff --git a/src/historymenu.cpp b/src/historymenu.cpp index 8d75324d..b5edae3f 100644 --- a/src/historymenu.cpp +++ b/src/historymenu.cpp @@ -33,6 +33,7 @@ // KDE Includes #include +#include HistoryMenu::HistoryMenu(QWidget *parent) @@ -78,11 +79,22 @@ void HistoryMenu::postPopulated() 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::clearHistory() +{ + int res = KMessageBox::warningYesNo(this, i18n("Are you sure you want to delete history?"), i18n("History") ); + + if (res == KMessageBox::Yes) + { + m_history->clear(); + } +} + + void HistoryMenu::setInitialActions(QList actions) { m_initialActions = actions; -- cgit v1.2.1