-rw-r--r-- | kmicromail/composemail.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 9060364..654cfc0 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp | |||
@@ -1,96 +1,97 @@ | |||
1 | // CHANGED 2004-08-06 Lutz Rogowski | ||
1 | 2 | ||
2 | #include "composemail.h" | 3 | #include "composemail.h" |
3 | 4 | ||
4 | #include <libmailwrapper/smtpwrapper.h> | 5 | #include <libmailwrapper/smtpwrapper.h> |
5 | #include <libmailwrapper/storemail.h> | 6 | #include <libmailwrapper/storemail.h> |
6 | #include <libmailwrapper/abstractmail.h> | 7 | #include <libmailwrapper/abstractmail.h> |
7 | #include <libmailwrapper/mailtypes.h> | 8 | #include <libmailwrapper/mailtypes.h> |
8 | 9 | ||
9 | /* OPIE */ | 10 | /* OPIE */ |
10 | //#include <opie2/ofiledialog.h> | 11 | //#include <opie2/ofiledialog.h> |
11 | //#include <opie2/odebug.h> | 12 | //#include <opie2/odebug.h> |
12 | #include <kfiledialog.h> | 13 | #include <kfiledialog.h> |
13 | //#include <qpe/resource.h> | 14 | //#include <qpe/resource.h> |
14 | #include <qpe/config.h> | 15 | #include <qpe/config.h> |
15 | #include <qpe/global.h> | 16 | #include <qpe/global.h> |
16 | //#include <qpe/contact.h> | 17 | //#include <qpe/contact.h> |
17 | 18 | ||
18 | 19 | ||
19 | #include <qcombobox.h> | 20 | #include <qcombobox.h> |
20 | #include <qcheckbox.h> | 21 | #include <qcheckbox.h> |
21 | #include <qtimer.h> | 22 | #include <qtimer.h> |
22 | #include <qmessagebox.h> | 23 | #include <qmessagebox.h> |
23 | #include <qpushbutton.h> | 24 | #include <qpushbutton.h> |
24 | #include <qmultilineedit.h> | 25 | #include <qmultilineedit.h> |
25 | #include <qlabel.h> | 26 | #include <qlabel.h> |
26 | #include <qtabwidget.h> | 27 | #include <qtabwidget.h> |
27 | #include <qlistview.h> | 28 | #include <qlistview.h> |
28 | #include <kabc/addresseedialog.h> | 29 | #include <kabc/addresseedialog.h> |
29 | #include <kabc/stdaddressbook.h> | 30 | #include <kabc/stdaddressbook.h> |
30 | #include <kabc/addressee.h> | 31 | #include <kabc/addressee.h> |
31 | 32 | ||
32 | 33 | ||
33 | 34 | ||
34 | //using namespace Opie::Core; | 35 | //using namespace Opie::Core; |
35 | //using namespace Opie::Ui; | 36 | //using namespace Opie::Ui; |
36 | ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) | 37 | ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) |
37 | : ComposeMailUI( parent, name, modal, flags ) | 38 | : ComposeMailUI( parent, name, modal, flags ) |
38 | { | 39 | { |
39 | 40 | ||
40 | settings = s; | 41 | settings = s; |
41 | m_replyid = ""; | 42 | m_replyid = ""; |
42 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); | 43 | KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); |
43 | QStringList mails = con.emails(); | 44 | QStringList mails = con.emails(); |
44 | QString defmail = con.preferredEmail(); | 45 | QString defmail = con.preferredEmail(); |
45 | if ( mails.count() == 0) | 46 | if ( mails.count() == 0) |
46 | QMessageBox::information( 0, tr( "Hint" ), | 47 | QMessageBox::information( 0, tr( "Hint" ), |
47 | tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 48 | tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
48 | tr( "Ok" ) ); | 49 | tr( "Ok" ) ); |
49 | if (defmail.length()!=0) { | 50 | if (defmail.length()!=0) { |
50 | fromBox->insertItem(defmail); | 51 | fromBox->insertItem(defmail); |
51 | } | 52 | } |
52 | QStringList::ConstIterator sit = mails.begin(); | 53 | QStringList::ConstIterator sit = mails.begin(); |
53 | for (;sit!=mails.end();++sit) { | 54 | for (;sit!=mails.end();++sit) { |
54 | if ( (*sit)==defmail) | 55 | if ( (*sit)==defmail) |
55 | continue; | 56 | continue; |
56 | fromBox->insertItem((*sit)); | 57 | fromBox->insertItem((*sit)); |
57 | } | 58 | } |
58 | senderNameEdit->setText(con.formattedName()); | 59 | senderNameEdit->setText(con.formattedName()); |
59 | Config cfg( "mail" ); | 60 | Config cfg( "mail" ); |
60 | cfg.setGroup( "Compose" ); | 61 | cfg.setGroup( "Compose" ); |
61 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); | 62 | checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); |
62 | 63 | ||
63 | attList->addColumn( tr( "Name" ) ); | 64 | attList->addColumn( tr( "Name" ) ); |
64 | attList->addColumn( tr( "Size" ) ); | 65 | attList->addColumn( tr( "Size" ) ); |
65 | 66 | ||
66 | QList<Account> accounts = settings->getAccounts(); | 67 | QList<Account> accounts = settings->getAccounts(); |
67 | 68 | ||
68 | Account *it; | 69 | Account *it; |
69 | for ( it = accounts.first(); it; it = accounts.next() ) { | 70 | for ( it = accounts.first(); it; it = accounts.next() ) { |
70 | if ( it->getType()==MAILLIB::A_SMTP ) { | 71 | if ( it->getType()==MAILLIB::A_SMTP ) { |
71 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 72 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
72 | smtpAccountBox->insertItem( smtp->getAccountName() ); | 73 | smtpAccountBox->insertItem( smtp->getAccountName() ); |
73 | smtpAccounts.append( smtp ); | 74 | smtpAccounts.append( smtp ); |
74 | } | 75 | } |
75 | } | 76 | } |
76 | if ( smtpAccounts.count() > 0 ) { | 77 | if ( smtpAccounts.count() > 0 ) { |
77 | fillValues( smtpAccountBox->currentItem() ); | 78 | fillValues( smtpAccountBox->currentItem() ); |
78 | } else { | 79 | } else { |
79 | QMessageBox::information( 0, tr( "Problem" ), | 80 | QMessageBox::information( 0, tr( "Problem" ), |
80 | tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), | 81 | tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ), |
81 | tr( "Ok" ) ); | 82 | tr( "Ok" ) ); |
82 | return; | 83 | return; |
83 | } | 84 | } |
84 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); | 85 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); |
85 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); | 86 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); |
86 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); | 87 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); |
87 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); | 88 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); |
88 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); | 89 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); |
89 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); | 90 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); |
90 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); | 91 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); |
91 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); | 92 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); |
92 | mMail = 0; | 93 | mMail = 0; |
93 | warnAttach = true; | 94 | warnAttach = true; |
94 | 95 | ||
95 | } | 96 | } |
96 | void ComposeMail::saveAsDraft() | 97 | void ComposeMail::saveAsDraft() |