Re: [evolution-patches] Patch to add open menu to right click popup for attachment(s) in meetings.



Hi,

I have split the patch into 2 parts:
	-> Desentitize the event editor for GWmeeting(s).
	-> Addition of open menu to right click popup for attachment(s) in
calendar.

And made appropriate changes those mentioned.

Bug ids they resolve are #309681, #312192.





Thanks,
Viren

On Fri, 2005-07-29 at 21:01 +0530, Harish Krishnaswamy wrote:
> Hi,
>   
>  A few suggestions...
> 
>       *  The patch seems to address multiple issues - open as well as
>         modify  attachments, (de)sensitizing  widgets for DnD events.
>         Kindly split them into different cohesive patches. This makes it
>         easy to manipulate them while merging them with other branches,
>         reverting them etc.
>       * mention the bug ids that the patch proposes to solve.
>       * As this patch modifies the ui and we are beyond the UI freeze,
>         this must be approved by the release team and GDP should be
>         notified as well. 
>   
> > 
> > +       E_CAL_POPUP_MODIFY_ATTACHMENTS = 1<<2,/* check to open/remove
> > attachments */
> Opening an attachment does not modify it. Hence the name is not entirely
> consistent with its use.
> 
> >  }; 
> > +ECalPopupTargetAttachments * e_cal_popup_target_new_attachments
> > (ECalPopup *ecp, CompEditor *editor, GSList *attachments);
> pl. remove the unwanted space. 
> 
> 
> > +       ECal *client;
> > +       gboolean read_only;
> > +       CompEditorFlags flags;
> > +
> > +       client = comp_editor_get_e_cal (editor);
> > +       flags = comp_editor_get_flags (editor);
> > +       e_cal_is_read_only (client, &read_only, NULL);
> 
> Use the return value from e_cal_is_read_only and handle errors here.
> 
> >         t->attachments = attachments;
> > +       
> > +       if (!read_only && ((flags & COMP_EDITOR_USER_ORG) || 
> > +                               (flags & COMP_EDITOR_NEW_ITEM) ||
> > +                               !(flags &
> > COMP_EDITOR_MEETING)))        
> Checking if it is not a meeting before checking if the user is an
> organizer makes this more readable.
> 
>  
> > 
> > -       gboolean read_only, custom, alarm, sens = TRUE;
> > +       gboolean read_only, custom, alarm, user_org = TRUE;
> 
> 
> > +       gtk_widget_set_sensitive (priv->summary_label, !read_only &&
> > user_org);
> > +       gtk_entry_set_editable (GTK_ENTRY (priv->summary), !read_only
> > && user_org);
> > +       gtk_widget_set_sensitive (priv->location_label, !read_only &&
> > user_org);
> > +       gtk_entry_set_editable (GTK_ENTRY (priv->location), !read_only
> > && user_org);
> > +       gtk_widget_set_sensitive (priv->start_time, !read_only &&
> > user_org);
> > +       gtk_widget_set_sensitive (priv->start_timezone, !read_only &&
> > user_org);
> > +       gtk_widget_set_sensitive (priv->end_time, !read_only &&
> > user_org);
> > +       gtk_widget_set_sensitive (priv->end_timezone, !read_only &&
> > user_org);
> > +       gtk_widget_set_sensitive (priv->all_day_event, !read_only &&
> > user_org);
> > +       gtk_widget_set_sensitive (priv->description, !read_only &&
> > user_org);
> > +       gtk_widget_set_sensitive (priv->classification, !read_only &&
> > user_org);
> > +       gtk_widget_set_sensitive (priv->show_time_as_busy, !read_only
> > && user_org);
> The !read_only && user_org is computed 12 times. 
> How about calling 'sensitize' or something as before, 
> computing sensitize = !read_only && <get static cap here> once
> and using it.
> 
> > 
> > +
> 
> comp_uid is being leaked here. (evil of copy-paste - the original code
> (authored by yours truly (sigh)) leaks this too :(
> can you make this a function call instead of duplicating code ?
>   
> Thanks,
> Harish
> 
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
Index: gui/e-calendar-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-view.c,v
retrieving revision 1.88
diff -u -p -r1.88 e-calendar-view.c
--- gui/e-calendar-view.c	25 Jul 2005 04:55:59 -0000	1.88
+++ gui/e-calendar-view.c	2 Aug 2005 08:39:14 -0000
@@ -1801,8 +1801,11 @@ e_calendar_view_edit_appointment (ECalen
 		ECalComponent *comp = e_cal_component_new ();
 		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));
 		flags |= COMP_EDITOR_MEETING;
-		if (itip_organizer_is_user (comp, client))
+		
+		if (itip_organizer_is_user (comp, client) &&
+				!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_ORGANIZER)) 
 			flags |= COMP_EDITOR_USER_ORG;
+
 		g_object_unref (comp);
 	}
 
Index: gui/e-cal-popup.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-popup.h,v
retrieving revision 1.8
diff -u -p -r1.8 e-cal-popup.h
--- gui/e-cal-popup.h	25 Jul 2005 05:18:51 -0000	1.8
+++ gui/e-cal-popup.h	2 Aug 2005 08:39:14 -0000
@@ -25,6 +25,7 @@
 #include <glib-object.h>
 
 #include "e-util/e-popup.h"
+#include "dialogs/comp-editor.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -111,6 +112,7 @@ enum _e_cal_popup_target_source_t {
 enum _e_cal_popup_target_attachments_t {
 	E_CAL_POPUP_ATTACHMENTS_ONE = 1<<0, /* only 1 selected */
 	E_CAL_POPUP_ATTACHMENTS_MANY = 1<<1, /* one or more selected */
+	E_CAL_POPUP_ATTACHMENTS_MODIFY =1<<2, /* check for modify operation */
 };
 
 typedef struct _ECalPopupTargetSelect ECalPopupTargetSelect;
@@ -184,7 +186,8 @@ ECalPopup *e_cal_popup_new(const char *m
 
 ECalPopupTargetSelect *e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArray *events);
 ECalPopupTargetSource *e_cal_popup_target_new_source(ECalPopup *eabp, struct _ESourceSelector *selector);
-ECalPopupTargetAttachments * e_cal_popup_target_new_attachments (ECalPopup *ecp, GSList *attachments);
+ECalPopupTargetAttachments * e_cal_popup_target_new_attachments (ECalPopup *ecp, 
+								CompEditor *editor, GSList *attachments);
 
 /* ********************************************************************** */
 
Index: gui/e-cal-popup.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-popup.c,v
retrieving revision 1.14
diff -u -p -r1.14 e-cal-popup.c
--- gui/e-cal-popup.c	25 Jul 2005 11:50:55 -0000	1.14
+++ gui/e-cal-popup.c	2 Aug 2005 08:39:15 -0000
@@ -347,11 +347,26 @@ e_cal_popup_target_new_source(ECalPopup 
  * Return value: 
  **/
 ECalPopupTargetAttachments *
-e_cal_popup_target_new_attachments(ECalPopup *ecp, GSList *attachments)
+e_cal_popup_target_new_attachments(ECalPopup *ecp, CompEditor *editor, GSList *attachments)
 {
 	ECalPopupTargetAttachments *t = e_popup_target_new(&ecp->popup, E_CAL_POPUP_TARGET_ATTACHMENTS, sizeof(*t));
 	guint32 mask = ~0;
 	int len = g_slist_length(attachments);
+	ECal *client = comp_editor_get_e_cal (editor);
+	CompEditorFlags flags = comp_editor_get_flags (editor);
+	gboolean read_only = FALSE;
+	GError *error = NULL;
+
+	if (!e_cal_is_read_only (client, &read_only, &error)) {
+		if (error->code != E_CALENDAR_STATUS_BUSY)
+			read_only = TRUE;
+		g_error_free (error);
+	}	
+
+	if (!read_only && (!(flags & COMP_EDITOR_MEETING) || 
+				(flags & COMP_EDITOR_NEW_ITEM) || 
+				(flags & COMP_EDITOR_USER_ORG)))
+		mask &= ~ E_CAL_POPUP_ATTACHMENTS_MODIFY;
 
 	t->attachments = attachments;
 	if (len > 0)
@@ -423,6 +438,7 @@ static const EPopupHookTargetMask ecalph
 static const EPopupHookTargetMask ecalph_attachments_masks[] = {
 	{ "one", E_CAL_POPUP_ATTACHMENTS_ONE },
 	{ "many", E_CAL_POPUP_ATTACHMENTS_MANY },
+	{ "modify", E_CAL_POPUP_ATTACHMENTS_MODIFY },
 	{ 0 }
 };
 
Index: gui/dialogs/event-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-page.c,v
retrieving revision 1.87
diff -u -p -r1.87 event-page.c
--- gui/dialogs/event-page.c	6 Jul 2005 13:31:28 -0000	1.87
+++ gui/dialogs/event-page.c	2 Aug 2005 08:39:16 -0000
@@ -603,7 +603,7 @@ is_custom_alarm_store (EAlarmList *alarm
 static void
 sensitize_widgets (EventPage *epage)
 {
-	gboolean read_only, custom, alarm, sens = TRUE;
+	gboolean read_only, custom, alarm, sens = TRUE, sensitize;
 	EventPagePrivate *priv;
 	
 	priv = epage->priv;
@@ -612,22 +612,24 @@ sensitize_widgets (EventPage *epage)
 
 	if (!e_cal_is_read_only (COMP_EDITOR_PAGE (epage)->client, &read_only, NULL))
 		read_only = TRUE;
+	
+	sensitize = !read_only && sens;
 
 	custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL);
 	alarm = e_dialog_toggle_get (priv->alarm);
 	
-	gtk_widget_set_sensitive (priv->summary_label, !read_only && sens);
-	gtk_entry_set_editable (GTK_ENTRY (priv->summary), !read_only && sens);
-	gtk_widget_set_sensitive (priv->location_label, !read_only && sens);
-	gtk_entry_set_editable (GTK_ENTRY (priv->location), !read_only && sens);
-	gtk_widget_set_sensitive (priv->start_time, !read_only && sens);
-	gtk_widget_set_sensitive (priv->start_timezone, !read_only && sens);
-	gtk_widget_set_sensitive (priv->end_time, !read_only && sens);
-	gtk_widget_set_sensitive (priv->end_timezone, !read_only && sens);
-	gtk_widget_set_sensitive (priv->all_day_event, !read_only && sens);
-	gtk_widget_set_sensitive (priv->description, !read_only && sens);
-	gtk_widget_set_sensitive (priv->classification, !read_only && sens);
-	gtk_widget_set_sensitive (priv->show_time_as_busy, !read_only && sens);
+	gtk_widget_set_sensitive (priv->summary_label, sensitize);
+	gtk_entry_set_editable (GTK_ENTRY (priv->summary), sensitize);
+	gtk_widget_set_sensitive (priv->location_label, sensitize);
+	gtk_entry_set_editable (GTK_ENTRY (priv->location), sensitize);
+	gtk_widget_set_sensitive (priv->start_time, sensitize);
+	gtk_widget_set_sensitive (priv->start_timezone, sensitize);
+	gtk_widget_set_sensitive (priv->end_time, sensitize);
+	gtk_widget_set_sensitive (priv->end_timezone, sensitize);
+	gtk_widget_set_sensitive (priv->all_day_event, sensitize);
+	gtk_widget_set_sensitive (priv->description, sensitize);
+	gtk_widget_set_sensitive (priv->classification, sensitize);
+	gtk_widget_set_sensitive (priv->show_time_as_busy, sensitize);
 	gtk_widget_set_sensitive (priv->alarm, !read_only);
 	gtk_widget_set_sensitive (priv->alarm_time, !read_only && !custom && alarm);
 	gtk_widget_set_sensitive (priv->alarm_custom, alarm);
@@ -635,9 +637,9 @@ sensitize_widgets (EventPage *epage)
 		gtk_widget_show (priv->alarm_warning);
 	else
 		gtk_widget_hide (priv->alarm_warning);
-	gtk_widget_set_sensitive (priv->categories_btn, !read_only && sens);
-	gtk_widget_set_sensitive (priv->sendoptions_button, !read_only && sens);
-	gtk_entry_set_editable (GTK_ENTRY (priv->categories), !read_only && sens);
+	gtk_widget_set_sensitive (priv->categories_btn, sensitize);
+	gtk_widget_set_sensitive (priv->sendoptions_button, sensitize);
+	gtk_entry_set_editable (GTK_ENTRY (priv->categories), sensitize);
 
 	if (COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE) {
 		gtk_widget_set_sensitive (priv->sendoptions_button, TRUE);
Index: gui/dialogs/event-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-editor.c,v
retrieving revision 1.68
diff -u -p -r1.68 event-editor.c
--- gui/dialogs/event-editor.c	4 Jul 2005 09:37:24 -0000	1.68
+++ gui/dialogs/event-editor.c	2 Aug 2005 08:39:16 -0000
@@ -410,7 +410,9 @@ static void
 show_meeting (EventEditor *ee)
 {
 	EventEditorPrivate *priv;
-
+	CompEditor *editor = COMP_EDITOR (ee);
+	CompEditorFlags flags = comp_editor_get_flags (editor);
+	
 	priv = ee->priv;
 
 	event_page_set_meeting (priv->event_page, TRUE);
@@ -428,6 +430,9 @@ show_meeting (EventEditor *ee)
 	}
  	if (comp_editor_get_flags (COMP_EDITOR (ee)) & COMP_EDITOR_DELEGATE)
  		comp_editor_show_page (COMP_EDITOR (ee), COMP_EDITOR_PAGE (priv->meet_page));
+
+	if (!(flags & COMP_EDITOR_NEW_ITEM) && !(flags & COMP_EDITOR_USER_ORG))
+		gtk_drag_dest_unset (GTK_WIDGET (editor));
 }
 
 void
Index: gui/dialogs/meeting-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/meeting-page.c,v
retrieving revision 1.103
diff -u -p -r1.103 meeting-page.c
--- gui/dialogs/meeting-page.c	11 Jul 2005 02:35:49 -0000	1.103
+++ gui/dialogs/meeting-page.c	2 Aug 2005 08:39:17 -0000
@@ -384,9 +384,6 @@ meeting_page_fill_widgets (CompEditorPag
 			gtk_widget_hide (priv->organizer_table);
 			gtk_widget_show (priv->existing_organizer_table);
 			if (itip_organizer_is_user (comp, page->client)) {
-				gtk_widget_set_sensitive (priv->invite, TRUE);
-				gtk_widget_set_sensitive (priv->add, TRUE);
-				gtk_widget_set_sensitive (priv->remove, TRUE);
 				if (e_cal_get_static_capability (
 					    page->client,
 					    CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS))
@@ -433,6 +430,7 @@ meeting_page_fill_widgets (CompEditorPag
 	}
 	
 	priv->updating = FALSE;
+	priv->user_org = page->flags & COMP_EDITOR_PAGE_USER_ORG;
 
 	sensitize_widgets (mpage);
 
Index: gui/dialogs/recurrence-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/recurrence-page.c,v
retrieving revision 1.67
diff -u -p -r1.67 recurrence-page.c
--- gui/dialogs/recurrence-page.c	23 Jun 2005 09:11:05 -0000	1.67
+++ gui/dialogs/recurrence-page.c	2 Aug 2005 08:39:18 -0000
@@ -474,7 +474,9 @@ sensitize_recur_widgets (RecurrencePage 
 	GtkWidget *label;
 
 	priv = rpage->priv;
-	sens = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG;
+	
+	if (COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_MEETING)
+		sens = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG;
 
 	recurs = e_dialog_toggle_get (priv->recurs);
 	
@@ -511,7 +513,7 @@ sensitize_recur_widgets (RecurrencePage 
 static void
 sensitize_buttons (RecurrencePage *rpage)
 {
-	gboolean read_only, sens = TRUE;
+	gboolean read_only, sensitize = TRUE;
 	gint selected_rows;
 	RecurrencePagePrivate *priv;
 	icalcomponent *icalcomp;
@@ -519,7 +521,7 @@ sensitize_buttons (RecurrencePage *rpage
 
 	priv = rpage->priv;
 	if (COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_MEETING)
-		sens = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG;
+		sensitize = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG;
 	
 	selected_rows = gtk_tree_selection_count_selected_rows (
 		gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list)));
@@ -554,10 +556,10 @@ sensitize_buttons (RecurrencePage *rpage
 	else
 		gtk_widget_set_sensitive (priv->params, FALSE);
 
-	gtk_widget_set_sensitive (priv->recurs, !read_only && sens);
-	gtk_widget_set_sensitive (priv->exception_add, !read_only && e_cal_component_has_recurrences (priv->comp) && sens);
-	gtk_widget_set_sensitive (priv->exception_modify, !read_only && selected_rows > 0 && sens);
-	gtk_widget_set_sensitive (priv->exception_delete, !read_only && selected_rows > 0 && sens);
+	gtk_widget_set_sensitive (priv->recurs, !read_only && sensitize);
+	gtk_widget_set_sensitive (priv->exception_add, !read_only && e_cal_component_has_recurrences (priv->comp) && sensitize);
+	gtk_widget_set_sensitive (priv->exception_modify, !read_only && selected_rows > 0 && sensitize);
+	gtk_widget_set_sensitive (priv->exception_delete, !read_only && selected_rows > 0 && sensitize);
 }
 
 #if 0
Index: gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.143
diff -u -p -r1.143 comp-editor.c
--- gui/dialogs/comp-editor.c	20 Jul 2005 11:18:54 -0000	1.143
+++ gui/dialogs/comp-editor.c	2 Aug 2005 08:39:19 -0000
@@ -1056,10 +1056,10 @@ cab_remove(EPopup *ep, EPopupItem *item,
 
 /* Popup menu handling.  */
 static EPopupItem cab_popups[] = {
-	{ E_POPUP_ITEM, "10.attach", N_("_Remove"), cab_remove, NULL, GTK_STOCK_REMOVE, E_CAL_POPUP_ATTACHMENTS_MANY },
+	{ E_POPUP_ITEM, "10.attach", N_("_Remove"), cab_remove, NULL, GTK_STOCK_REMOVE, E_CAL_POPUP_ATTACHMENTS_MANY | E_CAL_POPUP_ATTACHMENTS_MODIFY },
 	{ E_POPUP_ITEM, "20.attach", N_("_Properties"), cab_properties, NULL, GTK_STOCK_PROPERTIES, E_CAL_POPUP_ATTACHMENTS_ONE },
 	{ E_POPUP_BAR, "30.attach.00", NULL, NULL, NULL, NULL, E_CAL_POPUP_ATTACHMENTS_MANY|E_CAL_POPUP_ATTACHMENTS_ONE },
-	{ E_POPUP_ITEM, "30.attach.01", N_("_Add attachment..."), cab_add, NULL, GTK_STOCK_ADD, 0 },
+	{ E_POPUP_ITEM, "30.attach.01", N_("_Add attachment..."), cab_add, NULL, GTK_STOCK_ADD, E_CAL_POPUP_ATTACHMENTS_MODIFY },
 };
 
 static void
@@ -1100,6 +1100,7 @@ cab_popup(EAttachmentBar *bar, GdkEventB
 	ECalPopup *ecp;
 	ECalPopupTargetAttachments *t;
 	GtkMenu *menu;
+       CompEditor *editor = COMP_EDITOR (gtk_widget_get_toplevel (GTK_WIDGET (bar)));
 
         attachments = e_attachment_bar_get_attachment(bar, id);
 
@@ -1115,7 +1116,7 @@ cab_popup(EAttachmentBar *bar, GdkEventB
 	 */
 	ecp = e_cal_popup_new("org.gnome.evolution.calendar.attachmentbar.popup");
 	e_popup_add_items((EPopup *)ecp, menus, NULL, cab_popups_free, bar);
-	t = e_cal_popup_target_new_attachments(ecp, attachments);
+	t = e_cal_popup_target_new_attachments(ecp, editor, attachments);
 	t->target.widget = (GtkWidget *)bar;
 	menu = e_popup_create_menu_once((EPopup *)ecp, (EPopupTarget *)t, 0);
 
@@ -1254,19 +1255,6 @@ setup_widgets (CompEditor *editor)
 	
 }
 
-void
-comp_editor_sensitize_attachment_bar (CompEditor *editor, gboolean  set)
-{
-	CompEditorPrivate *priv;
-
-	g_return_if_fail (IS_COMP_EDITOR (editor));
-
-	priv = editor->priv;
-	
-	gtk_widget_set_sensitive (GTK_WIDGET (priv->attachment_bar),  set);
-	gtk_widget_set_sensitive (GTK_WIDGET (priv->attachment_scrolled_window),  set);
-}
-	
 /* Object initialization function for the calendar component editor */
 static void
 comp_editor_init (CompEditor *editor)
@@ -2496,7 +2484,6 @@ comp_editor_notify_client_changed (CompE
 
 	if (!e_cal_is_read_only (client, &read_only, NULL))
 		read_only = TRUE;
-	comp_editor_sensitize_attachment_bar (editor, !read_only);
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), GTK_RESPONSE_OK, !read_only);
 }
 
Index: gui/dialogs/task-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-editor.c,v
retrieving revision 1.83
diff -u -p -r1.83 task-editor.c
--- gui/dialogs/task-editor.c	1 Apr 2005 08:44:56 -0000	1.83
+++ gui/dialogs/task-editor.c	2 Aug 2005 08:39:20 -0000
@@ -148,7 +148,6 @@ task_editor_construct (TaskEditor *te, E
 	
 	if (!e_cal_is_read_only (client, &read_only, NULL))
 			read_only = TRUE;
-	comp_editor_sensitize_attachment_bar (COMP_EDITOR (te), !read_only);
 
 	if (priv->is_assigned) {
 		if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS))
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2782
diff -u -p -r1.2782 ChangeLog
--- ChangeLog	29 Jul 2005 05:10:11 -0000	1.2782
+++ ChangeLog	2 Aug 2005 08:39:27 -0000
@@ -1,3 +1,28 @@
+2005-08-02  Viren.l  <lviren novell com>
+	Fixes #309681
+	
+	* gui/e-calendar-view.c: (e_calendar_view_edit_appointment):
+	  Set the COMP_EDITOR_USER_ORG flag by checking the static capability.
+	* gui/dialogs/meeting-page.c:(meeting_page_fill_widgets):
+	  Removed sensitizing of Add, Remove & Invite buttons.
+	  Assigned user_org using CompEditorPageFlags.
+	* gui/dialogs/recurrence-page.c: (sensitize_button):
+	  Added a check for COMP_EDITOR_PAGE_MEETING.    	
+	* gui/dialogs/event-page.c: (sensitize_widgets):
+	  Added sensitize boolean variable to store the && operation of
+	  user_org,!read_only.	  
+	* gui/dialogs/event-editor.c: (show_meeting):
+	  If user is not organizer dont allow the widget to receive notification of drags.
+	* gui/e-cal-popup.[ch]: (e_cal_popup_target_new_attachments):
+	  Added a flag E_CAL_POPUP_ATTACHMENTS_MODIFY and set it in the
+	  e_cal_popup_target_new_attachments function.
+	* gui/dialogs/comp-editor.c: Added visibility mask 
+	  to Remove and Add attachments popup menus.
+	  Removed function comp_editor_sensitize_attachment_bar which
+	  is no longer required.
+	* gui/dialogs/task-editor.c: (task_editor_construct):
+	  Removed call made to comp_editor_sensitize_attachment_bar.		
+
 2005-07-29  Chenthill Palanisamy  <pchenthill novell com>
 
 
Index: gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.143
diff -u -p -r1.143 comp-editor.c
--- gui/dialogs/comp-editor.c	20 Jul 2005 11:18:54 -0000	1.143
+++ gui/dialogs/comp-editor.c	2 Aug 2005 08:56:53 -0000
@@ -138,6 +138,7 @@ static void page_dates_changed_cb (GtkOb
 
 static void obj_modified_cb (ECal *client, GList *objs, gpointer data);
 static void obj_removed_cb (ECal *client, GList *uids, gpointer data);
+static gboolean open_attachment (EAttachmentBar *bar, CompEditor *editor);
 
 G_DEFINE_TYPE (CompEditor, comp_editor, GTK_TYPE_DIALOG);
 
@@ -973,8 +974,8 @@ attachment_bar_changed_cb (EAttachmentBa
 
 }
 
-static	gboolean 
-attachment_bar_icon_clicked_cb (EAttachmentBar *bar, GdkEvent *event, CompEditor *editor)
+static gboolean 
+open_attachment (EAttachmentBar *bar, CompEditor *editor)
 {
 	GnomeIconList *icon_list;
 	GList *p;
@@ -982,7 +983,7 @@ attachment_bar_icon_clicked_cb (EAttachm
 	char *attach_file_url;
 	GError *error = NULL;
 	
-	if (E_IS_ATTACHMENT_BAR (bar) && event->type == GDK_2BUTTON_PRESS) {
+	if (E_IS_ATTACHMENT_BAR (bar)) {
 		icon_list = GNOME_ICON_LIST (bar);
 		p = gnome_icon_list_get_selection (icon_list);
 		if (p) {
@@ -1015,9 +1016,34 @@ attachment_bar_icon_clicked_cb (EAttachm
 		return FALSE;
 }
 
+static	gboolean 
+attachment_bar_icon_clicked_cb (EAttachmentBar *bar, GdkEvent *event, CompEditor *editor)
+{
+	GnomeIconList *icon_list;
+	GList *p;
+	int num;
+	char *attach_file_url;
+	GError *error = NULL;
+	
+	if (E_IS_ATTACHMENT_BAR (bar) && event->type == GDK_2BUTTON_PRESS) 
+		if (open_attachment (bar, editor))
+				return TRUE;
+	return FALSE;
+}
+
 /* Callbacks.  */
 
 static void
+cab_open(EPopup *ep, EPopupItem *item, void *data)
+{
+	EAttachmentBar *bar = data;
+	CompEditor *editor = COMP_EDITOR (gtk_widget_get_toplevel (GTK_WIDGET (bar)));
+	
+	if (!open_attachment (bar, editor))
+		g_message ("\n Open failed");
+}
+
+static void
 cab_add(EPopup *ep, EPopupItem *item, void *data)
 {
 	EAttachmentBar *bar = data;
@@ -1056,10 +1082,11 @@ cab_remove(EPopup *ep, EPopupItem *item,
 
 /* Popup menu handling.  */
 static EPopupItem cab_popups[] = {
-	{ E_POPUP_ITEM, "10.attach", N_("_Remove"), cab_remove, NULL, GTK_STOCK_REMOVE, E_CAL_POPUP_ATTACHMENTS_MANY },
-	{ E_POPUP_ITEM, "20.attach", N_("_Properties"), cab_properties, NULL, GTK_STOCK_PROPERTIES, E_CAL_POPUP_ATTACHMENTS_ONE },
-	{ E_POPUP_BAR, "30.attach.00", NULL, NULL, NULL, NULL, E_CAL_POPUP_ATTACHMENTS_MANY|E_CAL_POPUP_ATTACHMENTS_ONE },
-	{ E_POPUP_ITEM, "30.attach.01", N_("_Add attachment..."), cab_add, NULL, GTK_STOCK_ADD, 0 },
+	{ E_POPUP_ITEM, "10.ATTACH", N_("_Open"), cab_open, NULL, GTK_STOCK_OPEN, E_CAL_POPUP_ATTACHMENTS_ONE },
+	{ E_POPUP_ITEM, "20.attach", N_("_Remove"), cab_remove, NULL, GTK_STOCK_REMOVE, E_CAL_POPUP_ATTACHMENTS_MANY },
+	{ E_POPUP_ITEM, "30.attach", N_("_Properties"), cab_properties, NULL, GTK_STOCK_PROPERTIES, E_CAL_POPUP_ATTACHMENTS_ONE },
+	{ E_POPUP_BAR, "40.attach.00", NULL, NULL, NULL, NULL, E_CAL_POPUP_ATTACHMENTS_MANY|E_CAL_POPUP_ATTACHMENTS_ONE },
+	{ E_POPUP_ITEM, "40.attach.01", N_("_Add attachment..."), cab_add, NULL, GTK_STOCK_ADD, 0},
 };
 
 static void
@@ -1254,19 +1281,6 @@ setup_widgets (CompEditor *editor)
 	
 }
 
-void
-comp_editor_sensitize_attachment_bar (CompEditor *editor, gboolean  set)
-{
-	CompEditorPrivate *priv;
-
-	g_return_if_fail (IS_COMP_EDITOR (editor));
-
-	priv = editor->priv;
-	
-	gtk_widget_set_sensitive (GTK_WIDGET (priv->attachment_bar),  set);
-	gtk_widget_set_sensitive (GTK_WIDGET (priv->attachment_scrolled_window),  set);
-}
-	
 /* Object initialization function for the calendar component editor */
 static void
 comp_editor_init (CompEditor *editor)
@@ -2496,7 +2510,7 @@ comp_editor_notify_client_changed (CompE
 
 	if (!e_cal_is_read_only (client, &read_only, NULL))
 		read_only = TRUE;
-	comp_editor_sensitize_attachment_bar (editor, !read_only);
+
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (editor), GTK_RESPONSE_OK, !read_only);
 }
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2782
diff -u -p -r1.2782 ChangeLog
--- ChangeLog	29 Jul 2005 05:10:11 -0000	1.2782
+++ ChangeLog	2 Aug 2005 08:57:00 -0000
@@ -1,3 +1,13 @@
+2005-08-02  Viren.l  <lviren novell com>
+	Fixes #312192
+	
+	* gui/dialogs/comp-editor.c : (attachment_bar_icon_clicked_cb),
+	(cab_open), (open_attachment):
+	Added Open menu to cab_popups.
+	Moved the code to open attachment to open_attachment
+	function and invoked the same from cab_open, 
+	attachment_bar_icon_clicked_cb.
+
 2005-07-29  Chenthill Palanisamy  <pchenthill novell com>
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]