diff options
author | JP Rosevear <jpr@novell.com> | 2005-01-01 00:59:18 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2005-01-01 00:59:18 +0800 |
commit | de25efe4bdfddb3240b68980a14d9f390c6f7d8b (patch) | |
tree | 24026ad11a272d2fe531b97061f27eed1a5ecb6f /calendar | |
parent | 8e5d0b82e0d2ebd5beb5db504fa7f7302c541a42 (diff) | |
download | gsoc2013-evolution-de25efe4bdfddb3240b68980a14d9f390c6f7d8b.tar gsoc2013-evolution-de25efe4bdfddb3240b68980a14d9f390c6f7d8b.tar.gz gsoc2013-evolution-de25efe4bdfddb3240b68980a14d9f390c6f7d8b.tar.bz2 gsoc2013-evolution-de25efe4bdfddb3240b68980a14d9f390c6f7d8b.tar.lz gsoc2013-evolution-de25efe4bdfddb3240b68980a14d9f390c6f7d8b.tar.xz gsoc2013-evolution-de25efe4bdfddb3240b68980a14d9f390c6f7d8b.tar.zst gsoc2013-evolution-de25efe4bdfddb3240b68980a14d9f390c6f7d8b.zip |
add necessary include
2004-12-31 JP Rosevear <jpr@novell.com>
* gui/dialogs/schedule-page.c: add necessary include
* gui/dialogs/meeting-page.c (sensitize_widgets): kill warning
* gui/dialogs/cal-prefs-dialog.c (template_url_changed): kill warning
* gui/dialogs/alarm-dialog.c (malarm_widgets_to_alarm): kill warnings
(init_widgets): ditto
* gui/main.c (initialize): no need to init the config system now
* gui/e-cell-date-edit-config.h: include date edit text header
* gui/e-cal-config.c (ecp_target_free): kill warning
* gui/calendar-config.c: clean up includes, internally initialize
the config setup to make it easier for others; kill dead functions
svn path=/trunk/; revision=28209
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 20 | ||||
-rw-r--r-- | calendar/gui/calendar-config.c | 122 | ||||
-rw-r--r-- | calendar/gui/calendar-config.h | 15 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-dialog.c | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/meeting-page.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/schedule-page.c | 1 | ||||
-rw-r--r-- | calendar/gui/e-cal-config.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-cell-date-edit-config.h | 1 | ||||
-rw-r--r-- | calendar/gui/main.c | 2 |
10 files changed, 114 insertions, 57 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index f13c775c14..3979c5b771 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,23 @@ +2004-12-31 JP Rosevear <jpr@novell.com> + + * gui/dialogs/schedule-page.c: add necessary include + + * gui/dialogs/meeting-page.c (sensitize_widgets): kill warning + + * gui/dialogs/cal-prefs-dialog.c (template_url_changed): kill warning + + * gui/dialogs/alarm-dialog.c (malarm_widgets_to_alarm): kill warnings + (init_widgets): ditto + + * gui/main.c (initialize): no need to init the config system now + + * gui/e-cell-date-edit-config.h: include date edit text header + + * gui/e-cal-config.c (ecp_target_free): kill warning + + * gui/calendar-config.c: clean up includes, internally initialize + the config setup to make it easier for others; kill dead functions + 2004-12-26 Rodrigo Moya <rodrigo@novell.com> * gui/e-cal-model.c (search_by_uid_and_client): removed superfluous if diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index adbbf21b0c..c31bdca261 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -31,17 +31,11 @@ #include <string.h> #include <time.h> -#include <gtk/gtksignal.h> -#include <libgnome/gnome-config.h> #include <libgnomeui/gnome-dialog.h> #include <gal/util/e-util.h> #include <widgets/e-timezone-dialog/e-timezone-dialog.h> #include <libecal/e-cal-time-util.h> -#include "calendar-component.h" -#include "calendar-commands.h" -#include "e-tasks.h" -#include "e-cell-date-edit-text.h" #include "calendar-config-keys.h" #include "calendar-config.h" @@ -63,8 +57,8 @@ do_cleanup (void) config = NULL; } -void -calendar_config_init (void) +static void +calendar_config_init (void) { if (config) return; @@ -78,6 +72,8 @@ calendar_config_init (void) void calendar_config_remove_notification (guint id) { + calendar_config_init (); + gconf_client_notify_remove (config, id); } @@ -89,6 +85,8 @@ calendar_config_locale_supports_12_hour_format (void) char s[16]; time_t t = 0; + calendar_config_init (); + e_utf8_strftime (s, sizeof s, "%p", gmtime (&t)); return s[0] != '\0'; } @@ -121,12 +119,16 @@ units_to_string (CalUnits units) GSList * calendar_config_get_calendars_selected (void) { + calendar_config_init (); + return gconf_client_get_list (config, CALENDAR_CONFIG_SELECTED_CALENDARS, GCONF_VALUE_STRING, NULL); } void calendar_config_set_calendars_selected (GSList *selected) { + calendar_config_init (); + gconf_client_set_list (config, CALENDAR_CONFIG_SELECTED_CALENDARS, GCONF_VALUE_STRING, selected, NULL); } @@ -134,6 +136,8 @@ guint calendar_config_add_notification_calendars_selected (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_SELECTED_CALENDARS, func, data, NULL, NULL); @@ -144,12 +148,16 @@ calendar_config_add_notification_calendars_selected (GConfClientNotifyFunc func, char * calendar_config_get_primary_calendar (void) { + calendar_config_init (); + return gconf_client_get_string (config, CALENDAR_CONFIG_PRIMARY_CALENDAR, NULL); } void calendar_config_set_primary_calendar (const char *primary_uid) { + calendar_config_init (); + gconf_client_set_string (config, CALENDAR_CONFIG_PRIMARY_CALENDAR, primary_uid, NULL); } @@ -158,6 +166,8 @@ guint calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_PRIMARY_CALENDAR, func, data, NULL, NULL); @@ -171,6 +181,8 @@ calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, g gchar * calendar_config_get_timezone (void) { + calendar_config_init (); + return gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL); } @@ -179,6 +191,8 @@ calendar_config_get_icaltimezone (void) { char *location; icaltimezone *zone = NULL; + + calendar_config_init (); location = calendar_config_get_timezone (); if (location) @@ -196,6 +210,8 @@ calendar_config_get_icaltimezone (void) void calendar_config_set_timezone (gchar *timezone) { + calendar_config_init (); + if (timezone && timezone[0]) gconf_client_set_string (config, CALENDAR_CONFIG_TIMEZONE, timezone, NULL); else @@ -206,6 +222,8 @@ guint calendar_config_add_notification_timezone (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_TIMEZONE, func, data, NULL, NULL); @@ -216,6 +234,8 @@ calendar_config_add_notification_timezone (GConfClientNotifyFunc func, gpointer gboolean calendar_config_get_24_hour_format (void) { + calendar_config_init (); + /* If the locale defines 'am' and 'pm' strings then the user has the choice of 12-hour or 24-hour time format, with 12-hour as the default. If the locale doesn't have 'am' and 'pm' strings we have @@ -230,6 +250,8 @@ calendar_config_get_24_hour_format (void) void calendar_config_set_24_hour_format (gboolean use_24_hour) { + calendar_config_init (); + gconf_client_set_bool (config, CALENDAR_CONFIG_24HOUR, use_24_hour, NULL); } @@ -237,6 +259,8 @@ guint calendar_config_add_notification_24_hour_format (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_24HOUR, func, data, NULL, NULL); @@ -247,6 +271,8 @@ calendar_config_add_notification_24_hour_format (GConfClientNotifyFunc func, gpo gint calendar_config_get_week_start_day (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_WEEK_START, NULL); } @@ -254,6 +280,8 @@ calendar_config_get_week_start_day (void) void calendar_config_set_week_start_day (gint week_start_day) { + calendar_config_init (); + gconf_client_set_int (config, CALENDAR_CONFIG_WEEK_START, week_start_day, NULL); } @@ -261,6 +289,8 @@ guint calendar_config_add_notification_week_start_day (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_WEEK_START, func, data, NULL, NULL); @@ -271,6 +301,8 @@ calendar_config_add_notification_week_start_day (GConfClientNotifyFunc func, gpo gint calendar_config_get_day_start_hour (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_START_HOUR, NULL); } @@ -278,6 +310,8 @@ calendar_config_get_day_start_hour (void) void calendar_config_set_day_start_hour (gint day_start_hour) { + calendar_config_init (); + gconf_client_set_int (config, CALENDAR_CONFIG_DAY_START_HOUR, day_start_hour, NULL); } @@ -285,6 +319,8 @@ guint calendar_config_add_notification_day_start_hour (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_START_HOUR, func, data, NULL, NULL); @@ -294,6 +330,8 @@ calendar_config_add_notification_day_start_hour (GConfClientNotifyFunc func, gpo gint calendar_config_get_day_start_minute (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_START_MINUTE, NULL); } @@ -301,6 +339,8 @@ calendar_config_get_day_start_minute (void) void calendar_config_set_day_start_minute (gint day_start_min) { + calendar_config_init (); + gconf_client_set_int (config, CALENDAR_CONFIG_DAY_START_MINUTE, day_start_min, NULL); } @@ -308,6 +348,8 @@ guint calendar_config_add_notification_day_start_minute (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_START_MINUTE, func, data, NULL, NULL); @@ -317,6 +359,8 @@ calendar_config_add_notification_day_start_minute (GConfClientNotifyFunc func, g gint calendar_config_get_day_end_hour (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_END_HOUR, NULL); } @@ -324,6 +368,8 @@ calendar_config_get_day_end_hour (void) void calendar_config_set_day_end_hour (gint day_end_hour) { + calendar_config_init (); + gconf_client_set_int (config, CALENDAR_CONFIG_DAY_END_HOUR, day_end_hour, NULL); } @@ -331,6 +377,8 @@ guint calendar_config_add_notification_day_end_hour (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_END_HOUR, func, data, NULL, NULL); @@ -340,6 +388,8 @@ calendar_config_add_notification_day_end_hour (GConfClientNotifyFunc func, gpoin gint calendar_config_get_day_end_minute (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_DAY_END_MINUTE, NULL); } @@ -347,6 +397,8 @@ calendar_config_get_day_end_minute (void) void calendar_config_set_day_end_minute (gint day_end_min) { + calendar_config_init (); + gconf_client_set_int (config, CALENDAR_CONFIG_DAY_END_MINUTE, day_end_min, NULL); } @@ -355,6 +407,8 @@ calendar_config_add_notification_day_end_minute (GConfClientNotifyFunc func, gpo { guint id; + calendar_config_init (); + id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_END_MINUTE, func, data, NULL, NULL); return id; @@ -364,6 +418,8 @@ calendar_config_add_notification_day_end_minute (GConfClientNotifyFunc func, gpo gint calendar_config_get_time_divisions (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_TIME_DIVISIONS, NULL); } @@ -371,6 +427,8 @@ calendar_config_get_time_divisions (void) void calendar_config_set_time_divisions (gint divisions) { + calendar_config_init (); + gconf_client_set_int (config, CALENDAR_CONFIG_TIME_DIVISIONS, divisions, NULL); } @@ -378,6 +436,8 @@ guint calendar_config_add_notification_time_divisions (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_TIME_DIVISIONS, func, data, NULL, NULL); @@ -388,6 +448,8 @@ calendar_config_add_notification_time_divisions (GConfClientNotifyFunc func, gpo gboolean calendar_config_get_dnav_show_week_no (void) { + calendar_config_init (); + return gconf_client_get_bool (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, NULL); } @@ -395,6 +457,8 @@ calendar_config_get_dnav_show_week_no (void) void calendar_config_set_dnav_show_week_no (gboolean show_week_no) { + calendar_config_init (); + gconf_client_set_bool (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, show_week_no, NULL); } @@ -402,6 +466,8 @@ guint calendar_config_add_notification_dnav_show_week_no (GConfClientNotifyFunc func, gpointer data) { guint id; + + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, func, data, NULL, NULL); @@ -412,6 +478,8 @@ calendar_config_add_notification_dnav_show_week_no (GConfClientNotifyFunc func, gint calendar_config_get_hpane_pos (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_HPANE_POS, NULL); } @@ -419,6 +487,8 @@ calendar_config_get_hpane_pos (void) void calendar_config_set_hpane_pos (gint hpane_pos) { + calendar_config_init (); + gconf_client_set_int (config, CALENDAR_CONFIG_HPANE_POS, hpane_pos, NULL); } @@ -426,6 +496,8 @@ calendar_config_set_hpane_pos (gint hpane_pos) gint calendar_config_get_vpane_pos (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_VPANE_POS, NULL); } @@ -433,6 +505,8 @@ calendar_config_get_vpane_pos (void) void calendar_config_set_vpane_pos (gint vpane_pos) { + calendar_config_init (); + gconf_client_set_int (config, CALENDAR_CONFIG_VPANE_POS, vpane_pos, NULL); } @@ -440,6 +514,8 @@ calendar_config_set_vpane_pos (gint vpane_pos) gint calendar_config_get_month_hpane_pos (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_MONTH_HPANE_POS, NULL); } @@ -447,6 +523,8 @@ calendar_config_get_month_hpane_pos (void) void calendar_config_set_month_hpane_pos (gint hpane_pos) { + calendar_config_init (); + gconf_client_set_int (config, CALENDAR_CONFIG_MONTH_HPANE_POS, hpane_pos, NULL); } @@ -454,6 +532,8 @@ calendar_config_set_month_hpane_pos (gint hpane_pos) gint calendar_config_get_month_vpane_pos (void) { + calendar_config_init (); + return gconf_client_get_int (config, CALENDAR_CONFIG_MONTH_VPANE_POS, NULL); } @@ -750,32 +830,6 @@ calendar_config_set_confirm_purge (gboolean confirm) gconf_client_set_bool (config, CALENDAR_CONFIG_PROMPT_PURGE, confirm, NULL); } -/* This sets all the common config settings for an EDateEdit widget. - These are the week start day, whether we show week numbers, and whether we - use 24 hour format. */ -void -calendar_config_configure_e_date_edit (EDateEdit *dedit) -{ - gboolean dnav_show_week_no, use_24_hour; - gint week_start_day; - - g_return_if_fail (E_IS_DATE_EDIT (dedit)); - - dnav_show_week_no = calendar_config_get_dnav_show_week_no (); - - /* Note that this is 0 (Sun) to 6 (Sat). */ - week_start_day = calendar_config_get_week_start_day (); - - /* Convert it to 0 (Mon) to 6 (Sun), which is what we use. */ - week_start_day = (week_start_day + 6) % 7; - - use_24_hour = calendar_config_get_24_hour_format (); - - e_date_edit_set_week_start_day (dedit, week_start_day); - e_date_edit_set_show_week_numbers (dedit, dnav_show_week_no); - e_date_edit_set_use_24_hour_format (dedit, use_24_hour); -} - void calendar_config_check_timezone_set () { diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index cba2c7bcd7..414e52b14f 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -30,12 +30,9 @@ #ifndef _CALENDAR_CONFIG_H_ #define _CALENDAR_CONFIG_H_ +#include <glib.h> +#include <libecal/e-cal.h> #include <gconf/gconf-client.h> -#include <widgets/misc/e-calendar.h> -#include <widgets/misc/e-dateedit.h> -#include <widgets/misc/e-cell-date-edit.h> -#include "e-calendar-table.h" - /* These are used to get/set the working days in the week. The bit-flags are combined together. The bits must be from 0 (Sun) to 6 (Sat) to match the @@ -61,7 +58,6 @@ typedef enum } CalUnits; -void calendar_config_init (void); void calendar_config_remove_notification (guint id); /* @@ -211,13 +207,6 @@ void calendar_config_set_free_busy_template (const gchar *template); guint calendar_config_add_notification_free_busy_template (GConfClientNotifyFunc func, gpointer data); -/* Convenience functions to configure common properties of ECalendar, - EDateEdit & ECalendarTable widgets, and the ECellDateEdit ETable cell. */ -void calendar_config_configure_e_calendar (ECalendar *cal); -void calendar_config_configure_e_date_edit (EDateEdit *dedit); -void calendar_config_configure_e_calendar_table (ECalendarTable *cal_table); -void calendar_config_configure_e_cell_date_edit (ECellDateEdit *ecde); - /* Shows the timezone dialog if the user hasn't set a default timezone. */ void calendar_config_check_timezone_set (void); diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index 6cdc789eab..1fe8c5c1d4 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -342,7 +342,6 @@ malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) char *str; ECalComponentText description; GSList *attendee_list = NULL; - EDestination **destv; GtkTextBuffer *text_buffer; GtkTextIter text_iter_start, text_iter_end; ENameSelectorModel *name_selector_model; @@ -351,7 +350,6 @@ malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) icalcomponent *icalcomp; icalproperty *icalprop; GList *l; - int i; /* Attendees */ name_selector_model = e_name_selector_peek_model (dialog->name_selector); @@ -869,8 +867,6 @@ init_widgets (Dialog *dialog) { GtkWidget *menu; GtkTextBuffer *text_buffer; - BonoboControlFrame *cf; - Bonobo_PropertyBag pb = CORBA_OBJECT_NIL; menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dialog->action)); g_signal_connect (menu, "selection_done", diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index 79a825ef73..750319a001 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -374,8 +374,6 @@ static void template_url_changed (GtkEntry *entry, DialogData *dialog_data) { calendar_config_set_free_busy_template (gtk_entry_get_text (entry)); - - return FALSE; } static void diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c index 33eb509865..de66095724 100644 --- a/calendar/gui/dialogs/meeting-page.c +++ b/calendar/gui/dialogs/meeting-page.c @@ -305,7 +305,7 @@ clear_widgets (MeetingPage *mpage) static void sensitize_widgets (MeetingPage *mpage) { - gboolean read_only = FALSE, user_org; + gboolean read_only = FALSE; MeetingPagePrivate *priv = mpage->priv; GError *error = NULL; diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 83bc6d788a..327770cecb 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -34,6 +34,7 @@ #include <libgnomeui/gnome-dialog-util.h> #include <glade/glade.h> #include <e-util/e-dialog-widgets.h> +#include <widgets/misc/e-dateedit.h> #include "../calendar-config.h" #include "../e-meeting-time-sel.h" #include "../itip-utils.h" diff --git a/calendar/gui/e-cal-config.c b/calendar/gui/e-cal-config.c index 65c1d8c2b6..8059e25f4d 100644 --- a/calendar/gui/e-cal-config.c +++ b/calendar/gui/e-cal-config.c @@ -52,7 +52,7 @@ ecp_target_free (EConfig *ec, EConfigTarget *t) if (p->source_changed_id) { g_signal_handler_disconnect (s->source, p->source_changed_id); - p->source_changed_id = NULL; + p->source_changed_id = 0; } break; } } diff --git a/calendar/gui/e-cell-date-edit-config.h b/calendar/gui/e-cell-date-edit-config.h index fad1d9e508..889e6440e3 100644 --- a/calendar/gui/e-cell-date-edit-config.h +++ b/calendar/gui/e-cell-date-edit-config.h @@ -24,6 +24,7 @@ #define _E_CELL_DATE_EDIT_CONFIG_H_ #include <widgets/misc/e-cell-date-edit.h> +#include "e-cell-date-edit-text.h" G_BEGIN_DECLS diff --git a/calendar/gui/main.c b/calendar/gui/main.c index 63da655858..51f2e47db8 100644 --- a/calendar/gui/main.c +++ b/calendar/gui/main.c @@ -132,8 +132,6 @@ initialize (void) { comp_editor_registry = E_COMP_EDITOR_REGISTRY (e_comp_editor_registry_new ()); - calendar_config_init (); - #if 0 itip_control_factory_init (); component_editor_factory_init (); |