summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-05-11 07:57:36 +0200
committerMontel Laurent <[email protected]>2015-05-11 07:57:36 +0200
commitc3322cd3bbf01240811c6b881f3487ea273f1905 (patch)
treeaba148728353e6c8b3f49595ba8d4e347ae91ca9
parent43c99c21af8a6ca96e16feab4ddc0b61668b2fd4 (diff)
Create a console indicator
-rw-r--r--pimsettingexporter/CMakeLists.txt1
-rw-r--r--pimsettingexporter/console/CMakeLists.txt39
-rw-r--r--pimsettingexporter/console/importexportprogressindicatorconsole.cpp40
-rw-r--r--pimsettingexporter/console/importexportprogressindicatorconsole.h35
-rw-r--r--pimsettingexporter/console/main.cpp54
5 files changed, 169 insertions, 0 deletions
diff --git a/pimsettingexporter/CMakeLists.txt b/pimsettingexporter/CMakeLists.txt
index f41ccf8..8fff9a0 100644
--- a/pimsettingexporter/CMakeLists.txt
+++ b/pimsettingexporter/CMakeLists.txt
@@ -133,3 +133,4 @@ install(FILES backup-structure.txt DESTINATION ${DATA_INSTALL_DIR}/pimsettingexp
kde4_install_icons( ${ICON_INSTALL_DIR} )
add_subdirectory(tests)
add_subdirectory(gui)
+add_subdirectory(console)
diff --git a/pimsettingexporter/console/CMakeLists.txt b/pimsettingexporter/console/CMakeLists.txt
new file mode 100644
index 0000000..026d3b3
--- /dev/null
+++ b/pimsettingexporter/console/CMakeLists.txt
@@ -0,0 +1,39 @@
+
+include_directories(${AKONADI_INCLUDE_DIR}
+ ${CMAKE_SOURCE_DIR}/libkdepim
+ ${CMAKE_SOURCE_DIR}/mailcommon
+ ${CMAKE_SOURCE_DIR}/messageviewer
+ ${CMAKE_SOURCE_DIR}/pimcommon
+ ${CMAKE_SOURCE_DIR}/messagecomposer/
+ ${CMAKE_SOURCE_DIR}/pimsettingexporter/
+)
+
+
+set(pimsettingexporterconsole_SRCS
+ importexportprogressindicatorconsole.cpp
+ main.cpp)
+
+kde4_add_executable(pimsettingexporterconsole ${pimsettingexporterconsole_SRCS})
+
+target_link_libraries(pimsettingexporterconsole
+ ${KDE4_KFILE_LIBS}
+ ${KDE4_KIO_LIBS}
+ ${KDEPIMLIBS_AKONADI_LIBS}
+ ${KDEPIMLIBS_AKONADI_KMIME_LIBS}
+ ${KDEPIMLIBS_KMIME_LIBS}
+ ${KDEPIMLIBS_KPIMUTILS_LIBS}
+ ${KDEPIMLIBS_MAILTRANSPORT_LIBS}
+ ${AKONADI_COMMON_LIBRARIES}
+ ${KDEPIMLIBS_KALARMCAL_LIBS}
+ ${QT_QTXML_LIBRARY}
+ mailimporter
+ mailcommon
+ pimcommon
+ kdepim
+ messagecomposer
+ pimsettingexporterprivate
+)
+
+
+install(TARGETS pimsettingexporterconsole ${INSTALL_TARGETS_DEFAULT_ARGS} )
+
diff --git a/pimsettingexporter/console/importexportprogressindicatorconsole.cpp b/pimsettingexporter/console/importexportprogressindicatorconsole.cpp
new file mode 100644
index 0000000..6b57d94
--- /dev/null
+++ b/pimsettingexporter/console/importexportprogressindicatorconsole.cpp
@@ -0,0 +1,40 @@
+/*
+ Copyright (c) 2015 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License, version 2, as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "importexportprogressindicatorconsole.h"
+#include <QDebug>
+
+ImportExportProgressIndicatorConsole::ImportExportProgressIndicatorConsole(QObject *parent)
+ : ImportExportProgressIndicatorBase(parent)
+{
+
+}
+
+ImportExportProgressIndicatorConsole::~ImportExportProgressIndicatorConsole()
+{
+}
+
+void ImportExportProgressIndicatorConsole::showInfo(const QString &text)
+{
+ Q_EMIT info(text);
+}
+
+void ImportExportProgressIndicatorConsole::showErrorMessage(const QString &message, const QString &title)
+{
+ qDebug()<<" message "<< message << " title "<<title;
+}
+
diff --git a/pimsettingexporter/console/importexportprogressindicatorconsole.h b/pimsettingexporter/console/importexportprogressindicatorconsole.h
new file mode 100644
index 0000000..0fbbc76
--- /dev/null
+++ b/pimsettingexporter/console/importexportprogressindicatorconsole.h
@@ -0,0 +1,35 @@
+/*
+ Copyright (c) 2015 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License, version 2, as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#ifndef IMPORTEXPORTPROGRESSINDICATORCONSOLE_H
+#define IMPORTEXPORTPROGRESSINDICATORCONSOLE_H
+
+#include "importexportprogressindicatorbase.h"
+
+class ImportExportProgressIndicatorConsole : public ImportExportProgressIndicatorBase
+{
+ Q_OBJECT
+public:
+ explicit ImportExportProgressIndicatorConsole(QObject *parent = 0);
+ ~ImportExportProgressIndicatorConsole();
+
+private:
+ void showInfo(const QString &text);
+ void showErrorMessage(const QString &message, const QString &title);
+};
+
+#endif // IMPORTEXPORTPROGRESSINDICATORCONSOLE_H
diff --git a/pimsettingexporter/console/main.cpp b/pimsettingexporter/console/main.cpp
new file mode 100644
index 0000000..bdb2fe2
--- /dev/null
+++ b/pimsettingexporter/console/main.cpp
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 2015 Montel Laurent <[email protected]>
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License, version 2, as
+ published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+
+#include "pimsettingexporter_options.h"
+
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include "kdepim-version.h"
+
+int main(int argc, char *argv[])
+{
+#if 0
+ KLocale::setMainCatalog("pimsettingexporter");
+
+ KAboutData aboutData( "pimsettingexporter", 0, ki18n("PIM Setting Exporter"),
+ KDEPIM_VERSION, ki18n("PIM Setting Exporter"), KAboutData::License_GPL_V2,
+ ki18n("Copyright © 2012-2014 pimsettingexporter authors"));
+ aboutData.addAuthor(ki18n("Laurent Montel"), ki18n("Maintainer"), "[email protected]");
+ aboutData.setProgramIconName(QLatin1String("kontact"));
+ KCmdLineArgs::init( argc, argv, &aboutData );
+
+ KCmdLineArgs::addCmdLineOptions( pimsettingexporter_options() ); // Add our own options.
+
+ KUniqueApplication::addCmdLineOptions();
+
+ if (!KUniqueApplication::start())
+ {
+ kDebug() << "pimsettingexporter is already running!";
+ return (0);
+ }
+ KUniqueApplication a;
+ PimSettingExporterWindow *backupMailWin = new PimSettingExporterWindow();
+ a.setTopWidget(backupMailWin);
+ backupMailWin->show();
+ backupMailWin->handleCommandLine();
+ return a.exec();
+#endif
+ return 0;
+}