Commit 23db0d53 authored by Karan Luthra's avatar Karan Luthra
Browse files

Show save draft dialog on change of recipients or subject as well

Treat changes to the recipients or subject line as changes to
message. Previously, only changes to the Composer TextEdit and
Sender field counted as "Message Updated"

BUG: 336111
REVIEW: 118727
parent 05de2a5c
......@@ -161,6 +161,7 @@ ComposeWidget::ComposeWidget(MainWindow *mainWindow, QSettings *settings, MSA::M
connect(ui->mailText, SIGNAL(sendRequest()), SLOT(send()));
connect(ui->mailText, SIGNAL(textChanged()), SLOT(setMessageUpdated()));
connect(ui->subject, SIGNAL(textChanged(QString)), SLOT(updateWindowTitle()));
connect(ui->subject, SIGNAL(textChanged(QString)), SLOT(setMessageUpdated()));
FromAddressProxyModel *proxy = new FromAddressProxyModel(this);
......@@ -262,7 +263,7 @@ void ComposeWidget::changeEvent(QEvent *e)
void ComposeWidget::closeEvent(QCloseEvent *ce)
const bool noSaveRequired = m_sentMail || ui->mailText->document()->isEmpty() || !m_messageEverEdited ||
const bool noSaveRequired = m_sentMail || !m_messageEverEdited ||
(m_explicitDraft && !m_messageUpdated); // autosave to permanent draft and no update
if (!noSaveRequired) { // save is required
QMessageBox msgBox(this);
......@@ -595,6 +596,7 @@ void ComposeWidget::addRecipient(int position, Composer::RecipientKind kind, con
LineEdit *edit = new LineEdit(address, this);
connect(edit, SIGNAL(textChanged(QString)), this, SLOT(slotCheckAddress()));
connect(edit, SIGNAL(textChanged(QString)), this, SLOT(setMessageUpdated()));
connect(edit, SIGNAL(textEdited(QString)), SLOT(completeRecipients(QString)));
connect(edit, SIGNAL(editingFinished()), SLOT(collapseRecipients()));
connect(edit, SIGNAL(textChanged(QString)), m_recipientListUpdateTimer, SLOT(start()));
Supports Markdown
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