author | alwin <alwin> | 2003-12-28 17:32:43 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-28 17:32:43 (UTC) |
commit | 696a2dcfcb65fbb24b709bbae0a18a7854e2d72c (patch) (unidiff) | |
tree | e813c9508881796cf999e9c25c05e4482c6fd9e8 /noncore/net/mail/composemail.cpp | |
parent | b900cad9c050c2d5963228a2191e13053457ef1d (diff) | |
download | opie-696a2dcfcb65fbb24b709bbae0a18a7854e2d72c.zip opie-696a2dcfcb65fbb24b709bbae0a18a7854e2d72c.tar.gz opie-696a2dcfcb65fbb24b709bbae0a18a7854e2d72c.tar.bz2 |
reduced to the max...
- from address isn't setup any longer within the smtp account (it makes realy no
sense, a smtp account describes the connection to a smtp server, not the
identity of the sender)
- from address is taken from the personal info of the addressbook (thats why this
info exists). Of course the user can change it when sending an email.
- user can select a from with a selection of the mails given in their personal
infos.
- in addresspicker: use "<Firstname> <Lastname>" instead of "Filename"
- settings ui: switched of the part within the smtp accounts describing the
identitiy of user
ToDo: a dialog setting up a default signature
Diffstat (limited to 'noncore/net/mail/composemail.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/composemail.cpp | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp index 73d1a43..13c7900 100644 --- a/noncore/net/mail/composemail.cpp +++ b/noncore/net/mail/composemail.cpp | |||
@@ -5,2 +5,4 @@ | |||
5 | #include <qpe/config.h> | 5 | #include <qpe/config.h> |
6 | #include <qpe/global.h> | ||
7 | #include <qpe/contact.h> | ||
6 | 8 | ||
@@ -14,2 +16,22 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
14 | 16 | ||
17 | QString vfilename = Global::applicationFileName("addressbook", | ||
18 | "businesscard.vcf"); | ||
19 | Contact c; | ||
20 | if (QFile::exists(vfilename)) { | ||
21 | c = Contact::readVCard( vfilename )[0]; | ||
22 | } | ||
23 | |||
24 | QStringList mails = c.emailList(); | ||
25 | QString defmail = c.defaultEmail(); | ||
26 | |||
27 | if (defmail.length()!=0) { | ||
28 | fromBox->insertItem(defmail); | ||
29 | } | ||
30 | QStringList::ConstIterator sit = mails.begin(); | ||
31 | for (;sit!=mails.end();++sit) { | ||
32 | if ( (*sit)==defmail) | ||
33 | continue; | ||
34 | fromBox->insertItem((*sit)); | ||
35 | } | ||
36 | senderNameEdit->setText(c.firstName()+" "+c.lastName()); | ||
15 | Config cfg( "mail" ); | 37 | Config cfg( "mail" ); |
@@ -22,2 +44,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
22 | QList<Account> accounts = settings->getAccounts(); | 44 | QList<Account> accounts = settings->getAccounts(); |
45 | |||
23 | Account *it; | 46 | Account *it; |
@@ -26,3 +49,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
26 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 49 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
27 | fromBox->insertItem( smtp->getMail() ); | 50 | smtpAccountBox->insertItem( smtp->getAccountName() ); |
28 | smtpAccounts.append( smtp ); | 51 | smtpAccounts.append( smtp ); |
@@ -32,3 +55,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
32 | if ( smtpAccounts.count() > 0 ) { | 55 | if ( smtpAccounts.count() > 0 ) { |
33 | fillValues( fromBox->currentItem() ); | 56 | fillValues( smtpAccountBox->currentItem() ); |
34 | } else { | 57 | } else { |
@@ -40,3 +63,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
40 | 63 | ||
41 | connect( fromBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) ); | 64 | connect( smtpAccountBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) ); |
42 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); | 65 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); |
@@ -110,4 +133,4 @@ void ComposeMail::fillValues( int current ) | |||
110 | { | 133 | { |
134 | #if 0 | ||
111 | SMTPaccount *smtp = smtpAccounts.at( current ); | 135 | SMTPaccount *smtp = smtpAccounts.at( current ); |
112 | |||
113 | ccLine->clear(); | 136 | ccLine->clear(); |
@@ -124,4 +147,4 @@ void ComposeMail::fillValues( int current ) | |||
124 | } | 147 | } |
125 | |||
126 | sigMultiLine->setText( smtp->getSignature() ); | 148 | sigMultiLine->setText( smtp->getSignature() ); |
149 | #endif | ||
127 | } | 150 | } |
@@ -165,10 +188,10 @@ void ComposeMail::accept() | |||
165 | 188 | ||
166 | 189 | #if 0 | |
167 | qDebug( "Sending Mail with " + | 190 | qDebug( "Sending Mail with " + |
168 | smtpAccounts.at( fromBox->currentItem() )->getAccountName() ); | 191 | smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); |
192 | #endif | ||
169 | Mail *mail = new Mail(); | 193 | Mail *mail = new Mail(); |
170 | SMTPaccount *smtp = smtpAccounts.at( fromBox->currentItem() ); | ||
171 | 194 | ||
172 | mail->setMail( smtp->getMail() ); | 195 | SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); |
173 | mail->setName( smtp->getName() ); | 196 | mail->setMail(fromBox->currentText()); |
174 | 197 | ||
@@ -180,3 +203,3 @@ void ComposeMail::accept() | |||
180 | } | 203 | } |
181 | 204 | mail->setName(senderNameEdit->text()); | |
182 | mail->setCC( ccLine->text() ); | 205 | mail->setCC( ccLine->text() ); |
@@ -190,2 +213,3 @@ void ComposeMail::accept() | |||
190 | } | 213 | } |
214 | qDebug(txt); | ||
191 | mail->setMessage( txt ); | 215 | mail->setMessage( txt ); |
@@ -198,3 +222,3 @@ void ComposeMail::accept() | |||
198 | SMTPwrapper wrapper( settings ); | 222 | SMTPwrapper wrapper( settings ); |
199 | wrapper.sendMail( *mail,checkBoxLater->isChecked() ); | 223 | wrapper.sendMail( *mail,smtp,checkBoxLater->isChecked() ); |
200 | 224 | ||