From 411ebc296442644ace6dbbdf6e30b8ae92436021 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Sat, 2 Jun 2001 01:22:38 +0000 Subject: use new func 2001-06-01 JP Rosevear * gui/dialogs/event-page.c (make_date_edit): use new func * gui/dialogs/task-details-page.c (task_details_page_create_date_edit): ditto * gui/dialogs/recurrence-page.c (make_ending_until_special): ditto * gui/dialogs/comp-editor-util.c (comp_editor_new_date_edit): rename date_edit_new function * gui/dialogs/comp-editor-util.h: new proto * gui/dialogs/task-page.c (task_page_set_summary): no longer any need to block/unblock the handler (task_page_create_date_edit): use new func svn path=/trunk/; revision=10093 --- calendar/gui/dialogs/comp-editor-util.c | 24 ++++++++++++++++++++++++ calendar/gui/dialogs/comp-editor-util.h | 2 ++ calendar/gui/dialogs/event-page.c | 8 ++++---- calendar/gui/dialogs/recurrence-page.c | 3 +-- calendar/gui/dialogs/task-details-page.c | 3 +-- calendar/gui/dialogs/task-page.c | 5 +---- 6 files changed, 33 insertions(+), 12 deletions(-) (limited to 'calendar/gui/dialogs') diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index 1110b5f18a..6debc3c30d 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -127,3 +127,27 @@ comp_editor_date_label (CompEditorPageDates *dates, GtkWidget *label) gtk_label_set_text (GTK_LABEL (label), buffer); } + +/** + * comp_editor_new_date_edit: + * @show_date: Whether to show a date picker in the widget. + * @show_time: Whether to show a time picker in the widget. + * + * Creates a new #EDateEdit widget, configured using the calendar's preferences. + * + * Return value: A newly-created #EDateEdit widget. + **/ +GtkWidget * +comp_editor_new_date_edit (gboolean show_date, gboolean show_time) +{ + EDateEdit *dedit; + + dedit = E_DATE_EDIT (e_date_edit_new ()); + + e_date_edit_set_show_date (dedit, show_date); + e_date_edit_set_show_time (dedit, show_time); + + calendar_config_configure_e_date_edit (dedit); + + return GTK_WIDGET (dedit); +} diff --git a/calendar/gui/dialogs/comp-editor-util.h b/calendar/gui/dialogs/comp-editor-util.h index ad27ab06ca..d4f93df023 100644 --- a/calendar/gui/dialogs/comp-editor-util.h +++ b/calendar/gui/dialogs/comp-editor-util.h @@ -28,4 +28,6 @@ void comp_editor_dates (CompEditorPageDates *date, CalComponent *comp); void comp_editor_date_label (CompEditorPageDates *dates, GtkWidget *label); +GtkWidget *comp_editor_new_date_edit (gboolean show_date, gboolean show_time); + #endif diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 8ade431f36..07ace90bec 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -34,8 +34,8 @@ #include "e-util/e-dialog-widgets.h" #include "widgets/misc/e-dateedit.h" #include "cal-util/timeutil.h" -#include "../widget-util.h" #include "../calendar-config.h" +#include "comp-editor-util.h" #include "event-page.h" @@ -82,8 +82,6 @@ static void event_page_fill_component (CompEditorPage *page, CalComponent *comp) static void event_page_set_summary (CompEditorPage *page, const char *summary); static void event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); -GtkWidget *make_date_edit (void); - static CompEditorPageClass *parent_class = NULL; @@ -933,8 +931,10 @@ event_page_new (void) return epage; } +GtkWidget *make_date_edit (void); + GtkWidget * make_date_edit (void) { - return date_edit_new (TRUE, TRUE); + return comp_editor_new_date_edit (TRUE, TRUE); } diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 4d690be6dc..b4a998f353 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -38,7 +38,6 @@ #include "../calendar-config.h" #include "../tag-calendar.h" #include "../weekday-picker.h" -#include "../widget-util.h" #include "comp-editor-util.h" #include "recurrence-page.h" @@ -1163,7 +1162,7 @@ make_ending_until_special (RecurrencePage *rpage) /* Create the widget */ - priv->ending_date_edit = date_edit_new (TRUE, FALSE); + priv->ending_date_edit = comp_editor_new_date_edit (TRUE, FALSE); de = E_DATE_EDIT (priv->ending_date_edit); gtk_container_add (GTK_CONTAINER (priv->ending_special), diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 317f36dbe6..d6f0e57738 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -32,7 +32,6 @@ #include #include #include "e-util/e-dialog-widgets.h" -#include "../widget-util.h" #include "comp-editor-util.h" #include "task-details-page.h" @@ -454,7 +453,7 @@ task_details_page_create_date_edit (void) { GtkWidget *dedit; - dedit = date_edit_new (TRUE, TRUE); + dedit = comp_editor_new_date_edit (TRUE, TRUE); e_date_edit_set_allow_no_date_set (E_DATE_EDIT (dedit), TRUE); return dedit; diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index a1e66260c2..ffa5521b29 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -36,7 +36,6 @@ #include #include #include "e-util/e-dialog-widgets.h" -#include "../widget-util.h" #include "task-page.h" @@ -558,9 +557,7 @@ task_page_set_summary (CompEditorPage *page, const char *summary) tpage = TASK_PAGE (page); priv = tpage->priv; - gtk_signal_handler_block_by_data (GTK_OBJECT (priv->summary), tpage); e_utf8_gtk_entry_set_text (GTK_ENTRY (priv->summary), summary); - gtk_signal_handler_unblock_by_data (GTK_OBJECT (priv->summary), tpage); } static void @@ -959,7 +956,7 @@ task_page_create_date_edit (void) { GtkWidget *dedit; - dedit = date_edit_new (TRUE, TRUE); + dedit = comp_editor_new_date_edit (TRUE, TRUE); e_date_edit_set_allow_no_date_set (E_DATE_EDIT (dedit), TRUE); return dedit; -- cgit v1.2.3