summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/writemail.cpp
Unidiff
Diffstat (limited to 'noncore/net/mailit/writemail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mailit/writemail.cpp26
1 files changed, 17 insertions, 9 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
@@ -120,22 +120,22 @@ void WriteMail::init()
120 grid->addWidget( addressButton, 0, 2 ); 120 grid->addWidget( addressButton, 0, 2 );
121 connect(addressButton, SIGNAL(clicked()), this, SLOT(getAddress()) ); 121 connect(addressButton, SIGNAL(clicked()), this, SLOT(getAddress()) );
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();
140 connect(okButton, SIGNAL(clicked()), this, SLOT(addRecipients()) ); 140 connect(okButton, SIGNAL(clicked()), this, SLOT(addRecipients()) );
141 QWhatsThis::add(okButton,QWidget::tr("Queue your mail by clicking here")); 141 QWhatsThis::add(okButton,QWidget::tr("Queue your mail by clicking here"));
@@ -145,13 +145,12 @@ void WriteMail::init()
145 145
146void WriteMail::reject() 146void 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;
156 155
157 if (toInput->text() == "") 156 if (toInput->text() == "")
@@ -249,18 +248,29 @@ void WriteMail::attachFile()
249 addAtt->showMaximized(); 248 addAtt->showMaximized();
250} 249}
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) 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 }
261 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
266 pos = 0; 276 pos = 0;
@@ -318,29 +328,28 @@ bool WriteMail::getRecipients(bool ccField)
318 328
319 return TRUE; 329 return TRUE;
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
332 mail.recipients.clear(); 341 mail.recipients.clear();
333 342
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 }
345 354
346 ccField ? ccInput->setText(recipients):toInput->setText(recipients); 355 ccField ? ccInput->setText(recipients):toInput->setText(recipients);
@@ -373,9 +382,8 @@ void WriteMail::setRecipient(const QString &recipient)
373 382
374void WriteMail::newMail() 383void 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}