summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-10-24 08:13:32 +0200
committerMontel Laurent <[email protected]>2017-10-24 08:13:32 +0200
commitc25e380dac756fda62640f235b1f16fa0b21b795 (patch)
tree2b21d8544c172050ed6b97daa18f929883ba010f
parent0ef40d6a04d65ed534e30613ee8c7307f3f08605 (diff)
Signal when identity was removed
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/editor/kmcomposerwin.cpp8
-rw-r--r--src/editor/kmcomposerwin.h1
-rw-r--r--src/editor/warningwidgets/incorrectidentityfolderwarning.cpp20
-rw-r--r--src/editor/warningwidgets/incorrectidentityfolderwarning.h3
5 files changed, 33 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d47ce15..148600a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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")
diff --git a/src/editor/kmcomposerwin.cpp b/src/editor/kmcomposerwin.cpp
index d0e3cfa..4b24d82 100644
--- a/src/editor/kmcomposerwin.cpp
+++ b/src/editor/kmcomposerwin.cpp
@@ -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();
+ }
+}
diff --git a/src/editor/kmcomposerwin.h b/src/editor/kmcomposerwin.h
index e9f89b6..0c3c0d2 100644
--- a/src/editor/kmcomposerwin.h
+++ b/src/editor/kmcomposerwin.h
@@ -534,6 +534,7 @@ private:
};
void slotCryptoModuleSelected();
void slotFccIsInvalid();
+ void slotIdentityDeleted(uint uoid);
void updateComposerAfterIdentityChanged(const KIdentityManagement::Identity &ident, uint uoid, bool wasModified);
diff --git a/src/editor/warningwidgets/incorrectidentityfolderwarning.cpp b/src/editor/warningwidgets/incorrectidentityfolderwarning.cpp
index 79937e2..3c50017 100644
--- a/src/editor/warningwidgets/incorrectidentityfolderwarning.cpp
+++ b/src/editor/warningwidgets/incorrectidentityfolderwarning.cpp
@@ -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;
+}
diff --git a/src/editor/warningwidgets/incorrectidentityfolderwarning.h b/src/editor/warningwidgets/incorrectidentityfolderwarning.h
index 6afbf6d..9f6f2b0 100644
--- a/src/editor/warningwidgets/incorrectidentityfolderwarning.h
+++ b/src/editor/warningwidgets/incorrectidentityfolderwarning.h
@@ -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