[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdepim
From:       Pradeepto Bhattacharya <pradeepto () kde ! org>
Date:       2008-07-23 5:48:07
Message-ID: 1216792087.155484.2549.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 836832 by pradeepto:

Merged revisions 781595 via svnmerge from 
svn+ssh://pradeepto@svn.kde.org/home/kde/branches/kdepim/enterprise/kdepim

........
  r781595 | ervin | 2008-03-03 15:33:49 +0530 (Mon, 03 Mar 2008) | 7 lines
  
  By default insert the organizer as an attendee. When the user
  change the organizer ask if we want to keep the corresponding attendee
  or not.
  
  Addresses kolab/issue2297.
........


 _M            . (directory)  
 M  +59 -0     korganizer/koeditorfreebusy.cpp  
 M  +4 -0      korganizer/koeditorfreebusy.h  


** branches/KDE/3.5/kdepim #property svnmerge-integrated
   - /branches/kdepim/enterprise/kdepim:1-767022,767033,767233-767554,767556,767558-76 \
7946,767948-769318,769320-769354,769356-771105,771107-771251,771253-772311,772313-7723 \
16,772318-775194,775196-775202,775204,775207-775211,775213-778001,778003-778004,778007 \
,778010-778011,778013-778029,778031-778727,778729-779448,779450-779482,779484-779505,7 \
79507-779852,779854-779994,780211,780251,782647-783127,783129-783243,783245,783248-783 \
477,783479-783847,784547,787827,817568,817604,817710-818288,818312-819076,819078-82007 \
3,820075-821035,821037-821124,821126-821378,821380-821648,821650-821813,821815-821835, \
821837-822268,822270-823864,823866-824217,824219-824277,824279-824285,824287-824288,82 \
4290-824805,824807-825075,825077-825083,825085-826354,826356-827491,830100,830443  + \
/branches/kdepim/enterprise/kdepim:1-767022,767033,767233-767554,767556,767558-767946, \
767948-769318,769320-769354,769356-771105,771107-771251,771253-772311,772313-772316,77 \
2318-775194,775196-775202,775204,775207-775211,775213-778001,778003-778004,778007,7780 \
10-778011,778013-778029,778031-778727,778729-779448,779450-779482,779484-779505,779507 \
-779852,779854-779994,780211,780251,781595,782647-783127,783129-783243,783245,783248-7 \
83477,783479-783847,784547,787827,817568,817604,817710-818288,818312-819076,819078-820 \
073,820075-821035,821037-821124,821126-821378,821380-821648,821650-821813,821815-82183 \
5,821837-822268,822270-823864,823866-824217,824219-824277,824279-824285,824287-824288, \
                824290-824805,824807-825075,825077-825083,825085-826354,826356-827491,830100,830443
                
--- branches/KDE/3.5/kdepim/korganizer/koeditorfreebusy.cpp #836831:836832
@@ -47,6 +47,8 @@
 #include <libkcal/event.h>
 #include <libkcal/freebusy.h>
 
+#include <libemailfunctions/email.h>
+
 #include <kdgantt/KDGanttView.h>
 #include <kdgantt/KDGanttViewTaskItem.h>
 #include <kdgantt/KDGanttViewSubwidgets.h>
@@ -337,6 +339,10 @@
   initEditWidgets( this, topLayout );
   connect( mRemoveButton, SIGNAL(clicked()),
            SLOT(removeAttendee()) );
+
+  slotOrganizerChanged( mOrganizerCombo->currentText() );
+  connect( mOrganizerCombo, SIGNAL( activated(const QString&) ),
+           this, SLOT( slotOrganizerChanged(const QString&) ) );
 }
 
 KOEditorFreeBusy::~KOEditorFreeBusy()
@@ -856,4 +862,57 @@
     addNewAttendee();
 }
 
+void KOEditorFreeBusy::slotOrganizerChanged(const QString & newOrganizer)
+{
+  if (newOrganizer==mCurrentOrganizer) return;
+
+  QString name;
+  QString email;
+  bool success = KPIM::getNameAndMail( newOrganizer, name, email );
+
+  if (!success) return;
+//
+
+  Attendee *currentOrganizerAttendee = 0;
+  Attendee *newOrganizerAttendee = 0;
+
+  FreeBusyItem *anItem =
+    static_cast<FreeBusyItem *>( mGanttView->firstChild() );
+  while( anItem ) {
+    Attendee *attendee = anItem->attendee();
+    if( attendee->fullName() == mCurrentOrganizer )
+      currentOrganizerAttendee = attendee;
+
+    if( attendee->fullName() == newOrganizer )
+      newOrganizerAttendee = attendee;
+
+    anItem = static_cast<FreeBusyItem *>( anItem->nextSibling() );
+  }
+
+  int answer = KMessageBox::No;
+
+  if (currentOrganizerAttendee) {
+    answer = KMessageBox::questionYesNo( this, i18n("You are changing the organiser \
of " +                                                    "this event, who is also \
attending, " +                                                    "do you want to \
change that attendee " +                                                    "as \
well?") ); +  } else {
+    answer = KMessageBox::Yes;
+  }
+
+  if (answer==KMessageBox::Yes) {
+    if (currentOrganizerAttendee) {
+      removeAttendee( currentOrganizerAttendee );
+    }
+
+    if (!newOrganizerAttendee) {
+      Attendee *a = new Attendee( name, email, true );
+      insertAttendee( a, false );
+      updateAttendee();
+    }
+  }
+
+  mCurrentOrganizer = newOrganizer;
+}
+
 #include "koeditorfreebusy.moc"
--- branches/KDE/3.5/kdepim/korganizer/koeditorfreebusy.h #836831:836832
@@ -97,6 +97,8 @@
     void clearSelection() const;
     void changeStatusForMe( KCal::Attendee::PartStat status );
 
+  private slots:
+    void slotOrganizerChanged( const QString &newOrganizer );
   private:
     void updateFreeBusyData( FreeBusyItem * );
 
@@ -117,6 +119,8 @@
     QTimer mReloadTimer;
 
     bool mForceDownload;
+
+    QString mCurrentOrganizer;
 };
 
 #endif


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic