Commit 80d775e8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Rename some files

parent 630983dd
......@@ -6,8 +6,7 @@ include_directories(${AKONADI_INCLUDE_DIR}
set(pimsettingexporterconsole_SRCS
importexportprogressindicatorconsole.cpp
pimsettingexportconsole_debug.cpp
pimsettingexporterconsole.cpp
pimdataexporterconsole.cpp
loginfo.cpp
loginfile.cpp
main.cpp)
......
......@@ -18,7 +18,7 @@
*/
#include "pimsettingexporter-version.h"
#include "pimsettingexporterconsole.h"
#include "pimdataexporterconsole.h"
#include "pimsettingexportconsole_debug.h"
#include <kaboutdata.h>
#include <KLocalizedString>
......@@ -69,13 +69,13 @@ int main(int argc, char *argv[])
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Log file " << logFile;
}
PimSettingExporterConsole *console = new PimSettingExporterConsole;
PimDataExporterConsole *console = new PimDataExporterConsole;
if (!importFile.isEmpty()) {
console->setMode(PimSettingExporterConsole::Import);
console->setMode(PimDataExporterConsole::Import);
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Import Mode" << importFile;
console->setImportExportFileName(importFile);
} else if (!exportFile.isEmpty()) {
console->setMode(PimSettingExporterConsole::Export);
console->setMode(PimDataExporterConsole::Export);
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Export Mode" << exportFile;
console->setImportExportFileName(exportFile);
}
......@@ -85,8 +85,8 @@ int main(int argc, char *argv[])
if (!templateFile.isEmpty()) {
console->setTemplateFileName(templateFile);
}
QObject::connect(console, &PimSettingExporterConsole::finished, &app, &QCoreApplication::quit);
QTimer::singleShot(0, console, &PimSettingExporterConsole::start);
QObject::connect(console, &PimDataExporterConsole::finished, &app, &QCoreApplication::quit);
QTimer::singleShot(0, console, &PimDataExporterConsole::start);
return app.exec();
}
......@@ -17,7 +17,7 @@
Boston, MA 02110-1301, USA.
*/
#include "pimsettingexporterconsole.h"
#include "pimdataexporterconsole.h"
#include "pimdatabackuprestore.h"
#include "pimsettingexportconsole_debug.h"
#include "loginfile.h"
......@@ -29,7 +29,7 @@
#include <MailCommon/MailKernel>
#include <MailCommon/FilterManager>
PimSettingExporterConsole::PimSettingExporterConsole(QObject *parent)
PimDataExporterConsole::PimDataExporterConsole(QObject *parent)
: QObject(parent)
, mPimSettingsBackupRestore(new PimDataBackupRestore(this))
, mLogInFile(nullptr)
......@@ -47,56 +47,56 @@ PimSettingExporterConsole::PimSettingExporterConsole(QObject *parent)
//TODO initialize akonadi server
}
PimSettingExporterConsole::~PimSettingExporterConsole()
PimDataExporterConsole::~PimDataExporterConsole()
{
}
void PimSettingExporterConsole::initializeLogInFile()
void PimDataExporterConsole::initializeLogInFile()
{
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::addEndLine, this, &PimSettingExporterConsole::slotAddEndLine);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::addError, this, &PimSettingExporterConsole::slotAddError);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::addInfo, this, &PimSettingExporterConsole::slotAddInfo);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::addTitle, this, &PimSettingExporterConsole::slotAddTitle);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::jobFinished, this, &PimSettingExporterConsole::slotJobFinished);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::backupDone, this, &PimSettingExporterConsole::slotBackupDone);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::jobFailed, this, &PimSettingExporterConsole::slotJobFailed);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::restoreDone, this, &PimSettingExporterConsole::slotRestoreDone);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::addEndLine, this, &PimDataExporterConsole::slotAddEndLine);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::addError, this, &PimDataExporterConsole::slotAddError);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::addInfo, this, &PimDataExporterConsole::slotAddInfo);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::addTitle, this, &PimDataExporterConsole::slotAddTitle);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::jobFinished, this, &PimDataExporterConsole::slotJobFinished);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::backupDone, this, &PimDataExporterConsole::slotBackupDone);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::jobFailed, this, &PimDataExporterConsole::slotJobFailed);
connect(mPimSettingsBackupRestore, &PimDataBackupRestore::restoreDone, this, &PimDataExporterConsole::slotRestoreDone);
}
void PimSettingExporterConsole::closeLogFile()
void PimDataExporterConsole::closeLogFile()
{
delete mLogInFile;
mLogInFile = nullptr;
}
void PimSettingExporterConsole::slotRestoreDone()
void PimDataExporterConsole::slotRestoreDone()
{
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Restore Done";
closeLogFile();
QTimer::singleShot(0, this, &PimSettingExporterConsole::finished);
QTimer::singleShot(0, this, &PimDataExporterConsole::finished);
}
void PimSettingExporterConsole::slotJobFailed()
void PimDataExporterConsole::slotJobFailed()
{
qCWarning(PIMSETTINGEXPORTERCONSOLE_LOG) << "job failed";
closeLogFile();
mPimSettingsBackupRestore->closeArchive();
}
void PimSettingExporterConsole::slotBackupDone()
void PimDataExporterConsole::slotBackupDone()
{
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Backup Done";
closeLogFile();
QTimer::singleShot(0, this, &PimSettingExporterConsole::finished);
QTimer::singleShot(0, this, &PimDataExporterConsole::finished);
}
void PimSettingExporterConsole::slotJobFinished()
void PimDataExporterConsole::slotJobFinished()
{
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "job finished";
mPimSettingsBackupRestore->nextStep();
}
void PimSettingExporterConsole::slotAddEndLine()
void PimDataExporterConsole::slotAddEndLine()
{
if (mLogInFile) {
mLogInFile->addEndLine();
......@@ -104,7 +104,7 @@ void PimSettingExporterConsole::slotAddEndLine()
mLogInfo->addEndLineLogEntry();
}
void PimSettingExporterConsole::slotAddError(const QString &message)
void PimDataExporterConsole::slotAddError(const QString &message)
{
if (mLogInFile) {
mLogInFile->addError(message);
......@@ -112,7 +112,7 @@ void PimSettingExporterConsole::slotAddError(const QString &message)
mLogInfo->addErrorLogEntry(message);
}
void PimSettingExporterConsole::slotAddInfo(const QString &message)
void PimDataExporterConsole::slotAddInfo(const QString &message)
{
if (mLogInFile) {
mLogInFile->addInfo(message);
......@@ -120,7 +120,7 @@ void PimSettingExporterConsole::slotAddInfo(const QString &message)
mLogInfo->addInfoLogEntry(message);
}
void PimSettingExporterConsole::slotAddTitle(const QString &message)
void PimDataExporterConsole::slotAddTitle(const QString &message)
{
if (mLogInFile) {
mLogInFile->addTitle(message);
......@@ -128,12 +128,12 @@ void PimSettingExporterConsole::slotAddTitle(const QString &message)
mLogInfo->addTitleLogEntry(message);
}
QString PimSettingExporterConsole::importExportFileName() const
QString PimDataExporterConsole::importExportFileName() const
{
return mImportExportFileName;
}
void PimSettingExporterConsole::setImportExportFileName(const QString &filename)
void PimDataExporterConsole::setImportExportFileName(const QString &filename)
{
if (mInProgress) {
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Already in progress. We can't change it.";
......@@ -142,7 +142,7 @@ void PimSettingExporterConsole::setImportExportFileName(const QString &filename)
mImportExportFileName = filename;
}
void PimSettingExporterConsole::start()
void PimDataExporterConsole::start()
{
//Load template if necessary
if (!mTemplateFileName.isEmpty()) {
......@@ -154,24 +154,24 @@ void PimSettingExporterConsole::start()
case Import:
if (!mPimSettingsBackupRestore->restoreStart(mImportExportFileName)) {
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Unable to start restore.";
QTimer::singleShot(0, this, &PimSettingExporterConsole::finished);
QTimer::singleShot(0, this, &PimDataExporterConsole::finished);
}
break;
case Export:
if (!mPimSettingsBackupRestore->backupStart(mImportExportFileName)) {
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Unable to start backup.";
QTimer::singleShot(0, this, &PimSettingExporterConsole::finished);
QTimer::singleShot(0, this, &PimDataExporterConsole::finished);
}
break;
}
}
PimSettingExporterConsole::Mode PimSettingExporterConsole::mode() const
PimDataExporterConsole::Mode PimDataExporterConsole::mode() const
{
return mMode;
}
void PimSettingExporterConsole::setMode(Mode mode)
void PimDataExporterConsole::setMode(Mode mode)
{
if (mInProgress) {
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Already in progress. We can't change it.";
......@@ -180,7 +180,7 @@ void PimSettingExporterConsole::setMode(Mode mode)
mMode = mode;
}
void PimSettingExporterConsole::setLogFileName(const QString &logFileName)
void PimDataExporterConsole::setLogFileName(const QString &logFileName)
{
if (mInProgress) {
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Already in progress. We can't change it.";
......@@ -192,7 +192,7 @@ void PimSettingExporterConsole::setLogFileName(const QString &logFileName)
mLogInFile->setFileName(logFileName);
}
void PimSettingExporterConsole::setTemplateFileName(const QString &templateFileName)
void PimDataExporterConsole::setTemplateFileName(const QString &templateFileName)
{
if (mInProgress) {
qCDebug(PIMSETTINGEXPORTERCONSOLE_LOG) << "Already in progress. We can't change it.";
......
......@@ -24,7 +24,7 @@
class PimDataBackupRestore;
class LogInFile;
class LogInfo;
class PimSettingExporterConsole : public QObject
class PimDataExporterConsole : public QObject
{
Q_OBJECT
public:
......@@ -33,8 +33,8 @@ public:
Export = 1
};
explicit PimSettingExporterConsole(QObject *parent = nullptr);
~PimSettingExporterConsole();
explicit PimDataExporterConsole(QObject *parent = nullptr);
~PimDataExporterConsole();
Mode mode() const;
void setMode(Mode mode);
......
......@@ -4,15 +4,15 @@ include_directories(
)
set( pimsettingexporter_kcfg_SRCS settings/pimsettingexporterglobalconfig.kcfgc )
set( pimsettingexporter_kcfg_SRCS settings/pimdataexporterglobalconfig.kcfgc )
kconfig_add_kcfg_files(pimsettingexporter_kcfg_SRCS ${pimsettingexporter_kcfg_SRCS})
kconfig_add_kcfg_files(pimdataexporter_kcfg_SRCS ${pimsettingexporter_kcfg_SRCS})
set(pimsettingexporter_widget_SRCS
widgets/selectiontypetreewidget.cpp
widgets/logwidget.cpp
widgets/pimsettingexporterconfigurewidget.cpp
widgets/pimdataexporterconfigurewidget.cpp
)
set(pimsettingexporter_dialog_SRCS
......@@ -20,7 +20,7 @@ set(pimsettingexporter_dialog_SRCS
dialog/backupfilestructureinfodialog.cpp
dialog/showarchivestructuredialog.cpp
dialog/synchronizeresourcedialog.cpp
dialog/pimsettingexporterconfiguredialog.cpp
dialog/pimdataexporterconfiguredialog.cpp
)
set(pimsettingexporter_job_SRCS
......@@ -28,19 +28,19 @@ set(pimsettingexporter_job_SRCS
)
set(pimsettingexporter_trayicon_SRCS
trayicon/pimsettingstrayicon.cpp
trayicon/pimdatatrayicon.cpp
)
set(pimsettingexporter_SRCS
${pimsettingexporter_kcfg_SRCS}
${pimdataexporter_kcfg_SRCS}
${pimsettingexporter_widget_SRCS}
${pimsettingexporter_dialog_SRCS}
${pimsettingexporter_job_SRCS}
${pimsettingexporter_trayicon_SRCS}
pimsettingsbackuprestoreui.cpp
pimdatabackuprestoreui.cpp
importexportprogressindicatorgui.cpp
pimsettingexporterwindow.cpp
pimsettingcommandlineoption.cpp
pimdataexporterwindow.cpp
pimdatacommandlineoption.cpp
main.cpp)
qt5_add_resources(pimsettingexporter_SRCS pimsettingexporter.qrc)
......@@ -71,7 +71,7 @@ install(TARGETS pimsettingexporter ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
install(PROGRAMS org.kde.pimsettingexporter.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES settings/pimsettingexporterglobalconfig.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
install(FILES settings/pimdataexporterglobalconfig.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
if(BUILD_TESTING)
add_subdirectory(tests)
......
add_definitions(-DPIMDATAEXPORTER_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data")
set( pimsettingexporter_kcfg_SRCS ../settings/pimsettingexporterglobalconfig.kcfgc )
set( pimdataexporter_kcfg_SRCS ../settings/pimdataexporterglobalconfig.kcfgc )
kconfig_add_kcfg_files(pimsettingexporter_kcfg_SRCS ${pimsettingexporter_kcfg_SRCS})
kconfig_add_kcfg_files(pimdataexporter_kcfg_SRCS ${pimdataexporter_kcfg_SRCS})
add_executable( synchronizeresourcedialogtest synchronizeresourcedialogtest.cpp ../dialog/synchronizeresourcedialog.cpp)
add_test(NAME synchronizeresourcedialogtest COMMAND synchronizeresourcedialogtest)
ecm_mark_as_test(synchronizeresourcedialogtest)
target_link_libraries(synchronizeresourcedialogtest Qt5::Test Qt5::Widgets KF5::I18n KF5::ItemViews KF5::ConfigCore)
add_executable( pimsettingexporterconfiguredialogtest pimsettingexporterconfiguredialogtest.cpp ../dialog/pimsettingexporterconfiguredialog.cpp ../widgets/pimsettingexporterconfigurewidget.cpp ${pimsettingexporter_kcfg_SRCS})
add_test(NAME pimsettingexporterconfiguredialogtest COMMAND pimsettingexporterconfiguredialogtest)
ecm_mark_as_test(pimsettingexporterconfiguredialogtest)
target_link_libraries(pimsettingexporterconfiguredialogtest Qt5::Test Qt5::Widgets KF5::I18n KF5::ItemViews KF5::ConfigCore KF5::ConfigGui)
add_executable( pimdataexporterconfiguredialogtest pimdataexporterconfiguredialogtest.cpp ../dialog/pimdataexporterconfiguredialog.cpp ../widgets/pimdataexporterconfigurewidget.cpp ${pimdataexporter_kcfg_SRCS})
add_test(NAME pimdataexporterconfiguredialogtest COMMAND pimdataexporterconfiguredialogtest)
ecm_mark_as_test(pimdataexporterconfiguredialogtest)
target_link_libraries(pimdataexporterconfiguredialogtest Qt5::Test Qt5::Widgets KF5::I18n KF5::ItemViews KF5::ConfigCore KF5::ConfigGui)
add_executable( pimsettingexporterconfigurewidgettest pimsettingexporterconfigurewidgettest.cpp ../widgets/pimsettingexporterconfigurewidget.cpp ${pimsettingexporter_kcfg_SRCS})
add_test(NAME pimsettingexporterconfigurewidgettest COMMAND pimsettingexporterconfigurewidgettest)
ecm_mark_as_test(pimsettingexporterconfigurewidgettest)
target_link_libraries(pimsettingexporterconfigurewidgettest Qt5::Test Qt5::Widgets KF5::I18n KF5::ItemViews KF5::ConfigCore KF5::ConfigGui)
add_executable( pimdataexporterconfigurewidgettest pimdataexporterconfigurewidgettest.cpp ../widgets/pimdataexporterconfigurewidget.cpp ${pimdataexporter_kcfg_SRCS})
add_test(NAME pimdataexporterconfigurewidgettest COMMAND pimsettingexporterconfigurewidgettest)
ecm_mark_as_test(pimdataexporterconfigurewidgettest)
target_link_libraries(pimdataexporterconfigurewidgettest Qt5::Test Qt5::Widgets KF5::I18n KF5::ItemViews KF5::ConfigCore KF5::ConfigGui)
add_executable( selectiontypetreewidgettest selectiontypetreewidgettest.cpp ../widgets/selectiontypetreewidget.cpp ${pimsettingexporter_kcfg_SRCS})
add_executable( selectiontypetreewidgettest selectiontypetreewidgettest.cpp ../widgets/selectiontypetreewidget.cpp ${pimdataexporter_kcfg_SRCS})
add_test(NAME selectiontypetreewidgettest COMMAND selectiontypetreewidgettest)
ecm_mark_as_test(selectiontypetreewidgettest)
target_link_libraries(selectiontypetreewidgettest Qt5::Test Qt5::Widgets KF5::I18n KF5::ItemViews pimdataexporterprivate KF5::ConfigCore KF5::ConfigGui KF5::PimCommonAkonadi)
add_executable( selectiontypedialogtest selectiontypedialogtest.cpp ../widgets/selectiontypetreewidget.cpp ../dialog/selectiontypedialog.cpp ${pimsettingexporter_kcfg_SRCS})
add_executable( selectiontypedialogtest selectiontypedialogtest.cpp ../widgets/selectiontypetreewidget.cpp ../dialog/selectiontypedialog.cpp ${pimdataexporter_kcfg_SRCS})
add_test(NAME selectiontypedialogtest COMMAND selectiontypedialogtest)
ecm_mark_as_test(selectiontypedialogtest)
target_link_libraries(selectiontypedialogtest Qt5::Test Qt5::Widgets KF5::I18n KF5::ItemViews pimdataexporterprivate KF5::ConfigCore KF5::ConfigGui KF5::PimCommonAkonadi)
......@@ -17,29 +17,29 @@
Boston, MA 02110-1301, USA.
*/
#include "pimsettingexporterconfiguredialogtest.h"
#include "../dialog/pimsettingexporterconfiguredialog.h"
#include "pimdataexporterconfiguredialogtest.h"
#include "../dialog/pimdataexporterconfiguredialog.h"
#include <QDialogButtonBox>
#include <QTest>
#include "../widgets/pimsettingexporterconfigurewidget.h"
#include "../widgets/pimdataexporterconfigurewidget.h"
PimSettingExporterConfigureDialogTest::PimSettingExporterConfigureDialogTest(QObject *parent)
PimDataExporterConfigureDialogTest::PimDataExporterConfigureDialogTest(QObject *parent)
: QObject(parent)
{
}
PimSettingExporterConfigureDialogTest::~PimSettingExporterConfigureDialogTest()
PimDataExporterConfigureDialogTest::~PimDataExporterConfigureDialogTest()
{
}
void PimSettingExporterConfigureDialogTest::shouldHaveDefaultValue()
void PimDataExporterConfigureDialogTest::shouldHaveDefaultValue()
{
PimSettingExporterConfigureDialog dlg;
PimDataExporterConfigureDialog dlg;
QDialogButtonBox *buttonBox = dlg.findChild<QDialogButtonBox *>(QStringLiteral("buttonbox"));
QVERIFY(buttonBox);
PimSettingExporterConfigureWidget *configureWidget = dlg.findChild<PimSettingExporterConfigureWidget *>(QStringLiteral("configurewidget"));
PimDataExporterConfigureWidget *configureWidget = dlg.findChild<PimDataExporterConfigureWidget *>(QStringLiteral("configurewidget"));
QVERIFY(configureWidget);
}
QTEST_MAIN(PimSettingExporterConfigureDialogTest)
QTEST_MAIN(PimDataExporterConfigureDialogTest)
......@@ -22,12 +22,12 @@
#include <QObject>
class PimSettingExporterConfigureDialogTest : public QObject
class PimDataExporterConfigureDialogTest : public QObject
{
Q_OBJECT
public:
explicit PimSettingExporterConfigureDialogTest(QObject *parent = nullptr);
~PimSettingExporterConfigureDialogTest();
explicit PimDataExporterConfigureDialogTest(QObject *parent = nullptr);
~PimDataExporterConfigureDialogTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
......
......@@ -17,24 +17,24 @@
Boston, MA 02110-1301, USA.
*/
#include "pimsettingexporterconfigurewidgettest.h"
#include "../widgets/pimsettingexporterconfigurewidget.h"
#include "pimdataexporterconfigurewidgettest.h"
#include "../widgets/pimdataexporterconfigurewidget.h"
#include <QCheckBox>
#include <QGroupBox>
#include <QTest>
PimSettingExporterConfigureWidgetTest::PimSettingExporterConfigureWidgetTest(QObject *parent)
PimDataExporterConfigureWidgetTest::PimDataExporterConfigureWidgetTest(QObject *parent)
: QObject(parent)
{
}
PimSettingExporterConfigureWidgetTest::~PimSettingExporterConfigureWidgetTest()
PimDataExporterConfigureWidgetTest::~PimDataExporterConfigureWidgetTest()
{
}
void PimSettingExporterConfigureWidgetTest::shouldHaveDefaultValue()
void PimDataExporterConfigureWidgetTest::shouldHaveDefaultValue()
{
PimSettingExporterConfigureWidget w;
PimDataExporterConfigureWidget w;
QGroupBox *importGroupBox = w.findChild<QGroupBox *>(QStringLiteral("import_groupbox"));
QVERIFY(importGroupBox);
......@@ -49,4 +49,4 @@ void PimSettingExporterConfigureWidgetTest::shouldHaveDefaultValue()
QVERIFY(alwaysMergeConfigFile);
}
QTEST_MAIN(PimSettingExporterConfigureWidgetTest)
QTEST_MAIN(PimDataExporterConfigureWidgetTest)
......@@ -22,12 +22,12 @@
#include <QObject>
class PimSettingExporterConfigureWidgetTest : public QObject
class PimDataExporterConfigureWidgetTest : public QObject
{
Q_OBJECT
public:
explicit PimSettingExporterConfigureWidgetTest(QObject *parent = nullptr);
~PimSettingExporterConfigureWidgetTest();
explicit PimDataExporterConfigureWidgetTest(QObject *parent = nullptr);
~PimDataExporterConfigureWidgetTest();
private Q_SLOTS:
void shouldHaveDefaultValue();
};
......
......@@ -17,35 +17,35 @@
Boston, MA 02110-1301, USA.
*/
#include "pimsettingexporterconfiguredialog.h"
#include "pimdataexporterconfiguredialog.h"
#include <QVBoxLayout>
#include <KLocalizedString>
#include <QPushButton>
#include <QDialogButtonBox>
#include "../widgets/pimsettingexporterconfigurewidget.h"
#include "../widgets/pimdataexporterconfigurewidget.h"
PimSettingExporterConfigureDialog::PimSettingExporterConfigureDialog(QWidget *parent)
PimDataExporterConfigureDialog::PimDataExporterConfigureDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Configure PimSettingExporter"));
QVBoxLayout *layout = new QVBoxLayout(this);
mConfigureWidget = new PimSettingExporterConfigureWidget(this);
mConfigureWidget = new PimDataExporterConfigureWidget(this);
mConfigureWidget->setObjectName(QStringLiteral("configurewidget"));
layout->addWidget(mConfigureWidget);
QDialogButtonBox *button = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults, this);
button->setObjectName(QStringLiteral("buttonbox"));
connect(button, &QDialogButtonBox::accepted, this, &PimSettingExporterConfigureDialog::slotAccepted);
connect(button, &QDialogButtonBox::rejected, this, &PimSettingExporterConfigureDialog::reject);
connect(button->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, mConfigureWidget, &PimSettingExporterConfigureWidget::resetToDefault);
connect(button, &QDialogButtonBox::accepted, this, &PimDataExporterConfigureDialog::slotAccepted);
connect(button, &QDialogButtonBox::rejected, this, &PimDataExporterConfigureDialog::reject);
connect(button->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, mConfigureWidget, &PimDataExporterConfigureWidget::resetToDefault);
layout->addWidget(button);
}
PimSettingExporterConfigureDialog::~PimSettingExporterConfigureDialog()
PimDataExporterConfigureDialog::~PimDataExporterConfigureDialog()
{
}
void PimSettingExporterConfigureDialog::slotAccepted()
void PimDataExporterConfigureDialog::slotAccepted()
{
mConfigureWidget->save();
accept();
......
......@@ -21,18 +21,18 @@
#define PIMSETTINGEXPORTERCONFIGUREDIALOG_H
#include <QDialog>
class PimSettingExporterConfigureWidget;
class PimSettingExporterConfigureDialog : public QDialog
class PimDataExporterConfigureWidget;
class PimDataExporterConfigureDialog : public QDialog
{
Q_OBJECT
public:
explicit PimSettingExporterConfigureDialog(QWidget *parent = nullptr);
~PimSettingExporterConfigureDialog();
explicit PimDataExporterConfigureDialog(QWidget *parent = nullptr);
~PimDataExporterConfigureDialog();
private:
void slotAccepted();
PimSettingExporterConfigureWidget *mConfigureWidget = nullptr;
PimDataExporterConfigureWidget *mConfigureWidget = nullptr;
};
#endif // PIMSETTINGEXPORTERCONFIGUREDIALOG_H
......@@ -18,7 +18,7 @@
*/
#include "importexportprogressindicatorgui.h"
#include "pimsettingexporterglobalconfig.h"
#include "pimdataexporterglobalconfig.h"
#include <QProgressDialog>
#include <KMessageBox>
#include <KLocalizedString>
......@@ -72,7 +72,7 @@ bool ImportExportProgressIndicatorGui::wasCanceled() const
int ImportExportProgressIndicatorGui::mergeConfigMessageBox(const QString &configName) const
{
if (PimSettingExportGlobalConfig::self()->alwaysMergeConfigFile()) {
if (PimDataExportGlobalConfig::self()->alwaysMergeConfigFile()) {
return KMessageBox::Yes;
}
return KMessageBox::warningYesNoCancel(mParentWidget, i18n("\"%1\" already exists. Do you want to overwrite it or merge it?", configName), i18n("Restore"), KStandardGuiItem::overwrite(),
......@@ -81,7 +81,7 @@ int ImportExportProgressIndicatorGui::mergeConfigMessageBox(const QString &confi
bool ImportExportProgressIndicatorGui::overwriteConfigMessageBox(const QString &configName) const
{
if (PimSettingExportGlobalConfig::self()->alwaysOverrideFile()) {
if (PimDataExportGlobalConfig::self()->alwaysOverrideFile()) {
return true;
}
return KMessageBox::warningYesNo(mParentWidget, i18n("\"%1\" already exists. Do you want to overwrite it?", configName), i18n("Restore")) == KMessageBox::Yes;
......@@ -89,7 +89,7 @@ bool ImportExportProgressIndicatorGui::overwriteConfigMessageBox(const QString &
bool ImportExportProgressIndicatorGui::overwriteDirectoryMessageBox(const QString &directory) const
{
if (PimSettingExportGlobalConfig::self()->alwaysOverrideDirectory()) {
if (PimDataExportGlobalConfig::self()->alwaysOverrideDirectory()) {
return true;
}
return KMessageBox::warningYesNo(mParentWidget, i18n("Directory \"%1\" already exists. Do you want to overwrite it?", directory), i18n("Restore")) == KMessageBox::Yes;
......
......@@ -17,8 +17,8 @@
Boston, MA 02110-1301, USA.
*/
#include "pimsettingexporterwindow.h"
#include "pimsettingcommandlineoption.h"
#include "pimdataexporterwindow.h"
#include "pimdatacommandlineoption.h"
#include <KLocalizedString>
#include <KDBusService>
......@@ -44,15 +44,15 @@ int main(int argc, char *argv[])
migrate.migrate();
QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kontact")));
PimSettingCommandLineOption parser;
PimDataCommandLineOption parser;
parser.createParser(app);
KDBusService service(KDBusService::Unique);
PimSettingExporterWindow *backupMailWin = new PimSettingExporterWindow();
PimDataExporterWindow *backupMailWin = new PimDataExporterWindow();