aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2004-06-08 23:58:12 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2004-06-08 23:58:12 +0800
commit7601e9e71eb0f412b7671954c8724e1820e519cd (patch)
tree412e8c2d6396369899c4cebd0d1f217b07bffd66
parentc2d7dc57764bc05a28d3b765f50ccff901524fba (diff)
downloadgsoc2013-evolution-7601e9e71eb0f412b7671954c8724e1820e519cd.tar.gz
gsoc2013-evolution-7601e9e71eb0f412b7671954c8724e1820e519cd.tar.zst
gsoc2013-evolution-7601e9e71eb0f412b7671954c8724e1820e519cd.zip
do not set the private client here, it is set in comp-editor.c.
2004-06-08 Rodrigo Moya <rodrigo@novell.com> * gui/dialogs/comp-editor-page.c (comp_editor_page_notify_client_changed): do not set the private client here, it is set in comp-editor.c. * gui/dialogs/event-page.c (sensitize_widgets): new function. (source_changed_cb): call sensitize_buttons(). * gui/dialogs/recurrence-page.c (sensitize_buttons): new function, to deal correctly with the sensitivity of all widgets in the page. (recurrence_page_fill_widgets, type_toggled_cb, client_changed_cb): call sensitize_buttons() instead of sensitize_recur_widgets(). (recurrence_page_construct): g_signal_connect_after for "client_changed", to get notifications after CompEditorPage gets his. * gui/dialogs/alarm-page.c (sensitize_buttons): sensitize the missing widgets in the page. (alarm_page_construct): g_signal_connect_after for "client_changed", to get notifications after CompEditorPage gets his. svn path=/trunk/; revision=26254
-rw-r--r--calendar/ChangeLog23
-rw-r--r--calendar/gui/dialogs/alarm-page.c10
-rw-r--r--calendar/gui/dialogs/comp-editor-page.c1
-rw-r--r--calendar/gui/dialogs/event-page.c30
-rw-r--r--calendar/gui/dialogs/recurrence-page.c48
5 files changed, 97 insertions, 15 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index b7d76e7bf9..fdb386f0b1 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,26 @@
+2004-06-08 Rodrigo Moya <rodrigo@novell.com>
+
+ * gui/dialogs/comp-editor-page.c
+ (comp_editor_page_notify_client_changed): do not set the private
+ client here, it is set in comp-editor.c.
+
+ * gui/dialogs/event-page.c (sensitize_widgets): new function.
+ (source_changed_cb): call sensitize_buttons().
+
+ * gui/dialogs/recurrence-page.c (sensitize_buttons): new
+ function, to deal correctly with the sensitivity of all widgets
+ in the page.
+ (recurrence_page_fill_widgets, type_toggled_cb, client_changed_cb):
+ call sensitize_buttons() instead of sensitize_recur_widgets().
+ (recurrence_page_construct): g_signal_connect_after for
+ "client_changed", to get notifications after CompEditorPage
+ gets his.
+
+ * gui/dialogs/alarm-page.c (sensitize_buttons): sensitize the missing
+ widgets in the page.
+ (alarm_page_construct): g_signal_connect_after for "client_changed",
+ to get notifications after CompEditorPage gets his.
+
2004-06-08 JP Rosevear <jpr@novell.com>
* gui/e-week-view.c (e_week_view_do_key_press): cast week view
diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c
index d7faebf14c..8270332707 100644
--- a/calendar/gui/dialogs/alarm-page.c
+++ b/calendar/gui/dialogs/alarm-page.c
@@ -345,6 +345,12 @@ sensitize_buttons (AlarmPage *apage)
else
gtk_widget_set_sensitive (apage->priv->add, sensitivity);
gtk_widget_set_sensitive (priv->delete, have_selected && !read_only ? TRUE : FALSE);
+ gtk_widget_set_sensitive (priv->action, sensitivity);
+ gtk_widget_set_sensitive (priv->interval_value, sensitivity);
+ gtk_widget_set_sensitive (priv->value_units, sensitivity);
+ gtk_widget_set_sensitive (priv->relative, sensitivity);
+ gtk_widget_set_sensitive (priv->time, sensitivity);
+ gtk_widget_set_sensitive (priv->button_options, sensitivity);
}
/* Appends an alarm to the list */
@@ -862,8 +868,8 @@ alarm_page_construct (AlarmPage *apage)
init_widgets (apage);
- g_signal_connect (G_OBJECT (apage), "client_changed",
- G_CALLBACK (client_changed_cb), NULL);
+ g_signal_connect_after (G_OBJECT (apage), "client_changed",
+ G_CALLBACK (client_changed_cb), NULL);
return apage;
}
diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c
index be96f161a0..44e89a3b14 100644
--- a/calendar/gui/dialogs/comp-editor-page.c
+++ b/calendar/gui/dialogs/comp-editor-page.c
@@ -436,7 +436,6 @@ comp_editor_page_notify_client_changed (CompEditorPage *page,
gtk_signal_emit (GTK_OBJECT (page),
comp_editor_page_signals[CLIENT_CHANGED],
client);
- comp_editor_page_set_e_cal (page, client);
}
/**
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index cd7bbe12ce..abdc84aa34 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -408,6 +408,33 @@ clear_widgets (EventPage *epage)
e_dialog_editable_set (priv->categories, NULL);
}
+static void
+sensitize_widgets (EventPage *epage)
+{
+ gboolean read_only;
+ EventPagePrivate *priv;
+
+ priv = epage->priv;
+
+ if (!e_cal_is_read_only (COMP_EDITOR_PAGE (epage)->client, &read_only, NULL))
+ read_only = TRUE;
+
+ gtk_widget_set_sensitive (priv->summary, !read_only);
+ gtk_widget_set_sensitive (priv->location, !read_only);
+ gtk_widget_set_sensitive (priv->start_time, !read_only);
+ gtk_widget_set_sensitive (priv->start_timezone, !read_only);
+ gtk_widget_set_sensitive (priv->end_time, !read_only);
+ gtk_widget_set_sensitive (priv->end_timezone, !read_only);
+ gtk_widget_set_sensitive (priv->all_day_event, !read_only);
+ gtk_widget_set_sensitive (priv->description, !read_only);
+ gtk_widget_set_sensitive (priv->classification_public, !read_only);
+ gtk_widget_set_sensitive (priv->classification_private, !read_only);
+ gtk_widget_set_sensitive (priv->classification_confidential, !read_only);
+ gtk_widget_set_sensitive (priv->show_time_as_free, !read_only);
+ gtk_widget_set_sensitive (priv->show_time_as_busy, !read_only);
+ gtk_widget_set_sensitive (priv->categories_btn, !read_only);
+ gtk_widget_set_sensitive (priv->categories, !read_only);
+}
/* fill_widgets handler for the event page */
static gboolean
@@ -532,6 +559,8 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
priv->updating = FALSE;
+ sensitize_widgets (epage);
+
return validated;
}
@@ -1269,6 +1298,7 @@ source_changed_cb (GtkWidget *widget, ESource *source, gpointer data)
gtk_widget_destroy (dialog);
} else {
comp_editor_page_notify_client_changed (COMP_EDITOR_PAGE (epage), client);
+ sensitize_widgets (epage);
}
}
}
diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c
index cec2685a7c..f08107c8e2 100644
--- a/calendar/gui/dialogs/recurrence-page.c
+++ b/calendar/gui/dialogs/recurrence-page.c
@@ -508,13 +508,9 @@ sensitize_recur_widgets (RecurrencePage *rpage)
RecurrencePagePrivate *priv;
enum recur_type type;
GtkWidget *label;
- gboolean read_only;
priv = rpage->priv;
- if (!e_cal_is_read_only (COMP_EDITOR_PAGE (rpage)->client, &read_only, NULL))
- read_only = TRUE;
-
type = e_dialog_radio_get (priv->none, type_map);
/* We can't preview that well for instances right now */
@@ -556,6 +552,34 @@ sensitize_recur_widgets (RecurrencePage *rpage)
}
}
+static void
+sensitize_buttons (RecurrencePage *rpage)
+{
+ gboolean read_only;
+ gint selected_rows;
+ RecurrencePagePrivate *priv;
+
+ priv = rpage->priv;
+
+ selected_rows = gtk_tree_selection_count_selected_rows (
+ gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list)));
+
+ if (!e_cal_is_read_only (COMP_EDITOR_PAGE (rpage)->client, &read_only, NULL))
+ read_only = TRUE;
+
+ if (!read_only)
+ sensitize_recur_widgets (rpage);
+ else
+ gtk_widget_set_sensitive (priv->params, FALSE);
+
+ gtk_widget_set_sensitive (priv->none, !read_only);
+ gtk_widget_set_sensitive (priv->simple, !read_only);
+ gtk_widget_set_sensitive (priv->exception_add, !read_only && e_cal_component_has_recurrences (priv->comp));
+ gtk_widget_set_sensitive (priv->exception_modify, !read_only && selected_rows > 0);
+ gtk_widget_set_sensitive (priv->exception_delete, !read_only && selected_rows > 0);
+ gtk_widget_set_sensitive (priv->exception_date, !read_only);
+}
+
#if 0
/* Encondes a position/weekday pair into the proper format for
* icalrecurrencetype.by_day. Not needed at present.
@@ -1504,7 +1528,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
RecurrencePage *rpage;
RecurrencePagePrivate *priv;
ECalComponentText text;
- CompEditorPageDates dates;
+ CompEditorPageDates dates;
GSList *rrule_list;
int len;
struct icalrecurrencetype *r;
@@ -1568,7 +1592,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
gtk_widget_set_sensitive (priv->custom, FALSE);
- sensitize_recur_widgets (rpage);
+ sensitize_buttons (rpage);
preview_recur (rpage);
priv->updating = FALSE;
@@ -1836,7 +1860,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
gtk_widget_set_sensitive (priv->custom, FALSE);
- sensitize_recur_widgets (rpage);
+ sensitize_buttons (rpage);
make_recurrence_special (rpage);
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->interval_value));
@@ -1859,7 +1883,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
g_signal_handlers_unblock_matched (priv->custom, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage);
gtk_widget_set_sensitive (priv->custom, TRUE);
- sensitize_recur_widgets (rpage);
+ sensitize_buttons (rpage);
out:
@@ -2048,7 +2072,7 @@ type_toggled_cb (GtkToggleButton *toggle, gpointer data)
field_changed (rpage);
if (toggle->active) {
- sensitize_recur_widgets (rpage);
+ sensitize_buttons (rpage);
preview_recur (rpage);
}
}
@@ -2354,7 +2378,7 @@ client_changed_cb (CompEditorPage *page, ECal *client, gpointer user_data)
{
RecurrencePage *rpage = RECURRENCE_PAGE (page);
- sensitize_recur_widgets (rpage);
+ sensitize_buttons (rpage);
}
/**
@@ -2389,8 +2413,8 @@ recurrence_page_construct (RecurrencePage *rpage)
init_widgets (rpage);
- g_signal_connect (G_OBJECT (rpage), "client_changed",
- G_CALLBACK (client_changed_cb), NULL);
+ g_signal_connect_after (G_OBJECT (rpage), "client_changed",
+ G_CALLBACK (client_changed_cb), NULL);
return rpage;
}