Commit 6ffa8d05 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to QLineEdit

parent a44b54d2
...@@ -23,6 +23,7 @@ using namespace PimCommon::ConfigureImmutableWidgetUtils; ...@@ -23,6 +23,7 @@ using namespace PimCommon::ConfigureImmutableWidgetUtils;
#include <MessageList/AggregationConfigButton> #include <MessageList/AggregationConfigButton>
#include <MessageList/ThemeComboBox> #include <MessageList/ThemeComboBox>
#include <MessageList/ThemeConfigButton> #include <MessageList/ThemeConfigButton>
#include <Libkdepim/LineEditCatchReturnKey>
#include "messagelistsettings.h" #include "messagelistsettings.h"
#include <MailCommon/TagWidget> #include <MailCommon/TagWidget>
#include "MailCommon/Tag" #include "MailCommon/Tag"
...@@ -61,7 +62,7 @@ using namespace PimCommon::ConfigureImmutableWidgetUtils; ...@@ -61,7 +62,7 @@ using namespace PimCommon::ConfigureImmutableWidgetUtils;
#include <QHBoxLayout> #include <QHBoxLayout>
#include <KMessageBox> #include <KMessageBox>
#include <KKeySequenceWidget> #include <KKeySequenceWidget>
#include <KLineEdit> #include <QLineEdit>
#include <QIcon> #include <QIcon>
#include "kmail_debug.h" #include "kmail_debug.h"
...@@ -678,7 +679,8 @@ AppearancePageHeadersTab::AppearancePageHeadersTab(QWidget *parent) ...@@ -678,7 +679,8 @@ AppearancePageHeadersTab::AppearancePageHeadersTab(QWidget *parent)
hboxHBoxLayout->addWidget(radio); hboxHBoxLayout->addWidget(radio);
mDateDisplay->addButton(radio, dateDisplayConfig[i].dateDisplay); mDateDisplay->addButton(radio, dateDisplayConfig[i].dateDisplay);
mCustomDateFormatEdit = new KLineEdit(hbox); mCustomDateFormatEdit = new QLineEdit(hbox);
new KPIM::LineEditCatchReturnKey(mCustomDateFormatEdit, this);
hboxHBoxLayout->addWidget(mCustomDateFormatEdit); hboxHBoxLayout->addWidget(mCustomDateFormatEdit);
mCustomDateFormatEdit->setEnabled(false); mCustomDateFormatEdit->setEnabled(false);
hboxHBoxLayout->setStretchFactor(mCustomDateFormatEdit, 1); hboxHBoxLayout->setStretchFactor(mCustomDateFormatEdit, 1);
...@@ -969,8 +971,8 @@ AppearancePageMessageTagTab::AppearancePageMessageTagTab(QWidget *parent) ...@@ -969,8 +971,8 @@ AppearancePageMessageTagTab::AppearancePageMessageTagTab(QWidget *parent)
QHBoxLayout *addremovegrid = new QHBoxLayout(); QHBoxLayout *addremovegrid = new QHBoxLayout();
tageditgrid->addLayout(addremovegrid); tageditgrid->addLayout(addremovegrid);
mTagAddLineEdit = new KLineEdit(mTagsGroupBox); mTagAddLineEdit = new QLineEdit(mTagsGroupBox);
mTagAddLineEdit->setTrapReturnKey(true); new KPIM::LineEditCatchReturnKey(mTagAddLineEdit, this);
addremovegrid->addWidget(mTagAddLineEdit); addremovegrid->addWidget(mTagAddLineEdit);
mTagAddButton = new QPushButton(mTagsGroupBox); mTagAddButton = new QPushButton(mTagsGroupBox);
...@@ -1031,7 +1033,7 @@ AppearancePageMessageTagTab::AppearancePageMessageTagTab(QWidget *parent) ...@@ -1031,7 +1033,7 @@ AppearancePageMessageTagTab::AppearancePageMessageTagTab(QWidget *parent)
connect(mTagWidget, &TagWidget::changed, this, &AppearancePageMessageTagTab::slotEmitChangeCheck); connect(mTagWidget, &TagWidget::changed, this, &AppearancePageMessageTagTab::slotEmitChangeCheck);
//For enabling the add button in case box is non-empty //For enabling the add button in case box is non-empty
connect(mTagAddLineEdit, &KLineEdit::textChanged, connect(mTagAddLineEdit, &QLineEdit::textChanged,
this, &AppearancePage::MessageTagTab::slotAddLineTextChanged); this, &AppearancePage::MessageTagTab::slotAddLineTextChanged);
//For on-the-fly updating of tag name in editbox //For on-the-fly updating of tag name in editbox
...@@ -1040,7 +1042,7 @@ AppearancePageMessageTagTab::AppearancePageMessageTagTab(QWidget *parent) ...@@ -1040,7 +1042,7 @@ AppearancePageMessageTagTab::AppearancePageMessageTagTab(QWidget *parent)
connect(mTagWidget, &TagWidget::iconNameChanged, this, &AppearancePageMessageTagTab::slotIconNameChanged); connect(mTagWidget, &TagWidget::iconNameChanged, this, &AppearancePageMessageTagTab::slotIconNameChanged);
connect(mTagAddLineEdit, &KLineEdit::returnPressed, connect(mTagAddLineEdit, &QLineEdit::returnPressed,
this, &AppearancePageMessageTagTab::slotAddNewTag); this, &AppearancePageMessageTagTab::slotAddNewTag);
connect(mTagAddButton, &QAbstractButton::clicked, connect(mTagAddButton, &QAbstractButton::clicked,
...@@ -1163,12 +1165,12 @@ void AppearancePage::MessageTagTab::slotUpdateTagSettingWidgets(int aIndex) ...@@ -1163,12 +1165,12 @@ void AppearancePage::MessageTagTab::slotUpdateTagSettingWidgets(int aIndex)
TagListWidgetItem *tagItem = static_cast<TagListWidgetItem *>(item); TagListWidgetItem *tagItem = static_cast<TagListWidgetItem *>(item);
MailCommon::Tag::Ptr tmp_desc = tagItem->kmailTag(); MailCommon::Tag::Ptr tmp_desc = tagItem->kmailTag();
disconnect(mTagWidget->tagNameLineEdit(), &KLineEdit::textChanged, disconnect(mTagWidget->tagNameLineEdit(), &QLineEdit::textChanged,
this, &AppearancePage::MessageTagTab::slotNameLineTextChanged); this, &AppearancePage::MessageTagTab::slotNameLineTextChanged);
mTagWidget->tagNameLineEdit()->setEnabled(!tmp_desc->isImmutable); mTagWidget->tagNameLineEdit()->setEnabled(!tmp_desc->isImmutable);
mTagWidget->tagNameLineEdit()->setText(tmp_desc->tagName); mTagWidget->tagNameLineEdit()->setText(tmp_desc->tagName);
connect(mTagWidget->tagNameLineEdit(), &KLineEdit::textChanged, connect(mTagWidget->tagNameLineEdit(), &QLineEdit::textChanged,
this, &AppearancePage::MessageTagTab::slotNameLineTextChanged); this, &AppearancePage::MessageTagTab::slotNameLineTextChanged);
mTagWidget->setTagTextColor(tmp_desc->textColor); mTagWidget->setTagTextColor(tmp_desc->textColor);
......
...@@ -30,7 +30,7 @@ class ColorListBox; ...@@ -30,7 +30,7 @@ class ColorListBox;
class QButtonGroup; class QButtonGroup;
class QGroupBox; class QGroupBox;
class QSpinBox; class QSpinBox;
class KLineEdit; class QLineEdit;
class QModelIndex; class QModelIndex;
class KJob; class KJob;
namespace MessageViewer { namespace MessageViewer {
...@@ -146,7 +146,7 @@ private: // data ...@@ -146,7 +146,7 @@ private: // data
MessageList::Utils::ThemeComboBox *mThemeComboBox = nullptr; MessageList::Utils::ThemeComboBox *mThemeComboBox = nullptr;
QButtonGroup *mDateDisplay = nullptr; QButtonGroup *mDateDisplay = nullptr;
QGroupBox *mDateDisplayBox = nullptr; QGroupBox *mDateDisplayBox = nullptr;
KLineEdit *mCustomDateFormatEdit = nullptr; QLineEdit *mCustomDateFormatEdit = nullptr;
QString mCustomDateWhatsThis; QString mCustomDateWhatsThis;
}; };
...@@ -246,7 +246,7 @@ private: ...@@ -246,7 +246,7 @@ private:
void updateButtons(); void updateButtons();
private: // data private: // data
KLineEdit *mTagAddLineEdit = nullptr; QLineEdit *mTagAddLineEdit = nullptr;
QPushButton *mTagAddButton = nullptr; QPushButton *mTagAddButton = nullptr;
QPushButton *mTagRemoveButton = nullptr; QPushButton *mTagRemoveButton = nullptr;
QPushButton *mTagUpButton = nullptr; QPushButton *mTagUpButton = 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