Skip to content

Commit

Permalink
Alter email dialog so enter key will send email, ccSelf unlocks send …
Browse files Browse the repository at this point in the history
…button, and toAddress has focus on start.
  • Loading branch information
baumgarr committed Oct 28, 2015
1 parent 1f8e6c3 commit 7336763
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dialog/emaildialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ EmailDialog::EmailDialog(QWidget *parent) :
connect(toAddress, SIGNAL(textChanged(QString)), this, SLOT(toAddressChanged()));
connect(ccAddress, SIGNAL(textChanged(QString)), this, SLOT(toAddressChanged()));
connect(bccAddress, SIGNAL(textChanged(QString)), this, SLOT(toAddressChanged()));
connect(ccSelf, SIGNAL(toggled(bool)), this, SLOT(toAddressChanged()));
cancelButton->setAutoDefault(false);
sendButton->setEnabled(false);
sendButton->setAutoDefault(true);
sendButton->setAutoExclusive(true);
toAddress->setFocus();
}


Expand Down Expand Up @@ -103,7 +108,7 @@ void EmailDialog::toAddressChanged() {
int cci = cc.indexOf("@");
int bcci = bcc.indexOf("@");

if (toi <=0 && cci <= 0 && bcci <= 0)
if (toi <=0 && cci <= 0 && bcci <= 0 && !ccSelf->isChecked())
sendButton->setEnabled(false);
else
sendButton->setEnabled(true);
Expand Down

0 comments on commit 7336763

Please sign in to comment.