summaryrefslogtreecommitdiff
path: root/noncore
authorgroucho <groucho>2003-04-13 10:29:05 (UTC)
committer groucho <groucho>2003-04-13 10:29:05 (UTC)
commit8cc217bed9c122a7c7448e2cd59bfde330dfcfad (patch) (unidiff)
treef802c03bbddf54ecc541ce23bdc43da0fc8b390b /noncore
parent64d6b3e723b9b2fc3b1f3eea6da6344c5f26ce1e (diff)
downloadopie-8cc217bed9c122a7c7448e2cd59bfde330dfcfad.zip
opie-8cc217bed9c122a7c7448e2cd59bfde330dfcfad.tar.gz
opie-8cc217bed9c122a7c7448e2cd59bfde330dfcfad.tar.bz2
- Uses mime types for attachment reading
- Addresses are read from ocontactacess
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/addatt.cpp34
-rw-r--r--noncore/net/mailit/addatt.h8
-rw-r--r--noncore/net/mailit/addresslist.cpp20
-rw-r--r--noncore/net/mailit/emailclient.cpp2
-rw-r--r--noncore/net/mailit/mailitwindow.cpp4
-rw-r--r--noncore/net/mailit/viewatt.cpp15
-rw-r--r--noncore/net/mailit/writemail.cpp5
-rw-r--r--noncore/unsupported/mailit/addatt.cpp34
-rw-r--r--noncore/unsupported/mailit/addatt.h8
-rw-r--r--noncore/unsupported/mailit/addresslist.cpp20
-rw-r--r--noncore/unsupported/mailit/emailclient.cpp2
-rw-r--r--noncore/unsupported/mailit/mailitwindow.cpp4
-rw-r--r--noncore/unsupported/mailit/viewatt.cpp15
-rw-r--r--noncore/unsupported/mailit/writemail.cpp5
14 files changed, 110 insertions, 66 deletions
diff --git a/noncore/net/mailit/addatt.cpp b/noncore/net/mailit/addatt.cpp
index f279f52..c8be865 100644
--- a/noncore/net/mailit/addatt.cpp
+++ b/noncore/net/mailit/addatt.cpp
@@ -20,2 +20,3 @@
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qhbox.h>
21#include <qdir.h> 22#include <qdir.h>
@@ -59,8 +60,8 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f)
59 60
60 QGridLayout *top = new QGridLayout(this, 3,1 ); 61 QGridLayout *top = new QGridLayout(this, 1,1 );
61 62
62 63 QHBox *buttons=new QHBox(this);
63 /*fileCategoryButton = new QPushButton(this);*/ 64 /*fileCategoryButton = new QPushButton(this);*/
64 attatchButton = new QPushButton("Attatch ->", this); 65 attatchButton = new QPushButton("Attatch ->", buttons);
65 removeButton = new QPushButton("Remove", this); 66 removeButton = new QPushButton("Remove", buttons);
66 67
@@ -77,10 +78,9 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f)
77 78
78 //ofs=new OFileSelector(this,2,0,"/root/Documents");
79
80
81 top->addWidget(attatchButton,1,0);
82 top->addWidget(removeButton,2,0);
83 79
84 /*connect(fileCategories, SIGNAL(activated(int)), this, 80 top->addWidget(buttons,1,0);
85 SLOT(fileCategorySelected(int)) );*/ 81 //buttons->addWidget(attatchButton,0,0);
82 //buttons->addWidget(removeButton,0,1);
83
84 //connect(fileCategories, SIGNAL(activated(int)), this,
85 //SLOT(fileCategorySelected(int)) );*/
86 connect(attatchButton, SIGNAL(clicked()), this, 86 connect(attatchButton, SIGNAL(clicked()), this,
@@ -125,13 +125,7 @@ void AddAtt::addAttatchment()
125 { 125 {
126 QDialog qd(this,tr("Select attachment"),true); 126 OFileDialog ofs("Attachments",this,0,0,"/root/Documents");
127
128 QGridLayout top(&qd,1,1);
129
130 OFileSelector ofs(&qd,1,0,"/root/Documents");
131
132 top.addWidget(&ofs,0,0);
133 127
134 qd.showMaximized(); 128 ofs.showMaximized();
135 129
136 if (qd.exec()==QDialog::Accepted) 130 if (ofs.exec()==QDialog::Accepted)
137 { 131 {
diff --git a/noncore/net/mailit/addatt.h b/noncore/net/mailit/addatt.h
index 73062e2..fcf3279 100644
--- a/noncore/net/mailit/addatt.h
+++ b/noncore/net/mailit/addatt.h
@@ -29,3 +29,3 @@
29#include <qstringlist.h> 29#include <qstringlist.h>
30#include <opie/ofileselector.h> 30#include <opie/ofiledialog.h>
31#include <qpe/applnk.h> 31#include <qpe/applnk.h>
@@ -67,8 +67,8 @@ private:
67 QListView *attView; 67 QListView *attView;
68 QPushButton *fileCategoryButton, *attatchButton, *removeButton; 68 QPushButton *attatchButton, *removeButton;
69 QPopupMenu *fileCategories; 69 QPopupMenu *fileCategories;
70 bool modified; 70 bool modified;
71 QFileInfo *fi; 71 //QFileInfo *fi;
72 72
73 OFileSelector* ofs; 73 OFileDialog* ofs;
74}; 74};
diff --git a/noncore/net/mailit/addresslist.cpp b/noncore/net/mailit/addresslist.cpp
index 1cf2562..43e3830 100644
--- a/noncore/net/mailit/addresslist.cpp
+++ b/noncore/net/mailit/addresslist.cpp
@@ -21,2 +21,4 @@
21#include <qtextstream.h> 21#include <qtextstream.h>
22#include <opie/ocontactaccess.h>
23#include <opie/ocontact.h>
22 24
@@ -118,6 +120,18 @@ void AddressList::read()
118{ 120{
119 QFile f(filename); 121 OContactAccess::List::Iterator it;
122
123 //QFile f(filename);
120 QString lineEmail, lineName, email, name; 124 QString lineEmail, lineName, email, name;
125 OContactAccess m_contactdb("mailit");
126 OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 );
127 //OContact* oc;
121 128
122 if (! f.open(IO_ReadOnly) ) 129 for ( it = m_list.begin(); it != m_list.end(); ++it )
130 {
131 //oc=(OContact*) it;
132 if ((*it).defaultEmail().length()!=0)
133 addContact((*it).defaultEmail(),(*it).fullName());
134 }
135
136 /*if (! f.open(IO_ReadOnly) )
123 return; 137 return;
@@ -136,3 +150,3 @@ void AddressList::read()
136 } 150 }
137 f.close(); 151 f.close();*/
138} 152}
diff --git a/noncore/net/mailit/emailclient.cpp b/noncore/net/mailit/emailclient.cpp
index 9258aac..2943986 100644
--- a/noncore/net/mailit/emailclient.cpp
+++ b/noncore/net/mailit/emailclient.cpp
@@ -150,3 +150,3 @@ void EmailClient::init()
150 150
151 sendMailButton = new QAction(tr("Send mail"), Resource::loadPixmap("mailit/sendmail"), QString::null, 0, this, 0); 151 sendMailButton = new QAction(tr("Send mail"), Resource::loadPixmap("mailit/sendqueue"), QString::null, 0, this, 0);
152 connect(sendMailButton, SIGNAL(activated()), this, SLOT(sendQuedMail()) ); 152 connect(sendMailButton, SIGNAL(activated()), this, SLOT(sendQuedMail()) );
diff --git a/noncore/net/mailit/mailitwindow.cpp b/noncore/net/mailit/mailitwindow.cpp
index f9b6de2..fd49c1f 100644
--- a/noncore/net/mailit/mailitwindow.cpp
+++ b/noncore/net/mailit/mailitwindow.cpp
@@ -29,2 +29,3 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
29 29
30 qWarning("***Starting writeMail");
30 emailClient = new EmailClient(views, "client"); 31 emailClient = new EmailClient(views, "client");
@@ -32,2 +33,3 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
32 readMail = new ReadMail(views, "reading"); 33 readMail = new ReadMail(views, "reading");
34 qWarning("***Finished readMail");
33 35
@@ -59,2 +61,4 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
59 viewingMail = FALSE; 61 viewingMail = FALSE;
62
63 qWarning("***Finished MailitWindow");
60} 64}
diff --git a/noncore/net/mailit/viewatt.cpp b/noncore/net/mailit/viewatt.cpp
index 86f119f..b6f5015 100644
--- a/noncore/net/mailit/viewatt.cpp
+++ b/noncore/net/mailit/viewatt.cpp
@@ -22,2 +22,3 @@
22#include <qpe/applnk.h> 22#include <qpe/applnk.h>
23#include <qpe/mimetype.h>
23 24
@@ -45,2 +46,4 @@ void ViewAtt::update(Email *mailIn, bool inbox)
45 46
47
48
46 listView->clear(); 49 listView->clear();
@@ -62,2 +65,9 @@ void ViewAtt::update(Email *mailIn, bool inbox)
62 65
66 const QString& mtypeDef=(const QString&) ePtr->contentType+"/"+ePtr->contentAttribute;
67
68 MimeType mt(mtypeDef);
69
70 item->setPixmap(0, mt.pixmap());
71
72 /*
63 if (ePtr->contentType == "TEXT") { 73 if (ePtr->contentType == "TEXT") {
@@ -65,4 +75,3 @@ void ViewAtt::update(Email *mailIn, bool inbox)
65 actions->addTo(bar); 75 actions->addTo(bar);
66 item->setPixmap(0, Resource::loadPixmap("txt")); 76 }
67 }
68 if (ePtr->contentType == "AUDIO") { 77 if (ePtr->contentType == "AUDIO") {
@@ -76,3 +85,3 @@ void ViewAtt::update(Email *mailIn, bool inbox)
76 item->setPixmap(0, Resource::loadPixmap("pixmap")); 85 item->setPixmap(0, Resource::loadPixmap("pixmap"));
77 } 86 }*/
78 } 87 }
diff --git a/noncore/net/mailit/writemail.cpp b/noncore/net/mailit/writemail.cpp
index 70332a9..a45cfd2 100644
--- a/noncore/net/mailit/writemail.cpp
+++ b/noncore/net/mailit/writemail.cpp
@@ -47,3 +47,3 @@ void WriteMail::setAddressList(AddressList *list)
47 for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { 47 for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) {
48 item = new QListViewItem(addressView, cPtr->email, cPtr->name); 48 item = new QListViewItem(addressView, cPtr->name, cPtr->email);
49 } 49 }
@@ -112,6 +112,7 @@ void WriteMail::init()
112 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2); 112 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2);
113
113 114
114 addressView = new QListView( widget, "addressView"); 115 addressView = new QListView( widget, "addressView");
115 addressView->addColumn("Email");
116 addressView->addColumn("Name"); 116 addressView->addColumn("Name");
117 addressView->addColumn("EMail");
117 addressView->setAllColumnsShowFocus(TRUE); 118 addressView->setAllColumnsShowFocus(TRUE);
diff --git a/noncore/unsupported/mailit/addatt.cpp b/noncore/unsupported/mailit/addatt.cpp
index f279f52..c8be865 100644
--- a/noncore/unsupported/mailit/addatt.cpp
+++ b/noncore/unsupported/mailit/addatt.cpp
@@ -20,2 +20,3 @@
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qhbox.h>
21#include <qdir.h> 22#include <qdir.h>
@@ -59,8 +60,8 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f)
59 60
60 QGridLayout *top = new QGridLayout(this, 3,1 ); 61 QGridLayout *top = new QGridLayout(this, 1,1 );
61 62
62 63 QHBox *buttons=new QHBox(this);
63 /*fileCategoryButton = new QPushButton(this);*/ 64 /*fileCategoryButton = new QPushButton(this);*/
64 attatchButton = new QPushButton("Attatch ->", this); 65 attatchButton = new QPushButton("Attatch ->", buttons);
65 removeButton = new QPushButton("Remove", this); 66 removeButton = new QPushButton("Remove", buttons);
66 67
@@ -77,10 +78,9 @@ AddAtt::AddAtt(QWidget *parent, const char *name, WFlags f)
77 78
78 //ofs=new OFileSelector(this,2,0,"/root/Documents");
79
80
81 top->addWidget(attatchButton,1,0);
82 top->addWidget(removeButton,2,0);
83 79
84 /*connect(fileCategories, SIGNAL(activated(int)), this, 80 top->addWidget(buttons,1,0);
85 SLOT(fileCategorySelected(int)) );*/ 81 //buttons->addWidget(attatchButton,0,0);
82 //buttons->addWidget(removeButton,0,1);
83
84 //connect(fileCategories, SIGNAL(activated(int)), this,
85 //SLOT(fileCategorySelected(int)) );*/
86 connect(attatchButton, SIGNAL(clicked()), this, 86 connect(attatchButton, SIGNAL(clicked()), this,
@@ -125,13 +125,7 @@ void AddAtt::addAttatchment()
125 { 125 {
126 QDialog qd(this,tr("Select attachment"),true); 126 OFileDialog ofs("Attachments",this,0,0,"/root/Documents");
127
128 QGridLayout top(&qd,1,1);
129
130 OFileSelector ofs(&qd,1,0,"/root/Documents");
131
132 top.addWidget(&ofs,0,0);
133 127
134 qd.showMaximized(); 128 ofs.showMaximized();
135 129
136 if (qd.exec()==QDialog::Accepted) 130 if (ofs.exec()==QDialog::Accepted)
137 { 131 {
diff --git a/noncore/unsupported/mailit/addatt.h b/noncore/unsupported/mailit/addatt.h
index 73062e2..fcf3279 100644
--- a/noncore/unsupported/mailit/addatt.h
+++ b/noncore/unsupported/mailit/addatt.h
@@ -29,3 +29,3 @@
29#include <qstringlist.h> 29#include <qstringlist.h>
30#include <opie/ofileselector.h> 30#include <opie/ofiledialog.h>
31#include <qpe/applnk.h> 31#include <qpe/applnk.h>
@@ -67,8 +67,8 @@ private:
67 QListView *attView; 67 QListView *attView;
68 QPushButton *fileCategoryButton, *attatchButton, *removeButton; 68 QPushButton *attatchButton, *removeButton;
69 QPopupMenu *fileCategories; 69 QPopupMenu *fileCategories;
70 bool modified; 70 bool modified;
71 QFileInfo *fi; 71 //QFileInfo *fi;
72 72
73 OFileSelector* ofs; 73 OFileDialog* ofs;
74}; 74};
diff --git a/noncore/unsupported/mailit/addresslist.cpp b/noncore/unsupported/mailit/addresslist.cpp
index 1cf2562..43e3830 100644
--- a/noncore/unsupported/mailit/addresslist.cpp
+++ b/noncore/unsupported/mailit/addresslist.cpp
@@ -21,2 +21,4 @@
21#include <qtextstream.h> 21#include <qtextstream.h>
22#include <opie/ocontactaccess.h>
23#include <opie/ocontact.h>
22 24
@@ -118,6 +120,18 @@ void AddressList::read()
118{ 120{
119 QFile f(filename); 121 OContactAccess::List::Iterator it;
122
123 //QFile f(filename);
120 QString lineEmail, lineName, email, name; 124 QString lineEmail, lineName, email, name;
125 OContactAccess m_contactdb("mailit");
126 OContactAccess::List m_list = m_contactdb.sorted( true, 0, 0, 0 );
127 //OContact* oc;
121 128
122 if (! f.open(IO_ReadOnly) ) 129 for ( it = m_list.begin(); it != m_list.end(); ++it )
130 {
131 //oc=(OContact*) it;
132 if ((*it).defaultEmail().length()!=0)
133 addContact((*it).defaultEmail(),(*it).fullName());
134 }
135
136 /*if (! f.open(IO_ReadOnly) )
123 return; 137 return;
@@ -136,3 +150,3 @@ void AddressList::read()
136 } 150 }
137 f.close(); 151 f.close();*/
138} 152}
diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp
index 9258aac..2943986 100644
--- a/noncore/unsupported/mailit/emailclient.cpp
+++ b/noncore/unsupported/mailit/emailclient.cpp
@@ -150,3 +150,3 @@ void EmailClient::init()
150 150
151 sendMailButton = new QAction(tr("Send mail"), Resource::loadPixmap("mailit/sendmail"), QString::null, 0, this, 0); 151 sendMailButton = new QAction(tr("Send mail"), Resource::loadPixmap("mailit/sendqueue"), QString::null, 0, this, 0);
152 connect(sendMailButton, SIGNAL(activated()), this, SLOT(sendQuedMail()) ); 152 connect(sendMailButton, SIGNAL(activated()), this, SLOT(sendQuedMail()) );
diff --git a/noncore/unsupported/mailit/mailitwindow.cpp b/noncore/unsupported/mailit/mailitwindow.cpp
index f9b6de2..fd49c1f 100644
--- a/noncore/unsupported/mailit/mailitwindow.cpp
+++ b/noncore/unsupported/mailit/mailitwindow.cpp
@@ -29,2 +29,3 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
29 29
30 qWarning("***Starting writeMail");
30 emailClient = new EmailClient(views, "client"); 31 emailClient = new EmailClient(views, "client");
@@ -32,2 +33,3 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
32 readMail = new ReadMail(views, "reading"); 33 readMail = new ReadMail(views, "reading");
34 qWarning("***Finished readMail");
33 35
@@ -59,2 +61,4 @@ MailItWindow::MailItWindow(QWidget *parent, const char *name, WFlags fl)
59 viewingMail = FALSE; 61 viewingMail = FALSE;
62
63 qWarning("***Finished MailitWindow");
60} 64}
diff --git a/noncore/unsupported/mailit/viewatt.cpp b/noncore/unsupported/mailit/viewatt.cpp
index 86f119f..b6f5015 100644
--- a/noncore/unsupported/mailit/viewatt.cpp
+++ b/noncore/unsupported/mailit/viewatt.cpp
@@ -22,2 +22,3 @@
22#include <qpe/applnk.h> 22#include <qpe/applnk.h>
23#include <qpe/mimetype.h>
23 24
@@ -45,2 +46,4 @@ void ViewAtt::update(Email *mailIn, bool inbox)
45 46
47
48
46 listView->clear(); 49 listView->clear();
@@ -62,2 +65,9 @@ void ViewAtt::update(Email *mailIn, bool inbox)
62 65
66 const QString& mtypeDef=(const QString&) ePtr->contentType+"/"+ePtr->contentAttribute;
67
68 MimeType mt(mtypeDef);
69
70 item->setPixmap(0, mt.pixmap());
71
72 /*
63 if (ePtr->contentType == "TEXT") { 73 if (ePtr->contentType == "TEXT") {
@@ -65,4 +75,3 @@ void ViewAtt::update(Email *mailIn, bool inbox)
65 actions->addTo(bar); 75 actions->addTo(bar);
66 item->setPixmap(0, Resource::loadPixmap("txt")); 76 }
67 }
68 if (ePtr->contentType == "AUDIO") { 77 if (ePtr->contentType == "AUDIO") {
@@ -76,3 +85,3 @@ void ViewAtt::update(Email *mailIn, bool inbox)
76 item->setPixmap(0, Resource::loadPixmap("pixmap")); 85 item->setPixmap(0, Resource::loadPixmap("pixmap"));
77 } 86 }*/
78 } 87 }
diff --git a/noncore/unsupported/mailit/writemail.cpp b/noncore/unsupported/mailit/writemail.cpp
index 70332a9..a45cfd2 100644
--- a/noncore/unsupported/mailit/writemail.cpp
+++ b/noncore/unsupported/mailit/writemail.cpp
@@ -47,3 +47,3 @@ void WriteMail::setAddressList(AddressList *list)
47 for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) { 47 for (cPtr = cListPtr->first(); cPtr != 0; cPtr = cListPtr->next() ) {
48 item = new QListViewItem(addressView, cPtr->email, cPtr->name); 48 item = new QListViewItem(addressView, cPtr->name, cPtr->email);
49 } 49 }
@@ -112,6 +112,7 @@ void WriteMail::init()
112 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2); 112 grid->addMultiCellWidget( emailInput, 2, 2, 0, 2);
113
113 114
114 addressView = new QListView( widget, "addressView"); 115 addressView = new QListView( widget, "addressView");
115 addressView->addColumn("Email");
116 addressView->addColumn("Name"); 116 addressView->addColumn("Name");
117 addressView->addColumn("EMail");
117 addressView->setAllColumnsShowFocus(TRUE); 118 addressView->setAllColumnsShowFocus(TRUE);