From 20d72f43f15e96ec4d90b14315909c7c5654b986 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Mon, 30 Jan 2006 09:33:36 +0000 Subject: fixes #225816 svn path=/trunk/; revision=31353 --- calendar/ChangeLog | 16 ++++++++++++++ calendar/gui/dialogs/alarm-list-dialog.c | 31 ++++++++++++++++++++++++++++ calendar/gui/dialogs/alarm-list-dialog.glade | 19 ++++++++++++++--- 3 files changed, 63 insertions(+), 3 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 592e4133ef..5cfe74f80e 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,19 @@ +2006-01-18 Johnny Jacob + + Fixes #225816 + * gui/dialogs/alatm-list-dialog.glade : Added edit button. + * gui/dialogs/alarm-list-dialog.c (init_widgets), (get_widgets) : + Get and connect signals for edit button. + (sensitize_buttons) : Handle the sesitivity of edit button. + (edit_clicked_cb) : Added. Handle edit button click event. + * gui/dialogs/alarm-dialogs.c (populate_widgets) : Added. Extract data + from alarm and fill in the widgets. + (alarm_to_repeat_widgets): Added. Alarm data to repeat widgets. + (alarm_to_aalarm_widgets): Added. Alarm data to audio alarm widgets. + (alarm_to_dalarm_widgets): Added. Alarm data to display alarm widgets. + (alarm_to_palarm_widgets): Added. Alarm data to procedure alarm widgets. + (alarm_to_dialog): call populate_widgets. + 2006-01-28 Rajeev ramanathan ** Fixes Bug #327347 diff --git a/calendar/gui/dialogs/alarm-list-dialog.c b/calendar/gui/dialogs/alarm-list-dialog.c index f1cacfa159..9b365ca6a3 100644 --- a/calendar/gui/dialogs/alarm-list-dialog.c +++ b/calendar/gui/dialogs/alarm-list-dialog.c @@ -65,6 +65,7 @@ typedef struct { GtkWidget *list; GtkWidget *add; + GtkWidget *edit; GtkWidget *delete; GtkWidget *box; @@ -83,12 +84,14 @@ get_widgets (Dialog *dialog) dialog->box = GW ("vbox53"); dialog->list = GW ("list"); dialog->add = GW ("add"); + dialog->edit = GW ("edit"); dialog->delete = GW ("delete"); #undef GW return (dialog->list && dialog->add + && dialog->edit && dialog->delete); } @@ -114,6 +117,7 @@ sensitize_buttons (Dialog *dialog) else gtk_widget_set_sensitive (dialog->add, TRUE); gtk_widget_set_sensitive (dialog->delete, have_selected && !read_only); + gtk_widget_set_sensitive (dialog->edit, have_selected && !read_only); } /* Callback used for the "add reminder" button */ @@ -146,6 +150,31 @@ add_clicked_cb (GtkButton *button, gpointer data) sensitize_buttons (dialog); } +/* Callback used for the "edit reminder" button */ +static void +edit_clicked_cb (GtkButton *button, gpointer data) +{ + Dialog *dialog = data; + GtkTreeSelection *selection; + GtkTreeIter iter; + GtkTreePath *path; + ECalComponentAlarm *alarm; + GtkTreeView *view; + + view = GTK_TREE_VIEW (dialog->list); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list)); + if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) { + g_warning ("Could not get a selection to delete."); + return; + } + + alarm = e_alarm_list_get_alarm (dialog->list_store, &iter); + + if (alarm_dialog_run (dialog->toplevel, dialog->ecal, alarm)) + gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter); +} + /* Callback used for the "delete reminder" button */ static void delete_clicked_cb (GtkButton *button, gpointer data) @@ -211,6 +240,8 @@ init_widgets (Dialog *dialog) G_CALLBACK (add_clicked_cb), dialog); g_signal_connect (dialog->delete, "clicked", G_CALLBACK (delete_clicked_cb), dialog); + g_signal_connect (dialog->edit, "clicked", + G_CALLBACK (edit_clicked_cb), dialog); g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list)), "changed", G_CALLBACK (selection_changed_cb), dialog); diff --git a/calendar/gui/dialogs/alarm-list-dialog.glade b/calendar/gui/dialogs/alarm-list-dialog.glade index 7a0f9e75b9..779a30071a 100644 --- a/calendar/gui/dialogs/alarm-list-dialog.glade +++ b/calendar/gui/dialogs/alarm-list-dialog.glade @@ -94,9 +94,6 @@ False False True - False - False - False @@ -148,6 +145,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -198,6 +199,18 @@ True + + + + True + True + True + gtk-edit + True + GTK_RELIEF_NORMAL + True + + 0 -- cgit