diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-04-22 02:52:23 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-04-22 05:07:15 +0800 |
commit | 7950d6a0c6efd6c4d48afd99c138f38952bdd1bb (patch) | |
tree | 3a8fd7957dd29441120d2db18ccb1cc23f5935f2 /calendar | |
parent | 397b15ff4aa5afd1d5c7e0a093a33616624401cf (diff) | |
download | gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.gz gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.tar.zst gsoc2013-evolution-7950d6a0c6efd6c4d48afd99c138f38952bdd1bb.zip |
Adapt to libedataserver[ui] changes.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/alarm-notify/alarm-queue.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/calendar-setup.c | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/e-send-options-utils.c | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 24 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.c | 15 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 13 | ||||
-rw-r--r-- | calendar/gui/e-cal-component-preview.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-cal-model.c | 4 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-day-view.c | 2 | ||||
-rw-r--r-- | calendar/gui/e-task-table.c | 4 | ||||
-rw-r--r-- | calendar/importers/icalendar-importer.c | 54 |
13 files changed, 96 insertions, 44 deletions
diff --git a/calendar/alarm-notify/alarm-queue.c b/calendar/alarm-notify/alarm-queue.c index 8cd052952a..7d3a082d5a 100644 --- a/calendar/alarm-notify/alarm-queue.c +++ b/calendar/alarm-notify/alarm-queue.c @@ -1022,7 +1022,7 @@ edit_component (ECalClient *cal_client, * How are other apps expected to know this stuff? */ source = e_client_get_source (E_CLIENT (cal_client)); - source_uid = e_source_peek_uid (source); + source_uid = e_source_get_uid (source); e_cal_component_get_uid (comp, &comp_uid); diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c index bf77f8c70d..0d0da2244a 100644 --- a/calendar/gui/dialogs/calendar-setup.c +++ b/calendar/gui/dialogs/calendar-setup.c @@ -68,7 +68,7 @@ eccp_check_complete (EConfig *ec, const gchar *tmp; ESource *source; - tmp = e_source_peek_name (sdialog->source); + tmp = e_source_get_display_name (sdialog->source); valid = tmp && tmp[0] && ((source = e_source_group_peek_source_by_name (sdialog->source_group, tmp)) == NULL || source == sdialog->original_source); return valid; @@ -233,7 +233,7 @@ name_changed (GtkEntry *entry, name = gtk_entry_get_text (GTK_ENTRY (entry)); - changed = g_strcmp0 (name, e_source_peek_name (source)) != 0; + changed = g_strcmp0 (name, e_source_get_display_name (source)) != 0; e_source_set_name (source, name); group = e_source_peek_group (source); @@ -275,7 +275,7 @@ eccp_get_source_name (EConfig *ec, G_CALLBACK (name_changed), (gpointer) t); if (source) - gtk_entry_set_text (GTK_ENTRY (entry), e_source_peek_name (source)); + gtk_entry_set_text (GTK_ENTRY (entry), e_source_get_display_name (source)); return entry; } @@ -440,7 +440,7 @@ eccp_get_source_color (EConfig *ec, if (!gdk_color_parse (color_spec, &color)) g_warning ("Unknown color \"%s\" in calendar \"%s\"", - color_spec, e_source_peek_name (sdialog->source)); + color_spec, e_source_get_display_name (sdialog->source)); label = gtk_label_new_with_mnemonic (_("Colo_r:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 641666b230..033d80a4a7 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -957,7 +957,7 @@ action_save_cb (GtkAction *action, e_alert_submit ( E_ALERT_SINK (editor), "calendar:prompt-read-only-cal-editor", - e_source_peek_name ( + e_source_get_display_name ( e_client_get_source (E_CLIENT (priv->cal_client))), NULL); return; @@ -969,7 +969,7 @@ action_save_cb (GtkAction *action, e_alert_submit ( E_ALERT_SINK (editor), "calendar:prompt-no-task-assignment-editor", - e_source_peek_name ( + e_source_get_display_name ( e_client_get_source (E_CLIENT (priv->cal_client))), NULL); return; @@ -2184,7 +2184,7 @@ prompt_and_save_changes (CompEditor *editor, e_alert_submit ( E_ALERT_SINK (editor), "calendar:prompt-read-only-cal-editor", - e_source_peek_name ( + e_source_get_display_name ( e_client_get_source (E_CLIENT (priv->cal_client))), NULL); /* don't discard changes when selected readonly calendar */ @@ -2197,7 +2197,7 @@ prompt_and_save_changes (CompEditor *editor, e_alert_submit ( E_ALERT_SINK (editor), "calendar:prompt-no-task-assignment-editor", - e_source_peek_name ( + e_source_get_display_name ( e_client_get_source (E_CLIENT (priv->cal_client))), NULL); return FALSE; diff --git a/calendar/gui/dialogs/e-send-options-utils.c b/calendar/gui/dialogs/e-send-options-utils.c index 780554812d..e42bbc73d4 100644 --- a/calendar/gui/dialogs/e-send-options-utils.c +++ b/calendar/gui/dialogs/e-send-options-utils.c @@ -51,7 +51,7 @@ e_send_options_utils_set_default_data (ESendOptionsDialog *sod, else source_list = e_source_list_new_for_gconf (gconf, "/apps/evolution/tasks/sources"); - uid = e_source_peek_uid (source); + uid = e_source_get_uid (source); source = e_source_list_peek_source_by_uid (source_list, uid); /* priority */ diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 086f3ef494..a3c2b496ea 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -2889,10 +2889,12 @@ event_page_send_options_clicked_cb (EventPage *epage) if (!priv->sod) { priv->sod = e_send_options_dialog_new (); - source = e_source_combo_box_get_active ( + source = e_source_combo_box_ref_active ( E_SOURCE_COMBO_BOX (priv->source_selector)); - e_send_options_utils_set_default_data (priv->sod, source, "calendar"); + e_send_options_utils_set_default_data ( + priv->sod, source, "calendar"); priv->sod->data->initialized = TRUE; + g_object_unref (source); } if (e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS)) { @@ -2939,7 +2941,7 @@ epage_client_opened_cb (GObject *source_object, NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, _("Unable to open the calendar '%s': %s"), - e_source_peek_name (source), + e_source_get_display_name (source), error->message); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -2987,7 +2989,8 @@ source_changed_cb (ESourceComboBox *source_combo_box, if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (epage))) return; - source = e_source_combo_box_get_active (source_combo_box); + source = e_source_combo_box_ref_active (source_combo_box); + g_return_if_fail (source != NULL); if (priv->open_cancellable) { g_cancellable_cancel (priv->open_cancellable); @@ -2995,9 +2998,13 @@ source_changed_cb (ESourceComboBox *source_combo_box, } priv->open_cancellable = g_cancellable_new (); - e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_EVENTS, FALSE, priv->open_cancellable, - e_client_utils_authenticate_handler, NULL, - epage_client_opened_cb, epage); + e_client_utils_open_new ( + source, E_CLIENT_SOURCE_TYPE_EVENTS, + FALSE, priv->open_cancellable, + e_client_utils_authenticate_handler, NULL, + epage_client_opened_cb, epage); + + g_object_unref (source); } static void @@ -3305,7 +3312,8 @@ init_widgets (EventPage *epage) g_signal_connect ( priv->alarm_dialog, "delete-event", G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); - priv->alarm_list_dlg_widget = alarm_list_dialog_peek (client, priv->alarm_list_store); + priv->alarm_list_dlg_widget = alarm_list_dialog_peek ( + client, priv->alarm_list_store); gtk_widget_reparent (priv->alarm_list_dlg_widget, priv->alarm_box); gtk_widget_show_all (priv->alarm_list_dlg_widget); gtk_widget_hide (priv->alarm_dialog); diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 5348a19328..58d3d3b207 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -947,7 +947,7 @@ mpage_client_opened_cb (GObject *source_object, dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, _("Unable to open memos in '%s': %s"), - e_source_peek_name (source), + e_source_get_display_name (source), error ? error->message : _("Unknown error")); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -993,7 +993,8 @@ source_changed_cb (ESourceComboBox *source_combo_box, if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (mpage))) return; - source = e_source_combo_box_get_active (source_combo_box); + source = e_source_combo_box_ref_active (source_combo_box); + g_return_if_fail (source != NULL); if (priv->open_cancellable) { g_cancellable_cancel (priv->open_cancellable); @@ -1001,9 +1002,13 @@ source_changed_cb (ESourceComboBox *source_combo_box, } priv->open_cancellable = g_cancellable_new (); - e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_MEMOS, FALSE, priv->open_cancellable, - e_client_utils_authenticate_handler, NULL, - mpage_client_opened_cb, mpage); + e_client_utils_open_new ( + source, E_CLIENT_SOURCE_TYPE_MEMOS, + FALSE, priv->open_cancellable, + e_client_utils_authenticate_handler, NULL, + mpage_client_opened_cb, mpage); + + g_object_unref (source); } static void diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 71a494541a..9e051af37d 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -1775,7 +1775,7 @@ tpage_client_opened_cb (GObject *source_object, NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, _("Unable to open tasks in '%s': %s"), - e_source_peek_name (source), + e_source_get_display_name (source), error->message); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -1824,7 +1824,8 @@ source_changed_cb (ESourceComboBox *source_combo_box, if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage))) return; - source = e_source_combo_box_get_active (source_combo_box); + source = e_source_combo_box_ref_active (source_combo_box); + g_return_if_fail (source != NULL); if (priv->open_cancellable) { g_cancellable_cancel (priv->open_cancellable); @@ -1837,6 +1838,8 @@ source_changed_cb (ESourceComboBox *source_combo_box, FALSE, priv->open_cancellable, e_client_utils_authenticate_handler, NULL, tpage_client_opened_cb, tpage); + + g_object_unref (source); } static void @@ -1880,9 +1883,11 @@ task_page_send_options_clicked_cb (TaskPage *tpage) if (!priv->sod) { priv->sod = e_send_options_dialog_new (); priv->sod->data->initialized = TRUE; - source = e_source_combo_box_get_active ( + source = e_source_combo_box_ref_active ( E_SOURCE_COMBO_BOX (priv->source_selector)); - e_send_options_utils_set_default_data (priv->sod, source, "task"); + e_send_options_utils_set_default_data ( + priv->sod, source, "task"); + g_object_unref (source); } if (e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS)) { diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index c96a9e0790..4b727d4d53 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -109,7 +109,7 @@ update_comp_info (ECalComponentPreview *preview, gint comp_sequence; source = e_client_get_source (E_CLIENT (client)); - cal_uid = g_strdup (e_source_peek_uid (source)); + cal_uid = g_strdup (e_source_get_uid (source)); e_cal_component_get_uid (comp, &uid); comp_uid = g_strdup (uid); e_cal_component_get_last_modified (comp, &itm); diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 20dee7f714..d56b7583fd 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -2942,7 +2942,7 @@ client_opened_cb (GObject *source_object, g_warning ( "%s: Failed to open '%s': %s", G_STRFUNC, - e_source_peek_name (source), + e_source_get_display_name (source), error->message); g_error_free (error); e_cal_model_update_status_message (model, NULL, -1.0); @@ -3017,7 +3017,7 @@ add_new_client (ECalModel *model, gchar *msg; source = e_client_get_source (E_CLIENT (client)); - display_name = e_source_peek_name (source); + display_name = e_source_get_display_name (source); msg = g_strdup_printf (_("Opening %s"), display_name); e_cal_model_update_status_message (model, msg, -1.0); g_free (msg); diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 17d5a43965..24ea98a8f7 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1517,7 +1517,7 @@ e_calendar_view_new_appointment_for (ECalendarView *cal_view, widget = e_alert_dialog_new_for_args ( parent, "calendar:prompt-read-only-cal", - e_source_peek_name (source), + e_source_get_display_name (source), NULL); g_signal_connect ( diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 7b4fecfb0a..ad7fd78cd3 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -7909,7 +7909,7 @@ e_day_view_on_drag_data_get (GtkWidget *widget, gchar *tmp; source = e_client_get_source (E_CLIENT (event->comp_data->client)); - source_uid = e_source_peek_uid (source); + source_uid = e_source_get_uid (source); tmp = g_strconcat (source_uid, "\n", comp_str, NULL); target = gtk_selection_data_get_target (selection_data); diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index b314766aff..651ef83a89 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -1692,7 +1692,7 @@ hide_completed_rows_ready (GObject *source_object, g_debug ("%s: Could not get the objects from '%s': %s", G_STRFUNC, - source ? e_source_peek_name (source) : "???", + source ? e_source_get_display_name (source) : "???", error ? error->message : "Uknown error"); } g_clear_error (&error); @@ -1754,7 +1754,7 @@ show_completed_rows_ready (GObject *source_object, g_debug ("%s: Could not get the objects from '%s': %s", G_STRFUNC, - source ? e_source_peek_name (source) : "???", + source ? e_source_get_display_name (source) : "???", error ? error->message : "Uknown error"); } g_clear_error (&error); diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index 9432bc3256..9723236d26 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -255,20 +255,37 @@ static void button_toggled_cb (GtkWidget *widget, struct _selector_data *sd) { - g_datalist_set_data_full(&sd->target->data, "primary-source", - g_object_ref (e_source_selector_get_primary_selection ((ESourceSelector *) sd->selector)), - g_object_unref); - g_datalist_set_data(&sd->target->data, "primary-type", GINT_TO_POINTER(import_type_map[sd->page])); - gtk_notebook_set_current_page ((GtkNotebook *) sd->notebook, sd->page); + ESourceSelector *selector; + ESource *source; + GtkNotebook *notebook; + + selector = E_SOURCE_SELECTOR (sd->selector); + source = e_source_selector_ref_primary_selection (selector); + g_return_if_fail (source != NULL); + + g_datalist_set_data_full ( + &sd->target->data, "primary-source", + source, (GDestroyNotify) g_object_unref); + g_datalist_set_data ( + &sd->target->data, "primary-type", + GINT_TO_POINTER (import_type_map[sd->page])); + + notebook = GTK_NOTEBOOK (sd->notebook); + gtk_notebook_set_current_page (notebook, sd->page); } static void primary_selection_changed_cb (ESourceSelector *selector, EImportTarget *target) { - g_datalist_set_data_full(&target->data, "primary-source", - g_object_ref (e_source_selector_get_primary_selection (selector)), - g_object_unref); + ESource *source; + + source = e_source_selector_ref_primary_selection (selector); + g_return_if_fail (source != NULL); + + g_datalist_set_data_full ( + &target->data, "primary-source", + source, (GDestroyNotify) g_object_unref); } static GtkWidget * @@ -436,7 +453,9 @@ ivcal_import (EImport *ei, ici->cancellable = g_cancellable_new (); e_import_status (ei, target, _("Opening calendar"), 0); - e_client_utils_open_new (g_datalist_get_data(&target->data, "primary-source"), type, FALSE, ici->cancellable, + e_client_utils_open_new ( + g_datalist_get_data (&target->data, "primary-source"), + type, FALSE, ici->cancellable, e_client_utils_authenticate_handler, NULL, ivcal_opened, ici); } @@ -841,6 +860,7 @@ open_default_source (ICalIntelligentImporter *ici, ESource *source; ECalClient *cal_client; GError *error = NULL; + EClientSourceType client_source_type; struct OpenDefaultSourceData *odsd; g_return_if_fail (ici != NULL); @@ -863,6 +883,20 @@ open_default_source (ICalIntelligentImporter *ici, source = g_object_ref (source); g_object_unref (cal_client); + switch (source_type) { + case E_CAL_CLIENT_SOURCE_TYPE_EVENTS: + client_source_type = E_CLIENT_SOURCE_TYPE_EVENTS; + break; + case E_CAL_CLIENT_SOURCE_TYPE_TASKS: + client_source_type = E_CLIENT_SOURCE_TYPE_TASKS; + break; + case E_CAL_CLIENT_SOURCE_TYPE_MEMOS: + client_source_type = E_CLIENT_SOURCE_TYPE_MEMOS; + break; + default: + g_return_if_reached (); + } + odsd = g_new0 (struct OpenDefaultSourceData, 1); odsd->ici = ici; odsd->opened_cb = opened_cb; @@ -870,7 +904,7 @@ open_default_source (ICalIntelligentImporter *ici, e_import_status (ici->ei, ici->target, _("Opening calendar"), 0); e_client_utils_open_new ( - source, source_type == E_CAL_CLIENT_SOURCE_TYPE_EVENTS ? E_CLIENT_SOURCE_TYPE_EVENTS : E_CLIENT_SOURCE_TYPE_TASKS, FALSE, ici->cancellable, + source, client_source_type, FALSE, ici->cancellable, e_client_utils_authenticate_handler, NULL, default_source_opened_cb, odsd); |