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

Continue to implement it

parent 77ccb3e7
Pipeline #29497 canceled with stage
......@@ -45,35 +45,57 @@ WindowsContactImportExportPluginInterface::~WindowsContactImportExportPluginInte
void WindowsContactImportExportPluginInterface::createAction(KActionCollection *ac)
{
// QAction *action = ac->addAction(QStringLiteral("file_export_csv"));
// 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, &WindowsContactImportExportPluginInterface::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, &WindowsContactImportExportPluginInterface::slotImportCVS);
QAction *action = ac->addAction(QStringLiteral("file_export_windows_contact"));
action->setText(i18n("Export Windows Contact file..."));
action->setWhatsThis(i18n("Export contacts to windows contact file."));
setExportActions(QList<QAction *>() << action);
connect(action, &QAction::triggered, this, &WindowsContactImportExportPluginInterface::slotExportWindowsContact);
action = ac->addAction(QStringLiteral("file_import_windows_contact"));
action->setText(i18n("Import Windows Contact file..."));
action->setWhatsThis(i18n("Import contacts from windows contact file."));
setImportActions(QList<QAction *>() << action);
connect(action, &QAction::triggered, this, &WindowsContactImportExportPluginInterface::slotImportWindowsContact);
}
void WindowsContactImportExportPluginInterface::slotExportWindowsContact()
{
mImportExportAction = Export;
Q_EMIT emitPluginActivated(this);
}
void WindowsContactImportExportPluginInterface::slotImportWindowsContact()
{
mImportExportAction = Import;
Q_EMIT emitPluginActivated(this);
}
void WindowsContactImportExportPluginInterface::exec()
{
// switch (mImportExportAction) {
// case Import:
// importCSV();
// break;
// case Export:
// exportCSV();
// break;
// }
switch (mImportExportAction) {
case Import:
importWindowsContact();
break;
case Export:
exportWindowsContact();
break;
}
}
bool WindowsContactImportExportPluginInterface::canImportFileType(const QUrl &url)
void WindowsContactImportExportPluginInterface::importWindowsContact()
{
//TODO
return false;
}
void WindowsContactImportExportPluginInterface::exportWindowsContact()
{
//TODO
}
bool WindowsContactImportExportPluginInterface::canImportFileType(const QUrl &url)
{
return url.path().endsWith(QLatin1String(".contact"));
}
void WindowsContactImportExportPluginInterface::importFile(const QUrl &url)
......
......@@ -35,6 +35,12 @@ public:
Q_REQUIRED_RESULT bool canImportFileType(const QUrl &url) override;
void importFile(const QUrl &url) override;
private:
void slotExportWindowsContact();
void slotImportWindowsContact();
void importWindowsContact();
void exportWindowsContact();
};
#endif
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