Commit 06c1a4a7 authored by Laurent Montel's avatar Laurent Montel 😁

Move code to LaunchExternalComponent

parent 27738351
......@@ -25,11 +25,13 @@
#include "archivemailagentinterface.h"
#include "sendlateragentinterface.h"
#include "followupreminderinterface.h"
#include "mailcommon/filter/filtermanager.h"
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply>
#include <QProcess>
#include <QDebug>
#include <antispam-virus/antispamwizard.h>
KMLaunchExternalComponent::KMLaunchExternalComponent(QWidget *parentWidget, QObject *parent)
: QObject(parent),
......@@ -131,3 +133,20 @@ void KMLaunchExternalComponent::slotAccountWizard()
"Please check your installation." ),
i18n( "Unable to start account wizard" ) );
}
void KMLaunchExternalComponent::slotAntiSpamWizard()
{
KMail::AntiSpamWizard wiz( KMail::AntiSpamWizard::AntiSpam, mParentWidget );
wiz.exec();
}
void KMLaunchExternalComponent::slotAntiVirusWizard()
{
KMail::AntiSpamWizard wiz( KMail::AntiSpamWizard::AntiVirus, mParentWidget);
wiz.exec();
}
void KMLaunchExternalComponent::slotFilterLogViewer()
{
MailCommon::FilterManager::instance()->showFilterLogDialog( (qlonglong)mParentWidget->winId() );
}
......@@ -38,6 +38,9 @@ public Q_SLOTS:
void slotAddrBook();
void slotImport();
void slotAccountWizard();
void slotFilterLogViewer();
void slotAntiVirusWizard();
void slotAntiSpamWizard();
private:
QWidget *mParentWidget;
};
......
......@@ -2934,17 +2934,17 @@ void KMMainWidget::setupActions()
{
KAction *action = new KAction(i18n("Filter &Log Viewer..."), this);
actionCollection()->addAction(QLatin1String("filter_log_viewer"), action );
connect(action, SIGNAL(triggered(bool)), SLOT(slotFilterLogViewer()));
connect(action, SIGNAL(triggered(bool)), mLaunchExternalComponent, SLOT(slotFilterLogViewer()));
}
{
KAction *action = new KAction(i18n("&Anti-Spam Wizard..."), this);
actionCollection()->addAction(QLatin1String("antiSpamWizard"), action );
connect(action, SIGNAL(triggered(bool)), SLOT(slotAntiSpamWizard()));
connect(action, SIGNAL(triggered(bool)), mLaunchExternalComponent, SLOT(slotAntiSpamWizard()));
}
{
KAction *action = new KAction(i18n("&Anti-Virus Wizard..."), this);
actionCollection()->addAction(QLatin1String("antiVirusWizard"), action );
connect(action, SIGNAL(triggered(bool)), SLOT(slotAntiVirusWizard()));
connect(action, SIGNAL(triggered(bool)), mLaunchExternalComponent, SLOT(slotAntiVirusWizard()));
}
{
KAction *action = new KAction( i18n("&Account Wizard..."), this );
......@@ -4192,26 +4192,6 @@ void KMMainWidget::initializeFilterActions()
updateMessageActions();
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotAntiSpamWizard()
{
AntiSpamWizard wiz( AntiSpamWizard::AntiSpam, this );
wiz.exec();
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotAntiVirusWizard()
{
AntiSpamWizard wiz( AntiSpamWizard::AntiVirus, this);
wiz.exec();
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotFilterLogViewer()
{
MailCommon::FilterManager::instance()->showFilterLogDialog( (qlonglong)winId() );
}
//-----------------------------------------------------------------------------
void KMMainWidget::updateFileMenu()
{
......
......@@ -344,9 +344,6 @@ protected slots:
void slotShowStartupFolder();
/** Show tip-of-the-day, forced */
void slotShowTip();
void slotAntiSpamWizard();
void slotAntiVirusWizard();
void slotFilterLogViewer();
/** Message navigation */
void slotSelectNextMessage();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment