Merge remote-tracking branch 'origin/KDE/4.14'

Conflicts:
	kmail/kmlaunchexternalcomponent.h
	kmail/kmmainwidget.cpp
	kmail/kmmainwidget.h
wilder-work
Montel Laurent 11 years ago
commit 6cd84ce334
  1. 2
      CMakeLists.txt
  2. 51
      kmlaunchexternalcomponent.cpp
  3. 16
      kmlaunchexternalcomponent.h
  4. 68
      kmmainwidget.cpp
  5. 8
      kmmainwidget.h

@ -188,7 +188,7 @@ if (KDEPIM_BUILD_DESKTOP)
util.cpp
messageactions.cpp
foldershortcutactionmanager.cpp
kmconfigureagent.cpp
kmlaunchexternalcomponent.cpp
manageshowcollectionproperties.cpp
${kmailprivate_attributes_LIB_SRCS}
${kmailprivate_tag_LIB_SRCS}

@ -15,9 +15,10 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "kmconfigureagent.h"
#include "kmlaunchexternalcomponent.h"
#include <KMessageBox>
#include <KLocalizedString>
#include <KStandardDirs>
#include "archivemailagentinterface.h"
#include "sendlateragentinterface.h"
@ -25,20 +26,22 @@
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply>
#include <QProcess>
#include <QDebug>
KMConfigureAgent::KMConfigureAgent(QWidget *parentWidget, QObject *parent)
KMLaunchExternalComponent::KMLaunchExternalComponent(QWidget *parentWidget, QObject *parent)
: QObject(parent),
mParentWidget(parentWidget)
{
}
KMConfigureAgent::~KMConfigureAgent()
KMLaunchExternalComponent::~KMLaunchExternalComponent()
{
}
void KMConfigureAgent::slotConfigureAutomaticArchiving()
void KMLaunchExternalComponent::slotConfigureAutomaticArchiving()
{
OrgFreedesktopAkonadiArchiveMailAgentInterface archiveMailInterface(QLatin1String("org.freedesktop.Akonadi.ArchiveMailAgent"), QLatin1String("/ArchiveMailAgent"), QDBusConnection::sessionBus(), this);
if (archiveMailInterface.isValid()) {
@ -48,7 +51,7 @@ void KMConfigureAgent::slotConfigureAutomaticArchiving()
}
}
void KMConfigureAgent::slotConfigureSendLater()
void KMLaunchExternalComponent::slotConfigureSendLater()
{
OrgFreedesktopAkonadiSendLaterAgentInterface sendLaterInterface(QLatin1String("org.freedesktop.Akonadi.SendLaterAgent"), QLatin1String("/SendLaterAgent"), QDBusConnection::sessionBus(), this);
if (sendLaterInterface.isValid()) {
@ -58,7 +61,7 @@ void KMConfigureAgent::slotConfigureSendLater()
}
}
void KMConfigureAgent::slotConfigureFollowupReminder()
void KMLaunchExternalComponent::slotConfigureFollowupReminder()
{
OrgFreedesktopAkonadiFollowUpReminderAgentInterface followUpInterface(QLatin1String("org.freedesktop.Akonadi.FollowUpReminder"), QLatin1String("/FollowUpReminder"), QDBusConnection::sessionBus(), this);
if (followUpInterface.isValid()) {
@ -67,3 +70,39 @@ void KMConfigureAgent::slotConfigureFollowupReminder()
KMessageBox::error(mParentWidget, i18n("Followup Reminder Agent was not registered."));
}
}
void KMLaunchExternalComponent::slotStartCertManager()
{
if ( !QProcess::startDetached(QLatin1String("kleopatra") ) )
KMessageBox::error( mParentWidget, i18n( "Could not start certificate manager; "
"please check your installation." ),
i18n( "KMail Error" ) );
else
qDebug() << "slotStartCertManager(): certificate manager started.";
}
void KMLaunchExternalComponent::slotStartWatchGnuPG()
{
if ( !QProcess::startDetached(QLatin1String("kwatchgnupg")) )
KMessageBox::error( mParentWidget, i18n( "Could not start GnuPG LogViewer (kwatchgnupg); "
"please check your installation." ),
i18n( "KMail Error" ) );
}
void KMLaunchExternalComponent::slotImportWizard()
{
const QString path = KStandardDirs::findExe( QLatin1String("importwizard" ) );
if ( !QProcess::startDetached( path ) )
KMessageBox::error( mParentWidget, i18n( "Could not start the import wizard. "
"Please check your installation." ),
i18n( "Unable to start import wizard" ) );
}
void KMLaunchExternalComponent::slotExportData()
{
const QString path = KStandardDirs::findExe( QLatin1String("pimsettingexporter" ) );
if ( !QProcess::startDetached( path ) )
KMessageBox::error( mParentWidget, i18n( "Could not start \"PIM Setting Exporter\" program. "
"Please check your installation." ),
i18n( "Unable to start \"PIM Setting Exporter\" program" ) );
}

@ -15,24 +15,28 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KMCONFIGUREAGENT_H
#define KMCONFIGUREAGENT_H
#ifndef KMLAUNCHEXTERNALCOMPONENT_H
#define KMLAUNCHEXTERNALCOMPONENT_H
#include <QObject>
class KMConfigureAgent : public QObject
class KMLaunchExternalComponent : public QObject
{
Q_OBJECT
public:
explicit KMConfigureAgent(QWidget *parentWidget, QObject *parent = Q_NULLPTR);
~KMConfigureAgent();
explicit KMLaunchExternalComponent(QWidget *parentWidget, QObject *parent = Q_NULLPTR);
~KMLaunchExternalComponent();
public Q_SLOTS:
void slotConfigureSendLater();
void slotConfigureAutomaticArchiving();
void slotConfigureFollowupReminder();
void slotStartCertManager();
void slotStartWatchGnuPG();
void slotImportWizard();
void slotExportData();
private:
QWidget *mParentWidget;
};
#endif // KMCONFIGUREAGENT_H
#endif // KMLAUNCHEXTERNALCOMPONENT_H

@ -96,7 +96,7 @@ using KSieveUi::SieveDebugDialog;
#include "widgets/displaymessageformatactionmenu.h"
#include "ksieveui/vacation/vacationmanager.h"
#include "kmconfigureagent.h"
#include "kmlaunchexternalcomponent.h"
// LIBKDEPIM includes
#include "progresswidget/progressmanager.h"
@ -183,15 +183,13 @@ using KSieveUi::SieveDebugDialog;
#include <QProcess>
#include <QDBusConnection>
#include <QTextDocument>
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply>
#include <QDBusPendingCallWatcher>
#include <QDir>
// System includes
#include <errno.h> // ugh
#include <AkonadiWidgets/standardactionmanager.h>
#include <KHelpClient>
#include <QStandardPaths>
#include <QMenu>
#include <job/manageserversidesubscriptionjob.h>
#include <job/removeduplicatemailjob.h>
@ -205,9 +203,6 @@ using KMail::AntiSpamWizard;
using KMime::Types::AddrSpecList;
using MessageViewer::AttachmentStrategy;
Q_DECLARE_METATYPE(KPIM::ProgressItem *)
Q_DECLARE_METATYPE(Akonadi::Job *)
Q_DECLARE_METATYPE(QPointer<KPIM::ProgressItem>)
Q_GLOBAL_STATIC(KMMainWidget::PtrList, theMainWidgetList)
//-----------------------------------------------------------------------------
@ -232,7 +227,7 @@ KMMainWidget::KMMainWidget(QWidget *parent, KXMLGUIClient *aGUIClient,
mSearchMessages(0),
mManageShowCollectionProperties(new ManageShowCollectionProperties(this, this))
{
mConfigAgent = new KMConfigureAgent(this, this);
mLaunchExternalComponent = new KMLaunchExternalComponent(this, this);
// must be the first line of the constructor:
mStartupDone = false;
mWasEverShown = false;
@ -1467,7 +1462,6 @@ void KMMainWidget::slotExpireFolder()
}
bool mustDeleteExpirationAttribute = false;
MailCommon::ExpireCollectionAttribute *attr = MailCommon::ExpireCollectionAttribute::expirationCollectionAttribute(mCurrentFolder->collection(), mustDeleteExpirationAttribute);
;
bool canBeExpired = true;
if (!attr->isAutoExpire()) {
canBeExpired = false;
@ -2331,28 +2325,6 @@ void KMMainWidget::slotDebugSieve()
#endif
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotStartCertManager()
{
if (!QProcess::startDetached(QLatin1String("kleopatra")))
KMessageBox::error(this, i18n("Could not start certificate manager; "
"please check your installation."),
i18n("KMail Error"));
else {
qDebug() << "\nslotStartCertManager(): certificate manager started.";
}
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotStartWatchGnuPG()
{
if (!QProcess::startDetached(QLatin1String("kwatchgnupg")))
KMessageBox::error(this, i18n("Could not start GnuPG LogViewer (kwatchgnupg); "
"please check your installation."),
i18n("KMail Error"));
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotConfigChanged()
{
readConfig();
@ -3026,7 +2998,7 @@ void KMMainWidget::setupActions()
{
QAction *action = new QAction(QIcon::fromTheme(QLatin1String("pgp-keys")), i18n("Certificate Manager"), this);
actionCollection()->addAction(QLatin1String("tools_start_certman"), action);
connect(action, &QAction::triggered, this, &KMMainWidget::slotStartCertManager);
connect(action, &QAction::triggered, mLaunchExternalComponent, &KMLaunchExternalComponent::slotStartCertManager);
// disable action if no certman binary is around
if (QStandardPaths::findExecutable(QLatin1String("kleopatra")).isEmpty()) {
action->setEnabled(false);
@ -3035,7 +3007,7 @@ void KMMainWidget::setupActions()
{
QAction *action = new QAction(QIcon::fromTheme(QLatin1String("pgp-keys")), i18n("GnuPG Log Viewer"), this);
actionCollection()->addAction(QLatin1String("tools_start_kwatchgnupg"), action);
connect(action, &QAction::triggered, this, &KMMainWidget::slotStartWatchGnuPG);
connect(action, &QAction::triggered, mLaunchExternalComponent, &KMLaunchExternalComponent::slotStartWatchGnuPG);
#ifdef Q_OS_WIN32
// not ported yet, underlying infrastructure missing on Windows
const bool usableKWatchGnupg = false;
@ -3085,7 +3057,7 @@ void KMMainWidget::setupActions()
{
QAction *action = new QAction(i18n("&Import Wizard..."), this);
actionCollection()->addAction(QLatin1String("importWizard"), action);
connect(action, &QAction::triggered, this, &KMMainWidget::slotImportWizard);
connect(action, &QAction::triggered, mLaunchExternalComponent, &KMLaunchExternalComponent::slotImportWizard);
}
if (KSieveUi::Util::allowOutOfOfficeSettings()) {
QAction *action = new QAction(i18n("Edit \"Out of Office\" Replies..."), this);
@ -3096,19 +3068,19 @@ void KMMainWidget::setupActions()
{
QAction *action = new QAction(i18n("&Configure Automatic Archiving..."), this);
actionCollection()->addAction(QLatin1String("tools_automatic_archiving"), action);
connect(action, &QAction::triggered, mConfigAgent, &KMConfigureAgent::slotConfigureAutomaticArchiving);
connect(action, &QAction::triggered, mLaunchExternalComponent, &KMLaunchExternalComponent::slotConfigureAutomaticArchiving);
}
{
QAction *action = new QAction(i18n("Delayed Messages..."), this);
actionCollection()->addAction(QLatin1String("message_delayed"), action);
connect(action, &QAction::triggered, mConfigAgent, &KMConfigureAgent::slotConfigureSendLater);
connect(action, &QAction::triggered, mLaunchExternalComponent, &KMLaunchExternalComponent::slotConfigureSendLater);
}
{
QAction *action = new QAction(i18n("Followup Reminder Messages..."), this);
actionCollection()->addAction(QLatin1String("followup_reminder_messages"), action);
connect(action, &QAction::triggered, mConfigAgent, &KMConfigureAgent::slotConfigureFollowupReminder);
connect(action, &QAction::triggered, mLaunchExternalComponent, &KMLaunchExternalComponent::slotConfigureFollowupReminder);
}
// Disable the standard action delete key sortcut.
@ -3519,7 +3491,7 @@ void KMMainWidget::setupActions()
{
QAction *action = new QAction(QIcon::fromTheme(QLatin1String("kmail")), i18n("&Export KMail Data..."), this);
actionCollection()->addAction(QLatin1String("kmail_export_data"), action);
connect(action, &QAction::triggered, this, &KMMainWidget::slotExportData);
connect(action, &QAction::triggered, mLaunchExternalComponent, &KMLaunchExternalComponent::slotExportData);
}
{
@ -4336,15 +4308,6 @@ void KMMainWidget::slotAccountWizard()
KMail::Util::launchAccountWizard(this);
}
void KMMainWidget::slotImportWizard()
{
const QString path = QStandardPaths::findExecutable(QLatin1String("importwizard"));
if (!QProcess::startDetached(path))
KMessageBox::error(this, i18n("Could not start the import wizard. "
"Please check your installation."),
i18n("Unable to start import wizard"));
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotFilterLogViewer()
{
@ -4585,15 +4548,6 @@ void KMMainWidget::updatePaneTagComboBox()
}
}
void KMMainWidget::slotExportData()
{
const QString path = QStandardPaths::findExecutable(QLatin1String("pimsettingexporter"));
if (!QProcess::startDetached(path))
KMessageBox::error(this, i18n("Could not start \"PIM Setting Exporter\" program. "
"Please check your installation."),
i18n("Unable to start \"PIM Setting Exporter\" program"));
}
void KMMainWidget::slotCreateAddressBookContact()
{
CreateNewContactJob *job = new CreateNewContactJob(this, this);

@ -50,7 +50,7 @@ class Message;
class KUrl;
class QVBoxLayout;
class QSplitter;
class KMConfigureAgent;
class KMLaunchExternalComponent;
class DisplayMessageFormatActionMenu;
class QMenu;
class QAction;
@ -363,8 +363,6 @@ protected slots:
void slotResendMsg();
void slotCheckVacation();
void slotDebugSieve();
void slotStartCertManager();
void slotStartWatchGnuPG();
void slotApplyFilters();
void slotApplyFiltersOnFolder();
void slotExpandThread();
@ -394,7 +392,6 @@ protected slots:
void slotAntiVirusWizard();
void slotFilterLogViewer();
void slotAccountWizard();
void slotImportWizard();
/** Message navigation */
void slotSelectNextMessage();
@ -463,7 +460,6 @@ protected slots:
void slotCollectionChanged(const Akonadi::Collection &, const QSet<QByteArray> &);
void slotCreateNewTab(bool);
void slotUpdateActionsAfterMailChecking();
void slotExportData();
void slotCreateAddressBookContact();
void slotOpenRecentMsg(const QUrl &url);
@ -656,7 +652,7 @@ private:
DisplayMessageFormatActionMenu *mDisplayMessageFormatMenu;
MessageViewer::Viewer::DisplayFormatMessage mFolderDisplayFormatPreference;
QAction *mSearchMessages;
KMConfigureAgent *mConfigAgent;
KMLaunchExternalComponent *mLaunchExternalComponent;
ManageShowCollectionProperties *mManageShowCollectionProperties;
};

Loading…
Cancel
Save