summaryrefslogtreecommitdiff
path: root/noncore/net
Unidiff
Diffstat (limited to 'noncore/net') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/config.in2
-rw-r--r--noncore/net/mail/libmailwrapper/.cvsignore6
-rw-r--r--noncore/net/mail/libmailwrapper/config.in4
-rw-r--r--noncore/net/mail/libmailwrapper/libmailwrapper.pro44
-rw-r--r--noncore/net/mail/libmailwrapper/mailwrapper.cpp15
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp12
-rw-r--r--noncore/net/mail/libmailwrapper/smtpwrapper.cpp4
-rw-r--r--noncore/net/mail/mail.pro26
-rw-r--r--noncore/net/mail/mainwindow.cpp1
9 files changed, 84 insertions, 30 deletions
diff --git a/noncore/net/mail/config.in b/noncore/net/mail/config.in
index 43ecc6f..b5173ae 100644
--- a/noncore/net/mail/config.in
+++ b/noncore/net/mail/config.in
@@ -1,4 +1,4 @@
1 config MAIL3 1 config MAIL3
2 boolean "opie-mail3 (a mail client)" 2 boolean "opie-mail3 (a mail client)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && LIBMAILWRAPPER
diff --git a/noncore/net/mail/libmailwrapper/.cvsignore b/noncore/net/mail/libmailwrapper/.cvsignore
new file mode 100644
index 0000000..581c299
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/.cvsignore
@@ -0,0 +1,6 @@
1logindialogui.cpp
2logindialogui.h
3sendmailprogressui.cpp
4sendmailprogressui.h
5.moc
6Makefile
diff --git a/noncore/net/mail/libmailwrapper/config.in b/noncore/net/mail/libmailwrapper/config.in
new file mode 100644
index 0000000..790891e
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/config.in
@@ -0,0 +1,4 @@
1 config LIBMAILWRAPPER
2 boolean "libmailwrapper ( wrapper arround libetpan needed by mail3"
3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE
diff --git a/noncore/net/mail/libmailwrapper/libmailwrapper.pro b/noncore/net/mail/libmailwrapper/libmailwrapper.pro
new file mode 100644
index 0000000..4b4a4f1
--- a/dev/null
+++ b/noncore/net/mail/libmailwrapper/libmailwrapper.pro
@@ -0,0 +1,44 @@
1TEMPLATE = lib
2CONFIG += qt warn_on debug
3
4HEADERS = mailwrapper.h \
5 imapwrapper.h \
6 mailtypes.h \
7 pop3wrapper.h \
8 abstractmail.h \
9 smtpwrapper.h \
10 genericwrapper.h \
11 mboxwrapper.h \
12 settings.h \
13 logindialog.h \
14 sendmailprogress.h
15
16SOURCES = imapwrapper.cpp \
17 mailwrapper.cpp \
18 mailtypes.cpp \
19 pop3wrapper.cpp \
20 abstractmail.cpp \
21 smtpwrapper.cpp \
22 genericwrapper.cpp \
23 mboxwrapper.cpp \
24 settings.cpp \
25 logindialog.cpp \
26 sendmailprogress.cpp
27
28 INTERFACES = logindialogui.ui \
29 sendmailprogressui.ui
30
31
32INCLUDEPATH += $(OPIEDIR)/include
33
34CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
35contains( CONFTEST, y ){
36 LIBS += -lqpe -letpan -lssl -lcrypto -liconv
37}else{
38 LIBS += -lqpe -letpan -lssl -lcrypto
39}
40
41DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
42TARGET = mailwrapper
43
44include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
index 9398823..75b9343 100644
--- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp
@@ -1,59 +1,70 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <sys/types.h> 3#include <sys/types.h>
4#include <unistd.h> 4#include <unistd.h>
5#include <fcntl.h> 5#include <fcntl.h>
6#include <string.h> 6#include <string.h>
7#include <qdir.h> 7#include <qdir.h>
8 8
9#include "mailwrapper.h" 9#include "mailwrapper.h"
10#include "logindialog.h" 10//#include "logindialog.h"
11#include "defines.h" 11//#include "defines.h"
12
13#define UNDEFINED 64
14#define MAXLINE 76
15#define UTF16MASK 0x03FFUL
16#define UTF16SHIFT 10
17#define UTF16BASE 0x10000UL
18#define UTF16HIGHSTART 0xD800UL
19#define UTF16HIGHEND 0xDBFFUL
20#define UTF16LOSTART 0xDC00UL
21#define UTF16LOEND 0xDFFFUL
22
12 23
13Attachment::Attachment( DocLnk lnk ) 24Attachment::Attachment( DocLnk lnk )
14{ 25{
15 doc = lnk; 26 doc = lnk;
16 size = QFileInfo( doc.file() ).size(); 27 size = QFileInfo( doc.file() ).size();
17} 28}
18 29
19Folder::Folder(const QString&tmp_name, const QString&sep ) 30Folder::Folder(const QString&tmp_name, const QString&sep )
20{ 31{
21 name = tmp_name; 32 name = tmp_name;
22 nameDisplay = name; 33 nameDisplay = name;
23 separator = sep; 34 separator = sep;
24} 35}
25 36
26const QString& Folder::Separator()const 37const QString& Folder::Separator()const
27{ 38{
28 return separator; 39 return separator;
29} 40}
30 41
31IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no_inf, const QString&prefix ) 42IMAPFolder::IMAPFolder(const QString&name,const QString&sep, bool select,bool no_inf, const QString&prefix )
32 : Folder( name,sep ),m_MaySelect(select),m_NoInferior(no_inf) 43 : Folder( name,sep ),m_MaySelect(select),m_NoInferior(no_inf)
33{ 44{
34 // Decode IMAP foldername 45 // Decode IMAP foldername
35 nameDisplay = IMAPFolder::decodeFolderName( name ); 46 nameDisplay = IMAPFolder::decodeFolderName( name );
36 qDebug( "folder " + name + " - displayed as " + nameDisplay ); 47 qDebug( "folder " + name + " - displayed as " + nameDisplay );
37 48
38 if (prefix.length()>0) { 49 if (prefix.length()>0) {
39 if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) { 50 if (nameDisplay.startsWith(prefix) && nameDisplay.length()>prefix.length()) {
40 nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length()); 51 nameDisplay=nameDisplay.right(nameDisplay.length()-prefix.length());
41 } 52 }
42 } 53 }
43} 54}
44 55
45static unsigned char base64chars[] = 56static unsigned char base64chars[] =
46 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,"; 57 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,";
47 58
48/** 59/**
49 * Decodes base64 encoded parts of the imapfolder name 60 * Decodes base64 encoded parts of the imapfolder name
50 * Code taken from kde cvs: kdebase/kioslave/imap4/rfcdecoder.cc 61 * Code taken from kde cvs: kdebase/kioslave/imap4/rfcdecoder.cc
51 */ 62 */
52QString IMAPFolder::decodeFolderName( const QString &name ) 63QString IMAPFolder::decodeFolderName( const QString &name )
53{ 64{
54 unsigned char c, i, bitcount; 65 unsigned char c, i, bitcount;
55 unsigned long ucs4, utf16, bitbuf; 66 unsigned long ucs4, utf16, bitbuf;
56 unsigned char base64[256], utf8[6]; 67 unsigned char base64[256], utf8[6];
57 unsigned long srcPtr = 0; 68 unsigned long srcPtr = 0;
58 QCString dst = ""; 69 QCString dst = "";
59 QCString src = name.ascii(); 70 QCString src = name.ascii();
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp
index 17aa1b0..c5187f5 100644
--- a/noncore/net/mail/libmailwrapper/settings.cpp
+++ b/noncore/net/mail/libmailwrapper/settings.cpp
@@ -1,55 +1,65 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <qdir.h> 2#include <qdir.h>
3 3
4#include <qpe/config.h> 4#include <qpe/config.h>
5 5
6#include "settings.h" 6#include "settings.h"
7#include "defines.h" 7//#include "defines.h"
8
9#define IMAP_PORT "143"
10#define IMAP_SSL_PORT "993"
11#define SMTP_PORT "25"
12#define SMTP_SSL_PORT "465"
13#define POP3_PORT "110"
14#define POP3_SSL_PORT "995"
15#define NNTP_PORT "119"
16#define NNTP_SSL_PORT "563"
17
8 18
9Settings::Settings() 19Settings::Settings()
10 : QObject() 20 : QObject()
11{ 21{
12 updateAccounts(); 22 updateAccounts();
13} 23}
14 24
15void Settings::checkDirectory() 25void Settings::checkDirectory()
16{ 26{
17 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) { 27 if ( !QDir( (QString) getenv( "HOME" ) + "/Applications/opiemail/" ).exists() ) {
18 system( "mkdir -p $HOME/Applications/opiemail" ); 28 system( "mkdir -p $HOME/Applications/opiemail" );
19 qDebug( "$HOME/Applications/opiemail created" ); 29 qDebug( "$HOME/Applications/opiemail created" );
20 } 30 }
21} 31}
22 32
23QList<Account> Settings::getAccounts() 33QList<Account> Settings::getAccounts()
24{ 34{
25 return accounts; 35 return accounts;
26} 36}
27 37
28void Settings::addAccount( Account *account ) 38void Settings::addAccount( Account *account )
29{ 39{
30 accounts.append( account ); 40 accounts.append( account );
31} 41}
32 42
33void Settings::delAccount( Account *account ) 43void Settings::delAccount( Account *account )
34{ 44{
35 accounts.remove( account ); 45 accounts.remove( account );
36 account->remove(); 46 account->remove();
37} 47}
38 48
39void Settings::updateAccounts() 49void Settings::updateAccounts()
40{ 50{
41 accounts.clear(); 51 accounts.clear();
42 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" ); 52 QDir dir( (QString) getenv( "HOME" ) + "/Applications/opiemail" );
43 QStringList::Iterator it; 53 QStringList::Iterator it;
44 54
45 QStringList imap = dir.entryList( "imap-*" ); 55 QStringList imap = dir.entryList( "imap-*" );
46 for ( it = imap.begin(); it != imap.end(); it++ ) { 56 for ( it = imap.begin(); it != imap.end(); it++ ) {
47 qDebug( "Added IMAP account" ); 57 qDebug( "Added IMAP account" );
48 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") ); 58 IMAPaccount *account = new IMAPaccount( (*it).replace(0, 5, "") );
49 accounts.append( account ); 59 accounts.append( account );
50 } 60 }
51 61
52 QStringList pop3 = dir.entryList( "pop3-*" ); 62 QStringList pop3 = dir.entryList( "pop3-*" );
53 for ( it = pop3.begin(); it != pop3.end(); it++ ) { 63 for ( it = pop3.begin(); it != pop3.end(); it++ ) {
54 qDebug( "Added POP account" ); 64 qDebug( "Added POP account" );
55 POP3account *account = new POP3account( (*it).replace(0, 5, "") ); 65 POP3account *account = new POP3account( (*it).replace(0, 5, "") );
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
index 7e03af9..b9c4ff2 100644
--- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp
@@ -1,70 +1,72 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <sys/stat.h> 2#include <sys/stat.h>
3#include <sys/types.h> 3#include <sys/types.h>
4#include <unistd.h> 4#include <unistd.h>
5#include <fcntl.h> 5#include <fcntl.h>
6#include <string.h> 6#include <string.h>
7#include <qdir.h> 7#include <qdir.h>
8#include <qt.h> 8#include <qt.h>
9 9
10#include <qpe/config.h> 10#include <qpe/config.h>
11#include <qpe/qcopenvelope_qws.h> 11#include <qpe/qcopenvelope_qws.h>
12 12
13#include <libetpan/libetpan.h> 13#include <libetpan/libetpan.h>
14 14
15#include "smtpwrapper.h" 15#include "smtpwrapper.h"
16#include "mailwrapper.h" 16#include "mailwrapper.h"
17#include "mboxwrapper.h" 17#include "mboxwrapper.h"
18#include "logindialog.h" 18#include "logindialog.h"
19#include "mailtypes.h" 19#include "mailtypes.h"
20#include "defines.h" 20//#include "defines.h"
21#include "sendmailprogress.h" 21#include "sendmailprogress.h"
22 22
23#define USER_AGENT "OpieMail v0.1"
24
23progressMailSend*SMTPwrapper::sendProgress = 0; 25progressMailSend*SMTPwrapper::sendProgress = 0;
24 26
25SMTPwrapper::SMTPwrapper( Settings *s ) 27SMTPwrapper::SMTPwrapper( Settings *s )
26 : QObject() 28 : QObject()
27{ 29{
28 settings = s; 30 settings = s;
29 Config cfg( "mail" ); 31 Config cfg( "mail" );
30 cfg.setGroup( "Status" ); 32 cfg.setGroup( "Status" );
31 m_queuedMail = cfg.readNumEntry( "outgoing", 0 ); 33 m_queuedMail = cfg.readNumEntry( "outgoing", 0 );
32 emit queuedMails( m_queuedMail ); 34 emit queuedMails( m_queuedMail );
33 connect( this, SIGNAL( queuedMails( int ) ), this, SLOT( emitQCop( int ) ) ); 35 connect( this, SIGNAL( queuedMails( int ) ), this, SLOT( emitQCop( int ) ) );
34} 36}
35 37
36void SMTPwrapper::emitQCop( int queued ) { 38void SMTPwrapper::emitQCop( int queued ) {
37 QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" ); 39 QCopEnvelope env( "QPE/Pim", "outgoingMails(int)" );
38 env << queued; 40 env << queued;
39} 41}
40 42
41QString SMTPwrapper::mailsmtpError( int errnum ) 43QString SMTPwrapper::mailsmtpError( int errnum )
42{ 44{
43 switch ( errnum ) { 45 switch ( errnum ) {
44 case MAILSMTP_NO_ERROR: 46 case MAILSMTP_NO_ERROR:
45 return tr( "No error" ); 47 return tr( "No error" );
46 case MAILSMTP_ERROR_UNEXPECTED_CODE: 48 case MAILSMTP_ERROR_UNEXPECTED_CODE:
47 return tr( "Unexpected error code" ); 49 return tr( "Unexpected error code" );
48 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE: 50 case MAILSMTP_ERROR_SERVICE_NOT_AVAILABLE:
49 return tr( "Service not available" ); 51 return tr( "Service not available" );
50 case MAILSMTP_ERROR_STREAM: 52 case MAILSMTP_ERROR_STREAM:
51 return tr( "Stream error" ); 53 return tr( "Stream error" );
52 case MAILSMTP_ERROR_HOSTNAME: 54 case MAILSMTP_ERROR_HOSTNAME:
53 return tr( "gethostname() failed" ); 55 return tr( "gethostname() failed" );
54 case MAILSMTP_ERROR_NOT_IMPLEMENTED: 56 case MAILSMTP_ERROR_NOT_IMPLEMENTED:
55 return tr( "Not implemented" ); 57 return tr( "Not implemented" );
56 case MAILSMTP_ERROR_ACTION_NOT_TAKEN: 58 case MAILSMTP_ERROR_ACTION_NOT_TAKEN:
57 return tr( "Error, action not taken" ); 59 return tr( "Error, action not taken" );
58 case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION: 60 case MAILSMTP_ERROR_EXCEED_STORAGE_ALLOCATION:
59 return tr( "Data exceeds storage allocation" ); 61 return tr( "Data exceeds storage allocation" );
60 case MAILSMTP_ERROR_IN_PROCESSING: 62 case MAILSMTP_ERROR_IN_PROCESSING:
61 return tr( "Error in processing" ); 63 return tr( "Error in processing" );
62 // case MAILSMTP_ERROR_INSUFFISANT_SYSTEM_STORAGE: 64 // case MAILSMTP_ERROR_INSUFFISANT_SYSTEM_STORAGE:
63 // return tr( "Insufficient system storage" ); 65 // return tr( "Insufficient system storage" );
64 case MAILSMTP_ERROR_MAILBOX_UNAVAILABLE: 66 case MAILSMTP_ERROR_MAILBOX_UNAVAILABLE:
65 return tr( "Mailbox unavailable" ); 67 return tr( "Mailbox unavailable" );
66 case MAILSMTP_ERROR_MAILBOX_NAME_NOT_ALLOWED: 68 case MAILSMTP_ERROR_MAILBOX_NAME_NOT_ALLOWED:
67 return tr( "Mailbox name not allowed" ); 69 return tr( "Mailbox name not allowed" );
68 case MAILSMTP_ERROR_BAD_SEQUENCE_OF_COMMAND: 70 case MAILSMTP_ERROR_BAD_SEQUENCE_OF_COMMAND:
69 return tr( "Bad command sequence" ); 71 return tr( "Bad command sequence" );
70 case MAILSMTP_ERROR_USER_NOT_LOCAL: 72 case MAILSMTP_ERROR_USER_NOT_LOCAL:
diff --git a/noncore/net/mail/mail.pro b/noncore/net/mail/mail.pro
index 2c15a7b..69e1450 100644
--- a/noncore/net/mail/mail.pro
+++ b/noncore/net/mail/mail.pro
@@ -1,76 +1,52 @@
1CONFIG += qt warn_on debug quick-app 1CONFIG += qt warn_on debug quick-app
2 2
3HEADERS = defines.h \ 3HEADERS = defines.h \
4 logindialog.h \
5 settings.h \
6 editaccounts.h \ 4 editaccounts.h \
7 mailwrapper.h \
8 composemail.h \ 5 composemail.h \
9 accountview.h \ 6 accountview.h \
10 mainwindow.h \ 7 mainwindow.h \
11 viewmail.h \ 8 viewmail.h \
12 viewmailbase.h \ 9 viewmailbase.h \
13 opiemail.h \ 10 opiemail.h \
14 imapwrapper.h \
15 mailtypes.h \
16 mailistviewitem.h \ 11 mailistviewitem.h \
17 pop3wrapper.h \
18 abstractmail.h \
19 settingsdialog.h \ 12 settingsdialog.h \
20 statuswidget.h \ 13 statuswidget.h \
21 smtpwrapper.h \
22 genericwrapper.h \
23 mboxwrapper.h \
24 sendmailprogress.h \
25 newmaildir.h 14 newmaildir.h
26 15
27SOURCES = main.cpp \ 16SOURCES = main.cpp \
28 opiemail.cpp \ 17 opiemail.cpp \
29 mainwindow.cpp \ 18 mainwindow.cpp \
30 accountview.cpp \ 19 accountview.cpp \
31 composemail.cpp \ 20 composemail.cpp \
32 mailwrapper.cpp \
33 imapwrapper.cpp \
34 addresspicker.cpp \ 21 addresspicker.cpp \
35 editaccounts.cpp \ 22 editaccounts.cpp \
36 logindialog.cpp \
37 viewmail.cpp \ 23 viewmail.cpp \
38 viewmailbase.cpp \ 24 viewmailbase.cpp \
39 settings.cpp \
40 mailtypes.cpp \
41 pop3wrapper.cpp \
42 abstractmail.cpp \
43 settingsdialog.cpp \ 25 settingsdialog.cpp \
44 statuswidget.cpp \ 26 statuswidget.cpp \
45 smtpwrapper.cpp \
46 genericwrapper.cpp \
47 mboxwrapper.cpp \
48 sendmailprogress.cpp \
49 newmaildir.cpp 27 newmaildir.cpp
50 28
51INTERFACES = editaccountsui.ui \ 29INTERFACES = editaccountsui.ui \
52 selectmailtypeui.ui \ 30 selectmailtypeui.ui \
53 imapconfigui.ui \ 31 imapconfigui.ui \
54 pop3configui.ui \ 32 pop3configui.ui \
55 nntpconfigui.ui \ 33 nntpconfigui.ui \
56 smtpconfigui.ui \ 34 smtpconfigui.ui \
57 addresspickerui.ui \ 35 addresspickerui.ui \
58 logindialogui.ui \
59 composemailui.ui \ 36 composemailui.ui \
60 settingsdialogui.ui \ 37 settingsdialogui.ui \
61 statuswidgetui.ui \ 38 statuswidgetui.ui \
62 sendmailprogressui.ui \
63 newmaildirui.ui 39 newmaildirui.ui
64 40
65INCLUDEPATH += $(OPIEDIR)/include 41INCLUDEPATH += $(OPIEDIR)/include
66 42
67CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX ) 43CONFTEST = $$system( echo $CONFIG_TARGET_MACOSX )
68contains( CONFTEST, y ){ 44contains( CONFTEST, y ){
69 LIBS += -lqpe -letpan -lssl -lcrypto -lopie -liconv 45 LIBS += -lqpe -letpan -lssl -lcrypto -lopie -liconv
70}else{ 46}else{
71 LIBS += -lqpe -letpan -lssl -lcrypto -lopie 47 LIBS += -lqpe -lopie -llibmailwrapper
72} 48}
73 49
74TARGET = opiemail 50TARGET = opiemail
75 51
76include ( $(OPIEDIR)/include.pro ) 52include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp
index 2a74286..6511b1f 100644
--- a/noncore/net/mail/mainwindow.cpp
+++ b/noncore/net/mail/mainwindow.cpp
@@ -1,69 +1,70 @@
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 "viewmail.h" 14#include "viewmail.h"
15#include "mailtypes.h" 15#include "mailtypes.h"
16#include "mailistviewitem.h" 16#include "mailistviewitem.h"
17 17
18 18
19MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 19MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
20 : QMainWindow( parent, name, flags ) 20 : QMainWindow( parent, name, flags )
21{ 21{
22
22 setCaption( tr( "Mail" ) ); 23 setCaption( tr( "Mail" ) );
23 setToolBarsMovable( false ); 24 setToolBarsMovable( false );
24 25
25 toolBar = new QToolBar( this ); 26 toolBar = new QToolBar( this );
26 menuBar = new QMenuBar( toolBar ); 27 menuBar = new QMenuBar( toolBar );
27 mailMenu = new QPopupMenu( menuBar ); 28 mailMenu = new QPopupMenu( menuBar );
28 menuBar->insertItem( tr( "Mail" ), mailMenu ); 29 menuBar->insertItem( tr( "Mail" ), mailMenu );
29 settingsMenu = new QPopupMenu( menuBar ); 30 settingsMenu = new QPopupMenu( menuBar );
30 menuBar->insertItem( tr( "Settings" ), settingsMenu ); 31 menuBar->insertItem( tr( "Settings" ), settingsMenu );
31 32
32 addToolBar( toolBar ); 33 addToolBar( toolBar );
33 toolBar->setHorizontalStretchable( true ); 34 toolBar->setHorizontalStretchable( true );
34 35
35 QLabel *spacer = new QLabel( toolBar ); 36 QLabel *spacer = new QLabel( toolBar );
36 spacer->setBackgroundMode( QWidget::PaletteButton ); 37 spacer->setBackgroundMode( QWidget::PaletteButton );
37 toolBar->setStretchableWidget( spacer ); 38 toolBar->setStretchableWidget( spacer );
38 39
39 composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL, 40 composeMail = new QAction( tr( "Compose new mail" ), ICON_COMPOSEMAIL,
40 0, 0, this ); 41 0, 0, this );
41 composeMail->addTo( toolBar ); 42 composeMail->addTo( toolBar );
42 composeMail->addTo( mailMenu ); 43 composeMail->addTo( mailMenu );
43 44
44 sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED, 45 sendQueued = new QAction( tr( "Send queued mails" ), ICON_SENDQUEUED,
45 0, 0, this ); 46 0, 0, this );
46 sendQueued->addTo( toolBar ); 47 sendQueued->addTo( toolBar );
47 sendQueued->addTo( mailMenu ); 48 sendQueued->addTo( mailMenu );
48 49
49 /* 50 /*
50 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, 51 syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC,
51 0, 0, this ); 52 0, 0, this );
52 syncFolders->addTo( toolBar ); 53 syncFolders->addTo( toolBar );
53 syncFolders->addTo( mailMenu ); 54 syncFolders->addTo( mailMenu );
54 */ 55 */
55 56
56 showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS, 57 showFolders = new QAction( tr( "Show/Hide folders" ), ICON_SHOWFOLDERS,
57 0, 0, this, 0, true ); 58 0, 0, this, 0, true );
58 showFolders->addTo( toolBar ); 59 showFolders->addTo( toolBar );
59 showFolders->addTo( mailMenu ); 60 showFolders->addTo( mailMenu );
60 showFolders->setOn( true ); 61 showFolders->setOn( true );
61 connect(showFolders, SIGNAL( toggled( bool ) ), 62 connect(showFolders, SIGNAL( toggled( bool ) ),
62 SLOT( slotShowFolders( bool ) ) ); 63 SLOT( slotShowFolders( bool ) ) );
63 64
64 /* 65 /*
65 searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS, 66 searchMails = new QAction( tr( "Search mails" ), ICON_SEARCHMAILS,
66 0, 0, this ); 67 0, 0, this );
67 searchMails->addTo( toolBar ); 68 searchMails->addTo( toolBar );
68 searchMails->addTo( mailMenu ); 69 searchMails->addTo( mailMenu );
69 */ 70 */