[evolution-patches] [calendar] fix for bug#270036



Attached patch fixes bug #270036
Please review.

Regards,
Dinesh Layek

Index: cal-prefs-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/cal-prefs-dialog.c,v
retrieving revision 1.42
diff -u -p -r1.42 cal-prefs-dialog.c
--- cal-prefs-dialog.c	23 Jun 2005 09:11:05 -0000	1.42
+++ cal-prefs-dialog.c	23 Sep 2005 08:46:29 -0000
@@ -82,6 +82,7 @@ static void cal_prefs_dialog_url_remove_
 static void cal_prefs_dialog_url_enable_clicked (GtkWidget *button, DialogData *dialog_data);
 static void cal_prefs_dialog_url_list_change (GtkTreeSelection *selection, DialogData *dialog_data);
 static void cal_prefs_dialog_url_list_enable_toggled (GtkCellRendererToggle *renderer, const char *path_string, DialogData *dialog_data);
+static void cal_prefs_dialog_url_list_selection_changed (GtkTreeSelection *selection, DialogData *dialog_data); 
 static void cal_prefs_dialog_url_list_double_click(GtkTreeView *treeview, 
 						   GtkTreePath *path, 
 						   GtkTreeViewColumn *column, 
@@ -596,6 +597,9 @@ init_widgets (DialogData *dialog_data)
 	g_signal_connect (dialog_data->url_list, "row-activated",
 			 G_CALLBACK (cal_prefs_dialog_url_list_double_click),
 			 dialog_data);
+	g_signal_connect (selection, "changed",
+			 G_CALLBACK (cal_prefs_dialog_url_list_selection_changed),
+			 dialog_data);
 }
 
 /* Sets the color in a color picker from an X color spec */
@@ -832,6 +836,26 @@ cal_prefs_dialog_url_list_double_click (
 					DialogData *dialog_data)
 {
 	cal_prefs_dialog_url_edit_clicked  (NULL, dialog_data);
+}				
+static void
+cal_prefs_dialog_url_list_selection_changed (GtkTreeSelection *selection, 
+					DialogData *dialog_data)
+{
+        EPublishUri *url = NULL;
+        GtkTreeSelection * selection;
+        GtkTreeModel *model;
+        GtkTreeIter iter;
+
+        selection = gtk_tree_view_get_selection (dialog_data->url_list);
+        if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+                gtk_tree_model_get (model, &iter,
+                                    URL_LIST_FREE_BUSY_URL_COLUMN, &url,
+                                    -1);
+                gtk_button_set_label ((GtkButton *) dialog_data->url_enable,
+                                      url->enabled ? _("Disable") : _("Enable"));
+
+                url_list_changed (dialog_data);
+        }
 }				
 
 static void
Index: ../../ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2804
diff -u -p -r1.2804 ChangeLog
--- ../../ChangeLog	19 Sep 2005 08:10:51 -0000	1.2804
+++ ../../ChangeLog	23 Sep 2005 08:46:32 -0000
@@ -1,3 +1,10 @@
+2005-09-23  Dinesh Layek <ldinesh novell com>
+
+	Fixes #270036
+	* gui/dialogs/cal-prefs-dialog.c
+	(init_widgets): connected to the signal handler cal_prefs_dialog_url_list_selection_changed
+	for the signal GtkTreeSelection "changed" and implemented the signal handler
+
 2005-09-08  P. S. Chakravarthi <pchakravarthi novell com>
 
 	Fix #261625


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