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.cpp17
1 files changed, 9 insertions, 8 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
@@ -6,16 +6,16 @@
6#include "composemail.h" 6#include "composemail.h"
7 7
8ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 8ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
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() ) {
19 if ( it->getType().compare( "SMTP" ) == 0 ) { 19 if ( it->getType().compare( "SMTP" ) == 0 ) {
20 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 20 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
21 fromBox->insertItem( smtp->getMail() ); 21 fromBox->insertItem( smtp->getMail() );
@@ -23,13 +23,13 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
23 } 23 }
24 } 24 }
25 25
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 }
33 33
34 connect( fromBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) ); 34 connect( fromBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) );
35 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); 35 connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) );
@@ -47,12 +47,13 @@ void ComposeMail::pickAddress( QLineEdit *line )
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
53void ComposeMail::pickAddressTo() 54void ComposeMail::pickAddressTo()
54{ 55{
55 pickAddress( toLine ); 56 pickAddress( toLine );
56} 57}
57 58
58void ComposeMail::pickAddressCC() 59void ComposeMail::pickAddressCC()
@@ -90,13 +91,13 @@ void ComposeMail::fillValues( int current )
90 sigMultiLine->setText( smtp->getSignature() ); 91 sigMultiLine->setText( smtp->getSignature() );
91} 92}
92 93
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 );
100 101
101 tabWidget->setCurrentPage( currPage ); 102 tabWidget->setCurrentPage( currPage );
102} 103}
@@ -110,23 +111,23 @@ void ComposeMail::addAttachment()
110 } 111 }
111} 112}
112 113
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 {
120 attList->takeItem( attList->currentItem() ); 121 attList->takeItem( attList->currentItem() );
121 } 122 }
122} 123}
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() );
130 mail->setMail( smtp->getMail() ); 131 mail->setMail( smtp->getMail() );
131 mail->setName( smtp->getName() ); 132 mail->setName( smtp->getName() );
132 133
@@ -161,13 +162,13 @@ void ComposeMail::accept()
161 162
162AttachViewItem::AttachViewItem( QListView *parent, Attachment *att ) 163AttachViewItem::AttachViewItem( QListView *parent, Attachment *att )
163 : QListViewItem( parent ) 164 : QListViewItem( parent )
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() ) );
172} 173}
173 174