summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp4
-rw-r--r--noncore/net/mail/libmailwrapper/libmailwrapper.control4
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp2
-rw-r--r--noncore/net/mail/mail.pro4
-rw-r--r--noncore/net/mail/main.cpp2
-rw-r--r--noncore/net/mail/opie-mail.control4
-rw-r--r--noncore/net/mail/taskbarapplet/mailapplet.cpp4
-rw-r--r--noncore/net/mail/taskbarapplet/opie-mailapplet.control4
-rw-r--r--noncore/net/mail/taskbarapplet/taskbarapplet.pro2
-rw-r--r--noncore/net/mail/viewmail.cpp4
10 files changed, 17 insertions, 17 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index abcc3f6..6708779 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -1,51 +1,51 @@
1#include <qt.h> 1#include <qt.h>
2 2
3#include <opie/ofiledialog.h> 3#include <opie2/ofiledialog.h>
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 12
13ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 13ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
14 : ComposeMailUI( parent, name, modal, flags ) 14 : ComposeMailUI( parent, name, modal, flags )
15{ 15{
16 settings = s; 16 settings = s;
17 17
18 QString vfilename = Global::applicationFileName("addressbook", 18 QString vfilename = Global::applicationFileName("addressbook",
19 "businesscard.vcf"); 19 "businesscard.vcf");
20 Contact c; 20 Contact c;
21 if (QFile::exists(vfilename)) { 21 if (QFile::exists(vfilename)) {
22 c = Contact::readVCard( vfilename )[0]; 22 c = Contact::readVCard( vfilename )[0];
23 } 23 }
24 24
25 QStringList mails = c.emailList(); 25 QStringList mails = c.emailList();
26 QString defmail = c.defaultEmail(); 26 QString defmail = c.defaultEmail();
27 27
28 if (defmail.length()!=0) { 28 if (defmail.length()!=0) {
29 fromBox->insertItem(defmail); 29 fromBox->insertItem(defmail);
30 } 30 }
31 QStringList::ConstIterator sit = mails.begin(); 31 QStringList::ConstIterator sit = mails.begin();
32 for (;sit!=mails.end();++sit) { 32 for (;sit!=mails.end();++sit) {
33 if ( (*sit)==defmail) 33 if ( (*sit)==defmail)
34 continue; 34 continue;
35 fromBox->insertItem((*sit)); 35 fromBox->insertItem((*sit));
36 } 36 }
37 senderNameEdit->setText(c.firstName()+" "+c.lastName()); 37 senderNameEdit->setText(c.firstName()+" "+c.lastName());
38 Config cfg( "mail" ); 38 Config cfg( "mail" );
39 cfg.setGroup( "Compose" ); 39 cfg.setGroup( "Compose" );
40 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); 40 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
41 41
42 attList->addColumn( tr( "Name" ) ); 42 attList->addColumn( tr( "Name" ) );
43 attList->addColumn( tr( "Size" ) ); 43 attList->addColumn( tr( "Size" ) );
44 44
45 QList<Account> accounts = settings->getAccounts(); 45 QList<Account> accounts = settings->getAccounts();
46 46
47 Account *it; 47 Account *it;
48 for ( it = accounts.first(); it; it = accounts.next() ) { 48 for ( it = accounts.first(); it; it = accounts.next() ) {
49 if ( it->getType().compare( "SMTP" ) == 0 ) { 49 if ( it->getType().compare( "SMTP" ) == 0 ) {
50 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 50 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
51 smtpAccountBox->insertItem( smtp->getAccountName() ); 51 smtpAccountBox->insertItem( smtp->getAccountName() );
@@ -118,97 +118,97 @@ void ComposeMail::pickAddressTo()
118void ComposeMail::pickAddressCC() 118void ComposeMail::pickAddressCC()
119{ 119{
120 pickAddress( ccLine ); 120 pickAddress( ccLine );
121} 121}
122 122
123void ComposeMail::pickAddressBCC() 123void ComposeMail::pickAddressBCC()
124{ 124{
125 pickAddress( bccLine ); 125 pickAddress( bccLine );
126} 126}
127 127
128void ComposeMail::pickAddressReply() 128void ComposeMail::pickAddressReply()
129{ 129{
130 pickAddress( replyLine ); 130 pickAddress( replyLine );
131} 131}
132 132
133void ComposeMail::fillValues( int current ) 133void ComposeMail::fillValues( int current )
134{ 134{
135#if 0 135#if 0
136 SMTPaccount *smtp = smtpAccounts.at( current ); 136 SMTPaccount *smtp = smtpAccounts.at( current );
137 ccLine->clear(); 137 ccLine->clear();
138 if ( smtp->getUseCC() ) { 138 if ( smtp->getUseCC() ) {
139 ccLine->setText( smtp->getCC() ); 139 ccLine->setText( smtp->getCC() );
140 } 140 }
141 bccLine->clear(); 141 bccLine->clear();
142 if ( smtp->getUseBCC() ) { 142 if ( smtp->getUseBCC() ) {
143 bccLine->setText( smtp->getBCC() ); 143 bccLine->setText( smtp->getBCC() );
144 } 144 }
145 replyLine->clear(); 145 replyLine->clear();
146 if ( smtp->getUseReply() ) { 146 if ( smtp->getUseReply() ) {
147 replyLine->setText( smtp->getReply() ); 147 replyLine->setText( smtp->getReply() );
148 } 148 }
149 sigMultiLine->setText( smtp->getSignature() ); 149 sigMultiLine->setText( smtp->getSignature() );
150#endif 150#endif
151} 151}
152 152
153void ComposeMail::slotAdjustColumns() 153void ComposeMail::slotAdjustColumns()
154{ 154{
155 int currPage = tabWidget->currentPageIndex(); 155 int currPage = tabWidget->currentPageIndex();
156 156
157 tabWidget->showPage( attachTab ); 157 tabWidget->showPage( attachTab );
158 attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); 158 attList->setColumnWidth( 0, attList->visibleWidth() - 80 );
159 attList->setColumnWidth( 1, 80 ); 159 attList->setColumnWidth( 1, 80 );
160 160
161 tabWidget->setCurrentPage( currPage ); 161 tabWidget->setCurrentPage( currPage );
162} 162}
163 163
164void ComposeMail::addAttachment() 164void ComposeMail::addAttachment()
165{ 165{
166 DocLnk lnk = OFileDialog::getOpenFileName( 1, "/" ); 166 DocLnk lnk = Opie::OFileDialog::getOpenFileName( 1, "/" );
167 if ( !lnk.name().isEmpty() ) { 167 if ( !lnk.name().isEmpty() ) {
168 Attachment *att = new Attachment( lnk ); 168 Attachment *att = new Attachment( lnk );
169 (void) new AttachViewItem( attList, att ); 169 (void) new AttachViewItem( attList, att );
170 } 170 }
171} 171}
172 172
173void ComposeMail::removeAttachment() 173void ComposeMail::removeAttachment()
174{ 174{
175 if ( !attList->currentItem() ) { 175 if ( !attList->currentItem() ) {
176 QMessageBox::information( this, tr( "Error" ), 176 QMessageBox::information( this, tr( "Error" ),
177 tr( "<p>Please select a File.</p>" ), 177 tr( "<p>Please select a File.</p>" ),
178 tr( "Ok" ) ); 178 tr( "Ok" ) );
179 } else { 179 } else {
180 attList->takeItem( attList->currentItem() ); 180 attList->takeItem( attList->currentItem() );
181 } 181 }
182} 182}
183 183
184void ComposeMail::accept() 184void ComposeMail::accept()
185{ 185{
186 if ( checkBoxLater->isChecked() ) { 186 if ( checkBoxLater->isChecked() ) {
187 qDebug( "Send later" ); 187 qDebug( "Send later" );
188 } 188 }
189 189
190#if 0 190#if 0
191 qDebug( "Sending Mail with " + 191 qDebug( "Sending Mail with " +
192 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); 192 smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() );
193#endif 193#endif
194 Mail *mail = new Mail(); 194 Mail *mail = new Mail();
195 195
196 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); 196 SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() );
197 mail->setMail(fromBox->currentText()); 197 mail->setMail(fromBox->currentText());
198 198
199 if ( !toLine->text().isEmpty() ) { 199 if ( !toLine->text().isEmpty() ) {
200 mail->setTo( toLine->text() ); 200 mail->setTo( toLine->text() );
201 } else { 201 } else {
202 qDebug( "No Reciever spezified -> returning" ); 202 qDebug( "No Reciever spezified -> returning" );
203 return; 203 return;
204 } 204 }
205 mail->setName(senderNameEdit->text()); 205 mail->setName(senderNameEdit->text());
206 mail->setCC( ccLine->text() ); 206 mail->setCC( ccLine->text() );
207 mail->setBCC( bccLine->text() ); 207 mail->setBCC( bccLine->text() );
208 mail->setReply( replyLine->text() ); 208 mail->setReply( replyLine->text() );
209 mail->setSubject( subjectLine->text() ); 209 mail->setSubject( subjectLine->text() );
210 QString txt = message->text(); 210 QString txt = message->text();
211 if ( !sigMultiLine->text().isEmpty() ) { 211 if ( !sigMultiLine->text().isEmpty() ) {
212 txt.append( "\n--\n" ); 212 txt.append( "\n--\n" );
213 txt.append( sigMultiLine->text() ); 213 txt.append( sigMultiLine->text() );
214 } 214 }
diff --git a/noncore/net/mail/libmailwrapper/libmailwrapper.control b/noncore/net/mail/libmailwrapper/libmailwrapper.control
index 0e9e3ed..8b319c8 100644
--- a/noncore/net/mail/libmailwrapper/libmailwrapper.control
+++ b/noncore/net/mail/libmailwrapper/libmailwrapper.control
@@ -1,10 +1,10 @@
1Package: libmailwrapper 1Package: libmailwrapper
2Files: lib/libmailwrapper.so* 2Files: lib/libmailwrapper.so*
3Priority: optional 3Priority: optional
4Section: libs 4Section: libs
5Maintainer: Rajko Albrecht <alwin@handhelds.org>, Juergen Graf <jgf@handhelds.org>, Maximilian Reiß <harlekin@handhelds.org> 5Maintainer: Rajko Albrecht <alwin@handhelds.org>, Juergen Graf <jgf@handhelds.org>, Maximilian Reiß <harlekin@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 0.4-$SUB_VERSION 7Version: 0.5-$SUB_VERSION
8Depends: task-opie-minimal, libopie1, libetpan 8Depends: task-opie-minimal, libopiecore2, libopieui2, libetpan (>= 0.33pre)
9Description: wrapper lib needed by Opie's mailer 9Description: wrapper lib needed by Opie's mailer
10License: LGPL 10License: LGPL
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 5090f4a..dfc00d8 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -1,57 +1,57 @@
1#include "mhwrapper.h" 1#include "mhwrapper.h"
2#include "mailtypes.h" 2#include "mailtypes.h"
3#include "mailwrapper.h" 3#include "mailwrapper.h"
4#include <libetpan/libetpan.h> 4#include <libetpan/libetpan.h>
5#include <qdir.h> 5#include <qdir.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#include <qpe/global.h> 8#include <qpe/global.h>
9#include <opie/oprocess.h> 9#include <opie2/oprocess.h>
10 10
11const QString MHwrapper::wrapperType="MH"; 11const QString MHwrapper::wrapperType="MH";
12 12
13MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) 13MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
14 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) 14 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name)
15{ 15{
16 if (MHPath.length()>0) { 16 if (MHPath.length()>0) {
17 if (MHPath[MHPath.length()-1]=='/') { 17 if (MHPath[MHPath.length()-1]=='/') {
18 MHPath=MHPath.left(MHPath.length()-1); 18 MHPath=MHPath.left(MHPath.length()-1);
19 } 19 }
20 qDebug(MHPath); 20 qDebug(MHPath);
21 QDir dir(MHPath); 21 QDir dir(MHPath);
22 if (!dir.exists()) { 22 if (!dir.exists()) {
23 dir.mkdir(MHPath); 23 dir.mkdir(MHPath);
24 } 24 }
25 init_storage(); 25 init_storage();
26 } 26 }
27} 27}
28 28
29void MHwrapper::init_storage() 29void MHwrapper::init_storage()
30{ 30{
31 int r; 31 int r;
32 QString pre = MHPath; 32 QString pre = MHPath;
33 if (!m_storage) { 33 if (!m_storage) {
34 m_storage = mailstorage_new(NULL); 34 m_storage = mailstorage_new(NULL);
35 r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0); 35 r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0);
36 if (r != MAIL_NO_ERROR) { 36 if (r != MAIL_NO_ERROR) {
37 qDebug("error initializing storage"); 37 qDebug("error initializing storage");
38 mailstorage_free(m_storage); 38 mailstorage_free(m_storage);
39 m_storage = 0; 39 m_storage = 0;
40 return; 40 return;
41 } 41 }
42 } 42 }
43 r = mailstorage_connect(m_storage); 43 r = mailstorage_connect(m_storage);
44 if (r!=MAIL_NO_ERROR) { 44 if (r!=MAIL_NO_ERROR) {
45 qDebug("error connecting storage"); 45 qDebug("error connecting storage");
46 mailstorage_free(m_storage); 46 mailstorage_free(m_storage);
47 m_storage = 0; 47 m_storage = 0;
48 } 48 }
49} 49}
50 50
51void MHwrapper::clean_storage() 51void MHwrapper::clean_storage()
52{ 52{
53 if (m_storage) { 53 if (m_storage) {
54 mailstorage_disconnect(m_storage); 54 mailstorage_disconnect(m_storage);
55 mailstorage_free(m_storage); 55 mailstorage_free(m_storage);
56 m_storage = 0; 56 m_storage = 0;
57 } 57 }
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index 184b5b3..d3d2ab1 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -6,56 +6,56 @@ HEADERS = defines.h \
6 accountview.h \ 6 accountview.h \
7 accountitem.h \ 7 accountitem.h \
8 mainwindow.h \ 8 mainwindow.h \
9 viewmail.h \ 9 viewmail.h \
10 viewmailbase.h \ 10 viewmailbase.h \
11 opiemail.h \ 11 opiemail.h \
12 mailistviewitem.h \ 12 mailistviewitem.h \
13 settingsdialog.h \ 13 settingsdialog.h \
14 statuswidget.h \ 14 statuswidget.h \
15 newmaildir.h \ 15 newmaildir.h \
16 selectstore.h \ 16 selectstore.h \
17 selectsmtp.h 17 selectsmtp.h
18 18
19SOURCES = main.cpp \ 19SOURCES = main.cpp \
20 opiemail.cpp \ 20 opiemail.cpp \
21 mainwindow.cpp \ 21 mainwindow.cpp \
22 accountview.cpp \ 22 accountview.cpp \
23 accountitem.cpp \ 23 accountitem.cpp \
24 composemail.cpp \ 24 composemail.cpp \
25 addresspicker.cpp \ 25 addresspicker.cpp \
26 editaccounts.cpp \ 26 editaccounts.cpp \
27 viewmail.cpp \ 27 viewmail.cpp \
28 viewmailbase.cpp \ 28 viewmailbase.cpp \
29 mailistviewitem.cpp \ 29 mailistviewitem.cpp \
30 settingsdialog.cpp \ 30 settingsdialog.cpp \
31 statuswidget.cpp \ 31 statuswidget.cpp \
32 newmaildir.cpp \ 32 newmaildir.cpp \
33 selectstore.cpp \ 33 selectstore.cpp \
34 selectsmtp.cpp 34 selectsmtp.cpp
35 35
36INTERFACES = editaccountsui.ui \ 36INTERFACES = editaccountsui.ui \
37 selectmailtypeui.ui \ 37 selectmailtypeui.ui \
38 imapconfigui.ui \ 38 imapconfigui.ui \
39 pop3configui.ui \ 39 pop3configui.ui \
40 nntpconfigui.ui \ 40 nntpconfigui.ui \
41 smtpconfigui.ui \ 41 smtpconfigui.ui \
42 addresspickerui.ui \ 42 addresspickerui.ui \
43 composemailui.ui \ 43 composemailui.ui \
44 settingsdialogui.ui \ 44 settingsdialogui.ui \
45 statuswidgetui.ui \ 45 statuswidgetui.ui \
46 newmaildirui.ui \ 46 newmaildirui.ui \
47 selectstoreui.ui 47 selectstoreui.ui
48 48
49 49
50INCLUDEPATH += $(OPIEDIR)/include 50INCLUDEPATH += $(OPIEDIR)/include
51 51
52CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) 52CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
53contains( CONFTEST, y ){ 53contains( CONFTEST, y ){
54 LIBS += -lqpe -lopie -lmailwrapper -liconv 54 LIBS += -lqpe -lopieui2 -lopiecore2 -lopie -lmailwrapper -liconv
55}else{ 55}else{
56 LIBS += -lqpe -lopie -lmailwrapper 56 LIBS += -lqpe -lopieui2 -lopiecore2 -lopie -lmailwrapper
57} 57}
58 58
59TARGET = opiemail 59TARGET = opiemail
60 60
61include ( $(OPIEDIR)/include.pro ) 61include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/mail/main.cpp b/noncore/net/mail/main.cpp
index 3bfcb4a..54ac7fb 100644
--- a/noncore/net/mail/main.cpp
+++ b/noncore/net/mail/main.cpp
@@ -1,5 +1,5 @@
1#include <opie/oapplicationfactory.h> 1#include <opie2/oapplicationfactory.h>
2 2
3#include "opiemail.h" 3#include "opiemail.h"
4 4
5OPIE_EXPORT_APP( OApplicationFactory<OpieMail> ) 5OPIE_EXPORT_APP( OApplicationFactory<OpieMail> )
diff --git a/noncore/net/mail/opie-mail.control b/noncore/net/mail/opie-mail.control
index 0e11c4a..5f25414 100644
--- a/noncore/net/mail/opie-mail.control
+++ b/noncore/net/mail/opie-mail.control
@@ -1,10 +1,10 @@
1Package: opie-mail 1Package: opie-mail
2Files: plugins/application/libopiemail.so* bin/opiemail apps/1Pim/mail.desktop pics/mail/*.png 2Files: plugins/application/libopiemail.so* bin/opiemail apps/1Pim/mail.desktop pics/mail/*.png
3Priority: optional 3Priority: optional
4Section: opie/pim 4Section: opie/pim
5Maintainer: Rajko Albrecht <alwin@handhelds.org>, Juergen Graf <jgf@handhelds.org>, Maximilian Reiß <harlekin@handhelds.org> 5Maintainer: Rajko Albrecht <alwin@handhelds.org>, Juergen Graf <jgf@handhelds.org>, Maximilian Reiß <harlekin@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 0.4-$SUB_VERSION 7Version: 0.5-$SUB_VERSION
8Depends: task-opie-minimal, libopie1, libmailwrapper 8Depends: task-opie-minimal, libopie1, libopiecore2, libopieui2, libmailwrapper (>= 0.4)
9Description: Opie's mail and news client (POP3, IMAP and NNTP) 9Description: Opie's mail and news client (POP3, IMAP and NNTP)
10License: LGPL 10License: LGPL
diff --git a/noncore/net/mail/taskbarapplet/mailapplet.cpp b/noncore/net/mail/taskbarapplet/mailapplet.cpp
index a0805ba..de32007 100644
--- a/noncore/net/mail/taskbarapplet/mailapplet.cpp
+++ b/noncore/net/mail/taskbarapplet/mailapplet.cpp
@@ -1,57 +1,57 @@
1#include <qpainter.h> 1#include <qpainter.h>
2#include <qtimer.h> 2#include <qtimer.h>
3 3
4#include <qpe/qcopenvelope_qws.h> 4#include <qpe/qcopenvelope_qws.h>
5#include <qpe/resource.h> 5#include <qpe/resource.h>
6#include <qpe/config.h> 6#include <qpe/config.h>
7#include <qpe/applnk.h> 7#include <qpe/applnk.h>
8 8
9#include <opie/odevice.h> 9#include <opie2/odevice.h>
10 10
11#include <libmailwrapper/settings.h> 11#include <libmailwrapper/settings.h>
12 12
13#include "mailapplet.h" 13#include "mailapplet.h"
14 14
15using namespace Opie; 15using namespace Opie;
16 16
17MailApplet::MailApplet( QWidget *parent ) 17MailApplet::MailApplet( QWidget *parent )
18: QWidget( parent ) { 18: QWidget( parent ) {
19 19
20 m_config = new Config( "mail" ); 20 m_config = new Config( "mail" );
21 m_config->setGroup( "Applet" ); 21 m_config->setGroup( "Applet" );
22 22
23 setFixedWidth( AppLnk::smallIconSize() ); 23 setFixedWidth( AppLnk::smallIconSize() );
24 setFixedHeight( AppLnk::smallIconSize() ); 24 setFixedHeight( AppLnk::smallIconSize() );
25 25
26 hide(); 26 hide();
27 27
28 m_newMails = 0; 28 m_newMails = 0;
29 m_statusMail = 0l; 29 m_statusMail = 0l;
30 30
31 if ( !m_config->readBoolEntry( "Disabled", false ) ) { 31 if ( !m_config->readBoolEntry( "Disabled", false ) ) {
32 // delay 5 sec until the whole mail backend gets started .-) 32 // delay 5 sec until the whole mail backend gets started .-)
33 QTimer::singleShot( 5000, this, SLOT( startup() ) ); 33 QTimer::singleShot( 5000, this, SLOT( startup() ) );
34 } 34 }
35 repaint( true ); 35 repaint( true );
36} 36}
37 37
38 38
39MailApplet::~MailApplet() { 39MailApplet::~MailApplet() {
40 if ( m_statusMail ) 40 if ( m_statusMail )
41 delete m_statusMail; 41 delete m_statusMail;
42 if ( m_config ) 42 if ( m_config )
43 delete m_config; 43 delete m_config;
44} 44}
45 45
46void MailApplet::paintEvent( QPaintEvent* ) { 46void MailApplet::paintEvent( QPaintEvent* ) {
47 QPainter p( this ); 47 QPainter p( this );
48 p.drawPixmap( 0, 0, Resource::loadPixmap( "mail/inbox" ) ); 48 p.drawPixmap( 0, 0, Resource::loadPixmap( "mail/inbox" ) );
49 QFont f( "vera", AppLnk::smallIconSize() ); 49 QFont f( "vera", AppLnk::smallIconSize() );
50 QFontMetrics fm( f ); 50 QFontMetrics fm( f );
51 p.setFont( f ); 51 p.setFont( f );
52 p.setPen( Qt::blue ); 52 p.setPen( Qt::blue );
53 p.drawText( AppLnk::smallIconSize()/3, AppLnk::smallIconSize() - 2, QString::number( m_newMails ) ); 53 p.drawText( AppLnk::smallIconSize()/3, AppLnk::smallIconSize() - 2, QString::number( m_newMails ) );
54 return; 54 return;
55 55
56} 56}
57 57
@@ -71,75 +71,75 @@ void MailApplet::slotClicked() {
71 } 71 }
72 72
73 if (m_statusMail) 73 if (m_statusMail)
74 m_statusMail->reset_status(); 74 m_statusMail->reset_status();
75 75
76 hide(); 76 hide();
77} 77}
78 78
79void MailApplet::startup() { 79void MailApplet::startup() {
80 Settings *settings = new Settings(); 80 Settings *settings = new Settings();
81 QList<Account> ma = settings->getAccounts(); 81 QList<Account> ma = settings->getAccounts();
82 m_statusMail = new StatusMail( ma ); 82 m_statusMail = new StatusMail( ma );
83 delete settings; 83 delete settings;
84 84
85 m_intervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; 85 m_intervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000;
86 m_intervalTimer = new QTimer(); 86 m_intervalTimer = new QTimer();
87 m_intervalTimer->start( m_intervalMs ); 87 m_intervalTimer->start( m_intervalMs );
88 connect( m_intervalTimer, SIGNAL( timeout() ), this, SLOT( slotCheck() ) ); 88 connect( m_intervalTimer, SIGNAL( timeout() ), this, SLOT( slotCheck() ) );
89} 89}
90 90
91void MailApplet::slotCheck() { 91void MailApplet::slotCheck() {
92 // Check wether the check interval has been changed. 92 // Check wether the check interval has been changed.
93 int newIntervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000; 93 int newIntervalMs = m_config->readNumEntry( "CheckEvery", 5 ) * 60000;
94 if ( newIntervalMs != m_intervalMs ) { 94 if ( newIntervalMs != m_intervalMs ) {
95 m_intervalTimer->changeInterval( newIntervalMs ); 95 m_intervalTimer->changeInterval( newIntervalMs );
96 m_intervalMs = newIntervalMs; 96 m_intervalMs = newIntervalMs;
97 } 97 }
98 98
99 if (m_statusMail == 0) { 99 if (m_statusMail == 0) {
100 return; 100 return;
101 } 101 }
102 102
103 folderStat stat; 103 folderStat stat;
104 m_statusMail->check_current_stat( stat ); 104 m_statusMail->check_current_stat( stat );
105 int newMailsOld = m_newMails; 105 int newMailsOld = m_newMails;
106 m_newMails = stat.message_unseen; 106 m_newMails = stat.message_unseen;
107 qDebug( QString( "test %1" ).arg( m_newMails ) ); 107 qDebug( QString( "test %1" ).arg( m_newMails ) );
108 if ( m_newMails > 0 && newMailsOld != m_newMails ) { 108 if ( m_newMails > 0 && newMailsOld != m_newMails ) {
109 ODevice *device = ODevice::inst(); 109 ODevice *device = ODevice::inst();
110 if ( isHidden() ) 110 if ( isHidden() )
111 show(); 111 show();
112 if ( m_config->readBoolEntry( "BlinkLed", true ) ) { 112 if ( m_config->readBoolEntry( "BlinkLed", true ) ) {
113 if ( !device->ledList().isEmpty() ) { 113 if ( !device->ledList().isEmpty() ) {
114 OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0]; 114 OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0];
115 device->setLedState( led, device->ledStateList( led ).contains( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On ); 115 device->setLedState( led, device->ledStateList( led ).contains( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On );
116 } 116 }
117 } 117 }
118 if ( m_config->readBoolEntry( "PlaySound", false ) ) 118 if ( m_config->readBoolEntry( "PlaySound", false ) )
119 device->alarmSound(); 119 device->playAlarmSound();
120 120
121 Config cfg( "mail" ); 121 Config cfg( "mail" );
122 cfg.setGroup( "Status" ); 122 cfg.setGroup( "Status" );
123 cfg.writeEntry( "newMails", m_newMails ); 123 cfg.writeEntry( "newMails", m_newMails );
124 QCopEnvelope env( "QPE/Pim", "newMails(int)" ); 124 QCopEnvelope env( "QPE/Pim", "newMails(int)" );
125 env << m_newMails; 125 env << m_newMails;
126 repaint( true ); 126 repaint( true );
127 127
128 } else { 128 } else {
129 ODevice *device = ODevice::inst(); 129 ODevice *device = ODevice::inst();
130 if ( !isHidden() ) 130 if ( !isHidden() )
131 hide(); 131 hide();
132 if ( !device->ledList().isEmpty() ) { 132 if ( !device->ledList().isEmpty() ) {
133 OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0]; 133 OLed led = ( device->ledList().contains( Led_Mail ) ) ? Led_Mail : device->ledList()[0];
134 device->setLedState( led, Led_Off ); 134 device->setLedState( led, Led_Off );
135 } 135 }
136 136
137 if ( newMailsOld != m_newMails ) { 137 if ( newMailsOld != m_newMails ) {
138 Config cfg( "mail" ); 138 Config cfg( "mail" );
139 cfg.setGroup( "Status" ); 139 cfg.setGroup( "Status" );
140 cfg.writeEntry( "newMails", m_newMails ); 140 cfg.writeEntry( "newMails", m_newMails );
141 QCopEnvelope env( "QPE/Pim", "newMails(int)" ); 141 QCopEnvelope env( "QPE/Pim", "newMails(int)" );
142 env << m_newMails; 142 env << m_newMails;
143 } 143 }
144 } 144 }
145} 145}
diff --git a/noncore/net/mail/taskbarapplet/opie-mailapplet.control b/noncore/net/mail/taskbarapplet/opie-mailapplet.control
index 84adc7b..f9822a5 100644
--- a/noncore/net/mail/taskbarapplet/opie-mailapplet.control
+++ b/noncore/net/mail/taskbarapplet/opie-mailapplet.control
@@ -1,10 +1,10 @@
1Package: opie-mailapplet 1Package: opie-mailapplet
2Files: plugins/applets/libmailapplet.so* 2Files: plugins/applets/libmailapplet.so*
3Priority: optional 3Priority: optional
4Section: opie/applets 4Section: opie/applets
5Maintainer: Rajko Albrecht <alwin@handhelds.org>, Juergen Graf <jgf@handhelds.org>, Maximilian Reiß <harlekin@handhelds.org> 5Maintainer: Rajko Albrecht <alwin@handhelds.org>, Juergen Graf <jgf@handhelds.org>, Maximilian Reiß <harlekin@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 0.4-$SUB_VERSION 7Version: 0.5-$SUB_VERSION
8Depends: task-opie-minimal, libopie1, opie-mail 8Depends: task-opie-minimal, libopiecore2, opie-mail
9Description: A Biff-like mailchecker 9Description: A Biff-like mailchecker
10License: LGPL 10License: LGPL
diff --git a/noncore/net/mail/taskbarapplet/taskbarapplet.pro b/noncore/net/mail/taskbarapplet/taskbarapplet.pro
index c54e87f..e4ac6d1 100644
--- a/noncore/net/mail/taskbarapplet/taskbarapplet.pro
+++ b/noncore/net/mail/taskbarapplet/taskbarapplet.pro
@@ -1,12 +1,12 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG +=qt plugin warn_on release 2 CONFIG +=qt plugin warn_on release
3 HEADERS +=mailapplet.h \ 3 HEADERS +=mailapplet.h \
4 mailappletimpl.h 4 mailappletimpl.h
5 SOURCES +=mailapplet.cpp \ 5 SOURCES +=mailapplet.cpp \
6 mailappletimpl.cpp 6 mailappletimpl.cpp
7INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/noncore/net/mail 7INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/noncore/net/mail
8 LIBS +=-lmailwrapper -lqpe -lopie 8 LIBS +=-lmailwrapper -lqpe -lopiecore2
9 TARGET =mailapplet 9 TARGET =mailapplet
10 DESTDIR +=$(OPIEDIR)/plugins/applets/ 10 DESTDIR +=$(OPIEDIR)/plugins/applets/
11 11
12include ( $(OPIEDIR)/include.pro ) 12include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 9ca6383..99965d4 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -1,60 +1,60 @@
1#include <qtextbrowser.h> 1#include <qtextbrowser.h>
2#include <qmessagebox.h> 2#include <qmessagebox.h>
3#include <qtextstream.h> 3#include <qtextstream.h>
4#include <qaction.h> 4#include <qaction.h>
5#include <qpopupmenu.h> 5#include <qpopupmenu.h>
6#include <qfile.h> 6#include <qfile.h>
7#include <qapplication.h> 7#include <qapplication.h>
8#include <qvaluelist.h> 8#include <qvaluelist.h>
9 9
10#include <qpe/config.h> 10#include <qpe/config.h>
11 11
12#include <opie/ofiledialog.h> 12#include <opie2/ofiledialog.h>
13 13
14#include <libmailwrapper/settings.h> 14#include <libmailwrapper/settings.h>
15#include "composemail.h" 15#include "composemail.h"
16#include "viewmail.h" 16#include "viewmail.h"
17#include <libmailwrapper/abstractmail.h> 17#include <libmailwrapper/abstractmail.h>
18#include "accountview.h" 18#include "accountview.h"
19#include <libmailwrapper/mailtypes.h> 19#include <libmailwrapper/mailtypes.h>
20 20
21AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 21AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
22 const QString&fsize,int num,const QValueList<int>&path) 22 const QString&fsize,int num,const QValueList<int>&path)
23 : QListViewItem(parent,after),_partNum(num) 23 : QListViewItem(parent,after),_partNum(num)
24{ 24{
25 _path=path; 25 _path=path;
26 setText(0, mime); 26 setText(0, mime);
27 setText(1, desc); 27 setText(1, desc);
28 setText(2, file); 28 setText(2, file);
29 setText(3, fsize); 29 setText(3, fsize);
30} 30}
31 31
32AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, 32AttachItem::AttachItem(QListViewItem * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file,
33 const QString&fsize,int num,const QValueList<int>&path) 33 const QString&fsize,int num,const QValueList<int>&path)
34 : QListViewItem(parent,after),_partNum(num) 34 : QListViewItem(parent,after),_partNum(num)
35{ 35{
36 _path=path; 36 _path=path;
37 setText(0, mime); 37 setText(0, mime);
38 setText(1, desc); 38 setText(1, desc);
39 setText(2, file); 39 setText(2, file);
40 setText(3, fsize); 40 setText(3, fsize);
41} 41}
42 42
43bool AttachItem::isParentof(const QValueList<int>&path) 43bool AttachItem::isParentof(const QValueList<int>&path)
44{ 44{
45 /* if not set, then no parent */ 45 /* if not set, then no parent */
46 if (path.count()==0||_path.count()==0) return false; 46 if (path.count()==0||_path.count()==0) return false;
47 /* the parent must have one digit less then a child */ 47 /* the parent must have one digit less then a child */
48 if (path.count()!=_path.count()+1) return false; 48 if (path.count()!=_path.count()+1) return false;
49 for (unsigned int i=0; i < _path.count();++i) { 49 for (unsigned int i=0; i < _path.count();++i) {
50 if (_path[i]!=path[i]) return false; 50 if (_path[i]!=path[i]) return false;
51 } 51 }
52 return true; 52 return true;
53} 53}
54 54
55AttachItem* ViewMail::searchParent(const QValueList<int>&path) 55AttachItem* ViewMail::searchParent(const QValueList<int>&path)
56{ 56{
57 QListViewItemIterator it( attachments ); 57 QListViewItemIterator it( attachments );
58 for ( ; it.current(); ++it ) { 58 for ( ; it.current(); ++it ) {
59 AttachItem*ati = (AttachItem*)it.current(); 59 AttachItem*ati = (AttachItem*)it.current();
60 if (ati->isParentof(path)) return ati; 60 if (ati->isParentof(path)) return ati;
@@ -153,97 +153,97 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
153 } 153 }
154 QTextOStream o(&fsize); 154 QTextOStream o(&fsize);
155 if (w>0) o.precision(2); else o.precision(0); 155 if (w>0) o.precision(2); else o.precision(0);
156 o.setf(QTextStream::fixed); 156 o.setf(QTextStream::fixed);
157 o << s << " " << q << "Byte"; 157 o << s << " " << q << "Byte";
158 desc = body.Parts()[i].Description(); 158 desc = body.Parts()[i].Description();
159 parentItem = searchParent(body.Parts()[i].Positionlist()); 159 parentItem = searchParent(body.Parts()[i].Positionlist());
160 if (parentItem) { 160 if (parentItem) {
161 AttachItem*temp = lastChild(parentItem); 161 AttachItem*temp = lastChild(parentItem);
162 if (temp) curItem = temp; 162 if (temp) curItem = temp;
163 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist()); 163 curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
164 attachments->setRootIsDecorated(true); 164 attachments->setRootIsDecorated(true);
165 curItem = parentItem; 165 curItem = parentItem;
166 } else { 166 } else {
167 curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist()); 167 curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
168 } 168 }
169} 169}
170} 170}
171 171
172 172
173void ViewMail::slotShowHtml( bool state ) { 173void ViewMail::slotShowHtml( bool state ) {
174 m_showHtml = state; 174 m_showHtml = state;
175 setText(); 175 setText();
176} 176}
177 177
178void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { 178void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) {
179 if (!item ) 179 if (!item )
180 return; 180 return;
181 181
182 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { 182 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) {
183 setText(); 183 setText();
184 return; 184 return;
185 } 185 }
186 QPopupMenu *menu = new QPopupMenu(); 186 QPopupMenu *menu = new QPopupMenu();
187 int ret=0; 187 int ret=0;
188 188
189 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) { 189 if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) {
190 menu->insertItem( tr( "Show Text" ), 1 ); 190 menu->insertItem( tr( "Show Text" ), 1 );
191 } 191 }
192 menu->insertItem( tr( "Save Attachment" ), 0 ); 192 menu->insertItem( tr( "Save Attachment" ), 0 );
193 menu->insertSeparator(1); 193 menu->insertSeparator(1);
194 194
195 ret = menu->exec( point, 0 ); 195 ret = menu->exec( point, 0 );
196 196
197 switch(ret) { 197 switch(ret) {
198 case 0: 198 case 0:
199 { MimeTypes types; 199 { MimeTypes types;
200 types.insert( "all", "*" ); 200 types.insert( "all", "*" );
201 QString str = OFileDialog::getSaveFileName( 1, 201 QString str = Opie::OFileDialog::getSaveFileName( 1,
202 "/", item->text( 2 ) , types, 0 ); 202 "/", item->text( 2 ) , types, 0 );
203 203
204 if( !str.isEmpty() ) { 204 if( !str.isEmpty() ) {
205 encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); 205 encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
206 if (content) { 206 if (content) {
207 QFile output(str); 207 QFile output(str);
208 output.open(IO_WriteOnly); 208 output.open(IO_WriteOnly);
209 output.writeBlock(content->Content(),content->Length()); 209 output.writeBlock(content->Content(),content->Length());
210 output.close(); 210 output.close();
211 delete content; 211 delete content;
212 } 212 }
213 } 213 }
214 } 214 }
215 break ; 215 break ;
216 216
217 case 1: 217 case 1:
218 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { 218 if ( ( ( AttachItem* )item )->Partnumber() == -1 ) {
219 setText(); 219 setText();
220 } else { 220 } else {
221 if ( m_recMail.Wrapper() != 0l ) { // make sure that there is a wrapper , even after delete or simular actions 221 if ( m_recMail.Wrapper() != 0l ) { // make sure that there is a wrapper , even after delete or simular actions
222 browser->setText( m_recMail.Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); 222 browser->setText( m_recMail.Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) );
223 } 223 }
224 } 224 }
225 break; 225 break;
226 } 226 }
227 delete menu; 227 delete menu;
228} 228}
229 229
230 230
231void ViewMail::setMail( RecMail mail ) { 231void ViewMail::setMail( RecMail mail ) {
232 232
233 m_recMail = mail; 233 m_recMail = mail;
234 234
235 m_mail[0] = mail.getFrom(); 235 m_mail[0] = mail.getFrom();
236 m_mail[1] = mail.getSubject(); 236 m_mail[1] = mail.getSubject();
237 m_mail[3] = mail.getDate(); 237 m_mail[3] = mail.getDate();
238 m_mail[4] = mail.Msgid(); 238 m_mail[4] = mail.Msgid();
239 239
240 m_mail2[0] = mail.To(); 240 m_mail2[0] = mail.To();
241 m_mail2[1] = mail.CC(); 241 m_mail2[1] = mail.CC();
242 m_mail2[2] = mail.Bcc(); 242 m_mail2[2] = mail.Bcc();
243 243
244 setText(); 244 setText();
245} 245}
246 246
247 247
248 248
249ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) 249ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)