Hacked in a temporary fix for three GroupWare popups showing up when a single instance of a recurring meeting is resized in the agenda view

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1171222 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent 4da5936526
commit b35cd0e835

@ -328,6 +328,14 @@ bool IncidenceChanger::myAttendeeStatusChanged( Incidence *oldInc, Incidence *ne
bool IncidenceChanger::changeIncidence( Incidence *oldinc, Incidence *newinc, bool IncidenceChanger::changeIncidence( Incidence *oldinc, Incidence *newinc,
KOGlobals::WhatChanged action, KOGlobals::WhatChanged action,
TQWidget *parent ) TQWidget *parent )
{
return changeIncidence( oldinc, newinc, action, parent, 0 );
}
bool IncidenceChanger::changeIncidence( Incidence *oldinc, Incidence *newinc,
KOGlobals::WhatChanged action,
TQWidget *parent,
int dontAskForGroupware )
{ {
kdDebug(5850)<<"IncidenceChanger::changeIncidence for incidence \""<<newinc->summary()<<"\" ( old one was \""<<oldinc->summary()<<"\")"<<endl; kdDebug(5850)<<"IncidenceChanger::changeIncidence for incidence \""<<newinc->summary()<<"\" ( old one was \""<<oldinc->summary()<<"\")"<<endl;
if ( incidencesEqual( newinc, oldinc ) ) { if ( incidencesEqual( newinc, oldinc ) ) {
@ -347,7 +355,7 @@ kdDebug(5850)<<"IncidenceChanger::changeIncidence for incidence \""<<newinc->sum
success = KOGroupware::instance()->sendICalMessage( success = KOGroupware::instance()->sendICalMessage(
parent, parent,
KCal::Scheduler::Request, KCal::Scheduler::Request,
newinc, KOGlobals::INCIDENCEEDITED, attendeeStatusChanged ); newinc, KOGlobals::INCIDENCEEDITED, attendeeStatusChanged, dontAskForGroupware );
} }
if ( success ) { if ( success ) {
@ -365,6 +373,13 @@ kdDebug(5850)<<"IncidenceChanger::changeIncidence for incidence \""<<newinc->sum
bool IncidenceChanger::addIncidence( Incidence *incidence, bool IncidenceChanger::addIncidence( Incidence *incidence,
ResourceCalendar *res, const TQString &subRes, ResourceCalendar *res, const TQString &subRes,
TQWidget *parent ) TQWidget *parent )
{
return addIncidence( incidence, res, subRes, parent, 0 );
}
bool IncidenceChanger::addIncidence( Incidence *incidence,
ResourceCalendar *res, const TQString &subRes,
TQWidget *parent, int dontAskForGroupware )
{ {
CalendarResources *stdcal = dynamic_cast<CalendarResources *>( mCalendar ); CalendarResources *stdcal = dynamic_cast<CalendarResources *>( mCalendar );
if( stdcal && !stdcal->hasCalendarResources() ) { if( stdcal && !stdcal->hasCalendarResources() ) {
@ -440,7 +455,7 @@ bool IncidenceChanger::addIncidence( Incidence *incidence,
if ( !KOGroupware::instance()->sendICalMessage( if ( !KOGroupware::instance()->sendICalMessage(
parent, parent,
KCal::Scheduler::Request, KCal::Scheduler::Request,
incidence, KOGlobals::INCIDENCEADDED, false ) ) { incidence, KOGlobals::INCIDENCEADDED, false, dontAskForGroupware ) ) {
KMessageBox::sorry( KMessageBox::sorry(
parent, parent,
i18n( "Attempt to send the scheduling message failed. " i18n( "Attempt to send the scheduling message failed. "

@ -52,9 +52,14 @@ class IncidenceChanger : public KOrg::IncidenceChangerBase
bool addIncidence( Incidence *incidence, bool addIncidence( Incidence *incidence,
ResourceCalendar *res, const TQString &subRes, ResourceCalendar *res, const TQString &subRes,
TQWidget *parent ); TQWidget *parent );
bool addIncidence( Incidence *incidence,
ResourceCalendar *res, const TQString &subRes,
TQWidget *parent, int dontAskForGroupware );
bool changeIncidence( Incidence *oldinc, Incidence *newinc, bool changeIncidence( Incidence *oldinc, Incidence *newinc,
KOGlobals::WhatChanged, TQWidget *parent ); KOGlobals::WhatChanged, TQWidget *parent );
bool changeIncidence( Incidence *oldinc, Incidence *newinc,
KOGlobals::WhatChanged, TQWidget *parent, int dontAskForGroupware );
bool deleteIncidence( Incidence *incidence, TQWidget *parent ); bool deleteIncidence( Incidence *incidence, TQWidget *parent );

@ -57,9 +57,15 @@ public:
virtual bool addIncidence( Incidence *incidence, virtual bool addIncidence( Incidence *incidence,
ResourceCalendar *res, const TQString &subRes, ResourceCalendar *res, const TQString &subRes,
TQWidget *parent ) = 0; TQWidget *parent ) = 0;
virtual bool addIncidence( Incidence *incidence,
ResourceCalendar *res, const TQString &subRes,
TQWidget *parent, int dontAskForGroupware) = 0;
virtual bool changeIncidence( Incidence *oldinc, Incidence *newinc, virtual bool changeIncidence( Incidence *oldinc, Incidence *newinc,
KOGlobals::WhatChanged, TQWidget *parent ) = 0; KOGlobals::WhatChanged, TQWidget *parent ) = 0;
virtual bool changeIncidence( Incidence *oldinc, Incidence *newinc,
KOGlobals::WhatChanged, TQWidget *parent, int dontAskForGroupware ) = 0;
virtual bool deleteIncidence( Incidence *incidence, TQWidget *parent ) = 0; virtual bool deleteIncidence( Incidence *incidence, TQWidget *parent ) = 0;
virtual bool cutIncidences( const Incidence::List &incidences, TQWidget *parent ) = 0; virtual bool cutIncidences( const Incidence::List &incidences, TQWidget *parent ) = 0;

@ -1109,6 +1109,10 @@ void KOAgenda::endItemAction()
if ( chosenOption == KOGlobals::ONLY_THIS_ONE || if ( chosenOption == KOGlobals::ONLY_THIS_ONE ||
chosenOption == KOGlobals::ONLY_FUTURE ) { chosenOption == KOGlobals::ONLY_FUTURE ) {
// FIXME Prompt for this...it is quite possible that the user does not want to broadcast the change
// That prompting dialog will require the ability to suppress/override the mChanger->endChange GroupWare communication though.
int autoAnswerGroupWare = 1; // Send all possible GroupWare messages without prompting
// Store modification information in case it is needed to recreate the changes with a new actionitem... // Store modification information in case it is needed to recreate the changes with a new actionitem...
int mai_xl = mActionItem->cellXLeft(); int mai_xl = mActionItem->cellXLeft();
int mai_xr = mActionItem->cellXRight(); int mai_xr = mActionItem->cellXRight();
@ -1116,15 +1120,16 @@ void KOAgenda::endItemAction()
int mai_yb = mActionItem->cellYBottom(); int mai_yb = mActionItem->cellYBottom();
multiModify = true; multiModify = true;
emit startMultiModify( i18n("Dissociate event from recurrence") );
enableAgendaUpdate( false ); enableAgendaUpdate( false );
mChanger->addIncidence( incToChange, mResPair.first, mResPair.second, this ); mChanger->addIncidence( incToChange, mResPair.first, mResPair.second, this, autoAnswerGroupWare );
enableAgendaUpdate( true ); enableAgendaUpdate( true );
KOGlobals::WhatChanged wc = chosenOption == KOGlobals::ONLY_THIS_ONE ? KOGlobals::WhatChanged wc = chosenOption == KOGlobals::ONLY_THIS_ONE ?
KOGlobals::RECURRENCE_MODIFIED_ONE_ONLY : KOGlobals::RECURRENCE_MODIFIED_ONE_ONLY :
KOGlobals::RECURRENCE_MODIFIED_ALL_FUTURE; KOGlobals::RECURRENCE_MODIFIED_ALL_FUTURE;
mChanger->changeIncidence( oldIncSaved, inc, wc, this ); mChanger->changeIncidence( oldIncSaved, inc, wc, this, autoAnswerGroupWare );
// mActionItem does not exist any more, seeing as we just got done deleting it // mActionItem does not exist any more, seeing as we just got done deleting it
// (by deleting/replacing the original incidence it was created from through // (by deleting/replacing the original incidence it was created from through

@ -242,7 +242,8 @@ bool KOGroupware::sendICalMessage( TQWidget* parent,
KCal::Scheduler::Method method, KCal::Scheduler::Method method,
Incidence* incidence, Incidence* incidence,
KOGlobals::HowChanged action, KOGlobals::HowChanged action,
bool attendeeStatusChanged ) bool attendeeStatusChanged,
int dontAskForGroupware )
{ {
// If there are no attendees, don't bother // If there are no attendees, don't bother
if( incidence->attendees().isEmpty() ) if( incidence->attendees().isEmpty() )
@ -264,108 +265,116 @@ bool KOGroupware::sendICalMessage( TQWidget* parent,
* insists on applying them. * insists on applying them.
*/ */
if ( isOrganizer ) { if ( dontAskForGroupware == 1 ) {
/* We are the organizer. If there is more than one attendee, or if there is rc = KMessageBox::Yes;
* only one, and it's not the same as the organizer, ask the user to send }
* mail. */ else if ( dontAskForGroupware == 2 ) {
if ( incidence->attendees().count() > 1 rc = KMessageBox::No;
|| incidence->attendees().first()->email() != incidence->organizer().email() ) { }
else {
TQString txt; if ( isOrganizer ) {
switch( action ) { /* We are the organizer. If there is more than one attendee, or if there is
case KOGlobals::INCIDENCEEDITED: * only one, and it's not the same as the organizer, ask the user to send
txt = i18n( "You changed the invitation \"%1\".\n" * mail. */
"Do you want to email the attendees an update message?" ). if ( incidence->attendees().count() > 1
arg( incidence->summary() ); || incidence->attendees().first()->email() != incidence->organizer().email() ) {
break;
case KOGlobals::INCIDENCEDELETED: TQString txt;
Q_ASSERT( incidence->type() == "Event" || incidence->type() == "Todo" ); switch( action ) {
if ( incidence->type() == "Event" ) { case KOGlobals::INCIDENCEEDITED:
txt = i18n( "You removed the invitation \"%1\".\n" txt = i18n( "You changed the invitation \"%1\".\n"
"Do you want to email the attendees that the event is canceled?" ). "Do you want to email the attendees an update message?" ).
arg( incidence->summary() );
} else if ( incidence->type() == "Todo" ) {
txt = i18n( "You removed the invitation \"%1\".\n"
"Do you want to email the attendees that the todo is canceled?" ).
arg( incidence->summary() );
}
break;
case KOGlobals::INCIDENCEADDED:
if ( incidence->type() == "Event" ) {
txt = i18n( "The event \"%1\" includes other people.\n"
"Do you want to email the invitation to the attendees?" ).
arg( incidence->summary() );
} else if ( incidence->type() == "Todo" ) {
txt = i18n( "The todo \"%1\" includes other people.\n"
"Do you want to email the invitation to the attendees?" ).
arg( incidence->summary() ); arg( incidence->summary() );
} else { break;
txt = i18n( "This incidence includes other people. " case KOGlobals::INCIDENCEDELETED:
"Should an email be sent to the attendees?" ); Q_ASSERT( incidence->type() == "Event" || incidence->type() == "Todo" );
if ( incidence->type() == "Event" ) {
txt = i18n( "You removed the invitation \"%1\".\n"
"Do you want to email the attendees that the event is canceled?" ).
arg( incidence->summary() );
} else if ( incidence->type() == "Todo" ) {
txt = i18n( "You removed the invitation \"%1\".\n"
"Do you want to email the attendees that the todo is canceled?" ).
arg( incidence->summary() );
}
break;
case KOGlobals::INCIDENCEADDED:
if ( incidence->type() == "Event" ) {
txt = i18n( "The event \"%1\" includes other people.\n"
"Do you want to email the invitation to the attendees?" ).
arg( incidence->summary() );
} else if ( incidence->type() == "Todo" ) {
txt = i18n( "The todo \"%1\" includes other people.\n"
"Do you want to email the invitation to the attendees?" ).
arg( incidence->summary() );
} else {
txt = i18n( "This incidence includes other people. "
"Should an email be sent to the attendees?" );
}
break;
default:
kdError() << "Unsupported HowChanged action" << int( action ) << endl;
break;
} }
break;
default:
kdError() << "Unsupported HowChanged action" << int( action ) << endl;
break;
}
rc = KMessageBox::questionYesNo( rc = KMessageBox::questionYesNo(
parent, txt, i18n( "Group Scheduling Email" ), parent, txt, i18n( "Group Scheduling Email" ),
KGuiItem( i18n( "Send Email" ) ), KGuiItem( i18n( "Do Not Send" ) ) ); KGuiItem( i18n( "Send Email" ) ), KGuiItem( i18n( "Do Not Send" ) ) );
} else { } else {
return true; return true;
} }
} else if( incidence->type() == "Todo" ) { } else if( incidence->type() == "Todo" ) {
if( method == Scheduler::Request ) if( method == Scheduler::Request )
// This is an update to be sent to the organizer // This is an update to be sent to the organizer
method = Scheduler::Reply; method = Scheduler::Reply;
// Ask if the user wants to tell the organizer about the current status // Ask if the user wants to tell the organizer about the current status
TQString txt = i18n( "Do you want to send a status update to the " TQString txt = i18n( "Do you want to send a status update to the "
"organizer of this task?"); "organizer of this task?");
rc = KMessageBox::questionYesNo( parent, txt, TQString::null, i18n("Send Update"), i18n("Do Not Send") );
} else if( incidence->type() == "Event" ) {
TQString txt;
if ( attendeeStatusChanged && method == Scheduler::Request ) {
txt = i18n( "Your status as an attendee of this event changed. "
"Do you want to send a status update to the event organizer?" );
method = Scheduler::Reply;
rc = KMessageBox::questionYesNo( parent, txt, TQString::null, i18n("Send Update"), i18n("Do Not Send") ); rc = KMessageBox::questionYesNo( parent, txt, TQString::null, i18n("Send Update"), i18n("Do Not Send") );
} else { } else if( incidence->type() == "Event" ) {
if( action == KOGlobals::INCIDENCEDELETED ) { TQString txt;
const TQStringList myEmails = KOPrefs::instance()->allEmails(); if ( attendeeStatusChanged && method == Scheduler::Request ) {
bool askConfirmation = false; txt = i18n( "Your status as an attendee of this event changed. "
for ( TQStringList::ConstIterator it = myEmails.begin(); it != myEmails.end(); ++it ) { "Do you want to send a status update to the event organizer?" );
TQString email = *it; method = Scheduler::Reply;
Attendee *me = incidence->attendeeByMail(email); rc = KMessageBox::questionYesNo( parent, txt, TQString::null, i18n("Send Update"), i18n("Do Not Send") );
if (me && (me->status()==KCal::Attendee::Accepted || me->status()==KCal::Attendee::Delegated)) { } else {
askConfirmation = true; if( action == KOGlobals::INCIDENCEDELETED ) {
break; const TQStringList myEmails = KOPrefs::instance()->allEmails();
bool askConfirmation = false;
for ( TQStringList::ConstIterator it = myEmails.begin(); it != myEmails.end(); ++it ) {
TQString email = *it;
Attendee *me = incidence->attendeeByMail(email);
if (me && (me->status()==KCal::Attendee::Accepted || me->status()==KCal::Attendee::Delegated)) {
askConfirmation = true;
break;
}
} }
}
if ( !askConfirmation ) { if ( !askConfirmation ) {
return true; return true;
} }
txt = i18n( "You had previously accepted an invitation to this event. " txt = i18n( "You had previously accepted an invitation to this event. "
"Do you want to send an updated response to the organizer " "Do you want to send an updated response to the organizer "
"declining the invitation?" ); "declining the invitation?" );
rc = KMessageBox::questionYesNo( rc = KMessageBox::questionYesNo(
parent, txt, i18n( "Group Scheduling Email" ), parent, txt, i18n( "Group Scheduling Email" ),
KGuiItem( i18n( "Send Update" ) ), KGuiItem( i18n( "Do Not Send" ) ) ); KGuiItem( i18n( "Send Update" ) ), KGuiItem( i18n( "Do Not Send" ) ) );
setDoNotNotify( rc == KMessageBox::No ); setDoNotNotify( rc == KMessageBox::No );
} else { } else {
txt = i18n( "You are not the organizer of this event. Editing it will " txt = i18n( "You are not the organizer of this event. Editing it will "
"bring your calendar out of sync with the organizer's calendar. " "bring your calendar out of sync with the organizer's calendar. "
"Do you really want to edit it?" ); "Do you really want to edit it?" );
rc = KMessageBox::warningYesNo( parent, txt ); rc = KMessageBox::warningYesNo( parent, txt );
return ( rc == KMessageBox::Yes ); return ( rc == KMessageBox::Yes );
}
} }
} else {
kdWarning(5850) << "Groupware messages for Journals are not implemented yet!" << endl;
return true;
} }
} else {
kdWarning(5850) << "Groupware messages for Journals are not implemented yet!" << endl;
return true;
} }
if ( rc == KMessageBox::Yes ) { if ( rc == KMessageBox::Yes ) {

@ -78,7 +78,8 @@ class KOGroupware : public QObject
bool sendICalMessage( TQWidget *parent, KCal::Scheduler::Method method, bool sendICalMessage( TQWidget *parent, KCal::Scheduler::Method method,
Incidence* incidence, Incidence* incidence,
KOGlobals::HowChanged action, KOGlobals::HowChanged action,
bool attendeeStatusChanged ); bool attendeeStatusChanged,
int dontAskForGroupware = 0 );
/** /**
Send counter proposal message. Send counter proposal message.

Loading…
Cancel
Save