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

Port to kpagedialog

parent b3a5e552
...@@ -66,6 +66,7 @@ find_package(KF5KIO ${KF5_MIN_VERSION} REQUIRED) ...@@ -66,6 +66,7 @@ find_package(KF5KIO ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Notifications ${KF5_MIN_VERSION} REQUIRED) find_package(KF5Notifications ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} REQUIRED) find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} REQUIRED) find_package(KF5XmlGui ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} REQUIRED)
# Find KdepimLibs Package # Find KdepimLibs Package
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED) find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
......
...@@ -81,6 +81,7 @@ target_link_libraries(pimdataexporter ...@@ -81,6 +81,7 @@ target_link_libraries(pimdataexporter
KF5::I18n KF5::I18n
KF5::Crash KF5::Crash
${pimdataexporter_userfeedback_LIB} ${pimdataexporter_userfeedback_LIB}
KF5::WidgetsAddons
) )
add_subdirectory(kconf_update) add_subdirectory(kconf_update)
......
...@@ -12,7 +12,7 @@ target_link_libraries(synchronizeresourcedialogtest Qt5::Test Qt5::Widgets KF5:: ...@@ -12,7 +12,7 @@ target_link_libraries(synchronizeresourcedialogtest Qt5::Test Qt5::Widgets KF5::
add_executable( pimdataexporterconfiguredialogtest pimdataexporterconfiguredialogtest.cpp ../dialog/pimdataexporterconfiguredialog.cpp ../widgets/pimdataexporterconfigurewidget.cpp ${pimdataexporter_kcfg_SRCS}) add_executable( pimdataexporterconfiguredialogtest pimdataexporterconfiguredialogtest.cpp ../dialog/pimdataexporterconfiguredialog.cpp ../widgets/pimdataexporterconfigurewidget.cpp ${pimdataexporter_kcfg_SRCS})
add_test(NAME pimdataexporterconfiguredialogtest COMMAND pimdataexporterconfiguredialogtest) add_test(NAME pimdataexporterconfiguredialogtest COMMAND pimdataexporterconfiguredialogtest)
ecm_mark_as_test(pimdataexporterconfiguredialogtest) ecm_mark_as_test(pimdataexporterconfiguredialogtest)
target_link_libraries(pimdataexporterconfiguredialogtest Qt5::Test Qt5::Widgets KF5::I18n KF5::ItemViews KF5::ConfigCore KF5::ConfigGui) target_link_libraries(pimdataexporterconfiguredialogtest Qt5::Test Qt5::Widgets KF5::I18n KF5::ItemViews KF5::ConfigCore KF5::ConfigGui KF5::WidgetsAddons)
add_executable( pimdataexporterconfigurewidgettest pimdataexporterconfigurewidgettest.cpp ../widgets/pimdataexporterconfigurewidget.cpp ${pimdataexporter_kcfg_SRCS}) add_executable( pimdataexporterconfigurewidgettest pimdataexporterconfigurewidgettest.cpp ../widgets/pimdataexporterconfigurewidget.cpp ${pimdataexporter_kcfg_SRCS})
......
...@@ -22,23 +22,33 @@ ...@@ -22,23 +22,33 @@
#include <KLocalizedString> #include <KLocalizedString>
#include <QPushButton> #include <QPushButton>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <kpagewidgetmodel.h>
#include "../widgets/pimdataexporterconfigurewidget.h" #include "../widgets/pimdataexporterconfigurewidget.h"
PimDataExporterConfigureDialog::PimDataExporterConfigureDialog(QWidget *parent) PimDataExporterConfigureDialog::PimDataExporterConfigureDialog(QWidget *parent)
: QDialog(parent) : KPageDialog(parent)
{ {
setFaceType(KPageDialog::List);
setWindowTitle(i18nc("@title:window", "Configure PimDataExporter")); setWindowTitle(i18nc("@title:window", "Configure PimDataExporter"));
QVBoxLayout *layout = new QVBoxLayout(this);
//General page
QWidget *generalConfigureWiget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout(generalConfigureWiget);
mConfigureWidget = new PimDataExporterConfigureWidget(this); mConfigureWidget = new PimDataExporterConfigureWidget(this);
mConfigureWidget->setObjectName(QStringLiteral("configurewidget")); mConfigureWidget->setObjectName(QStringLiteral("configurewidget"));
layout->addWidget(mConfigureWidget); layout->addWidget(mConfigureWidget);
QDialogButtonBox *button = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults, this); KPageWidgetItem *generalPageWidgetPage = new KPageWidgetItem(mConfigureWidget, i18n("General"));
button->setObjectName(QStringLiteral("buttonbox")); generalPageWidgetPage->setIcon(QIcon::fromTheme(QStringLiteral("network-workgroup")));
connect(button, &QDialogButtonBox::accepted, this, &PimDataExporterConfigureDialog::slotAccepted); addPage(generalPageWidgetPage);
connect(button, &QDialogButtonBox::rejected, this, &PimDataExporterConfigureDialog::reject);
connect(button->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, mConfigureWidget, &PimDataExporterConfigureWidget::resetToDefault);
layout->addWidget(button); buttonBox()->setStandardButtons(QDialogButtonBox::Ok| QDialogButtonBox::Cancel);
connect(buttonBox(), &QDialogButtonBox::accepted, this, &PimDataExporterConfigureDialog::accept);
connect(buttonBox(), &QDialogButtonBox::rejected, this, &PimDataExporterConfigureDialog::reject);
} }
PimDataExporterConfigureDialog::~PimDataExporterConfigureDialog() PimDataExporterConfigureDialog::~PimDataExporterConfigureDialog()
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
#ifndef PIMDATAEXPORTERCONFIGUREDIALOG_H #ifndef PIMDATAEXPORTERCONFIGUREDIALOG_H
#define PIMDATAEXPORTERCONFIGUREDIALOG_H #define PIMDATAEXPORTERCONFIGUREDIALOG_H
#include <KPageDialog>
#include <QDialog> #include <QDialog>
class PimDataExporterConfigureWidget; class PimDataExporterConfigureWidget;
class PimDataExporterConfigureDialog : public QDialog class PimDataExporterConfigureDialog : public KPageDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
......
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