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) (side-by-side diff)
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
@@ -9,13 +9,12 @@
/* OPIE */
//#include <opie2/ofiledialog.h>
//#include <opie2/odebug.h>
#include <kfiledialog.h>
//#include <qpe/resource.h>
-#include <qpe/config.h>
#include <qpe/global.h>
//#include <qpe/contact.h>
#include <qcombobox.h>
#include <qcheckbox.h>
@@ -32,33 +31,36 @@
#ifdef DESKTOP_VERSION
#include <kabc/addresseedialog.h>
#else //DESKTOP_VERSION
#include <libkdepim/externalapphandler.h>
#endif //DESKTOP_VERSION
+#include "koprefs.h"
//using namespace Opie::Core;
//using namespace Opie::Ui;
ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal )
: ComposeMailUI( parent, name, modal )
{
-
mPickLineEdit = 0;
connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
settings = s;
m_replyid = "";
+ if ( KOPrefs::instance()->mUseKapi) {
KConfig config( locateLocal("config", "kabcrc") );
config.setGroup( "General" );
QString whoami_uid = config.readEntry( "WhoAmI" );
if ( whoami_uid.isEmpty() ) {
QMessageBox::information( 0, tr( "Hint" ),
tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
tr( "Ok" ) );
+
+ fillSettings();
} else
ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid);
#ifdef DESKTOP_VERSION
KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( );
@@ -76,20 +78,24 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
if ( (*sit)==defmail)
continue;
fromBox->insertItem((*sit));
}
senderNameEdit->setText(con.formattedName());
#endif
- Config cfg( "mail" );
- cfg.setGroup( "Compose" );
- checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
+
+ } else {
+ fillSettings();
+ }
+ checkBoxLater->setChecked( KOPrefs::instance()->mSendLater );
attList->addColumn( tr( "Name" ) );
attList->addColumn( tr( "Size" ) );
QList<Account> accounts = settings->getAccounts();
+ if ( QApplication::desktop()->width() < 320 )
+ smtpAccountBox->setMaximumWidth( 80 );
Account *it;
for ( it = accounts.first(); it; it = accounts.next() ) {
if ( it->getType()==MAILLIB::A_SMTP ) {
SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
smtpAccountBox->insertItem( smtp->getAccountName() );
smtpAccounts.append( smtp );
@@ -110,15 +116,27 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
QMessageBox::information( 0, tr( "Problem" ),
tr( "Please create an SMTP account first.\nThe SMTP is needed for sending mail.\n" ),
tr( "Ok" ) );
return;
}
connect( smtpAccountBox, SIGNAL( activated(int) ), SLOT( fillValues(int) ) );
-
+ message->setFont ( KOPrefs::instance()->mComposeFont );
}
+void ComposeMail::fillSettings()
+{
+ if ( QApplication::desktop()->width() < 320 )
+ fromBox->setMaximumWidth( 100 );
+ QStringList mailList = QStringList::split(";",KOPrefs::instance()->mEmail);
+ QStringList::ConstIterator sit = mailList.begin();
+ int pref = 0;
+ for (;sit!=mailList.end();++sit) {
+ fromBox->insertItem((*sit));
+ }
+ senderNameEdit->setText(KOPrefs::instance()->mName);
+}
void ComposeMail::saveAsDraft()
{
Opie::Core::OSmartPointer<Mail> mail= new Mail();