Commit 01cbafb4 authored by Carl Schwan's avatar Carl Schwan 🚴 Committed by Laurent Montel
Browse files

Port Imap Dialog to QFormLayout

parent 1a31938b
Pipeline #75676 failed with stage
in 3 minutes and 20 seconds
......@@ -66,7 +66,7 @@ set(KDEPIMRUNTIME_LIB_VERSION "${KDEPIM_RUNTIME_VERSION_NUMBER}")
set(KDEPIMRUNTIME_LIB_SOVERSION "5")
set(AKONADI_VERSION "5.18.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.18.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.18.41")
set(KMAILTRANSPORT_LIB_VERSION "5.18.40")
set(CALENDARUTILS_LIB_VERSION "5.18.40")
set(KIMAP_LIB_VERSION "5.18.40")
......
......@@ -44,6 +44,7 @@
#include <entitydisplayattribute.h>
#include <resourcesettings.h>
#include <QFontDatabase>
#include <QPointer>
#include <QVBoxLayout>
#include <kidentitymanagement/identitycombo.h>
......@@ -158,6 +159,7 @@ SetupServer::SetupServer(ImapResourceBase *parentResource, WId parent)
m_ui->checkInterval->setMinimum(Akonadi::ResourceSettings::self()->minimumCheckInterval());
m_ui->checkInterval->setMaximum(10000);
m_ui->checkInterval->setSingleStep(1);
m_ui->imapInfo->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
// regex for evaluating a valid server name/ip
mValidator.setRegularExpression(QRegularExpression(QStringLiteral("[A-Za-z0-9_:.-]*")));
......@@ -167,9 +169,8 @@ SetupServer::SetupServer(ImapResourceBase *parentResource, WId parent)
m_ui->folderRequester->setAccessRightsFilter(Akonadi::Collection::CanChangeItem | Akonadi::Collection::CanCreateItem | Akonadi::Collection::CanDeleteItem);
m_ui->folderRequester->changeCollectionDialogOptions(Akonadi::CollectionDialog::AllowToCreateNewChildCollection);
m_identityCombobox = new KIdentityManagement::IdentityCombo(KIdentityManagement::IdentityManager::self(), this);
m_ui->identityLabel->setBuddy(m_identityCombobox);
m_ui->identityLayout->addWidget(m_identityCombobox, 1);
m_ui->identityLabel->setBuddy(m_identityCombobox);
m_identityCombobox->showDefault(true);
m_ui->formLayoutAdvanced->insertRow(3, i18n("Identity:"), m_identityCombobox);
connect(m_ui->testButton, &QPushButton::pressed, this, &SetupServer::slotTest);
......@@ -183,7 +184,6 @@ SetupServer::SetupServer(ImapResourceBase *parentResource, WId parent)
connect(m_ui->managesieveCheck, &QCheckBox::toggled, this, &SetupServer::slotEnableWidgets);
connect(m_ui->sameConfigCheck, &QCheckBox::toggled, this, &SetupServer::slotEnableWidgets);
connect(m_ui->useDefaultIdentityCheck, &QCheckBox::toggled, this, &SetupServer::slotIdentityCheckboxChanged);
connect(m_ui->enableMailCheckBox, &QCheckBox::toggled, this, &SetupServer::slotMailCheckboxChanged);
connect(m_ui->safeImapGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, &SetupServer::slotEncryptionRadioChanged);
connect(m_ui->customSieveGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, &SetupServer::slotCustomSieveChanged);
......@@ -211,11 +211,6 @@ void SetupServer::slotSubcriptionCheckboxChanged()
m_ui->subscriptionButton->setEnabled(m_ui->subscriptionEnabled->isChecked());
}
void SetupServer::slotIdentityCheckboxChanged()
{
m_identityCombobox->setEnabled(!m_ui->useDefaultIdentityCheck->isChecked());
}
void SetupServer::slotMailCheckboxChanged()
{
m_ui->checkInterval->setEnabled(m_ui->enableMailCheckBox->isChecked());
......@@ -335,9 +330,9 @@ void SetupServer::applySettings()
}
m_parentResource->settings()->setAutomaticExpungeEnabled(m_ui->autoExpungeCheck->isChecked());
m_parentResource->settings()->setUseDefaultIdentity(m_ui->useDefaultIdentityCheck->isChecked());
m_parentResource->settings()->setUseDefaultIdentity(m_identityCombobox->isDefaultIdentity());
if (!m_ui->useDefaultIdentityCheck->isChecked()) {
if (!m_identityCombobox->isDefaultIdentity()) {
m_parentResource->settings()->setAccountIdentity(m_identityCombobox->currentIdentity());
}
......@@ -448,10 +443,7 @@ void SetupServer::readSettings()
requestJob->start();
}
m_ui->useDefaultIdentityCheck->setChecked(m_parentResource->settings()->useDefaultIdentity());
if (!m_ui->useDefaultIdentityCheck->isChecked()) {
m_identityCombobox->setCurrentIdentity(m_parentResource->settings()->accountIdentity());
}
m_identityCombobox->setCurrentIdentity(m_parentResource->settings()->accountIdentity());
m_ui->enableMailCheckBox->setChecked(m_parentResource->settings()->intervalCheckEnabled());
if (m_ui->enableMailCheckBox->isChecked()) {
......@@ -501,7 +493,7 @@ void SetupServer::slotTest()
qCDebug(IMAPRESOURCE_LOG) << m_ui->imapServer->text();
m_ui->testButton->setEnabled(false);
m_ui->safeImap->setEnabled(false);
m_ui->advancedTab->setEnabled(false);
m_ui->authenticationCombo->setEnabled(false);
m_ui->testInfo->clear();
......@@ -570,7 +562,7 @@ void SetupServer::slotFinished(const QVector<int> &testResult)
m_ui->testInfo->setText(text);
m_ui->testButton->setEnabled(true);
m_ui->safeImap->setEnabled(true);
m_ui->advancedTab->setEnabled(true);
m_ui->authenticationCombo->setEnabled(true);
slotEncryptionRadioChanged();
slotSafetyChanged();
......
......@@ -61,7 +61,6 @@ private Q_SLOTS:
* Call this if you want the settings saved from this page.
*/
void applySettings();
void slotIdentityCheckboxChanged();
void slotMailCheckboxChanged();
void slotEncryptionRadioChanged();
void slotSubcriptionCheckboxChanged();
......
This diff is collapsed.
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