Commit 249ceed9 authored by Laurent Montel's avatar Laurent Montel 😁

Move more code to kmlaunchexternalcomponent

parent 626c857e
......@@ -19,7 +19,9 @@
#include <KMessageBox>
#include <KLocalizedString>
#include <KStandardDirs>
#include <KRun>
#include "util.h"
#include "archivemailagentinterface.h"
#include "sendlateragentinterface.h"
#include "followupreminderinterface.h"
......@@ -106,3 +108,18 @@ void KMLaunchExternalComponent::slotExportData()
"Please check your installation." ),
i18n( "Unable to start \"PIM Setting Exporter\" program" ) );
}
void KMLaunchExternalComponent::slotAddrBook()
{
KRun::runCommand(QLatin1String("kaddressbook"), mParentWidget->window());
}
void KMLaunchExternalComponent::slotImport()
{
KRun::runCommand(QLatin1String("kmailcvt"), mParentWidget->window());
}
void KMLaunchExternalComponent::slotAccountWizard()
{
KMail::Util::launchAccountWizard( mParentWidget );
}
......@@ -35,6 +35,9 @@ public Q_SLOTS:
void slotStartWatchGnuPG();
void slotImportWizard();
void slotExportData();
void slotAddrBook();
void slotImport();
void slotAccountWizard();
private:
QWidget *mParentWidget;
};
......
......@@ -148,7 +148,6 @@ using KSieveUi::SieveDebugDialog;
#include <kaboutdata.h>
#include <kicon.h>
#include <kwindowsystem.h>
#include <krun.h>
#include <kmessagebox.h>
#include <kactionmenu.h>
#include <kmenu.h>
......@@ -1303,20 +1302,6 @@ void KMMainWidget::slotManageSieveScripts()
mManageSieveDialog->show();
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotAddrBook()
{
KRun::runCommand(QLatin1String("kaddressbook"), window());
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotImport()
{
KRun::runCommand(QLatin1String("kmailcvt"), window());
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotCheckMail()
{
......@@ -2977,7 +2962,7 @@ void KMMainWidget::setupActions()
if (parent()->inherits("KMMainWin")) {
KAction *action = new KAction(KIcon(QLatin1String("x-office-address-book")), i18n("&Address Book"), this);
actionCollection()->addAction(QLatin1String("addressbook"), action );
connect(action, SIGNAL(triggered(bool)), SLOT(slotAddrBook()));
connect(action, SIGNAL(triggered(bool)), mLaunchExternalComponent, SLOT(slotAddrBook()));
if (KStandardDirs::findExe(QLatin1String("kaddressbook")).isEmpty())
action->setEnabled(false);
}
......@@ -3006,7 +2991,7 @@ void KMMainWidget::setupActions()
{
KAction *action = new KAction(KIcon(QLatin1String("document-import")), i18n("&Import Messages..."), this);
actionCollection()->addAction(QLatin1String("import"), action );
connect(action, SIGNAL(triggered(bool)), SLOT(slotImport()));
connect(action, SIGNAL(triggered(bool)), mLaunchExternalComponent, SLOT(slotImport()));
if (KStandardDirs::findExe(QLatin1String("kmailcvt")).isEmpty()) action->setEnabled(false);
}
......@@ -3036,7 +3021,7 @@ void KMMainWidget::setupActions()
{
KAction *action = new KAction( i18n("&Account Wizard..."), this );
actionCollection()->addAction( QLatin1String("accountWizard"), action );
connect( action, SIGNAL(triggered(bool)), SLOT(slotAccountWizard()) );
connect( action, SIGNAL(triggered(bool)), mLaunchExternalComponent, SLOT(slotAccountWizard()) );
}
{
KAction *action = new KAction( i18n("&Import Wizard..."), this );
......@@ -4291,11 +4276,6 @@ void KMMainWidget::slotAntiVirusWizard()
AntiSpamWizard wiz( AntiSpamWizard::AntiVirus, this);
wiz.exec();
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotAccountWizard()
{
KMail::Util::launchAccountWizard( this );
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotFilterLogViewer()
......
......@@ -294,8 +294,6 @@ protected slots:
void slotHelp();
void slotFilter();
void slotManageSieveScripts();
void slotAddrBook();
void slotImport();
void slotCompose();
void slotPostToML();
void slotExpireFolder();
......@@ -349,7 +347,6 @@ protected slots:
void slotAntiSpamWizard();
void slotAntiVirusWizard();
void slotFilterLogViewer();
void slotAccountWizard();
/** 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