author | harlekin <harlekin> | 2003-12-20 00:05:37 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-20 00:05:37 (UTC) |
commit | dc088ad432189b4883f7654ef6b2c1e2f69112cc (patch) (unidiff) | |
tree | 090f6afd960e644d7da1fae3b8c8ffa97b669b59 | |
parent | 00a0c8cf03fe746c1e3ba608bf298c8e66d065f9 (diff) | |
download | opie-dc088ad432189b4883f7654ef6b2c1e2f69112cc.zip opie-dc088ad432189b4883f7654ef6b2c1e2f69112cc.tar.gz opie-dc088ad432189b4883f7654ef6b2c1e2f69112cc.tar.bz2 |
- beginning of a settings dialog
- button for switching between html and plain text view of the mail
- hide some unused icons
- completed alwins idea about status icons ( alwin you missed the one that sets the read icon .-) )
- beginning of a status widget
-
-rw-r--r-- | noncore/net/mail/mail.pro | 12 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 24 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.h | 3 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.cpp | 91 | ||||
-rw-r--r-- | noncore/net/mail/viewmail.h | 5 | ||||
-rw-r--r-- | noncore/net/mail/viewmailbase.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/viewmailbase.h | 3 |
8 files changed, 101 insertions, 44 deletions
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro index d058db7..49be889 100644 --- a/noncore/net/mail/mail.pro +++ b/noncore/net/mail/mail.pro | |||
@@ -1,58 +1,64 @@ | |||
1 | CONFIG += qt warn_on debug quick-app | 1 | CONFIG += qt warn_on debug quick-app |
2 | 2 | ||
3 | HEADERS = defines.h \ | 3 | HEADERS = defines.h \ |
4 | logindialog.h \ | 4 | logindialog.h \ |
5 | settings.h \ | 5 | settings.h \ |
6 | editaccounts.h \ | 6 | editaccounts.h \ |
7 | mailwrapper.h \ | 7 | mailwrapper.h \ |
8 | composemail.h \ | 8 | composemail.h \ |
9 | accountview.h \ | 9 | accountview.h \ |
10 | mainwindow.h \ | 10 | mainwindow.h \ |
11 | viewmail.h \ | 11 | viewmail.h \ |
12 | viewmailbase.h \ | 12 | viewmailbase.h \ |
13 | opiemail.h \ | 13 | opiemail.h \ |
14 | imapwrapper.h \ | 14 | imapwrapper.h \ |
15 | mailtypes.h \ | 15 | mailtypes.h \ |
16 | mailistviewitem.h \ | 16 | mailistviewitem.h \ |
17 | pop3wrapper.h \ | 17 | pop3wrapper.h \ |
18 | abstractmail.h | 18 | abstractmail.h \ |
19 | settingsdialog.h \ | ||
20 | statuswidget.h | ||
19 | 21 | ||
20 | SOURCES = main.cpp \ | 22 | SOURCES = main.cpp \ |
21 | opiemail.cpp \ | 23 | opiemail.cpp \ |
22 | mainwindow.cpp \ | 24 | mainwindow.cpp \ |
23 | accountview.cpp \ | 25 | accountview.cpp \ |
24 | composemail.cpp \ | 26 | composemail.cpp \ |
25 | mailwrapper.cpp \ | 27 | mailwrapper.cpp \ |
26 | imapwrapper.cpp \ | 28 | imapwrapper.cpp \ |
27 | addresspicker.cpp \ | 29 | addresspicker.cpp \ |
28 | editaccounts.cpp \ | 30 | editaccounts.cpp \ |
29 | logindialog.cpp \ | 31 | logindialog.cpp \ |
30 | viewmail.cpp \ | 32 | viewmail.cpp \ |
31 | viewmailbase.cpp \ | 33 | viewmailbase.cpp \ |
32 | settings.cpp \ | 34 | settings.cpp \ |
33 | mailtypes.cpp \ | 35 | mailtypes.cpp \ |
34 | pop3wrapper.cpp \ | 36 | pop3wrapper.cpp \ |
35 | abstractmail.cpp | 37 | abstractmail.cpp \ |
38 | settingsdialog.cpp \ | ||
39 | statuswidget.cpp | ||
36 | 40 | ||
37 | INTERFACES = editaccountsui.ui \ | 41 | INTERFACES = editaccountsui.ui \ |
38 | selectmailtypeui.ui \ | 42 | selectmailtypeui.ui \ |
39 | imapconfigui.ui \ | 43 | imapconfigui.ui \ |
40 | pop3configui.ui \ | 44 | pop3configui.ui \ |
41 | nntpconfigui.ui \ | 45 | nntpconfigui.ui \ |
42 | smtpconfigui.ui \ | 46 | smtpconfigui.ui \ |
43 | addresspickerui.ui \ | 47 | addresspickerui.ui \ |
44 | logindialogui.ui \ | 48 | logindialogui.ui \ |
45 | composemailui.ui | 49 | composemailui.ui \ |
50 | settingsdialogui.ui \ | ||
51 | statuswidgetui.ui | ||
46 | 52 | ||
47 | INCLUDEPATH += $(OPIEDIR)/include | 53 | INCLUDEPATH += $(OPIEDIR)/include |
48 | 54 | ||
49 | CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) | 55 | CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) |
50 | contains( CONFTEST, y ){ | 56 | contains( CONFTEST, y ){ |
51 | LIBS += -lqpe -letpan -lssl -lcrypto -lopie -liconv | 57 | LIBS += -lqpe -letpan -lssl -lcrypto -lopie -liconv |
52 | }else{ | 58 | }else{ |
53 | LIBS += -lqpe -letpan -lssl -lcrypto -lopie | 59 | LIBS += -lqpe -letpan -lssl -lcrypto -lopie |
54 | } | 60 | } |
55 | 61 | ||
56 | TARGET = opiemail | 62 | TARGET = opiemail |
57 | 63 | ||
58 | include ( $(OPIEDIR)/include.pro ) | 64 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 9a37510..d3b9c34 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -1,260 +1,278 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qvbox.h> | 2 | #include <qvbox.h> |
3 | #include <qheader.h> | 3 | #include <qheader.h> |
4 | #include <qtimer.h> | 4 | #include <qtimer.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | #include <qmessagebox.h> | 6 | #include <qmessagebox.h> |
7 | #include <qtextstream.h> | 7 | #include <qtextstream.h> |
8 | 8 | ||
9 | #include <qpe/qpeapplication.h> | 9 | #include <qpe/qpeapplication.h> |
10 | #include <qpe/resource.h> | 10 | #include <qpe/resource.h> |
11 | 11 | ||
12 | #include "defines.h" | 12 | #include "defines.h" |
13 | #include "mainwindow.h" | 13 | #include "mainwindow.h" |
14 | #include "settingsdialog.h" | ||
14 | #include "viewmail.h" | 15 | #include "viewmail.h" |
15 | #include "mailtypes.h" | 16 | #include "mailtypes.h" |
16 | #include "mailistviewitem.h" | 17 | #include "mailistviewitem.h" |
17 | 18 | ||
19 | |||
18 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 20 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
19 | : QMainWindow( parent, name, flags ) | 21 | : QMainWindow( parent, name, flags ) |
20 | { | 22 | { |
21 | setCaption( tr( "Mail" ) ); | 23 | setCaption( tr( "Mail" ) ); |
22 | setToolBarsMovable( false ); | 24 | setToolBarsMovable( false ); |
23 | 25 | ||
24 | toolBar = new QToolBar( this ); | 26 | toolBar = new QToolBar( this ); |
25 | menuBar = new QMenuBar( toolBar ); | 27 | menuBar = new QMenuBar( toolBar ); |
26 | mailMenu = new QPopupMenu( menuBar ); | 28 | mailMenu = new QPopupMenu( menuBar ); |
27 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 29 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
28 | settingsMenu = new QPopupMenu( menuBar ); | 30 | settingsMenu = new QPopupMenu( menuBar ); |
29 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 31 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
30 | 32 | ||
31 | addToolBar( toolBar ); | 33 | addToolBar( toolBar ); |
32 | toolBar->setHorizontalStretchable( true ); | 34 | toolBar->setHorizontalStretchable( true ); |
33 | 35 | ||
34 | QLabel *spacer = new QLabel( toolBar ); | 36 | QLabel *spacer = new QLabel( toolBar ); |
35 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 37 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
36 | toolBar->setStretchableWidget( spacer ); | 38 | toolBar->setStretchableWidget( spacer ); |
37 | 39 | ||
38 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, | 40 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, |
39 | 0, 0, this ); | 41 | 0, 0, this ); |
40 | composeMail->addTo( toolBar ); | 42 | composeMail->addTo( toolBar ); |
41 | composeMail->addTo( mailMenu ); | 43 | composeMail->addTo( mailMenu ); |
42 | 44 | ||
43 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, | 45 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, |
44 | 0, 0, this ); | 46 | 0, 0, this ); |
45 | sendQueued->addTo( toolBar ); | 47 | sendQueued->addTo( toolBar ); |
46 | sendQueued->addTo( mailMenu ); | 48 | sendQueued->addTo( mailMenu ); |
47 | 49 | ||
50 | /* | ||
48 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 51 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
49 | 0, 0, this ); | 52 | 0, 0, this ); |
50 | syncFolders->addTo( toolBar ); | 53 | syncFolders->addTo( toolBar ); |
51 | syncFolders->addTo( mailMenu ); | 54 | syncFolders->addTo( mailMenu ); |
55 | */ | ||
52 | 56 | ||
53 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, | 57 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, |
54 | 0, 0, this, 0, true ); | 58 | 0, 0, this, 0, true ); |
55 | showFolders->addTo( toolBar ); | 59 | showFolders->addTo( toolBar ); |
56 | showFolders->addTo( mailMenu ); | 60 | showFolders->addTo( mailMenu ); |
57 | showFolders->setOn( true ); | 61 | showFolders->setOn( true ); |
58 | connect(showFolders, SIGNAL( toggled( bool ) ), | 62 | connect(showFolders, SIGNAL( toggled( bool ) ), |
59 | SLOT( slotShowFolders( bool ) ) ); | 63 | SLOT( slotShowFolders( bool ) ) ); |
60 | 64 | ||
61 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, | 65 | /* |
66 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, | ||
62 | 0, 0, this ); | 67 | 0, 0, this ); |
63 | searchMails->addTo( toolBar ); | 68 | searchMails->addTo( toolBar ); |
64 | searchMails->addTo( mailMenu ); | 69 | searchMails->addTo( mailMenu ); |
70 | */ | ||
65 | 71 | ||
66 | deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); | 72 | deleteMails = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); |
67 | deleteMails->addTo( toolBar ); | 73 | deleteMails->addTo( toolBar ); |
68 | deleteMails->addTo( mailMenu ); | 74 | deleteMails->addTo( mailMenu ); |
69 | connect( deleteMails, SIGNAL( activated() ), | 75 | connect( deleteMails, SIGNAL( activated() ), |
70 | SLOT( slotDeleteMail() ) ); | 76 | SLOT( slotDeleteMail() ) ); |
71 | 77 | ||
72 | editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, | 78 | editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, |
73 | 0, 0, this ); | 79 | 0, 0, this ); |
74 | editSettings->addTo( settingsMenu ); | 80 | editSettings->addTo( settingsMenu ); |
81 | connect( editSettings, SIGNAL( activated() ), | ||
82 | SLOT( slotEditSettings() ) ); | ||
75 | 83 | ||
76 | editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, | 84 | editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, |
77 | 0, 0, this ); | 85 | 0, 0, this ); |
78 | editAccounts->addTo( settingsMenu ); | 86 | editAccounts->addTo( settingsMenu ); |
79 | 87 | ||
80 | QWidget *view = new QWidget( this ); | 88 | QWidget *view = new QWidget( this ); |
81 | setCentralWidget( view ); | 89 | setCentralWidget( view ); |
82 | 90 | ||
83 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); | 91 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); |
84 | 92 | ||
85 | folderView = new AccountView( view ); | 93 | folderView = new AccountView( view ); |
86 | folderView->header()->hide(); | 94 | folderView->header()->hide(); |
87 | folderView->setRootIsDecorated( true ); | 95 | folderView->setRootIsDecorated( true ); |
88 | folderView->addColumn( tr( "Mailbox" ) ); | 96 | folderView->addColumn( tr( "Mailbox" ) ); |
89 | //folderView->hide(); | 97 | //folderView->hide(); |
90 | 98 | ||
91 | layout->addWidget( folderView ); | 99 | layout->addWidget( folderView ); |
92 | 100 | ||
93 | mailView = new QListView( view ); | 101 | mailView = new QListView( view ); |
94 | mailView->addColumn( tr( "" ) ); | 102 | mailView->addColumn( tr( "" ) ); |
95 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 103 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
96 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 104 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
97 | mailView->addColumn( tr( "Size" ),QListView::Manual); | 105 | mailView->addColumn( tr( "Size" ),QListView::Manual); |
98 | mailView->addColumn( tr( "Date" )); | 106 | mailView->addColumn( tr( "Date" )); |
99 | mailView->setAllColumnsShowFocus(true); | 107 | mailView->setAllColumnsShowFocus(true); |
100 | mailView->setSorting(-1); | 108 | mailView->setSorting(-1); |
101 | 109 | ||
110 | statusWidget = new StatusWidget( view ); | ||
111 | |||
102 | layout->addWidget( mailView ); | 112 | layout->addWidget( mailView ); |
113 | layout->addWidget( statusWidget ); | ||
103 | layout->setStretchFactor( folderView, 1 ); | 114 | layout->setStretchFactor( folderView, 1 ); |
104 | layout->setStretchFactor( mailView, 2 ); | 115 | layout->setStretchFactor( mailView, 2 ); |
105 | 116 | ||
117 | |||
106 | slotAdjustLayout(); | 118 | slotAdjustLayout(); |
107 | 119 | ||
108 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, | 120 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, |
109 | SLOT( displayMail( QListViewItem * ) ) ); | 121 | SLOT( displayMail( QListViewItem * ) ) ); |
110 | 122 | ||
111 | connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); | 123 | connect(folderView, SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); |
112 | 124 | ||
113 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 125 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
114 | 126 | ||
115 | } | 127 | } |
116 | 128 | ||
117 | 129 | ||
118 | void MainWindow::slotAdjustLayout() { | 130 | void MainWindow::slotAdjustLayout() { |
119 | 131 | ||
120 | QWidget *d = QApplication::desktop(); | 132 | QWidget *d = QApplication::desktop(); |
121 | 133 | ||
122 | if ( d->width() < d->height() ) { | 134 | if ( d->width() < d->height() ) { |
123 | layout->setDirection( QBoxLayout::TopToBottom ); | 135 | layout->setDirection( QBoxLayout::TopToBottom ); |
124 | } else { | 136 | } else { |
125 | layout->setDirection( QBoxLayout::LeftToRight ); | 137 | layout->setDirection( QBoxLayout::LeftToRight ); |
126 | } | 138 | } |
127 | delete d; | 139 | delete d; |
128 | } | 140 | } |
129 | 141 | ||
130 | void MainWindow::slotAdjustColumns() | 142 | void MainWindow::slotAdjustColumns() |
131 | { | 143 | { |
132 | bool hidden = folderView->isHidden(); | 144 | bool hidden = folderView->isHidden(); |
133 | if ( hidden ) folderView->show(); | 145 | if ( hidden ) folderView->show(); |
134 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 146 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
135 | if ( hidden ) folderView->hide(); | 147 | if ( hidden ) folderView->hide(); |
136 | 148 | ||
137 | mailView->setColumnWidth( 0, 10 ); | 149 | mailView->setColumnWidth( 0, 10 ); |
138 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); | 150 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); |
139 | mailView->setColumnWidth( 2, 80 ); | 151 | mailView->setColumnWidth( 2, 80 ); |
140 | mailView->setColumnWidth( 3, 50 ); | 152 | mailView->setColumnWidth( 3, 50 ); |
141 | mailView->setColumnWidth( 4, 50 ); | 153 | mailView->setColumnWidth( 4, 50 ); |
142 | } | 154 | } |
143 | 155 | ||
156 | void MainWindow::slotEditSettings() { | ||
157 | SettingsDialog settingsDialog( this, 0, true ); | ||
158 | settingsDialog.showMaximized(); | ||
159 | settingsDialog.exec(); | ||
160 | } | ||
161 | |||
144 | void MainWindow::slotShowFolders( bool show ) | 162 | void MainWindow::slotShowFolders( bool show ) |
145 | { | 163 | { |
146 | qDebug( "Show Folders" ); | 164 | qDebug( "Show Folders" ); |
147 | if ( show && folderView->isHidden() ) { | 165 | if ( show && folderView->isHidden() ) { |
148 | qDebug( "-> showing" ); | 166 | qDebug( "-> showing" ); |
149 | folderView->show(); | 167 | folderView->show(); |
150 | } else if ( !show && !folderView->isHidden() ) { | 168 | } else if ( !show && !folderView->isHidden() ) { |
151 | qDebug( "-> hiding" ); | 169 | qDebug( "-> hiding" ); |
152 | folderView->hide(); | 170 | folderView->hide(); |
153 | } | 171 | } |
154 | } | 172 | } |
155 | 173 | ||
156 | void MainWindow::refreshMailView(QList<RecMail>*list) | 174 | void MainWindow::refreshMailView(QList<RecMail>*list) |
157 | { | 175 | { |
158 | MailListViewItem*item = 0; | 176 | MailListViewItem*item = 0; |
159 | mailView->clear(); | 177 | mailView->clear(); |
160 | for (unsigned int i = 0; i < list->count();++i) { | 178 | for (unsigned int i = 0; i < list->count();++i) { |
161 | item = new MailListViewItem(mailView,item); | 179 | item = new MailListViewItem(mailView,item); |
162 | item->storeData(*(list->at(i))); | 180 | item->storeData(*(list->at(i))); |
163 | item->showEntry(); | 181 | item->showEntry(); |
164 | } | 182 | } |
165 | } | 183 | } |
166 | void MainWindow::displayMail(QListViewItem*item) | 184 | void MainWindow::displayMail(QListViewItem*item) |
167 | { | 185 | { |
168 | 186 | ||
169 | if (!item) return; | 187 | if (!item) return; |
170 | RecMail mail = ((MailListViewItem*)item)->data(); | 188 | RecMail mail = ((MailListViewItem*)item)->data(); |
171 | RecBody body = folderView->fetchBody(mail); | 189 | RecBody body = folderView->fetchBody(mail); |
172 | 190 | ||
173 | ViewMail readMail( this ); | 191 | ViewMail readMail( this ); |
174 | readMail.setBody( body ); | 192 | readMail.setBody( body ); |
175 | readMail.setMail( mail ); | 193 | readMail.setMail( mail ); |
176 | readMail.showMaximized(); | 194 | readMail.showMaximized(); |
177 | readMail.exec(); | 195 | readMail.exec(); |
178 | 196 | ||
179 | if ( readMail.deleted ) { | 197 | if ( readMail.deleted ) { |
180 | folderView->refreshCurrent(); | 198 | folderView->refreshCurrent(); |
181 | } else { | 199 | } else { |
182 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); | 200 | ( (MailListViewItem*)item )->setPixmap( 0, Resource::loadPixmap( "") ); |
183 | } | 201 | } |
184 | } | 202 | } |
185 | 203 | ||
186 | void MainWindow::slotDeleteMail() | 204 | void MainWindow::slotDeleteMail() |
187 | { | 205 | { |
188 | if (!mailView->currentItem()) return; | 206 | if (!mailView->currentItem()) return; |
189 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 207 | RecMail mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
190 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail.getFrom() + " - " + mail.getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { | 208 | if ( QMessageBox::warning(this, tr("Delete Mail"), QString( tr("<p>Do you really want to delete this mail? <br><br>" ) + mail.getFrom() + " - " + mail.getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { |
191 | mail.Wrapper()->deleteMail( mail ); | 209 | mail.Wrapper()->deleteMail( mail ); |
192 | folderView->refreshCurrent(); | 210 | folderView->refreshCurrent(); |
193 | } | 211 | } |
194 | } | 212 | } |
195 | 213 | ||
196 | 214 | ||
197 | 215 | ||
198 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) | 216 | MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item ) |
199 | :QListViewItem(parent,item),mail_data() | 217 | :QListViewItem(parent,item),mail_data() |
200 | { | 218 | { |
201 | } | 219 | } |
202 | 220 | ||
203 | void MailListViewItem::showEntry() | 221 | void MailListViewItem::showEntry() |
204 | { | 222 | { |
205 | if ( mail_data.getFlags().testBit( FLAG_ANSWERED ) == true) { | 223 | if ( mail_data.getFlags().testBit( FLAG_ANSWERED ) == true) { |
206 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); | 224 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgreplied") ); |
207 | } else if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { | 225 | } else if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { |
208 | /* I think it looks nicer if there are not such a log of icons but only on mails | 226 | /* I think it looks nicer if there are not such a log of icons but only on mails |
209 | replied or new - Alwin*/ | 227 | replied or new - Alwin*/ |
210 | //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); | 228 | //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); |
211 | } else { | 229 | } else { |
212 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") ); | 230 | setPixmap( 0, Resource::loadPixmap( "mail/kmmsgnew") ); |
213 | } | 231 | } |
214 | double s = mail_data.Msgsize(); | 232 | double s = mail_data.Msgsize(); |
215 | int w; | 233 | int w; |
216 | w=0; | 234 | w=0; |
217 | 235 | ||
218 | while (s>1024) { | 236 | while (s>1024) { |
219 | s/=1024; | 237 | s/=1024; |
220 | ++w; | 238 | ++w; |
221 | if (w>=2) break; | 239 | if (w>=2) break; |
222 | } | 240 | } |
223 | 241 | ||
224 | QString q=""; | 242 | QString q=""; |
225 | QString fsize=""; | 243 | QString fsize=""; |
226 | switch(w) { | 244 | switch(w) { |
227 | case 1: | 245 | case 1: |
228 | q="k"; | 246 | q="k"; |
229 | break; | 247 | break; |
230 | case 2: | 248 | case 2: |
231 | q="M"; | 249 | q="M"; |
232 | break; | 250 | break; |
233 | default: | 251 | default: |
234 | break; | 252 | break; |
235 | } | 253 | } |
236 | 254 | ||
237 | { | 255 | { |
238 | QTextOStream o(&fsize); | 256 | QTextOStream o(&fsize); |
239 | if (w>0) o.precision(2); else o.precision(0); | 257 | if (w>0) o.precision(2); else o.precision(0); |
240 | o.setf(QTextStream::fixed); | 258 | o.setf(QTextStream::fixed); |
241 | o << s << " " << q << "Byte"; | 259 | o << s << " " << q << "Byte"; |
242 | } | 260 | } |
243 | 261 | ||
244 | setText(1,mail_data.getSubject()); | 262 | setText(1,mail_data.getSubject()); |
245 | setText(2,mail_data.getFrom()); | 263 | setText(2,mail_data.getFrom()); |
246 | setText(3,fsize); | 264 | setText(3,fsize); |
247 | setText(4,mail_data.getDate()); | 265 | setText(4,mail_data.getDate()); |
248 | } | 266 | } |
249 | 267 | ||
250 | void MailListViewItem::storeData(const RecMail&data) | 268 | void MailListViewItem::storeData(const RecMail&data) |
251 | { | 269 | { |
252 | mail_data = data; | 270 | mail_data = data; |
253 | } | 271 | } |
254 | 272 | ||
255 | const RecMail& MailListViewItem::data()const | 273 | const RecMail& MailListViewItem::data()const |
256 | { | 274 | { |
257 | return mail_data; | 275 | return mail_data; |
258 | } | 276 | } |
259 | 277 | ||
260 | 278 | ||
diff --git a/noncore/net/mail/mainwindow.h b/noncore/net/mail/mainwindow.h index 21af190..4e4f4bb 100644 --- a/noncore/net/mail/mainwindow.h +++ b/noncore/net/mail/mainwindow.h | |||
@@ -1,43 +1,46 @@ | |||
1 | #ifndef MAINWINDOW_H | 1 | #ifndef MAINWINDOW_H |
2 | #define MAINWINDOW_H | 2 | #define MAINWINDOW_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qaction.h> | 6 | #include <qaction.h> |
7 | 7 | ||
8 | #include <qtoolbar.h> | 8 | #include <qtoolbar.h> |
9 | #include <qmenubar.h> | 9 | #include <qmenubar.h> |
10 | 10 | ||
11 | #include "accountview.h" | 11 | #include "accountview.h" |
12 | #include "statuswidget.h" | ||
12 | 13 | ||
13 | class RecMail; | 14 | class RecMail; |
14 | 15 | ||
15 | class MainWindow : public QMainWindow | 16 | class MainWindow : public QMainWindow |
16 | { | 17 | { |
17 | Q_OBJECT | 18 | Q_OBJECT |
18 | 19 | ||
19 | public: | 20 | public: |
20 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); | 21 | MainWindow( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); |
21 | 22 | ||
22 | public slots: | 23 | public slots: |
23 | void slotAdjustColumns(); | 24 | void slotAdjustColumns(); |
24 | 25 | ||
25 | protected slots: | 26 | protected slots: |
26 | virtual void slotShowFolders( bool show ); | 27 | virtual void slotShowFolders( bool show ); |
27 | virtual void refreshMailView(QList<RecMail>*); | 28 | virtual void refreshMailView(QList<RecMail>*); |
28 | virtual void displayMail(QListViewItem*); | 29 | virtual void displayMail(QListViewItem*); |
29 | virtual void slotDeleteMail(); | 30 | virtual void slotDeleteMail(); |
30 | void slotAdjustLayout(); | 31 | void slotAdjustLayout(); |
32 | void slotEditSettings(); | ||
31 | 33 | ||
32 | protected: | 34 | protected: |
33 | QToolBar *toolBar; | 35 | QToolBar *toolBar; |
36 | StatusWidget *statusWidget; | ||
34 | QMenuBar *menuBar; | 37 | QMenuBar *menuBar; |
35 | QPopupMenu *mailMenu, *settingsMenu; | 38 | QPopupMenu *mailMenu, *settingsMenu; |
36 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, | 39 | QAction *composeMail, *sendQueued, *showFolders, *searchMails, *deleteMails, |
37 | *editSettings, *editAccounts, *syncFolders; | 40 | *editSettings, *editAccounts, *syncFolders; |
38 | AccountView *folderView; | 41 | AccountView *folderView; |
39 | QListView *mailView; | 42 | QListView *mailView; |
40 | QBoxLayout *layout; | 43 | QBoxLayout *layout; |
41 | }; | 44 | }; |
42 | 45 | ||
43 | #endif | 46 | #endif |
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 740e4cf..7ab4e0d 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -1,55 +1,55 @@ | |||
1 | #include "opiemail.h" | 1 | #include "opiemail.h" |
2 | #include "editaccounts.h" | 2 | #include "editaccounts.h" |
3 | #include "composemail.h" | 3 | #include "composemail.h" |
4 | 4 | ||
5 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | 5 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) |
6 | : MainWindow( parent, name, flags ) | 6 | : MainWindow( parent, name, flags ) |
7 | { | 7 | { |
8 | settings = new Settings(); | 8 | settings = new Settings(); |
9 | 9 | ||
10 | folderView->populate( settings->getAccounts() ); | 10 | folderView->populate( settings->getAccounts() ); |
11 | 11 | ||
12 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 12 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
13 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 13 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
14 | connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 14 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
15 | connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); | 15 | connect( editSettings, SIGNAL( activated() ), SLOT( slotEditSettings() ) ); |
16 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 16 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
17 | } | 17 | } |
18 | 18 | ||
19 | void OpieMail::slotComposeMail() | 19 | void OpieMail::slotComposeMail() |
20 | { | 20 | { |
21 | qDebug( "Compose Mail" ); | 21 | qDebug( "Compose Mail" ); |
22 | ComposeMail compose( settings, this, 0 , true ); | 22 | ComposeMail compose( settings, this, 0 , true ); |
23 | compose.showMaximized(); | 23 | compose.showMaximized(); |
24 | compose.slotAdjustColumns(); | 24 | compose.slotAdjustColumns(); |
25 | compose.exec(); | 25 | compose.exec(); |
26 | } | 26 | } |
27 | 27 | ||
28 | void OpieMail::slotSendQueued() | 28 | void OpieMail::slotSendQueued() |
29 | { | 29 | { |
30 | qDebug( "Send Queued" ); | 30 | qDebug( "Send Queued" ); |
31 | } | 31 | } |
32 | 32 | ||
33 | void OpieMail::slotSearchMails() | 33 | void OpieMail::slotSearchMails() |
34 | { | 34 | { |
35 | qDebug( "Search Mails" ); | 35 | qDebug( "Search Mails" ); |
36 | } | 36 | } |
37 | 37 | ||
38 | void OpieMail::slotEditSettings() | 38 | void OpieMail::slotEditSettings() |
39 | { | 39 | { |
40 | qDebug( "Edit Settings" ); | 40 | qDebug( "Edit Settings" ); |
41 | } | 41 | } |
42 | 42 | ||
43 | void OpieMail::slotEditAccounts() | 43 | void OpieMail::slotEditAccounts() |
44 | { | 44 | { |
45 | qDebug( "Edit Accounts" ); | 45 | qDebug( "Edit Accounts" ); |
46 | EditAccounts eaDialog( settings, this, 0, true ); | 46 | EditAccounts eaDialog( settings, this, 0, true ); |
47 | eaDialog.showMaximized(); | 47 | eaDialog.showMaximized(); |
48 | eaDialog.slotAdjustColumns(); | 48 | eaDialog.slotAdjustColumns(); |
49 | eaDialog.exec(); | 49 | eaDialog.exec(); |
50 | if ( settings ) delete settings; | 50 | if ( settings ) delete settings; |
51 | settings = new Settings(); | 51 | settings = new Settings(); |
52 | 52 | ||
53 | folderView->populate( settings->getAccounts() ); | 53 | folderView->populate( settings->getAccounts() ); |
54 | } | 54 | } |
55 | 55 | ||
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp index d86454c..e11fe1f 100644 --- a/noncore/net/mail/viewmail.cpp +++ b/noncore/net/mail/viewmail.cpp | |||
@@ -1,326 +1,347 @@ | |||
1 | #include <qtextbrowser.h> | 1 | #include <qtextbrowser.h> |
2 | #include <qmessagebox.h> | 2 | #include <qmessagebox.h> |
3 | #include <qtextstream.h> | 3 | #include <qtextstream.h> |
4 | #include <qaction.h> | 4 | #include <qaction.h> |
5 | #include <qpopupmenu.h> | 5 | #include <qpopupmenu.h> |
6 | #include <qfile.h> | 6 | #include <qfile.h> |
7 | #include <qapplication.h> | 7 | #include <qapplication.h> |
8 | 8 | ||
9 | #include <qpe/config.h> | ||
10 | |||
9 | #include <opie/ofiledialog.h> | 11 | #include <opie/ofiledialog.h> |
10 | 12 | ||
11 | #include "settings.h" | 13 | #include "settings.h" |
12 | #include "composemail.h" | 14 | #include "composemail.h" |
13 | #include "viewmail.h" | 15 | #include "viewmail.h" |
14 | #include "abstractmail.h" | 16 | #include "abstractmail.h" |
15 | #include "accountview.h" | 17 | #include "accountview.h" |
16 | #include "mailtypes.h" | 18 | #include "mailtypes.h" |
17 | 19 | ||
18 | AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, | 20 | AttachItem::AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, |
19 | const QString&fsize,int num) | 21 | const QString&fsize,int num) |
20 | : QListViewItem(parent,after),_partNum(num) | 22 | : QListViewItem(parent,after),_partNum(num) |
21 | { | 23 | { |
22 | setText(0, mime); | 24 | setText(0, mime); |
23 | setText(1, desc); | 25 | setText(1, desc); |
24 | setText(2, file); | 26 | setText(2, file); |
25 | setText(3, fsize); | 27 | setText(3, fsize); |
26 | } | 28 | } |
27 | 29 | ||
28 | void ViewMail::setBody( RecBody body ) { | 30 | void ViewMail::setBody( RecBody body ) { |
29 | 31 | ||
30 | m_body = body; | 32 | m_body = body; |
31 | m_mail[2] = body.Bodytext(); | 33 | m_mail[2] = body.Bodytext(); |
32 | attachbutton->setEnabled(body.Parts().count()>0); | 34 | attachbutton->setEnabled(body.Parts().count()>0); |
33 | attachments->setEnabled(body.Parts().count()>0); | 35 | attachments->setEnabled(body.Parts().count()>0); |
34 | if (body.Parts().count()==0) { | 36 | if (body.Parts().count()==0) { |
35 | return; | 37 | return; |
36 | } | 38 | } |
37 | AttachItem * curItem=0; | 39 | AttachItem * curItem=0; |
38 | QString type=body.Description().Type()+"/"+body.Description().Subtype(); | 40 | QString type=body.Description().Type()+"/"+body.Description().Subtype(); |
39 | QString desc,fsize; | 41 | QString desc,fsize; |
40 | double s = body.Description().Size(); | 42 | double s = body.Description().Size(); |
41 | int w; | 43 | int w; |
42 | w=0; | 44 | w=0; |
43 | 45 | ||
44 | while (s>1024) { | 46 | while (s>1024) { |
45 | s/=1024; | 47 | s/=1024; |
46 | ++w; | 48 | ++w; |
47 | if (w>=2) break; | 49 | if (w>=2) break; |
48 | } | 50 | } |
49 | 51 | ||
50 | QString q=""; | 52 | QString q=""; |
51 | switch(w) { | 53 | switch(w) { |
52 | case 1: | 54 | case 1: |
53 | q="k"; | 55 | q="k"; |
54 | break; | 56 | break; |
55 | case 2: | 57 | case 2: |
56 | q="M"; | 58 | q="M"; |
57 | break; | 59 | break; |
58 | default: | 60 | default: |
59 | break; | 61 | break; |
60 | } | 62 | } |
61 | 63 | ||
62 | { | 64 | { |
63 | /* I did not found a method to make a CONTENT reset on a QTextStream | 65 | /* I did not found a method to make a CONTENT reset on a QTextStream |
64 | so I use this construct that the stream will re-constructed in each | 66 | so I use this construct that the stream will re-constructed in each |
65 | loop. To let it work, the textstream is packed into a own area of | 67 | loop. To let it work, the textstream is packed into a own area of |
66 | code is it will be destructed after finishing its small job. | 68 | code is it will be destructed after finishing its small job. |
67 | */ | 69 | */ |
68 | QTextOStream o(&fsize); | 70 | QTextOStream o(&fsize); |
69 | if (w>0) o.precision(2); else o.precision(0); | 71 | if (w>0) o.precision(2); else o.precision(0); |
70 | o.setf(QTextStream::fixed); | 72 | o.setf(QTextStream::fixed); |
71 | o << s << " " << q << "Byte"; | 73 | o << s << " " << q << "Byte"; |
72 | } | 74 | } |
73 | 75 | ||
74 | curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1); | 76 | curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1); |
75 | QString filename = ""; | 77 | QString filename = ""; |
76 | for (unsigned int i = 0; i < body.Parts().count();++i) { | 78 | for (unsigned int i = 0; i < body.Parts().count();++i) { |
77 | type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype(); | 79 | type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype(); |
78 | part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin(); | 80 | part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin(); |
79 | for (;it!=body.Parts()[i].Parameters().end();++it) { | 81 | for (;it!=body.Parts()[i].Parameters().end();++it) { |
80 | qDebug(it.key()); | 82 | qDebug(it.key()); |
81 | if (it.key().lower()=="name") { | 83 | if (it.key().lower()=="name") { |
82 | filename=it.data(); | 84 | filename=it.data(); |
83 | } | 85 | } |
84 | } | 86 | } |
85 | s = body.Parts()[i].Size(); | 87 | s = body.Parts()[i].Size(); |
86 | w = 0; | 88 | w = 0; |
87 | while (s>1024) { | 89 | while (s>1024) { |
88 | s/=1024; | 90 | s/=1024; |
89 | ++w; | 91 | ++w; |
90 | if (w>=2) break; | 92 | if (w>=2) break; |
91 | } | 93 | } |
92 | switch(w) { | 94 | switch(w) { |
93 | case 1: | 95 | case 1: |
94 | q="k"; | 96 | q="k"; |
95 | break; | 97 | break; |
96 | case 2: | 98 | case 2: |
97 | q="M"; | 99 | q="M"; |
98 | break; | 100 | break; |
99 | default: | 101 | default: |
100 | q=""; | 102 | q=""; |
101 | break; | 103 | break; |
102 | } | 104 | } |
103 | QTextOStream o(&fsize); | 105 | QTextOStream o(&fsize); |
104 | if (w>0) o.precision(2); else o.precision(0); | 106 | if (w>0) o.precision(2); else o.precision(0); |
105 | o.setf(QTextStream::fixed); | 107 | o.setf(QTextStream::fixed); |
106 | o << s << " " << q << "Byte"; | 108 | o << s << " " << q << "Byte"; |
107 | desc = body.Parts()[i].Description(); | 109 | desc = body.Parts()[i].Description(); |
108 | curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i); | 110 | curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i); |
109 | } | 111 | } |
110 | } | 112 | } |
111 | 113 | ||
114 | |||
115 | void ViewMail::slotShowHtml( bool state ) { | ||
116 | m_showHtml = state; | ||
117 | setText(); | ||
118 | } | ||
119 | |||
112 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { | 120 | void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) { |
113 | if (!item ) | 121 | if (!item ) |
114 | return; | 122 | return; |
115 | 123 | ||
116 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { | 124 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { |
117 | setText(); | 125 | setText(); |
118 | return; | 126 | return; |
119 | } | 127 | } |
120 | QPopupMenu *menu = new QPopupMenu(); | 128 | QPopupMenu *menu = new QPopupMenu(); |
121 | int ret=0; | 129 | int ret=0; |
122 | 130 | ||
123 | if ( item->text( 0 ).left( 5 ) == "text/" ) { | 131 | if ( item->text( 0 ).left( 5 ) == "text/" ) { |
124 | menu->insertItem( tr( "Show Text" ), 1 ); | 132 | menu->insertItem( tr( "Show Text" ), 1 ); |
125 | } | 133 | } |
126 | menu->insertItem( tr( "Save Attachment" ), 0 ); | 134 | menu->insertItem( tr( "Save Attachment" ), 0 ); |
127 | menu->insertSeparator(1); | 135 | menu->insertSeparator(1); |
128 | 136 | ||
129 | ret = menu->exec( point, 0 ); | 137 | ret = menu->exec( point, 0 ); |
130 | 138 | ||
131 | switch(ret) { | 139 | switch(ret) { |
132 | case 0: | 140 | case 0: |
133 | { MimeTypes types; | 141 | { MimeTypes types; |
134 | types.insert( "all", "*" ); | 142 | types.insert( "all", "*" ); |
135 | QString str = OFileDialog::getSaveFileName( 1, | 143 | QString str = OFileDialog::getSaveFileName( 1, |
136 | "/", item->text( 2 ) , types, 0 ); | 144 | "/", item->text( 2 ) , types, 0 ); |
137 | 145 | ||
138 | if( !str.isEmpty() ) { | 146 | if( !str.isEmpty() ) { |
139 | encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); | 147 | encodedString*content = m_recMail.Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ); |
140 | if (content) { | 148 | if (content) { |
141 | QFile output(str); | 149 | QFile output(str); |
142 | output.open(IO_WriteOnly); | 150 | output.open(IO_WriteOnly); |
143 | output.writeBlock(content->Content(),content->Length()); | 151 | output.writeBlock(content->Content(),content->Length()); |
144 | output.close(); | 152 | output.close(); |
145 | delete content; | 153 | delete content; |
146 | } | 154 | } |
147 | } | 155 | } |
148 | } | 156 | } |
149 | break ; | 157 | break ; |
150 | 158 | ||
151 | case 1: | 159 | case 1: |
152 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { | 160 | if ( ( ( AttachItem* )item )->Partnumber() == -1 ) { |
153 | setText(); | 161 | setText(); |
154 | } else { | 162 | } else { |
155 | if ( m_recMail.Wrapper() != 0l ) { // make sure that there is a wrapper , even after delete or simular actions | 163 | if ( m_recMail.Wrapper() != 0l ) { // make sure that there is a wrapper , even after delete or simular actions |
156 | browser->setText( m_recMail.Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); | 164 | browser->setText( m_recMail.Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) ); |
157 | } | 165 | } |
158 | } | 166 | } |
159 | break; | 167 | break; |
160 | } | 168 | } |
161 | delete menu; | 169 | delete menu; |
162 | } | 170 | } |
163 | 171 | ||
164 | 172 | ||
165 | void ViewMail::setMail( RecMail mail ) { | 173 | void ViewMail::setMail( RecMail mail ) { |
166 | 174 | ||
167 | m_recMail = mail; | 175 | m_recMail = mail; |
168 | 176 | ||
169 | m_mail[0] = mail.getFrom(); | 177 | m_mail[0] = mail.getFrom(); |
170 | m_mail[1] = mail.getSubject(); | 178 | m_mail[1] = mail.getSubject(); |
171 | m_mail[3] = mail.getDate(); | 179 | m_mail[3] = mail.getDate(); |
172 | m_mail[4] = mail.Msgid(); | 180 | m_mail[4] = mail.Msgid(); |
173 | 181 | ||
174 | m_mail2[0] = mail.To(); | 182 | m_mail2[0] = mail.To(); |
175 | m_mail2[1] = mail.CC(); | 183 | m_mail2[1] = mail.CC(); |
176 | m_mail2[2] = mail.Bcc(); | 184 | m_mail2[2] = mail.Bcc(); |
177 | 185 | ||
178 | setText(); | 186 | setText(); |
179 | } | 187 | } |
180 | 188 | ||
181 | 189 | ||
182 | 190 | ||
183 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) | 191 | ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl) |
184 | : ViewMailBase(parent, name, fl), _inLoop(false) | 192 | : ViewMailBase(parent, name, fl), _inLoop(false) |
185 | { | 193 | { |
186 | m_gotBody = false; | 194 | m_gotBody = false; |
187 | deleted = false; | 195 | deleted = false; |
188 | 196 | ||
189 | connect(reply, SIGNAL(activated()), SLOT(slotReply())); | 197 | connect( reply, SIGNAL(activated()), SLOT(slotReply())); |
190 | connect(forward, SIGNAL(activated()), SLOT(slotForward())); | 198 | connect( forward, SIGNAL(activated()), SLOT(slotForward())); |
191 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) ); | 199 | connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) ); |
200 | connect( showHtml, SIGNAL( toggled( bool ) ), SLOT( slotShowHtml( bool ) ) ); | ||
192 | 201 | ||
193 | attachments->setEnabled(m_gotBody); | 202 | attachments->setEnabled(m_gotBody); |
194 | connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) ); | 203 | connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) ); |
195 | 204 | ||
205 | readConfig(); | ||
196 | 206 | ||
197 | } | 207 | } |
198 | 208 | ||
209 | void ViewMail::readConfig() { | ||
210 | Config cfg( "mail" ); | ||
211 | cfg.setGroup( "Settings" ); | ||
212 | m_showHtml = cfg.readBoolEntry( "showHtml", false ); | ||
213 | showHtml->setOn( m_showHtml ); | ||
214 | } | ||
215 | |||
199 | void ViewMail::setText() | 216 | void ViewMail::setText() |
200 | { | 217 | { |
201 | 218 | ||
202 | QString toString; | 219 | QString toString; |
203 | QString ccString; | 220 | QString ccString; |
204 | QString bccString; | 221 | QString bccString; |
205 | 222 | ||
206 | for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) { | 223 | for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) { |
207 | toString += (*it); | 224 | toString += (*it); |
208 | } | 225 | } |
209 | for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) { | 226 | for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) { |
210 | ccString += (*it); | 227 | ccString += (*it); |
211 | } | 228 | } |
212 | for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) { | 229 | for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) { |
213 | bccString += (*it); | 230 | bccString += (*it); |
214 | } | 231 | } |
215 | 232 | ||
216 | setCaption( caption().arg( m_mail[0] ) ); | 233 | setCaption( caption().arg( m_mail[0] ) ); |
217 | 234 | ||
218 | m_mailHtml = "<html><body>" | 235 | m_mailHtml = "<html><body>" |
219 | "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" | 236 | "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" |
220 | "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" | 237 | "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" |
221 | "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" | 238 | "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" |
222 | "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" | 239 | "<b>" + tr( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" |
223 | "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + | 240 | "<b>" + tr( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + |
224 | tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" | 241 | tr( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" |
225 | "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] + | 242 | "<b>" + tr( "Date" ) + ": </b> " + m_mail[3] + |
226 | "</td></tr></table><font face=fixed>"; | 243 | "</td></tr></table><font face=fixed>"; |
227 | 244 | ||
245 | if ( !m_showHtml ) { | ||
228 | browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); | 246 | browser->setText( QString( m_mailHtml) + deHtml( m_mail[2] ) + "</font></html>" ); |
229 | // remove later in favor of a real handling | 247 | } else { |
230 | m_gotBody = true; | 248 | browser->setText( QString( m_mailHtml) + m_mail[2] + "</font></html>" ); |
249 | } | ||
250 | // remove later in favor of a real handling | ||
251 | m_gotBody = true; | ||
231 | } | 252 | } |
232 | 253 | ||
233 | 254 | ||
234 | ViewMail::~ViewMail() | 255 | ViewMail::~ViewMail() |
235 | { | 256 | { |
236 | hide(); | 257 | hide(); |
237 | } | 258 | } |
238 | 259 | ||
239 | void ViewMail::hide() | 260 | void ViewMail::hide() |
240 | { | 261 | { |
241 | QWidget::hide(); | 262 | QWidget::hide(); |
242 | 263 | ||
243 | if (_inLoop) { | 264 | if (_inLoop) { |
244 | _inLoop = false; | 265 | _inLoop = false; |
245 | qApp->exit_loop(); | 266 | qApp->exit_loop(); |
246 | 267 | ||
247 | } | 268 | } |
248 | 269 | ||
249 | } | 270 | } |
250 | 271 | ||
251 | void ViewMail::exec() | 272 | void ViewMail::exec() |
252 | { | 273 | { |
253 | show(); | 274 | show(); |
254 | 275 | ||
255 | if (!_inLoop) { | 276 | if (!_inLoop) { |
256 | _inLoop = true; | 277 | _inLoop = true; |
257 | qApp->enter_loop(); | 278 | qApp->enter_loop(); |
258 | } | 279 | } |
259 | 280 | ||
260 | } | 281 | } |
261 | 282 | ||
262 | QString ViewMail::deHtml(const QString &string) | 283 | QString ViewMail::deHtml(const QString &string) |
263 | { | 284 | { |
264 | QString string_ = string; | 285 | QString string_ = string; |
265 | string_.replace(QRegExp("&"), "&"); | 286 | string_.replace(QRegExp("&"), "&"); |
266 | string_.replace(QRegExp("<"), "<"); | 287 | string_.replace(QRegExp("<"), "<"); |
267 | string_.replace(QRegExp(">"), ">"); | 288 | string_.replace(QRegExp(">"), ">"); |
268 | string_.replace(QRegExp("\\n"), "<br>"); | 289 | string_.replace(QRegExp("\\n"), "<br>"); |
269 | return string_; | 290 | return string_; |
270 | } | 291 | } |
271 | 292 | ||
272 | void ViewMail::slotReply() | 293 | void ViewMail::slotReply() |
273 | { | 294 | { |
274 | if (!m_gotBody) { | 295 | if (!m_gotBody) { |
275 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); | 296 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot reply yet."), tr("Ok")); |
276 | return; | 297 | return; |
277 | } | 298 | } |
278 | 299 | ||
279 | QString rtext; | 300 | QString rtext; |
280 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose | 301 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose |
281 | .arg( m_mail[0] ) | 302 | .arg( m_mail[0] ) |
282 | .arg( m_mail[3] ); | 303 | .arg( m_mail[3] ); |
283 | 304 | ||
284 | QString text = m_mail[2]; | 305 | QString text = m_mail[2]; |
285 | QStringList lines = QStringList::split(QRegExp("\\n"), text); | 306 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
286 | QStringList::Iterator it; | 307 | QStringList::Iterator it; |
287 | for (it = lines.begin(); it != lines.end(); it++) { | 308 | for (it = lines.begin(); it != lines.end(); it++) { |
288 | rtext += "> " + *it + "\n"; | 309 | rtext += "> " + *it + "\n"; |
289 | } | 310 | } |
290 | rtext += "\n"; | 311 | rtext += "\n"; |
291 | 312 | ||
292 | QString prefix; | 313 | QString prefix; |
293 | if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = ""; | 314 | if ( m_mail[1].find(QRegExp("^Re: *$")) != -1) prefix = ""; |
294 | else prefix = "Re: "; // no i18n on purpose | 315 | else prefix = "Re: "; // no i18n on purpose |
295 | 316 | ||
296 | Settings *settings = new Settings(); | 317 | Settings *settings = new Settings(); |
297 | ComposeMail composer( settings ,this, 0, true); | 318 | ComposeMail composer( settings ,this, 0, true); |
298 | composer.setTo( m_mail[0] ); | 319 | composer.setTo( m_mail[0] ); |
299 | composer.setSubject( "Re: " + m_mail[1] ); | 320 | composer.setSubject( "Re: " + m_mail[1] ); |
300 | composer.setMessage( rtext ); | 321 | composer.setMessage( rtext ); |
301 | composer.showMaximized(); | 322 | composer.showMaximized(); |
302 | if ( QDialog::Accepted==composer.exec()) { | 323 | if ( QDialog::Accepted==composer.exec()) { |
303 | m_recMail.Wrapper()->answeredMail(m_recMail); | 324 | m_recMail.Wrapper()->answeredMail(m_recMail); |
304 | } | 325 | } |
305 | } | 326 | } |
306 | 327 | ||
307 | void ViewMail::slotForward() | 328 | void ViewMail::slotForward() |
308 | { | 329 | { |
309 | if (!m_gotBody) { | 330 | if (!m_gotBody) { |
310 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); | 331 | QMessageBox::information(this, tr("Error"), tr("<p>The mail body is not yet downloaded, so you cannot forward yet."), tr("Ok")); |
311 | return; | 332 | return; |
312 | } | 333 | } |
313 | 334 | ||
314 | QString ftext; | 335 | QString ftext; |
315 | ftext += QString("\n----- Forwarded message from %1 -----\n\n") | 336 | ftext += QString("\n----- Forwarded message from %1 -----\n\n") |
316 | .arg( m_mail[0] ); | 337 | .arg( m_mail[0] ); |
317 | if (!m_mail[3].isNull()) | 338 | if (!m_mail[3].isNull()) |
318 | ftext += QString("Date: %1\n") | 339 | ftext += QString("Date: %1\n") |
319 | .arg( m_mail[3] ); | 340 | .arg( m_mail[3] ); |
320 | if (!m_mail[0].isNull()) | 341 | if (!m_mail[0].isNull()) |
321 | ftext += QString("From: %1\n") | 342 | ftext += QString("From: %1\n") |
322 | .arg( m_mail[0] ); | 343 | .arg( m_mail[0] ); |
323 | if (!m_mail[1].isNull()) | 344 | if (!m_mail[1].isNull()) |
324 | ftext += QString("Subject: %1\n") | 345 | ftext += QString("Subject: %1\n") |
325 | .arg( m_mail[1] ); | 346 | .arg( m_mail[1] ); |
326 | 347 | ||
diff --git a/noncore/net/mail/viewmail.h b/noncore/net/mail/viewmail.h index dd7f854..bf7a4dd 100644 --- a/noncore/net/mail/viewmail.h +++ b/noncore/net/mail/viewmail.h | |||
@@ -1,61 +1,64 @@ | |||
1 | #ifndef VIEWMAIL_H | 1 | #ifndef VIEWMAIL_H |
2 | #define VIEWMAIL_H | 2 | #define VIEWMAIL_H |
3 | 3 | ||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | #include <qmap.h> | 5 | #include <qmap.h> |
6 | #include <qstringlist.h> | 6 | #include <qstringlist.h> |
7 | 7 | ||
8 | #include "viewmailbase.h" | 8 | #include "viewmailbase.h" |
9 | #include "mailtypes.h" | 9 | #include "mailtypes.h" |
10 | 10 | ||
11 | class AttachItem : public QListViewItem | 11 | class AttachItem : public QListViewItem |
12 | { | 12 | { |
13 | public: | 13 | public: |
14 | AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, | 14 | AttachItem(QListView * parent,QListViewItem *after, const QString&mime,const QString&desc,const QString&file, |
15 | const QString&fsize,int num); | 15 | const QString&fsize,int num); |
16 | int Partnumber() { return _partNum; } | 16 | int Partnumber() { return _partNum; } |
17 | 17 | ||
18 | private: | 18 | private: |
19 | int _partNum; | 19 | int _partNum; |
20 | }; | 20 | }; |
21 | 21 | ||
22 | class ViewMail : public ViewMailBase | 22 | class ViewMail : public ViewMailBase |
23 | { | 23 | { |
24 | Q_OBJECT | 24 | Q_OBJECT |
25 | 25 | ||
26 | public: | 26 | public: |
27 | ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = Qt::WType_Modal); | 27 | ViewMail( QWidget *parent = 0, const char *name = 0, WFlags fl = Qt::WType_Modal); |
28 | ~ViewMail(); | 28 | ~ViewMail(); |
29 | 29 | ||
30 | void hide(); | 30 | void hide(); |
31 | void exec(); | 31 | void exec(); |
32 | void setMail( RecMail mail ); | 32 | void setMail( RecMail mail ); |
33 | void setBody( RecBody body ); | 33 | void setBody( RecBody body ); |
34 | bool deleted; | 34 | bool deleted; |
35 | 35 | ||
36 | protected: | 36 | protected: |
37 | QString deHtml(const QString &string); | 37 | QString deHtml(const QString &string); |
38 | 38 | ||
39 | protected slots: | 39 | protected slots: |
40 | void slotReply(); | 40 | void slotReply(); |
41 | void slotForward(); | 41 | void slotForward(); |
42 | void setText(); | 42 | void setText(); |
43 | void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); | 43 | void slotItemClicked( QListViewItem * item , const QPoint & point, int c ); |
44 | void slotDeleteMail( ); | 44 | void slotDeleteMail( ); |
45 | 45 | void slotShowHtml( bool ); | |
46 | 46 | ||
47 | private: | 47 | private: |
48 | void readConfig(); | ||
49 | |||
48 | bool _inLoop; | 50 | bool _inLoop; |
49 | QString m_mailHtml; | 51 | QString m_mailHtml; |
50 | bool m_gotBody; | 52 | bool m_gotBody; |
51 | RecBody m_body; | 53 | RecBody m_body; |
52 | RecMail m_recMail; | 54 | RecMail m_recMail; |
55 | bool m_showHtml; | ||
53 | 56 | ||
54 | // 0 from 1 subject 2 bodytext 3 date | 57 | // 0 from 1 subject 2 bodytext 3 date |
55 | QMap <int,QString> m_mail; | 58 | QMap <int,QString> m_mail; |
56 | // 0 to 1 cc 2 bcc | 59 | // 0 to 1 cc 2 bcc |
57 | QMap <int,QStringList> m_mail2; | 60 | QMap <int,QStringList> m_mail2; |
58 | 61 | ||
59 | }; | 62 | }; |
60 | 63 | ||
61 | #endif | 64 | #endif |
diff --git a/noncore/net/mail/viewmailbase.cpp b/noncore/net/mail/viewmailbase.cpp index 0c7f671..e69617d 100644 --- a/noncore/net/mail/viewmailbase.cpp +++ b/noncore/net/mail/viewmailbase.cpp | |||
@@ -1,77 +1,82 @@ | |||
1 | #include <qtextbrowser.h> | 1 | #include <qtextbrowser.h> |
2 | #include <qlistview.h> | 2 | #include <qlistview.h> |
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qlabel.h> | 4 | #include <qlabel.h> |
5 | #include <qvbox.h> | 5 | #include <qvbox.h> |
6 | #include <qpopupmenu.h> | 6 | #include <qpopupmenu.h> |
7 | 7 | ||
8 | #include <qpe/qpetoolbar.h> | 8 | #include <qpe/qpetoolbar.h> |
9 | #include <qmenubar.h> | 9 | #include <qmenubar.h> |
10 | #include <qpe/resource.h> | 10 | #include <qpe/resource.h> |
11 | 11 | ||
12 | #include "viewmailbase.h" | 12 | #include "viewmailbase.h" |
13 | //#include "opendiag.h" | 13 | //#include "opendiag.h" |
14 | 14 | ||
15 | ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) | 15 | ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) |
16 | : QMainWindow(parent, name, fl) | 16 | : QMainWindow(parent, name, fl) |
17 | { | 17 | { |
18 | setCaption(tr("E-Mail by %1")); | 18 | setCaption(tr("E-Mail by %1")); |
19 | setToolBarsMovable(false); | 19 | setToolBarsMovable(false); |
20 | 20 | ||
21 | toolbar = new QToolBar(this); | 21 | toolbar = new QToolBar(this); |
22 | menubar = new QMenuBar( toolbar ); | 22 | menubar = new QMenuBar( toolbar ); |
23 | mailmenu = new QPopupMenu( menubar ); | 23 | mailmenu = new QPopupMenu( menubar ); |
24 | menubar->insertItem( tr( "Mail" ), mailmenu ); | 24 | menubar->insertItem( tr( "Mail" ), mailmenu ); |
25 | 25 | ||
26 | toolbar->setHorizontalStretchable(true); | 26 | toolbar->setHorizontalStretchable(true); |
27 | addToolBar(toolbar); | 27 | addToolBar(toolbar); |
28 | 28 | ||
29 | QLabel *spacer = new QLabel(toolbar); | 29 | QLabel *spacer = new QLabel(toolbar); |
30 | spacer->setBackgroundMode(QWidget::PaletteButton); | 30 | spacer->setBackgroundMode(QWidget::PaletteButton); |
31 | toolbar->setStretchableWidget(spacer); | 31 | toolbar->setStretchableWidget(spacer); |
32 | 32 | ||
33 | reply = new QAction(tr("Reply"), QIconSet(Resource::loadPixmap("mail/reply")), 0, 0, this); | 33 | reply = new QAction(tr("Reply"), QIconSet(Resource::loadPixmap("mail/reply")), 0, 0, this); |
34 | reply->addTo(toolbar); | 34 | reply->addTo(toolbar); |
35 | reply->addTo(mailmenu); | 35 | reply->addTo(mailmenu); |
36 | 36 | ||
37 | forward = new QAction(tr("Forward"), QIconSet(Resource::loadPixmap("mail/forward")), 0, 0, this); | 37 | forward = new QAction(tr("Forward"), QIconSet(Resource::loadPixmap("mail/forward")), 0, 0, this); |
38 | forward->addTo(toolbar); | 38 | forward->addTo(toolbar); |
39 | forward->addTo(mailmenu); | 39 | forward->addTo(mailmenu); |
40 | 40 | ||
41 | attachbutton = new QAction(tr("Attachments"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); | 41 | attachbutton = new QAction(tr("Attachments"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); |
42 | attachbutton->addTo(toolbar); | 42 | attachbutton->addTo(toolbar); |
43 | attachbutton->addTo(mailmenu); | 43 | attachbutton->addTo(mailmenu); |
44 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); | 44 | connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); |
45 | 45 | ||
46 | |||
47 | showHtml = new QAction( tr( "Show Html" ), QIconSet( Resource::loadPixmap( "mail/attach" ) ), 0, 0, this, 0, true ); | ||
48 | showHtml->addTo( toolbar ); | ||
49 | showHtml->addTo( mailmenu ); | ||
50 | |||
46 | deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); | 51 | deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); |
47 | deleteMail->addTo(toolbar); | 52 | deleteMail->addTo(toolbar); |
48 | deleteMail->addTo(mailmenu); | 53 | deleteMail->addTo(mailmenu); |
49 | 54 | ||
50 | QVBox *view = new QVBox(this); | 55 | QVBox *view = new QVBox(this); |
51 | setCentralWidget(view); | 56 | setCentralWidget(view); |
52 | 57 | ||
53 | attachments = new QListView(view); | 58 | attachments = new QListView(view); |
54 | attachments->setMinimumHeight(90); | 59 | attachments->setMinimumHeight(90); |
55 | attachments->setMaximumHeight(90); | 60 | attachments->setMaximumHeight(90); |
56 | attachments->setAllColumnsShowFocus(true); | 61 | attachments->setAllColumnsShowFocus(true); |
57 | attachments->addColumn("Mime Type", 60); | 62 | attachments->addColumn("Mime Type", 60); |
58 | attachments->addColumn(tr("Description"), 100); | 63 | attachments->addColumn(tr("Description"), 100); |
59 | attachments->addColumn(tr("Filename"), 80); | 64 | attachments->addColumn(tr("Filename"), 80); |
60 | attachments->addColumn(tr("Size"), 80); | 65 | attachments->addColumn(tr("Size"), 80); |
61 | attachments->setSorting(-1); | 66 | attachments->setSorting(-1); |
62 | attachments->hide(); | 67 | attachments->hide(); |
63 | 68 | ||
64 | browser = new QTextBrowser(view); | 69 | browser = new QTextBrowser(view); |
65 | 70 | ||
66 | //openDiag = new OpenDiag(view); | 71 | //openDiag = new OpenDiag(view); |
67 | //openDiag->hide(); | 72 | //openDiag->hide(); |
68 | 73 | ||
69 | } | 74 | } |
70 | 75 | ||
71 | void ViewMailBase::slotChangeAttachview(bool state) | 76 | void ViewMailBase::slotChangeAttachview(bool state) |
72 | { | 77 | { |
73 | if (state) attachments->show(); | 78 | if (state) attachments->show(); |
74 | else attachments->hide(); | 79 | else attachments->hide(); |
75 | } | 80 | } |
76 | 81 | ||
77 | 82 | ||
diff --git a/noncore/net/mail/viewmailbase.h b/noncore/net/mail/viewmailbase.h index 898522e..6d2a5b2 100644 --- a/noncore/net/mail/viewmailbase.h +++ b/noncore/net/mail/viewmailbase.h | |||
@@ -1,36 +1,37 @@ | |||
1 | #ifndef VIEWMAILBASE_H | 1 | #ifndef VIEWMAILBASE_H |
2 | #define VIEWMAILBASE_H | 2 | #define VIEWMAILBASE_H |
3 | 3 | ||
4 | #include <qmainwindow.h> | 4 | #include <qmainwindow.h> |
5 | 5 | ||
6 | class QAction; | 6 | class QAction; |
7 | class OpenDiag; | 7 | class OpenDiag; |
8 | class QListView; | 8 | class QListView; |
9 | class QToolBar; | 9 | class QToolBar; |
10 | class QTextBrowser; | 10 | class QTextBrowser; |
11 | class QMenuBar; | 11 | class QMenuBar; |
12 | class QPopupMenu; | 12 | class QPopupMenu; |
13 | 13 | ||
14 | class ViewMailBase : public QMainWindow | 14 | class ViewMailBase : public QMainWindow |
15 | { | 15 | { |
16 | Q_OBJECT | 16 | Q_OBJECT |
17 | 17 | ||
18 | public: | 18 | public: |
19 | ViewMailBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); | 19 | ViewMailBase(QWidget *parent = 0, const char *name = 0, WFlags fl = 0); |
20 | 20 | ||
21 | protected: | 21 | protected: |
22 | QAction *reply, *forward, *attachbutton, *deleteMail; | 22 | QAction *reply, *forward, *attachbutton, *deleteMail, *showHtml; |
23 | QListView *attachments; | 23 | QListView *attachments; |
24 | QToolBar *toolbar; | 24 | QToolBar *toolbar; |
25 | QTextBrowser *browser; | 25 | QTextBrowser *browser; |
26 | OpenDiag *openDiag; | 26 | OpenDiag *openDiag; |
27 | QMenuBar *menubar; | 27 | QMenuBar *menubar; |
28 | QPopupMenu *mailmenu; | 28 | QPopupMenu *mailmenu; |
29 | 29 | ||
30 | protected slots: | 30 | protected slots: |
31 | void slotChangeAttachview(bool state); | 31 | void slotChangeAttachview(bool state); |
32 | 32 | ||
33 | |||
33 | }; | 34 | }; |
34 | 35 | ||
35 | #endif | 36 | #endif |
36 | 37 | ||