author | zautrix <zautrix> | 2005-02-04 10:23:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-04 10:23:55 (UTC) |
commit | 83256090c493dab56f1afba4829e864598bf70d2 (patch) (side-by-side diff) | |
tree | 8d5b7ee0c6fe42f0f14c53b80c924ccddd5a1599 | |
parent | a96872e5ecff3a8fb1785aff71f5f7f150ef8604 (diff) | |
download | kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.zip kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.gz kdepimpi-83256090c493dab56f1afba4829e864598bf70d2.tar.bz2 |
mail send
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 3 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 5 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 | ||||
-rw-r--r-- | kmicromail/composemail.cpp | 14 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 33 | ||||
-rw-r--r-- | kmicromail/opiemail.h | 5 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 56 | ||||
-rw-r--r-- | korganizer/koeventviewer.h | 3 | ||||
-rw-r--r-- | libkdepim/externalapphandler.cpp | 1 |
9 files changed, 114 insertions, 8 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 8af7da2..e24ee43 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -7,6 +7,9 @@ Added feature for changing alarm settings for many items at once: Open list view (or search dialog), select the desired items and choose in the popup menu: Set alarm for selected... +Added to the event/todo viewer the option to send an email to +all attendees or all selected (with RSVP) attendees. + ********** VERSION 2.0.2 ************ KO/Pi: diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 12b70a0..8c3b1e4 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1211,6 +1211,11 @@ { "Set reminder offset to:","Setze Alarm Offset auf:" }, { "Set Alarm!","Setze Alarm!" }, { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, +{ " and "," und " }, +{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, +{ "Mail to selected","Mail an Ausgewählte" }, +{ "Mail to all","Mail an Alle" }, +{ "","" }, { "","" }, { "","" }, { "","" }, diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 702eaa3..a8e4de5 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -2497,7 +2497,7 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt emailList.append(list[i].preferredEmail()); uidList.append(list[i].uid()); } - + //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); } diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp index ed8a2ee..3231b45 100644 --- a/kmicromail/composemail.cpp +++ b/kmicromail/composemail.cpp @@ -55,8 +55,9 @@ ComposeMail::ComposeMail( Settings *sett, QWidget *parent, const char *name, boo 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) { @@ -260,6 +261,13 @@ void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameLis //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 ) @@ -281,7 +289,7 @@ void ComposeMail::insertAttendees(const QString& uid,const QStringList& nameLis } QString names ; QLineEdit *line = mPickLineEdit; - if (uid == this->name()) + if (UID == this->name()) { for ( int i = 0; i < nameList.count(); i++) { diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index f56711d..e159b73 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -46,11 +46,13 @@ 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() @@ -138,7 +140,9 @@ void OpieMail::slotwriteMail2(const QString& namemail ) #ifndef DESKTOP_VERSION compose.showMaximized(); #endif + mCurrentComposer = &compose; compose.exec(); + mCurrentComposer = 0; raise(); //qDebug("retttich "); } @@ -161,7 +165,10 @@ void OpieMail::slotwriteMail(const QString&name,const QString&email) #ifndef DESKTOP_VERSION compose.showMaximized(); #endif + + mCurrentComposer = &compose; compose.exec(); + mCurrentComposer = 0; raise(); } @@ -300,10 +307,13 @@ void OpieMail::replyMail() 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; } @@ -637,5 +647,26 @@ void OpieMail::reEditMail() #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 @@ -8,6 +8,9 @@ #include <opie2/osmartpointer.h> #include <libmailwrapper/mailtypes.h> #include <viewmail.h> +#include <qstringlist.h> + +class ComposeMail; class OpieMail : public MainWindow { @@ -25,6 +28,7 @@ public slots: 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); @@ -48,6 +52,7 @@ protected slots: void clearSelection(); void slotDownloadMail(); private: + ComposeMail* mCurrentComposer; void closeViewMail(ViewMail * vm); QString mPendingEmail; QString mPendingName; diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 7dc1880..bf41edb 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -126,8 +126,16 @@ void KOEventViewer::setSource(const QString& n) if ( n.left(6) == "mailto" ) { // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); #ifndef DESKTOP_VERSION + if ( n.mid(7,3) == "ALL" ) { + qDebug("all "); + mailToAttendees( true ); + } else if ( n.mid(7,4) == "RSVP" ) { + mailToAttendees( false ); + qDebug("rsvp "); + } else { QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); e << n.mid(7); + } #endif } @@ -174,7 +182,26 @@ void KOEventViewer::setSource(const QString& n) } #endif } +void KOEventViewer::mailToAttendees( bool all ) +{ + QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); + if (attendees.count() == 0) return; + QStringList nameList; + QStringList emailList; + QStringList uidList; + Attendee* a; + for(a=attendees.first();a;a=attendees.next()) { + if ( !all && !a->RSVP() ) continue; + if (!a->email().isEmpty()) { + nameList.append (a->name() ); + emailList.append (a->email() ); + uidList.append (a->uid() ); + } + } + QString uid = "ComposeMailUIpick2"+mMailSubject; + bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); +} void KOEventViewer::addTag(const QString & tag,const QString & text) { int number=text.contains("\n"); @@ -462,6 +489,9 @@ void KOEventViewer::formatAttendees(Incidence *event) addTag("h3",i18n("Attendees")); Attendee *a; mText.append("<ul>"); + int a_count = 0; + int a_count_nr = 0; + for(a=attendees.first();a;a=attendees.next()) { #ifndef KORG_NOKABC #ifdef DESKTOP_VERSION @@ -501,10 +531,14 @@ void KOEventViewer::formatAttendees(Incidence *event) if (!a->email().isEmpty()) { if (iconPath) { mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; - if ( a->RSVP() ) + if ( a->RSVP() ) { + ++a_count; mText += "<IMG src=\"" + iconPath + "\">"; - else + } + else { + ++a_count_nr; mText += "<IMG src=\"" + NOiconPath + "\">"; + } mText += "</a>\n"; } } @@ -514,6 +548,24 @@ void KOEventViewer::formatAttendees(Incidence *event) mText +="(" + a->roleStr().left(1) + ".)"; } mText.append("</li></ul>"); + if ( a_count > 1 ) { + mText += "<a href=\"mailto:ALL\">"; + mText += i18n( "Mail to all" ); + mText += "</a> ( "; + mText += "<IMG src=\"" + iconPath + "\">"; + mText += i18n( " and " ); + mText += "<IMG src=\"" + NOiconPath + "\"> )"; + mText += "<br>\n"; + + + } + if ( a_count_nr > 1 ) { + mText += "<a href=\"mailto:RSVP\">"; + mText += i18n( "Mail to selected" ); + mText += "</a> ( "; + mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); + mText += "\n"; + } } } diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 0cd3f33..cf44284 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h @@ -51,6 +51,7 @@ class KOEventViewer : public QTextBrowser { void addText(QString text); void setSyncMode( bool ); void setColorMode( int ); + void mailToAttendees( bool all ); protected: int mColorMode; @@ -66,7 +67,7 @@ class KOEventViewer : public QTextBrowser { QString mText; QString mMailSubject; - Incidence* mCurrentIncidence; + Incidence* mCurrentIncidence; signals: void launchaddressbook(QString uid); }; diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 3079141..7200da9 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp @@ -1131,6 +1131,7 @@ void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& dat { if ( cmsg == "nextView()" ) { + qDebug("nextView()"); emit nextView(); return; } |