Commit 92afcf90 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to QLineEdit

parent dee9a1ad
......@@ -19,7 +19,7 @@
#include "sievescriptdebuggerfrontendwidgettest.h"
#include "../sievescriptdebuggerfrontendwidget.h"
#include <KLineEdit>
#include <QLineEdit>
#include <KPIMTextEdit/kpimtextedit/texttospeechwidget.h>
#include <KUrlRequester>
#include <QLabel>
......@@ -57,11 +57,10 @@ void SieveScriptDebuggerFrontEndWidgetTest::shouldHaveDefaultValue()
QLabel *extensionLab = w.findChild<QLabel *>(QStringLiteral("extensionlab"));
QVERIFY(extensionLab);
KLineEdit *extension = w.findChild<KLineEdit *>(QStringLiteral("extension"));
QLineEdit *extension = w.findChild<QLineEdit *>(QStringLiteral("extension"));
QVERIFY(extension);
QVERIFY(extension->text().isEmpty());
QVERIFY(extension->isClearButtonEnabled());
QVERIFY(extension->trapReturnKey());
KPIMTextEdit::TextToSpeechWidget *textToSpeechWidget = w.findChild<KPIMTextEdit::TextToSpeechWidget *>(QStringLiteral("texttospeechwidget"));
QVERIFY(textToSpeechWidget);
......
......@@ -33,6 +33,7 @@
#include "editor/sievetextedit.h"
#include <KPIMTextEdit/PlainTextEditorWidget>
#include <KPIMTextEdit/TextToSpeechWidget>
#include <Libkdepim/LineEditCatchReturnKey>
#include <QLabel>
#include <KUrlRequester>
#include <KLineEdit>
......@@ -67,11 +68,11 @@ SieveScriptDebuggerFrontEndWidget::SieveScriptDebuggerFrontEndWidget(QWidget *pa
QLabel *extensionLab = new QLabel(i18n("Extension:"));
extensionLab->setObjectName(QStringLiteral("extensionlab"));
mExtension = new KLineEdit(this);
mExtension = new QLineEdit(this);
mExtension->setObjectName(QStringLiteral("extension"));
mExtension->setPlaceholderText(i18n("Activate extension with \"+<name of extension>\", deactivate it with \"-<name of extension>\""));
mExtension->setClearButtonEnabled(true);
mExtension->setTrapReturnKey(true);
new KPIM::LineEditCatchReturnKey(mExtension, this);
formLayout->addRow(extensionLab, mExtension);
......
......@@ -28,7 +28,7 @@ class PlainTextEditorWidget;
}
class KUrlRequester;
class QProcess;
class KLineEdit;
class QLineEdit;
class QSplitter;
namespace KSieveUi {
class SieveTextEditWidget;
......@@ -67,7 +67,7 @@ private:
KPIMTextEdit::PlainTextEditorWidget *mSieveTestResult = nullptr;
KUrlRequester *mEmailPath = nullptr;
QProcess *mProcess = nullptr;
KLineEdit *mExtension = nullptr;
QLineEdit *mExtension = nullptr;
QSplitter *mSplitter = nullptr;
};
}
......
......@@ -22,9 +22,10 @@
#include <KPIMTextEdit/PlainTextEditFindBar>
#include <KPIMTextEdit/SlideContainer>
#include <Libkdepim/LineEditCatchReturnKey>
#include <KLocalizedString>
#include <KLineEdit>
#include <QLineEdit>
#include <QVBoxLayout>
#include <QHBoxLayout>
......@@ -67,9 +68,9 @@ SieveTemplateEditDialog::SieveTemplateEditDialog(QWidget *parent, bool defaultTe
QLabel *label = new QLabel(i18n("Name:"));
hbox->addWidget(label);
mTemplateNameEdit = new KLineEdit;
mTemplateNameEdit = new QLineEdit;
mTemplateNameEdit->setReadOnly(defaultTemplate);
mTemplateNameEdit->setTrapReturnKey(true);
new KPIM::LineEditCatchReturnKey(mTemplateNameEdit, this);
mTemplateNameEdit->setClearButtonEnabled(!defaultTemplate);
hbox->addWidget(mTemplateNameEdit);
......
......@@ -22,7 +22,7 @@
#include <QDialog>
class KLineEdit;
class QLineEdit;
class QPushButton;
namespace KSieveUi {
......@@ -46,7 +46,7 @@ private:
void readConfig();
void writeConfig();
SieveTextEditWidget *mTextEditWidget = nullptr;
KLineEdit *mTemplateNameEdit = nullptr;
QLineEdit *mTemplateNameEdit = nullptr;
QPushButton *mOkButton = 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