summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-10 05:48:32 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-10 05:48:32 (GMT)
commit7d49e8fe594ebd98817da767379630e061f17170 (patch)
tree322751b4567619b1a1c05b05d731faa1d28a2547
parentc84b8fecc3a895f3e5396d8d02d0286cd0de5c10 (diff)
Add signal/slot
-rw-r--r--kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp22
-rw-r--r--kaddressbook/importexportplugins/csv/csvimportexportplugininterface.h3
-rw-r--r--kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp13
-rw-r--r--kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.h2
-rw-r--r--kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp21
-rw-r--r--kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.h3
6 files changed, 64 insertions, 0 deletions
diff --git a/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp b/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp
index aaaeade..3470cdc 100644
--- a/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp
+++ b/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.cpp
@@ -40,13 +40,35 @@ void CSVImportExportPluginInterface::createAction(KActionCollection *ac)
action->setText(i18n("Export CSV file..."));
action->setWhatsThis(i18n("Export contacts to a file in comma separated value format."));
setExportActions(QList<QAction *>() << action);
+ connect(action, &QAction::triggered, this, &CSVImportExportPluginInterface::slotExportCVS);
action = ac->addAction(QStringLiteral("file_import_csv"));
action->setText(i18n("Import CSV file..."));
action->setWhatsThis(i18n("Import contacts from a file in comma separated value format."));
setImportActions(QList<QAction *>() << action);
+ connect(action, &QAction::triggered, this, &CSVImportExportPluginInterface::slotImportCVS);
}
+
void CSVImportExportPluginInterface::exec()
{
+ switch(mImportExportAction) {
+ case Import:
+ break;
+ case Export:
+ break;
+ }
+ //TODO
+}
+
+void CSVImportExportPluginInterface::slotImportCVS()
+{
+ mImportExportAction = Import;
+ Q_EMIT emitPluginActivated(this);
+}
+
+void CSVImportExportPluginInterface::slotExportCVS()
+{
+ mImportExportAction = Export;
+ Q_EMIT emitPluginActivated(this);
}
diff --git a/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.h b/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.h
index 1bc3669..6e0bdc4 100644
--- a/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.h
+++ b/kaddressbook/importexportplugins/csv/csvimportexportplugininterface.h
@@ -31,6 +31,9 @@ public:
void createAction(KActionCollection *ac) Q_DECL_OVERRIDE;
void exec() Q_DECL_OVERRIDE;
+private:
+ void slotImportCVS();
+ void slotExportCVS();
};
#endif // CSVIMPORTEXPORTPLUGININTERFACE_H
diff --git a/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp b/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp
index 9897b50..e78e792 100644
--- a/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp
+++ b/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.cpp
@@ -40,9 +40,22 @@ void LDapImportExportPluginInterface::createAction(KActionCollection *ac)
action->setText(i18n("Import From LDAP server..."));
action->setWhatsThis(i18n("Import contacts from an LDAP server."));
setImportActions(QList<QAction *>() << action);
+ connect(action, &QAction::triggered, this, &LDapImportExportPluginInterface::slotImportLdap);
}
void LDapImportExportPluginInterface::exec()
{
+ switch(mImportExportAction) {
+ case Import:
+ break;
+ case Export:
+ break;
+ }
//TODO
}
+
+void LDapImportExportPluginInterface::slotImportLdap()
+{
+ mImportExportAction = Import;
+ Q_EMIT emitPluginActivated(this);
+}
diff --git a/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.h b/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.h
index 57d6c9f..07e2228 100644
--- a/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.h
+++ b/kaddressbook/importexportplugins/ldap/ldapimportexportplugininterface.h
@@ -31,6 +31,8 @@ public:
void createAction(KActionCollection *ac) Q_DECL_OVERRIDE;
void exec() Q_DECL_OVERRIDE;
+private:
+ void slotImportLdap();
};
#endif // LDAPIMPORTEXPORTPLUGININTERFACE_H
diff --git a/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp b/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp
index 32a45be..b7e8350 100644
--- a/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp
+++ b/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.cpp
@@ -39,14 +39,35 @@ void LDifImportExportPluginInterface::createAction(KActionCollection *ac)
QAction *action = ac->addAction(QStringLiteral("file_import_ldif"));
action->setText(i18n("Import LDIF file..."));
action->setWhatsThis(i18n("Import contacts from an LDIF file."));
+ connect(action, &QAction::triggered, this, &LDifImportExportPluginInterface::slotImportLdif);
setImportActions(QList<QAction *>() << action);
action = ac->addAction(QStringLiteral("file_export_ldif"));
action->setText(i18n("Export LDIF file..."));
action->setWhatsThis(i18n("Export contacts to an LDIF file."));
+ connect(action, &QAction::triggered, this, &LDifImportExportPluginInterface::slotExportLdif);
setExportActions(QList<QAction *>() << action);
}
void LDifImportExportPluginInterface::exec()
{
+ switch(mImportExportAction) {
+ case Import:
+ break;
+ case Export:
+ break;
+ }
+ //TODO
+}
+
+void LDifImportExportPluginInterface::slotImportLdif()
+{
+ mImportExportAction = Import;
+ Q_EMIT emitPluginActivated(this);
+}
+
+void LDifImportExportPluginInterface::slotExportLdif()
+{
+ mImportExportAction = Export;
+ Q_EMIT emitPluginActivated(this);
}
diff --git a/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.h b/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.h
index 592b882..7daacfa 100644
--- a/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.h
+++ b/kaddressbook/importexportplugins/ldif/ldifimportexportplugininterface.h
@@ -31,6 +31,9 @@ public:
void createAction(KActionCollection *ac) Q_DECL_OVERRIDE;
void exec() Q_DECL_OVERRIDE;
+private:
+ void slotImportLdif();
+ void slotExportLdif();
};
#endif // LDIFIMPORTEXPORTPLUGININTERFACE_H