aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2004-06-08 22:21:28 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2004-06-08 22:21:28 +0800
commit5ab8cfca31e7985486d51e94f94457901ee84fe6 (patch)
treef8dc5df541e218f180c2dd8a4f62d7e26ddabec3
parent1b0a361c8e076f7b63824857e253c56535a3b6ea (diff)
downloadgsoc2013-evolution-5ab8cfca31e7985486d51e94f94457901ee84fe6.tar
gsoc2013-evolution-5ab8cfca31e7985486d51e94f94457901ee84fe6.tar.gz
gsoc2013-evolution-5ab8cfca31e7985486d51e94f94457901ee84fe6.tar.bz2
gsoc2013-evolution-5ab8cfca31e7985486d51e94f94457901ee84fe6.tar.lz
gsoc2013-evolution-5ab8cfca31e7985486d51e94f94457901ee84fe6.tar.xz
gsoc2013-evolution-5ab8cfca31e7985486d51e94f94457901ee84fe6.tar.zst
gsoc2013-evolution-5ab8cfca31e7985486d51e94f94457901ee84fe6.zip
Fixes #59650
2004-06-08 Rodrigo Moya <rodrigo@novell.com> Fixes #59650 * gui/dialogs/alarm-page.c (alarm_page_construct): connect to "client_changed" signal on the page. (client_changed_cb): new callback. (sensitize_buttons): added code for dealing with read only calendars and disable/enable buttons approppriately. svn path=/trunk/; revision=26251
-rw-r--r--calendar/ChangeLog10
-rw-r--r--calendar/gui/dialogs/alarm-page.c26
2 files changed, 32 insertions, 4 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index e53f99a74a..4c78932856 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,13 @@
+2004-06-08 Rodrigo Moya <rodrigo@novell.com>
+
+ Fixes #59650
+
+ * gui/dialogs/alarm-page.c (alarm_page_construct): connect to
+ "client_changed" signal on the page.
+ (client_changed_cb): new callback.
+ (sensitize_buttons): added code for dealing with read only calendars
+ and disable/enable buttons approppriately.
+
2004-06-07 Dan Winship <danw@novell.com>
* gui/dialogs/comp-editor.c (pixmaps): s/stock_save_as/stock_save-as/
diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c
index 7a8c687ad7..7b77cd7d74 100644
--- a/calendar/gui/dialogs/alarm-page.c
+++ b/calendar/gui/dialogs/alarm-page.c
@@ -327,7 +327,7 @@ sensitize_buttons (AlarmPage *apage)
ECal *client;
GtkTreeSelection *selection;
GtkTreeIter iter;
- gboolean have_selected;
+ gboolean have_selected, read_only, sensitivity;
priv = apage->priv;
@@ -335,9 +335,16 @@ sensitize_buttons (AlarmPage *apage)
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list));
have_selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
- gtk_widget_set_sensitive (priv->add,
- e_cal_get_one_alarm_only (client) && have_selected ? FALSE : TRUE);
- gtk_widget_set_sensitive (priv->delete, have_selected);
+ if (e_cal_is_read_only (client, &read_only, NULL) && read_only)
+ sensitivity = FALSE;
+ else
+ sensitivity = TRUE;
+
+ if (e_cal_get_one_alarm_only (COMP_EDITOR_PAGE (apage)->client) && have_selected)
+ gtk_widget_set_sensitive (apage->priv->add, FALSE);
+ else
+ gtk_widget_set_sensitive (apage->priv->add, sensitivity);
+ gtk_widget_set_sensitive (priv->delete, have_selected && !read_only ? TRUE : FALSE);
}
/* Appends an alarm to the list */
@@ -815,6 +822,14 @@ init_widgets (AlarmPage *apage)
+static void
+client_changed_cb (CompEditorPage *page, ECal *client, gpointer user_data)
+{
+ AlarmPage *apage = ALARM_PAGE (page);
+
+ sensitize_buttons (apage);
+}
+
/**
* alarm_page_construct:
* @apage: An alarm page.
@@ -847,6 +862,9 @@ alarm_page_construct (AlarmPage *apage)
init_widgets (apage);
+ g_signal_connect (G_OBJECT (apage), "client_changed",
+ G_CALLBACK (client_changed_cb), NULL);
+
return apage;
}