Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

Signal when identity was removed

parent 0ef40d6a
......@@ -48,7 +48,7 @@ set(AKONADI_CONTACT_VERSION "5.6.40")
set(KCONTACTS_LIB_VERSION "5.6.40")
set(KCALENDARCORE_LIB_VERSION "5.6.40")
set(CALENDARUTILS_LIB_VERSION "5.6.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.6.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.6.41")
set(KLDAP_LIB_VERSION "5.6.40")
set(KMAILTRANSPORT_LIB_VERSION "5.6.42")
set(KONTACTINTERFACE_LIB_VERSION "5.6.40")
......
......@@ -312,6 +312,7 @@ KMComposerWin::KMComposerWin(const KMime::Message::Ptr &aMsg, bool lastSignState
KIdentityManagement::IdentityCombo *identity = new KIdentityManagement::IdentityCombo(kmkernel->identityManager(),
mHeadersArea);
identity->setCurrentIdentity(mId);
connect(identity, &KIdentityManagement::IdentityCombo::identityDeleted, this, &KMComposerWin::slotIdentityDeleted);
mComposerBase->setIdentityCombo(identity);
sigController->setIdentityCombo(identity);
......@@ -3472,3 +3473,10 @@ void KMComposerWin::slotKeyForMailBoxResult(const GpgME::KeyListResult &, const
slotRecipientEditorFocusChanged();
}
}
void KMComposerWin::slotIdentityDeleted(uint uoid)
{
if (mComposerBase->identityCombo()->currentIdentity() == uoid) {
mIncorrectIdentityFolderWarning->identityInvalid();
}
}
......@@ -534,6 +534,7 @@ private:
};
void slotCryptoModuleSelected();
void slotFccIsInvalid();
void slotIdentityDeleted(uint uoid);
void updateComposerAfterIdentityChanged(const KIdentityManagement::Identity &ident, uint uoid, bool wasModified);
......
......@@ -27,6 +27,7 @@ IncorrectIdentityFolderWarning::IncorrectIdentityFolderWarning(QWidget *parent)
setCloseButtonVisible(true);
setMessageType(Warning);
setWordWrap(true);
connect(this, &IncorrectIdentityFolderWarning::hideAnimationFinished, this, &IncorrectIdentityFolderWarning::slotHideAnnimationFinished);
}
IncorrectIdentityFolderWarning::~IncorrectIdentityFolderWarning()
......@@ -45,6 +46,12 @@ void IncorrectIdentityFolderWarning::fccIsInvalid()
updateText();
}
void IncorrectIdentityFolderWarning::identityInvalid()
{
mIdentityIsInvalid = true;
updateText();
}
void IncorrectIdentityFolderWarning::updateText()
{
QString text;
......@@ -57,6 +64,19 @@ void IncorrectIdentityFolderWarning::updateText()
}
text += i18n("Sent Folder is not defined. Please verify it before to send it.");
}
if (mIdentityIsInvalid) {
if (!text.isEmpty()) {
text += QLatin1Char('\n');
}
text += i18n("Identity was not found. Please verify that you will use a correct identity.");
}
setText(text);
animatedShow();
}
void IncorrectIdentityFolderWarning::slotHideAnnimationFinished()
{
mMailTransportIsInvalid = false;
mFccIsInvalid = false;
mIdentityIsInvalid = false;
}
......@@ -31,11 +31,14 @@ public:
void mailTransportIsInvalid();
void fccIsInvalid();
void identityInvalid();
private:
void updateText();
void slotHideAnnimationFinished();
bool mMailTransportIsInvalid = false;
bool mFccIsInvalid = false;
bool mIdentityIsInvalid = false;
};
#endif // INCORRECTIDENTITYFOLDERWARNING_H
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