From 7950d6a0c6efd6c4d48afd99c138f38952bdd1bb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 21 Apr 2012 14:52:23 -0400 Subject: Adapt to libedataserver[ui] changes. --- calendar/gui/dialogs/calendar-setup.c | 8 ++++---- calendar/gui/dialogs/comp-editor.c | 8 ++++---- calendar/gui/dialogs/e-send-options-utils.c | 2 +- calendar/gui/dialogs/event-page.c | 24 ++++++++++++++++-------- calendar/gui/dialogs/memo-page.c | 15 ++++++++++----- calendar/gui/dialogs/task-page.c | 13 +++++++++---- 6 files changed, 44 insertions(+), 26 deletions(-) (limited to 'calendar/gui/dialogs') 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)) { -- cgit v1.2.3