summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp17
-rw-r--r--noncore/net/mail/composemail.h3
-rw-r--r--noncore/net/mail/viewmail.cpp50
3 files changed, 39 insertions, 31 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index 88dd780..96787e4 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -9,10 +9,10 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
9 : ComposeMailUI( parent, name, modal, flags ) 9 : ComposeMailUI( parent, name, modal, flags )
10{ 10{
11 settings = s; 11 settings = s;
12 12
13 attList->addColumn( tr( "Name" ) ); 13 attList->addColumn( tr( "Name" ) );
14 attList->addColumn( tr( "Size" ) ); 14 attList->addColumn( tr( "Size" ) );
15 15
16 QList<Account> accounts = settings->getAccounts(); 16 QList<Account> accounts = settings->getAccounts();
17 Account *it; 17 Account *it;
18 for ( it = accounts.first(); it; it = accounts.next() ) { 18 for ( it = accounts.first(); it; it = accounts.next() ) {
@@ -26,7 +26,7 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
26 if ( smtpAccounts.count() > 0 ) { 26 if ( smtpAccounts.count() > 0 ) {
27 fillValues( fromBox->currentItem() ); 27 fillValues( fromBox->currentItem() );
28 } else { 28 } else {
29 QMessageBox::information( this, tr( "Problem" ), 29 QMessageBox::information( this, tr( "Problem" ),
30 tr( "<p>Please create an SMTP account first.</p>" ), 30 tr( "<p>Please create an SMTP account first.</p>" ),
31 tr( "Ok" ) ); 31 tr( "Ok" ) );
32 } 32 }
@@ -50,6 +50,7 @@ void ComposeMail::pickAddress( QLineEdit *line )
50 } 50 }
51} 51}
52 52
53
53void ComposeMail::pickAddressTo() 54void ComposeMail::pickAddressTo()
54{ 55{
55 pickAddress( toLine ); 56 pickAddress( toLine );
@@ -93,7 +94,7 @@ void ComposeMail::fillValues( int current )
93void ComposeMail::slotAdjustColumns() 94void ComposeMail::slotAdjustColumns()
94{ 95{
95 int currPage = tabWidget->currentPageIndex(); 96 int currPage = tabWidget->currentPageIndex();
96 97
97 tabWidget->showPage( attachTab ); 98 tabWidget->showPage( attachTab );
98 attList->setColumnWidth( 0, attList->visibleWidth() - 80 ); 99 attList->setColumnWidth( 0, attList->visibleWidth() - 80 );
99 attList->setColumnWidth( 1, 80 ); 100 attList->setColumnWidth( 1, 80 );
@@ -113,7 +114,7 @@ void ComposeMail::addAttachment()
113void ComposeMail::removeAttachment() 114void ComposeMail::removeAttachment()
114{ 115{
115 if ( !attList->currentItem() ) { 116 if ( !attList->currentItem() ) {
116 QMessageBox::information( this, tr( "Error" ), 117 QMessageBox::information( this, tr( "Error" ),
117 tr( "<p>Please select a File.</p>" ), 118 tr( "<p>Please select a File.</p>" ),
118 tr( "Ok" ) ); 119 tr( "Ok" ) );
119 } else { 120 } else {
@@ -123,7 +124,7 @@ void ComposeMail::removeAttachment()
123 124
124void ComposeMail::accept() 125void ComposeMail::accept()
125{ 126{
126 qDebug( "Sending Mail with " + 127 qDebug( "Sending Mail with " +
127 smtpAccounts.at( fromBox->currentItem() )->getAccountName() ); 128 smtpAccounts.at( fromBox->currentItem() )->getAccountName() );
128 Mail *mail = new Mail(); 129 Mail *mail = new Mail();
129 SMTPaccount *smtp = smtpAccounts.at( fromBox->currentItem() ); 130 SMTPaccount *smtp = smtpAccounts.at( fromBox->currentItem() );
@@ -164,8 +165,8 @@ AttachViewItem::AttachViewItem( QListView *parent, Attachment *att )
164{ 165{
165 attachment = att; 166 attachment = att;
166 qDebug( att->getMimeType() ); 167 qDebug( att->getMimeType() );
167 setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ? 168 setPixmap( 0, attachment->getDocLnk().pixmap().isNull() ?
168 Resource::loadPixmap( "UnknownDocument-14" ) : 169 Resource::loadPixmap( "UnknownDocument-14" ) :
169 attachment->getDocLnk().pixmap() ); 170 attachment->getDocLnk().pixmap() );
170 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() ); 171 setText( 0, att->getName().isEmpty() ? att->getFileName() : att->getName() );
171 setText( 1, QString::number( att->getSize() ) ); 172 setText( 1, QString::number( att->getSize() ) );
diff --git a/noncore/net/mail/composemail.h b/noncore/net/mail/composemail.h
index c7ae22a..196a471 100644
--- a/noncore/net/mail/composemail.h
+++ b/noncore/net/mail/composemail.h
@@ -35,6 +35,7 @@ public:
35public slots: 35public slots:
36 void slotAdjustColumns(); 36 void slotAdjustColumns();
37 37
38
38protected slots: 39protected slots:
39 void accept(); 40 void accept();
40 41
@@ -48,6 +49,8 @@ private slots:
48 void addAttachment(); 49 void addAttachment();
49 void removeAttachment(); 50 void removeAttachment();
50 51
52
53
51private: 54private:
52 Settings *settings; 55 Settings *settings;
53 QList<SMTPaccount> smtpAccounts; 56 QList<SMTPaccount> smtpAccounts;
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index cba9948..ed3ece9 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -3,8 +3,8 @@
3#include <qaction.h> 3#include <qaction.h>
4#include <qapplication.h> 4#include <qapplication.h>
5 5
6//#include "mailfactory.h" 6#include "settings.h"
7//#include "composer.h" 7#include "composemail.h"
8#include "viewmail.h" 8#include "viewmail.h"
9 9
10AttachItem::AttachItem(QListView *parent, AttachItemStore &attachItemStore) 10AttachItem::AttachItem(QListView *parent, AttachItemStore &attachItemStore)
@@ -73,21 +73,22 @@ void ViewMail::setText()
73 73
74 _mailHtml = tr( 74 _mailHtml = tr(
75 "<html><body>" 75 "<html><body>"
76 "<div align=center><b>%1</b></div>" 76 "<div align=center><b><font color=#FF2222>%1</b></font></div>"
77 "<b>From:</b> %2<br>" 77 "<b>From:</b> %2<br>"
78 "<b>To:</b> %3<br>" 78 "<b>To:</b> %3<br>"
79 "%4" 79 "%4"
80 "%5" 80 "%5"
81 "<b>Date:</b> %6<hr>" 81 "<b>Date:</b> %6<hr>"
82 "<font face=fixed>%7</font>") 82 "<font face=fixed>")
83 .arg( deHtml( m_mail[1] ) ) 83 .arg( deHtml( m_mail[1] ) )
84 .arg( deHtml( m_mail[0] ) ) 84 .arg( deHtml( m_mail[0] ) )
85 .arg( deHtml( toString ) ) 85 .arg( deHtml( toString ) )
86 .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( ccString ) ) ) 86 .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( ccString ) ) )
87 .arg( tr("<b>Bcc:</b> %1<br>").arg( deHtml( bccString ) ) ) 87 .arg( tr("<b>Bcc:</b> %1<br>").arg( deHtml( bccString ) ) )
88 .arg( m_mail[3] ) 88 .arg( m_mail[3] );
89 .arg("%1"); 89 browser->setText( QString(_mailHtml) + deHtml( m_mail[2] ) + "</font>" );
90 browser->setText( QString(_mailHtml) + deHtml( m_mail[2] ) ); 90 // remove later in favor of a real handling
91 _gotBody = true;
91} 92}
92 93
93 94
@@ -135,21 +136,21 @@ void ViewMail::slotReply()
135 } 136 }
136 137
137 QString rtext; 138 QString rtext;
138 // rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose 139 rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose
139 // .arg(_mail.envelope().from()[0].toString()) 140 .arg( m_mail[1] )
140 // .arg(_mail.envelope().mailDate()); 141 .arg( m_mail[3] );
141 142
142 //QString text = _mail.bodyPart(1).data(); 143 QString text = m_mail[2];
143 //QStringList lines = QStringList::split(QRegExp("\\n"), text); 144 QStringList lines = QStringList::split(QRegExp("\\n"), text);
144 QStringList::Iterator it; 145 QStringList::Iterator it;
145 //for (it = lines.begin(); it != lines.end(); it++) { 146 for (it = lines.begin(); it != lines.end(); it++) {
146 // rtext += "> " + *it + "\n"; 147 rtext += "> " + *it + "\n";
147 //} 148 }
148 rtext += "\n"; 149 rtext += "\n";
149 150
150 QString prefix; 151 QString prefix;
151 //if (_mail.envelope().subject().find(QRegExp("^Re: *$")) != -1) prefix = ""; 152 if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = "";
152 // else prefix = "Re: "; // no i18n on purpose 153 else prefix = "Re: "; // no i18n on purpose
153 154
154 //SendMail sendMail; 155 //SendMail sendMail;
155 //sendMail.setTo(_mail.envelope().from()[0].toString()); 156 //sendMail.setTo(_mail.envelope().from()[0].toString());
@@ -157,10 +158,13 @@ void ViewMail::slotReply()
157 //sendMail.setInReplyTo(_mail.envelope().messageId()); 158 //sendMail.setInReplyTo(_mail.envelope().messageId());
158 //sendMail.setMessage(rtext); 159 //sendMail.setMessage(rtext);
159 160
160 //Composer composer(this, 0, true); 161
161 //composer.setSendMail(sendMail); 162/* ComposeMail composer(this, 0, true);
162 //composer.showMaximized(); 163 composer.setMessage( );
163 //composer.exec(); 164 composer.showMaximized();
165 composer.exec();
166*/
167 qDebug ( rtext );
164} 168}
165 169
166void ViewMail::slotForward() 170void ViewMail::slotForward()