summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt5
-rw-r--r--kaddressbook/kabcore.cpp2
-rw-r--r--kmicromail/composemail.cpp14
-rw-r--r--kmicromail/opiemail.cpp33
-rw-r--r--kmicromail/opiemail.h5
-rw-r--r--korganizer/koeventviewer.cpp56
-rw-r--r--korganizer/koeventviewer.h3
-rw-r--r--libkdepim/externalapphandler.cpp1
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
@@ -1,21 +1,24 @@
Info about the changes in new versions of KDE-Pim/Pi
********** VERSION 2.0.3 ************
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.
Added WhatsThis support for the todo view and the list view.
Added a quite useful feature to the montview.
Just click on the week numbers on the left.
And in the top right corner of month view/agenda view
there is now a "week number quick selector".
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
@@ -1202,19 +1202,24 @@
{ "Journal view","Journal" },
{ "Display all opened","Zeige alle geöffnet" },
{ "Display all closed","Zeige alle geschlossen" },
{ "Display all flat","Zeige alle flach" },
{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
{ "Default todo done color:","Standard Todo erledigt Farbe" },
{ "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
@@ -2488,25 +2488,25 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt
QStringList nameList;
QStringList emailList;
QStringList uidList;
KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
uint i=0;
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.
*/
void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
{
// qDebug("KABCore::requestForBirthdayList");
QStringList birthdayList;
QStringList anniversaryList;
diff --git a/kmicromail/composemail.cpp b/kmicromail/composemail.cpp
index ed8a2ee..3231b45 100644
--- a/kmicromail/composemail.cpp
+++ b/kmicromail/composemail.cpp
@@ -46,26 +46,27 @@
#include <qlabel.h>
#include <qtabwidget.h>
#include <qlistview.h>
//using namespace Opie::Core;
//using namespace Opie::Ui;
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" );
if ( whoami_uid.isEmpty() ) {
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" ) );
@@ -251,46 +252,53 @@ void ComposeMail::pickAddress( )
}
#else
bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/ompi", this->name() /* name is here the unique uid*/);
// the result should now arrive through method insertAttendees
#endif
}
//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" ) );
if (defmail.length()!=0) {
fromBox->insertItem(defmail);
}
QStringList::ConstIterator sit = emailList.begin();
int pref = 0;
for (;sit!=emailList.end();++sit) {
if ( (*sit)==defmail)
continue;
fromBox->insertItem((*sit));
}
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];
if ( ! _email.isEmpty() ) {
if ( ! names.isEmpty() )
names+= ",";
names+= "\""+_name +"\"<" +_email +">";
}
}
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index f56711d..e159b73 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -37,29 +37,31 @@
#include <qpe/qpeapplication.h>
#endif
#include <libmailwrapper/smtpwrapper.h>
#include <libmailwrapper/mailtypes.h>
#include <libmailwrapper/abstractmail.h>
#include "koprefs.h"
//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 )
delete tb;
}
void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
{
@@ -129,48 +131,53 @@ void OpieMail::slotwriteMail2(const QString& namemail )
}
int sub = to.find( ">:");
if ( sub > 0 ) {
compose.setTo( to.left(sub+1) );
compose.setSubject( to.mid(sub+2) );
} else
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 ");
ComposeMail compose( settings, this, 0, true );
if (!email.isEmpty())
{
if (!name.isEmpty())
{
compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">");
}
else
{
compose.setTo(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)
slotwriteMail2( QString () );
else {
if ( mPendingEmail == QString::null )
slotwriteMail2( mPendingName );
else
slotwriteMail( mPendingName, mPendingEmail );
@@ -291,28 +298,31 @@ void OpieMail::replyMail()
Settings *settings = new Settings();
ComposeMail composer( settings ,this, 0, true);
if (mail->Replyto().isEmpty()) {
composer.setTo( mail->getFrom());
} else {
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();
}
void OpieMail::slotDownloadMail( )
{
QListViewItem*item = mailView->currentItem();
if (!item ) {
@@ -628,14 +638,35 @@ void OpieMail::slotMoveCopyAllMail()
void OpieMail::reEditMail()
{
if (!mailView->currentItem()) return;
ComposeMail compose( settings, this, 0, true );
compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data());
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
@@ -1,61 +1,66 @@
// CHANGED 2004-09-31 Lutz Rogowski
#ifndef OPIEMAIL_H
#define OPIEMAIL_H
#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:
OpieMail( QWidget *parent = 0, const char *name = 0 );
virtual ~OpieMail();
static QString appName() { return QString::fromLatin1("kopiemail"); }
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();
virtual void slotEditAccounts();
virtual void displayMail();
virtual void replyMail();
virtual void slotDeleteMail();
virtual void slotGetMail();
virtual void slotGetAllMail();
virtual void slotDeleteAllMail();
virtual void mailHold(int, QListViewItem *,const QPoint&,int);
virtual void slotShowFolders( bool show );
virtual void refreshMailView(const QValueList<RecMailP>&);
virtual void mailLeftClicked( QListViewItem * );
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;
QTextBrowser * tb;
};
#endif
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp
index 7dc1880..bf41edb 100644
--- a/korganizer/koeventviewer.cpp
+++ b/korganizer/koeventviewer.cpp
@@ -117,26 +117,34 @@ void KOEventViewer::setSource(const QString& n)
}
}
}
return;
}
//requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
// 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
kdDebug() << "KOEventViewer::setSource(): " << n << endl;
QString tmpStr;
if (n.startsWith("mailto:")) {
KApplication::kApplication()->invokeMailer(n.mid(7),QString::null);
//emit showIncidence(n);
return;
@@ -165,25 +173,44 @@ void KOEventViewer::setSource(const QString& n)
QString iconPath = iconLoader->iconPath("go",KIcon::Small);
ActionManager::setStartedKAddressBook(true);
tmpStr = "kaddressbook --editor-only --uid ";
tmpStr += KProcess::quote(n.mid(6));
KRun::runCommand(tmpStr,"KAddressBook",iconPath);
return;
}
} 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;
if(number !=-1)
{
if (number > 0) {
int pos=0;
QString tmp;
for(int i=0;i<=number;i++) {
@@ -453,24 +480,27 @@ void KOEventViewer::formatAttendees(Incidence *event)
#endif
if (iconPath) {
mText += " <a href=\"mailto:" + event->organizer() + "\">";
mText += "<IMG src=\"" + iconPath + "\">";
mText += "</a>\n";
}
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();
if (!o.isEmpty() && addressList.size()<2) {
mText += "<a href=\"uid:" + o.uid() + "\">";
mText += o.formattedName();
mText += "</a>\n";
} else {
mText += "<li>";
@@ -492,37 +522,59 @@ void KOEventViewer::formatAttendees(Incidence *event)
#else
//qDebug("nokabc ");
mText += "<li><a href=\"uid:" + a->uid() + "\">";
if (!a->name().isEmpty()) mText += a->name();
else mText += a->email();
mText += "</a>\n";
#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;
if (mode == 0 ) {
addTag("h2",i18n("Journal from: "));
}
else {
if ( mode == 1 ) {
addTag("h2",i18n( "Local: " ) +i18n("Journal from: "));
diff --git a/korganizer/koeventviewer.h b/korganizer/koeventviewer.h
index 0cd3f33..cf44284 100644
--- a/korganizer/koeventviewer.h
+++ b/korganizer/koeventviewer.h
@@ -42,33 +42,34 @@ class KOEventViewer : public QTextBrowser {
void setTodo(Todo *event, bool clearV = true );
void setJournal(Journal *jour, bool clearV = true );
void appendEvent(Event *event, int mode = 0 );
void appendTodo(Todo *event, int mode = 0 );
void appendJournal(Journal *jour, int mode = 0 );
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);
void formatAttendees(Incidence *event);
void formatReadOnly(Incidence *event);
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
@@ -1122,24 +1122,25 @@ 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)
res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data );
if (!res)
res = mDisplayDetails->appMessage( cmsg, data );
// if (!res)