summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2005-02-04 10:23:55 (UTC)
committer zautrix <zautrix>2005-02-04 10:23:55 (UTC)
commit83256090c493dab56f1afba4829e864598bf70d2 (patch) (side-by-side diff)
tree8d5b7ee0c6fe42f0f14c53b80c924ccddd5a1599 /kmicromail
parenta96872e5ecff3a8fb1785aff71f5f7f150ef8604 (diff)
downloadkdepimpi-83256090c493dab56f1afba4829e864598bf70d2.zip
kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.gz
kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.bz2
mail send
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/composemail.cpp14
-rw-r--r--kmicromail/opiemail.cpp33
-rw-r--r--kmicromail/opiemail.h5
3 files changed, 48 insertions, 4 deletions
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index ed8a2ee..3231b45 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -52,14 +52,15 @@
ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, bool modal )
: ComposeMailUI( parent, name, modal )
{
mPickLineEdit = 0;
mEncoding = KOPrefs::instance()->mCurrentCodeName;
- connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
- this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
+ //managed from opiemail now
+ //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 = sett;
m_replyid = "";
if ( KOPrefs::instance()->mUseKapi) {
KConfig config( locateLocal("config", "kabcrc") );
config.setGroup( "General" );
QString whoami_uid = config.readEntry( "WhoAmI" );
@@ -257,12 +258,19 @@ void ComposeMail::pickAddress( )
//the map includes name/email pairs, that comes from Ka/Pi
void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
{
//qDebug("ComposeMail::insertAttendees ");
raise();
+ QString UID = uid;
+ if ( uid.left( 18 ) == (this->name() +QString("pick2")) ) {
+ mPickLineEdit = toLine;
+ UID = this->name();
+ subjectLine->setText( uid.mid( 18 ) );
+ }
+ //qDebug("ccc %s %s ", uid.latin1(), this->name());
if ( mPickLineEdit == 0 ) { //whoami received
QString defmail = uidList[0];
if ( emailList.count() == 0 )
QMessageBox::information( 0, i18n( "Hint" ),
i18n( "Please apply\n\"Set Who Am I\"\nin KA/Pi to get the from\nfield automatically filled out!\n" ),
i18n( "Ok" ) );
@@ -278,13 +286,13 @@ void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameLis
}
senderNameEdit->setText(nameList[0]);
return;
}
QString names ;
QLineEdit *line = mPickLineEdit;
- if (uid == this->name())
+ if (UID == this->name())
{
for ( int i = 0; i < nameList.count(); i++)
{
QString _name = nameList[i];
QString _email = emailList[i];
QString _uid = uidList[i];
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index f56711d..e159b73 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -43,17 +43,19 @@
//using namespace Opie::Core;
OpieMail::OpieMail( QWidget *parent, const char *name )
: MainWindow( parent, name) //, WStyle_ContextHelp )
{
+ mCurrentComposer = 0;
settings = new Settings();
tb = 0;
setIcon(SmallIcon( "kmicromail" ) );
folderView->populate( settings->getAccounts() );
-
+ connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
+ this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
}
OpieMail::~OpieMail()
{
if (settings) delete settings;
if ( tb )
@@ -135,13 +137,15 @@ void OpieMail::slotwriteMail2(const QString& namemail )
compose.setTo( to );
}
compose.slotAdjustColumns();
#ifndef DESKTOP_VERSION
compose.showMaximized();
#endif
+ mCurrentComposer = &compose;
compose.exec();
+ mCurrentComposer = 0;
raise();
//qDebug("retttich ");
}
void OpieMail::slotwriteMail(const QString&name,const QString&email)
{
// qDebug("OpieMail::slotwriteMail ");
@@ -158,13 +162,16 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email)
}
}
compose.slotAdjustColumns();
#ifndef DESKTOP_VERSION
compose.showMaximized();
#endif
+
+ mCurrentComposer = &compose;
compose.exec();
+ mCurrentComposer = 0;
raise();
}
void OpieMail::slotComposeMail()
{
if ( mPendingEmail == QString::null && mPendingName == QString::null)
@@ -297,16 +304,19 @@ void OpieMail::replyMail()
composer.setTo( mail->Replyto());
}
composer.setSubject( prefix + mail->getSubject());
composer.setMessage( rtext );
composer.setInReplyTo( mail->Msgid());
composer.setCharset( body->getCharset() );
+
+ mCurrentComposer = &composer;
if ( QDialog::Accepted == KApplication::execDialog( &composer ) )
{
mail->Wrapper()->answeredMail(mail);
}
+ mCurrentComposer = 0;
delete settings;
}
void OpieMail::closeViewMail(ViewMail * vm)
{
vm->hide();
@@ -634,8 +644,29 @@ void OpieMail::reEditMail()
compose.slotAdjustColumns();
#ifndef DESKTOP_VERSION
compose.showMaximized();
#else
compose.resize(640,480);
#endif
+ mCurrentComposer = &compose;
compose.exec();
+ mCurrentComposer = 0;
+}
+
+void OpieMail::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
+{
+
+ if ( mCurrentComposer ) {
+ mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList);
+ } else {
+ ComposeMail compose( settings, this, 0, true );
+ compose.slotAdjustColumns();
+#ifndef DESKTOP_VERSION
+ compose.showMaximized();
+#endif
+ mCurrentComposer = &compose;
+ mCurrentComposer->insertAttendees(uid,nameList,emailList,uidList);
+ compose.exec();
+ mCurrentComposer = 0;
+ raise();
+ }
}
diff --git a/kmicromail/opiemail.h b/kmicromail/opiemail.h
index b8a527f..4f75b3f 100644
--- a/kmicromail/opiemail.h
+++ b/kmicromail/opiemail.h
@@ -5,12 +5,15 @@
#include "mainwindow.h"
#include <libmailwrapper/settings.h>
#include <opie2/osmartpointer.h>
#include <libmailwrapper/mailtypes.h>
#include <viewmail.h>
+#include <qstringlist.h>
+
+class ComposeMail;
class OpieMail : public MainWindow
{
Q_OBJECT
public:
@@ -22,12 +25,13 @@ public slots:
virtual void slotwriteMail(const QString&name,const QString&email);
virtual void slotwriteMail2(const QString&nameemail);
virtual void slotComposeMail();
virtual void slotExtAppHandler();
virtual void appMessage(const QCString &msg, const QByteArray &data);
virtual void message(const QCString &msg, const QByteArray &data);
+ void insertAttendees(const QString&, const QStringList& namelist, const QStringList& emaillist, const QStringList& uidlist);
protected slots:
virtual void deleteAndDisplayNextMail(ViewMail * vm);
virtual void displayNextMail(ViewMail * vm);
virtual void slotSendQueued();
virtual void slotSearchMails();
virtual void slotEditSettings();
@@ -45,12 +49,13 @@ protected slots:
virtual void slotMoveCopyMail();
virtual void slotMoveCopyAllMail();
virtual void reEditMail();
void clearSelection();
void slotDownloadMail();
private:
+ ComposeMail* mCurrentComposer;
void closeViewMail(ViewMail * vm);
QString mPendingEmail;
QString mPendingName;
QByteArray mPendingData;
QCString mPendingMessage;
Settings *settings;