Git commit 13ffc00d6e8f374711b3376ea9373c8ea6713480 by Jan Kundrát. Committed on 12/04/2017 at 18:44. Pushed by gerrit into branch 'master'.
GUI: Show when we cannot send yet/anymore If an attachment was not available (either "yet" due to a slow network, or "not anymore" due to e.g. a deleted item), the UI would refuse to prepare for sending, but there was no visible indication about the culprit to the user. This change doesn't make it 100% foolproof, but at least it shows that something was wrong and that the button hit was not ignored. Change-Id: I67776902dfaf09410fd84e1bb33c46b1174dbdd0 M +8 -2 src/Gui/ComposeWidget.cpp https://commits.kde.org/trojita/13ffc00d6e8f374711b3376ea9373c8ea6713480 diff --git a/src/Gui/ComposeWidget.cpp b/src/Gui/ComposeWidget.cpp index 4e8b37be..e76ea2ff 100644 --- a/src/Gui/ComposeWidget.cpp +++ b/src/Gui/ComposeWidget.cpp @@ -751,7 +751,12 @@ bool ComposeWidget::buildMessageData() } } - return m_composer->isReadyForSerialization(); + if (!m_composer->isReadyForSerialization()) { + gotError(tr("Cannot prepare this e-mail for sending: some parts are not available")); + return false; + } + + return true; } void ComposeWidget::send() @@ -761,8 +766,9 @@ void ComposeWidget::send() // than losing some work. It's cheap anyway. saveDraft(m_autoSavePath); - if (!buildMessageData()) + if (!buildMessageData()) { return; + } const bool reuseImapCreds = m_settings->value(Common::SettingsNames::smtpAuthReuseImapCredsKey, false).toBool(); m_submission->setImapOptions(m_settings->value(Common::SettingsNames::composerSaveToImapKey, true).toBool(),
