-rw-r--r-- | noncore/net/mail/mail.pro | 2 | ||||
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 1 |
2 files changed, 0 insertions, 3 deletions
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro index 098817a..c913826 100644 --- a/noncore/net/mail/mail.pro +++ b/noncore/net/mail/mail.pro | |||
@@ -1,42 +1,40 @@ | |||
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 | readmailgui.h \ | ||
12 | opiemail.h | 11 | opiemail.h |
13 | 12 | ||
14 | SOURCES = main.cpp \ | 13 | SOURCES = main.cpp \ |
15 | opiemail.cpp \ | 14 | opiemail.cpp \ |
16 | mainwindow.cpp \ | 15 | mainwindow.cpp \ |
17 | accountview.cpp \ | 16 | accountview.cpp \ |
18 | composemail.cpp \ | 17 | composemail.cpp \ |
19 | mailwrapper.cpp \ | 18 | mailwrapper.cpp \ |
20 | imapwrapper.cpp \ | 19 | imapwrapper.cpp \ |
21 | addresspicker.cpp \ | 20 | addresspicker.cpp \ |
22 | editaccounts.cpp \ | 21 | editaccounts.cpp \ |
23 | logindialog.cpp \ | 22 | logindialog.cpp \ |
24 | readmailgui.cpp \ | ||
25 | settings.cpp | 23 | settings.cpp |
26 | 24 | ||
27 | INTERFACES = editaccountsui.ui \ | 25 | INTERFACES = editaccountsui.ui \ |
28 | selectmailtypeui.ui \ | 26 | selectmailtypeui.ui \ |
29 | imapconfigui.ui \ | 27 | imapconfigui.ui \ |
30 | pop3configui.ui \ | 28 | pop3configui.ui \ |
31 | nntpconfigui.ui \ | 29 | nntpconfigui.ui \ |
32 | smtpconfigui.ui \ | 30 | smtpconfigui.ui \ |
33 | addresspickerui.ui \ | 31 | addresspickerui.ui \ |
34 | logindialogui.ui \ | 32 | logindialogui.ui \ |
35 | composemailui.ui | 33 | composemailui.ui |
36 | 34 | ||
37 | INCLUDEPATH += $(OPIEDIR)/include | 35 | INCLUDEPATH += $(OPIEDIR)/include |
38 | INCLUDEPATH += $(OPIEDIR)/include/libetpan | 36 | INCLUDEPATH += $(OPIEDIR)/include/libetpan |
39 | LIBS += -lqpe -lopie -letpan -lssl -lcrypto -ldb | 37 | LIBS += -lqpe -lopie -letpan -lssl -lcrypto -ldb |
40 | TARGET = opiemail | 38 | TARGET = opiemail |
41 | 39 | ||
42 | include ( $(OPIEDIR)/include.pro ) | 40 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 0a433a0..28111d0 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -1,151 +1,150 @@ | |||
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 | 5 | ||
6 | #include <qpe/resource.h> | 6 | #include <qpe/resource.h> |
7 | 7 | ||
8 | #include "defines.h" | 8 | #include "defines.h" |
9 | #include "readmailgui.h" | ||
10 | #include "mainwindow.h" | 9 | #include "mainwindow.h" |
11 | 10 | ||
12 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 11 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
13 | : QMainWindow( parent, name, flags ) | 12 | : QMainWindow( parent, name, flags ) |
14 | { | 13 | { |
15 | setCaption( tr( "Opie-Mail" ) ); | 14 | setCaption( tr( "Opie-Mail" ) ); |
16 | setToolBarsMovable( false ); | 15 | setToolBarsMovable( false ); |
17 | 16 | ||
18 | toolBar = new QToolBar( this ); | 17 | toolBar = new QToolBar( this ); |
19 | menuBar = new QMenuBar( toolBar ); | 18 | menuBar = new QMenuBar( toolBar ); |
20 | mailMenu = new QPopupMenu( menuBar ); | 19 | mailMenu = new QPopupMenu( menuBar ); |
21 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 20 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
22 | settingsMenu = new QPopupMenu( menuBar ); | 21 | settingsMenu = new QPopupMenu( menuBar ); |
23 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 22 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
24 | 23 | ||
25 | addToolBar( toolBar ); | 24 | addToolBar( toolBar ); |
26 | toolBar->setHorizontalStretchable( true ); | 25 | toolBar->setHorizontalStretchable( true ); |
27 | 26 | ||
28 | QLabel *spacer = new QLabel( toolBar ); | 27 | QLabel *spacer = new QLabel( toolBar ); |
29 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 28 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
30 | toolBar->setStretchableWidget( spacer ); | 29 | toolBar->setStretchableWidget( spacer ); |
31 | 30 | ||
32 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, | 31 | composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, |
33 | 0, 0, this ); | 32 | 0, 0, this ); |
34 | composeMail->addTo( toolBar ); | 33 | composeMail->addTo( toolBar ); |
35 | composeMail->addTo( mailMenu ); | 34 | composeMail->addTo( mailMenu ); |
36 | 35 | ||
37 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, | 36 | sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, |
38 | 0, 0, this ); | 37 | 0, 0, this ); |
39 | sendQueued->addTo( toolBar ); | 38 | sendQueued->addTo( toolBar ); |
40 | sendQueued->addTo( mailMenu ); | 39 | sendQueued->addTo( mailMenu ); |
41 | 40 | ||
42 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 41 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
43 | 0, 0, this ); | 42 | 0, 0, this ); |
44 | syncFolders->addTo( toolBar ); | 43 | syncFolders->addTo( toolBar ); |
45 | syncFolders->addTo( mailMenu ); | 44 | syncFolders->addTo( mailMenu ); |
46 | 45 | ||
47 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, | 46 | showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, |
48 | 0, 0, this, 0, true ); | 47 | 0, 0, this, 0, true ); |
49 | showFolders->addTo( toolBar ); | 48 | showFolders->addTo( toolBar ); |
50 | showFolders->addTo( mailMenu ); | 49 | showFolders->addTo( mailMenu ); |
51 | connect(showFolders, SIGNAL( toggled( bool ) ), | 50 | connect(showFolders, SIGNAL( toggled( bool ) ), |
52 | SLOT( slotShowFolders( bool ) ) ); | 51 | SLOT( slotShowFolders( bool ) ) ); |
53 | 52 | ||
54 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, | 53 | searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, |
55 | 0, 0, this ); | 54 | 0, 0, this ); |
56 | searchMails->addTo( toolBar ); | 55 | searchMails->addTo( toolBar ); |
57 | searchMails->addTo( mailMenu ); | 56 | searchMails->addTo( mailMenu ); |
58 | 57 | ||
59 | 58 | ||
60 | editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, | 59 | editSettings = new QAction( tr( "Edit settings" ), ICON_EDITSETTINGS, |
61 | 0, 0, this ); | 60 | 0, 0, this ); |
62 | editSettings->addTo( settingsMenu ); | 61 | editSettings->addTo( settingsMenu ); |
63 | 62 | ||
64 | editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, | 63 | editAccounts = new QAction( tr( "Configure accounts" ), ICON_EDITACCOUNTS, |
65 | 0, 0, this ); | 64 | 0, 0, this ); |
66 | editAccounts->addTo( settingsMenu ); | 65 | editAccounts->addTo( settingsMenu ); |
67 | 66 | ||
68 | QVBox *view = new QVBox( this ); | 67 | QVBox *view = new QVBox( this ); |
69 | setCentralWidget( view ); | 68 | setCentralWidget( view ); |
70 | 69 | ||
71 | folderView = new AccountView( view ); | 70 | folderView = new AccountView( view ); |
72 | folderView->header()->hide(); | 71 | folderView->header()->hide(); |
73 | folderView->setMinimumHeight( 90 ); | 72 | folderView->setMinimumHeight( 90 ); |
74 | folderView->setMaximumHeight( 90 ); | 73 | folderView->setMaximumHeight( 90 ); |
75 | folderView->addColumn( tr( "Mailbox" ) ); | 74 | folderView->addColumn( tr( "Mailbox" ) ); |
76 | folderView->hide(); | 75 | folderView->hide(); |
77 | 76 | ||
78 | mailView = new QListView( view ); | 77 | mailView = new QListView( view ); |
79 | mailView->setMinimumHeight( 50 ); | 78 | mailView->setMinimumHeight( 50 ); |
80 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 79 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
81 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 80 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
82 | mailView->addColumn( tr( "Date" )); | 81 | mailView->addColumn( tr( "Date" )); |
83 | mailView->setAllColumnsShowFocus(true); | 82 | mailView->setAllColumnsShowFocus(true); |
84 | mailView->setSorting(-1); | 83 | mailView->setSorting(-1); |
85 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, | 84 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, |
86 | SLOT( displayMail( QListViewItem * ) ) ); | 85 | SLOT( displayMail( QListViewItem * ) ) ); |
87 | 86 | ||
88 | connect(folderView,SIGNAL(refreshMailview(Maillist*)),this,SLOT(refreshMailView(Maillist*))); | 87 | connect(folderView,SIGNAL(refreshMailview(Maillist*)),this,SLOT(refreshMailView(Maillist*))); |
89 | 88 | ||
90 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 89 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
91 | } | 90 | } |
92 | 91 | ||
93 | void MainWindow::slotAdjustColumns() | 92 | void MainWindow::slotAdjustColumns() |
94 | { | 93 | { |
95 | bool hidden = folderView->isHidden(); | 94 | bool hidden = folderView->isHidden(); |
96 | if ( hidden ) folderView->show(); | 95 | if ( hidden ) folderView->show(); |
97 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 96 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
98 | if ( hidden ) folderView->hide(); | 97 | if ( hidden ) folderView->hide(); |
99 | 98 | ||
100 | mailView->setColumnWidth( 0, mailView->visibleWidth() - 130 ); | 99 | mailView->setColumnWidth( 0, mailView->visibleWidth() - 130 ); |
101 | mailView->setColumnWidth( 1, 80 ); | 100 | mailView->setColumnWidth( 1, 80 ); |
102 | mailView->setColumnWidth( 2, 50 ); | 101 | mailView->setColumnWidth( 2, 50 ); |
103 | } | 102 | } |
104 | 103 | ||
105 | void MainWindow::slotShowFolders( bool show ) | 104 | void MainWindow::slotShowFolders( bool show ) |
106 | { | 105 | { |
107 | qDebug( "Show Folders" ); | 106 | qDebug( "Show Folders" ); |
108 | if ( show && folderView->isHidden() ) { | 107 | if ( show && folderView->isHidden() ) { |
109 | qDebug( "-> showing" ); | 108 | qDebug( "-> showing" ); |
110 | folderView->show(); | 109 | folderView->show(); |
111 | } else if ( !show && !folderView->isHidden() ) { | 110 | } else if ( !show && !folderView->isHidden() ) { |
112 | qDebug( "-> hiding" ); | 111 | qDebug( "-> hiding" ); |
113 | folderView->hide(); | 112 | folderView->hide(); |
114 | } | 113 | } |
115 | } | 114 | } |
116 | 115 | ||
117 | void MainWindow::refreshMailView(Maillist*list) | 116 | void MainWindow::refreshMailView(Maillist*list) |
118 | { | 117 | { |
119 | MailListViewItem*item = 0; | 118 | MailListViewItem*item = 0; |
120 | mailView->clear(); | 119 | mailView->clear(); |
121 | #if 0 | 120 | #if 0 |
122 | QFont f = mailView->getFont(); | 121 | QFont f = mailView->getFont(); |
123 | QFont bf = f; | 122 | QFont bf = f; |
124 | #endif | 123 | #endif |
125 | for (unsigned int i = 0; i < list->count();++i) { | 124 | for (unsigned int i = 0; i < list->count();++i) { |
126 | item = new MailListViewItem(mailView,item); | 125 | item = new MailListViewItem(mailView,item); |
127 | item->storeData(*(list->at(i))); | 126 | item->storeData(*(list->at(i))); |
128 | item->showEntry(); | 127 | item->showEntry(); |
129 | #if 0 | 128 | #if 0 |
130 | if (!list->at(i)->getFlags().testBit(FLAG_SEEN)) { | 129 | if (!list->at(i)->getFlags().testBit(FLAG_SEEN)) { |
131 | item->setFont(bf); | 130 | item->setFont(bf); |
132 | } | 131 | } |
133 | #endif | 132 | #endif |
134 | } | 133 | } |
135 | } | 134 | } |
136 | void MainWindow::displayMail(QListViewItem*item) | 135 | void MainWindow::displayMail(QListViewItem*item) |
137 | { | 136 | { |
138 | if (!item) return; | 137 | if (!item) return; |
139 | qDebug("View mail"); | 138 | qDebug("View mail"); |
140 | RecMail mail = ((MailListViewItem*)item)->data(); | 139 | RecMail mail = ((MailListViewItem*)item)->data(); |
141 | QString body = folderView->fetchBody(mail); | 140 | QString body = folderView->fetchBody(mail); |
142 | 141 | ||
143 | qDebug(body); | 142 | qDebug(body); |
144 | } | 143 | } |
145 | 144 | ||
146 | void MailListViewItem::showEntry() | 145 | void MailListViewItem::showEntry() |
147 | { | 146 | { |
148 | setText(0,mail_data.getSubject()); | 147 | setText(0,mail_data.getSubject()); |
149 | setText(1,mail_data.getFrom()); | 148 | setText(1,mail_data.getFrom()); |
150 | setText(2,mail_data.getDate()); | 149 | setText(2,mail_data.getDate()); |
151 | } | 150 | } |