summaryrefslogtreecommitdiffabout
path: root/kmicromail/composemail.cpp
Unidiff
Diffstat (limited to 'kmicromail/composemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/composemail.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index 01dd406..9efa932 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -36,32 +36,35 @@
36#endif //DESKTOP_VERSION 36#endif //DESKTOP_VERSION
37 37
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 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 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" );
53
53 if ( whoami_uid.isEmpty() ) { 54 if ( whoami_uid.isEmpty() ) {
54 QMessageBox::information( 0, tr( "Hint" ), 55 QMessageBox::information( 0, tr( "Hint" ),
55 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" ),
56 tr( "Ok" ) ); 57 tr( "Ok" ) );
57 58
58 } else 59 } else
59 bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid); 60 ExternalAppHandler::instance()->requestDetailsFromKAPI("", "sendbacklist", whoami_uid);
61
62
60#ifdef DESKTOP_VERSION 63#ifdef DESKTOP_VERSION
61 KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( ); 64 KABC::Addressee con = KABC::StdAddressBook::self()->whoAmI( );
62 QStringList mails = con.emails(); 65 QStringList mails = con.emails();
63 QString defmail = con.preferredEmail(); 66 QString defmail = con.preferredEmail();
64 if ( mails.count() == 0) 67 if ( mails.count() == 0)
65 QMessageBox::information( 0, tr( "Hint" ), 68 QMessageBox::information( 0, tr( "Hint" ),
66 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), 69 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
67 tr( "Ok" ) ); 70 tr( "Ok" ) );
@@ -77,17 +80,16 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m
77 senderNameEdit->setText(con.formattedName()); 80 senderNameEdit->setText(con.formattedName());
78#endif 81#endif
79 Config cfg( "mail" ); 82 Config cfg( "mail" );
80 cfg.setGroup( "Compose" ); 83 cfg.setGroup( "Compose" );
81 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) ); 84 checkBoxLater->setChecked( cfg.readBoolEntry( "sendLater", false ) );
82 85
83 attList->addColumn( tr( "Name" ) ); 86 attList->addColumn( tr( "Name" ) );
84 attList->addColumn( tr( "Size" ) ); 87 attList->addColumn( tr( "Size" ) );
85
86 QList<Account> accounts = settings->getAccounts(); 88 QList<Account> accounts = settings->getAccounts();
87 89
88 Account *it; 90 Account *it;
89 for ( it = accounts.first(); it; it = accounts.next() ) { 91 for ( it = accounts.first(); it; it = accounts.next() ) {
90 if ( it->getType()==MAILLIB::A_SMTP ) { 92 if ( it->getType()==MAILLIB::A_SMTP ) {
91 SMTPaccount *smtp = static_cast<SMTPaccount *>(it); 93 SMTPaccount *smtp = static_cast<SMTPaccount *>(it);
92 smtpAccountBox->insertItem( smtp->getAccountName() ); 94 smtpAccountBox->insertItem( smtp->getAccountName() );
93 smtpAccounts.append( smtp ); 95 smtpAccounts.append( smtp );
@@ -192,21 +194,20 @@ void ComposeMail::pickAddress( )
192#else 194#else
193 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/); 195 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/);
194 // the result should now arrive through method insertAttendees 196 // the result should now arrive through method insertAttendees
195#endif 197#endif
196} 198}
197//the map includes name/email pairs, that comes from Ka/Pi 199//the map includes name/email pairs, that comes from Ka/Pi
198void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) 200void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
199{ 201{
200 qDebug("ComposeMail::insertAttendees "); 202 //qDebug("ComposeMail::insertAttendees ");
201 raise(); 203 raise();
202 204
203 if ( mPickLineEdit == 0 ) { //whoami received 205 if ( mPickLineEdit == 0 ) { //whoami received
204 qDebug("returnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn ");
205 QString defmail = uidList[0]; 206 QString defmail = uidList[0];
206 if ( emailList.count() == 0 ) 207 if ( emailList.count() == 0 )
207 QMessageBox::information( 0, tr( "Hint" ), 208 QMessageBox::information( 0, tr( "Hint" ),
208 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ), 209 tr( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
209 tr( "Ok" ) ); 210 tr( "Ok" ) );
210 if (defmail.length()!=0) { 211 if (defmail.length()!=0) {
211 fromBox->insertItem(defmail); 212 fromBox->insertItem(defmail);
212 } 213 }