summaryrefslogtreecommitdiff
authortille <tille>2002-06-19 12:41:33 (UTC)
committer tille <tille>2002-06-19 12:41:33 (UTC)
commit2bcd7302e4e156ad5f389b23c01a690917abee01 (patch) (unidiff)
tree25770523cbb36e7152f8a3a4c1650afab6fc45da
parentb55f69a46fd27ce26235029f702c0f3942fde68c (diff)
downloadopie-2bcd7302e4e156ad5f389b23c01a690917abee01.zip
opie-2bcd7302e4e156ad5f389b23c01a690917abee01.tar.gz
opie-2bcd7302e4e156ad5f389b23c01a690917abee01.tar.bz2
added ofiledialog for attachments, but did not yet remove attachdiag
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mail2/composer.cpp7
-rw-r--r--noncore/unsupported/mail2/mail.pro2
2 files changed, 6 insertions, 3 deletions
diff --git a/noncore/unsupported/mail2/composer.cpp b/noncore/unsupported/mail2/composer.cpp
index 72a7242..03dacae 100644
--- a/noncore/unsupported/mail2/composer.cpp
+++ b/noncore/unsupported/mail2/composer.cpp
@@ -1,65 +1,67 @@
1#include <qmultilineedit.h> 1#include <qmultilineedit.h>
2#include <qmessagebox.h> 2#include <qmessagebox.h>
3#include <qpopupmenu.h> 3#include <qpopupmenu.h>
4#include <qcombobox.h> 4#include <qcombobox.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qaction.h> 6#include <qaction.h>
7#include <qtimer.h> 7#include <qtimer.h>
8#include <qlabel.h> 8#include <qlabel.h>
9#include <qapplication.h> 9#include <qapplication.h>
10 10
11#include <qpe/resource.h> 11#include <qpe/resource.h>
12#include <qpe/config.h> 12#include <qpe/config.h>
13 13
14#include <opie/ofiledialog.h>
15//#include "attachdiag.h"
16
14#include "addresspicker.h" 17#include "addresspicker.h"
15#include "listviewplus.h" 18#include "listviewplus.h"
16#include "smtphandler.h" 19#include "smtphandler.h"
17#include "attachdiag.h"
18#include "composer.h" 20#include "composer.h"
19#include "rename.h" 21#include "rename.h"
20 22
21AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment) 23AttachViewItem::AttachViewItem(QListView *parent, Attachment &attachment)
22 : QListViewItem(parent), _attachment(attachment) 24 : QListViewItem(parent), _attachment(attachment)
23{ 25{
24 setPixmap(0, _attachment.docLnk().pixmap().isNull() ? Resource::loadPixmap("UnknownDocument-14") : _attachment.docLnk().pixmap()); 26 setPixmap(0, _attachment.docLnk().pixmap().isNull() ? Resource::loadPixmap("UnknownDocument-14") : _attachment.docLnk().pixmap());
25 setText(0, _attachment.newName().isEmpty() ? _attachment.fileName() : _attachment.newName()); 27 setText(0, _attachment.newName().isEmpty() ? _attachment.fileName() : _attachment.newName());
26 setText(1, _attachment.description()); 28 setText(1, _attachment.description());
27} 29}
28 30
29Composer::Composer(QWidget *parent, const char *name, WFlags fl, bool sendQueue) 31Composer::Composer(QWidget *parent, const char *name, WFlags fl, bool sendQueue)
30 : ComposerBase(parent, name, fl), _inLoop(false) 32 : ComposerBase(parent, name, fl), _inLoop(false)
31{ 33{
32 _sendQueued = sendQueue; 34 _sendQueued = sendQueue;
33 abort->setEnabled(false); 35 abort->setEnabled(false);
34 to->setFocus(); 36 to->setFocus();
35 37
36 connect(sendmail, SIGNAL(activated()), SLOT(slotSendMail())); 38 connect(sendmail, SIGNAL(activated()), SLOT(slotSendMail()));
37 connect(queuemail, SIGNAL(activated()), SLOT(slotQueueMail())); 39 connect(queuemail, SIGNAL(activated()), SLOT(slotQueueMail()));
38 connect(addressbook, SIGNAL(activated()), SLOT(slotOpenAddressPicker())); 40 connect(addressbook, SIGNAL(activated()), SLOT(slotOpenAddressPicker()));
39 connect(addattach, SIGNAL(activated()), SLOT(slotAddAttach())); 41 connect(addattach, SIGNAL(activated()), SLOT(slotAddAttach()));
40 connect(delattach, SIGNAL(activated()), SLOT(slotDelAttach())); 42 connect(delattach, SIGNAL(activated()), SLOT(slotDelAttach()));
41 43
42 connect(from, SIGNAL(activated(int)), SLOT(slotFromChanged(int))); 44 connect(from, SIGNAL(activated(int)), SLOT(slotFromChanged(int)));
43 45
44 connect(attachPopup, SIGNAL(activated(int)), SLOT(slotPopupHandler(int))); 46 connect(attachPopup, SIGNAL(activated(int)), SLOT(slotPopupHandler(int)));
45 47
46 QTimer::singleShot(0, this, SLOT(slotFillStuff())); 48 QTimer::singleShot(0, this, SLOT(slotFillStuff()));
47 QTimer::singleShot(0, this, SLOT(slotResizing())); 49 QTimer::singleShot(0, this, SLOT(slotResizing()));
48 50
49} 51}
50 52
51Composer::~Composer() 53Composer::~Composer()
52{ 54{
53 hide(); 55 hide();
54} 56}
55 57
56void Composer::hide() 58void Composer::hide()
57{ 59{
58 QWidget::hide(); 60 QWidget::hide();
59 61
60 if (_inLoop) { 62 if (_inLoop) {
61 _inLoop = false; 63 _inLoop = false;
62 qApp->exit_loop(); 64 qApp->exit_loop();
63 } 65 }
64} 66}
65 67
@@ -349,64 +351,65 @@ void Composer::slotFillStuff()
349 if (!(*it).email().isEmpty() && !(*it).smtpServer().isEmpty() && !(*it).smtpPort().isEmpty()) { 351 if (!(*it).email().isEmpty() && !(*it).smtpServer().isEmpty() && !(*it).smtpPort().isEmpty()) {
350 if (!(*it).realName().isEmpty()) 352 if (!(*it).realName().isEmpty())
351 from->insertItem((*it).realName() + " <" + (*it).email() + ">", i); 353 from->insertItem((*it).realName() + " <" + (*it).email() + ">", i);
352 else 354 else
353 from->insertItem((*it).email()); 355 from->insertItem((*it).email());
354 356
355 accountsLoaded.append(*it); 357 accountsLoaded.append(*it);
356 i++; 358 i++;
357 } 359 }
358 } 360 }
359} 361}
360 362
361void Composer::slotFromChanged(int id) 363void Composer::slotFromChanged(int id)
362{ 364{
363 Account account = accountsLoaded[id]; 365 Account account = accountsLoaded[id];
364 366
365 if (account.defaultCc()) cc->setText(account.cc()); 367 if (account.defaultCc()) cc->setText(account.cc());
366 if (account.defaultBcc()) bcc->setText(account.bcc()); 368 if (account.defaultBcc()) bcc->setText(account.bcc());
367 if (account.defaultReplyTo()) replyto->setText(account.replyTo()); 369 if (account.defaultReplyTo()) replyto->setText(account.replyTo());
368 if (!account.signature().isEmpty()) 370 if (!account.signature().isEmpty())
369 message->setText(message->text() + "\n\n-- \n" + account.signature()); 371 message->setText(message->text() + "\n\n-- \n" + account.signature());
370} 372}
371 373
372void Composer::slotOpenAddressPicker() 374void Composer::slotOpenAddressPicker()
373{ 375{
374 if (!to->isHidden() && cc->isHidden() && bcc->isHidden()) { 376 if (!to->isHidden() && cc->isHidden() && bcc->isHidden()) {
375 if (to->text().isEmpty()) { 377 if (to->text().isEmpty()) {
376 to->setText(AddressPicker::getNames()); 378 to->setText(AddressPicker::getNames());
377 } else { 379 } else {
378 to->setText(to->text() + ", " + AddressPicker::getNames()); 380 to->setText(to->text() + ", " + AddressPicker::getNames());
379 } 381 }
380 } else if (to->isHidden() && !cc->isHidden() && bcc->isHidden()) { 382 } else if (to->isHidden() && !cc->isHidden() && bcc->isHidden()) {
381 if (cc->text().isEmpty()) { 383 if (cc->text().isEmpty()) {
382 cc->setText(AddressPicker::getNames()); 384 cc->setText(AddressPicker::getNames());
383 } else { 385 } else {
384 cc->setText(cc->text() + ", " + AddressPicker::getNames()); 386 cc->setText(cc->text() + ", " + AddressPicker::getNames());
385 } 387 }
386 } else if (to->isHidden() && cc->isHidden() && !bcc->isHidden()) { 388 } else if (to->isHidden() && cc->isHidden() && !bcc->isHidden()) {
387 if (bcc->text().isEmpty()) { 389 if (bcc->text().isEmpty()) {
388 bcc->setText(AddressPicker::getNames()); 390 bcc->setText(AddressPicker::getNames());
389 } else { 391 } else {
390 bcc->setText(bcc->text() + ", " + AddressPicker::getNames()); 392 bcc->setText(bcc->text() + ", " + AddressPicker::getNames());
391 } 393 }
392 } 394 }
393} 395}
394 396
395void Composer::slotAddAttach() 397void Composer::slotAddAttach()
396{ 398{
397 DocLnk lnk = AttachDiag::getFile(this); 399 DocLnk lnk = OFileDialog::getOpenFileName( 1,"/");
400 //DocLnk lnk = AttachDiag::getFile(this);
398 if (lnk.name().isEmpty()) return; 401 if (lnk.name().isEmpty()) return;
399 402
400 Attachment attachment; 403 Attachment attachment;
401 attachment.setFileName(lnk.file()); 404 attachment.setFileName(lnk.file());
402 attachment.setNewName(lnk.name()); 405 attachment.setNewName(lnk.name());
403 attachment.setDocLnk(lnk); 406 attachment.setDocLnk(lnk);
404 407
405 (void) new AttachViewItem(attachView, attachment); 408 (void) new AttachViewItem(attachView, attachment);
406} 409}
407 410
408void Composer::slotDelAttach() 411void Composer::slotDelAttach()
409{ 412{
410 if (attachView->currentItem() == NULL) return; 413 if (attachView->currentItem() == NULL) return;
411 attachView->takeItem(attachView->currentItem()); 414 attachView->takeItem(attachView->currentItem());
412} 415}
diff --git a/noncore/unsupported/mail2/mail.pro b/noncore/unsupported/mail2/mail.pro
index 76b7996..cd21d4a 100644
--- a/noncore/unsupported/mail2/mail.pro
+++ b/noncore/unsupported/mail2/mail.pro
@@ -1,46 +1,46 @@
1 TEMPLATE = app 1 TEMPLATE = app
2 CONFIG = qt warn_on debug 2 CONFIG = qt warn_on debug
3 #CONFIG = qt warn_on release 3 #CONFIG = qt warn_on release
4 HEADERS = accounteditor.h \ 4 HEADERS = accounteditor.h \
5 addresspicker.h \ 5 addresspicker.h \
6 attachdiag.h \ 6 attachdiag.h \
7 composer.h \ 7 composer.h \
8 composerbase.h \ 8 composerbase.h \
9 configdiag.h \ 9 configdiag.h \
10 folderwidget.h \ 10 folderwidget.h \
11 listviewplus.h \ 11 listviewplus.h \
12 mailtable.h \ 12 mailtable.h \
13 mainwindow.h \ 13 mainwindow.h \
14 mainwindowbase.h \ 14 mainwindowbase.h \
15 opendiag.h \ 15 opendiag.h \
16 rename.h \ 16 rename.h \
17 searchdiag.h \ 17 searchdiag.h \
18 viewmail.h \ 18 viewmail.h \
19 viewmailbase.h 19 viewmailbase.h
20 SOURCES = accounteditor.cpp \ 20 SOURCES = accounteditor.cpp \
21 addresspicker.cpp \ 21 addresspicker.cpp \
22 attachdiag.cpp \ 22 attachdiag.cpp \
23 composer.cpp \ 23 composer.cpp \
24 composerbase.cpp \ 24 composerbase.cpp \
25 configdiag.cpp \ 25 configdiag.cpp \
26 folderwidget.cpp \ 26 folderwidget.cpp \
27 listviewplus.cpp \ 27 listviewplus.cpp \
28 mailtable.cpp \ 28 mailtable.cpp \
29 main.cpp \ 29 main.cpp \
30 mainwindow.cpp \ 30 mainwindow.cpp \
31 mainwindowbase.cpp \ 31 mainwindowbase.cpp \
32 opendiag.cpp \ 32 opendiag.cpp \
33 rename.cpp \ 33 rename.cpp \
34 searchdiag.cpp \ 34 searchdiag.cpp \
35 viewmail.cpp \ 35 viewmail.cpp \
36 viewmailbase.cpp 36 viewmailbase.cpp
37 INTERFACES = accounteditorbase.ui \ 37 INTERFACES = accounteditorbase.ui \
38 addresspickerbase.ui \ 38 addresspickerbase.ui \
39 configdiagbase.ui \ 39 configdiagbase.ui \
40 opendiagbase.ui \ 40 opendiagbase.ui \
41 renamebase.ui \ 41 renamebase.ui \
42 searchdiagbase.ui 42 searchdiagbase.ui
43 INCLUDEPATH += $(OPIEDIR)/include libmail 43 INCLUDEPATH += $(OPIEDIR)/include libmail
44 LIBS += -lmail -lqpe 44 LIBS += -lmail -lqpe -lopie
45 TARGET = mail 45 TARGET = mail
46 DESTDIR = $(OPIEDIR)/bin 46 DESTDIR = $(OPIEDIR)/bin