-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 @@ -4,12 +4,15 @@ Info about the changes in new versions of KDE-Pim/Pi KO/Pi: 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: Fixed the layout problem of the day label buttons of the agenda view introduced in version 2.0.1. 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 @@ -1208,12 +1208,17 @@ { "Select week %1-%2","Selektiere Woche %1-%2" }, { "Select Week","Selektiere Woche" }, { "Set alarm for selected...","Setze Alarm für Selekt..." }, { "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 @@ -2494,13 +2494,13 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt for (i=0; i < list.count(); i++) { nameList.append(list[i].realName()); 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); } /* this method will be called through the QCop interface from Ko/Pi to select birthdays * to put them into the calendar. 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; diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 7dc1880..bf41edb 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp @@ -123,14 +123,22 @@ void KOEventViewer::setSource(const QString& n) // the result should now arrive through method insertAttendees //QString uid = "uid:"+(*it).uid(); #endif 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 } #ifndef KORG_NODCOP @@ -171,13 +179,32 @@ void KOEventViewer::setSource(const QString& n) } } else { //QTextBrowser::setSource(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"); QString str = "<" + tag + ">"; QString tmpText=text; QString tmpStr=str; @@ -459,12 +486,15 @@ void KOEventViewer::formatAttendees(Incidence *event) } mText.append("</li></ul>"); 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 if (a->name().isEmpty()) { addressList = add_book->findByEmail(a->email()); KABC::Addressee o = addressList.first(); @@ -498,25 +528,47 @@ void KOEventViewer::formatAttendees(Incidence *event) #endif 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"; } } if (a->status() != Attendee::NeedsAction ) mText +="[" + a->statusStr() + "] "; if (a->role() == Attendee::Chair ) 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"; + } } } void KOEventViewer::appendJournal(Journal *jour, int mode ) { bool shortDate = KOPrefs::instance()->mShortDateInViewer; diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h index 0cd3f33..cf44284 100644 --- a/korganizer/koeventviewer.h +++ b/korganizer/koeventviewer.h @@ -48,12 +48,13 @@ class KOEventViewer : public QTextBrowser { void clearEvents(bool now=false); void addText(QString text); void setSyncMode( bool ); void setColorMode( int ); + void mailToAttendees( bool all ); protected: int mColorMode; void addTag(const QString & tag,const QString & text); void formatCategories(Incidence *event); @@ -63,12 +64,12 @@ class KOEventViewer : public QTextBrowser { private: QTextBrowser *mEventTextView; bool mSyncMode; QString mText; QString mMailSubject; - Incidence* mCurrentIncidence; + Incidence* mCurrentIncidence; signals: void launchaddressbook(QString uid); }; #endif diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 3079141..7200da9 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp @@ -1128,12 +1128,13 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete **************************************************************************/ void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data ) { if ( cmsg == "nextView()" ) { + qDebug("nextView()"); emit nextView(); return; } bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data ); if (!res) |