author | zautrix <zautrix> | 2004-10-30 11:40:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-30 11:40:54 (UTC) |
commit | 632b43950f1ac2980c281eb8901d797deb0ba971 (patch) (unidiff) | |
tree | 72534bf865fbef61a29d5e8b2e65672c15b432c0 /kmicromail/composemail.cpp | |
parent | 0057c2a8e90346583f606491730cae819d2313ac (diff) | |
download | kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.zip kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.tar.gz kdepimpi-632b43950f1ac2980c281eb8901d797deb0ba971.tar.bz2 |
made ompi compiling on desktop
-rw-r--r-- | kmicromail/composemail.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index 8eb6d27..0cd0b23 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp | |||
@@ -9,52 +9,52 @@ | |||
9 | 9 | ||
10 | /* OPIE */ | 10 | /* OPIE */ |
11 | //#include <opie2/ofiledialog.h> | 11 | //#include <opie2/ofiledialog.h> |
12 | //#include <opie2/odebug.h> | 12 | //#include <opie2/odebug.h> |
13 | #include <kfiledialog.h> | 13 | #include <kfiledialog.h> |
14 | //#include <qpe/resource.h> | 14 | //#include <qpe/resource.h> |
15 | #include <qpe/global.h> | 15 | #include <qpe/global.h> |
16 | //#include <qpe/contact.h> | 16 | //#include <qpe/contact.h> |
17 | 17 | ||
18 | 18 | ||
19 | #include <qcombobox.h> | 19 | #include <qcombobox.h> |
20 | #include <qcheckbox.h> | 20 | #include <qcheckbox.h> |
21 | #include <qiconset.h> | 21 | #include <qiconset.h> |
22 | #include <qtimer.h> | 22 | #include <qtimer.h> |
23 | #include <qmessagebox.h> | 23 | #include <qmessagebox.h> |
24 | #include <qpushbutton.h> | 24 | #include <qpushbutton.h> |
25 | #include <qmultilineedit.h> | 25 | #include <qmultilineedit.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qtabwidget.h> | 27 | #include <qtabwidget.h> |
28 | #include <qlistview.h> | 28 | #include <qlistview.h> |
29 | #include <kabc/addresseedialog.h> | 29 | #include <kabc/addresseedialog.h> |
30 | #include <kabc/stdaddressbook.h> | 30 | #include <kabc/stdaddressbook.h> |
31 | #include <kabc/addressee.h> | 31 | #include <kabc/addressee.h> |
32 | #ifdef DESKTOP_VERSION | 32 | #ifdef DESKTOP_VERSION |
33 | #include <qapplication.h> | ||
33 | #include <kabc/addresseedialog.h> | 34 | #include <kabc/addresseedialog.h> |
34 | #else //DESKTOP_VERSION | ||
35 | #include <libkdepim/externalapphandler.h> | ||
36 | #endif //DESKTOP_VERSION | 35 | #endif //DESKTOP_VERSION |
36 | #include <libkdepim/externalapphandler.h> | ||
37 | 37 | ||
38 | #include "koprefs.h" | 38 | #include "koprefs.h" |
39 | 39 | ||
40 | //using namespace Opie::Core; | 40 | //using namespace Opie::Core; |
41 | //using namespace Opie::Ui; | 41 | //using namespace Opie::Ui; |
42 | ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal ) | 42 | ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal ) |
43 | : ComposeMailUI( parent, name, modal ) | 43 | : ComposeMailUI( parent, name, modal ) |
44 | { | 44 | { |
45 | mPickLineEdit = 0; | 45 | mPickLineEdit = 0; |
46 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), | 46 | connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), |
47 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); | 47 | this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); |
48 | settings = s; | 48 | settings = s; |
49 | m_replyid = ""; | 49 | m_replyid = ""; |
50 | if ( KOPrefs::instance()->mUseKapi) { | 50 | if ( KOPrefs::instance()->mUseKapi) { |
51 | KConfig config( locateLocal("config", "kabcrc") ); | 51 | KConfig config( locateLocal("config", "kabcrc") ); |
52 | config.setGroup( "General" ); | 52 | config.setGroup( "General" ); |
53 | QString whoami_uid = config.readEntry( "WhoAmI" ); | 53 | QString whoami_uid = config.readEntry( "WhoAmI" ); |
54 | 54 | ||
55 | if ( whoami_uid.isEmpty() ) { | 55 | if ( whoami_uid.isEmpty() ) { |
56 | QMessageBox::information( 0, i18n( "Hint" ), | 56 | QMessageBox::information( 0, i18n( "Hint" ), |
57 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), | 57 | i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), |
58 | i18n( "Ok" ) ); | 58 | i18n( "Ok" ) ); |
59 | 59 | ||
60 | 60 | ||
@@ -93,54 +93,55 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
93 | QList<Account> accounts = settings->getAccounts(); | 93 | QList<Account> accounts = settings->getAccounts(); |
94 | 94 | ||
95 | if ( QApplication::desktop()->width() < 320 ) | 95 | if ( QApplication::desktop()->width() < 320 ) |
96 | smtpAccountBox->setMaximumWidth( 80 ); | 96 | smtpAccountBox->setMaximumWidth( 80 ); |
97 | Account *it; | 97 | Account *it; |
98 | for ( it = accounts.first(); it; it = accounts.next() ) { | 98 | for ( it = accounts.first(); it; it = accounts.next() ) { |
99 | if ( it->getType()==MAILLIB::A_SMTP ) { | 99 | if ( it->getType()==MAILLIB::A_SMTP ) { |
100 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 100 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
101 | smtpAccountBox->insertItem( smtp->getAccountName() ); | 101 | smtpAccountBox->insertItem( smtp->getAccountName() ); |
102 | smtpAccounts.append( smtp ); | 102 | smtpAccounts.append( smtp ); |
103 | } | 103 | } |
104 | } | 104 | } |
105 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); | 105 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); |
106 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); | 106 | connect( ccButton, SIGNAL( clicked() ), SLOT( pickAddressCC() ) ); |
107 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); | 107 | connect( bccButton, SIGNAL( clicked() ), SLOT( pickAddressBCC() ) ); |
108 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); | 108 | connect( replyButton, SIGNAL( clicked() ), SLOT( pickAddressReply() ) ); |
109 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); | 109 | connect( addButton, SIGNAL( clicked() ), SLOT( addAttachment() ) ); |
110 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); | 110 | connect( deleteButton, SIGNAL( clicked() ), SLOT( removeAttachment() ) ); |
111 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); | 111 | connect( SaveButton, SIGNAL( clicked() ), SLOT( saveAsDraft()) ); |
112 | mMail = 0; | 112 | mMail = 0; |
113 | warnAttach = true; | 113 | warnAttach = true; |
114 | QIconSet icon; | 114 | QIconSet icon; |
115 | //icon = SmallIcon("fileexport"); | 115 | //icon = SmallIcon("fileexport"); |
116 | icon = SmallIcon("filesave"); | 116 | icon = SmallIcon("filesave"); |
117 | if ( QApplication::desktop()->width() < 320 ) | 117 | SaveButton->setIconSet (icon ) ; |
118 | if ( QApplication::desktop()->width() < 320 ) { | ||
118 | SaveButton->setText ("") ; | 119 | SaveButton->setText ("") ; |
120 | SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ; | ||
121 | } | ||
119 | else | 122 | else |
120 | SaveButton->setText (i18n("Save")) ; | 123 | SaveButton->setText (i18n("Save")); |
121 | SaveButton->setIconSet (icon ) ; | ||
122 | SaveButton->setMaximumSize ( SaveButton->sizeHint().height(),SaveButton->sizeHint().height()) ; | ||
123 | #ifndef DESKTOP_VERSION | 124 | #ifndef DESKTOP_VERSION |
124 | QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); | 125 | QPEApplication::setStylusOperation( message, QPEApplication::RightOnHold ); |
125 | QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold ); | 126 | QPEApplication::setStylusOperation( senderNameEdit, QPEApplication::RightOnHold ); |
126 | QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold ); | 127 | QPEApplication::setStylusOperation( subjectLine, QPEApplication::RightOnHold ); |
127 | #endif | 128 | #endif |
128 | message->setFont ( KOPrefs::instance()->mComposeFont ); | 129 | message->setFont ( KOPrefs::instance()->mComposeFont ); |
129 | message->setWordWrap (QMultiLineEdit::WidgetWidth); | 130 | message->setWordWrap (QMultiLineEdit::WidgetWidth); |
130 | if ( smtpAccounts.count() > 0 ) { | 131 | if ( smtpAccounts.count() > 0 ) { |
131 | fillValues( smtpAccountBox->currentItem() ); | 132 | fillValues( smtpAccountBox->currentItem() ); |
132 | } else { | 133 | } else { |
133 | QMessageBox::information( 0, i18n( "Problem" ), | 134 | QMessageBox::information( 0, i18n( "Problem" ), |
134 | i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ), | 135 | i18n( "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n" ), |
135 | i18n( "Ok" ) ); | 136 | i18n( "Ok" ) ); |
136 | return; | 137 | return; |
137 | } | 138 | } |
138 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); | 139 | connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); |
139 | 140 | ||
140 | 141 | ||
141 | } | 142 | } |
142 | 143 | ||
143 | void ComposeMail::fillSettings() | 144 | void ComposeMail::fillSettings() |
144 | { | 145 | { |
145 | if ( QApplication::desktop()->width() < 320 ) | 146 | if ( QApplication::desktop()->width() < 320 ) |
146 | fromBox->setMaximumWidth( 100 ); | 147 | fromBox->setMaximumWidth( 100 ); |