summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp28
-rw-r--r--noncore/net/mail/composemail.h4
-rw-r--r--noncore/net/mail/opie-mail.control2
-rw-r--r--noncore/net/mail/viewmail.cpp80
4 files changed, 68 insertions, 46 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index 96787e4..cfccdbb 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -46,16 +46,44 @@ void ComposeMail::pickAddress( QLineEdit *line )
46 if ( line->text().isEmpty() ) { 46 if ( line->text().isEmpty() ) {
47 line->setText( names ); 47 line->setText( names );
48 } else if ( !names.isEmpty() ) { 48 } else if ( !names.isEmpty() ) {
49 line->setText( line->text() + ", " + names ); 49 line->setText( line->text() + ", " + names );
50 } 50 }
51} 51}
52 52
53 53
54void ComposeMail::setTo( const QString & to )
55{
56/* QString toline;
57 QStringList toEntry = to;
58 for ( QStringList::Iterator it = toEntry.begin(); it != toEntry.end(); ++it ) {
59 toline += (*it);
60 }
61 toLine->setText( toline );
62*/
63toLine->setText( to );
64}
65
66void ComposeMail::setSubject( const QString & subject )
67{
68 subjectLine->setText( subject );
69}
70
71void ComposeMail::setInReplyTo( const QString & messageId )
72{
73
74}
75
76void ComposeMail::setMessage( const QString & text )
77{
78 message->setText( text );
79}
80
81
54void ComposeMail::pickAddressTo() 82void ComposeMail::pickAddressTo()
55{ 83{
56 pickAddress( toLine ); 84 pickAddress( toLine );
57} 85}
58 86
59void ComposeMail::pickAddressCC() 87void ComposeMail::pickAddressCC()
60{ 88{
61 pickAddress( ccLine ); 89 pickAddress( ccLine );
diff --git a/noncore/net/mail/composemail.h b/noncore/net/mail/composemail.h
index 196a471..230e397 100644
--- a/noncore/net/mail/composemail.h
+++ b/noncore/net/mail/composemail.h
@@ -30,16 +30,20 @@ class ComposeMail : public ComposeMailUI
30 Q_OBJECT 30 Q_OBJECT
31 31
32public: 32public:
33 ComposeMail( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 ); 33 ComposeMail( Settings *s, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags flags = 0 );
34 34
35public slots: 35public slots:
36 void slotAdjustColumns(); 36 void slotAdjustColumns();
37 37
38 void setTo( const QString & to );
39 void setSubject( const QString & subject );
40 void setInReplyTo( const QString & messageId );
41 void setMessage( const QString & text );
38 42
39protected slots: 43protected slots:
40 void accept(); 44 void accept();
41 45
42private slots: 46private slots:
43 void fillValues( int current ); 47 void fillValues( int current );
44 void pickAddress( QLineEdit *line ); 48 void pickAddress( QLineEdit *line );
45 void pickAddressTo(); 49 void pickAddressTo();
diff --git a/noncore/net/mail/opie-mail.control b/noncore/net/mail/opie-mail.control
index afe0947..9dfe425 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: bin/opiemail apps/1Pim/opiemail.desktop pics/mail/*.png 2Files: bin/opiemail apps/1Pim/mail.desktop pics/opiemail/*.png
3Priority: optional 3Priority: optional
4Section: opie/applications 4Section: opie/applications
5Maintainer: Juergen Graf <jgf@handhelds.org> 5Maintainer: Juergen Graf <jgf@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 0.0.1-$SUB_VERSION 7Version: 0.0.1-$SUB_VERSION
8Depends: task-opie-minimal, libopie1 8Depends: task-opie-minimal, libopie1
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/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index ed3ece9..8f9ea07 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -68,28 +68,26 @@ void ViewMail::setText()
68 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) { 68 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) {
69 bccString += (*it); 69 bccString += (*it);
70 } 70 }
71 71
72 setCaption( caption().arg( m_mail[0] ) ); 72 setCaption( caption().arg( m_mail[0] ) );
73 73
74 _mailHtml = tr( 74 _mailHtml = tr(
75 "<html><body>" 75 "<html><body>"
76 "<div align=center><b><font color=#FF2222>%1</b></font></div>" 76 "<div align=center><b><font color=#0000FF>%1</b></font></div>"
77 "<b>From:</b> %2<br>" 77 "<b>From:</b><font color=#6C86C0> %2</font><br>"
78 "<b>To:</b> %3<br>" 78 "<b>To:</b><font color=#6C86C0> %3</font><br>"
79 "%4" 79 "%4"
80 "%5" 80 "<b>Date:</b> %5<hr>"
81 "<b>Date:</b> %6<hr>"
82 "<font face=fixed>") 81 "<font face=fixed>")
83 .arg( deHtml( m_mail[1] ) ) 82 .arg( deHtml( m_mail[1] ) )
84 .arg( deHtml( m_mail[0] ) ) 83 .arg( deHtml( m_mail[0] ) )
85 .arg( deHtml( toString ) ) 84 .arg( deHtml( toString ) )
86 .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( ccString ) ) ) 85 .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( ccString ) ) )
87 .arg( tr("<b>Bcc:</b> %1<br>").arg( deHtml( bccString ) ) )
88 .arg( m_mail[3] ); 86 .arg( m_mail[3] );
89 browser->setText( QString(_mailHtml) + deHtml( m_mail[2] ) + "</font>" ); 87 browser->setText( QString(_mailHtml) + deHtml( m_mail[2] ) + "</font>" );
90 // remove later in favor of a real handling 88 // remove later in favor of a real handling
91 _gotBody = true; 89 _gotBody = true;
92} 90}
93 91
94 92
95 93
@@ -147,75 +145,67 @@ void ViewMail::slotReply()
147 rtext += "> " + *it + "\n"; 145 rtext += "> " + *it + "\n";
148 } 146 }
149 rtext += "\n"; 147 rtext += "\n";
150 148
151 QString prefix; 149 QString prefix;
152 if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = ""; 150 if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = "";
153 else prefix = "Re: "; // no i18n on purpose 151 else prefix = "Re: "; // no i18n on purpose
154 152
155 //SendMail sendMail; 153 Settings *settings = new Settings();
156 //sendMail.setTo(_mail.envelope().from()[0].toString()); 154 ComposeMail composer( settings ,this, 0, true);
157 //sendMail.setSubject(prefix + _mail.envelope().subject()); 155 composer.setTo( m_mail[0] );
158 //sendMail.setInReplyTo(_mail.envelope().messageId()); 156 composer.setSubject( "Re: " + m_mail[1] );
159 //sendMail.setMessage(rtext); 157 composer.setMessage( rtext );
160
161
162/* ComposeMail composer(this, 0, true);
163 composer.setMessage( );
164 composer.showMaximized(); 158 composer.showMaximized();
165 composer.exec(); 159 composer.exec();
166*/ 160
167 qDebug ( rtext ); 161 qDebug ( rtext );
168} 162}
169 163
170void ViewMail::slotForward() 164void ViewMail::slotForward()
171{ 165{
172 if (!_gotBody) { 166 if (!_gotBody) {
173 QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); 167 QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok"));
174 return; 168 return;
175 } 169 }
176 170
177 QString ftext; 171 QString ftext;
178 /*ftext += QString("\n----- Forwarded message from %1 -----\n\n") 172 ftext += QString("\n----- Forwarded message from %1 -----\n\n")
179 .arg(_mail.envelope().from()[0].toString()); 173 .arg( m_mail[0] );
180 if (!_mail.envelope().mailDate().isNull()) 174 if (!m_mail[3].isNull())
181 ftext += QString("Date: %1\n") 175 ftext += QString("Date: %1\n")
182 .arg(_mail.envelope().mailDate()); 176 .arg( m_mail[3] );
183 if (!_mail.envelope().from()[0].toString().isNull()) 177 if (!m_mail[0].isNull())
184 ftext += QString("From: %1\n") 178 ftext += QString("From: %1\n")
185 .arg(_mail.envelope().from()[0].toString()); 179 .arg( m_mail[0] );
186 if (!_mail.envelope().to().toString().isNull()) 180 //if (!_mail.envelope().to().toString().isNull())
187 ftext += QString("To: %1\n") 181 //ftext += QString("To: %1\n")
188 .arg(_mail.envelope().to().toString()); 182 // .arg(_mail.envelope().to().toString());
189 if (!_mail.envelope().cc().toString().isNull()) 183 //if (!_mail.envelope().cc().toString().isNull())
190 ftext += QString("Cc: %1\n") 184 //ftext += QString("Cc: %1\n")
191 .arg(_mail.envelope().cc().toString()); 185 // .arg(_mail.envelope().cc().toString());
192 if (!_mail.envelope().bcc().toString().isNull()) 186 if (!m_mail[1].isNull())
193 ftext += QString("Bcc: %1\n") 187 ftext += QString("Subject: %1\n")
194 .arg(_mail.envelope().bcc().toString()); 188 .arg( m_mail[1] );
195 if (!_mail.envelope().subject().isNull())
196 ftext += QString("Subject: %1\n")
197 .arg(_mail.envelope().subject());
198 189
199 ftext += QString("\n%1\n") 190 ftext += QString("\n%1\n")
200 .arg(_mail.bodyPart(1).data()); 191 .arg( m_mail[2]);
201 192
202 ftext += QString("----- End forwarded message -----\n"); 193 ftext += QString("----- End forwarded message -----\n");
203*/
204/*
205 SendMail sendMail;
206 sendMail.setSubject("Fwd: " + _mail.envelope().subject());
207 sendMail.setMessage(ftext);
208 194
209 Composer composer(this, 0, true); 195 qDebug( ftext );
210 composer.setSendMail(sendMail); 196
197
198 Settings *settings = new Settings();
199 ComposeMail composer( settings ,this, 0, true);
200 composer.setSubject( "Fwd: " + m_mail[1] );
201 composer.setMessage( ftext );
211 composer.showMaximized(); 202 composer.showMaximized();
212 composer.exec(); 203 composer.exec();
213*/
214} 204}
215 205
216/* 206/*
217void ViewMail::slotIMAPUid(IMAPResponse &response) 207void ViewMail::slotIMAPUid(IMAPResponse &response)
218{ 208{
219 disconnect(_handler, SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPUid(IMAPResponse &))); 209 disconnect(_handler, SIGNAL(gotResponse(IMAPResponse &)), this, SLOT(slotIMAPUid(IMAPResponse &)));
220 210
221 if (response.statusResponse().status() == IMAPResponseEnums::OK) { 211 if (response.statusResponse().status() == IMAPResponseEnums::OK) {