Commit c84b8fec authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add signal/slot. Import plugin

parent c904044b
......@@ -36,37 +36,38 @@ GMXImportExportPluginInterface::~GMXImportExportPluginInterface()
void GMXImportExportPluginInterface::createAction(KActionCollection *ac)
{
#if 0
QAction *action = ac->addAction(QStringLiteral("file_import_gmx"));
action->setText(i18n("Import GMX..."));
action->setWhatsThis(i18n("Import contacts from a GMX file."));
action->setText(i18n("Import GMX file..."));
action->setWhatsThis(i18n("Import contacts from a GMX address book file."));
setImportActions(QList<QAction *>() << action);
connect(action, &QAction::triggered, this, &GMXImportExportPluginInterface::slotImportGmx);
QList<QAction *> exportActionList;
action = ac->addAction(QStringLiteral("file_import_gmx"));
action->setText(i18n("Import GMX..."));
action->setWhatsThis(i18n("Import contacts from a GMX file."));
exportActionList << action;
action = ac->addAction(QStringLiteral("file_export_gmx40"));
action->setWhatsThis(i18n("Export contacts to a GMX 4.0 file."));
action->setText(i18n("Export GMX 4.0..."));
exportActionList << action;
action = ac->addAction(QStringLiteral("file_export_gmx"));
action->setText(i18n("Export GMX file..."));
action->setWhatsThis(i18n("Export contacts to a GMX address book file."));
setExportActions(QList<QAction *>() << action);
connect(action, &QAction::triggered, this, &GMXImportExportPluginInterface::slotExportGmx);
}
action = ac->addAction(QStringLiteral("file_export_gmx30"));
action->setText(i18n("Export GMX 3.0..."));
action->setWhatsThis(i18n("Export contacts to a GMX 3.0 file."));
exportActionList << action;
void GMXImportExportPluginInterface::exec()
{
switch(mImportExportAction) {
case Import:
break;
case Export:
break;
}
//TODO
}
action = ac->addAction(QStringLiteral("file_export_gmx21"));
action->setText(i18n("Export GMX 2.1..."));
action->setWhatsThis(i18n("Export contacts to a GMX 2.1 file."));
exportActionList << action;
setExportActions(exportActionList);
#endif
void GMXImportExportPluginInterface::slotImportGmx()
{
mImportExportAction = Import;
Q_EMIT emitPluginActivated(this);
}
void GMXImportExportPluginInterface::exec()
void GMXImportExportPluginInterface::slotExportGmx()
{
mImportExportAction = Export;
Q_EMIT emitPluginActivated(this);
}
......@@ -31,6 +31,9 @@ public:
void createAction(KActionCollection *ac) Q_DECL_OVERRIDE;
void exec() Q_DECL_OVERRIDE;
private:
void slotImportGmx();
void slotExportGmx();
};
#endif // GMXIMPORTEXPORTPLUGININTERFACE_H
Supports Markdown
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