author | alwin <alwin> | 2003-12-09 16:59:57 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-09 16:59:57 (UTC) |
commit | 1999708f1480dbdd19e73671fbd9e422883839b6 (patch) (unidiff) | |
tree | 633887e98f12d63455faa5065c0f6a3cc0fb290d /noncore/net/mail/mainwindow.cpp | |
parent | c6b105a7bf2bfffa847fd84c422ae9a3850c682f (diff) | |
download | opie-1999708f1480dbdd19e73671fbd9e422883839b6.zip opie-1999708f1480dbdd19e73671fbd9e422883839b6.tar.gz opie-1999708f1480dbdd19e73671fbd9e422883839b6.tar.bz2 |
some interface changes
split class defines into more files
Diffstat (limited to 'noncore/net/mail/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 7af7d83..b25db97 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -9,6 +9,8 @@ | |||
9 | #include "defines.h" | 9 | #include "defines.h" |
10 | #include "mainwindow.h" | 10 | #include "mainwindow.h" |
11 | #include "viewmail.h" | 11 | #include "viewmail.h" |
12 | #include "mailtypes.h" | ||
13 | #include "mailistviewitem.h" | ||
12 | 14 | ||
13 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 15 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
14 | : QMainWindow( parent, name, flags ) | 16 | : QMainWindow( parent, name, flags ) |
@@ -100,7 +102,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
100 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, | 102 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, |
101 | SLOT( displayMail( QListViewItem * ) ) ); | 103 | SLOT( displayMail( QListViewItem * ) ) ); |
102 | 104 | ||
103 | connect(folderView,SIGNAL(refreshMailview(Maillist*)),this,SLOT(refreshMailView(Maillist*))); | 105 | connect(folderView,SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); |
104 | 106 | ||
105 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 107 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
106 | } | 108 | } |
@@ -129,23 +131,14 @@ void MainWindow::slotShowFolders( bool show ) | |||
129 | } | 131 | } |
130 | } | 132 | } |
131 | 133 | ||
132 | void MainWindow::refreshMailView(Maillist*list) | 134 | void MainWindow::refreshMailView(QList<RecMail>*list) |
133 | { | 135 | { |
134 | MailListViewItem*item = 0; | 136 | MailListViewItem*item = 0; |
135 | mailView->clear(); | 137 | mailView->clear(); |
136 | #if 0 | ||
137 | QFont f = mailView->getFont(); | ||
138 | QFont bf = f; | ||
139 | #endif | ||
140 | for (unsigned int i = 0; i < list->count();++i) { | 138 | for (unsigned int i = 0; i < list->count();++i) { |
141 | item = new MailListViewItem(mailView,item); | 139 | item = new MailListViewItem(mailView,item); |
142 | item->storeData(*(list->at(i))); | 140 | item->storeData(*(list->at(i))); |
143 | item->showEntry(); | 141 | item->showEntry(); |
144 | #if 0 | ||
145 | if (!list->at(i)->getFlags().testBit(FLAG_SEEN)) { | ||
146 | item->setFont(bf); | ||
147 | } | ||
148 | #endif | ||
149 | } | 142 | } |
150 | } | 143 | } |
151 | void MainWindow::displayMail(QListViewItem*item) | 144 | void MainWindow::displayMail(QListViewItem*item) |
@@ -153,14 +146,17 @@ void MainWindow::displayMail(QListViewItem*item) | |||
153 | if (!item) return; | 146 | if (!item) return; |
154 | qDebug("View mail"); | 147 | qDebug("View mail"); |
155 | RecMail mail = ((MailListViewItem*)item)->data(); | 148 | RecMail mail = ((MailListViewItem*)item)->data(); |
156 | QString body = folderView->fetchBody(mail); | 149 | RecBody body = folderView->fetchBody(mail); |
157 | 150 | ||
158 | ViewMail readMail( this ); | 151 | ViewMail readMail( this ); |
159 | readMail.setMailInfo( mail.getFrom(), "", mail.getSubject(), "", "", body ); | 152 | readMail.setMailInfo( mail.getFrom(), "", mail.getSubject(), "", "", body.Bodytext() ); |
160 | readMail.showMaximized(); | 153 | readMail.showMaximized(); |
161 | readMail.exec(); | 154 | readMail.exec(); |
155 | } | ||
162 | 156 | ||
163 | qDebug(body ); | 157 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * after ) |
158 | :QListViewItem(parent,after),mail_data() | ||
159 | { | ||
164 | } | 160 | } |
165 | 161 | ||
166 | void MailListViewItem::showEntry() | 162 | void MailListViewItem::showEntry() |
@@ -169,3 +165,13 @@ void MailListViewItem::showEntry() | |||
169 | setText(1,mail_data.getFrom()); | 165 | setText(1,mail_data.getFrom()); |
170 | setText(2,mail_data.getDate()); | 166 | setText(2,mail_data.getDate()); |
171 | } | 167 | } |
168 | |||
169 | void MailListViewItem::storeData(const RecMail&data) | ||
170 | { | ||
171 | mail_data = data; | ||
172 | } | ||
173 | |||
174 | const RecMail& MailListViewItem::data()const | ||
175 | { | ||
176 | return mail_data; | ||
177 | } | ||