diff options
author | JP Rosevear <jpr@ximian.com> | 2001-06-02 09:22:38 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-06-02 09:22:38 +0800 |
commit | 411ebc296442644ace6dbbdf6e30b8ae92436021 (patch) | |
tree | d5ef9d37b5a0ca1939d2f7baaefe5f57e8fca4ae /calendar/gui | |
parent | 83c15783e32bdbdfd106120299417861ddd3c211 (diff) | |
download | gsoc2013-evolution-411ebc296442644ace6dbbdf6e30b8ae92436021.tar.gz gsoc2013-evolution-411ebc296442644ace6dbbdf6e30b8ae92436021.tar.zst gsoc2013-evolution-411ebc296442644ace6dbbdf6e30b8ae92436021.zip |
use new func
2001-06-01 JP Rosevear <jpr@ximian.com>
* 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
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/comp-editor-util.c | 24 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-util.h | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-details-page.c | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 5 | ||||
-rw-r--r-- | calendar/gui/widget-util.c | 54 | ||||
-rw-r--r-- | calendar/gui/widget-util.h | 31 |
8 files changed, 33 insertions, 97 deletions
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 <gal/widgets/e-unicode.h> #include <widgets/misc/e-dateedit.h> #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 <gal/widgets/e-categories.h> #include <widgets/misc/e-dateedit.h> #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; diff --git a/calendar/gui/widget-util.c b/calendar/gui/widget-util.c deleted file mode 100644 index d6034ce8b0..0000000000 --- a/calendar/gui/widget-util.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Evolution calendar - Widget utilities - * - * Copyright (C) 2000 Helix Code, Inc. - * - * Author: Federico Mena-Quintero <federico@helixcode.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <widgets/misc/e-dateedit.h> -#include "calendar-config.h" -#include "widget-util.h" - - - -/** - * date_edit_new: - * @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 * -date_edit_new (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/widget-util.h b/calendar/gui/widget-util.h deleted file mode 100644 index 930e0f9b6e..0000000000 --- a/calendar/gui/widget-util.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Evolution calendar - Widget utilities - * - * Copyright (C) 2000 Helix Code, Inc. - * - * Author: Federico Mena-Quintero <federico@helixcode.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef WIDGET_UTIL_H -#define WIDGET_UTIL_H - -#include <gtk/gtkwidget.h> - - -GtkWidget *date_edit_new (gboolean show_date, gboolean show_time); - - -#endif |