summaryrefslogtreecommitdiff
path: root/noncore/net/mail/composemail.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/composemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index 74ccc7b..5bc2883 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -4,24 +4,26 @@
4#include <qpe/resource.h> 4#include <qpe/resource.h>
5#include <qpe/config.h> 5#include <qpe/config.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <qpe/contact.h> 7#include <qpe/contact.h>
8 8
9#include "composemail.h" 9#include "composemail.h"
10 10
11#include <libmailwrapper/smtpwrapper.h> 11#include <libmailwrapper/smtpwrapper.h>
12#include <libmailwrapper/storemail.h> 12#include <libmailwrapper/storemail.h>
13#include <libmailwrapper/abstractmail.h> 13#include <libmailwrapper/abstractmail.h>
14#include <libmailwrapper/mailtypes.h> 14#include <libmailwrapper/mailtypes.h>
15 15
16using namespace Opie::Core;
17using namespace Opie::Ui;
16ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 18ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
17 : ComposeMailUI( parent, name, modal, flags ) 19 : ComposeMailUI( parent, name, modal, flags )
18{ 20{
19 settings = s; 21 settings = s;
20 m_replyid = ""; 22 m_replyid = "";
21 23
22 QString vfilename = Global::applicationFileName("addressbook", 24 QString vfilename = Global::applicationFileName("addressbook",
23 "businesscard.vcf"); 25 "businesscard.vcf");
24 Contact c; 26 Contact c;
25 if (QFile::exists(vfilename)) { 27 if (QFile::exists(vfilename)) {
26 c = Contact::readVCard( vfilename )[0]; 28 c = Contact::readVCard( vfilename )[0];
27 } 29 }
@@ -151,25 +153,25 @@ void ComposeMail::slotAdjustColumns()
151{ 153{
152 int currPage = tabWidget->currentPageIndex(); 154 int currPage = tabWidget->currentPageIndex();
153 155
154 tabWidget->showPage( attachTab ); 156 tabWidget->showPage( attachTab );
155 attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); 157 attList->setColumnWidth( 0, attList->visibleWidth() - 80 );
156 attList->setColumnWidth( 1, 80 ); 158 attList->setColumnWidth( 1, 80 );
157 159
158 tabWidget->setCurrentPage( currPage ); 160 tabWidget->setCurrentPage( currPage );
159} 161}
160 162
161void ComposeMail::addAttachment() 163void ComposeMail::addAttachment()
162{ 164{
163 DocLnk lnk = Opie::OFileDialog::getOpenFileName( 1, "/" ); 165 DocLnk lnk = OFileDialog::getOpenFileName( 1, "/" );
164 if ( !lnk.name().isEmpty() ) { 166 if ( !lnk.name().isEmpty() ) {
165 Attachment *att = new Attachment( lnk ); 167 Attachment *att = new Attachment( lnk );
166 (void) new AttachViewItem( attList, att ); 168 (void) new AttachViewItem( attList, att );
167 } 169 }
168} 170}
169 171
170void ComposeMail::removeAttachment() 172void ComposeMail::removeAttachment()
171{ 173{
172 if ( !attList->currentItem() ) { 174 if ( !attList->currentItem() ) {
173 QMessageBox::information( this, tr( "Error" ), 175 QMessageBox::information( this, tr( "Error" ),
174 tr( "<p>Please select a File.</p>" ), 176 tr( "<p>Please select a File.</p>" ),
175 tr( "Ok" ) ); 177 tr( "Ok" ) );
@@ -179,25 +181,25 @@ void ComposeMail::removeAttachment()
179} 181}
180 182
181void ComposeMail::accept() 183void ComposeMail::accept()
182{ 184{
183 if ( checkBoxLater->isChecked() ) { 185 if ( checkBoxLater->isChecked() ) {
184 qDebug( "Send later" ); 186 qDebug( "Send later" );
185 } 187 }
186 188
187#if 0 189#if 0
188 qDebug( "Sending Mail with " + 190 qDebug( "Sending Mail with " +
189 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); 191 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() );
190#endif 192#endif
191 Opie::OSmartPointer<Mail> mail=new Mail; 193 Opie::Core::OSmartPointer<Mail> mail=new Mail;
192 194
193 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); 195 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
194 mail->setMail(fromBox->currentText()); 196 mail->setMail(fromBox->currentText());
195 197
196 if ( !toLine->text().isEmpty() ) { 198 if ( !toLine->text().isEmpty() ) {
197 mail->setTo( toLine->text() ); 199 mail->setTo( toLine->text() );
198 } else { 200 } else {
199 QMessageBox::warning(0,tr("Sending mail"), 201 QMessageBox::warning(0,tr("Sending mail"),
200 tr("No Receiver spezified" ) ); 202 tr("No Receiver spezified" ) );
201 return; 203 return;
202 } 204 }
203 mail->setName(senderNameEdit->text()); 205 mail->setName(senderNameEdit->text());
@@ -227,25 +229,25 @@ void ComposeMail::accept()
227 229
228 QDialog::accept(); 230 QDialog::accept();
229} 231}
230 232
231void ComposeMail::reject() 233void ComposeMail::reject()
232{ 234{
233 int yesno = QMessageBox::warning(0,tr("Store message"), 235 int yesno = QMessageBox::warning(0,tr("Store message"),
234 tr("Store message into drafts?"), 236 tr("Store message into drafts?"),
235 tr("Yes"), 237 tr("Yes"),
236 tr("No"),QString::null,0,1); 238 tr("No"),QString::null,0,1);
237 239
238 if (yesno == 0) { 240 if (yesno == 0) {
239 Opie::OSmartPointer<Mail> mail=new Mail(); 241 Opie::Core::OSmartPointer<Mail> mail=new Mail();
240 mail->setMail(fromBox->currentText()); 242 mail->setMail(fromBox->currentText());
241 mail->setTo( toLine->text() ); 243 mail->setTo( toLine->text() );
242 mail->setName(senderNameEdit->text()); 244 mail->setName(senderNameEdit->text());
243 mail->setCC( ccLine->text() ); 245 mail->setCC( ccLine->text() );
244 mail->setBCC( bccLine->text() ); 246 mail->setBCC( bccLine->text() );
245 mail->setReply( replyLine->text() ); 247 mail->setReply( replyLine->text() );
246 mail->setSubject( subjectLine->text() ); 248 mail->setSubject( subjectLine->text() );
247 if (!m_replyid.isEmpty()) { 249 if (!m_replyid.isEmpty()) {
248 QStringList ids; 250 QStringList ids;
249 ids.append(m_replyid); 251 ids.append(m_replyid);
250 mail->setInreply(ids); 252 mail->setInreply(ids);
251 } 253 }