From f077b76e102be2dff906b9b3fef6fa198cb71fa3 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Tue, 2 Jul 2019 13:51:06 +0200 Subject: [PATCH] Continue to implement refreshsettingsassistant --- kmail-refresh-settings/CMakeLists.txt | 1 + .../refreshsettingsassistant.cpp | 16 ++++++--- .../refreshsettingsassistant.h | 9 +++++ .../refreshsettingsfirstpage.cpp | 31 +++++++++++++++++ .../refreshsettingsfirstpage.h | 33 +++++++++++++++++++ 5 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 kmail-refresh-settings/refreshsettingsfirstpage.cpp create mode 100644 kmail-refresh-settings/refreshsettingsfirstpage.h diff --git a/kmail-refresh-settings/CMakeLists.txt b/kmail-refresh-settings/CMakeLists.txt index c2485d5b4..b700fc282 100644 --- a/kmail-refresh-settings/CMakeLists.txt +++ b/kmail-refresh-settings/CMakeLists.txt @@ -3,6 +3,7 @@ set(kmail-refresh-settings_SRCS refreshsettingsassistant.cpp refreshsettringsfinishpage.cpp refreshsettingscleanuppage.cpp + refreshsettingsfirstpage.cpp ) ecm_qt_declare_logging_category(kmail-refresh-settings_SRCS HEADER kmail-refresh-settings_debug.h IDENTIFIER KMAIL_REFRESH_SETTINGS_LOG CATEGORY_NAME org.kde.pim.kmail_refresh_settings) diff --git a/kmail-refresh-settings/refreshsettingsassistant.cpp b/kmail-refresh-settings/refreshsettingsassistant.cpp index cfe021650..de220d589 100644 --- a/kmail-refresh-settings/refreshsettingsassistant.cpp +++ b/kmail-refresh-settings/refreshsettingsassistant.cpp @@ -20,12 +20,12 @@ #include "refreshsettingsassistant.h" #include "refreshsettingscleanuppage.h" +#include "refreshsettingsfirstpage.h" #include "refreshsettringsfinishpage.h" #include #include #include #include -#include #include #include @@ -38,7 +38,6 @@ RefreshSettingsAssistant::RefreshSettingsAssistant(QWidget *parent) resize(640, 480); Akonadi::ControlGui::widgetNeedsAkonadi(this); initializePages(); - KMessageBox::information(this, i18n("Close KMail before cleaning settings.")); KHelpMenu *helpMenu = new KHelpMenu(this, KAboutData::applicationData(), true); //Initialize menu QMenu *menu = helpMenu->menu(); @@ -53,8 +52,17 @@ RefreshSettingsAssistant::~RefreshSettingsAssistant() void RefreshSettingsAssistant::initializePages() { - mCleanUpPage = new RefreshSettingsCleanupPage(this); - mCleanUpPageItem = new KPageWidgetItem(mCleanUpPage, i18n("Step 1: Clean up Settings")); + mFirstPage = new RefreshSettingsFirstPage(this); + mFirstPageItem = new KPageWidgetItem(mFirstPage, i18n("Warning")); + addPage(mFirstPageItem); + mCleanUpPage = new RefreshSettingsCleanupPage(this); + mCleanUpPageItem = new KPageWidgetItem(mCleanUpPage, i18n("Clean up Settings")); addPage(mCleanUpPageItem); + + mFinishPage = new RefreshSettringsFinishPage(this); + mFinishPageItem = new KPageWidgetItem(mFinishPage, i18n("Finish")); + addPage(mFinishPageItem); + + } diff --git a/kmail-refresh-settings/refreshsettingsassistant.h b/kmail-refresh-settings/refreshsettingsassistant.h index a71880ab1..3812614f6 100644 --- a/kmail-refresh-settings/refreshsettingsassistant.h +++ b/kmail-refresh-settings/refreshsettingsassistant.h @@ -22,16 +22,25 @@ #include class RefreshSettingsCleanupPage; +class RefreshSettingsFirstPage; +class RefreshSettringsFinishPage; class RefreshSettingsAssistant : public KAssistantDialog { Q_OBJECT public: explicit RefreshSettingsAssistant(QWidget *parent = nullptr); ~RefreshSettingsAssistant(); + private: void initializePages(); KPageWidgetItem *mCleanUpPageItem = nullptr; RefreshSettingsCleanupPage *mCleanUpPage = nullptr; + + KPageWidgetItem *mFirstPageItem = nullptr; + RefreshSettingsFirstPage *mFirstPage = nullptr; + + KPageWidgetItem *mFinishPageItem = nullptr; + RefreshSettringsFinishPage *mFinishPage = nullptr; }; #endif // REFRESHSETTINGSASSISTANT_H diff --git a/kmail-refresh-settings/refreshsettingsfirstpage.cpp b/kmail-refresh-settings/refreshsettingsfirstpage.cpp new file mode 100644 index 000000000..8a4ce3ff9 --- /dev/null +++ b/kmail-refresh-settings/refreshsettingsfirstpage.cpp @@ -0,0 +1,31 @@ +/* + Copyright (C) 2019 Montel Laurent + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "refreshsettingsfirstpage.h" + +RefreshSettingsFirstPage::RefreshSettingsFirstPage(QWidget *parent) + : QWidget(parent) +{ + +} + +RefreshSettingsFirstPage::~RefreshSettingsFirstPage() +{ + +} diff --git a/kmail-refresh-settings/refreshsettingsfirstpage.h b/kmail-refresh-settings/refreshsettingsfirstpage.h new file mode 100644 index 000000000..080295ef4 --- /dev/null +++ b/kmail-refresh-settings/refreshsettingsfirstpage.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2019 Montel Laurent + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + 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; see the file COPYING. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef REFRESHSETTINGSFIRSTPAGE_H +#define REFRESHSETTINGSFIRSTPAGE_H + +#include + +class RefreshSettingsFirstPage : public QWidget +{ + Q_OBJECT +public: + explicit RefreshSettingsFirstPage(QWidget *parent = nullptr); + ~RefreshSettingsFirstPage(); +}; + +#endif // REFRESHSETTINGSFIRSTPAGE_H