aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-component.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/calendar-component.c')
-rw-r--r--calendar/gui/calendar-component.c276
1 files changed, 138 insertions, 138 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index 6168988aad..607e199f81 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -82,16 +82,16 @@ static gint num_drag_types = sizeof(drag_types) / sizeof(drag_types[0]);
#define PARENT_TYPE bonobo_object_get_type ()
static BonoboObjectClass *parent_class = NULL;
-typedef struct
+typedef struct
{
ESourceList *source_list;
ESourceList *task_source_list;
ESourceList *memo_source_list;
-
+
GSList *source_selection;
GSList *task_source_selection;
GSList *memo_source_selection;
-
+
GnomeCalendar *calendar;
EInfoLabel *info_label;
@@ -106,7 +106,7 @@ typedef struct
EUserCreatableItemsHandler *creatable_items_handler;
EActivityHandler *activity_handler;
-
+
float vpane_pos;
} CalendarComponentView;
@@ -135,7 +135,7 @@ static void
calcomp_vpane_realized (GtkWidget *vpane, CalendarComponentView *view)
{
gtk_paned_set_position (GTK_PANED (vpane), (int)(view->vpane_pos*vpane->allocation.height));
-
+
}
static gboolean
@@ -190,7 +190,7 @@ ensure_sources (CalendarComponent *component)
group = E_SOURCE_GROUP (g->data);
- /* compare only file:// part. If user home dir name changes we do not want to create
+ /* compare only file:// part. If user home dir name changes we do not want to create
one more group */
if (!on_this_computer && !strncmp (base_uri_proto, e_source_group_peek_base_uri (group), 7))
@@ -225,11 +225,11 @@ ensure_sources (CalendarComponent *component)
homedir name changes */
if (strcmp (base_uri_proto, e_source_group_peek_base_uri (on_this_computer))) {
e_source_group_set_base_uri (on_this_computer, base_uri_proto);
-
+
/* *sigh* . We shouldn't need this sync call here as set_base_uri
call results in synching to gconf, but that happens in idle loop
and too late to prevent user seeing "Can not Open ... because of invalid uri" error.*/
- e_source_list_sync (source_list,NULL);
+ e_source_list_sync (source_list,NULL);
}
}
else {
@@ -247,7 +247,7 @@ ensure_sources (CalendarComponent *component)
/* Create the default Person addressbook */
personal_source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI);
e_source_group_add_source (on_this_computer, personal_source, -1);
-
+
calendars_selected = calendar_config_get_calendars_selected ();
if (!primary_calendar && !calendars_selected) {
GSList selected;
@@ -277,7 +277,7 @@ ensure_sources (CalendarComponent *component)
}
if (contacts) {
GSList *sources = e_source_group_peek_sources (contacts);
- if (sources)
+ if (sources)
birthdays_source = E_SOURCE (sources->data); /* There is only one source under Contacts Group*/
}
else {
@@ -299,7 +299,7 @@ ensure_sources (CalendarComponent *component)
if (!e_source_get_property (birthdays_source, "delete"))
e_source_set_property(birthdays_source, "delete", "no");
-
+
if (e_source_peek_color_spec (birthdays_source) == NULL)
e_source_set_color_spec (birthdays_source, "#DDBECE");
@@ -316,7 +316,7 @@ ensure_sources (CalendarComponent *component)
g_object_unref (personal_source);
if (birthdays_source)
g_object_unref (birthdays_source);
-
+
g_free (base_uri_proto);
g_free (base_uri);
}
@@ -328,10 +328,10 @@ static gboolean
is_in_selection (GSList *selection, ESource *source)
{
GSList *l;
-
+
for (l = selection; l; l = l->next) {
ESource *selected_source = l->data;
-
+
if (!strcmp (e_source_peek_uid (selected_source), e_source_peek_uid (source)))
return TRUE;
}
@@ -343,10 +343,10 @@ static gboolean
is_in_uids (GSList *uids, ESource *source)
{
GSList *l;
-
+
for (l = uids; l; l = l->next) {
const char *uid = l->data;
-
+
if (!strcmp (uid, e_source_peek_uid (source)))
return TRUE;
}
@@ -358,7 +358,7 @@ static void
update_uris_for_selection (CalendarComponentView *component_view)
{
GSList *selection, *l, *uids_selected = NULL;
-
+
selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (component_view->source_selector));
for (l = component_view->source_selection; l; l = l->next) {
@@ -370,11 +370,11 @@ update_uris_for_selection (CalendarComponentView *component_view)
for (l = selection; l; l = l->next) {
ESource *selected_source = l->data;
-
+
if (gnome_calendar_add_source (component_view->calendar, E_CAL_SOURCE_TYPE_EVENT, selected_source))
uids_selected = g_slist_append (uids_selected, (char *) e_source_peek_uid (selected_source));
}
-
+
e_source_selector_free_selection (component_view->source_selection);
component_view->source_selection = selection;
@@ -416,10 +416,10 @@ update_selection (CalendarComponentView *component_view)
for (l = selection; l; l = l->next) {
ESource *source = l->data;
- if (!is_in_uids (uids_selected, source))
+ if (!is_in_uids (uids_selected, source))
e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), source);
}
-
+
e_source_selector_free_selection (selection);
/* Make sure the whole selection is there */
@@ -428,9 +428,9 @@ update_selection (CalendarComponentView *component_view)
ESource *source;
source = e_source_list_peek_source_by_uid (component_view->source_list, uid);
- if (source)
+ if (source)
e_source_selector_select_source (E_SOURCE_SELECTOR (component_view->source_selector), source);
-
+
g_free (uid);
}
g_slist_free (uids_selected);
@@ -463,7 +463,7 @@ update_task_memo_selection (CalendarComponentView *component_view, ECalSourceTyp
gnome_calendar_remove_source_by_uid (component_view->calendar, type, uid);
else if (!is_in_uids (uids_selected, source))
gnome_calendar_remove_source (component_view->calendar, type, source);
-
+
g_free (uid);
}
g_slist_free (source_selection);
@@ -495,7 +495,7 @@ update_primary_selection (CalendarComponentView *component_view)
source = e_source_list_peek_source_by_uid (component_view->source_list, uid);
g_free (uid);
}
-
+
if (source) {
e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector), source);
} else {
@@ -526,7 +526,7 @@ update_primary_task_memo_selection (CalendarComponentView *component_view, ECalS
g_free (uid);
}
-
+
if (source)
gnome_calendar_set_default_source (component_view->calendar, type, source);
}
@@ -537,7 +537,7 @@ copy_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data)
{
CalendarComponentView *component_view = data;
ESource *selected_source;
-
+
selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector));
if (!selected_source)
return;
@@ -575,7 +575,7 @@ delete_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data)
e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector),
selected_source);
}
-
+
e_source_group_remove_source (e_source_peek_group (selected_source), selected_source);
e_source_list_sync (component_view->source_list, NULL);
}
@@ -622,7 +622,7 @@ popup_event_cb(ESourceSelector *selector, ESource *insource, GdkEventButton *eve
GSList *menus = NULL;
int i;
GtkMenu *menu;
-
+
/** @HookPoint-ECalPopup: Calendar Source Selector Context Menu
* @Id: org.gnome.evolution.calendar.source.popup
* @Class: org.gnome.evolution.calendar.popup:1.0
@@ -633,10 +633,10 @@ popup_event_cb(ESourceSelector *selector, ESource *insource, GdkEventButton *eve
ep = e_cal_popup_new("org.gnome.evolution.calendar.source.popup");
t = e_cal_popup_target_new_source(ep, selector);
t->target.widget = (GtkWidget *)component_view->calendar;
-
+
for (i=0;i<sizeof(ecc_source_popups)/sizeof(ecc_source_popups[0]);i++)
menus = g_slist_prepend(menus, &ecc_source_popups[i]);
-
+
e_popup_add_items((EPopup *)ep, menus, NULL, ecc_source_popup_free, component_view);
menu = e_popup_create_menu_once((EPopup *)ep, (EPopupTarget *)t, 0);
@@ -802,7 +802,7 @@ config_primary_selection_changed_cb (GConfClient *client, guint id, GConfEntry *
{
CalendarComponent *calendar_component = data;
CalendarComponentPrivate *priv = calendar_component->priv;
-
+
if (priv->create_ecal) {
g_object_unref (priv->create_ecal);
priv->create_ecal = NULL;
@@ -848,13 +848,13 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme
char *rid = NULL;
priv = calendar_component->priv;
-
+
l = g_list_last (priv->views);
if (!l)
return;
view = l->data;
-
+
if (!strncmp (uri, "calendar:", 9)) {
EUri *euri = e_uri_new (uri);
const char *p;
@@ -866,17 +866,17 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme
if (p) {
while (*p) {
len = strcspn (p, "=&");
-
+
/* If it's malformed, give up. */
if (p[len] != '=')
break;
-
+
header = (char *) p;
header[len] = '\0';
p += len + 1;
-
+
clen = strcspn (p, "&");
-
+
content = g_strndup (p, clen);
if (!g_ascii_strcasecmp (header, "startdate")) {
@@ -902,14 +902,14 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme
}
if (start != -1) {
-
+
if (end == -1)
end = start;
gnome_calendar_set_selected_time_range (view->calendar, start, end);
}
if (src_uid && uid)
gnome_calendar_edit_appointment (view->calendar, src_uid, uid, rid);
-
+
g_free (src_uid);
g_free (uid);
g_free (rid);
@@ -942,11 +942,11 @@ impl_upgradeFromVersion (PortableServer_Servant servant,
}
static gboolean
-selector_tree_drag_drop (GtkWidget *widget,
- GdkDragContext *context,
- int x,
- int y,
- guint time,
+selector_tree_drag_drop (GtkWidget *widget,
+ GdkDragContext *context,
+ int x,
+ int y,
+ guint time,
CalendarComponent *component)
{
GtkTreeViewColumn *column;
@@ -956,12 +956,12 @@ selector_tree_drag_drop (GtkWidget *widget,
GtkTreeModel *model;
GtkTreeIter iter;
gpointer data;
-
- if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, &path,
+
+ if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, &path,
&column, &cell_x, &cell_y))
return FALSE;
-
-
+
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
if (!gtk_tree_model_get_iter (model, &iter, path)) {
@@ -970,17 +970,17 @@ selector_tree_drag_drop (GtkWidget *widget,
}
gtk_tree_model_get (model, &iter, 0, &data, -1);
-
+
if (E_IS_SOURCE_GROUP (data)) {
g_object_unref (data);
gtk_tree_path_free (path);
return FALSE;
}
-
+
gtk_tree_path_free (path);
return TRUE;
}
-
+
static gboolean
selector_tree_drag_motion (GtkWidget *widget,
GdkDragContext *context,
@@ -995,21 +995,21 @@ selector_tree_drag_motion (GtkWidget *widget,
GtkTreeModel *model;
GtkTreeIter iter;
GdkDragAction action = GDK_ACTION_DEFAULT;
-
+
if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget),
x, y, &path, &pos))
goto finish;
-
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
-
+
if (!gtk_tree_model_get_iter (model, &iter, path))
goto finish;
-
+
gtk_tree_model_get (model, &iter, 0, &data, -1);
if (E_IS_SOURCE_GROUP (data) || e_source_get_readonly (data))
goto finish;
-
+
gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), path, GTK_TREE_VIEW_DROP_INTO_OR_BEFORE);
action = context->suggested_action;
@@ -1030,11 +1030,11 @@ update_single_object (ECal *client, icalcomponent *icalcomp)
icalcomponent *tmp_icalcomp;
uid = (char *) icalcomponent_get_uid (icalcomp);
-
+
if (e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL))
return e_cal_modify_object (client, icalcomp, CALOBJ_MOD_ALL, NULL);
- return e_cal_create_object (client, icalcomp, &uid, NULL);
+ return e_cal_create_object (client, icalcomp, &uid, NULL);
}
static gboolean
@@ -1052,7 +1052,7 @@ update_objects (ECal *client, icalcomponent *icalcomp)
subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT);
while (subcomp) {
gboolean success;
-
+
kind = icalcomponent_isa (subcomp);
if (kind == ICAL_VTIMEZONE_COMPONENT) {
icaltimezone *zone;
@@ -1078,10 +1078,10 @@ update_objects (ECal *client, icalcomponent *icalcomp)
}
static void
-selector_tree_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
+selector_tree_drag_data_received (GtkWidget *widget,
+ GdkDragContext *context,
+ gint x,
+ gint y,
GtkSelectionData *data,
guint info,
guint time,
@@ -1099,20 +1099,20 @@ selector_tree_drag_data_received (GtkWidget *widget,
if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget),
x, y, &path, &pos))
goto finish;
-
+
model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
-
+
if (!gtk_tree_model_get_iter (model, &iter, path))
goto finish;
-
-
+
+
gtk_tree_model_get (model, &iter, 0, &source, -1);
if (E_IS_SOURCE_GROUP (source) || e_source_get_readonly (source))
goto finish;
icalcomp = icalparser_parse_string ((char *)data->data);
-
+
if (icalcomp) {
char * uid;
@@ -1122,18 +1122,18 @@ selector_tree_drag_data_received (GtkWidget *widget,
icalcomponent_set_uid (icalcomp, uid);
}
- client = auth_new_cal_from_source (source,
+ client = auth_new_cal_from_source (source,
E_CAL_SOURCE_TYPE_EVENT);
-
+
if (client) {
if (e_cal_open (client, TRUE, NULL)) {
success = TRUE;
update_objects (client, icalcomp);
}
-
+
g_object_unref (client);
}
-
+
icalcomponent_free (icalcomp);
}
@@ -1144,12 +1144,12 @@ selector_tree_drag_data_received (GtkWidget *widget,
gtk_tree_path_free (path);
gtk_drag_finish (context, success, context->action == GDK_ACTION_MOVE, time);
-}
+}
static void
selector_tree_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, gpointer data)
{
- gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget),
+ gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget),
NULL, GTK_TREE_VIEW_DROP_BEFORE);
}
@@ -1161,57 +1161,57 @@ control_activate_cb (BonoboControl *control, gboolean activate, gpointer data)
if (activate) {
BonoboUIComponent *uic;
uic = bonobo_control_get_ui_component (component_view->view_control);
-
+
e_user_creatable_items_handler_activate (component_view->creatable_items_handler, uic);
- }
+ }
}
static void
config_create_ecal_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
-{
+{
CalendarComponent *calendar_component = data;
CalendarComponentPrivate *priv;
-
+
priv = calendar_component->priv;
g_object_unref (priv->create_ecal);
priv->create_ecal = NULL;
-
+
priv->notifications = g_list_remove (priv->notifications, GUINT_TO_POINTER (id));
}
static ECal *
-setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView *component_view)
+setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView *component_view)
{
CalendarComponentPrivate *priv;
ESource *source = NULL;
char *uid;
guint not;
-
+
priv = calendar_component->priv;
/* Try to use the client from the calendar first to avoid re-opening things */
if (component_view) {
ECal *default_ecal;
-
+
default_ecal = gnome_calendar_get_default_client (component_view->calendar);
if (default_ecal)
return default_ecal;
}
-
+
/* If there is an existing fall back, use that */
if (priv->create_ecal)
- return priv->create_ecal;
+ return priv->create_ecal;
- /* Get the current primary calendar, or try to set one if it doesn't already exist */
+ /* Get the current primary calendar, or try to set one if it doesn't already exist */
uid = calendar_config_get_primary_calendar ();
if (uid) {
source = e_source_list_peek_source_by_uid (priv->source_list, uid);
g_free (uid);
priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT);
- }
+ }
if (!priv->create_ecal) {
/* Try to create a default if there isn't one */
@@ -1219,19 +1219,19 @@ setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView
if (source)
priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT);
}
-
+
if (priv->create_ecal) {
icaltimezone *zone;
-
+
zone = calendar_config_get_icaltimezone ();
e_cal_set_default_timezone (priv->create_ecal, zone, NULL);
if (!e_cal_open (priv->create_ecal, FALSE, NULL)) {
GtkWidget *dialog;
-
+
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
- _("Unable to open the calendar '%s' for creating events and meetings"),
+ _("Unable to open the calendar '%s' for creating events and meetings"),
e_source_peek_name (source));
gtk_dialog_run (GTK_DIALOG (dialog));
@@ -1244,7 +1244,7 @@ setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView
} else {
GtkWidget *dialog;
-
+
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING, GTK_BUTTONS_OK,
_("There is no calendar available for creating events and meetings"));
@@ -1252,10 +1252,10 @@ setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView
gtk_widget_destroy (dialog);
return NULL;
- }
+ }
/* Handle the fact it may change on us */
- not = calendar_config_add_notification_primary_calendar (config_create_ecal_changed_cb,
+ not = calendar_config_add_notification_primary_calendar (config_create_ecal_changed_cb,
calendar_component);
priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
@@ -1297,7 +1297,7 @@ create_new_event (CalendarComponent *calendar_component, CalendarComponentView *
e_comp_editor_registry_add (comp_editor_registry, COMP_EDITOR (editor), TRUE);
}
- return TRUE;
+ return TRUE;
}
static void
@@ -1307,18 +1307,18 @@ create_local_item_cb (EUserCreatableItemsHandler *handler, const char *item_type
CalendarComponentPrivate *priv;
CalendarComponentView *component_view = NULL;
GList *l;
-
+
priv = calendar_component->priv;
-
+
for (l = priv->views; l; l = l->next) {
component_view = l->data;
if (component_view->creatable_items_handler == handler)
break;
-
+
component_view = NULL;
}
-
+
if (strcmp (item_type_name, CREATE_EVENT_ID) == 0)
create_new_event (calendar_component, component_view, FALSE, FALSE);
else if (strcmp (item_type_name, CREATE_ALLDAY_EVENT_ID) == 0)
@@ -1338,12 +1338,12 @@ create_component_view (CalendarComponent *calendar_component)
GtkWidget *statusbar_widget;
guint not;
AtkObject *a11y;
-
+
priv = calendar_component->priv;
/* Create the calendar component view */
component_view = g_new0 (CalendarComponentView, 1);
-
+
vpane = gtk_vpaned_new ();
g_signal_connect_after (vpane, "realize",
G_CALLBACK(calcomp_vpane_realized), component_view);
@@ -1355,20 +1355,20 @@ create_component_view (CalendarComponent *calendar_component)
component_view->task_source_list = g_object_ref (priv->task_source_list);
component_view->memo_source_list = g_object_ref (priv->memo_source_list);
component_view->vpane_pos = calendar_config_get_tag_vpane_pos ();
-
+
/* Create sidebar selector */
component_view->source_selector = e_source_selector_new (calendar_component->priv->source_list);
e_source_selector_set_select_new ((ESourceSelector *)component_view->source_selector, TRUE);
a11y = gtk_widget_get_accessible (GTK_WIDGET (component_view->source_selector));
atk_object_set_name (a11y, _("Calendar Source Selector"));
- g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion),
+ g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion),
calendar_component);
- g_signal_connect (component_view->source_selector, "drag-leave", G_CALLBACK (selector_tree_drag_leave),
+ g_signal_connect (component_view->source_selector, "drag-leave", G_CALLBACK (selector_tree_drag_leave),
calendar_component);
- g_signal_connect (component_view->source_selector, "drag-drop", G_CALLBACK (selector_tree_drag_drop),
+ g_signal_connect (component_view->source_selector, "drag-drop", G_CALLBACK (selector_tree_drag_drop),
calendar_component);
- g_signal_connect (component_view->source_selector, "drag-data-received",
+ g_signal_connect (component_view->source_selector, "drag-data-received",
G_CALLBACK (selector_tree_drag_data_received), calendar_component);
gtk_drag_dest_set(component_view->source_selector, GTK_DEST_DEFAULT_ALL, drag_types,
@@ -1392,9 +1392,9 @@ create_component_view (CalendarComponent *calendar_component)
gtk_box_pack_start(GTK_BOX (vbox), GTK_WIDGET (component_view->info_label), FALSE, TRUE, 0);
gtk_box_pack_start(GTK_BOX (vbox), selector_scrolled_window, TRUE, TRUE, 0);
gtk_widget_show (vbox);
-
- gtk_paned_pack1 (GTK_PANED (vpane), vbox, FALSE, FALSE);
-
+
+ gtk_paned_pack1 (GTK_PANED (vpane), vbox, FALSE, FALSE);
+
component_view->sidebar_control = bonobo_control_new (vpane);
/* Create main view */
@@ -1404,15 +1404,15 @@ create_component_view (CalendarComponent *calendar_component)
return NULL;
}
-
+
component_view->calendar = (GnomeCalendar *) bonobo_control_get_widget (component_view->view_control);
- gtk_paned_pack2 (GTK_PANED (vpane), gnome_calendar_get_tag (component_view->calendar), FALSE, FALSE);
+ gtk_paned_pack2 (GTK_PANED (vpane), gnome_calendar_get_tag (component_view->calendar), FALSE, FALSE);
/* This signal is thrown if backends die - we update the selector */
- g_signal_connect (component_view->calendar, "source_added",
+ g_signal_connect (component_view->calendar, "source_added",
G_CALLBACK (source_added_cb), component_view);
- g_signal_connect (component_view->calendar, "source_removed",
+ g_signal_connect (component_view->calendar, "source_removed",
G_CALLBACK (source_removed_cb), component_view);
/* Create status bar */
@@ -1422,9 +1422,9 @@ create_component_view (CalendarComponent *calendar_component)
gtk_widget_show (statusbar_widget);
component_view->statusbar_control = bonobo_control_new (statusbar_widget);
-
+
gnome_calendar_set_activity_handler (component_view->calendar, component_view->activity_handler);
-
+
/* connect after setting the initial selections, or we'll get unwanted calls
to calendar_control_sensitize_calendar_commands */
g_signal_connect (component_view->source_selector, "selection_changed",
@@ -1444,7 +1444,7 @@ create_component_view (CalendarComponent *calendar_component)
G_CALLBACK (calendar_dates_changed_cb), component_view);
/* Load the selection from the last run */
- update_selection (component_view);
+ update_selection (component_view);
update_primary_selection (component_view);
update_task_memo_selection (component_view, E_CAL_SOURCE_TYPE_TODO);
update_primary_task_memo_selection (component_view, E_CAL_SOURCE_TYPE_TODO);
@@ -1453,19 +1453,19 @@ create_component_view (CalendarComponent *calendar_component)
/* If the tasks/memos selection changes elsewhere, update it for the mini
mini tasks view sidebar */
- not = calendar_config_add_notification_tasks_selected (config_tasks_selection_changed_cb,
+ not = calendar_config_add_notification_tasks_selected (config_tasks_selection_changed_cb,
component_view);
component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not));
- not = calendar_config_add_notification_memos_selected (config_memos_selection_changed_cb,
+ not = calendar_config_add_notification_memos_selected (config_memos_selection_changed_cb,
component_view);
component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not));
- not = calendar_config_add_notification_primary_tasks (config_primary_tasks_selection_changed_cb,
+ not = calendar_config_add_notification_primary_tasks (config_primary_tasks_selection_changed_cb,
component_view);
component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not));
-
- not = calendar_config_add_notification_primary_memos (config_primary_memos_selection_changed_cb,
+
+ not = calendar_config_add_notification_primary_memos (config_primary_memos_selection_changed_cb,
component_view);
component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not));
@@ -1474,21 +1474,21 @@ create_component_view (CalendarComponent *calendar_component)
static void
destroy_component_view (CalendarComponentView *component_view)
-{
+{
GList *l;
-
+
if (component_view->source_list)
g_object_unref (component_view->source_list);
if (component_view->task_source_list)
g_object_unref (component_view->task_source_list);
-
+
if (component_view->memo_source_list)
g_object_unref (component_view->memo_source_list);
if (component_view->source_selection)
e_source_selector_free_selection (component_view->source_selection);
-
+
for (l = component_view->notifications; l; l = l->next)
calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
g_list_free (component_view->notifications);
@@ -1518,12 +1518,12 @@ view_destroyed_cb (gpointer data, GObject *where_the_object_was)
CalendarComponent *calendar_component = data;
CalendarComponentPrivate *priv;
GList *l;
-
+
priv = calendar_component->priv;
for (l = priv->views; l; l = l->next) {
CalendarComponentView *component_view = l->data;
-
+
if (G_OBJECT (component_view->view_control) == where_the_object_was) {
priv->views = g_list_remove (priv->views, component_view);
destroy_component_view (component_view);
@@ -1542,7 +1542,7 @@ impl_createView (PortableServer_Servant servant,
CalendarComponentPrivate *priv;
CalendarComponentView *component_view;
EComponentView *ecv;
-
+
priv = calendar_component->priv;
/* Create the calendar component view */
@@ -1556,7 +1556,7 @@ impl_createView (PortableServer_Servant servant,
g_object_weak_ref (G_OBJECT (component_view->view_control), view_destroyed_cb, calendar_component);
priv->views = g_list_append (priv->views, component_view);
-
+
/* TODO: Make CalendarComponentView just subclass EComponentView */
ecv = e_component_view_new_controls (parent, "calendar", component_view->sidebar_control,
component_view->view_control, component_view->statusbar_control);
@@ -1619,7 +1619,7 @@ impl_requestCreateItem (PortableServer_Servant servant,
{
CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant));
gboolean result = FALSE;
-
+
if (strcmp (item_type_name, CREATE_EVENT_ID) == 0)
result = create_new_event (calendar_component, NULL, FALSE, FALSE);
else if (strcmp (item_type_name, CREATE_ALLDAY_EVENT_ID) == 0)
@@ -1644,7 +1644,7 @@ impl_dispose (GObject *object)
CalendarComponent *calendar_component = CALENDAR_COMPONENT (object);
CalendarComponentPrivate *priv = calendar_component->priv;
GList *l;
-
+
if (priv->source_list != NULL) {
g_object_unref (priv->source_list);
priv->source_list = NULL;
@@ -1662,12 +1662,12 @@ impl_dispose (GObject *object)
for (l = priv->views; l; l = l->next) {
CalendarComponentView *component_view = l->data;
-
+
g_object_weak_unref (G_OBJECT (component_view->view_control), view_destroyed_cb, calendar_component);
}
g_list_free (priv->views);
priv->views = NULL;
-
+
for (l = priv->notifications; l; l = l->next)
calendar_config_remove_notification (GPOINTER_TO_UINT (l->data));
g_list_free (priv->notifications);
@@ -1681,14 +1681,14 @@ impl_finalize (GObject *object)
{
CalendarComponentPrivate *priv = CALENDAR_COMPONENT (object)->priv;
GList *l;
-
+
for (l = priv->views; l; l = l->next) {
CalendarComponentView *component_view = l->data;
-
+
destroy_component_view (component_view);
}
g_list_free (priv->views);
-
+
g_free (priv->base_directory);
g_free (priv->config_directory);
g_free (priv);
@@ -1719,7 +1719,7 @@ calendar_component_init (CalendarComponent *component)
{
CalendarComponentPrivate *priv;
guint not;
-
+
priv = g_new0 (CalendarComponentPrivate, 1);
priv->base_directory = g_build_filename (g_get_home_dir (), ".evolution", NULL);
@@ -1731,7 +1731,7 @@ calendar_component_init (CalendarComponent *component)
* calendar_component_peek_gconf_client(). */
priv->gconf_client = gconf_client_get_default ();
- not = calendar_config_add_notification_primary_calendar (config_primary_selection_changed_cb,
+ not = calendar_config_add_notification_primary_calendar (config_primary_selection_changed_cb,
component);
priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));