summaryrefslogtreecommitdiff
authoralwin <alwin>2004-02-20 03:06:34 (UTC)
committer alwin <alwin>2004-02-20 03:06:34 (UTC)
commit132f53a7c9cdc3e14a040558f80bb45ceb3ca9b5 (patch) (unidiff)
tree959a36e8388e78085562d96b988c1137fa0d4548
parentcb6a133e6c640e5a26de329bfb907c551a6158e4 (diff)
downloadopie-132f53a7c9cdc3e14a040558f80bb45ceb3ca9b5.zip
opie-132f53a7c9cdc3e14a040558f80bb45ceb3ca9b5.tar.gz
opie-132f53a7c9cdc3e14a040558f80bb45ceb3ca9b5.tar.bz2
removed usage of libopie - only the stuff from opie2
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/addresspicker.cpp11
-rw-r--r--noncore/net/mail/mail.pro4
2 files changed, 8 insertions, 7 deletions
diff --git a/noncore/net/mail/addresspicker.cpp b/noncore/net/mail/addresspicker.cpp
index c6dec35..f4f4cea 100644
--- a/noncore/net/mail/addresspicker.cpp
+++ b/noncore/net/mail/addresspicker.cpp
@@ -1,99 +1,100 @@
1#include <qpushbutton.h> 1#include <qpushbutton.h>
2#include <qmessagebox.h> 2#include <qmessagebox.h>
3#include <qtextstream.h> 3#include <qtextstream.h>
4#include <qlistbox.h> 4#include <qlistbox.h>
5#include <qfile.h> 5#include <qfile.h>
6 6
7#include <qpe/resource.h> 7#include <qpe/resource.h>
8#include <opie/ocontactaccess.h> 8#include <opie2/ocontactaccess.h>
9#include <opie/ocontact.h> 9#include <opie2/ocontact.h>
10 10
11 11
12#include <stdlib.h> 12#include <stdlib.h>
13 13
14#include "composemail.h" 14#include "composemail.h"
15 15
16AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags ) 16AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFlags flags )
17 : AddressPickerUI( parent, name, modal, flags ) 17 : AddressPickerUI( parent, name, modal, flags )
18{ 18{
19 okButton->setIconSet( Resource::loadPixmap( "enter" ) ); 19 okButton->setIconSet( Resource::loadPixmap( "enter" ) );
20 cancelButton->setIconSet( Resource::loadPixmap( "editdelete" ) ); 20 cancelButton->setIconSet( Resource::loadPixmap( "editdelete" ) );
21 21
22 connect(okButton, SIGNAL(clicked()), SLOT(accept())); 22 connect(okButton, SIGNAL(clicked()), SLOT(accept()));
23 connect(cancelButton, SIGNAL(clicked()), SLOT(close())); 23 connect(cancelButton, SIGNAL(clicked()), SLOT(close()));
24 OContactAccess::List::Iterator it; 24 Opie::OContactAccess::List::Iterator it;
25 25
26 QString lineEmail, lineName, contactLine; 26 QString lineEmail, lineName, contactLine;
27 /* what name has to set here???? */ 27 /* what name has to set here???? */
28 OContactAccess m_contactdb("opiemail"); 28 Opie::OContactAccess m_contactdb("opiemail");
29
29 QStringList mails; 30 QStringList mails;
30 QString pre,suf; 31 QString pre,suf;
31 OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 ); 32 Opie::OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 );
32 for ( it = m_list.begin(); it != m_list.end(); ++it ) { 33 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
33 if ((*it).defaultEmail().length()!=0) { 34 if ((*it).defaultEmail().length()!=0) {
34 mails = (*it).emailList(); 35 mails = (*it).emailList();
35 if ((*it).fileAs().length()>0) { 36 if ((*it).fileAs().length()>0) {
36 pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <"; 37 pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <";
37 suf = ">"; 38 suf = ">";
38 } else { 39 } else {
39 pre = ""; 40 pre = "";
40 suf = ""; 41 suf = "";
41 } 42 }
42 QStringList::ConstIterator sit = mails.begin(); 43 QStringList::ConstIterator sit = mails.begin();
43 for (;sit!=mails.end();++sit) { 44 for (;sit!=mails.end();++sit) {
44 contactLine=pre+(*sit)+suf; 45 contactLine=pre+(*sit)+suf;
45 addressList->insertItem(contactLine); 46 addressList->insertItem(contactLine);
46 } 47 }
47 } 48 }
48 } 49 }
49 if ( addressList->count() <= 0 ) { 50 if ( addressList->count() <= 0 ) {
50#if 0 51#if 0
51 // makes this realy sense?? 52 // makes this realy sense??
52 addressList->insertItem( 53 addressList->insertItem(
53 tr( "There are no entries in the addressbook." ) ); 54 tr( "There are no entries in the addressbook." ) );
54#endif 55#endif
55 addressList->setEnabled( false ); 56 addressList->setEnabled( false );
56 okButton->setEnabled( false ); 57 okButton->setEnabled( false );
57 } else { 58 } else {
58// addressList->sort(); 59// addressList->sort();
59 } 60 }
60} 61}
61 62
62void AddressPicker::accept() 63void AddressPicker::accept()
63{ 64{
64 QListBoxItem *item = addressList->firstItem(); 65 QListBoxItem *item = addressList->firstItem();
65 QString names; 66 QString names;
66 67
67 while ( item ) { 68 while ( item ) {
68 if ( item->selected() ) 69 if ( item->selected() )
69 names += item->text() + ", "; 70 names += item->text() + ", ";
70 item = item->next(); 71 item = item->next();
71 } 72 }
72 names.replace( names.length() - 2, 2, "" ); 73 names.replace( names.length() - 2, 2, "" );
73 74
74 if ( names.isEmpty() ) { 75 if ( names.isEmpty() ) {
75 QMessageBox::information(this, tr("Error"), tr("<p>You have to select" 76 QMessageBox::information(this, tr("Error"), tr("<p>You have to select"
76 " at least one address entry.</p>"), tr("Ok")); 77 " at least one address entry.</p>"), tr("Ok"));
77 return; 78 return;
78 } 79 }
79 80
80 selectedNames = names; 81 selectedNames = names;
81 QDialog::accept(); 82 QDialog::accept();
82} 83}
83 84
84QString AddressPicker::getNames() 85QString AddressPicker::getNames()
85{ 86{
86 QString names = 0; 87 QString names = 0;
87 88
88 AddressPicker picker(0, 0, true); 89 AddressPicker picker(0, 0, true);
89 picker.showMaximized(); 90 picker.showMaximized();
90 picker.show(); 91 picker.show();
91 92
92 int ret = picker.exec(); 93 int ret = picker.exec();
93 if ( QDialog::Accepted == ret ) { 94 if ( QDialog::Accepted == ret ) {
94 return picker.selectedNames; 95 return picker.selectedNames;
95 } 96 }
96 97
97 return 0; 98 return 0;
98} 99}
99 100
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index d3d2ab1..7e0de2b 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -1,61 +1,61 @@
1CONFIG += qt warn_on debug quick-app 1CONFIG += qt warn_on debug quick-app
2 2
3HEADERS = defines.h \ 3HEADERS = defines.h \
4 editaccounts.h \ 4 editaccounts.h \
5 composemail.h \ 5 composemail.h \
6 accountview.h \ 6 accountview.h \
7 accountitem.h \ 7 accountitem.h \
8 mainwindow.h \ 8 mainwindow.h \
9 viewmail.h \ 9 viewmail.h \
10 viewmailbase.h \ 10 viewmailbase.h \
11 opiemail.h \ 11 opiemail.h \
12 mailistviewitem.h \ 12 mailistviewitem.h \
13 settingsdialog.h \ 13 settingsdialog.h \
14 statuswidget.h \ 14 statuswidget.h \
15 newmaildir.h \ 15 newmaildir.h \
16 selectstore.h \ 16 selectstore.h \
17 selectsmtp.h 17 selectsmtp.h
18 18
19SOURCES = main.cpp \ 19SOURCES = main.cpp \
20 opiemail.cpp \ 20 opiemail.cpp \
21 mainwindow.cpp \ 21 mainwindow.cpp \
22 accountview.cpp \ 22 accountview.cpp \
23 accountitem.cpp \ 23 accountitem.cpp \
24 composemail.cpp \ 24 composemail.cpp \
25 addresspicker.cpp \ 25 addresspicker.cpp \
26 editaccounts.cpp \ 26 editaccounts.cpp \
27 viewmail.cpp \ 27 viewmail.cpp \
28 viewmailbase.cpp \ 28 viewmailbase.cpp \
29 mailistviewitem.cpp \ 29 mailistviewitem.cpp \
30 settingsdialog.cpp \ 30 settingsdialog.cpp \
31 statuswidget.cpp \ 31 statuswidget.cpp \
32 newmaildir.cpp \ 32 newmaildir.cpp \
33 selectstore.cpp \ 33 selectstore.cpp \
34 selectsmtp.cpp 34 selectsmtp.cpp
35 35
36INTERFACES = editaccountsui.ui \ 36INTERFACES = editaccountsui.ui \
37 selectmailtypeui.ui \ 37 selectmailtypeui.ui \
38 imapconfigui.ui \ 38 imapconfigui.ui \
39 pop3configui.ui \ 39 pop3configui.ui \
40 nntpconfigui.ui \ 40 nntpconfigui.ui \
41 smtpconfigui.ui \ 41 smtpconfigui.ui \
42 addresspickerui.ui \ 42 addresspickerui.ui \
43 composemailui.ui \ 43 composemailui.ui \
44 settingsdialogui.ui \ 44 settingsdialogui.ui \
45 statuswidgetui.ui \ 45 statuswidgetui.ui \
46 newmaildirui.ui \ 46 newmaildirui.ui \
47 selectstoreui.ui 47 selectstoreui.ui
48 48
49 49
50INCLUDEPATH += $(OPIEDIR)/include 50INCLUDEPATH += $(OPIEDIR)/include
51 51
52CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) 52CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
53contains( CONFTEST, y ){ 53contains( CONFTEST, y ){
54 LIBS += -lqpe -lopieui2 -lopiecore2 -lopie -lmailwrapper -liconv 54 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lopiedb2 -lmailwrapper -liconv
55}else{ 55}else{
56 LIBS += -lqpe -lopieui2 -lopiecore2 -lopie -lmailwrapper 56 LIBS += -lqpe -lopieui2 -lopiecore2 -lopiepim2 -lopiedb2 -lmailwrapper
57} 57}
58 58
59TARGET = opiemail 59TARGET = opiemail
60 60
61include ( $(OPIEDIR)/include.pro ) 61include ( $(OPIEDIR)/include.pro )