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

Port to QComboBox

parent a5c5f1d0
......@@ -19,12 +19,12 @@
#include "selectaddheaderpositioncombobox.h"
#include "autocreatescripts/autocreatescriptutil_p.h"
#include <KComboBox>
#include <QComboBox>
#include <KLocalizedString>
using namespace KSieveUi;
SelectAddHeaderPositionCombobox::SelectAddHeaderPositionCombobox(QWidget *parent)
: KComboBox(parent)
: QComboBox(parent)
{
initialize();
connect(this, QOverload<int>::of(&SelectAddHeaderPositionCombobox::activated), this, &SelectAddHeaderPositionCombobox::valueChanged);
......
......@@ -18,10 +18,10 @@
*/
#ifndef SELECTADDHEADERPOSITIONCOMBOBOX_H
#define SELECTADDHEADERPOSITIONCOMBOBOX_H
#include <KComboBox>
#include <QComboBox>
namespace KSieveUi {
class SelectAddHeaderPositionCombobox : public KComboBox
class SelectAddHeaderPositionCombobox : public QComboBox
{
Q_OBJECT
public:
......
......@@ -19,13 +19,13 @@
#include "selectimportancecombobox.h"
#include "autocreatescripts/autocreatescriptutil_p.h"
#include <KComboBox>
#include <QComboBox>
#include <KLocalizedString>
using namespace KSieveUi;
SelectImportanceCombobox::SelectImportanceCombobox(QWidget *parent)
: KComboBox(parent)
: QComboBox(parent)
{
initialize();
connect(this, QOverload<int>::of(&SelectImportanceCombobox::activated), this, &SelectImportanceCombobox::valueChanged);
......
......@@ -19,10 +19,10 @@
#ifndef SELECTIMPORTANCECOMBOBOX_H
#define SELECTIMPORTANCECOMBOBOX_H
#include <KComboBox>
#include <QComboBox>
namespace KSieveUi {
class SelectImportanceCombobox : public KComboBox
class SelectImportanceCombobox : public QComboBox
{
Q_OBJECT
public:
......
......@@ -24,7 +24,7 @@
using namespace KSieveUi;
SelectVacationComboBox::SelectVacationComboBox(QWidget *parent)
: KComboBox(parent)
: QComboBox(parent)
{
initialize();
connect(this, QOverload<int>::of(&SelectVacationComboBox::activated), this, &SelectVacationComboBox::valueChanged);
......
......@@ -18,10 +18,10 @@
*/
#ifndef SELECTVACATIONCOMBOBOX_H
#define SELECTVACATIONCOMBOBOX_H
#include <KComboBox>
#include <QComboBox>
namespace KSieveUi {
class SelectVacationComboBox : public KComboBox
class SelectVacationComboBox : public QComboBox
{
Q_OBJECT
public:
......
......@@ -24,7 +24,7 @@
using namespace KSieveUi;
SelectVariableModifierComboBox::SelectVariableModifierComboBox(QWidget *parent)
: KComboBox(parent)
: QComboBox(parent)
{
initialize();
connect(this, QOverload<int>::of(&SelectVariableModifierComboBox::activated), this, &SelectVariableModifierComboBox::valueChanged);
......
......@@ -19,10 +19,10 @@
#ifndef SELECTVARIABLEMODIFIERCOMBOBOX_H
#define SELECTVARIABLEMODIFIERCOMBOBOX_H
#include <KComboBox>
#include <QComboBox>
namespace KSieveUi {
class SelectVariableModifierComboBox : public KComboBox
class SelectVariableModifierComboBox : public QComboBox
{
Q_OBJECT
public:
......
......@@ -20,7 +20,7 @@
#include "autocreatescripts/autocreatescriptutil_p.h"
#include <KLocalizedString>
#include <KComboBox>
#include <QComboBox>
#include <QLineEdit>
#include <QHBoxLayout>
......@@ -42,12 +42,12 @@ void SelectBodyTypeWidget::initialize()
QHBoxLayout *lay = new QHBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
mBodyCombobox = new KComboBox(this);
mBodyCombobox = new QComboBox(this);
lay->addWidget(mBodyCombobox);
mBodyCombobox->addItem(i18n("raw"), QStringLiteral(":raw"));
mBodyCombobox->addItem(i18n("content"), QStringLiteral(":content"));
mBodyCombobox->addItem(i18n("text"), QStringLiteral(":text"));
connect(mBodyCombobox, QOverload<int>::of(&KComboBox::activated), this, &SelectBodyTypeWidget::slotBodyTypeChanged);
connect(mBodyCombobox, QOverload<int>::of(&QComboBox::activated), this, &SelectBodyTypeWidget::slotBodyTypeChanged);
mBodyLineEdit = new QLineEdit(this);
connect(mBodyLineEdit, &QLineEdit::textChanged, this, &SelectBodyTypeWidget::valueChanged);
......
......@@ -21,7 +21,7 @@
#include <QWidget>
class KComboBox;
class QComboBox;
class QLineEdit;
namespace KSieveUi {
......@@ -40,7 +40,7 @@ Q_SIGNALS:
private:
void slotBodyTypeChanged(int);
void initialize();
KComboBox *mBodyCombobox = nullptr;
QComboBox *mBodyCombobox = nullptr;
QLineEdit *mBodyLineEdit = nullptr;
};
}
......
......@@ -20,7 +20,7 @@
#include "sievedatespinbox.h"
#include <KLocalizedString>
#include <KComboBox>
#include <QComboBox>
#include <QLineEdit>
#include <KDateComboBox>
#include <KTimeComboBox>
......@@ -48,8 +48,8 @@ void SelectDateWidget::initialize()
QHBoxLayout *lay = new QHBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
mDateType = new KComboBox;
connect(mDateType, QOverload<int>::of(&KComboBox::activated), this, &SelectDateWidget::slotDateTypeActivated);
mDateType = new QComboBox;
connect(mDateType, QOverload<int>::of(&QComboBox::activated), this, &SelectDateWidget::slotDateTypeActivated);
mDateType->addItem(i18n("Year"), QVariant::fromValue(KSieveUi::SelectDateWidget::Year));
mDateType->addItem(i18n("Month"), QVariant::fromValue(KSieveUi::SelectDateWidget::Month));
mDateType->addItem(i18n("Day"), QVariant::fromValue(KSieveUi::SelectDateWidget::Day));
......
......@@ -23,7 +23,7 @@
#include <QSpinBox>
#include "ksieveui_private_export.h"
class KComboBox;
class QComboBox;
class QLineEdit;
class QStackedWidget;
class QSpinBox;
......@@ -65,7 +65,7 @@ private:
void initialize();
QString dateType(DateType type) const;
QString dateValue(DateType type) const;
KComboBox *mDateType = nullptr;
QComboBox *mDateType = nullptr;
QLineEdit *mDateLineEdit = nullptr;
SieveDateSpinBox *mDateValue = nullptr;
KDateComboBox *mDateEdit = nullptr;
......
......@@ -19,7 +19,7 @@
#include "selectrelationalmatchtype.h"
#include "autocreatescripts/autocreatescriptutil_p.h"
#include <KComboBox>
#include <QComboBox>
#include <KLocalizedString>
#include <QHBoxLayout>
......@@ -65,19 +65,19 @@ void SelectRelationalMatchType::initialize()
QHBoxLayout *lay = new QHBoxLayout(this);
lay->setContentsMargins(0, 0, 0, 0);
mType = new KComboBox(this);
mType = new QComboBox(this);
mType->addItem(i18n("Value"), QStringLiteral(":value"));
mType->addItem(i18n("Count"), QStringLiteral(":count"));
lay->addWidget(mType);
connect(mType, QOverload<int>::of(&KComboBox::activated), this, &SelectRelationalMatchType::valueChanged);
connect(mType, QOverload<int>::of(&QComboBox::activated), this, &SelectRelationalMatchType::valueChanged);
mMatch = new KComboBox(this);
mMatch = new QComboBox(this);
mMatch->addItem(i18n("Greater than"), QStringLiteral("gt"));
mMatch->addItem(i18n("Greater than or equal"), QStringLiteral("ge"));
mMatch->addItem(i18n("Less than"), QStringLiteral("lt"));
mMatch->addItem(i18n("Less than or equal"), QStringLiteral("le"));
mMatch->addItem(i18n("Equal to"), QStringLiteral("eq"));
mMatch->addItem(i18n("Not equal to"), QStringLiteral("ne"));
connect(mMatch, QOverload<int>::of(&KComboBox::activated), this, &SelectRelationalMatchType::valueChanged);
connect(mMatch, QOverload<int>::of(&QComboBox::activated), this, &SelectRelationalMatchType::valueChanged);
lay->addWidget(mMatch);
}
......@@ -21,7 +21,7 @@
#define SELECTRELATIONALMATCHTYPE_H
#include <QWidget>
class KComboBox;
class QComboBox;
namespace KSieveUi {
class SelectRelationalMatchType : public QWidget
{
......@@ -38,8 +38,8 @@ Q_SIGNALS:
private:
void initialize();
KComboBox *mType = nullptr;
KComboBox *mMatch = nullptr;
QComboBox *mType = nullptr;
QComboBox *mMatch = nullptr;
};
}
......
......@@ -42,7 +42,7 @@ static const int MINIMUMINCLUDEACTION = 1;
static const int MAXIMUMINCLUDEACTION = 20;
SieveIncludeLocation::SieveIncludeLocation(QWidget *parent)
: KComboBox(parent)
: QComboBox(parent)
{
initialize();
connect(this, QOverload<int>::of(&SieveIncludeLocation::activated), this, &SieveIncludeLocation::valueChanged);
......
......@@ -22,7 +22,7 @@
#include "sievewidgetpageabstract.h"
#include <Libkdepim/KWidgetLister>
#include <KComboBox>
#include <QComboBox>
class QPushButton;
class QGridLayout;
......@@ -31,7 +31,7 @@ class QXmlStreamReader;
namespace KSieveUi {
class SieveHelpButton;
class IncludeFileLineEdit;
class SieveIncludeLocation : public KComboBox
class SieveIncludeLocation : public QComboBox
{
Q_OBJECT
public:
......
......@@ -23,7 +23,7 @@
#include "autocreatescriptutil_p.h"
#include <KLocalizedString>
#include <KComboBox>
#include <QComboBox>
#include <QPushButton>
#include <QIcon>
......@@ -84,7 +84,7 @@ SieveScriptBlockWidget::SieveScriptBlockWidget(SieveEditorGraphicalModeWidget *g
QHBoxLayout *newBlockLayout = new QHBoxLayout;
QLabel *lab = new QLabel(i18n("Add new block:"));
newBlockLayout->addWidget(lab);
mNewBlockType = new KComboBox;
mNewBlockType = new QComboBox;
newBlockLayout->addWidget(mNewBlockType);
mNewBlockType->addItem(i18n("\"elsif\" block"));
mNewBlockType->addItem(i18n("\"else\" block"));
......
......@@ -26,7 +26,7 @@
class QRadioButton;
class QGroupBox;
class QAbstractButton;
class KComboBox;
class QComboBox;
class QPushButton;
class QXmlStreamReader;
......@@ -73,7 +73,7 @@ private:
QRadioButton *mMatchAll = nullptr;
QRadioButton *mMatchAny = nullptr;
QRadioButton *mAllMessageRBtn = nullptr;
KComboBox *mNewBlockType = nullptr;
QComboBox *mNewBlockType = nullptr;
QPushButton *mAddBlockType = nullptr;
};
}
......
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