summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/writemail.cpp
Unidiff
Diffstat (limited to 'noncore/net/mailit/writemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/writemail.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/noncore/net/mailit/writemail.cpp b/noncore/net/mailit/writemail.cpp
index 0336c83..dcf0c6e 100644
--- a/noncore/net/mailit/writemail.cpp
+++ b/noncore/net/mailit/writemail.cpp
@@ -122,18 +122,18 @@ void WriteMail::init()
122 QWhatsThis::add(addressButton,QWidget::tr("This button opens the address selector with all mail adresses from your OPIE addressbook")); 122 QWhatsThis::add(addressButton,QWidget::tr("This button opens the address selector with all mail adresses from your OPIE addressbook"));
123 123
124 emailInput = new QMultiLineEdit( widget, "emailInput" ); 124 emailInput = new QMultiLineEdit( widget, "emailInput" );
125 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2); 125 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2);
126 QWhatsThis::add(recipientsBox,QWidget::tr("Enter your mail text here")); 126 QWhatsThis::add(emailInput,QWidget::tr("Enter your mail text here"));
127 127
128 addressView = new QListView( widget, "addressView"); 128 addressView = new QListView( widget, "addressView");
129 addressView->addColumn("Name"); 129 addressView->addColumn("Name");
130 addressView->addColumn("EMail"); 130 addressView->addColumn("EMail");
131 addressView->setAllColumnsShowFocus(TRUE); 131 addressView->setAllColumnsShowFocus(TRUE);
132 addressView->setMultiSelection(TRUE); 132 addressView->setMultiSelection(TRUE);
133 addressView->hide(); 133 addressView->hide();
134 grid->addMultiCellWidget( addressView, 3, 3, 0, 2); 134 grid->addMultiCellWidget( addressView, 3, 3, 0, 2);
135 QWhatsThis::add(recipientsBox,QWidget::tr("Chose the recipients from this list")); 135 QWhatsThis::add(recipientsBox,QWidget::tr("Choose the recipients from this list"));
136 136
137 okButton = new QToolButton(bar, "ok"); 137 okButton = new QToolButton(bar, "ok");
138 okButton->setPixmap( Resource::loadPixmap("enter") ); 138 okButton->setPixmap( Resource::loadPixmap("enter") );
139 okButton->hide(); 139 okButton->hide();
@@ -147,9 +147,8 @@ void WriteMail::reject()
147{ 147{
148 emit cancelMail(); 148 emit cancelMail();
149} 149}
150 150
151// need to insert date
152void WriteMail::accept() 151void WriteMail::accept()
153{ 152{
154 QStringList attachedFiles, attachmentsType; 153 QStringList attachedFiles, attachmentsType;
155 int idCount = 0; 154 int idCount = 0;
@@ -251,15 +250,26 @@ void WriteMail::attachFile()
251 250
252void WriteMail::reply(Email replyMail, bool replyAll) 251void WriteMail::reply(Email replyMail, bool replyAll)
253{ 252{
254 int pos; 253 int pos;
254 QString ccRecipients;
255 255
256 mail = replyMail; 256 mail = replyMail;
257 mail.files.clear(); 257 mail.files.clear();
258 258
259 toInput->setText(mail.fromMail); 259 toInput->setText(mail.fromMail);
260 //replyAll ? ccInput->setText(mail.c)
261 260
261 if (replyAll)
262 {
263 for (QStringList::Iterator it = mail.carbonCopies.begin();it != mail.carbonCopies.end(); ++it)
264 {
265 ccRecipients.append(*it);
266 ccRecipients.append(";");
267 }
268 ccRecipients.truncate(ccRecipients.length()-1); //no ; at the end
269 ccInput->setText(ccRecipients);
270 }
271
262 addRecipients(replyAll); 272 addRecipients(replyAll);
263 273
264 subjectInput->setText(tr("Re: ") + mail.subject); 274 subjectInput->setText(tr("Re: ") + mail.subject);
265 275
@@ -320,12 +330,11 @@ bool WriteMail::getRecipients(bool ccField)
320} 330}
321 331
322void WriteMail::addRecipients() 332void WriteMail::addRecipients()
323{ 333{
324 334 toInput->isVisible() ? addRecipients(false) : addRecipients(true);
325 addRecipients(false);
326 } 335 }
327 336
328void WriteMail::addRecipients(bool ccField) 337void WriteMail::addRecipients(bool ccField)
329{ 338{
330 QString recipients = ""; 339 QString recipients = "";
331 340
@@ -334,11 +343,11 @@ void WriteMail::addRecipients(bool ccField)
334 QListViewItem *item = addressView->firstChild(); 343 QListViewItem *item = addressView->firstChild();
335 while (item != NULL) { 344 while (item != NULL) {
336 if ( item->isSelected() ) { 345 if ( item->isSelected() ) {
337 if (recipients == "") { 346 if (recipients == "") {
338 recipients = item->text(0); 347 recipients = item->text(1);
339 } else { 348 } else {
340 recipients += "; " + item->text(0); 349 recipients += "; " + item->text(1);
341 } 350 }
342 } 351 }
343 item = item->nextSibling(); 352 item = item->nextSibling();
344 } 353 }
@@ -375,7 +384,6 @@ void WriteMail::newMail()
375{ 384{
376 toInput->clear(); 385 toInput->clear();
377 subjectInput->clear(); 386 subjectInput->clear();
378 emailInput->clear(); 387 emailInput->clear();
379 //to clear selected
380 setAddressList(addressList); 388 setAddressList(addressList);
381} 389}