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)
find_package(KF5Notifications ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} REQUIRED)
# Find KdepimLibs Package
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
......
......@@ -81,6 +81,7 @@ target_link_libraries(pimdataexporter
KF5::I18n
KF5::Crash
${pimdataexporter_userfeedback_LIB}
KF5::WidgetsAddons
)
add_subdirectory(kconf_update)
......
......@@ -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_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)
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})
......
......@@ -22,23 +22,33 @@
#include <KLocalizedString>
#include <QPushButton>
#include <QDialogButtonBox>
#include <kpagewidgetmodel.h>
#include "../widgets/pimdataexporterconfigurewidget.h"
PimDataExporterConfigureDialog::PimDataExporterConfigureDialog(QWidget *parent)
: QDialog(parent)
: KPageDialog(parent)
{
setFaceType(KPageDialog::List);
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->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, &PimDataExporterConfigureDialog::slotAccepted);
connect(button, &QDialogButtonBox::rejected, this, &PimDataExporterConfigureDialog::reject);
connect(button->button(QDialogButtonBox::RestoreDefaults), &QPushButton::clicked, mConfigureWidget, &PimDataExporterConfigureWidget::resetToDefault);
layout->addWidget(button);
KPageWidgetItem *generalPageWidgetPage = new KPageWidgetItem(mConfigureWidget, i18n("General"));
generalPageWidgetPage->setIcon(QIcon::fromTheme(QStringLiteral("network-workgroup")));
addPage(generalPageWidgetPage);
buttonBox()->setStandardButtons(QDialogButtonBox::Ok| QDialogButtonBox::Cancel);
connect(buttonBox(), &QDialogButtonBox::accepted, this, &PimDataExporterConfigureDialog::accept);
connect(buttonBox(), &QDialogButtonBox::rejected, this, &PimDataExporterConfigureDialog::reject);
}
PimDataExporterConfigureDialog::~PimDataExporterConfigureDialog()
......
......@@ -20,9 +20,10 @@
#ifndef PIMDATAEXPORTERCONFIGUREDIALOG_H
#define PIMDATAEXPORTERCONFIGUREDIALOG_H
#include <KPageDialog>
#include <QDialog>
class PimDataExporterConfigureWidget;
class PimDataExporterConfigureDialog : public QDialog
class PimDataExporterConfigureDialog : public KPageDialog
{
Q_OBJECT
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