summaryrefslogtreecommitdiffabout
path: root/kmicromail/composemail.cpp
authorzautrix <zautrix>2004-09-15 06:15:59 (UTC)
committer zautrix <zautrix>2004-09-15 06:15:59 (UTC)
commit35b8948c6c203473866c74f1d13185a848454e04 (patch) (unidiff)
treeb6d8eca9863cbca8e24d474d8c895065faa17458 /kmicromail/composemail.cpp
parentf1f43030eefa765950cb501aece6cc71fb4e9859 (diff)
downloadkdepimpi-35b8948c6c203473866c74f1d13185a848454e04.zip
kdepimpi-35b8948c6c203473866c74f1d13185a848454e04.tar.gz
kdepimpi-35b8948c6c203473866c74f1d13185a848454e04.tar.bz2
Mail config added
Diffstat (limited to 'kmicromail/composemail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/composemail.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 9b799b3..e6f7daa 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -12,7 +12,6 @@
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/config.h>
16#include <qpe/global.h> 15#include <qpe/global.h>
17//#include <qpe/contact.h> 16//#include <qpe/contact.h>
18 17
@@ -35,18 +34,19 @@
35#include <libkdepim/externalapphandler.h> 34#include <libkdepim/externalapphandler.h>
36#endif //DESKTOP_VERSION 35#endif //DESKTOP_VERSION
37 36
37#include "koprefs.h"
38 38
39//using namespace Opie::Core; 39//using namespace Opie::Core;
40//using namespace Opie::Ui; 40//using namespace Opie::Ui;
41ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal ) 41ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal )
42 : ComposeMailUI( parent, name, modal ) 42 : ComposeMailUI( parent, name, modal )
43{ 43{
44
45 mPickLineEdit = 0; 44 mPickLineEdit = 0;
46 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 45 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&))); 46 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
48 settings = s; 47 settings = s;
49 m_replyid = ""; 48 m_replyid = "";
49 if ( KOPrefs::instance()->mUseKapi) {
50 KConfig config( locateLocal("config", "kabcrc") ); 50 KConfig config( locateLocal("config", "kabcrc") );
51 config.setGroup( "General" ); 51 config.setGroup( "General" );
52 QString whoami_uid = config.readEntry( "WhoAmI" ); 52 QString whoami_uid = config.readEntry( "WhoAmI" );
@@ -56,6 +56,8 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
56 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), 56 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
57 tr( "Ok" ) ); 57 tr( "Ok" ) );
58 58
59
60 fillSettings();
59 } else 61 } else
60 ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); 62 ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid);
61 63
@@ -79,14 +81,18 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
79 } 81 }
80 senderNameEdit->setText(con.formattedName()); 82 senderNameEdit->setText(con.formattedName());
81#endif 83#endif
82 Config cfg( "mail" ); 84
83 cfg.setGroup( "Compose" ); 85 } else {
84 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); 86 fillSettings();
87 }
88 checkBoxLater->setChecked( KOPrefs::instance()->mSendLater );
85 89
86 attList->addColumn( tr( "Name" ) ); 90 attList->addColumn( tr( "Name" ) );
87 attList->addColumn( tr( "Size" ) ); 91 attList->addColumn( tr( "Size" ) );
88 QList<Account> accounts = settings->getAccounts(); 92 QList<Account> accounts = settings->getAccounts();
89 93
94 if ( QApplication::desktop()->width() < 320 )
95 smtpAccountBox->setMaximumWidth( 80 );
90 Account *it; 96 Account *it;
91 for ( it = accounts.first(); it; it = accounts.next() ) { 97 for ( it = accounts.first(); it; it = accounts.next() ) {
92 if ( it->getType()==MAILLIB::A_SMTP ) { 98 if ( it->getType()==MAILLIB::A_SMTP ) {
@@ -113,9 +119,21 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
113 return; 119 return;
114 } 120 }
115 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) ); 121 connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
116 122 message->setFont ( KOPrefs::instance()->mComposeFont );
117} 123}
118 124
125void ComposeMail::fillSettings()
126{
127 if ( QApplication::desktop()->width() < 320 )
128 fromBox->setMaximumWidth( 100 );
129 QStringList mailList = QStringList::split(";",KOPrefs::instance()->mEmail);
130 QStringList::ConstIterator sit = mailList.begin();
131 int pref = 0;
132 for (;sit!=mailList.end();++sit) {
133 fromBox->insertItem((*sit));
134 }
135 senderNameEdit->setText(KOPrefs::instance()->mName);
136}
119 137
120 138
121void ComposeMail::saveAsDraft() 139void ComposeMail::saveAsDraft()