author | zautrix <zautrix> | 2004-07-05 18:01:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-05 18:01:38 (UTC) |
commit | 6a826e654102e78abb6d14f80a3679575e5d3c9a (patch) (unidiff) | |
tree | 0dbc28b69c3b7614bd7c528034e8c1ef4b815de0 | |
parent | 9a90061115ee2cac8adc5b2d21e607b6c5c9b890 (diff) | |
download | kdepimpi-6a826e654102e78abb6d14f80a3679575e5d3c9a.zip kdepimpi-6a826e654102e78abb6d14f80a3679575e5d3c9a.tar.gz kdepimpi-6a826e654102e78abb6d14f80a3679575e5d3c9a.tar.bz2 |
WSTYLE changes in mail
-rw-r--r-- | kmicromail/main.cpp | 13 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 2 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 2 |
3 files changed, 8 insertions, 9 deletions
diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp index a4f6a06..8a093c6 100644 --- a/kmicromail/main.cpp +++ b/kmicromail/main.cpp | |||
@@ -1,58 +1,57 @@ | |||
1 | 1 | ||
2 | #ifndef DESKTOP_VERSION | 2 | #ifndef DESKTOP_VERSION |
3 | #include <qpe/qpeapplication.h> | 3 | #include <qpe/qpeapplication.h> |
4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
5 | #else | 5 | #else |
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | #include <qstring.h> | 7 | #include <qstring.h> |
8 | #include <qwindowsstyle.h> | 8 | #include <qwindowsstyle.h> |
9 | #include <qplatinumstyle.h> | 9 | #include <qplatinumstyle.h> |
10 | #include <qsgistyle.h> | 10 | #include <qsgistyle.h> |
11 | #endif | 11 | #endif |
12 | #include "opiemail.h" | 12 | #include "opiemail.h" |
13 | #include <qdir.h> | 13 | #include <qdir.h> |
14 | #include <kstandarddirs.h> | 14 | #include <kstandarddirs.h> |
15 | #include <kglobal.h> | 15 | #include <kglobal.h> |
16 | #include <stdio.h> | 16 | #include <stdio.h> |
17 | #include "mainwindow.h" | 17 | #include "mainwindow.h" |
18 | 18 | ||
19 | using namespace Opie::Core; | 19 | using namespace Opie::Core; |
20 | int main( int argc, char **argv ) { | 20 | int main( int argc, char **argv ) { |
21 | 21 | ||
22 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
23 | QPEApplication a( argc, argv ); | 23 | QPEApplication a( argc, argv ); |
24 | a.setKeepRunning (); | 24 | a.setKeepRunning (); |
25 | #else | 25 | #else |
26 | QApplication a( argc, argv ); | 26 | QApplication a( argc, argv ); |
27 | QApplication::setStyle( new QPlatinumStyle ()); | 27 | QApplication::setStyle( new QPlatinumStyle ()); |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | KGlobal::setAppName( "kmicromail" ); | 30 | KGlobal::setAppName( "kmicromail" ); |
31 | QString fileName ; | 31 | QString fileName ; |
32 | #ifndef DESKTOP_VERSION | 32 | #ifndef DESKTOP_VERSION |
33 | fileName = getenv("QPEDIR"); | 33 | fileName = getenv("QPEDIR"); |
34 | if ( QApplication::desktop()->width() > 320 ) | 34 | if ( QApplication::desktop()->width() > 320 ) |
35 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kmicromail/icons22/"); | 35 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kmicromail/icons22/"); |
36 | else | 36 | else |
37 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kmicromail/"); | 37 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kmicromail/"); |
38 | #else | 38 | #else |
39 | fileName = qApp->applicationDirPath () + "/kdepim/kmicromail/"; | 39 | fileName = qApp->applicationDirPath () + "/kdepim/kmicromail/"; |
40 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 40 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
41 | #endif | 41 | #endif |
42 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kmicromail"))); | 42 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kmicromail"))); |
43 | OpieMail* mw = new OpieMail(); | 43 | OpieMail mw; |
44 | #ifndef DESKTOP_VERSION | 44 | #ifndef DESKTOP_VERSION |
45 | //qDebug("CONNECT "); | 45 | //qDebug("CONNECT "); |
46 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),mw, SLOT(message( const QCString&, const QByteArray& ))); | 46 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& ))); |
47 | a.showMainWidget(mw ); | 47 | a.showMainWidget(&mw ); |
48 | #else | 48 | #else |
49 | a.setMainWidget(mw ); | 49 | a.setMainWidget(&mw ); |
50 | m.show(); | 50 | mw.show(); |
51 | //m.resize( 800, 600 ); | 51 | //m.resize( 800, 600 ); |
52 | #endif | ||
53 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 52 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
53 | #endif | ||
54 | int rv = a.exec(); | 54 | int rv = a.exec(); |
55 | delete mw; | ||
56 | return rv; | 55 | return rv; |
57 | 56 | ||
58 | } | 57 | } |
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index a500dec..cd32c72 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -1,68 +1,68 @@ | |||
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 <kdialog.h> | 6 | #include <kdialog.h> |
7 | #include <kiconloader.h> | 7 | #include <kiconloader.h> |
8 | 8 | ||
9 | #ifndef DESKTOP_VERSION | 9 | #ifndef DESKTOP_VERSION |
10 | #include <qpe/qpeapplication.h> | 10 | #include <qpe/qpeapplication.h> |
11 | #endif | 11 | #endif |
12 | #include "defines.h" | 12 | #include "defines.h" |
13 | #include "mainwindow.h" | 13 | #include "mainwindow.h" |
14 | #include <KDGanttMinimizeSplitter.h> | 14 | #include <KDGanttMinimizeSplitter.h> |
15 | 15 | ||
16 | 16 | ||
17 | #include <kabc/stdaddressbook.h> | 17 | #include <kabc/stdaddressbook.h> |
18 | 18 | ||
19 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 19 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
20 | : QMainWindow( parent, name, flags ) | 20 | : QMainWindow( parent, name ) //, flags ) |
21 | { | 21 | { |
22 | setCaption( tr( "KMicroMail" ) ); | 22 | setCaption( tr( "KMicroMail" ) ); |
23 | setToolBarsMovable( false ); | 23 | setToolBarsMovable( false ); |
24 | KABC::StdAddressBook::self(); | 24 | KABC::StdAddressBook::self(); |
25 | toolBar = new QToolBar( this ); | 25 | toolBar = new QToolBar( this ); |
26 | menuBar = new QMenuBar( toolBar ); | 26 | menuBar = new QMenuBar( toolBar ); |
27 | mailMenu = new QPopupMenu( menuBar ); | 27 | mailMenu = new QPopupMenu( menuBar ); |
28 | menuBar->insertItem( tr( "Mail" ), mailMenu ); | 28 | menuBar->insertItem( tr( "Mail" ), mailMenu ); |
29 | settingsMenu = new QPopupMenu( menuBar ); | 29 | settingsMenu = new QPopupMenu( menuBar ); |
30 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); | 30 | menuBar->insertItem( tr( "Settings" ), settingsMenu ); |
31 | 31 | ||
32 | addToolBar( toolBar ); | 32 | addToolBar( toolBar ); |
33 | toolBar->setHorizontalStretchable( true ); | 33 | toolBar->setHorizontalStretchable( true ); |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | composeMail = new QAction( tr( "Compose new mail" ), SmallIcon("composemail"), | 37 | composeMail = new QAction( tr( "Compose new mail" ), SmallIcon("composemail"), |
38 | 0, 0, this ); | 38 | 0, 0, this ); |
39 | composeMail->addTo( toolBar ); | 39 | composeMail->addTo( toolBar ); |
40 | composeMail->addTo( mailMenu ); | 40 | composeMail->addTo( mailMenu ); |
41 | 41 | ||
42 | sendQueued = new QAction( tr( "Send queued mails" ), SmallIcon("sendqueued") , | 42 | sendQueued = new QAction( tr( "Send queued mails" ), SmallIcon("sendqueued") , |
43 | 0, 0, this ); | 43 | 0, 0, this ); |
44 | sendQueued->addTo( toolBar ); | 44 | sendQueued->addTo( toolBar ); |
45 | sendQueued->addTo( mailMenu ); | 45 | sendQueued->addTo( mailMenu ); |
46 | 46 | ||
47 | /* | 47 | /* |
48 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 48 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
49 | 0, 0, this ); | 49 | 0, 0, this ); |
50 | syncFolders->addTo( toolBar ); | 50 | syncFolders->addTo( toolBar ); |
51 | syncFolders->addTo( mailMenu ); | 51 | syncFolders->addTo( mailMenu ); |
52 | */ | 52 | */ |
53 | 53 | ||
54 | showFolders = new QAction( tr( "Show/Hide folders" ), SmallIcon("showfolders") , | 54 | showFolders = new QAction( tr( "Show/Hide folders" ), SmallIcon("showfolders") , |
55 | 0, 0, this, 0, true ); | 55 | 0, 0, this, 0, true ); |
56 | showFolders->addTo( toolBar ); | 56 | showFolders->addTo( toolBar ); |
57 | showFolders->addTo( mailMenu ); | 57 | showFolders->addTo( mailMenu ); |
58 | showFolders->setOn( true ); | 58 | showFolders->setOn( true ); |
59 | connect(showFolders, SIGNAL( toggled(bool) ), | 59 | connect(showFolders, SIGNAL( toggled(bool) ), |
60 | SLOT( slotShowFolders(bool) ) ); | 60 | SLOT( slotShowFolders(bool) ) ); |
61 | 61 | ||
62 | /* | 62 | /* |
63 | searchMails = new QAction( tr( "Search mails" ), SmallIcon("find") ), | 63 | searchMails = new QAction( tr( "Search mails" ), SmallIcon("find") ), |
64 | 0, 0, this ); | 64 | 0, 0, this ); |
65 | searchMails->addTo( toolBar ); | 65 | searchMails->addTo( toolBar ); |
66 | searchMails->addTo( mailMenu ); | 66 | searchMails->addTo( mailMenu ); |
67 | */ | 67 | */ |
68 | 68 | ||
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index bdbd93a..70fbcb2 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -1,74 +1,74 @@ | |||
1 | 1 | ||
2 | #include "settingsdialog.h" | 2 | #include "settingsdialog.h" |
3 | #include "opiemail.h" | 3 | #include "opiemail.h" |
4 | #include "editaccounts.h" | 4 | #include "editaccounts.h" |
5 | #include "composemail.h" | 5 | #include "composemail.h" |
6 | #include "mailistviewitem.h" | 6 | #include "mailistviewitem.h" |
7 | #include "viewmail.h" | 7 | #include "viewmail.h" |
8 | #include "selectstore.h" | 8 | #include "selectstore.h" |
9 | #include "selectsmtp.h" | 9 | #include "selectsmtp.h" |
10 | 10 | ||
11 | #include <qmessagebox.h> | 11 | #include <qmessagebox.h> |
12 | 12 | ||
13 | #include <qpe/qpeapplication.h> | 13 | #include <qpe/qpeapplication.h> |
14 | #include <libmailwrapper/smtpwrapper.h> | 14 | #include <libmailwrapper/smtpwrapper.h> |
15 | #include <libmailwrapper/mailtypes.h> | 15 | #include <libmailwrapper/mailtypes.h> |
16 | #include <libmailwrapper/abstractmail.h> | 16 | #include <libmailwrapper/abstractmail.h> |
17 | /* OPIE */ | 17 | /* OPIE */ |
18 | //#include <qpe/resource.h> | 18 | //#include <qpe/resource.h> |
19 | #include <qpe/qpeapplication.h> | 19 | #include <qpe/qpeapplication.h> |
20 | 20 | ||
21 | /* QT */ | 21 | /* QT */ |
22 | 22 | ||
23 | using namespace Opie::Core; | 23 | using namespace Opie::Core; |
24 | 24 | ||
25 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) | 25 | OpieMail::OpieMail( QWidget *parent, const char *name, WFlags flags ) |
26 | : MainWindow( parent, name, WStyle_ContextHelp ) | 26 | : MainWindow( parent, name) //, WStyle_ContextHelp ) |
27 | { | 27 | { |
28 | settings = new Settings(); | 28 | settings = new Settings(); |
29 | 29 | ||
30 | folderView->populate( settings->getAccounts() ); | 30 | folderView->populate( settings->getAccounts() ); |
31 | 31 | ||
32 | } | 32 | } |
33 | 33 | ||
34 | OpieMail::~OpieMail() | 34 | OpieMail::~OpieMail() |
35 | { | 35 | { |
36 | if (settings) delete settings; | 36 | if (settings) delete settings; |
37 | } | 37 | } |
38 | 38 | ||
39 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 39 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
40 | { | 40 | { |
41 | 41 | ||
42 | } | 42 | } |
43 | #include <stdlib.h> | 43 | #include <stdlib.h> |
44 | void OpieMail::message(const QCString &msg, const QByteArray &data) | 44 | void OpieMail::message(const QCString &msg, const QByteArray &data) |
45 | { | 45 | { |
46 | // copied from old mail2 | 46 | // copied from old mail2 |
47 | static int ii = 0; | 47 | static int ii = 0; |
48 | 48 | ||
49 | // block second call | 49 | // block second call |
50 | if ( ii < 2 ) { | 50 | if ( ii < 2 ) { |
51 | ++ii; | 51 | ++ii; |
52 | if ( ii > 1 ) { | 52 | if ( ii > 1 ) { |
53 | qDebug("qcop call blocked "); | 53 | qDebug("qcop call blocked "); |
54 | return; | 54 | return; |
55 | } | 55 | } |
56 | } | 56 | } |
57 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); | 57 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); |
58 | if (msg == "writeMail(QString,QString)") | 58 | if (msg == "writeMail(QString,QString)") |
59 | { | 59 | { |
60 | QDataStream stream(data,IO_ReadOnly); | 60 | QDataStream stream(data,IO_ReadOnly); |
61 | QString name, email; | 61 | QString name, email; |
62 | stream >> name >> email; | 62 | stream >> name >> email; |
63 | // removing the whitespaces at beginning and end is needed! | 63 | // removing the whitespaces at beginning and end is needed! |
64 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); | 64 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); |
65 | } | 65 | } |
66 | else if (msg == "newMail()") | 66 | else if (msg == "newMail()") |
67 | { | 67 | { |
68 | slotComposeMail(); | 68 | slotComposeMail(); |
69 | } | 69 | } |
70 | else if (msg == "newMail(QString)") | 70 | else if (msg == "newMail(QString)") |
71 | { | 71 | { |
72 | QDataStream stream(data,IO_ReadOnly); | 72 | QDataStream stream(data,IO_ReadOnly); |
73 | QString nameemail; | 73 | QString nameemail; |
74 | stream >> nameemail; | 74 | stream >> nameemail; |