Commit dd0fa8f0 authored by Laurent Montel's avatar Laurent Montel 😁

Use QComboBox

parent 2f6f2bab
......@@ -34,7 +34,7 @@
#include <QSpacerItem>
#include <QVBoxLayout>
#include <KComboBox>
#include <QComboBox>
#include <KLineEdit>
#include <KEditListWidget>
#include <KLocalizedString>
......@@ -98,16 +98,16 @@ void CollectionMailingListPage::init(const Akonadi::Collection &col)
//FIXME: add QWhatsThis
label = new QLabel(i18n("Preferred handler:"), mGroupWidget);
groupLayout->addWidget(label, 5, 0);
mMLHandlerCombo = new KComboBox(mGroupWidget);
mMLHandlerCombo = new QComboBox(mGroupWidget);
mMLHandlerCombo->addItem(i18n("KMail"), MailingList::KMail);
mMLHandlerCombo->addItem(i18n("Browser"), MailingList::Browser);
groupLayout->addWidget(mMLHandlerCombo, 5, 1, 1, 2);
connect(mMLHandlerCombo, QOverload<int>::of(&KComboBox::activated), this, &CollectionMailingListPage::slotMLHandling);
connect(mMLHandlerCombo, QOverload<int>::of(&QComboBox::activated), this, &CollectionMailingListPage::slotMLHandling);
label->setBuddy(mMLHandlerCombo);
label = new QLabel(i18n("Address type:"), mGroupWidget);
groupLayout->addWidget(label, 6, 0);
mAddressCombo = new KComboBox(mGroupWidget);
mAddressCombo = new QComboBox(mGroupWidget);
label->setBuddy(mAddressCombo);
groupLayout->addWidget(mAddressCombo, 6, 1);
......@@ -134,7 +134,7 @@ void CollectionMailingListPage::init(const Akonadi::Collection &col)
i18n("Post to List"), i18n("Subscribe to List"), i18n("Unsubscribe From List"), i18n("List Archives"), i18n("List Help")
};
mAddressCombo->addItems(el);
connect(mAddressCombo, QOverload<int>::of(&KComboBox::activated), this, &CollectionMailingListPage::slotAddressChanged);
connect(mAddressCombo, QOverload<int>::of(&QComboBox::activated), this, &CollectionMailingListPage::slotAddressChanged);
topLayout->addWidget(mGroupWidget);
mGroupWidget->setEnabled(false);
......
......@@ -32,7 +32,7 @@ class QPushButton;
template<typename T> class QSharedPointer;
class KComboBox;
class QComboBox;
class KJob;
class KEditListWidget;
class KSqueezedTextLabel;
......@@ -69,9 +69,9 @@ private:
MailingList mMailingList;
QCheckBox *mHoldsMailingList = nullptr;
KComboBox *mMLHandlerCombo = nullptr;
QComboBox *mMLHandlerCombo = nullptr;
QPushButton *mDetectButton = nullptr;
KComboBox *mAddressCombo = nullptr;
QComboBox *mAddressCombo = nullptr;
KEditListWidget *mEditList = nullptr;
KSqueezedTextLabel *mMLId = nullptr;
QWidget *mGroupWidget = nullptr;
......
......@@ -117,7 +117,7 @@ void CollectionViewPage::init(const Akonadi::Collection &col)
const QString senderReceiverColumnTip = i18n("Show Sender/Receiver Column in List of Messages");
QLabel *senderReceiverColumnLabel = new QLabel(i18n("Sho&w column:"), this);
mShowSenderReceiverComboBox = new KComboBox(this);
mShowSenderReceiverComboBox = new QComboBox(this);
mShowSenderReceiverComboBox->setToolTip(senderReceiverColumnTip);
senderReceiverColumnLabel->setBuddy(mShowSenderReceiverComboBox);
mShowSenderReceiverComboBox->insertItem(0, i18nc("@item:inlistbox Show default value.", "Default"));
......
......@@ -25,7 +25,7 @@
#include <MailCommon/FolderSettings>
class QCheckBox;
class QLabel;
class KComboBox;
class QComboBox;
class KIconButton;
class QRadioButton;
template<typename T> class QSharedPointer;
......@@ -61,7 +61,7 @@ private:
KIconButton *mNormalIconButton = nullptr;
QLabel *mUnreadIconLabel = nullptr;
KIconButton *mUnreadIconButton = nullptr;
KComboBox *mShowSenderReceiverComboBox = nullptr;
QComboBox *mShowSenderReceiverComboBox = nullptr;
QCheckBox *mUseDefaultAggregationCheckBox = nullptr;
MessageList::Utils::AggregationComboBox *mAggregationComboBox = nullptr;
QCheckBox *mUseDefaultThemeCheckBox = nullptr;
......
......@@ -38,7 +38,7 @@ using MailTransport::TransportManagementWidget;
#include <AkonadiCore/agentinstancecreatejob.h>
#include <identity/identitypage.h>
#include <Libkdepim/LdapConfigureWidget>
#include <KComboBox>
#include <QComboBox>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KMessageBox>
......@@ -123,23 +123,23 @@ AccountsPageSendingTab::AccountsPageSendingTab(QWidget *parent)
connect(mCheckSpellingBeforeSending, &QCheckBox::stateChanged, this, &AccountsPageSendingTab::slotEmitChanged);
// "send on check" combo:
mSendOnCheckCombo = new KComboBox(group);
mSendOnCheckCombo = new QComboBox(group);
mSendOnCheckCombo->setEditable(false);
mSendOnCheckCombo->addItems(QStringList()
<< i18n("Never Automatically")
<< i18n("On Manual Mail Checks")
<< i18n("On All Mail Checks"));
glay->addWidget(mSendOnCheckCombo, 2, 1);
connect(mSendOnCheckCombo, QOverload<int>::of(&KComboBox::activated), this, &AccountsPageSendingTab::slotEmitChanged);
connect(mSendOnCheckCombo, QOverload<int>::of(&QComboBox::activated), this, &AccountsPageSendingTab::slotEmitChanged);
// "default send method" combo:
mSendMethodCombo = new KComboBox(group);
mSendMethodCombo = new QComboBox(group);
mSendMethodCombo->setEditable(false);
mSendMethodCombo->addItems(QStringList()
<< i18n("Send Now")
<< i18n("Send Later"));
glay->addWidget(mSendMethodCombo, 3, 1);
connect(mSendMethodCombo, QOverload<int>::of(&KComboBox::activated), this, &AccountsPageSendingTab::slotEmitChanged);
connect(mSendMethodCombo, QOverload<int>::of(&QComboBox::activated), this, &AccountsPageSendingTab::slotEmitChanged);
// labels:
QLabel *l = new QLabel(i18n("Send &messages in outbox folder:"), group);
......
......@@ -23,7 +23,7 @@
#include "ui_accountspagereceivingtab.h"
class QCheckBox;
class KComboBox;
class QComboBox;
class OrgFreedesktopAkonadiNewMailNotifierInterface;
namespace KLDAP {
class LdapConfigureWidget;
......@@ -45,8 +45,8 @@ private:
private:
QCheckBox *mConfirmSendCheck = nullptr;
QCheckBox *mCheckSpellingBeforeSending = nullptr;
KComboBox *mSendOnCheckCombo = nullptr;
KComboBox *mSendMethodCombo = nullptr;
QComboBox *mSendOnCheckCombo = nullptr;
QComboBox *mSendMethodCombo = nullptr;
};
// subclasses: one class per tab:
......
......@@ -165,8 +165,7 @@ AppearancePageFontsTab::AppearancePageFontsTab(QWidget *parent)
// "font location" combo box and label:
QHBoxLayout *hlay = new QHBoxLayout(); // inherites spacing
vlay->addLayout(hlay);
mFontLocationCombo = new KComboBox(this);
mFontLocationCombo->setEditable(false);
mFontLocationCombo = new QComboBox(this);
mFontLocationCombo->setEnabled(false); // !mCustomFontCheck->isChecked()
QStringList fontDescriptions;
......@@ -198,7 +197,7 @@ AppearancePageFontsTab::AppearancePageFontsTab(QWidget *parent)
connect(mCustomFontCheck, &QAbstractButton::toggled,
mFontChooser, &QWidget::setEnabled);
// load the right font settings into mFontChooser:
connect(mFontLocationCombo, QOverload<int>::of(&KComboBox::activated),
connect(mFontLocationCombo, QOverload<int>::of(&QComboBox::activated),
this, &AppearancePage::FontsTab::slotFontSelectorChanged);
}
......
......@@ -24,7 +24,7 @@
class QPushButton;
class QCheckBox;
class KComboBox;
class QComboBox;
class KFontChooser;
class ColorListBox;
class QButtonGroup;
......@@ -72,7 +72,7 @@ private:
private:
QCheckBox *mCustomFontCheck = nullptr;
KComboBox *mFontLocationCombo = nullptr;
QComboBox *mFontLocationCombo = nullptr;
KFontChooser *mFontChooser = nullptr;
int mActiveFontIndex;
......
......@@ -285,7 +285,7 @@ ComposerPageGeneralTab::ComposerPageGeneralTab(QWidget *parent)
#ifdef KDEPIM_ENTERPRISE_BUILD
++row;
// "Default forwarding type" combobox
mForwardTypeCombo = new KComboBox(false, this);
mForwardTypeCombo = new QComboBox(this);
mForwardTypeCombo->addItems(QStringList() << i18nc("@item:inlistbox Inline mail forwarding",
"Inline")
<< i18n("As Attachment"));
......@@ -297,7 +297,7 @@ ComposerPageGeneralTab::ComposerPageGeneralTab(QWidget *parent)
label = new QLabel(i18n("Default forwarding type:"), this);
label->setBuddy(mForwardTypeCombo);
connect(mForwardTypeCombo, QOverload<int>::of(&KComboBox::activated), this, &ComposerPageGeneralTab::slotEmitChanged);
connect(mForwardTypeCombo, QOverload<int>::of(&QComboBox::activated), this, &ComposerPageGeneralTab::slotEmitChanged);
groupGridLayout->addWidget(label, row, 0);
groupGridLayout->addWidget(mForwardTypeCombo, row, 1);
......
......@@ -24,7 +24,7 @@
class QCheckBox;
class QSpinBox;
class QSpinBox;
class KComboBox;
class QComboBox;
class QLineEdit;
class ListView;
class QPushButton;
......@@ -73,7 +73,7 @@ private:
QCheckBox *mImprovePlainTextOfHtmlMessage = nullptr;
QSpinBox *mMaximumRecentAddress = nullptr;
#ifdef KDEPIM_ENTERPRISE_BUILD
KComboBox *mForwardTypeCombo = nullptr;
QComboBox *mForwardTypeCombo = nullptr;
QCheckBox *mRecipientCheck = nullptr;
QSpinBox *mRecipientSpin = nullptr;
#endif
......
......@@ -21,7 +21,7 @@
#include "kmkernel.h"
#include <QVBoxLayout>
#include <KComboBox>
#include <QComboBox>
#include <KNotifyConfigWidget>
#include <KLocalizedString>
#include <KConfig>
......@@ -39,7 +39,7 @@ KMKnotify::KMKnotify(QWidget *parent)
setWindowTitle(i18n("Notification"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
m_comboNotify = new KComboBox(false, this);
m_comboNotify = new QComboBox(this);
m_comboNotify->setSizeAdjustPolicy(QComboBox::AdjustToContents);
mainLayout->addWidget(m_comboNotify);
......@@ -58,7 +58,7 @@ KMKnotify::KMKnotify(QWidget *parent)
mainLayout->addWidget(buttonBox);
connect(m_comboNotify, QOverload<int>::of(&KComboBox::activated), this, &KMKnotify::slotComboChanged);
connect(m_comboNotify, QOverload<int>::of(&QComboBox::activated), this, &KMKnotify::slotComboChanged);
connect(okButton, &QPushButton::clicked, this, &KMKnotify::slotOk);
connect(m_notifyWidget, &KNotifyConfigWidget::changed, this, &KMKnotify::slotConfigChanged);
initCombobox();
......
......@@ -21,7 +21,7 @@
#define KMKNOTIFY_H
#include <QDialog>
class KComboBox;
class QComboBox;
class KNotifyConfigWidget;
namespace KMail {
......@@ -42,7 +42,7 @@ private:
void initCombobox();
void writeConfig();
void readConfig();
KComboBox *m_comboNotify = nullptr;
QComboBox *m_comboNotify = nullptr;
KNotifyConfigWidget *m_notifyWidget = nullptr;
bool m_changed = false;
};
......
......@@ -90,7 +90,7 @@ using MailTransport::TransportManager;
#include <qurl.h>
#include "kmail_debug.h"
#include <QPushButton>
#include <kcombobox.h>
#include <qcombobox.h>
#include <QTabWidget>
#include <QIcon>
......@@ -463,8 +463,7 @@ IdentityDialog::IdentityDialog(QWidget *parent)
// "Preferred Crypto Message Format" combobox and label:
++row;
mPreferredCryptoMessageFormat = new KComboBox(tab);
mPreferredCryptoMessageFormat->setEditable(false);
mPreferredCryptoMessageFormat = new QComboBox(tab);
QStringList l;
l << Kleo::cryptoMessageFormatToLabel(Kleo::AutoFormat)
<< Kleo::cryptoMessageFormatToLabel(Kleo::InlineOpenPGPFormat)
......
......@@ -36,7 +36,7 @@
class QCheckBox;
class KEditListWidget;
class KComboBox;
class QComboBox;
class KJob;
class KLineEdit;
class QPushButton;
......@@ -119,7 +119,7 @@ private:
KeySelectionCombo *mPGPEncryptionKeyRequester = nullptr;
KeySelectionCombo *mSMIMESigningKeyRequester = nullptr;
KeySelectionCombo *mSMIMEEncryptionKeyRequester = nullptr;
KComboBox *mPreferredCryptoMessageFormat = nullptr;
QComboBox *mPreferredCryptoMessageFormat = nullptr;
QCheckBox *mAutoSign = nullptr;
QCheckBox *mAutoEncrypt = nullptr;
// "advanced" tab:
......
......@@ -26,7 +26,7 @@
#include <KIdentityManagement/kidentitymanagement/identitymanager.h>
#include <PimCommon/PimUtil>
#include <KComboBox>
#include <QComboBox>
#include <KLineEdit>
#include <KLocalizedString>
#include <KSeparator>
......@@ -96,8 +96,7 @@ NewIdentityDialog::NewIdentityDialog(KIdentityManagement::IdentityManager *manag
// row 4: combobox with existing identities and label
hlay = new QHBoxLayout(); // inherits spacing
vlay->addLayout(hlay);
mComboBox = new KComboBox(page);
mComboBox->setEditable(false);
mComboBox = new QComboBox(page);
mComboBox->addItems(manager->shadowIdentities());
mComboBox->setEnabled(false);
QLabel *label = new QLabel(i18n("&Existing identities:"), page);
......@@ -112,7 +111,7 @@ NewIdentityDialog::NewIdentityDialog(KIdentityManagement::IdentityManager *manag
// enable/disable combobox and label depending on the third radio
// button's state:
connect(radio, &QRadioButton::toggled, label, &QLabel::setEnabled);
connect(radio, &QRadioButton::toggled, mComboBox, &KComboBox::setEnabled);
connect(radio, &QRadioButton::toggled, mComboBox, &QComboBox::setEnabled);
mOkButton->setEnabled(false); // since line edit is empty
......
......@@ -26,7 +26,7 @@
#include <QDialog>
class KComboBox;
class QComboBox;
class KLineEdit;
class QButtonGroup;
......@@ -56,7 +56,7 @@ private:
void slotHelp();
void slotEnableOK(const QString &);
KLineEdit *mLineEdit = nullptr;
KComboBox *mComboBox = nullptr;
QComboBox *mComboBox = nullptr;
QButtonGroup *mButtonGroup = nullptr;
KIdentityManagement::IdentityManager *mIdentityManager = nullptr;
QPushButton *mOkButton = nullptr;
......
......@@ -40,7 +40,7 @@
#include <messageviewer/kxface.h>
#include <KJobWidgets>
#include <kcombobox.h>
#include <qcombobox.h>
#include <KLocalizedString>
#include <kmessagebox.h>
#include <KIO/StoredTransferJob>
......@@ -89,8 +89,7 @@ XFaceConfigurator::XFaceConfigurator(QWidget *parent)
// "obtain X-Face from" combo and label:
hlay = new QHBoxLayout(); // inherits spacing
vlay->addLayout(hlay);
KComboBox *sourceCombo = new KComboBox(this);
sourceCombo->setEditable(false);
QComboBox *sourceCombo = new QComboBox(this);
sourceCombo->setWhatsThis(
i18n("Click on the widgets below to obtain help on the input methods."));
sourceCombo->setEnabled(false); // since !mEnableCheck->isChecked()
......@@ -109,9 +108,9 @@ XFaceConfigurator::XFaceConfigurator(QWidget *parent)
QStackedWidget *widgetStack = new QStackedWidget(this);
widgetStack->setEnabled(false); // since !mEnableCheck->isChecked()
vlay->addWidget(widgetStack, 1);
connect(sourceCombo, QOverload<int>::of(&KComboBox::highlighted), widgetStack, &QStackedWidget::setCurrentIndex);
connect(sourceCombo, QOverload<int>::of(&KComboBox::activated), widgetStack, &QStackedWidget::setCurrentIndex);
connect(mEnableCheck, &QCheckBox::toggled, sourceCombo, &KComboBox::setEnabled);
connect(sourceCombo, QOverload<int>::of(&QComboBox::highlighted), widgetStack, &QStackedWidget::setCurrentIndex);
connect(sourceCombo, QOverload<int>::of(&QComboBox::activated), widgetStack, &QStackedWidget::setCurrentIndex);
connect(mEnableCheck, &QCheckBox::toggled, sourceCombo, &QComboBox::setEnabled);
connect(mEnableCheck, &QCheckBox::toggled, widgetStack, &QStackedWidget::setEnabled);
connect(mEnableCheck, &QCheckBox::toggled, label, &QLabel::setEnabled);
// The focus might be still in the widget that is disabled
......
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