From 64977cb1bcc55bf4c7c0fc38cd3d047b1e6a25c6 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 19 Apr 2007 18:53:33 +0000 Subject: Massive code cleanup (bug #429422) svn path=/trunk/; revision=33432 --- calendar/gui/dialogs/comp-editor.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'calendar/gui/dialogs/comp-editor.c') diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index d74c23daef..0cd25deef7 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -814,15 +814,17 @@ save_comp (CompEditor *editor) } if (!result) { - GtkWidget *dlg; - char *msg; + GtkWidget *dialog; - msg = g_strdup (error ? error->message : _("Could not update object")); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", (error != NULL) ? error->message : + _("Could not update object")); + gtk_dialog_run (GTK_DIALOG(dialog)); + gtk_widget_destroy (dialog); - dlg = gnome_error_dialog (msg); - gnome_dialog_run_and_close (GNOME_DIALOG (dlg)); - - g_free (msg); if (error) g_error_free (error); @@ -2093,7 +2095,7 @@ comp_editor_show_page (CompEditor *editor, CompEditorPage *page) page_widget = comp_editor_page_get_widget (page); page_num = gtk_notebook_page_num (priv->notebook, page_widget); - gtk_notebook_set_page (priv->notebook, page_num); + gtk_notebook_set_current_page (priv->notebook, page_num); } /** @@ -2964,10 +2966,17 @@ obj_modified_cb (ECal *client, GList *objects, gpointer data) if (e_cal_component_set_icalcomponent (comp, icalcomp)) { comp_editor_edit_comp (editor, comp); } else { - GtkWidget *dlg; + GtkWidget *dialog; + + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", + _("Unable to use current version!")); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); - dlg = gnome_error_dialog (_("Unable to use current version!")); - gnome_dialog_run_and_close (GNOME_DIALOG (dlg)); icalcomponent_free (icalcomp); } -- cgit v1.2.3