summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-12-09 18:02:33 (UTC)
committer harlekin <harlekin>2003-12-09 18:02:33 (UTC)
commit0b7d74768f00be986f44bfbd61a6342fc854cc3a (patch) (unidiff)
tree2e314f0d73e3c720783618870fb6d2e16b4acf3e
parenta30efc4ca72e7689ee35b178d28db82054431fe9 (diff)
downloadopie-0b7d74768f00be986f44bfbd61a6342fc854cc3a.zip
opie-0b7d74768f00be986f44bfbd61a6342fc854cc3a.tar.gz
opie-0b7d74768f00be986f44bfbd61a6342fc854cc3a.tar.bz2
more updates
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/mainwindow.cpp28
-rw-r--r--noncore/net/mail/mainwindow.h3
-rw-r--r--noncore/net/mail/viewmail.cpp39
-rw-r--r--noncore/net/mail/viewmail.h12
4 files changed, 58 insertions, 24 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index b25db97..f19f93d 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -73,11 +73,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
73 73
74 74 layout = new QBoxLayout ( view, QBoxLayout::LeftToRight );
75 QWidget *d = QApplication::desktop();
76 QBoxLayout *layout;
77
78 if ( d->width() < d->height() ) {
79 layout = new QVBoxLayout( view );
80 } else {
81 layout = new QHBoxLayout( view );
82 }
83 75
@@ -101,2 +93,4 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
101 93
94 slotAdjustLayout();
95
102 connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, 96 connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this,
@@ -109,2 +103,15 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
109 103
104
105void MainWindow::slotAdjustLayout() {
106
107 QWidget *d = QApplication::desktop();
108
109 if ( d->width() < d->height() ) {
110 layout->setDirection( QBoxLayout::TopToBottom );
111 } else {
112 layout->setDirection( QBoxLayout::LeftToRight );
113 }
114 delete d;
115}
116
110void MainWindow::slotAdjustColumns() 117void MainWindow::slotAdjustColumns()
@@ -151,3 +158,4 @@ void MainWindow::displayMail(QListViewItem*item)
151 ViewMail readMail( this ); 158 ViewMail readMail( this );
152 readMail.setMailInfo( mail.getFrom(), "", mail.getSubject(), "", "", body.Bodytext() ); 159
160 readMail.setMailInfo( mail.getFrom(), mail.To(), mail.getSubject(), mail.CC(), mail.Bcc(), mail.getDate(), body.Bodytext() );
153 readMail.showMaximized(); 161 readMail.showMaximized();
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h
index 6c87261..6c1cda0 100644
--- a/noncore/net/mail/mainwindow.h
+++ b/noncore/net/mail/mainwindow.h
@@ -28,2 +28,3 @@ protected slots:
28 virtual void displayMail(QListViewItem*); 28 virtual void displayMail(QListViewItem*);
29 void slotAdjustLayout();
29 30
@@ -37,3 +38,3 @@ protected:
37 QListView *mailView; 38 QListView *mailView;
38 39 QBoxLayout *layout;
39}; 40};
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index b648b34..cba9948 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -25,10 +25,11 @@ AttachItem::AttachItem(QListViewItem *parent, AttachItemStore &attachItemStore)
25 25
26void ViewMail::setMailInfo( const QString & from, const QString & to, const QString & subject, const QString & cc, const QString & bcc, const QString & bodytext ) { 26void ViewMail::setMailInfo( const QString & from, const QStringList & to, const QString & subject, const QStringList & cc, const QStringList & bcc, const QString & date, const QString & bodytext ) {
27 27
28m_mail[0] = from; 28m_mail[0] = from;
29m_mail[1] = to; 29m_mail2[0] = to;
30m_mail[2] = subject; 30m_mail[1] = subject;
31m_mail[3] = cc; 31m_mail2[1] = cc;
32m_mail[4] = bcc; 32m_mail2[2] = bcc;
33m_mail[5] = bodytext; 33m_mail[2] = bodytext;
34m_mail[3] = date;
34 35
@@ -56,2 +57,16 @@ void ViewMail::setText()
56 57
58 QString toString;
59 QString ccString;
60 QString bccString;
61
62 for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) {
63 toString += (*it);
64 }
65 for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) {
66 ccString += (*it);
67 }
68 for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) {
69 bccString += (*it);
70 }
71
57 setCaption( caption().arg( m_mail[0] ) ); 72 setCaption( caption().arg( m_mail[0] ) );
@@ -67,10 +82,10 @@ void ViewMail::setText()
67 "<font face=fixed>%7</font>") 82 "<font face=fixed>%7</font>")
68 .arg( deHtml( m_mail[2] ) )
69 .arg( deHtml( m_mail[0] ) )
70 .arg( deHtml( m_mail[1] ) ) 83 .arg( deHtml( m_mail[1] ) )
71 .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( m_mail[3] ) ) ) 84 .arg( deHtml( m_mail[0] ) )
72 .arg( tr("<b>Bcc:</b> %1<br>").arg( deHtml( m_mail[4] ) ) ) 85 .arg( deHtml( toString ) )
73 .arg( tr("(no date)" ) ) 86 .arg( tr("<b>Cc:</b> %1<br>").arg( deHtml( ccString ) ) )
87 .arg( tr("<b>Bcc:</b> %1<br>").arg( deHtml( bccString ) ) )
88 .arg( m_mail[3] )
74 .arg("%1"); 89 .arg("%1");
75 browser->setText( QString(_mailHtml) + deHtml( m_mail[5] ) ); 90 browser->setText( QString(_mailHtml) + deHtml( m_mail[2] ) );
76} 91}
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h
index 9d3c6e4..615939a 100644
--- a/noncore/net/mail/viewmail.h
+++ b/noncore/net/mail/viewmail.h
@@ -5,2 +5,3 @@
5#include <qmap.h> 5#include <qmap.h>
6#include <qstringlist.h>
6 7
@@ -51,3 +52,3 @@ public:
51 static QString appName() { return QString::fromLatin1("mail"); } 52 static QString appName() { return QString::fromLatin1("mail"); }
52 void setMailInfo( const QString & from, const QString & to, const QString & subject, const QString & cc, const QString & bcc, const QString & bodytext ); 53 void setMailInfo( const QString & from, const QStringList & to, const QString & subject, const QStringList & cc, const QStringList & bcc,const QString & date, const QString & bodytext );
53 54
@@ -70,3 +71,12 @@ private:
70 bool _gotBody; 71 bool _gotBody;
72
73 // 0 from
74 // 1 subject
75 // 2 bodytext
76 // 3 date
71 QMap <int,QString> m_mail; 77 QMap <int,QString> m_mail;
78 // 0 to
79 // 1 cc
80 // 2 bcc
81 QMap <int,QStringList> m_mail2;
72 82