Re: [evolution-patches] patch for bug# 310338 [calendar - alarms]



On Fri, 2005-08-12 at 17:41 +0530, viren wrote:
editor = COMP_EDITOR (task_editor_new (oc->client, flags));

Shouldn pass flag here and since the flags is set for event-editor set it only for events.  Pass a boolean variable here.Other than that it looks fine.
Made the changes and committed the patch.


thanks, chenthill
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2793
diff -u -p -r1.2793 ChangeLog
--- ChangeLog	11 Aug 2005 17:42:39 -0000	1.2793
+++ ChangeLog	12 Aug 2005 13:54:14 -0000
@@ -1,3 +1,17 @@
+2005-08-12  Viren.L  <lviren novell com>
+
+	Fixes #310338
+	* gui/alarm-notify-dialog.c:(notified_alarms_dialog_new),
+	(edit_pressed_cb),(snooze_pressed_cb),(dialog_response_cb):	
+	Get the widget and connected "pressed" signal.
+	Removed AN_ALARM_EDIT and AN_ALARM_SNOOZE enums.
+	Removed check of these enums in dialog_response_cb and
+	moved the code to it's associated call backs.
+	* gui/alarm-notify/alarm-notify.glade:
+	Changed the button name to button-edit and button-snooze.
+	* gui/comp-editor-factory.c: (edit_existing):
+	Added CompEditorFlags and used to invoke event_editor_new.		
+
 2005-08-11  Carsten Guenther <carsten guenther scalix com>
 
 	* gui/dialogs/comp-editor.c: (get_attachment_list),
@@ -6,7 +20,6 @@
 	attachment file.
 	(set_attachment_list): Fixed how mime filename gets
 	extracted from attachments pathname.
-
 
 2005-08-10  Tor Lillqvist  <tml novell com>
 
Index: gui/comp-editor-factory.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/comp-editor-factory.c,v
retrieving revision 1.43
diff -u -p -r1.43 comp-editor-factory.c
--- gui/comp-editor-factory.c	17 Jan 2005 13:39:19 -0000	1.43
+++ gui/comp-editor-factory.c	12 Aug 2005 13:54:14 -0000
@@ -245,6 +245,7 @@ edit_existing (OpenClient *oc, const cha
 	icalcomponent *icalcomp;
 	CompEditor *editor;
 	ECalComponentVType vtype;
+	CompEditorFlags flags;
 
 	g_assert (oc->open);
 
@@ -269,7 +270,13 @@ edit_existing (OpenClient *oc, const cha
 
 	switch (vtype) {
 	case E_CAL_COMPONENT_EVENT:
-		editor = COMP_EDITOR (event_editor_new (oc->client, e_cal_component_has_attendees (comp)));
+		if (e_cal_component_has_attendees (comp))
+			flags |= COMP_EDITOR_MEETING;
+	
+		if (itip_organizer_is_user (comp, oc->client))
+			flags |= COMP_EDITOR_USER_ORG;
+
+		editor = COMP_EDITOR (event_editor_new (oc->client, flags));
 		break;
 
 	case E_CAL_COMPONENT_TODO:
Index: gui/alarm-notify/alarm-notify-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-notify-dialog.c,v
retrieving revision 1.34
diff -u -p -r1.34 alarm-notify-dialog.c
--- gui/alarm-notify/alarm-notify-dialog.c	9 May 2005 09:10:38 -0000	1.34
+++ gui/alarm-notify/alarm-notify-dialog.c	12 Aug 2005 13:54:15 -0000
@@ -27,6 +27,7 @@
 #include <gtk/gtkdialog.h>
 #include <gtk/gtkimage.h>
 #include <gtk/gtklabel.h>
+#include <gtk/gtkbutton.h>
 #include <gtk/gtkspinbutton.h>
 #include <gtk/gtksignal.h>
 #include <gtk/gtkscrolledwindow.h>
@@ -81,11 +82,6 @@ typedef struct {
 	
 } AlarmNotify;
 
-enum {
-	AN_RESPONSE_EDIT = 0,
-	AN_RESPONSE_SNOOZE = 1
-};
-
 
 
 static void
@@ -94,7 +90,11 @@ tree_selection_changed_cb (GtkTreeSelect
 static void
 fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, 
 			const gchar *location, time_t occur_start, time_t occur_end);
+static void 
+edit_pressed_cb (GtkButton *button, gpointer user_data);
 
+static void
+snooze_pressed_cb (GtkButton *button, gpointer user_data);
 
 
 AlarmNotify *an = NULL;
@@ -120,7 +120,6 @@ an_update_minutes_label (GtkSpinButton *
 static void
 dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data)
 {
-	int snooze_timeout;
 	AlarmNotify *an = user_data;
 	GtkTreeIter iter;
 	GtkTreeModel *model = NULL;
@@ -133,22 +132,52 @@ dialog_response_cb (GtkDialog *dialog, g
 	g_return_if_fail (funcinfo);
 
 	switch (response_id) {
-	case AN_RESPONSE_EDIT:
-		(* funcinfo->func) (ALARM_NOTIFY_EDIT, -1, funcinfo->func_data);
-		break;
-	case AN_RESPONSE_SNOOZE:
-		snooze_timeout = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (an->snooze_time));
-		(* funcinfo->func) (ALARM_NOTIFY_SNOOZE, snooze_timeout, funcinfo->func_data);
-		break;
 	case GTK_RESPONSE_CLOSE:
 	case GTK_RESPONSE_DELETE_EVENT:
 		(* funcinfo->func) (ALARM_NOTIFY_CLOSE, -1, funcinfo->func_data);
 		break;
 	}
-	
+
 	return;
 }
 
+static void 
+edit_pressed_cb (GtkButton *button, gpointer user_data)
+{
+	AlarmNotify *an = user_data;
+	AlarmFuncInfo *funcinfo = NULL;
+	GtkTreeIter iter;
+	GtkTreeModel *model = NULL;
+	GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview));
+
+	if (gtk_tree_selection_get_selected (selection, &model, &iter))
+		gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1);	
+
+	g_return_if_fail (funcinfo);
+	
+	(* funcinfo->func) (ALARM_NOTIFY_EDIT, -1, funcinfo->func_data);
+}
+
+static void 
+snooze_pressed_cb (GtkButton *button, gpointer user_data)
+{
+	int snooze_timeout;
+	AlarmNotify *an = user_data;
+	GtkTreeIter iter;
+	GtkTreeModel *model = NULL;
+	AlarmFuncInfo *funcinfo = NULL;
+	GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview));
+
+	if (gtk_tree_selection_get_selected (selection, &model, &iter))
+		gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1);	
+
+	g_return_if_fail (funcinfo);
+
+	snooze_timeout = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (an->snooze_time));
+	(* funcinfo->func) (ALARM_NOTIFY_SNOOZE, snooze_timeout, funcinfo->func_data);
+
+}
+
 static void
 dialog_destroyed_cb (GtkWidget *dialog, gpointer user_data)
 {
@@ -166,6 +195,8 @@ dialog_destroyed_cb (GtkWidget *dialog, 
 AlarmNotificationsDialog *
 notified_alarms_dialog_new (void)
 {
+	GtkWidget *edit_btn;
+	GtkWidget *snooze_btn;
 	GtkWidget *image;
 	char *icon_path;
 	GList *icon_list;
@@ -201,9 +232,11 @@ notified_alarms_dialog_new (void)
 	an->location = glade_xml_get_widget (an->xml, "location-label");
 	an->treeview = glade_xml_get_widget (an->xml, "appointments-treeview");
 	an->scrolledwindow = glade_xml_get_widget (an->xml, "treeview-scrolledwindow");
+	snooze_btn = glade_xml_get_widget (an->xml, "snooze-button");
+	edit_btn = glade_xml_get_widget (an->xml, "edit-button");
 
 	if (!(an->dialog && an->scrolledwindow && an->treeview && an->snooze_time
-	      && an->description && an->location)) {
+	      && an->description && an->location && edit_btn && snooze_btn)) {
 		g_message ("alarm_notify_dialog(): Could not find all widgets in Glade file!");
 		g_object_unref (an->xml);
 		g_free (an);
@@ -232,7 +265,9 @@ notified_alarms_dialog_new (void)
 	icon_path = e_icon_factory_get_icon_filename ("stock_alarm", E_ICON_SIZE_DIALOG);
 	gtk_image_set_from_file (GTK_IMAGE (image), icon_path);
 	g_free (icon_path);
-	
+
+	g_signal_connect (edit_btn, "pressed", G_CALLBACK (edit_pressed_cb), an);
+	g_signal_connect (snooze_btn, "pressed", G_CALLBACK (snooze_pressed_cb), an);
 	g_signal_connect (G_OBJECT (an->dialog), "response", G_CALLBACK (dialog_response_cb), an);
 	g_signal_connect (G_OBJECT (an->dialog), "destroy", G_CALLBACK (dialog_destroyed_cb), an);
 	
Index: gui/alarm-notify/alarm-notify.glade
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-notify.glade,v
retrieving revision 1.11
diff -u -p -r1.11 alarm-notify.glade
--- gui/alarm-notify/alarm-notify.glade	9 May 2005 09:10:38 -0000	1.11
+++ gui/alarm-notify/alarm-notify.glade	12 Aug 2005 13:54:15 -0000
@@ -326,7 +326,7 @@
 		      <property name="spacing">5</property>
 
 		      <child>
-			<widget class="GtkButton" id="button4">
+			<widget class="GtkButton" id="snooze-button">
 			  <property name="visible">True</property>
 			  <property name="can_default">True</property>
 			  <property name="can_focus">True</property>
@@ -405,7 +405,7 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkButton" id="button3">
+			<widget class="GtkButton" id="edit-button">
 			  <property name="visible">True</property>
 			  <property name="can_default">True</property>
 			  <property name="can_focus">True</property>


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