diff options
155 files changed, 1697 insertions, 1830 deletions
diff --git a/a11y/ChangeLog b/a11y/ChangeLog index d50eb5a4c9..0846e68111 100644 --- a/a11y/ChangeLog +++ b/a11y/ChangeLog @@ -1,3 +1,14 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * e-text/gal-a11y-e-text.c (et_get_extents), (et_get_full_text), + (et_set_full_text), (et_get_caret_offset): + Use g_object_get() instead of gtk_object_get(). + + * e-text/gal-a11y-e-text.c (et_paste_text): + Use g_object_set() instead of gtk_object_set(). + 2007-03-30 Wang Xin <jedy.wang@sun.com> * widgets/ea-calendar-item.c: Fixes #415985 and #416028. diff --git a/a11y/e-text/gal-a11y-e-text.c b/a11y/e-text/gal-a11y-e-text.c index 2d3b78991c..f1a06b73dc 100644 --- a/a11y/e-text/gal-a11y-e-text.c +++ b/a11y/e-text/gal-a11y-e-text.c @@ -64,10 +64,10 @@ et_get_extents (AtkComponent *component, &fake_height, coord_type); - gtk_object_get (GTK_OBJECT (item), - "text_width", &real_width, - "text_height", &real_height, - NULL); + g_object_get (item, + "text_width", &real_width, + "text_height", &real_height, + NULL); if (width) *width = real_width; @@ -82,9 +82,7 @@ et_get_full_text (AtkText *text) ETextModel *model; const char *full_text; - gtk_object_get (GTK_OBJECT (etext), - "model", &model, - NULL); + g_object_get (etext, "model", &model, NULL); full_text = e_text_model_get_text (model); @@ -98,9 +96,7 @@ et_set_full_text (AtkEditableText *text, EText *etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text))); ETextModel *model; - gtk_object_get (GTK_OBJECT (etext), - "model", &model, - NULL); + g_object_get (etext, "model", &model, NULL); e_text_model_set_text (model, full_text); } @@ -478,9 +474,7 @@ et_get_caret_offset (AtkText *text) g_return_val_if_fail (E_IS_TEXT (obj), -1); etext = E_TEXT (obj); - gtk_object_get (GTK_OBJECT (etext), - "cursor_pos", &offset, - NULL); + g_object_get (etext, "cursor_pos", &offset, NULL); return offset; } @@ -918,9 +912,7 @@ et_paste_text (AtkEditableText *text, g_return_if_fail (E_IS_TEXT (obj)); etext = E_TEXT (obj); - gtk_object_set (GTK_OBJECT (etext), - "cursor_pos", position, - NULL); + g_object_set (etext, "cursor_pos", position, NULL); e_text_paste_clipboard (etext); } diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 210a531008..1dae147ff8 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,43 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * tools/evolution-address-export.c: + Migrate from popt to GOption. + + * gui/contact-editor/e-contact-editor.c (e_contact_editor_init): + Use gtk_window_set_icon_from_file() instead of + gnome_window_icon_set_from_file(). + + * gui/widgets/e-addressbook-table-adapter.c: + * gui/widgets/e-addressbook-model.c: + * gui/widgets/eab-gui-util.c: + Include missing header file(s). + + * gui/widgets/eab-vcard-control.c (pstream_load), (book_open_cb), + (free_struct): + * gui/widgets/eab-gui-util.c (process_unref): + * gui/widgets/e-addressbook-view.c (eab_view_print), + (eab_view_print_preview), (eab_view_delete_selection), + (eab_view_save_as), (eab_view_view), (eab_view_send), + (eab_view_send_to): + e_free_object_list() is dead; just do it manually. + + * gui/widgets/e-addressbook-view.c (eab_view_print), + (eab_view_print_preview): + * conduit/address-conduit.c (addrconduit_load_configuration): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * conduit/address-conduit.c (e_addr_gui_new): + Use gtk_menu_shell_append() instead of gtk_menu_append(). + + * printing/e-contact-print.c (e_contact_build_style): + Use g_build_filename() instead of g_concat_dir_and_file(). + + * printing/e-contact-print-style-editor.c + (e_contact_print_style_editor_new): + Use g_object_new() instead of gtk_type_new(). + 2007-04-18 Srinivasa Ragavan <sragavan@novell.com> ** Committed Contact Merging patch from Ebby Wiselyn diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 293df8c79d..b2a5e3730c 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -168,11 +168,9 @@ addrconduit_load_configuration (guint32 pilot_id) c->pilot_id = pilot_id; management = gnome_pilot_conduit_management_new ("e_address_conduit", GNOME_PILOT_CONDUIT_MGMT_ID); - gtk_object_ref (GTK_OBJECT (management)); - gtk_object_sink (GTK_OBJECT (management)); + g_object_ref_sink (management); config = gnome_pilot_conduit_config_new (management, pilot_id); - gtk_object_ref (GTK_OBJECT (config)); - gtk_object_sink (GTK_OBJECT (config)); + g_object_ref_sink (config); if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type)) c->sync_type = GnomePilotConduitSyncTypeNotSet; gtk_object_unref (GTK_OBJECT (config)); @@ -307,7 +305,7 @@ e_addr_gui_new (EPilotSettings *ps) item = gtk_menu_item_new_with_label (items[i]); gtk_widget_show (item); - gtk_menu_append (GTK_MENU (menu), item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); } gtk_widget_show (menu); gtk_option_menu_set_menu (GTK_OPTION_MENU (gui->default_address), menu); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 1f857e593a..4a6262ec39 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -3348,7 +3348,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) /* set the icon */ icon_path = g_build_filename (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png", NULL); - gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor->app), icon_path); + gtk_window_set_icon_from_file (GTK_WINDOW (e_contact_editor->app), icon_path, NULL); g_free (icon_path); /* show window */ diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index edd824302b..85fa854324 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -8,6 +8,8 @@ */ #include <config.h> +#include <string.h> +#include <glib/gi18n.h> #include "eab-marshal.h" #include "e-addressbook-model.h" #include <libxml/tree.h> diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index a11f749523..65a82d03c9 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ #include <config.h> +#include <glib/gi18n.h> #include "e-addressbook-model.h" #include "e-addressbook-table-adapter.h" #include "eab-contact-merging.h" diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 5410bef787..282f142a77 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1859,7 +1859,8 @@ eab_view_print(EABView *view, int preview) e_contact_print_response (print, GTK_RESPONSE_APPLY, NULL); g_free (query); - e_free_object_list (list); + g_list_foreach (list, (GFunc) g_object_unref, NULL); + g_list_free (list); } else if (view->view_type == EAB_VIEW_TABLE) { GtkWidget *dialog; @@ -1872,8 +1873,7 @@ eab_view_print(EABView *view, int preview) g_object_get(view->widget, "table", &etable, NULL); printable = e_table_get_printable(etable); - g_object_ref (printable); - gtk_object_sink (GTK_OBJECT (printable)); + g_object_ref_sink (printable); g_object_unref(etable); g_object_ref (view->widget); @@ -1916,7 +1916,8 @@ eab_view_print_preview(EABView *view) else dialog = e_contact_print_dialog_new (book, query, list); e_contact_print_response (dialog, GTK_RESPONSE_APPLY, NULL); - e_free_object_list (list); + g_list_foreach (list, (GFunc) g_object_unref, NULL); + g_list_free (list); g_free (query); }else if (view->view_type == EAB_VIEW_TABLE) { GtkWidget *dialog; @@ -1929,8 +1930,7 @@ eab_view_print_preview(EABView *view) g_object_get(view->widget, "table", &etable, NULL); printable = e_table_get_printable(etable); - g_object_ref (printable); - gtk_object_sink (GTK_OBJECT (printable)); + g_object_ref_sink (printable); g_object_unref(etable); g_object_ref (view->widget); @@ -2003,7 +2003,8 @@ eab_view_delete_selection(EABView *view, gboolean is_delete) !eab_editor_confirm_delete(GTK_WINDOW(gtk_widget_get_toplevel(view->widget)), plural, is_list, name)) { g_free (name); - e_free_object_list(list); + g_list_foreach (list, (GFunc) g_object_unref, NULL); + g_list_free (list); return; } @@ -2062,7 +2063,8 @@ eab_view_delete_selection(EABView *view, gboolean is_delete) row = e_table_view_to_model_row (E_TABLE (etable), select); e_table_set_cursor_row (E_TABLE (etable), row); } - e_free_object_list(list); + g_list_foreach (list, (GFunc) g_object_unref, NULL); + g_list_free (list); } static void @@ -2177,7 +2179,8 @@ eab_view_save_as (EABView *view, gboolean all) } if (list) eab_contact_list_save (_("Save as VCard..."), list, NULL); - e_free_object_list(list); + g_list_foreach (list, (GFunc) g_object_unref, NULL); + g_list_free (list); } void @@ -2185,7 +2188,8 @@ eab_view_view (EABView *view) { GList *list = get_selected_contacts (view); eab_show_multiple_contacts (view->book, list, view->editable); - e_free_object_list(list); + g_list_foreach (list, (GFunc) g_object_unref, NULL); + g_list_free (list); } void @@ -2194,7 +2198,8 @@ eab_view_send (EABView *view) GList *list = get_selected_contacts (view); if (list) eab_send_contact_list (list, EAB_DISPOSITION_AS_ATTACHMENT); - e_free_object_list(list); + g_list_foreach (list, (GFunc) g_object_unref, NULL); + g_list_free (list); } void @@ -2203,7 +2208,8 @@ eab_view_send_to (EABView *view) GList *list = get_selected_contacts (view); if (list) eab_send_contact_list (list, EAB_DISPOSITION_AS_TO); - e_free_object_list(list); + g_list_foreach (list, (GFunc) g_object_unref, NULL); + g_list_free (list); } void diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index 64685bf6ff..ccfbac8ada 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -26,6 +26,7 @@ #include <errno.h> #include <string.h> +#include <glib/gi18n.h> #include <libedataserver/e-data-server-util.h> #include <libedataserverui/e-source-selector.h> #include <e-util/e-util.h> @@ -687,10 +688,12 @@ process_unref (ContactCopyProcess *process) { process->count --; if (process->count == 0) { - if (process->done_cb) { + if (process->done_cb) process->done_cb (process); - } - e_free_object_list(process->contacts); + g_list_foreach ( + process->contacts, + (GFunc) g_object_unref, NULL); + g_list_free (process->contacts); g_object_unref (process->source); g_object_unref (process->destination); g_free (process); diff --git a/addressbook/gui/widgets/eab-vcard-control.c b/addressbook/gui/widgets/eab-vcard-control.c index b015f865f5..df45562fb8 100644 --- a/addressbook/gui/widgets/eab-vcard-control.c +++ b/addressbook/gui/widgets/eab-vcard-control.c @@ -125,7 +125,11 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream, return; } - e_free_object_list (vcard_control->card_list); + g_list_foreach ( + vcard_control->card_list, + (GFunc) g_object_unref, NULL); + g_list_free (vcard_control->card_list); + list = eab_contact_list_from_string (vcard); g_free(vcard); vcard_control->card_list = list; @@ -192,7 +196,8 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure) } if (book) g_object_unref (book); - e_free_object_list (list); + g_list_foreach (list, (GFunc) g_object_unref, NULL); + g_list_free (list); } static void @@ -236,7 +241,11 @@ static void free_struct (gpointer data, GObject *where_object_was) { EABVCardControl *vcard_control = data; - e_free_object_list (vcard_control->card_list); + + g_list_foreach ( + vcard_control->card_list, + (GFunc) g_object_unref, NULL); + g_list_free (vcard_control->card_list); g_free (vcard_control); } diff --git a/addressbook/printing/e-contact-print-style-editor.c b/addressbook/printing/e-contact-print-style-editor.c index f5ac90bae0..3f945e28fe 100644 --- a/addressbook/printing/e-contact-print-style-editor.c +++ b/addressbook/printing/e-contact-print-style-editor.c @@ -128,8 +128,7 @@ e_contact_print_style_editor_destroy (GtkObject *object) GtkWidget* e_contact_print_style_editor_new (char *filename) { - GtkWidget *widget = GTK_WIDGET (gtk_type_new (e_contact_print_style_editor_get_type ())); - return widget; + return g_object_new (e_contact_print_style_editor_get_type (), NULL); } static void diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index e3899b8992..32098689d9 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -651,7 +651,7 @@ e_contact_build_style(EContactPrintStyle *style, GtkPrintSettings *config) style->center_footer = g_strdup(""); style->right_footer = g_strdup(""); style->reverse_on_even_pages = FALSE; - filename = g_concat_dir_and_file(EVOLUTION_ECPSDIR, "medbook.ecps"); + filename = g_build_filename(EVOLUTION_ECPSDIR, "medbook.ecps", NULL); styledoc = e_xml_parse_file (filename); g_free(filename); if (styledoc) { diff --git a/addressbook/tools/evolution-addressbook-export.c b/addressbook/tools/evolution-addressbook-export.c index ee157b74df..b99925d279 100644 --- a/addressbook/tools/evolution-addressbook-export.c +++ b/addressbook/tools/evolution-addressbook-export.c @@ -23,7 +23,9 @@ #include <config.h> +#include <string.h> #include <glib.h> +#include <glib/gi18n.h> #include <bonobo-activation/bonobo-activation.h> #include <bonobo/bonobo-main.h> #include <gnome.h> @@ -32,62 +34,71 @@ #include "evolution-addressbook-export.h" +/* Command-Line Options */ +static gchar *opt_output_file = NULL; +static gboolean opt_list_folders_mode = FALSE; +static gchar *opt_output_format = NULL; +static gchar *opt_addressbook_folder_uri = NULL; +static gboolean opt_async_mode = FALSE; +static gint opt_file_size = 0; +static gchar **opt_remaining = NULL; + +static GOptionEntry entries[] = { + { "output", '\0', G_OPTION_FLAG_FILENAME, + G_OPTION_ARG_STRING, &opt_output_file, + N_("Specify the output file instead of standard output"), + N_("OUTPUTFILE") }, + { "list-addressbook-folders", 'l', 0, + G_OPTION_ARG_NONE, &opt_list_folders_mode, + N_("List local addressbook folders") }, + { "format", '\0', 0, + G_OPTION_ARG_STRING, &opt_output_format, + N_("Show cards as vcard or csv file"), + N_("[vcard|csv]") }, + { "async", 'a', 0, + G_OPTION_ARG_NONE, &opt_async_mode, + N_("Export in asynchronous mode") }, + { "size", '\0', 0, + G_OPTION_ARG_INT, &opt_file_size, + N_("The number of cards in out output file in asynchronous mode, " + "default size 100."), + N_("NUMBER") }, + { G_OPTION_REMAINING, '\0', 0, + G_OPTION_ARG_STRING_ARRAY, &opt_remaining }, + { NULL } +}; + int main (int argc, char **argv) { ActionContext actctx; GnomeProgram *program; - poptContext context; - const gchar **argvn; + GOptionContext *context; int current_action = ACTION_NOTHING; int IsCSV = FALSE; int IsVCard = FALSE; - /*** popttable */ - char *output_file = NULL; - int list_folders_mode = FALSE; - char *output_format = NULL; - char *addressbook_folder_uri = NULL; - int async_mode = FALSE; - int file_size = 0; - - struct poptOption options[] = { - {"output", '\0', POPT_ARG_STRING, &output_file, 0, N_("Specify the output file instead of standard output"), - N_("OUTPUTFILE")}, - {"list-addressbook-folders", 'l', POPT_ARG_NONE, &list_folders_mode, 0, N_("List local addressbook folders"), - NULL}, - {"format", '\0', POPT_ARG_STRING, &output_format, 0, N_("Show cards as vcard or csv file"), N_("[vcard|csv]")}, - {"async", 'a', POPT_ARG_NONE, &async_mode, 0, N_("Export in asynchronous mode"), NULL}, - {"size", '\0', POPT_ARG_INT, &file_size, 0, - N_("The number of cards in one output file in asynchronous mode, default size 100."), N_("NUMBER")}, - {NULL, '\0', 0, NULL, 0, NULL, NULL} - }; - /* popttable end ** */ - /*i18n-lize */ bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); - program = - gnome_program_init (PACKAGE, VERSION, GNOME_BONOBO_MODULE, argc, argv, GNOME_PARAM_POPT_TABLE, options, - GNOME_PARAM_NONE); + context = g_option_context_new (NULL); + g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); + program = gnome_program_init ( + PACKAGE, VERSION, GNOME_BONOBO_MODULE, argc, argv, + GNOME_PARAM_GOPTION_CONTEXT, context, + GNOME_PARAM_NONE); /* Parsing Parameter */ - g_object_get (program, "popt-context", &context, NULL); - argvn = poptGetArgs (context); - if (!argvn) { - addressbook_folder_uri = NULL; - } else { /* there at lease is a one argument, and that should be addressbook folder uri */ - addressbook_folder_uri = g_strdup (*argvn); - } - poptFreeContext (context); + if (g_strv_length (opt_remaining) > 0) + opt_addressbook_folder_uri = g_strdup (opt_remaining[0]); - if (list_folders_mode != FALSE) { + if (opt_list_folders_mode != FALSE) { current_action = ACTION_LIST_FOLDERS; /* check there should not be addressbook-folder-uri , and async and size , output_format */ - if (addressbook_folder_uri != NULL || async_mode != FALSE || output_format != NULL || file_size != 0) { + if (opt_addressbook_folder_uri != NULL || opt_async_mode != FALSE || opt_output_format != NULL || opt_file_size != 0) { g_warning (_("Command line arguments error, please use --help option to see the usage.")); exit (-1); } @@ -96,11 +107,11 @@ main (int argc, char **argv) current_action = ACTION_LIST_CARDS; /* check the output format */ - if (output_format == NULL) { + if (opt_output_format == NULL) { IsVCard = TRUE; } else { - IsCSV = !strcmp (output_format, "csv"); - IsVCard = !strcmp (output_format, "vcard"); + IsCSV = !strcmp (opt_output_format, "csv"); + IsVCard = !strcmp (opt_output_format, "vcard"); if (IsCSV == FALSE && IsVCard == FALSE) { g_warning (_("Only support csv or vcard format.")); exit (-1); @@ -108,17 +119,17 @@ main (int argc, char **argv) } /*check async and output file */ - if (async_mode == TRUE) { + if (opt_async_mode == TRUE) { /* check have to output file , set default file_size */ - if (output_file == NULL) { + if (opt_output_file == NULL) { g_warning (_("In async mode, output must be file.")); exit (-1); } - if (file_size == 0) - file_size = DEFAULT_SIZE_NUMBER; + if (opt_file_size == 0) + opt_file_size = DEFAULT_SIZE_NUMBER; } else { /*check no file_size */ - if (file_size != 0) { + if (opt_file_size != 0) { g_warning (_("In normal mode, there is no need for the size option.")); exit (-1); } @@ -128,24 +139,24 @@ main (int argc, char **argv) /* do actions */ if (current_action == ACTION_LIST_FOLDERS) { actctx.action_type = current_action; - if (output_file == NULL) { + if (opt_output_file == NULL) { actctx.action_list_folders.output_file = NULL; } else { - actctx.action_list_folders.output_file = g_strdup (output_file); + actctx.action_list_folders.output_file = g_strdup (opt_output_file); } action_list_folders_init (&actctx); } else if (current_action == ACTION_LIST_CARDS) { actctx.action_type = current_action; - if (output_file == NULL) { + if (opt_output_file == NULL) { actctx.action_list_cards.output_file = NULL; } else { - actctx.action_list_cards.output_file = g_strdup (output_file); + actctx.action_list_cards.output_file = g_strdup (opt_output_file); } actctx.action_list_cards.IsCSV = IsCSV; actctx.action_list_cards.IsVCard = IsVCard; - actctx.action_list_cards.addressbook_folder_uri = g_strdup (addressbook_folder_uri); - actctx.action_list_cards.async_mode = async_mode; - actctx.action_list_cards.file_size = file_size; + actctx.action_list_cards.addressbook_folder_uri = g_strdup (opt_addressbook_folder_uri); + actctx.action_list_cards.async_mode = opt_async_mode; + actctx.action_list_cards.file_size = opt_file_size; action_list_cards_init (&actctx); diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 4336ce37ce..d33eddc09c 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,129 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * gui/e-select-names-renderer.c + (e_select_names_renderer_editing_done): + Use gtk_cell_renderer_stop_editing() instead of + gtk_cell_renderer_editing_canceled(). + + * gui/dialogs/task-details-page.c (get_widgets): + * gui/dialogs/schedule-page.c (get_widgets): + * gui/dialogs/task-page.c (get_widgets): + * gui/dialogs/recurrence-page.c (get_widgets): + * gui/dialogs/event-page.c (get_widgets): + * gui/dialogs/memo-page.c (get_widgets): + Use g_object_ref() instead of gtk_widget_ref(). + + * gui/dialogs/task-details-page.c (task_details_page_finalize): + * gui/dialogs/schedule-page.c (schedule_page_finalize): + * gui/dialogs/task-page.c (task_page_finalize): + * gui/dialogs/recurrence-page.c (recurrence_page_finalize): + * gui/dialogs/event-page.c (event_page_finalize): + * gui/dialogs/memo-page.c (memo_page_finalize): + Use g_object_unref() instead of gtk_widget_unref(). + + * gui/dialogs/event-editor.c (create_schedule_page): + * gui/dialogs/memo-editor.c (memo_editor_construct): + * gui/dialogs/task-editor.c (task_editor_construct): + * gui/print.c (print_table): + * conduits/todo/todo-conduit.c (todoconduit_load_configuration): + * conduits/calendar/calendar-conduit.c + (calconduit_load_configuration): + * conduits/memo/memo-conduit.c (memoconduit_load_configuration): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * gui/dialogs/task-details-page.c (sensitize_widgets): + * gui/dialogs/task-page.c (sensitize_widgets): + * gui/dialogs/event-page.c (sensitize_widgets), + (event_page_fill_widgets): + * gui/dialogs/memo-page.c (sensitize_widgets), + (memo_page_fill_widgets): + * gui/e-timezone-entry.c (e_timezone_entry_init): + Use gtk_editable_set_editable() instead of gtk_entry_set_editable(). + + * gui/dialogs/task-details-page.c (get_widgets): + * gui/dialogs/schedule-page.c (get_widgets): + * gui/dialogs/task-page.c (get_widgets): + * gui/dialogs/recurrence-page.c (get_widgets): + * gui/dialogs/event-page.c (get_widgets): + * gui/dialogs/memo-page.c (get_widgets): + Use g_object_ref() instead of gtk_accel_group_ref(). + + * gui/dialogs/comp-editor-page.c (comp_editor_page_destroy): + Use g_object_unref() instead of gtk_accel_group_unref(). + + * gui/dialogs/task-page.c (task_page_new): + * gui/dialogs/memo-page.c (memo_page_new): + Use g_object_new() instead of gtk_type_new(). + + * gui/dialogs/comp-editor.c (save_comp), (obj_modified_cb): + * gui/dialogs/comp-editor-page.c + (comp_editor_page_display_validation_error): + * gui/e-memos.c (backend_error_cb): + * gui/e-itip-control.c (update_item), (update_attendee_status), + (send_item), (send_freebusy): + * gui/gnome-cal.c (backend_error_cb): + * gui/e-tasks.c (backend_error_cb): + * gui/e-cell-date-edit-text.c (show_date_warning): + Use gtk_message_dialog_new() instead of gnome_error_dialog(), + gnome_warning_dialog(), gnome_question_dialog(), or gnome_ok_dialog(). + + * gui/dialogs/comp-editor.c (comp_editor_show_page): + * gui/dialogs/alarm-dialog.c (action_selection_done_cb): + * gui/gnome-cal.c (display_view): + * importers/icalendar-importer.c (button_toggled_cb): + Use gtk_notebook_set_current_page() instead of + gtk_notebook_set_page(). + + * gui/dialogs/alarm-dialog.glade: + * gui/dialogs/alarm-dialog.c: + Use GtkFileChooserButton instead of GnomeFileEntry. + + * gui/e-memos.c (e_memos_class_init): + * gui/e-tasks.c (e_tasks_class_init): + Use g_cclosure_marshal_VOID__INT instead of gtk_marshal_NONE__INT. + + * gui/e-day-view.c (e_day_view_style_set), (e_day_view_check_layout): + * gui/e-itip-control.c (e_itip_control_init): + * gui/gnome-cal.c (gnome_calendar_hpane_resized): + * gui/e-week-view.c (e_week_view_style_set): + * gui/e-meeting-time-sel (e_meeting_time_selector_construct), + (e_meeting_time_selector_style_set): + Use gtk_widget_set_size_request() instead of gtk_widget_set_usize(). + + * gui/e-day-view.c (e_day_view_stop_auto_scroll), + (e_day_view_cancel_layout): + * gui/e-week-view.c (e_week_view_cancel_layout): + Use g_source_remove() instead of gtk_timeout_remove(). + + * gui/tasks-component.c (task_component_peek): + * gui/calendar-component.c (calendar_component_peek): + * gui/memos-component.c (memos_component_peek): + Use g_mkdir_with_parents() instead of e_util_mkdir_hier(). + + * gui/print.c (range_selector_new): + * gui/e-day-view-time-item.c (e_day_view_time_item_show_popup_menu): + Use gtk_radio_button_get_group() instead of gtk_radio_button_group(). + + * gui/e-day-view-time-item.c (e_day_view_time_item_show_popup_menu): + * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct): + Use gtk_menu_shell_append() instead of gtk_menu_append(). + + * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct): + e_button_new_with_stock_icon() is dead; just do it manually. + + * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct): + Use gtk_radio_menu_item_get_group() instead of + gtk_radio_menu_item_group(). + + * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct), + (e_meeting_time_selector_draw_shadow): + Use gtk_paint_shadow() instead of gtk_draw_shadow(). + + * gui/e-meeting-time-sel.c (e_meeting_time_selector_timeout_handler): + Remove gtk_layout_freeze() and gtk_layout_thaw(). + 2007-04-10 Andre Klapper <a9016009@gmx.de> * gui/dialogs/cal-prefs-dialog.glade: add missing mnemonic widgets. diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c index 56dacdab9d..6763757f94 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -120,11 +120,9 @@ calconduit_load_configuration (guint32 pilot_id) /* Sync Type */ management = gnome_pilot_conduit_management_new ("e_calendar_conduit", GNOME_PILOT_CONDUIT_MGMT_ID); - gtk_object_ref (GTK_OBJECT (management)); - gtk_object_sink (GTK_OBJECT (management)); + g_object_ref_sink (management); config = gnome_pilot_conduit_config_new (management, pilot_id); - gtk_object_ref (GTK_OBJECT (config)); - gtk_object_sink (GTK_OBJECT (config)); + g_object_ref_sink (config); if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type)) c->sync_type = GnomePilotConduitSyncTypeNotSet; gtk_object_unref (GTK_OBJECT (config)); diff --git a/calendar/conduits/memo/memo-conduit.c b/calendar/conduits/memo/memo-conduit.c index 7bd2e104c3..49f5170f7f 100644 --- a/calendar/conduits/memo/memo-conduit.c +++ b/calendar/conduits/memo/memo-conduit.c @@ -125,11 +125,9 @@ memoconduit_load_configuration (guint32 pilot_id) c->pilot_id = pilot_id; management = gnome_pilot_conduit_management_new ("e_memo_conduit", GNOME_PILOT_CONDUIT_MGMT_ID); - gtk_object_ref (GTK_OBJECT (management)); - gtk_object_sink (GTK_OBJECT (management)); + g_object_ref_sink (management); config = gnome_pilot_conduit_config_new (management, pilot_id); - gtk_object_ref (GTK_OBJECT (config)); - gtk_object_sink (GTK_OBJECT (config)); + g_object_ref_sink (config); if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type)) c->sync_type = GnomePilotConduitSyncTypeNotSet; gtk_object_unref (GTK_OBJECT (config)); diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c index 31d84c173b..e63871a02d 100644 --- a/calendar/conduits/todo/todo-conduit.c +++ b/calendar/conduits/todo/todo-conduit.c @@ -127,11 +127,9 @@ todoconduit_load_configuration (guint32 pilot_id) c->pilot_id = pilot_id; management = gnome_pilot_conduit_management_new ("e_todo_conduit", GNOME_PILOT_CONDUIT_MGMT_ID); - gtk_object_ref (GTK_OBJECT (management)); - gtk_object_sink (GTK_OBJECT (management)); + g_object_ref_sink (management); config = gnome_pilot_conduit_config_new (management, pilot_id); - gtk_object_ref (GTK_OBJECT (config)); - gtk_object_sink (GTK_OBJECT (config)); + g_object_ref_sink (config); if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type)) c->sync_type = GnomePilotConduitSyncTypeNotSet; gtk_object_unref (GTK_OBJECT (config)); diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index d528202a50..08ecfb09f3 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -1718,7 +1718,7 @@ calendar_component_peek (void) if (component == NULL) { component = g_object_new (calendar_component_get_type (), NULL); - if (e_util_mkdir_hier (calendar_component_peek_config_directory (component), 0777) != 0) { + if (g_mkdir_with_parents (calendar_component_peek_config_directory (component), 0777) != 0) { g_warning (G_STRLOC ": Cannot create directory %s: %s", calendar_component_peek_config_directory (component), g_strerror (errno)); diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index d6e03cc036..36ee0add7a 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -33,6 +33,7 @@ #include <gtk/gtklabel.h> #include <gtk/gtkcellrenderertext.h> #include <gtk/gtkdialog.h> +#include <gtk/gtkfilechooserbutton.h> #include <gtk/gtknotebook.h> #include <gtk/gtksignal.h> #include <gtk/gtktreeview.h> @@ -41,7 +42,6 @@ #include <gtk/gtktextbuffer.h> #include <gtk/gtktextview.h> #include <gtk/gtktogglebutton.h> -#include <libgnomeui/gnome-file-entry.h> #include <bonobo/bonobo-control.h> #include <bonobo/bonobo-exception.h> #include <bonobo/bonobo-widget.h> @@ -99,7 +99,7 @@ typedef struct { GtkWidget *aalarm_group; GtkWidget *aalarm_sound; GtkWidget *aalarm_attach; - GtkWidget *aalarm_file_entry; + GtkWidget *aalarm_file_chooser; /* Mail alarm widgets */ const char *email; @@ -779,7 +779,7 @@ get_widgets (Dialog *dialog) dialog->aalarm_group = GW ("aalarm-group"); dialog->aalarm_sound = GW ("aalarm-sound"); dialog->aalarm_attach = GW ("aalarm-attach"); - dialog->aalarm_file_entry = GW ("aalarm-file-entry"); + dialog->aalarm_file_chooser = GW ("aalarm-file-chooser"); dialog->malarm_group = GW ("malarm-group"); dialog->malarm_address_group = GW ("malarm-address-group"); @@ -810,7 +810,7 @@ get_widgets (Dialog *dialog) && dialog->aalarm_group && dialog->aalarm_sound && dialog->aalarm_attach - && dialog->aalarm_file_entry + && dialog->aalarm_file_chooser && dialog->malarm_group && dialog->malarm_address_group && dialog->malarm_addressbook @@ -1073,13 +1073,16 @@ action_selection_done_cb (GtkMenuShell *menu_shell, gpointer data) } } - gtk_notebook_set_page (GTK_NOTEBOOK (dialog->option_notebook), page); + gtk_notebook_set_current_page ( + GTK_NOTEBOOK (dialog->option_notebook), page); switch (action) { case E_CAL_COMPONENT_ALARM_AUDIO: dir = calendar_config_get_dir_path (); if ( dir && *dir ) - gnome_file_entry_set_default_path (GNOME_FILE_ENTRY (dialog->aalarm_file_entry), dir); + gtk_file_chooser_set_current_folder ( + GTK_FILE_CHOOSER (dialog->aalarm_file_chooser), + dir); g_free (dir); check_custom_sound (dialog); break; diff --git a/calendar/gui/dialogs/alarm-dialog.glade b/calendar/gui/dialogs/alarm-dialog.glade index fb44f24b25..4e32374928 100644 --- a/calendar/gui/dialogs/alarm-dialog.glade +++ b/calendar/gui/dialogs/alarm-dialog.glade @@ -18,6 +18,8 @@ <property name="skip_pager_hint">False</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> <property name="has_separator">False</property> <child internal-child="vbox"> @@ -85,6 +87,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -112,6 +118,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -336,6 +346,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -363,6 +377,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -435,6 +453,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -539,6 +561,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -566,6 +592,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -631,6 +661,10 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">option-notebook</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="left_attach">0</property> @@ -704,6 +738,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="type">tab</property> @@ -754,7 +792,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> - <property name="mnemonic_widget">aalarm-attach</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="padding">0</property> @@ -764,27 +805,14 @@ </child> <child> - <widget class="GnomeFileEntry" id="aalarm-file-entry"> + <widget class="GtkFileChooserButton" id="aalarm-file-chooser"> <property name="visible">True</property> - <property name="max_saved">10</property> - <property name="directory_entry">False</property> - <property name="modal">True</property> - <property name="use_filechooser">True</property> - <property name="filechooser_action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - - <child internal-child="entry"> - <widget class="GtkEntry" id="aalarm-attach"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char">*</property> - <property name="activates_default">False</property> - </widget> - </child> + <property name="title" translatable="yes">Select A File</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> </widget> <packing> <property name="padding">0</property> @@ -819,6 +847,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="type">tab</property> @@ -854,6 +886,10 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">palarm-program</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="left_attach">0</property> @@ -879,6 +915,10 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">palarm-args</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="left_attach">0</property> @@ -958,6 +998,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="type">tab</property> @@ -1094,6 +1138,10 @@ <property name="xpad">0</property> <property name="ypad">0</property> <property name="mnemonic_widget">option-notebook</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="left_attach">0</property> @@ -1145,6 +1193,10 @@ <property name="yalign">0.5</property> <property name="xpad">0</property> <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> </widget> <packing> <property name="type">tab</property> diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c index 543a3555c7..ab546ca2a4 100644 --- a/calendar/gui/dialogs/calendar-setup.c +++ b/calendar/gui/dialogs/calendar-setup.c @@ -23,6 +23,8 @@ #include <config.h> #endif +#include <string.h> + #include <gtk/gtkbox.h> #include <gtk/gtkdialog.h> #include <gtk/gtkstock.h> diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index 8c9d488f4f..303d5bde84 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -22,8 +22,9 @@ #include <config.h> #endif -#include <gtk/gtksignal.h> #include <glib/gi18n.h> +#include <gtk/gtkmessagedialog.h> +#include <gtk/gtksignal.h> #include <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-dialog-util.h> #include "comp-editor-page.h" @@ -200,7 +201,7 @@ comp_editor_page_destroy (GtkObject *object) } if (page->accel_group) { - gtk_accel_group_unref (page->accel_group); + g_object_unref (page->accel_group); page->accel_group = NULL; } @@ -506,17 +507,18 @@ comp_editor_page_display_validation_error (CompEditorPage *page, GtkWidget *field) { GtkWidget *dialog; - char *real_msg; g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); g_return_if_fail (msg != NULL); g_return_if_fail (GTK_IS_WIDGET (field)); - real_msg = g_strdup_printf (_("Validation error: %s"), msg); - dialog = gnome_error_dialog (real_msg); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_CLOSE, + _("Validation error: %s"), msg); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); gtk_widget_grab_focus (field); - - g_free (real_msg); } 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); } diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index a8a1c365a2..3274dc0f37 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -372,8 +372,7 @@ create_schedule_page (EventEditor *ee) "gtk-close", GTK_RESPONSE_CLOSE, NULL); priv->sched_page = schedule_page_new (priv->model); - g_object_ref (priv->sched_page); - gtk_object_sink (GTK_OBJECT (priv->sched_page)); + g_object_ref_sink (priv->sched_page); gtk_container_add (GTK_CONTAINER (GTK_DIALOG(priv->sched_window)->vbox), comp_editor_page_get_widget (COMP_EDITOR_PAGE (priv->sched_page))); g_signal_connect (priv->sched_window, "response", G_CALLBACK(gtk_widget_hide), NULL); @@ -597,8 +596,7 @@ event_editor_construct (EventEditor *ee, ECal *client) priv = ee->priv; priv->event_page = event_page_new (priv->model, client, COMP_EDITOR(ee)->uic); - g_object_ref (priv->event_page); - gtk_object_sink (GTK_OBJECT (priv->event_page)); + g_object_ref_sink (priv->event_page); comp_editor_append_page (COMP_EDITOR (ee), COMP_EDITOR_PAGE (priv->event_page), _("Appoint_ment"), TRUE); @@ -612,8 +610,7 @@ event_editor_construct (EventEditor *ee, ECal *client) g_signal_connect (priv->recur_window, "response", G_CALLBACK (gtk_widget_hide), NULL); g_signal_connect ((GtkWidget *) priv->recur_window, "delete-event", G_CALLBACK(window_delete_event), NULL); priv->recur_page = recurrence_page_new (); - g_object_ref (priv->recur_page); - gtk_object_sink (GTK_OBJECT (priv->recur_page)); + g_object_ref_sink (priv->recur_page); gtk_container_add ((GtkContainer *) (GTK_DIALOG (priv->recur_window)->vbox), comp_editor_page_get_widget (COMP_EDITOR_PAGE (priv->recur_page))); gtk_widget_show_all (priv->recur_window); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 74cd4d2144..efb3c95b24 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -286,7 +286,7 @@ event_page_finalize (GObject *object) g_ptr_array_free (priv->deleted_attendees, TRUE); if (priv->main) - gtk_widget_unref (priv->main); + g_object_unref (priv->main); if (priv->xml) { g_object_unref (priv->xml); @@ -811,8 +811,8 @@ sensitize_widgets (EventPage *epage) gtk_box_pack_start ((GtkBox *)priv->status_icons, priv->alarm_icon, FALSE, FALSE, 6); } - gtk_entry_set_editable (GTK_ENTRY (priv->summary), !read_only); - gtk_entry_set_editable (GTK_ENTRY (priv->location), sensitize); + gtk_editable_set_editable (GTK_EDITABLE (priv->summary), !read_only); + gtk_editable_set_editable (GTK_EDITABLE (priv->location), sensitize); gtk_widget_set_sensitive (priv->alarm_box, custom); gtk_widget_set_sensitive (priv->start_time, sensitize); gtk_widget_set_sensitive (priv->start_timezone, sensitize); @@ -833,7 +833,7 @@ sensitize_widgets (EventPage *epage) gtk_widget_set_sensitive (priv->hour_selector, sensitize); gtk_widget_set_sensitive (priv->minute_selector, sensitize); - gtk_entry_set_editable (GTK_ENTRY (priv->categories), !read_only); + gtk_editable_set_editable (GTK_EDITABLE (priv->categories), !read_only); if (delegate) { gtk_widget_set_sensitive (priv->source_selector, FALSE); @@ -1052,7 +1052,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (!priv->user_org) { list = g_list_append (list, string); gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), list); - gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->organizer)->entry), FALSE); } g_free (string); @@ -2176,10 +2176,8 @@ get_widgets (EventPage *epage) it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); - if (accel_groups) { - page->accel_group = accel_groups->data; - gtk_accel_group_ref (page->accel_group); - } + if (accel_groups) + page->accel_group = g_object_ref (accel_groups->data); priv->alarm_dialog = GW ("alarm-dialog"); priv->alarm_box = GW ("custom_box"); priv->alarm_time = GW ("alarm-time"); @@ -2200,7 +2198,7 @@ get_widgets (EventPage *epage) } priv->attendees_label = GW ("attendees-label"); - gtk_widget_ref (priv->main); + g_object_ref (priv->main); gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); priv->categories = GW ("categories"); diff --git a/calendar/gui/dialogs/memo-editor.c b/calendar/gui/dialogs/memo-editor.c index fb977c3a97..aaa1b864b6 100644 --- a/calendar/gui/dialogs/memo-editor.c +++ b/calendar/gui/dialogs/memo-editor.c @@ -213,8 +213,7 @@ memo_editor_construct (MemoEditor *me, ECal *client) priv = me->priv; priv->memo_page = memo_page_new (editor->uic, flags); - g_object_ref (priv->memo_page); - gtk_object_sink (GTK_OBJECT (priv->memo_page)); + g_object_ref_sink (priv->memo_page); comp_editor_append_page (COMP_EDITOR (me), COMP_EDITOR_PAGE (priv->memo_page), _("Memo"), TRUE); diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index c0cade5155..b307da3ed8 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -180,7 +180,7 @@ memo_page_finalize (GObject *object) priv = mpage->priv; if (priv->main) - gtk_widget_unref (priv->main); + g_object_unref (priv->main); if (priv->xml) { g_object_unref (priv->xml); @@ -306,14 +306,14 @@ sensitize_widgets (MemoPage *mpage) gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->memo_content), sensitize); gtk_widget_set_sensitive (priv->start_date, sensitize); gtk_widget_set_sensitive (priv->categories_btn, !read_only); - gtk_entry_set_editable (GTK_ENTRY (priv->categories), !read_only); - gtk_entry_set_editable (GTK_ENTRY (priv->summary_entry), sensitize); + gtk_editable_set_editable (GTK_EDITABLE (priv->categories), !read_only); + gtk_editable_set_editable (GTK_EDITABLE (priv->summary_entry), sensitize); if (COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_IS_SHARED) { - gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry), sensitize); + gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->org_combo)->entry), sensitize); if (priv->to_entry) { - gtk_entry_set_editable (GTK_ENTRY (priv->to_entry), !read_only); + gtk_editable_set_editable (GTK_EDITABLE (priv->to_entry), !read_only); gtk_widget_grab_focus (priv->to_entry); } } @@ -424,7 +424,7 @@ memo_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } else { list = g_list_append (list, string); gtk_combo_set_popdown_strings (GTK_COMBO (priv->org_combo), list); - gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->org_combo)->entry), FALSE); } g_free (string); g_list_free (list); @@ -777,12 +777,10 @@ get_widgets (MemoPage *mpage) it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); - if (accel_groups) { - page->accel_group = accel_groups->data; - gtk_accel_group_ref (page->accel_group); - } + if (accel_groups) + page->accel_group = g_object_ref (accel_groups->data); - gtk_widget_ref (priv->main); + g_object_ref (priv->main); gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); priv->org_label = GW ("org-label"); @@ -1141,7 +1139,7 @@ memo_page_new (BonoboUIComponent *uic, CompEditorPageFlags flags) { MemoPage *mpage; - mpage = gtk_type_new (TYPE_MEMO_PAGE); + mpage = g_object_new (TYPE_MEMO_PAGE, NULL); mpage->priv->uic = uic; COMP_EDITOR_PAGE (mpage)->flags = flags; diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 2ee4f1a410..581a2559db 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -286,7 +286,7 @@ recurrence_page_finalize (GObject *object) 0, 0, NULL, preview_date_range_changed_cb, NULL); if (priv->main) - gtk_widget_unref (priv->main); + g_object_unref (priv->main); if (priv->xml) { g_object_unref (priv->xml); @@ -2000,12 +2000,10 @@ get_widgets (RecurrencePage *rpage) it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); - if (accel_groups) { - page->accel_group = accel_groups->data; - gtk_accel_group_ref (page->accel_group); - } + if (accel_groups) + page->accel_group = g_object_ref (accel_groups->data); - gtk_widget_ref (priv->main); + g_object_ref (priv->main); gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); priv->recurs = GW ("recurs"); diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 3aeb03b328..dd467b42f9 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -133,7 +133,7 @@ schedule_page_finalize (GObject *object) priv = spage->priv; if (priv->main) - gtk_widget_unref (priv->main); + g_object_unref (priv->main); if (priv->xml) { g_object_unref (priv->xml); @@ -358,12 +358,10 @@ get_widgets (SchedulePage *spage) it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); - if (accel_groups) { - page->accel_group = accel_groups->data; - gtk_accel_group_ref (page->accel_group); - } + if (accel_groups) + page->accel_group = g_object_ref (accel_groups->data); - gtk_widget_ref (priv->main); + g_object_ref (priv->main); gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); #undef GW diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 9484add139..a5164534d6 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -158,7 +158,7 @@ task_details_page_finalize (GObject *object) priv = tdpage->priv; if (priv->main) - gtk_widget_unref (priv->main); + g_object_unref (priv->main); if (priv->xml) { g_object_unref (priv->xml); @@ -275,7 +275,7 @@ sensitize_widgets (TaskDetailsPage *tdpage) gtk_widget_set_sensitive (priv->percent_complete, !read_only); gtk_widget_set_sensitive (priv->completed_date, !read_only); gtk_widget_set_sensitive (priv->url_label, !read_only); - gtk_entry_set_editable (GTK_ENTRY (e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry))), !read_only); + gtk_editable_set_editable (GTK_EDITABLE (e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry))), !read_only); } /* fill_widgets handler for the task page */ @@ -492,12 +492,10 @@ get_widgets (TaskDetailsPage *tdpage) it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); - if (accel_groups) { - page->accel_group = accel_groups->data; - gtk_accel_group_ref (page->accel_group); - } + if (accel_groups) + page->accel_group = g_object_ref (accel_groups->data); - gtk_widget_ref (priv->main); + g_object_ref (priv->main); gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); priv->status = GW ("status"); diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 35b92bc63b..ef614ef1c0 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -418,8 +418,7 @@ task_editor_construct (TaskEditor *te, ECal *client) priv = te->priv; priv->task_page = task_page_new (priv->model, client, editor->uic); - g_object_ref (priv->task_page); - gtk_object_sink (GTK_OBJECT (priv->task_page)); + g_object_ref_sink (priv->task_page); comp_editor_append_page (COMP_EDITOR (te), COMP_EDITOR_PAGE (priv->task_page), _("_Task"), TRUE); @@ -434,8 +433,7 @@ task_editor_construct (TaskEditor *te, ECal *client) g_signal_connect (priv->task_details_window, "delete-event", G_CALLBACK(gtk_widget_hide), NULL); priv->task_details_page = task_details_page_new (); - g_object_ref (priv->task_details_page); - gtk_object_sink (GTK_OBJECT (priv->task_details_page)); + g_object_ref_sink (priv->task_details_page); gtk_container_add ((GtkContainer *) GTK_DIALOG(priv->task_details_window)->vbox, comp_editor_page_get_widget ((CompEditorPage *)priv->task_details_page)); gtk_widget_show_all (priv->task_details_window); diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 79b07d012b..1a7352aab5 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -233,7 +233,7 @@ task_page_finalize (GObject *object) priv = tpage->priv; if (priv->main) - gtk_widget_unref (priv->main); + g_object_unref (priv->main); if (priv->xml) { g_object_unref (priv->xml); @@ -391,13 +391,13 @@ sensitize_widgets (TaskPage *tpage) sensitize = (!read_only && sens); - gtk_entry_set_editable (GTK_ENTRY (priv->summary), !read_only); + gtk_editable_set_editable (GTK_EDITABLE (priv->summary), !read_only); gtk_widget_set_sensitive (priv->due_date, !read_only); gtk_widget_set_sensitive (priv->start_date, !read_only); gtk_widget_set_sensitive (priv->timezone, !read_only); gtk_widget_set_sensitive (priv->description, !read_only); gtk_widget_set_sensitive (priv->categories_btn, !read_only); - gtk_entry_set_editable (GTK_ENTRY (priv->categories), !read_only); + gtk_editable_set_editable (GTK_EDITABLE (priv->categories), !read_only); gtk_widget_set_sensitive (priv->organizer, !read_only); gtk_widget_set_sensitive (priv->add, (!read_only && sens)); @@ -1398,12 +1398,10 @@ get_widgets (TaskPage *tpage) it when the notebook page is mapped. */ toplevel = gtk_widget_get_toplevel (priv->main); accel_groups = gtk_accel_groups_from_object (G_OBJECT (toplevel)); - if (accel_groups) { - page->accel_group = accel_groups->data; - gtk_accel_group_ref (page->accel_group); - } + if (accel_groups) + page->accel_group = g_object_ref (accel_groups->data); - gtk_widget_ref (priv->main); + g_object_ref (priv->main); gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); priv->summary = GW ("summary"); @@ -1913,7 +1911,7 @@ task_page_new (EMeetingStore *model, ECal *client, BonoboUIComponent *uic) { TaskPage *tpage; - tpage = gtk_type_new (TYPE_TASK_PAGE); + tpage = g_object_new (TYPE_TASK_PAGE, NULL); if (!task_page_construct (tpage, model, client)) { g_object_unref (tpage); return NULL; diff --git a/calendar/gui/e-cal-component-memo-preview.c b/calendar/gui/e-cal-component-memo-preview.c index 07b2f79964..4608967cfd 100644 --- a/calendar/gui/e-cal-component-memo-preview.c +++ b/calendar/gui/e-cal-component-memo-preview.c @@ -27,8 +27,10 @@ #include <config.h> #endif +#include <string.h> #include <gnome.h> #include <gtk/gtk.h> +#include <glib/gi18n.h> #include <libgnomevfs/gnome-vfs-ops.h> #include <libecal/e-cal-time-util.h> #include <libedataserver/e-categories.h> diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index d38ec5f195..3a8e9c7bee 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -26,8 +26,10 @@ #include <config.h> #endif +#include <string.h> #include <gnome.h> #include <gtk/gtk.h> +#include <glib/gi18n.h> #include <libgnomevfs/gnome-vfs-ops.h> #include <libedataserver/e-categories.h> #include <libecal/e-cal-time-util.h> diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index ef3badd22b..fd9d014827 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -34,6 +34,7 @@ #include <sys/stat.h> #include <unistd.h> #include <glib.h> +#include <glib/gi18n.h> #include <glib/gstdio.h> #include <gnome.h> #include <misc/e-gui-utils.h> diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c index a93c5e3ab3..4123e7357e 100644 --- a/calendar/gui/e-cell-date-edit-text.c +++ b/calendar/gui/e-cell-date-edit-text.c @@ -102,7 +102,7 @@ static void show_date_warning (ECellDateEditText *ecd) { GtkWidget *dialog; - char buffer[64], message[256], *format; + char buffer[64], *format; time_t t; struct tm *tmp_tm; @@ -120,14 +120,14 @@ show_date_warning (ECellDateEditText *ecd) e_utf8_strftime (buffer, sizeof (buffer), format, tmp_tm); - g_snprintf (message, 256, - _("The date must be entered in the format: \n\n%s"), - buffer); - - dialog = gnome_message_box_new (message, - GNOME_MESSAGE_BOX_ERROR, - GNOME_STOCK_BUTTON_OK, NULL); - gtk_widget_show (dialog); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("The date must be entered in the format: \n%s"), + buffer); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); } diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index b15f243e2c..d372e3e2f6 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -806,9 +806,9 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *dvtmitem, */ _("%02i minute divisions"), divisions[i]); item = gtk_radio_menu_item_new_with_label (group, buffer); - group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item)); + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item)); gtk_widget_show (item); - gtk_menu_append (GTK_MENU (menu), item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); if (current_divisions == divisions[i]) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 07f11c40b2..c61ae63bca 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -1680,7 +1680,7 @@ e_day_view_style_set (GtkWidget *widget, number of rows needed (min 1 + 1 for the dates + 1 space for DnD).*/ top_rows = MAX (1, day_view->rows_in_top_display); top_canvas_height = (top_rows + 2) * day_view->top_row_height; - gtk_widget_set_usize (day_view->top_canvas, -1, top_canvas_height); + gtk_widget_set_size_request (day_view->top_canvas, -1, top_canvas_height); /* Find the longest full & abbreviated month names. */ memset (&date_tm, 0, sizeof (date_tm)); @@ -1778,7 +1778,7 @@ e_day_view_style_set (GtkWidget *widget, /* Calculate the width of the time column. */ times_width = e_day_view_time_item_get_column_width (E_DAY_VIEW_TIME_ITEM (day_view->time_canvas_item)); - gtk_widget_set_usize (day_view->time_canvas, times_width, -1); + gtk_widget_set_size_request (day_view->time_canvas, times_width, -1); g_object_unref (layout); pango_font_metrics_unref (font_metrics); @@ -1877,7 +1877,7 @@ e_day_view_style_set (GtkWidget *widget, number of rows needed (min 1 + 1 for the dates + 1 space for DnD).*/ top_rows = MAX (1, day_view->rows_in_top_display); top_canvas_height = (top_rows + 2) * day_view->top_row_height; - gtk_widget_set_usize (day_view->top_canvas, -1, top_canvas_height); + gtk_widget_set_size_request (day_view->top_canvas, -1, top_canvas_height); /* Find the longest full & abbreviated month names. */ memset (&date_tm, 0, sizeof (date_tm)); @@ -1975,7 +1975,7 @@ e_day_view_style_set (GtkWidget *widget, /* Calculate the width of the time column. */ times_width = e_day_view_time_item_get_column_width (E_DAY_VIEW_TIME_ITEM (day_view->time_canvas_item)); - gtk_widget_set_usize (day_view->time_canvas, times_width, -1); + gtk_widget_set_size_request (day_view->time_canvas, times_width, -1); g_object_unref (layout); pango_font_metrics_unref (font_metrics); @@ -5499,8 +5499,8 @@ e_day_view_check_layout (EDayView *day_view) top_rows = MAX (1, rows_in_top_display); top_canvas_height = (top_rows + 2) * day_view->top_row_height; - gtk_widget_set_usize (day_view->top_canvas, -1, - top_canvas_height); + gtk_widget_set_size_request ( + day_view->top_canvas, -1, top_canvas_height); } } @@ -7962,7 +7962,7 @@ void e_day_view_stop_auto_scroll (EDayView *day_view) { if (day_view->auto_scroll_timeout_id != 0) { - gtk_timeout_remove (day_view->auto_scroll_timeout_id); + g_source_remove (day_view->auto_scroll_timeout_id); day_view->auto_scroll_timeout_id = 0; } } @@ -9307,7 +9307,7 @@ static void e_day_view_cancel_layout (EDayView *day_view) { if (day_view->layout_timeout_id != 0) { - gtk_timeout_remove (day_view->layout_timeout_id); + g_source_remove (day_view->layout_timeout_id); day_view->layout_timeout_id = 0; } } diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index 24624aa0a0..66d2a445f1 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -427,7 +427,7 @@ e_itip_control_init (EItipControl *itip) gtk_container_add (GTK_CONTAINER (scrolled_window), priv->html); g_object_weak_ref (G_OBJECT (priv->html), (GWeakNotify)html_destroyed, itip); - gtk_widget_set_usize (scrolled_window, 600, 400); + gtk_widget_set_size_request (scrolled_window, 600, 400); gtk_box_pack_start (GTK_BOX (itip), scrolled_window, FALSE, FALSE, 6); g_signal_connect (priv->html, "url_requested", G_CALLBACK (url_requested_cb), itip); @@ -1930,12 +1930,21 @@ update_item (EItipControl *itip) icalcomponent_set_method (priv->top_level, priv->method); if (!e_cal_receive_objects (priv->current_ecal, priv->top_level, &error)) { - dialog = gnome_warning_dialog (error->message); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + "%s", error->message); g_error_free (error); } else { - dialog = gnome_ok_dialog (_("Update complete\n")); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + _("Update complete\n")); } - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); icalcomponent_remove_component (priv->top_level, clone); } @@ -1961,7 +1970,12 @@ update_attendee_status (EItipControl *itip) if (!e_cal_component_set_icalcomponent (comp, icalcomp)) { icalcomponent_free (icalcomp); - dialog = gnome_warning_dialog (_("Object is invalid and cannot be updated\n")); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", _("Object is invalid and " + "cannot be updated\n")); } else { e_cal_component_get_attendee_list (priv->comp, &attendees); if (attendees != NULL) { @@ -1971,10 +1985,18 @@ update_attendee_status (EItipControl *itip) prop = find_attendee (icalcomp, itip_strip_mailto (a->value)); if (prop == NULL) { - dialog = gnome_question_dialog_modal (_("This response is not from a current " - "attendee. Add as an attendee?"), - NULL, NULL); - if (gnome_dialog_run_and_close (GNOME_DIALOG (dialog)) == GNOME_YES) { + gint response; + + dialog = gtk_message_dialog_new ( + NULL, GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_YES_NO, + "%s", _("This response is not from a " + "current attendee. Add as an attendee?")); + response = gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + if (response == GTK_RESPONSE_YES) { change_status (icalcomp, itip_strip_mailto (a->value), a->status); @@ -1983,10 +2005,13 @@ update_attendee_status (EItipControl *itip) goto cleanup; } } else if (a->status == ICAL_PARTSTAT_NONE || a->status == ICAL_PARTSTAT_X) { - dialog = gnome_warning_dialog (_("Attendee status could " - "not be updated because " - "of an invalid status!\n")); - goto cleanup; + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", _("Attendee status could not be " + "updated because of an invalid status!\n")); + goto run; } else { change_status (icalcomp, itip_strip_mailto (a->value), @@ -1997,20 +2022,35 @@ update_attendee_status (EItipControl *itip) } if (!e_cal_modify_object (priv->current_ecal, icalcomp, CALOBJ_MOD_ALL, &error)) { - dialog = gnome_warning_dialog (error->message); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", error->message); g_error_free (error); } else { - dialog = gnome_ok_dialog (_("Attendee status updated\n")); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + "%s", _("Attendee status updated\n")); } } else { - dialog = gnome_warning_dialog (_("Attendee status can not be updated " - "because the item no longer exists")); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", _("Attendee status can not be updated " + "because the item no longer exists")); } + run: + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + cleanup: if (comp != NULL) g_object_unref (comp); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); } static void @@ -2027,11 +2067,20 @@ send_item (EItipControl *itip) if (comp != NULL) { itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, priv->current_ecal, NULL, NULL, NULL); g_object_unref (comp); - dialog = gnome_ok_dialog (_("Item sent!\n")); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + "%s", _("Item sent!\n")); } else { - dialog = gnome_warning_dialog (_("The item could not be sent!\n")); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", _("The item could not be sent!\n")); } - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); } static void @@ -2075,13 +2124,22 @@ send_freebusy (EItipControl *itip) g_object_unref (comp); } - dialog = gnome_ok_dialog (_("Item sent!\n")); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + "%s", _("Item sent!\n")); g_list_free (comp_list); } else { - dialog = gnome_warning_dialog (_("The item could not be sent!\n")); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_WARNING, + GTK_BUTTONS_OK, + "%s", _("The item could not be sent!\n")); } - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); } static void diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index dde51f0ccc..4a8406b562 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -351,7 +351,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em /* The free/busy information */ mts->display_top = gnome_canvas_new (); - gtk_widget_set_usize (mts->display_top, -1, mts->row_height * 3); + gtk_widget_set_size_request (mts->display_top, -1, mts->row_height * 3); gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_top), 0, 0, mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, @@ -424,7 +424,12 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em 0, 1, 3, 4, GTK_FILL, 0, 0, 0); gtk_widget_show (hbox); - mts->add_attendees_button = e_button_new_with_stock_icon (_("A_ttendees..."), "gtk-jump-to"); + mts->add_attendees_button = + gtk_button_new_with_mnemonic (_("A_ttendees...")); + gtk_button_set_image ( + mts->add_attendees_button, + gtk_image_new_from_stock ( + GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON)); gtk_box_pack_start (GTK_BOX (hbox), mts->add_attendees_button, TRUE, TRUE, 6); gtk_widget_show (mts->add_attendees_button); g_signal_connect (mts->add_attendees_button, "clicked", @@ -459,7 +464,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em menuitem = gtk_check_menu_item_new_with_label (""); gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("Show _only working hours")); - gtk_menu_append (GTK_MENU (mts->options_menu), menuitem); + gtk_menu_shell_append (GTK_MENU_SHELL (mts->options_menu), menuitem); gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), mts->working_hours_only); @@ -469,7 +474,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em menuitem = gtk_check_menu_item_new_with_label (""); gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("Show _zoomed out")); - gtk_menu_append (GTK_MENU (mts->options_menu), menuitem); + gtk_menu_shell_append (GTK_MENU_SHELL (mts->options_menu), menuitem); gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), mts->zoomed_out); @@ -478,13 +483,13 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em gtk_widget_show (menuitem); menuitem = gtk_menu_item_new (); - gtk_menu_append (GTK_MENU (mts->options_menu), menuitem); + gtk_menu_shell_append (GTK_MENU_SHELL (mts->options_menu), menuitem); gtk_widget_set_sensitive (menuitem, FALSE); gtk_widget_show (menuitem); menuitem = gtk_menu_item_new_with_label (""); gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("_Update free/busy")); - gtk_menu_append (GTK_MENU (mts->options_menu), menuitem); + gtk_menu_shell_append (GTK_MENU_SHELL (mts->options_menu), menuitem); g_signal_connect (menuitem, "activate", G_CALLBACK (e_meeting_time_selector_on_update_free_busy), mts); @@ -547,36 +552,36 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em menuitem = gtk_radio_menu_item_new_with_label (NULL, ""); mts->autopick_all_item = menuitem; - group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem)); + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("_All people and resources")); - gtk_menu_append (GTK_MENU (mts->autopick_menu), menuitem); + gtk_menu_shell_append (GTK_MENU_SHELL (mts->autopick_menu), menuitem); g_signal_connect (menuitem, "toggled", G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts); gtk_widget_show (menuitem); menuitem = gtk_radio_menu_item_new_with_label (group, ""); mts->autopick_all_people_one_resource_item = menuitem; - group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem)); + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("All _people and one resource")); - gtk_menu_append (GTK_MENU (mts->autopick_menu), menuitem); + gtk_menu_shell_append (GTK_MENU_SHELL (mts->autopick_menu), menuitem); g_signal_connect (menuitem, "toggled", G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts); gtk_widget_show (menuitem); menuitem = gtk_radio_menu_item_new_with_label (group, ""); mts->autopick_required_people_item = menuitem; - group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem)); + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("_Required people")); - gtk_menu_append (GTK_MENU (mts->autopick_menu), menuitem); + gtk_menu_shell_append (GTK_MENU_SHELL (mts->autopick_menu), menuitem); g_signal_connect (menuitem, "activate", G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts); gtk_widget_show (menuitem); menuitem = gtk_radio_menu_item_new_with_label (group, ""); mts->autopick_required_people_one_resource_item = menuitem; - group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem)); + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); gtk_label_set_text_with_mnemonic (GTK_LABEL (GTK_BIN (menuitem)->child), _("Required people and _one resource")); - gtk_menu_append (GTK_MENU (mts->autopick_menu), menuitem); + gtk_menu_shell_append (GTK_MENU_SHELL (mts->autopick_menu), menuitem); g_signal_connect (menuitem, "activate", G_CALLBACK (e_meeting_time_selector_on_autopick_option_toggled), mts); gtk_widget_show (menuitem); @@ -701,7 +706,7 @@ e_meeting_time_selector_add_key_color (EMeetingTimeSelector * mts, darea = gtk_drawing_area_new (); gtk_box_pack_start (GTK_BOX (child_hbox), darea, FALSE, FALSE, 0); gtk_object_set_user_data (GTK_OBJECT (darea), mts); - gtk_widget_set_usize (darea, 14, 14); + gtk_widget_set_size_request (darea, 14, 14); gtk_widget_show (darea); label = gtk_label_new (label_text); @@ -728,8 +733,8 @@ e_meeting_time_selector_expose_key_color (GtkWidget *darea, width = darea->allocation.width; height = darea->allocation.height; - gtk_draw_shadow (darea->style, darea->window, GTK_STATE_NORMAL, - GTK_SHADOW_IN, 0, 0, width, height); + gtk_paint_shadow (darea->style, darea->window, GTK_STATE_NORMAL, + GTK_SHADOW_IN, NULL, NULL, NULL, 0, 0, width, height); if (color) { gdk_gc_set_foreground (gc, color); @@ -929,7 +934,7 @@ e_meeting_time_selector_style_set (GtkWidget *widget, e_meeting_time_selector_recalc_grid (mts); e_meeting_time_selector_restore_position (mts, &saved_time); - gtk_widget_set_usize (mts->display_top, -1, mts->row_height * 3 + 4); + gtk_widget_set_size_request (mts->display_top, -1, mts->row_height * 3 + 4); /* * FIXME: I can't find a way to get the treeview header heights @@ -939,11 +944,11 @@ e_meeting_time_selector_style_set (GtkWidget *widget, gtk_widget_realize (mts->list_view); gdk_window_get_position (gtk_tree_view_get_bin_window (GTK_TREE_VIEW (mts->list_view)), NULL, &maxheight); - gtk_widget_set_usize (mts->attendees_vbox_spacer, 1, mts->row_height * 3 - maxheight); + gtk_widget_set_size_request (mts->attendees_vbox_spacer, 1, mts->row_height * 3 - maxheight); */ - gtk_widget_set_usize (mts->attendees_vbox_spacer, 1, mts->row_height * 2 - 6); + gtk_widget_set_size_request (mts->attendees_vbox_spacer, 1, mts->row_height * 2 - 6); GTK_LAYOUT (mts->display_main)->hadjustment->step_increment = mts->day_width; GTK_LAYOUT (mts->display_main)->vadjustment->step_increment = mts->row_height; @@ -983,8 +988,8 @@ e_meeting_time_selector_draw_shadow (EMeetingTimeSelector *mts) w = mts->display_top->allocation.width + 4; h = mts->display_top->allocation.height + mts->display_main->allocation.height + 4; - gtk_draw_shadow (widget->style, widget->window, GTK_STATE_NORMAL, - GTK_SHADOW_IN, x, y, w, h); + gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL, + GTK_SHADOW_IN, NULL, NULL, NULL, x, y, w, h); } @@ -2617,14 +2622,10 @@ e_meeting_time_selector_timeout_handler (gpointer data) get redrawn completely. Otherwise the pixels get scrolled left or right which is not good for us (since our vertical bars have been moved) and causes flicker. */ - gtk_layout_freeze (GTK_LAYOUT (mts->display_main)); - gtk_layout_freeze (GTK_LAYOUT (mts->display_top)); gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main), scroll_x, scroll_y); gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_top), scroll_x, scroll_y); - gtk_layout_thaw (GTK_LAYOUT (mts->display_main)); - gtk_layout_thaw (GTK_LAYOUT (mts->display_top)); GDK_THREADS_LEAVE (); return TRUE; diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index 49594300dd..18353f5563 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -35,6 +35,7 @@ #include <sys/stat.h> #include <unistd.h> #include <glib.h> +#include <glib/gi18n.h> #include <glib/gstdio.h> #include <gnome.h> #include <widgets/misc/e-gui-utils.h> diff --git a/calendar/gui/e-memos.c b/calendar/gui/e-memos.c index 89c0f147a4..e87761974d 100644 --- a/calendar/gui/e-memos.c +++ b/calendar/gui/e-memos.c @@ -27,7 +27,9 @@ #include <config.h> #endif +#include <string.h> #include <gnome.h> +#include <glib/gi18n.h> #include <libgnomevfs/gnome-vfs-ops.h> #include <libedataserver/e-time-utils.h> #include <table/e-table-scrolled.h> @@ -501,7 +503,7 @@ e_memos_class_init (EMemosClass *klass) GTK_RUN_LAST, G_TYPE_FROM_CLASS (object_class), GTK_SIGNAL_OFFSET (EMemosClass, selection_changed), - gtk_marshal_NONE__INT, + g_cclosure_marshal_VOID__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); @@ -715,15 +717,23 @@ static void backend_error_cb (ECal *client, const char *message, gpointer data) { EMemos *memos; + GtkWidget *dialog; char *errmsg; char *urinopwd; memos = E_MEMOS (data); urinopwd = get_uri_without_password (e_cal_get_uri (client)); - errmsg = g_strdup_printf (_("Error on %s:\n %s"), urinopwd, message); - gnome_error_dialog_parented (errmsg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (memos)))); - g_free (errmsg); + + dialog = gtk_message_dialog_new ( + GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (memos))), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Error on %s:\n %s"), urinopwd, message); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + g_free (urinopwd); } diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c index 2f119e2e6c..e7af491077 100644 --- a/calendar/gui/e-select-names-renderer.c +++ b/calendar/gui/e-select-names-renderer.c @@ -61,7 +61,7 @@ e_select_names_renderer_editing_done (GtkCellEditable *editable, ESelectNamesRen g_signal_handlers_disconnect_matched (editable, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, cell); if (GTK_ENTRY (editable)->editing_canceled) { - gtk_cell_renderer_editing_canceled (GTK_CELL_RENDERER (cell)); + gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (cell), TRUE); goto cleanup; } diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index fec3839ddc..1c77ae09fa 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -27,6 +27,7 @@ #endif #include <gnome.h> +#include <glib/gi18n.h> #include <libgnomevfs/gnome-vfs-ops.h> #include <libedataserver/e-time-utils.h> #include <table/e-table-scrolled.h> @@ -630,7 +631,7 @@ e_tasks_class_init (ETasksClass *class) GTK_RUN_LAST, G_TYPE_FROM_CLASS (object_class), GTK_SIGNAL_OFFSET (ETasksClass, selection_changed), - gtk_marshal_NONE__INT, + g_cclosure_marshal_VOID__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); @@ -828,15 +829,23 @@ static void backend_error_cb (ECal *client, const char *message, gpointer data) { ETasks *tasks; - char *errmsg; + GtkWidget *dialog; char *urinopwd; tasks = E_TASKS (data); urinopwd = get_uri_without_password (e_cal_get_uri (client)); - errmsg = g_strdup_printf (_("Error on %s:\n %s"), urinopwd, message); - gnome_error_dialog_parented (errmsg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks)))); - g_free (errmsg); + + dialog = gtk_message_dialog_new ( + GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Error on %s:\n %s"), + urinopwd, message); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + g_free (urinopwd); } diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index 0699826999..b79ec9e171 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -120,7 +120,7 @@ e_timezone_entry_init (ETimezoneEntry *tentry) priv->default_zone = NULL; priv->entry = gtk_entry_new (); - gtk_entry_set_editable (GTK_ENTRY (priv->entry), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (priv->entry), FALSE); /*gtk_widget_set_usize (priv->date_entry, 90, 0);*/ gtk_box_pack_start (GTK_BOX (tentry), priv->entry, TRUE, TRUE, 0); gtk_widget_show (priv->entry); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 02250ed228..4690ee2241 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -857,9 +857,10 @@ e_week_view_style_set (GtkWidget *widget, } /* Set the height of the top canvas. */ - gtk_widget_set_usize (week_view->titles_canvas, -1, - PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + - PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) + 5); + gtk_widget_set_size_request ( + week_view->titles_canvas, -1, + PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + + PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) + 5); /* Save the sizes of various strings in the font, so we can quickly decide which date formats to use. */ @@ -4214,7 +4215,7 @@ static void e_week_view_cancel_layout (EWeekView *week_view) { if (week_view->layout_timeout_id != 0) { - gtk_timeout_remove (week_view->layout_timeout_id); + g_source_remove (week_view->layout_timeout_id); week_view->layout_timeout_id = 0; } } diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index fb361ea7fa..ee049ebf6c 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -2211,7 +2211,8 @@ display_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type, gboolean gra priv->current_view_type = view_type; - gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), (int) view_type); + gtk_notebook_set_current_page ( + GTK_NOTEBOOK (priv->notebook), (int) view_type); if (grab_focus) focus_current_view (gcal); @@ -2762,15 +2763,23 @@ static void backend_error_cb (ECal *client, const char *message, gpointer data) { GnomeCalendar *gcal; - char *errmsg; + GtkDialog *dialog; char *uristr; gcal = GNOME_CALENDAR (data); uristr = get_uri_without_password (e_cal_get_uri (client)); - errmsg = g_strdup_printf (_("Error on %s:\n %s"), uristr, message); - gnome_error_dialog_parented (errmsg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal)))); - g_free (errmsg); + + dialog = gtk_message_dialog_new ( + GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _("Error on %s:\n %s"), + uristr, message); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + g_free (uristr); } @@ -3413,9 +3422,9 @@ gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gc times_width = e_day_view_time_item_get_column_width ( E_DAY_VIEW_TIME_ITEM (E_DAY_VIEW (priv->day_view)->time_canvas_item)); if (times_width < priv->hpane_pos - 20) - gtk_widget_set_usize (E_DAY_VIEW (priv->day_view)->time_canvas, times_width, -1); + gtk_widget_set_size_request (E_DAY_VIEW (priv->day_view)->time_canvas, times_width, -1); else - gtk_widget_set_usize (E_DAY_VIEW (priv->day_view)->time_canvas, priv->hpane_pos - 20, -1); + gtk_widget_set_size_request (E_DAY_VIEW (priv->day_view)->time_canvas, priv->hpane_pos - 20, -1); return FALSE; diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c index ad811e0512..aef826507c 100644 --- a/calendar/gui/memos-component.c +++ b/calendar/gui/memos-component.c @@ -1314,7 +1314,7 @@ memos_component_peek (void) if (component == NULL) { component = g_object_new (memos_component_get_type (), NULL); - if (e_util_mkdir_hier (component->priv->config_directory, 0777) != 0) { + if (g_mkdir_with_parents (component->priv->config_directory, 0777) != 0) { g_warning (G_STRLOC ": Cannot create directory %s: %s", component->priv->config_directory, g_strerror (errno)); g_object_unref (component); diff --git a/calendar/gui/print.c b/calendar/gui/print.c index fafa4db632..5dbff11c0a 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -2046,7 +2046,7 @@ range_selector_new (GtkWidget *dialog, time_t at, int *view) e_utf8_strftime (text, sizeof (text), _("Selected day (%a %b %d %Y)"), &tm); radio = gtk_radio_button_new_with_label (NULL, text); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio)); + group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)); gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0); /* Week */ @@ -2084,21 +2084,21 @@ range_selector_new (GtkWidget *dialog, time_t at, int *view) g_snprintf (text, sizeof (text), _("Selected week (%s - %s)"), str1, str2); radio = gtk_radio_button_new_with_label (group, text); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio)); + group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)); gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0); /* Month */ e_utf8_strftime (text, sizeof (text), _("Selected month (%b %Y)"), &tm); radio = gtk_radio_button_new_with_label (group, text); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio)); + group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)); gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0); /* Year */ e_utf8_strftime (text, sizeof (text), _("Selected year (%Y)"), &tm); radio = gtk_radio_button_new_with_label (group, text); - group = gtk_radio_button_group (GTK_RADIO_BUTTON (radio)); + group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio)); gtk_box_pack_start (GTK_BOX (box), radio, FALSE, FALSE, 0); /* Select default */ @@ -2830,8 +2830,7 @@ print_table (ETable *etable, const char *dialog_title, const char *print_header, gpd = e_print_get_dialog_with_config (dialog_title, 0, settings); printable = e_table_get_printable (etable); - g_object_ref (printable); - gtk_object_sink (GTK_OBJECT (printable)); + g_object_ref_sink (printable); e_printable_reset (printable); pti->printable = printable; diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 2fc9bc8d62..0bae3c7c48 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -1391,7 +1391,7 @@ tasks_component_peek (void) if (component == NULL) { component = g_object_new (tasks_component_get_type (), NULL); - if (e_util_mkdir_hier (component->priv->config_directory, 0777) != 0) { + if (g_mkdir_with_parents (component->priv->config_directory, 0777) != 0) { g_warning (G_STRLOC ": Cannot create directory %s: %s", component->priv->config_directory, g_strerror (errno)); g_object_unref (component); diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index 768075ba34..5b7470c003 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -198,7 +198,7 @@ button_toggled_cb (GtkWidget *widget, struct _selector_data *sd) g_object_ref(e_source_selector_peek_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_page((GtkNotebook *)sd->notebook, sd->page); + gtk_notebook_set_current_page((GtkNotebook *)sd->notebook, sd->page); } static void diff --git a/composer/ChangeLog b/composer/ChangeLog index 5fe718b2bf..39310f6e99 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,10 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * e-msg-composer-hdrs.c (init), (e_msg_composer_hdrs_new): + Use g_object_ref_sink() instead of gtk_object_sink(). + 2007-04-09 Srinivasa Ragavan <sragavan@novell.com> ** Fix for bug #356523 from Martin Olsson diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c index 2a1ae8d774..89512db1da 100644 --- a/composer/e-msg-composer-hdrs.c +++ b/composer/e-msg-composer-hdrs.c @@ -908,8 +908,7 @@ init (EMsgComposerHdrs *hdrs) priv = g_new0 (EMsgComposerHdrsPrivate, 1); priv->tooltips = gtk_tooltips_new (); - g_object_ref (priv->tooltips); - gtk_object_sink ((GtkObject *) priv->tooltips); + g_object_ref_sink (priv->tooltips); priv->accounts = mail_config_get_accounts (); g_object_ref (priv->accounts); @@ -954,8 +953,7 @@ e_msg_composer_hdrs_new (BonoboUIComponent *uic, int visible_mask, int visible_f priv = new->priv; priv->uic = uic; - g_object_ref (new); - gtk_object_sink (GTK_OBJECT (new)); + g_object_ref_sink (new); setup_name_selector (new); diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 2a036e75f5..e56b6d878c 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,63 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * Makefile.am: + Remove e-gtk-utils.h and e-gtk-utils.c. + + * e-mktemp.c (get_dir): + Use g_mkdir_with_parents() instead of e_util_mkdir_hier(). + + * e-gui-utils.[ch]: + Remove e_create_image_widget() and e_button_new_with_stock_icon() + + * e-gui-utils.c (e_icon_for_mime_type): + Use GtkIconTheme instead of GnomeIconTheme. + + * eggtrayicon.c (gtk_status_icon_init): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * e-sorter-array.c (esa_sort): + Use g_qsort_with_data() instead of e_sort(). + + * e-util.[ch]: + Some cosmetic cleanups. + Remove some unused or redundant symbols: + E_MAKE_X_TYPE + GET_STRING_ARRAY_FROM_ELLIPSIS + GET_DUPLICATED_STRING_ARRAY_FROM_ELLIPSIS + E_OBJECT_CLASS_ADD_SIGNALS + E_OBJECT_CLASS_TYPE + e_strdup_strip() + e_free_object_list() + e_free_object_slist() + e_free_string_list() + e_free_string_slist() + e_read_file() + e_write_file_mkstemp() + e_read_uri() + e_strsplit() + e_create_directory() + e_sort() + e_strdupv() + + * e-util.c (e_format_number), (e_format_number_as_float): + e_free_string_list() is dead; just do it manually. + + * e-icon-factory.c: + Use GtkIconTheme instead of GnomeIconTheme. + Use GStaticMutex instead of pthread_mutex_t. + Allocate icons with GSlice. + + * e-xml-utils.c: + Include missing header file(s). + + * e-dialog-widget.c: + Drop support for GnomePropertyBox; nothing uses it. + + * e-dialog-widget.c (e_dialog_dateedit_get): + Use gnome_date_edit_get_time() instead of gnome_date_edit_get_date(). + 2007-03-20 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #419524 diff --git a/e-util/Makefile.am b/e-util/Makefile.am index 75f9809337..d78143c23d 100644 --- a/e-util/Makefile.am +++ b/e-util/Makefile.am @@ -52,7 +52,6 @@ eutilinclude_HEADERS = \ e-event.h \ e-folder-map.h \ e-fsutils.h \ - e-gtk-utils.h \ e-gui-utils.h \ e-html-utils.h \ e-icon-factory.h \ @@ -91,7 +90,6 @@ libeutil_la_SOURCES = \ e-event.c \ e-folder-map.c \ e-fsutils.c \ - e-gtk-utils.c \ e-gui-utils.c \ e-html-utils.c \ e-icon-factory.c \ diff --git a/e-util/e-dialog-widgets.c b/e-util/e-dialog-widgets.c index 6d17a3d1f1..205cf97e26 100644 --- a/e-util/e-dialog-widgets.c +++ b/e-util/e-dialog-widgets.c @@ -33,7 +33,6 @@ #include <gtk/gtksignal.h> #include <gtk/gtkspinbutton.h> #include <libgnomeui/gnome-dateedit.h> -#include <libgnomeui/gnome-propertybox.h> #include "e-dialog-widgets.h" @@ -116,44 +115,19 @@ index_to_value (const int *value_map, int index) return -1; } -/* Callback for the "toggled" signal of toggle buttons */ -static void -toggled_cb (GtkToggleButton *toggle, gpointer data) -{ - GnomePropertyBox *pbox; - - pbox = GNOME_PROPERTY_BOX (data); - - /* For radio buttons, we only notify the property box if the button is - * active, because we'll get one call for each of the changed buttons in - * the radio group. - */ - if (!GTK_IS_RADIO_BUTTON (toggle) || toggle->active) - gnome_property_box_changed (pbox); -} - /* Hooks a radio button group */ static void hook_radio (GtkWidget *dialog, GtkRadioButton *radio, gpointer value_var, gpointer info) { const int *value_map; - GSList *group, *l; int *value; - group = gtk_radio_button_get_group (radio); - /* Set the value */ value = (int *) value_var; value_map = (const int *) info; e_dialog_radio_set (GTK_WIDGET (radio), *value, value_map); - - /* Hook to changed */ - - if (GNOME_IS_PROPERTY_BOX (dialog)) - for (l = group; l; l = l->next) - g_signal_connect (l->data, "toggled", G_CALLBACK (toggled_cb), dialog); } /* Gets the value of a radio button group */ @@ -169,16 +143,6 @@ get_radio_value (GtkRadioButton *radio, gpointer value_var, gpointer info) *value = e_dialog_radio_get (GTK_WIDGET (radio), value_map); } -/* Callback for the "activate" signal of menu items */ -static void -activate_cb (GtkMenuItem *item, gpointer data) -{ - GnomePropertyBox *pbox; - - pbox = GNOME_PROPERTY_BOX (data); - gnome_property_box_changed (pbox); -} - /* Hooks an option menu */ static void hook_option_menu (GtkWidget *dialog, GtkOptionMenu *omenu, gpointer value_var, gpointer info) @@ -192,18 +156,6 @@ hook_option_menu (GtkWidget *dialog, GtkOptionMenu *omenu, gpointer value_var, g value_map = (const int *) info; e_dialog_option_menu_set (GTK_WIDGET (omenu), *value, value_map); - - /* Hook to changed */ - - if (GNOME_IS_PROPERTY_BOX (dialog)) { - GtkMenu *menu; - GList *l; - - menu = GTK_MENU (gtk_option_menu_get_menu (omenu)); - - for (l = GTK_MENU_SHELL (menu)->children; l; l = l->next) - g_signal_connect (l->data, "activate", G_CALLBACK (activate_cb), dialog); - } } /* Gets the value of an option menu */ @@ -229,11 +181,6 @@ hook_toggle (GtkWidget *dialog, GtkToggleButton *toggle, gpointer value_var, gpo value = (gboolean *) value_var; e_dialog_toggle_set (GTK_WIDGET (toggle), *value); - - /* Hook to changed */ - - if (GNOME_IS_PROPERTY_BOX (dialog)) - g_signal_connect (toggle, "toggled", G_CALLBACK (toggled_cb), dialog); } /* Gets the value of a toggle button */ @@ -246,16 +193,6 @@ get_toggle_value (GtkToggleButton *toggle, gpointer value_var, gpointer info) *value = e_dialog_toggle_get (GTK_WIDGET (toggle)); } -/* Callback for the "value_changed" signal of the adjustment of a spin button */ -static void -value_changed_cb (GtkAdjustment *adj, gpointer data) -{ - GnomePropertyBox *pbox; - - pbox = GNOME_PROPERTY_BOX (data); - gnome_property_box_changed (pbox); -} - /* Hooks a spin button */ static void hook_spin_button (GtkWidget *dialog, GtkSpinButton *spin, gpointer value_var, gpointer info) @@ -271,9 +208,6 @@ hook_spin_button (GtkWidget *dialog, GtkSpinButton *spin, gpointer value_var, gp /* Hook to changed */ adj = gtk_spin_button_get_adjustment (spin); - - if (GNOME_IS_PROPERTY_BOX (dialog)) - g_signal_connect (adj, "value_changed", G_CALLBACK (value_changed_cb), dialog); } /* Gets the value of a spin button */ @@ -286,16 +220,6 @@ get_spin_button_value (GtkSpinButton *spin, gpointer value_var, gpointer info) *value = e_dialog_spin_get_double (GTK_WIDGET (spin)); } -/* Callback for the "changed" signal of a GtkEditable widget */ -static void -changed_cb (GtkEditable *editable, gpointer data) -{ - GnomePropertyBox *pbox; - - pbox = GNOME_PROPERTY_BOX (data); - gnome_property_box_changed (pbox); -} - /* Hooks a GtkEditable widget */ static void hook_editable (GtkWidget *dialog, GtkEditable *editable, gpointer value_var, gpointer info) @@ -307,11 +231,6 @@ hook_editable (GtkWidget *dialog, GtkEditable *editable, gpointer value_var, gpo value = (char **) value_var; e_dialog_editable_set (GTK_WIDGET (editable), *value); - - /* Hook to changed */ - - if (GNOME_IS_PROPERTY_BOX (dialog)) - g_signal_connect (editable, "changed", G_CALLBACK (changed_cb), dialog); } /* Gets the value of a GtkEditable widget */ @@ -718,7 +637,7 @@ e_dialog_dateedit_get (GtkWidget *widget) g_return_val_if_fail (widget != NULL, -1); g_return_val_if_fail (GNOME_IS_DATE_EDIT (widget), -1); - return gnome_date_edit_get_date (GNOME_DATE_EDIT (widget)); + return gnome_date_edit_get_time (GNOME_DATE_EDIT (widget)); } /** @@ -743,10 +662,6 @@ e_dialog_dateedit_get (GtkWidget *widget) * use is to call that function in the handler for the "OK" button of a dialog * box. * - * In addition, if the specified @dialog is a #GnomePropertyBox, the widgets wil - * automatically turn on the "Apply" button of the property box when they are - * modified by the user. - * * Return value: TRUE if the type of the specified @widget is supported, FALSE * otherwise. **/ diff --git a/e-util/e-gtk-utils.c b/e-util/e-gtk-utils.c deleted file mode 100644 index d8282d2c1a..0000000000 --- a/e-util/e-gtk-utils.c +++ /dev/null @@ -1,223 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-gtk-utils.c - * - * Copyright (C) 2000 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Author: Ettore Perazzoli - */ - - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <gtk/gtklayout.h> -#include <gtk/gtksignal.h> -#include <gtk/gtkwidget.h> -#include <gtk/gtkbutton.h> -#include <gtk/gtkstock.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkimage.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkalignment.h> - -#ifdef GDK_WINDOWING_X11 -#include <gdk/gdkx.h> - -#include <X11/Xlib.h> -#endif - -#include "e-gtk-utils.h" - - -void -e_signal_connect_while_alive (void *instance, - const char *name, - GCallback callback, - void *callback_data, - void *alive_instance) -{ - GClosure *closure; - - g_return_if_fail (GTK_IS_OBJECT (instance)); - - closure = g_cclosure_new (callback, callback_data, NULL); - g_object_watch_closure (alive_instance, closure); - g_signal_connect_closure_by_id (instance, g_signal_lookup (name, G_OBJECT_TYPE (instance)), 0, - closure, FALSE); -} - - -/* (Cut and pasted from Gtk.) */ - -typedef struct DisconnectInfo { - unsigned int signal_handler; - - GtkObject *object1; - unsigned int disconnect_handler1; - - GtkObject *object2; - unsigned int disconnect_handler2; -} DisconnectInfo; - -static unsigned int -alive_disconnecter (GtkObject *object, - DisconnectInfo *info) -{ - g_assert (info != NULL); - - g_signal_handler_disconnect (info->object1, info->disconnect_handler1); - g_signal_handler_disconnect (info->object1, info->signal_handler); - g_signal_handler_disconnect (info->object2, info->disconnect_handler2); - - g_free (info); - - return 0; -} - -/** - * e_gtk_signal_connect_full_while_alive: - * @object: - * @name: - * @func: - * @marshal: - * @data: - * @destroy_func: - * @object_signal: - * @after: - * @alive_object: - * - * Connect a signal like `gtk_signal_connect_while_alive()', but with full - * params like `gtk_signal_connect_full()'. - **/ -void -e_signal_connect_full_while_alive (void *instance, - const char *name, - GtkSignalFunc func, - GtkCallbackMarshal marshal, - void *data, - GtkDestroyNotify destroy_func, - gboolean instance_signal, - gboolean after, - void *alive_instance) -{ - DisconnectInfo *info; - - g_return_if_fail (GTK_IS_OBJECT (instance)); - g_return_if_fail (name != NULL); - g_return_if_fail (func != NULL); - g_return_if_fail (GTK_IS_OBJECT (alive_instance)); - - info = g_new (DisconnectInfo, 1); - - info->signal_handler = gtk_signal_connect_full (instance, name, - func, marshal, data, - destroy_func, - instance_signal, after); - - info->object1 = instance; - info->disconnect_handler1 = g_signal_connect (instance, "destroy", - G_CALLBACK (alive_disconnecter), info); - - info->object2 = alive_instance; - info->disconnect_handler2 = g_signal_connect (alive_instance, "destroy", - G_CALLBACK (alive_disconnecter), info); -} - - -#ifdef GDK_WINDOWING_X11 -/* BackingStore support. */ - -static void -widget_realize_callback_for_backing_store (GtkWidget *widget, - void *data) -{ - XSetWindowAttributes attributes; - GdkWindow *window; - - if (GTK_IS_LAYOUT (widget)) - window = GTK_LAYOUT (widget)->bin_window; - else - window = widget->window; - - attributes.backing_store = Always; - XChangeWindowAttributes (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XWINDOW (window), - CWBackingStore, &attributes); -} - -#endif - -/** - * e_make_widget_backing_stored: - * @widget: A GtkWidget - * - * Make sure that the window for @widget has the BackingStore attribute set to - * Always when realized. This will allow the widget to be refreshed by the X - * server even if the application is currently not responding to X events (this - * is e.g. very useful for the splash screen). - * - * Notice that this will not work 100% in all cases as the server might not - * support that or just refuse to do so. - **/ -void -e_make_widget_backing_stored (GtkWidget *widget) -{ -#ifdef GDK_WINDOWING_X11 - g_signal_connect (widget, "realize", G_CALLBACK (widget_realize_callback_for_backing_store), NULL); -#endif -} - - -/** - * e_gtk_button_new_with_icon: - * @text: The mnemonic text for the label. - * @stock: The name of the stock item to get the icon from. - * - * Create a gtk button with a custom label and a stock icon. - * - * - * Return value: The widget. - **/ -GtkWidget * -e_gtk_button_new_with_icon(const char *text, const char *stock) -{ - GtkWidget *button, *label; - GtkStockItem item; - - button = gtk_button_new(); - label = gtk_label_new_with_mnemonic(text); - gtk_label_set_mnemonic_widget((GtkLabel *)label, button); - - if (gtk_stock_lookup(stock, &item)) { - GtkWidget *image, *hbox, *align; - - image = gtk_image_new_from_stock(stock, GTK_ICON_SIZE_BUTTON); - hbox = gtk_hbox_new(FALSE, 2); - align = gtk_alignment_new(0.5, 0.5, 0.0, 0.0); - gtk_box_pack_start((GtkBox *)hbox, image, FALSE, FALSE, 0); - gtk_box_pack_end((GtkBox *)hbox, label, FALSE, FALSE, 0); - gtk_container_add((GtkContainer *)align, hbox); - gtk_container_add((GtkContainer *)button, align); - gtk_widget_show_all(align); - } else { - gtk_misc_set_alignment((GtkMisc *)label, 0.5, 0.5); - gtk_container_add((GtkContainer *)button, label); - gtk_widget_show(label); - } - - return button; -} diff --git a/e-util/e-gtk-utils.h b/e-util/e-gtk-utils.h deleted file mode 100644 index cebb5b757d..0000000000 --- a/e-util/e-gtk-utils.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* e-gtk-utils.c - * - * Copyright (C) 2000 Ximian, Inc. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * Author: Ettore Perazzoli - */ - -#ifndef E_GTK_UTILS_H -#define E_GTK_UTILS_H - -#include <gtk/gtkobject.h> -#include <gtk/gtkradiobutton.h> - -void e_signal_connect_while_alive (void *object, - const char *name, - GCallback callback, - void *data, - void *alive_instance); - -void e_signal_connect_full_while_alive (void *instance, - const char *name, - GtkSignalFunc func, - GtkCallbackMarshal marshal, - void *data, - GtkDestroyNotify destroy_func, - gboolean object_signal, - gboolean after, - void *alive_instance); - -void e_make_widget_backing_stored (GtkWidget *widget); - -GtkWidget *e_gtk_button_new_with_icon(const char *text, const char *stock); - -#endif diff --git a/e-util/e-gui-utils.c b/e-util/e-gui-utils.c index 3c1f6f67af..875dc91ad9 100644 --- a/e-util/e-gui-utils.c +++ b/e-util/e-gui-utils.c @@ -31,58 +31,6 @@ #include <libgnomevfs/gnome-vfs-mime-handlers.h> #include <libgnomeui/gnome-icon-lookup.h> -GtkWidget *e_create_image_widget(gchar *name, - gchar *string1, gchar *string2, - gint int1, gint int2) -{ - GtkWidget *alignment = NULL; - GtkWidget *w; - - if (string1) { - w = e_icon_factory_get_image (string1, E_ICON_SIZE_DIALOG); - - gtk_misc_set_alignment (GTK_MISC (w), 0.5, 0.5); - - alignment = gtk_widget_new(gtk_alignment_get_type(), - "child", w, - "xalign", (double) 0, - "yalign", (double) 0, - "xscale", (double) 0, - "yscale", (double) 0, - NULL); - - gtk_widget_show_all (alignment); - } - - return alignment; -} - -GtkWidget * -e_button_new_with_stock_icon (const char *label_str, const char *stockid) -{ - GtkWidget *button, *hbox, *label, *align, *image; - - button = gtk_button_new (); - - label = gtk_label_new_with_mnemonic (label_str); - - gtk_label_set_mnemonic_widget (GTK_LABEL (label), button); - - image = gtk_image_new_from_stock (stockid, GTK_ICON_SIZE_BUTTON); - hbox = gtk_hbox_new (FALSE, 2); - - align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); - - gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); - gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0); - - gtk_container_add (GTK_CONTAINER (button), align); - gtk_container_add (GTK_CONTAINER (align), hbox); - gtk_widget_show_all (align); - - return button; -} - /** * e_icon_for_mime_type: * @mime_type: a MIME type @@ -97,35 +45,19 @@ e_button_new_with_stock_icon (const char *label_str, const char *stockid) GdkPixbuf * e_icon_for_mime_type (const char *mime_type, int size_hint) { - static GnomeIconTheme *icon_theme = NULL; - char *icon_name, *icon_path = NULL; + gchar *icon_name; GdkPixbuf *pixbuf = NULL; - - /* Try the icon theme. (GNOME 2.2 or Sun GNOME 2.0). - * This will also look in GNOME VFS. - */ - - if (!icon_theme) - icon_theme = gnome_icon_theme_new (); - gnome_icon_theme_set_allow_svg (icon_theme, TRUE); - - icon_name = gnome_icon_lookup (icon_theme, NULL, NULL, NULL, NULL, - mime_type, 0, NULL); - if (icon_name) { - /* FIXME: should we take size_hint as being the same - * as e-icon-factory.c? or should we just leave this - * as pixel size? */ - icon_path = gnome_icon_theme_lookup_icon ( - icon_theme, icon_name, size_hint, NULL, NULL); + + icon_name = gnome_icon_lookup ( + gtk_icon_theme_get_default (), + NULL, NULL, NULL, NULL, mime_type, 0, NULL); + + if (icon_name != NULL) { + pixbuf = gtk_icon_theme_load_icon ( + gtk_icon_theme_get_default (), + icon_name, size_hint, 0, NULL); g_free (icon_name); } - - if (icon_path == NULL) - return NULL; - - pixbuf = gdk_pixbuf_new_from_file (icon_path, NULL); - g_free (icon_path); - + return pixbuf; } - diff --git a/e-util/e-gui-utils.h b/e-util/e-gui-utils.h index 8701949cb0..de219e8bc4 100644 --- a/e-util/e-gui-utils.h +++ b/e-util/e-gui-utils.h @@ -2,12 +2,6 @@ #define E_GUI_UTILS_H #include <gtk/gtkwidget.h> -#include <bonobo/bonobo-ui-util.h> -#include <bonobo/bonobo-control.h> - -GtkWidget *e_create_image_widget (gchar *name, gchar *string1, gchar *string2, gint int1, gint int2); - -GtkWidget *e_button_new_with_stock_icon (const char *label_str, const char *stockid); GdkPixbuf *e_icon_for_mime_type (const char *mime_type, int size); diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c index 5471b5adab..96cd9d5ce2 100644 --- a/e-util/e-icon-factory.c +++ b/e-util/e-icon-factory.c @@ -30,8 +30,8 @@ #include <pthread.h> +#include <gtk/gtkicontheme.h> #include <gtk/gtkimage.h> -#include <libgnomeui/gnome-icon-theme.h> #include "e-icon-factory.h" #include "e-util-private.h" @@ -58,8 +58,8 @@ static GdkPixbuf *broken16_pixbuf = NULL; static GdkPixbuf *broken24_pixbuf = NULL; static GHashTable *name_to_icon = NULL; -static GnomeIconTheme *icon_theme = NULL; -static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; +static GtkIconTheme *icon_theme = NULL; +static GStaticMutex mutex = G_STATIC_MUTEX_INIT; /* Note: takes ownership of the pixbufs (eg. does not ref them) */ @@ -67,11 +67,11 @@ static Icon * icon_new (const char *name, GdkPixbuf *pixbuf) { Icon *icon; - - icon = g_malloc0 (sizeof (Icon)); + + icon = g_slice_new (Icon); icon->name = g_strdup (name); icon->pixbuf = pixbuf; - + return icon; } @@ -81,7 +81,7 @@ icon_free (Icon *icon) g_free (icon->name); if (icon->pixbuf) g_object_unref (icon->pixbuf); - g_free (icon); + g_slice_free (Icon, icon); } static Icon * @@ -89,11 +89,20 @@ load_icon (const char *icon_key, const char *icon_name, int size, int scale) { GdkPixbuf *pixbuf, *unscaled = NULL; char *basename, *filename = NULL; - + if (g_path_is_absolute (icon_name)) filename = g_strdup (icon_name); - else - filename = gnome_icon_theme_lookup_icon (icon_theme, icon_name, size, NULL, NULL); + else { + GtkIconInfo *icon_info; + + icon_info = gtk_icon_theme_lookup_icon ( + icon_theme, icon_name, size, 0); + if (icon_info != NULL) { + filename = g_strdup ( + gtk_icon_info_get_filename (icon_info)); + gtk_icon_info_free (icon_info); + } + } if (!filename || !(unscaled = gdk_pixbuf_new_from_file (filename, NULL))) { if (scale) { @@ -145,9 +154,9 @@ load_icon (const char *icon_key, const char *icon_name, int size, int scale) unscaled = gdk_pixbuf_new_from_file (filename, NULL); } } - + done: - + g_free (filename); if (unscaled != NULL) { pixbuf = gdk_pixbuf_scale_simple (unscaled, size, size, GDK_INTERP_BILINEAR); @@ -155,7 +164,7 @@ load_icon (const char *icon_key, const char *icon_name, int size, int scale) } else { pixbuf = NULL; } - + return icon_new (icon_key, pixbuf); } @@ -165,29 +174,21 @@ static int pixel_size_to_icon_size (int pixel_size) { int i, icon_size = -1; - + for (i = 0; i < E_ICON_NUM_SIZES; i++) { if (pixel_size == sizes[i]) { icon_size = i; break; } } - - return icon_size; -} -static gboolean -icon_foreach_remove (gpointer key, gpointer value, gpointer user_data) -{ - icon_free (value); - - return TRUE; + return icon_size; } static void -icon_theme_changed_cb (GnomeIconTheme *object, gpointer user_data) +icon_theme_changed_cb (GtkIconTheme *icon_theme, gpointer user_data) { - g_hash_table_foreach_remove (name_to_icon, (GHRFunc) icon_foreach_remove, NULL); + g_hash_table_remove_all (name_to_icon); } /** @@ -200,20 +201,22 @@ e_icon_factory_init (void) { if (name_to_icon != NULL) return; - - icon_theme = gnome_icon_theme_new (); - gnome_icon_theme_set_allow_svg (icon_theme, TRUE); - name_to_icon = g_hash_table_new (g_str_hash, g_str_equal); - g_signal_connect (G_OBJECT (icon_theme), "changed", G_CALLBACK (icon_theme_changed_cb), NULL); - - broken16_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) broken_image_16_xpm); - broken24_pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) broken_image_24_xpm); -} -static void -icon_foreach_free (gpointer key, gpointer value, gpointer user_data) -{ - icon_free (value); + name_to_icon = g_hash_table_new_full ( + g_str_hash, g_str_equal, + (GDestroyNotify) NULL, + (GDestroyNotify) icon_free); + + icon_theme = gtk_icon_theme_get_default (); + + g_signal_connect ( + icon_theme, "changed", + G_CALLBACK (icon_theme_changed_cb), NULL); + + broken16_pixbuf = gdk_pixbuf_new_from_xpm_data ( + (const char **) broken_image_16_xpm); + broken24_pixbuf = gdk_pixbuf_new_from_xpm_data ( + (const char **) broken_image_24_xpm); } /** @@ -226,12 +229,10 @@ e_icon_factory_shutdown (void) { if (name_to_icon == NULL) return; - - g_hash_table_foreach (name_to_icon, (GHFunc) icon_foreach_free, NULL); + g_hash_table_destroy (name_to_icon); g_object_unref (broken16_pixbuf); g_object_unref (broken24_pixbuf); - g_object_unref (icon_theme); name_to_icon = NULL; } @@ -248,21 +249,31 @@ e_icon_factory_shutdown (void) char * e_icon_factory_get_icon_filename (const char *icon_name, int icon_size) { + GtkIconInfo *icon_info; char *filename; - + g_return_val_if_fail (icon_name != NULL, NULL); g_return_val_if_fail (strcmp (icon_name, ""), NULL); - + if (icon_size >= E_ICON_NUM_SIZES) { - g_warning ("calling e_icon_factory_get_icon_filename with unknown icon_size value (%d)", icon_size); + g_warning ( + "calling %s with unknown icon_size value (%d)", + G_STRFUNC, icon_size); if ((icon_size = pixel_size_to_icon_size (icon_size)) == -1) return NULL; } - - pthread_mutex_lock (&lock); - filename = gnome_icon_theme_lookup_icon (icon_theme, icon_name, sizes[icon_size], NULL, NULL); - pthread_mutex_unlock (&lock); - + + g_static_mutex_lock (&mutex); + icon_info = gtk_icon_theme_lookup_icon ( + icon_theme, icon_name, sizes[icon_size], 0); + if (icon_info != NULL) { + filename = g_strdup ( + gtk_icon_info_get_filename (icon_info)); + gtk_icon_info_free (icon_info); + } else + filename = NULL; + g_static_mutex_unlock (&mutex); + return filename; } @@ -287,32 +298,34 @@ e_icon_factory_get_icon (const char *icon_name, int icon_size) char *icon_key; Icon *icon; int size; - + if (icon_size >= E_ICON_NUM_SIZES) { - g_warning ("calling e_icon_factory_get_icon with unknown icon_size value (%d)", icon_size); + g_warning ( + "calling %s with unknown icon_size value (%d)", + G_STRFUNC, icon_size); if ((icon_size = pixel_size_to_icon_size (icon_size)) == -1) return NULL; } - + size = sizes[icon_size]; - + if (icon_name == NULL || !strcmp (icon_name, "")) { if (size >= 24) return gdk_pixbuf_scale_simple (broken24_pixbuf, size, size, GDK_INTERP_NEAREST); else return gdk_pixbuf_scale_simple (broken16_pixbuf, size, size, GDK_INTERP_NEAREST); } - + icon_key = g_alloca (strlen (icon_name) + 7); sprintf (icon_key, "%dx%d/%s", size, size, icon_name); - - pthread_mutex_lock (&lock); - + + g_static_mutex_lock (&mutex); + if (!(icon = g_hash_table_lookup (name_to_icon, icon_key))) { icon = load_icon (icon_key, icon_name, size, TRUE); g_hash_table_insert (name_to_icon, icon->name, icon); } - + if ((pixbuf = icon->pixbuf)) { g_object_ref (pixbuf); } else { @@ -321,9 +334,9 @@ e_icon_factory_get_icon (const char *icon_name, int icon_size) else pixbuf = gdk_pixbuf_scale_simple (broken16_pixbuf, size, size, GDK_INTERP_NEAREST); } - - pthread_mutex_unlock (&lock); - + + g_static_mutex_unlock (&mutex); + return pixbuf; } @@ -332,7 +345,7 @@ e_icon_factory_get_image (const char *icon_name, int icon_size) { GdkPixbuf *pixbuf; GtkWidget *image; - + pixbuf = e_icon_factory_get_icon (icon_name, icon_size); image = gtk_image_new_from_pixbuf (pixbuf); g_object_unref (pixbuf); @@ -355,14 +368,14 @@ e_icon_factory_get_icon_list (const char *icon_name) char *icon_key; Icon *icon; int size, i; - + if (!icon_name || !strcmp (icon_name, "")) return NULL; - - pthread_mutex_lock (&lock); - + + g_static_mutex_lock (&mutex); + icon_key = g_alloca (strlen (icon_name) + 9); - + for (i = 0; i < G_N_ELEMENTS (icon_list_sizes); i++) { size = icon_list_sizes[i]; sprintf (icon_key, "%dx%d/%s", size, size, icon_name); @@ -377,8 +390,8 @@ e_icon_factory_get_icon_list (const char *icon_name) g_object_ref (icon->pixbuf); } } - - pthread_mutex_unlock (&lock); - + + g_static_mutex_unlock (&mutex); + return list; } diff --git a/e-util/e-mktemp.c b/e-util/e-mktemp.c index 56345d9c68..2b4fdf5d47 100644 --- a/e-util/e-mktemp.c +++ b/e-util/e-mktemp.c @@ -113,7 +113,7 @@ get_dir (gboolean make) tmpdir = g_build_filename(g_get_home_dir(), ".evolution", "cache", "tmp", NULL); path = g_string_new(tmpdir); - if (make && e_util_mkdir_hier(tmpdir, 0777) == -1) { + if (make && g_mkdir_with_parents(tmpdir, 0777) == -1) { g_string_free(path, TRUE); path = NULL; } diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c index 7b7e6ab4ea..0f103a339a 100644 --- a/e-util/e-sorter-array.c +++ b/e-util/e-sorter-array.c @@ -85,7 +85,9 @@ esa_sort(ESorterArray *esa) esa->sorted[i] = i; if (esa->compare) - e_sort (esa->sorted, rows, sizeof(int), esort_callback, esa); + g_qsort_with_data ( + esa->sorted, rows, sizeof(int), + esort_callback, esa); } static void diff --git a/e-util/e-util.c b/e-util/e-util.c index f5e33f04bd..28deaa74e9 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -49,8 +49,8 @@ #include "e-util.h" #include "e-util-private.h" -int -e_str_compare (const void *x, const void *y) +gint +e_str_compare (gconstpointer x, gconstpointer y) { if (x == NULL || y == NULL) { if (x == y) @@ -62,8 +62,8 @@ e_str_compare (const void *x, const void *y) return strcmp (x, y); } -int -e_str_case_compare (const void *x, const void *y) +gint +e_str_case_compare (gconstpointer x, gconstpointer y) { if (x == NULL || y == NULL) { if (x == y) @@ -75,8 +75,8 @@ e_str_case_compare (const void *x, const void *y) return g_utf8_collate (g_utf8_casefold (x, -1), g_utf8_casefold (y, -1)); } -int -e_collate_compare (const void *x, const void *y) +gint +e_collate_compare (gconstpointer x, gconstpointer y) { if (x == NULL || y == NULL) { if (x == y) @@ -88,158 +88,17 @@ e_collate_compare (const void *x, const void *y) return g_utf8_collate (x, y); } -int -e_int_compare (const void *x, const void *y) -{ - if (GPOINTER_TO_INT (x) < GPOINTER_TO_INT (y)) - return -1; - else if (GPOINTER_TO_INT (x) == GPOINTER_TO_INT (y)) - return 0; - else - return 1; -} - -char * -e_strdup_strip(const char *string) -{ - int i; - int length = 0; - int initial = 0; - for ( i = 0; string[i]; i++ ) { - if (initial == i && isspace((unsigned char) string[i])) { - initial ++; - } - if (!isspace((unsigned char) string[i])) { - length = i - initial + 1; - } - } - return g_strndup(string + initial, length); -} - -void -e_free_object_list (GList *list) -{ - GList *p; - - for (p = list; p != NULL; p = p->next) - g_object_unref (p->data); - - g_list_free (list); -} - -void -e_free_object_slist (GSList *list) -{ - GSList *p; - - for (p = list; p != NULL; p = p->next) - g_object_unref (p->data); - - g_slist_free (list); -} - -void -e_free_string_list (GList *list) -{ - GList *p; - - for (p = list; p != NULL; p = p->next) - g_free (p->data); - - g_list_free (list); -} - -void -e_free_string_slist (GSList *list) -{ - GSList *p; - - for (p = list; p != NULL; p = p->next) - g_free (p->data); - g_slist_free (list); -} - -#define BUFF_SIZE 1024 - -char * -e_read_file(const char *filename) -{ - int fd; - char buffer[BUFF_SIZE]; - GList *list = NULL, *list_iterator; - GList *lengths = NULL, *lengths_iterator; - int length = 0; - int bytes; - char *ret_val; - - fd = g_open(filename, O_RDONLY, 0); - if (fd == -1) - return NULL; - bytes = read(fd, buffer, BUFF_SIZE); - while (bytes) { - if (bytes > 0) { - char *temp = g_malloc(bytes); - memcpy (temp, buffer, bytes); - list = g_list_prepend(list, temp); - lengths = g_list_prepend(lengths, GINT_TO_POINTER(bytes)); - length += bytes; - } else { - if (errno != EINTR) { - close(fd); - g_list_foreach(list, (GFunc) g_free, NULL); - g_list_free(list); - g_list_free(lengths); - return NULL; - } - } - bytes = read(fd, buffer, BUFF_SIZE); - } - ret_val = g_new(char, length + 1); - ret_val[length] = 0; - lengths_iterator = lengths; - list_iterator = list; - for ( ; list_iterator; list_iterator = list_iterator->next, lengths_iterator = lengths_iterator->next) { - int this_length = GPOINTER_TO_INT(lengths_iterator->data); - length -= this_length; - memcpy(ret_val + length, list_iterator->data, this_length); - } - close(fd); - g_list_foreach(list, (GFunc) g_free, NULL); - g_list_free(list); - g_list_free(lengths); - return ret_val; -} - gint -e_write_file(const char *filename, const char *data, int flags) +e_int_compare (gconstpointer x, gconstpointer y) { - int fd; - int length = strlen(data); - int bytes; - fd = g_open(filename, flags | O_WRONLY, 0666); - if (fd == -1) - return errno; - while (length > 0) { - bytes = write(fd, data, length); - if (bytes > 0) { - length -= bytes; - data += bytes; - } else { - if (errno != EINTR && errno != EAGAIN) { - int save_errno = errno; - close(fd); - return save_errno; - } - } - } - if (close(fd) != 0) { - return errno; - } - return 0; + gint nx = GPOINTER_TO_INT (x); + gint ny = GPOINTER_TO_INT (y); + + return (nx == ny) ? 0 : (nx < ny) ? -1 : 1; } gint -e_write_file_uri (const char *filename, const char *data) +e_write_file_uri (const gchar *filename, const gchar *data) { guint64 length = strlen(data); guint64 bytes; @@ -267,141 +126,18 @@ e_write_file_uri (const char *filename, const char *data) return 0; } -gint -e_write_file_mkstemp(char *filename, const char *data) -{ - int fd; - int length = strlen(data); - int bytes; - fd = g_mkstemp (filename); - if (fd == -1) - return errno; - while (length > 0) { - bytes = write(fd, data, length); - if (bytes > 0) { - length -= bytes; - data += bytes; - } else { - if (errno != EINTR && errno != EAGAIN) { - int save_errno = errno; - close(fd); - return save_errno; - } - } - } - if (close(fd) != 0) { - return errno; - } - return 0; -} - -#if 0 -char * -e_read_uri(const char *uri) -{ - GnomeVFSHandle *handle; - GList *list = NULL, *list_iterator; - GList *lengths = NULL, *lengths_iterator; - gchar buffer[1025]; - gchar *ret_val; - int length = 0; - GnomeVFSFileSize bytes; - - gnome_vfs_open(&handle, uri, GNOME_VFS_OPEN_READ); - - gnome_vfs_read(handle, buffer, 1024, &bytes); - while (bytes) { - if (bytes) { - char *temp = g_malloc(bytes); - memcpy (temp, buffer, bytes); - list = g_list_prepend(list, temp); - lengths = g_list_prepend(lengths, GINT_TO_POINTER((gint) bytes)); - length += bytes; - } - gnome_vfs_read(handle, buffer, 1024, &bytes); - } - - ret_val = g_new(char, length + 1); - ret_val[length] = 0; - lengths_iterator = lengths; - list_iterator = list; - for ( ; list_iterator; list_iterator = list_iterator->next, lengths_iterator = lengths_iterator->next) { - int this_length = GPOINTER_TO_INT(lengths_iterator->data); - length -= this_length; - memcpy(ret_val + length, list_iterator->data, this_length); - } - gnome_vfs_close(handle); - g_list_foreach(list, (GFunc) g_free, NULL); - g_list_free(list); - g_list_free(lengths); - return ret_val; -} -#endif - /* Include build marshalers */ #include "e-util-marshal.h" -gchar** -e_strsplit (const gchar *string, - const gchar *delimiter, - gint max_tokens) -{ - GSList *string_list = NULL, *slist; - gchar **str_array, *s; - guint i, n = 1; - - g_return_val_if_fail (string != NULL, NULL); - g_return_val_if_fail (delimiter != NULL, NULL); - - if (max_tokens < 1) - max_tokens = G_MAXINT; - - s = strstr (string, delimiter); - if (s) - { - guint delimiter_len = strlen (delimiter); - - do - { - guint len; - gchar *new_string; - - len = s - string; - new_string = g_new (gchar, len + 1); - strncpy (new_string, string, len); - new_string[len] = 0; - string_list = g_slist_prepend (string_list, new_string); - n++; - string = s + delimiter_len; - s = strstr (string, delimiter); - } - while (--max_tokens && s); - } - - n++; - string_list = g_slist_prepend (string_list, g_strdup (string)); - - str_array = g_new (gchar*, n); - - i = n - 1; - - str_array[i--] = NULL; - for (slist = string_list; slist; slist = slist->next) - str_array[i--] = slist->data; - - g_slist_free (string_list); - - return str_array; -} - static gint -epow10 (gint number) { - gint value; +epow10 (gint number) +{ + gint value = 1; - for (value = 1; number > 0; number --) { + while (number-- > 0) value *= 10; - } + return value; } @@ -412,16 +148,16 @@ e_format_number (gint number) struct lconv *locality; gint char_length = 0; gint group_count = 0; - guchar *grouping; - int last_count = 3; - int divider; - char *value; - char *value_iterator; + gchar *grouping; + gint last_count = 3; + gint divider; + gchar *value; + gchar *value_iterator; locality = localeconv(); grouping = locality->grouping; while (number) { - char *group; + gchar *group; switch (*grouping) { default: last_count = *grouping; @@ -446,7 +182,7 @@ e_format_number (gint number) } if (list) { - value = g_new(char, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep)); + value = g_new(gchar, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep)); iterator = list; value_iterator = value; @@ -460,7 +196,8 @@ e_format_number (gint number) strcpy(value_iterator, iterator->data); value_iterator += strlen(iterator->data); } - e_free_string_list (list); + g_list_foreach (list, (GFunc) g_free, NULL); + g_list_free (list); return value; } else { return g_strdup("0"); @@ -468,23 +205,23 @@ e_format_number (gint number) } static gchar * -do_format_number_as_float (double number) +do_format_number_as_float (gdouble number) { GList *iterator, *list = NULL; struct lconv *locality; gint char_length = 0; gint group_count = 0; - guchar *grouping; - int last_count = 3; - int divider; - char *value; - char *value_iterator; - double fractional; + gchar *grouping; + gint last_count = 3; + gint divider; + gchar *value; + gchar *value_iterator; + gdouble fractional; locality = localeconv(); grouping = locality->grouping; while (number >= 1.0) { - char *group; + gchar *group; switch (*grouping) { default: last_count = *grouping; @@ -500,7 +237,7 @@ do_format_number_as_float (double number) if (number >= 1.0) { group = g_strdup_printf("%0*d", last_count, (int) fractional); } else { - group = g_strdup_printf("%d", (int) fractional); + group = g_strdup_printf("%d", (gint) fractional); } break; case CHAR_MAX: @@ -511,7 +248,7 @@ do_format_number_as_float (double number) fractional = floor (fractional); while (number >= 1.0) { - group = g_strdup_printf("%0*d", last_count, (int) fractional); + group = g_strdup_printf("%0*d", last_count, (gint) fractional); char_length += strlen(group); list = g_list_prepend(list, group); @@ -524,7 +261,7 @@ do_format_number_as_float (double number) fractional = floor (fractional); } - group = g_strdup_printf("%d", (int) fractional); + group = g_strdup_printf("%d", (gint) fractional); break; } char_length += strlen(group); @@ -533,7 +270,7 @@ do_format_number_as_float (double number) } if (list) { - value = g_new(char, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep)); + value = g_new(gchar, 1 + char_length + (group_count - 1) * strlen(locality->thousands_sep)); iterator = list; value_iterator = value; @@ -547,7 +284,8 @@ do_format_number_as_float (double number) strcpy(value_iterator, iterator->data); value_iterator += strlen(iterator->data); } - e_free_string_list (list); + g_list_foreach (list, (GFunc) g_free, NULL); + g_list_free (list); return value; } else { return g_strdup("0"); @@ -568,7 +306,7 @@ e_format_number_float (gfloat number) locality = localeconv(); int_part = floor (number); - str_intpart = do_format_number_as_float ((double) int_part); + str_intpart = do_format_number_as_float ((gdouble) int_part); if (!strcmp(locality->mon_decimal_point, "")) { decimal_point = "."; @@ -577,7 +315,7 @@ e_format_number_float (gfloat number) decimal_point = locality->mon_decimal_point; } - fraction = (int) ((number - int_part) * 100); + fraction = (gint) ((number - int_part) * 100); if (fraction == 0) { str_fraction = g_strdup ("00"); @@ -593,31 +331,21 @@ e_format_number_float (gfloat number) return value; } -gboolean -e_create_directory (gchar *directory) -{ - gint ret_val = e_util_mkdir_hier (directory, 0777); - if (ret_val == -1) - return FALSE; - else - return TRUE; -} - - /* Perform a binary search for key in base which has nmemb elements of size bytes each. The comparisons are done by (*compare)(). */ -void e_bsearch (const void *key, - const void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure, - size_t *start, - size_t *end) +void +e_bsearch (gconstpointer key, + gconstpointer base, + gsize nmemb, + gsize size, + ESortCompareFunc compare, + gpointer closure, + gsize *start, + gsize *end) { - size_t l, u, idx; - const void *p; - int comparison; + gsize l, u, idx; + gconstpointer p; + gint comparison; if (!(start || end)) return; @@ -625,20 +353,20 @@ void e_bsearch (cons u = nmemb; while (l < u) { idx = (l + u) / 2; - p = (void *) (((const char *) base) + (idx * size)); + p = (((const gchar *) base) + (idx * size)); comparison = (*compare) (key, p, closure); if (comparison < 0) u = idx; else if (comparison > 0) l = idx + 1; else { - size_t lsave, usave; + gsize lsave, usave; lsave = l; usave = u; if (start) { while (l < u) { idx = (l + u) / 2; - p = (void *) (((const char *) base) + (idx * size)); + p = (((const gchar *) base) + (idx * size)); comparison = (*compare) (key, p, closure); if (comparison <= 0) u = idx; @@ -653,7 +381,7 @@ void e_bsearch (cons if (end) { while (l < u) { idx = (l + u) / 2; - p = (void *) (((const char *) base) + (idx * size)); + p = (((const gchar *) base) + (idx * size)); comparison = (*compare) (key, p, closure); if (comparison < 0) u = idx; @@ -672,42 +400,6 @@ void e_bsearch (cons *end = l; } -static gpointer closure_closure; -static ESortCompareFunc compare_closure; - -static int -qsort_callback(const void *data1, const void *data2) -{ - return (*compare_closure) (data1, data2, closure_closure); -} - -/* Forget it. We're just going to use qsort. I lost the need for a stable sort. */ -void -e_sort (void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure) -{ - closure_closure = closure; - compare_closure = compare; - qsort(base, nmemb, size, qsort_callback); -#if 0 - void *base_copy; - int i; - base_copy = g_malloc(nmemb * size); - - for (i = 0; i < nmemb; i++) { - int position; - e_bsearch(base + (i * size), base_copy, i, size, compare, closure, NULL, &position); - memmove(base_copy + (position + 1) * size, base_copy + position * size, (i - position) * size); - memcpy(base_copy + position * size, base + i * size, size); - } - memcpy(base, base_copy, nmemb * size); - g_free(base_copy); -#endif -} - /** * Function to do a last minute fixup of the AM/PM stuff if the locale * and gettext haven't done it right. Most English speaking countries @@ -726,16 +418,18 @@ e_sort (void *base, * there isn't a stray space. **/ -size_t e_strftime_fix_am_pm(char *s, size_t max, const char *fmt, const struct tm *tm) +gsize +e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, + const struct tm *tm) { - char buf[10]; - char *sp; - char *ffmt; - size_t ret; + gchar buf[10]; + gchar *sp; + gchar *ffmt; + gsize ret; if (strstr(fmt, "%p")==NULL && strstr(fmt, "%P")==NULL) { /* No AM/PM involved - can use the fmt string directly */ - ret=e_strftime(s, max, fmt, tm); + ret=e_strftime(str, max, fmt, tm); } else { /* Get the AM/PM symbol from the locale */ e_strftime (buf, 10, "%p", tm); @@ -745,7 +439,7 @@ size_t e_strftime_fix_am_pm(char *s, size_t max, const char *fmt, const struct t * AM/PM have been defined in the locale * so we can use the fmt string directly **/ - ret=e_strftime(s, max, fmt, tm); + ret=e_strftime(str, max, fmt, tm); } else { /** * No AM/PM defined by locale @@ -762,7 +456,7 @@ size_t e_strftime_fix_am_pm(char *s, size_t max, const char *fmt, const struct t for (sp=ffmt; (sp=strstr(sp, "%I")); sp++) { sp[1]='H'; } - ret=e_strftime(s, max, ffmt, tm); + ret=e_strftime(str, max, ffmt, tm); g_free(ffmt); } } @@ -770,38 +464,39 @@ size_t e_strftime_fix_am_pm(char *s, size_t max, const char *fmt, const struct t return(ret); } -size_t -e_utf8_strftime_fix_am_pm(char *s, size_t max, const char *fmt, const struct tm *tm) +gsize +e_utf8_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt, + const struct tm *tm) { - size_t sz, ret; - char *locale_fmt, *buf; + gsize sz, ret; + gchar *locale_fmt, *buf; locale_fmt = g_locale_from_utf8(fmt, -1, NULL, &sz, NULL); if (!locale_fmt) return 0; - ret = e_strftime_fix_am_pm(s, max, locale_fmt, tm); + ret = e_strftime_fix_am_pm(str, max, locale_fmt, tm); if (!ret) { g_free (locale_fmt); return 0; } - buf = g_locale_to_utf8(s, ret, NULL, &sz, NULL); + buf = g_locale_to_utf8(str, ret, NULL, &sz, NULL); if (!buf) { g_free (locale_fmt); return 0; } if (sz >= max) { - char *tmp = buf + max - 1; + gchar *tmp = buf + max - 1; tmp = g_utf8_find_prev_char(buf, tmp); if (tmp) sz = tmp - buf; else sz = 0; } - memcpy(s, buf, sz); - s[sz] = '\0'; + memcpy(str, buf, sz); + str[sz] = '\0'; g_free(locale_fmt); g_free(buf); return sz; @@ -827,17 +522,16 @@ e_utf8_strftime_fix_am_pm(char *s, size_t max, const char *fmt, const struct tm * Return value: the gdouble value. **/ gdouble -e_flexible_strtod (const gchar *nptr, - gchar **endptr) +e_flexible_strtod (const gchar *nptr, gchar **endptr) { gchar *fail_pos; gdouble val; struct lconv *locale_data; - const char *decimal_point; - int decimal_point_len; - const char *p, *decimal_point_pos; - const char *end = NULL; /* Silence gcc */ - char *copy, *c; + const gchar *decimal_point; + gint decimal_point_len; + const gchar *p, *decimal_point_pos; + const gchar *end = NULL; /* Silence gcc */ + gchar *copy, *c; g_return_val_if_fail (nptr != NULL, 0); @@ -929,9 +623,9 @@ e_flexible_strtod (const gchar *nptr, if (fail_pos) { if (fail_pos > decimal_point_pos) - fail_pos = (char *)nptr + (fail_pos - copy) - (decimal_point_len - 1); + fail_pos = (gchar *)nptr + (fail_pos - copy) - (decimal_point_len - 1); else - fail_pos = (char *)nptr + (fail_pos - copy); + fail_pos = (gchar *)nptr + (fail_pos - copy); } g_free (copy); @@ -965,16 +659,13 @@ e_flexible_strtod (const gchar *nptr, * Return value: The pointer to the buffer with the converted string. **/ gchar * -e_ascii_dtostr (gchar *buffer, - gint buf_len, - const gchar *format, - gdouble d) +e_ascii_dtostr (gchar *buffer, gint buf_len, const gchar *format, gdouble d) { struct lconv *locale_data; - const char *decimal_point; - int decimal_point_len; + const gchar *decimal_point; + gint decimal_point_len; gchar *p; - int rest_len; + gint rest_len; gchar format_char; g_return_val_if_fail (buffer != NULL, NULL); @@ -1040,8 +731,8 @@ e_strdup_append_strings (gchar *first_string, ...) gint length; va_list args1; va_list args2; - char *v_string; - int v_int; + gchar *v_string; + gint v_int; va_start (args1, first_string); G_VA_COPY (args2, args1); @@ -1050,32 +741,32 @@ e_strdup_append_strings (gchar *first_string, ...) v_string = first_string; while (v_string) { - v_int = va_arg (args1, int); + v_int = va_arg (args1, gint); if (v_int >= 0) length += v_int; else length += strlen (v_string); - v_string = va_arg (args1, char *); + v_string = va_arg (args1, gchar *); } - buffer = g_new (char, length + 1); + buffer = g_new (gchar, length + 1); current = buffer; v_string = first_string; while (v_string) { - v_int = va_arg (args2, int); + v_int = va_arg (args2, gint); if (v_int < 0) { - int i; + gint i; for (i = 0; v_string[i]; i++) { *(current++) = v_string[i]; } } else { - int i; + gint i; for (i = 0; v_string[i] && i < v_int; i++) { *(current++) = v_string[i]; } } - v_string = va_arg (args2, char *); + v_string = va_arg (args2, gchar *); } *(current++) = 0; @@ -1085,36 +776,10 @@ e_strdup_append_strings (gchar *first_string, ...) return buffer; } -gchar ** -e_strdupv (const gchar **str_array) -{ - if (str_array) { - gint i; - gchar **retval; - - i = 0; - while (str_array[i]) - i++; - - retval = g_new (gchar*, i + 1); - - i = 0; - while (str_array[i]) { - retval[i] = g_strdup (str_array[i]); - i++; - } - retval[i] = NULL; - - return retval; - } else { - return NULL; - } -} - cairo_font_options_t * get_font_options () { - char *antialiasing, *hinting, *subpixel_order; + gchar *antialiasing, *hinting, *subpixel_order; GConfClient *gconf = gconf_client_get_default (); cairo_font_options_t *font_options = cairo_font_options_create (); @@ -1183,7 +848,7 @@ get_font_options () * file URI. **/ void -e_file_update_save_path(char *uri, gboolean free) +e_file_update_save_path (gchar *uri, gboolean free) { GConfClient *gconf = gconf_client_get_default(); @@ -1200,11 +865,11 @@ e_file_update_save_path(char *uri, gboolean free) * the users home directory. Returns an allocated URI that should be freed by * the caller. **/ -char * -e_file_get_save_path(void) +gchar * +e_file_get_save_path (void) { GConfClient *gconf = gconf_client_get_default(); - char *uri; + gchar *uri; uri = gconf_client_get_string(gconf, "/apps/evolution/mail/save_dir", NULL); g_object_unref(gconf); diff --git a/e-util/e-util.h b/e-util/e-util.h index d0faa995d8..1d4307dab4 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -61,164 +61,74 @@ GType l##_get_type(void)\ return type; \ } - -#define E_MAKE_X_TYPE(l,str,t,ci,i,parent,poa_init,offset) \ -GtkType l##_get_type(void) \ -{ \ - static GtkType type = 0; \ - if (!type){ \ - GTypeInfo info = { \ - sizeof (t##Class), \ - \ - (GBaseInitFunc) NULL, \ - (GBaseFinalizeFunc) NULL, \ - \ - (GClassInitFunc) ci, \ - (GClassFinalizeFunc) NULL, \ - \ - NULL, /* class_data */ \ - \ - sizeof (t), \ - 0, /* n_preallocs */ \ - (GInstanceInitFunc) i, \ - }; \ - type = bonobo_x_type_unique ( \ - parent, poa_init, NULL, \ - offset, &info, str); \ - } \ - return type; \ -} - -#define GET_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \ - { \ - va_list args; \ - int i; \ - char *s; \ - \ - va_start (args, (first_string)); \ - \ - i = 0; \ - for (s = (first_string); s; s = va_arg (args, char *)) \ - i++; \ - va_end (args); \ - \ - (labels) = g_new (char *, i + 1); \ - \ - va_start (args, (first_string)); \ - i = 0; \ - for (s = (first_string); s; s = va_arg (args, char *)) \ - (labels)[i++] = s; \ - \ - va_end (args); \ - (labels)[i] = NULL; \ - } - - -#define GET_DUPLICATED_STRING_ARRAY_FROM_ELLIPSIS(labels, first_string) \ - { \ - int i; \ - GET_STRING_ARRAY_FROM_ELLIPSIS ((labels), (first_string)); \ - for (i = 0; labels[i]; i++) \ - labels[i] = g_strdup (labels[i]); \ - } - - -#if 0 -# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) \ - gtk_object_class_add_signals (oc, sigs, last) -# define E_OBJECT_CLASS_TYPE(oc) (oc)->type -#else -# define E_OBJECT_CLASS_ADD_SIGNALS(oc,sigs,last) -# define E_OBJECT_CLASS_TYPE(oc) G_TYPE_FROM_CLASS (oc) -#endif - - typedef enum { E_FOCUS_NONE, E_FOCUS_CURRENT, E_FOCUS_START, E_FOCUS_END } EFocus; -int e_str_compare (const void *x, - const void *y); -int e_str_case_compare (const void *x, - const void *y); -int e_collate_compare (const void *x, - const void *y); -int e_int_compare (const void *x, - const void *y); -char *e_strdup_strip (const char *string); -void e_free_object_list (GList *list); -void e_free_object_slist (GSList *list); -void e_free_string_list (GList *list); -void e_free_string_slist (GSList *list); -char *e_read_file (const char *filename); -int e_write_file (const char *filename, - const char *data, - int flags); -int e_write_file_uri (const char *filename, - const char *data); -int e_write_file_mkstemp (char *filename, - const char *data); - -gchar **e_strsplit (const gchar *string, - const gchar *delimiter, - gint max_tokens); -/* This only makes a filename safe for usage as a filename. It still may have shell meta-characters in it. */ -gchar *e_format_number (gint number); -gchar *e_format_number_float (gfloat number); -gboolean e_create_directory (gchar *directory); -gchar **e_strdupv (const gchar **str_array); - - -typedef int (*ESortCompareFunc) (const void *first, - const void *second, - gpointer closure); -void e_sort (void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure); -void e_bsearch (const void *key, - const void *base, - size_t nmemb, - size_t size, - ESortCompareFunc compare, - gpointer closure, - size_t *start, - size_t *end); -size_t e_strftime_fix_am_pm (char *s, - size_t max, - const char *fmt, - const struct tm *tm); - -size_t e_utf8_strftime_fix_am_pm (char *s, - size_t max, - const char *fmt, - const struct tm *tm); +gint e_str_compare (gconstpointer x, + gconstpointer y); +gint e_str_case_compare (gconstpointer x, + gconstpointer y); +gint e_collate_compare (gconstpointer x, + gconstpointer y); +gint e_int_compare (gconstpointer x, + gconstpointer y); +gint e_write_file_uri (const gchar *filename, + const gchar *data); + +/* This only makes a filename safe for usage as a filename. + * It still may have shell meta-characters in it. */ +gchar * e_format_number (gint number); +gchar * e_format_number_float (gfloat number); + +typedef gint (*ESortCompareFunc) (gconstpointer first, + gconstpointer second, + gpointer closure); + +void e_bsearch (gconstpointer key, + gconstpointer base, + gsize nmemb, + gsize size, + ESortCompareFunc compare, + gpointer closure, + gsize *start, + gsize *end); + +gsize e_strftime_fix_am_pm (gchar *str, + gsize max, + const gchar *fmt, + const struct tm *tm); +gsize e_utf8_strftime_fix_am_pm (gchar *str, + gsize max, + const gchar *fmt, + const struct tm *tm); /* String to/from double conversion functions */ -gdouble e_flexible_strtod (const gchar *nptr, - gchar **endptr); +gdouble e_flexible_strtod (const gchar *nptr, + gchar **endptr); /* 29 bytes should enough for all possible values that * g_ascii_dtostr can produce with the %.17g format. * Then add 10 for good measure */ #define E_ASCII_DTOSTR_BUF_SIZE (DBL_DIG + 12 + 10) -gchar *e_ascii_dtostr (gchar *buffer, - gint buf_len, - const gchar *format, - gdouble d); +gchar * e_ascii_dtostr (gchar *buffer, + gint buf_len, + const gchar *format, + gdouble d); /* Alternating char * and int arguments with a NULL char * to end. Less than 0 for the int means copy the whole string. */ -gchar *e_strdup_append_strings (gchar *first_string, - ...); -cairo_font_options_t * get_font_options (); +gchar * e_strdup_append_strings (gchar *first_string, + ...); + +cairo_font_options_t * get_font_options (void); -void e_file_update_save_path(char *uri, gboolean free); -char *e_file_get_save_path(void); +void e_file_update_save_path (gchar *uri, + gboolean free); +gchar * e_file_get_save_path (void); #ifdef __cplusplus } diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c index 5d83247d05..7f9f1870c8 100644 --- a/e-util/e-xml-utils.c +++ b/e-util/e-xml-utils.c @@ -36,6 +36,7 @@ #include <string.h> #include <glib.h> +#include <glib/gi18n.h> #include <glib/gstdio.h> #include <libxml/parser.h> #include <libxml/xmlmemory.h> diff --git a/e-util/eggtrayicon.c b/e-util/eggtrayicon.c index 6c4a20e96a..0c79810fa9 100644 --- a/e-util/eggtrayicon.c +++ b/e-util/eggtrayicon.c @@ -1253,8 +1253,7 @@ gtk_status_icon_init (GtkStatusIcon *status_icon) gtk_widget_show (status_icon->priv->tray_icon); status_icon->priv->tooltips = gtk_tooltips_new (); - g_object_ref (status_icon->priv->tooltips); - gtk_object_sink (GTK_OBJECT (status_icon->priv->tooltips)); + g_object_ref_sink (status_icon->priv->tooltips); #endif #ifdef GDK_WINDOWING_WIN32 diff --git a/filter/filter-label.c b/filter/filter-label.c index 6abb84eb01..9c6d578101 100644 --- a/filter/filter-label.c +++ b/filter/filter-label.c @@ -34,7 +34,6 @@ #include <glib/gi18n.h> #include <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-dialog-util.h> -#include <libgnomeui/gnome-file-entry.h> #include "filter-label.h" #include <libedataserver/e-sexp.h> diff --git a/mail/ChangeLog b/mail/ChangeLog index 75b68a8981..2b73bf38af 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,38 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * mail-tools.c (mail_tool_get_local_movemail_path): + * em-utils.c (em_utils_save_part_to_file): + * em-migrate.c (cp_r), (em_migrate_folder), + (em_migrate_pop_uid_caches_1_4), (em_migrate_folder_expand_state_1_4), + (em_migrate_folder_view_settings), (em_migrate_imap_cmeta_1_4), + (em_migrate_1_4), (emm_setup_initial), (em_migrate): + * em-folder-tree-model.c (em_folder_tree_model_save_state): + * mail-component.c (mail_component_init): + Use g_mkdir_with_parents() instead of e_util_mkdir_hier(). + + * mail-send-recv.c: + Some cosmetic refactoring. + + * mail-send-recv.c (dialog_map): + Use gtk_widget_set_size_request() instead of gtk_widget_set_usize(). + + * mail-send-recv.c (build_dialog): + e_gtk_button_new_with_icon() is dead; just do it manually. + + * em-format-html-display.c (efhd_bonobo_object): + * em-format-html.c (efh_init): + * message-list.c (message_list_init): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * em-account-prefs.c (em_account_prefs_construct): + Use g_object_ref() instead of gtk_widget_ref(). + Use g_object_unref() instead of gtk_widget_unref(). + + * em-folder-view.c (emfv_setup_view): + Use g_build_filename() instead of g_concat_dir_and_file(). + 2007-04-18 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #423766 diff --git a/mail/em-account-prefs.c b/mail/em-account-prefs.c index 7e31d637b3..64ebeaf755 100644 --- a/mail/em-account-prefs.c +++ b/mail/em-account-prefs.c @@ -566,10 +566,10 @@ em_account_prefs_construct (EMAccountPrefs *prefs) toplevel = glade_xml_get_widget (gui, "toplevel"); /* reparent */ - gtk_widget_ref (toplevel); + g_object_ref (toplevel); gtk_container_remove (GTK_CONTAINER (toplevel->parent), toplevel); gtk_container_add (GTK_CONTAINER (prefs), toplevel); - gtk_widget_unref (toplevel); + g_object_unref (toplevel); widget = glade_xml_get_widget (gui, "etableMailAccounts"); diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 2467b71a7c..aced299122 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -1054,7 +1054,7 @@ em_folder_tree_model_save_state (EMFolderTreeModel *model) return; dirname = g_path_get_dirname (model->filename); - if (e_util_mkdir_hier (dirname, 0777) == -1 && errno != EEXIST) { + if (g_mkdir_with_parents (dirname, 0777) == -1 && errno != EEXIST) { g_free (dirname); return; } diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index e45b5e37e2..78b5d00790 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -571,10 +571,10 @@ emfv_setup_view_instance(EMFolderView *emfv) safe_id = g_strdup (id); e_filename_make_safe (safe_id); filename = g_strdup_printf ("custom_wide_view-%s.xml", safe_id); - p->view_instance->custom_filename = g_concat_dir_and_file (collection->local_dir, filename); + p->view_instance->custom_filename = g_build_filename (collection->local_dir, filename, NULL); g_free (filename); filename = g_strdup_printf ("current_wide_view-%s.xml", safe_id); - p->view_instance->current_view_filename = g_concat_dir_and_file (collection->local_dir, filename); + p->view_instance->current_view_filename = g_build_filename (collection->local_dir, filename, NULL); g_free (safe_id); } g_free (id); diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index d4c7a01d11..502f9a5090 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -1982,7 +1982,7 @@ efhd_bonobo_object(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject * persist = (Bonobo_PersistStream)Bonobo_Unknown_queryInterface(bonobo_widget_get_objref((BonoboWidget *)embedded), "IDL:Bonobo/PersistStream:1.0", &ev); if (persist == CORBA_OBJECT_NIL) { - gtk_object_sink((GtkObject *)embedded); + g_object_ref_sink(embedded); CORBA_exception_free(&ev); return FALSE; } @@ -2011,7 +2011,7 @@ efhd_bonobo_object(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject * CORBA_Object_release(persist, &ev); if (ev._major != CORBA_NO_EXCEPTION) { - gtk_object_sink((GtkObject *)embedded); + g_object_ref_sink(embedded); CORBA_exception_free(&ev); return FALSE; } diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 0811e4a575..66ca8885b9 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -141,8 +141,7 @@ efh_init(GObject *o) efh->html = (GtkHTML *)gtk_html_new(); gtk_html_set_blocking(efh->html, FALSE); - g_object_ref(efh->html); - gtk_object_sink((GtkObject *)efh->html); + g_object_ref_sink(efh->html); gtk_html_set_default_content_type(efh->html, "text/html; charset=utf-8"); gtk_html_set_editable(efh->html, FALSE); diff --git a/mail/em-migrate.c b/mail/em-migrate.c index 40e1c28f6c..b6d4d7d1b8 100644 --- a/mail/em-migrate.c +++ b/mail/em-migrate.c @@ -1523,7 +1523,7 @@ cp_r (const char *src, const char *dest, const char *pattern, int mode) struct stat st; DIR *dir; - if (e_util_mkdir_hier (dest, 0777) == -1) + if (g_mkdir_with_parents (dest, 0777) == -1) return -1; if (!(dir = opendir (src))) @@ -1644,7 +1644,7 @@ em_migrate_folder(EMMigrateSession *session, const char *dirname, const char *fu slen = src->len; dlen = dest->len; - if (e_util_mkdir_hier (dest->str, 0777) == -1 && errno != EEXIST) { + if (g_mkdir_with_parents (dest->str, 0777) == -1 && errno != EEXIST) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to create new folder `%s': %s"), dest->str, g_strerror(errno)); @@ -2073,7 +2073,7 @@ em_migrate_pop_uid_caches_1_4 (const char *evolution_dir, CamelException *ex) g_free (cache_dir); cache_dir = g_build_filename (evolution_dir, "mail", "pop", NULL); - if (e_util_mkdir_hier (cache_dir, 0777) == -1) { + if (g_mkdir_with_parents (cache_dir, 0777) == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to create POP3 keep-on-server data directory `%s': %s"), cache_dir, g_strerror(errno)); @@ -2101,7 +2101,7 @@ em_migrate_pop_uid_caches_1_4 (const char *evolution_dir, CamelException *ex) /* strip the trailing '_' */ g_string_truncate (newpath, newpath->len - 1); - if (e_util_mkdir_hier (newpath->str, 0777) == -1 + if (g_mkdir_with_parents (newpath->str, 0777) == -1 || cp(oldpath->str, (g_string_append(newpath, "/uid-cache"))->str, FALSE, CP_UNIQUE)) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to copy POP3 keep-on-server data `%s': %s"), @@ -2161,7 +2161,7 @@ em_migrate_folder_expand_state_1_4 (const char *evolution_dir, CamelException *e destpath = g_string_new (evolution_dir); g_string_append (destpath, "/mail/config"); - if (e_util_mkdir_hier (destpath->str, 0777) == -1 || !(dir = opendir (srcpath->str))) { + if (g_mkdir_with_parents (destpath->str, 0777) == -1 || !(dir = opendir (srcpath->str))) { g_string_free (destpath, TRUE); g_string_free (srcpath, TRUE); return 0; @@ -2259,7 +2259,7 @@ em_migrate_folder_view_settings_1_4 (const char *evolution_dir, CamelException * destpath = g_string_new (evolution_dir); g_string_append (destpath, "/mail/views"); - if (e_util_mkdir_hier (destpath->str, 0777) == -1 || !(dir = opendir (srcpath->str))) { + if (g_mkdir_with_parents (destpath->str, 0777) == -1 || !(dir = opendir (srcpath->str))) { g_string_free (destpath, TRUE); g_string_free (srcpath, TRUE); return 0; @@ -2475,7 +2475,7 @@ em_migrate_imap_cmeta_1_4(const char *evolution_dir, CamelException *ex) url->host?url->host:""); dir = e_path_to_physical(base, path); - if (e_util_mkdir_hier(dir, 0777) == 0) { + if (g_mkdir_with_parents(dir, 0777) == 0) { char *cmeta; FILE *fp; @@ -2573,7 +2573,7 @@ em_migrate_1_4 (const char *evolution_dir, xmlDocPtr filters, xmlDocPtr vfolders path = g_strdup_printf ("mbox:%s/.evolution/mail/local", g_get_home_dir ()); if (stat (path + 5, &st) == -1) { - if (errno != ENOENT || e_util_mkdir_hier (path + 5, 0777) == -1) { + if (errno != ENOENT || g_mkdir_with_parents (path + 5, 0777) == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to create local mail storage `%s': %s"), path + 5, g_strerror (errno)); @@ -2654,7 +2654,7 @@ emm_setup_initial(const char *evolution_dir) d(printf("Setting up initial mail tree\n")); base = g_build_filename(evolution_dir, "mail", "local", NULL); - if (e_util_mkdir_hier(base, 0777) == -1 && errno != EEXIST) { + if (g_mkdir_with_parents(base, 0777) == -1 && errno != EEXIST) { g_free(base); return -1; } @@ -2704,7 +2704,7 @@ em_migrate (const char *evolution_dir, int major, int minor, int revision, Camel /* make sure ~/.evolution/mail exists */ path = g_build_filename (evolution_dir, "mail", NULL); if (g_stat (path, &st) == -1) { - if (errno != ENOENT || e_util_mkdir_hier (path, 0777) == -1) { + if (errno != ENOENT || g_mkdir_with_parents (path, 0777) == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Unable to create local mail folders at `%s': %s"), path, g_strerror (errno)); diff --git a/mail/em-utils.c b/mail/em-utils.c index 98be4854df..ab958efc12 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -479,7 +479,7 @@ em_utils_save_part_to_file(GtkWidget *parent, const char *filename, CamelMimePar return FALSE; dirname = g_path_get_dirname(filename); - if (e_util_mkdir_hier(dirname, 0777) == -1) { + if (g_mkdir_with_parents(dirname, 0777) == -1) { e_error_run((GtkWindow *)parent, "mail:no-create-path", filename, g_strerror(errno), NULL); g_free(dirname); return FALSE; diff --git a/mail/mail-component.c b/mail/mail-component.c index 4f06665fa9..c898c08e84 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -1181,7 +1181,7 @@ mail_component_init (MailComponent *component) *p++ = '/'; } #endif - if (e_util_mkdir_hier (priv->base_directory, 0777) == -1 && errno != EEXIST) + if (g_mkdir_with_parents (priv->base_directory, 0777) == -1 && errno != EEXIST) abort (); priv->model = em_folder_tree_model_new (priv->base_directory); diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 9d00ec8f58..007d09bfef 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -29,19 +29,18 @@ /* for the dialog stuff */ #include <glib.h> -#include <gtk/gtkmain.h> +#include <glib/gi18n.h> +#include <gtk/gtkbox.h> +#include <gtk/gtkbutton.h> #include <gtk/gtkdialog.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkprogressbar.h> -#include <gtk/gtktable.h> -#include <gtk/gtklabel.h> #include <gtk/gtkimage.h> -#include <gtk/gtkbox.h> +#include <gtk/gtklabel.h> +#include <gtk/gtkmain.h> +#include <gtk/gtkprogressbar.h> #include <gtk/gtkscrolledwindow.h> -#include <libgnomeui/gnome-window-icon.h> -#include <glib/gi18n.h> +#include <gtk/gtkstock.h> +#include <gtk/gtktable.h> -#include "e-util/e-gtk-utils.h" #include "libedataserver/e-account-list.h" #include "misc/e-clipped-label.h" @@ -116,9 +115,9 @@ struct _send_info { char *uri; int keep; send_state_t state; - GtkProgressBar *bar; - GtkButton *stop; - EClippedLabel *status; + GtkWidget *progress_bar; + GtkWidget *cancel_button; + GtkWidget *status_label; int again; /* need to run send again */ @@ -135,7 +134,8 @@ static CamelFolder *receive_get_folder(CamelFilterDriver *d, const char *uri, vo static struct _send_data *send_data = NULL; static GtkWidget *send_recv_dialog = NULL; -static struct _send_data *setup_send_data(void) +static struct _send_data * +setup_send_data(void) { struct _send_data *data; @@ -155,12 +155,14 @@ receive_cancel(GtkButton *button, struct _send_info *info) { if (info->state == SEND_ACTIVE) { camel_operation_cancel(info->cancel); - if (info->status) - e_clipped_label_set_text(info->status, _("Canceling...")); + if (info->status_label) + e_clipped_label_set_text ( + E_CLIPPED_LABEL (info->status_label), + _("Canceling...")); info->state = SEND_CANCELLED; } - if (info->stop) - gtk_widget_set_sensitive((GtkWidget *)info->stop, FALSE); + if (info->cancel_button) + gtk_widget_set_sensitive(info->cancel_button, FALSE); } static void @@ -173,7 +175,8 @@ free_folder_info(void *key, struct _folder_info *info, void *data) g_free(info); } -static void free_send_info(void *key, struct _send_info *info, void *data) +static void +free_send_info(void *key, struct _send_info *info, void *data) { g_free(info->uri); camel_operation_unref(info->cancel); @@ -206,16 +209,18 @@ free_send_data(void) send_data = NULL; } -static void cancel_send_info(void *key, struct _send_info *info, void *data) +static void +cancel_send_info(void *key, struct _send_info *info, void *data) { - receive_cancel(info->stop, info); + receive_cancel (GTK_BUTTON (info->cancel_button), info); } -static void hide_send_info(void *key, struct _send_info *info, void *data) +static void +hide_send_info(void *key, struct _send_info *info, void *data) { - info->stop = NULL; - info->bar = NULL; - info->status = NULL; + info->cancel_button = NULL; + info->progress_bar = NULL; + info->status_label = NULL; if (info->timeout_id != 0) { g_source_remove (info->timeout_id); @@ -252,8 +257,52 @@ dialog_response(GtkDialog *gd, int button, struct _send_data *data) } } -static void operation_status(CamelOperation *op, const char *what, int pc, void *data); -static int operation_status_timeout(void *data); +static int +operation_status_timeout(void *data) +{ + struct _send_info *info = data; + + if (info->progress_bar) { + gtk_progress_bar_set_fraction ( + GTK_PROGRESS_BAR (info->progress_bar), + info->pc / 100.0); + if (info->what) + e_clipped_label_set_text ( + E_CLIPPED_LABEL (info->status_label), + info->what); + return TRUE; + } + + return FALSE; +} + +static void +set_send_status(struct _send_info *info, const char *desc, int pc) +{ + /* FIXME: LOCK */ + g_free(info->what); + info->what = g_strdup(desc); + info->pc = pc; +} + +/* for camel operation status */ +static void +operation_status(CamelOperation *op, const char *what, int pc, void *data) +{ + struct _send_info *info = data; + + /*printf("Operation '%s', percent %d\n");*/ + switch (pc) { + case CAMEL_OPERATION_START: + pc = 0; + break; + case CAMEL_OPERATION_END: + pc = 100; + break; + } + + set_send_status(info, what, pc); +} static char * format_url(const char *internal_url, const char *account_name) @@ -283,7 +332,8 @@ format_url(const char *internal_url, const char *account_name) return pretty_url; } -static send_info_t get_receive_type(const char *url) +static send_info_t +get_receive_type(const char *url) { CamelProvider *provider; CamelException ex; @@ -312,7 +362,7 @@ static send_info_t get_receive_type(const char *url) return SEND_INVALID; } -gboolean +static gboolean dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) { int h, w; @@ -324,22 +374,26 @@ dialog_map (GtkWidget *window, GdkEvent *event, GtkWidget *table) w = 750; if (h > 400) h = 400; - gtk_widget_set_usize (window, w, h); + gtk_widget_set_size_request (window, w, h); + + return FALSE; } static struct _send_data * build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destination) { GtkDialog *gd; - GtkTable *table; + GtkWidget *table; int row, num_sources; GList *list = NULL; struct _send_data *data; - GtkWidget *send_icon, *recv_icon,*scrolled_window; - GtkLabel *label; - EClippedLabel *status_label; - GtkProgressBar *bar; - GtkButton *stop; + GtkWidget *send_icon; + GtkWidget *recv_icon; + GtkWidget *scrolled_window; + GtkWidget *label; + GtkWidget *status_label; + GtkWidget *progress_bar; + GtkWidget *cancel_button; struct _send_info *info; char *pretty_url; EAccount *account; @@ -353,9 +407,13 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati gtk_container_set_border_width ((GtkContainer *)gd->vbox, 0); gtk_container_set_border_width ((GtkContainer *)gd->action_area, 6); - stop = (GtkButton *)e_gtk_button_new_with_icon(_("Cancel _All"), GTK_STOCK_CANCEL); - gtk_widget_show((GtkWidget *)stop); - gtk_dialog_add_action_widget(gd, (GtkWidget *)stop, GTK_RESPONSE_CANCEL); + cancel_button = gtk_button_new_with_mnemonic (_("Cancel _All")); + gtk_button_set_image ( + GTK_BUTTON (cancel_button), + gtk_image_new_from_stock ( + GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON)); + gtk_widget_show (cancel_button); + gtk_dialog_add_action_widget (gd, cancel_button, GTK_RESPONSE_CANCEL); icon_list = e_icon_factory_get_icon_list ("stock_mail-send-receive"); if (icon_list) { @@ -378,20 +436,22 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati g_object_unref (iter); - table = (GtkTable *) gtk_table_new (num_sources, 4, FALSE); - gtk_container_set_border_width ((GtkContainer *) table, 6); - gtk_table_set_row_spacings (table, 6); - gtk_table_set_col_spacings (table, 6); + table = gtk_table_new (num_sources, 4, FALSE); + gtk_container_set_border_width (GTK_CONTAINER (table), 6); + gtk_table_set_row_spacings (GTK_TABLE (table), 6); + gtk_table_set_col_spacings (GTK_TABLE (table), 6); scrolled_window = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), GTK_WIDGET (table)); - gtk_box_pack_start (GTK_BOX (gd->vbox), scrolled_window,TRUE, TRUE, 0); - gtk_widget_set_usize (gd->vbox, 600,200); - gtk_widget_show (GTK_WIDGET (scrolled_window)); + gtk_scrolled_window_add_with_viewport ( + GTK_SCROLLED_WINDOW (scrolled_window), table); + gtk_box_pack_start ( + GTK_BOX (gd->vbox), scrolled_window, TRUE, TRUE, 0); + gtk_widget_set_size_request (gd->vbox, 600, 200); + gtk_widget_show (scrolled_window); /* must bet setup after send_recv_dialog as it may re-trigger send-recv button */ data = setup_send_data (); @@ -433,42 +493,57 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati g_hash_table_insert (data->active, info->uri, info); list = g_list_prepend (list, info); - } else if (info->bar != NULL) { + } else if (info->progress_bar != NULL) { /* incase we get the same source pop up again */ e_iterator_next (iter); continue; } else if (info->timeout_id == 0) info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); - recv_icon = e_icon_factory_get_image ("stock_mail-receive", E_ICON_SIZE_LARGE_TOOLBAR); + recv_icon = e_icon_factory_get_image ( + "stock_mail-receive", E_ICON_SIZE_LARGE_TOOLBAR); pretty_url = format_url (source->url, account->name); - label = (GtkLabel *)gtk_label_new (NULL); - gtk_label_set_markup (label, pretty_url); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), pretty_url); g_free (pretty_url); - bar = (GtkProgressBar *)gtk_progress_bar_new (); + progress_bar = gtk_progress_bar_new (); - stop = (GtkButton *)e_gtk_button_new_with_icon(_("Cancel"), GTK_STOCK_CANCEL); + cancel_button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); - status_label = (EClippedLabel *)e_clipped_label_new((info->type == SEND_UPDATE)?_("Updating..."):_("Waiting..."), - PANGO_WEIGHT_NORMAL, 1.0); + status_label = e_clipped_label_new ( + (info->type == SEND_UPDATE) ? + _("Updating...") : _("Waiting..."), + PANGO_WEIGHT_NORMAL, 1.0); /* g_object_set(data->label, "bold", TRUE, NULL); */ gtk_misc_set_alignment (GTK_MISC (label), 0, .5); gtk_misc_set_alignment (GTK_MISC (status_label), 0, .5); - gtk_table_attach (table, (GtkWidget *)recv_icon, 0, 1, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); - gtk_table_attach (table, (GtkWidget *)label, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); - gtk_table_attach (table, (GtkWidget *)bar, 2, 3, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); - gtk_table_attach (table, (GtkWidget *)stop, 3, 4, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); - gtk_table_attach (table, (GtkWidget *)status_label, 1, 2, row+1, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), recv_icon, + 0, 1, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), label, + 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), progress_bar, + 2, 3, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), cancel_button, + 3, 4, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), status_label, + 1, 2, row+1, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); - info->bar = bar; - info->status = status_label; - info->stop = stop; + info->progress_bar = progress_bar; + info->status_label = status_label; + info->cancel_button = cancel_button; info->data = data; - g_signal_connect (stop, "clicked", G_CALLBACK(receive_cancel), info); + g_signal_connect ( + cancel_button, "clicked", + G_CALLBACK (receive_cancel), info); e_iterator_next (iter); row = row + 2; } @@ -493,34 +568,48 @@ build_dialog (EAccountList *accounts, CamelFolder *outbox, const char *destinati } else if (info->timeout_id == 0) info->timeout_id = g_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info); - send_icon = e_icon_factory_get_image ("stock_mail-send", E_ICON_SIZE_LARGE_TOOLBAR); + send_icon = e_icon_factory_get_image ( + "stock_mail-send", E_ICON_SIZE_LARGE_TOOLBAR); pretty_url = format_url (destination, NULL); - label = (GtkLabel *)gtk_label_new (NULL); - gtk_label_set_markup (label, pretty_url); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), pretty_url); g_free (pretty_url); - bar = (GtkProgressBar *)gtk_progress_bar_new (); - stop = (GtkButton *)e_gtk_button_new_with_icon(_("Cancel"), GTK_STOCK_CANCEL); + progress_bar = gtk_progress_bar_new (); + cancel_button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); - status_label = (EClippedLabel *)e_clipped_label_new(_("Waiting..."), PANGO_WEIGHT_NORMAL, 1.0); + status_label = e_clipped_label_new ( + _("Waiting..."), PANGO_WEIGHT_NORMAL, 1.0); gtk_misc_set_alignment (GTK_MISC (label), 0, .5); gtk_misc_set_alignment (GTK_MISC (status_label), 0, .5); - gtk_table_attach (table, GTK_WIDGET (send_icon), 0, 1, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); - gtk_table_attach (table, GTK_WIDGET (label), 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); - gtk_table_attach (table, GTK_WIDGET (bar), 2, 3, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); - gtk_table_attach (table, GTK_WIDGET (stop), 3, 4, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); - gtk_table_attach (table, GTK_WIDGET (status_label), 1, 2, row+1, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), send_icon, + 0, 1, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), label, + 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), progress_bar, + 2, 3, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), cancel_button, + 3, 4, row, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), status_label, + 1, 2, row+1, row+2, GTK_EXPAND | GTK_FILL, 0, 0, 0); - info->bar = bar; - info->stop = stop; + info->progress_bar = progress_bar; + info->cancel_button = cancel_button; info->data = data; - info->status = status_label; + info->status_label = status_label; - g_signal_connect(stop, "clicked", G_CALLBACK(receive_cancel), info); - gtk_widget_show_all (GTK_WIDGET (table)); + g_signal_connect ( + cancel_button, "clicked", + G_CALLBACK (receive_cancel), info); + gtk_widget_show_all (table); } gtk_widget_show (GTK_WIDGET (gd)); @@ -554,14 +643,6 @@ update_folders(char *uri, struct _folder_info *info, void *data) } } -static void set_send_status(struct _send_info *info, const char *desc, int pc) -{ - /* FIXME: LOCK */ - g_free(info->what); - info->what = g_strdup(desc); - info->pc = pc; -} - static void receive_status (CamelFilterDriver *driver, enum camel_filter_status_t status, int pc, const char *desc, void *data) { @@ -593,38 +674,6 @@ receive_status (CamelFilterDriver *driver, enum camel_filter_status_t status, in } } -static int operation_status_timeout(void *data) -{ - struct _send_info *info = data; - - if (info->bar) { - gtk_progress_bar_set_fraction((GtkProgressBar *)info->bar, (gfloat)(info->pc/100.0)); - if (info->what) - e_clipped_label_set_text(info->status, info->what); - return TRUE; - } - - return FALSE; -} - -/* for camel operation status */ -static void operation_status(CamelOperation *op, const char *what, int pc, void *data) -{ - struct _send_info *info = data; - - /*printf("Operation '%s', percent %d\n");*/ - switch (pc) { - case CAMEL_OPERATION_START: - pc = 0; - break; - case CAMEL_OPERATION_END: - pc = 100; - break; - } - - set_send_status(info, what, pc); -} - /* when receive/send is complete */ static void receive_done (char *uri, void *data) @@ -644,21 +693,25 @@ receive_done (char *uri, void *data) return; } - if (info->bar) { - gtk_progress_bar_set_fraction((GtkProgressBar *)info->bar, (gfloat)1.0); + if (info->progress_bar) { + const gchar *text; - switch(info->state) { - case SEND_CANCELLED: - e_clipped_label_set_text(info->status, _("Canceled.")); - break; - default: + gtk_progress_bar_set_fraction( + GTK_PROGRESS_BAR (info->progress_bar), 1.0); + + if (info->state == SEND_CANCELLED) + text = _("Canceled."); + else { + text = _("Complete"); info->state = SEND_COMPLETE; - e_clipped_label_set_text(info->status, _("Complete")); } + + e_clipped_label_set_text ( + E_CLIPPED_LABEL (info->status_label), text); } - if (info->stop) - gtk_widget_set_sensitive((GtkWidget *)info->stop, FALSE); + if (info->cancel_button) + gtk_widget_set_sensitive (info->cancel_button, FALSE); /* remove/free this active download */ d(printf("%s: freeing info %p\n", G_GNUC_FUNCTION, info)); @@ -687,7 +740,7 @@ receive_get_folder(CamelFilterDriver *d, const char *uri, void *data, CamelExcep struct _send_info *info = data; CamelFolder *folder; struct _folder_info *oldinfo; - char *oldkey; + gpointer oldkey; g_mutex_lock(info->data->lock); oldinfo = g_hash_table_lookup(info->data->folders, uri); @@ -704,7 +757,7 @@ receive_get_folder(CamelFilterDriver *d, const char *uri, void *data, CamelExcep /* and we assume the newer one is the same, but unref the old one anyway */ g_mutex_lock(info->data->lock); - if (g_hash_table_lookup_extended(info->data->folders, uri, (void **)&oldkey, (void **)&oldinfo)) { + if (g_hash_table_lookup_extended(info->data->folders, uri, &oldkey, (void **)&oldinfo)) { camel_object_unref(oldinfo->folder); oldinfo->folder = folder; } else { @@ -839,7 +892,8 @@ receive_update_got_store (char *uri, CamelStore *store, void *data) } } -GtkWidget *mail_send_receive (void) +GtkWidget * +mail_send_receive (void) { CamelFolder *outbox_folder; struct _send_data *data; @@ -1056,12 +1110,12 @@ mail_receive_uri (const char *uri, int keep) info = g_malloc0 (sizeof (*info)); info->type = type; - info->bar = NULL; - info->status = NULL; + info->progress_bar = NULL; + info->status_label = NULL; info->uri = g_strdup (uri); info->keep = keep; info->cancel = camel_operation_new (operation_status, info); - info->stop = NULL; + info->cancel_button = NULL; info->data = data; info->state = SEND_ACTIVE; info->timeout_id = 0; @@ -1128,12 +1182,12 @@ mail_send (void) info = g_malloc0 (sizeof (*info)); info->type = SEND_SEND; - info->bar = NULL; - info->status = NULL; + info->progress_bar = NULL; + info->status_label = NULL; info->uri = g_strdup (transport->url); info->keep = FALSE; info->cancel = camel_operation_new (operation_status, info); - info->stop = NULL; + info->cancel_button = NULL; info->data = data; info->state = SEND_ACTIVE; info->timeout_id = 0; diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 85b149df1b..195a02fe18 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -116,7 +116,7 @@ mail_tool_get_local_movemail_path (const unsigned char *uri, CamelException *ex) *c = '_'; path = g_strdup_printf("%s/mail/spool", mail_component_peek_base_directory(NULL)); - if (g_stat(path, &st) == -1 && e_util_mkdir_hier(path, 0777) == -1) { + if (g_stat(path, &st) == -1 && g_mkdir_with_parents(path, 0777) == -1) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Could not create spool directory `%s': %s"), path, g_strerror(errno)); g_free(path); diff --git a/mail/message-list.c b/mail/message-list.c index 08d9aaabe5..71b33fb4e7 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -2043,8 +2043,7 @@ message_list_init (MessageList *message_list) p = message_list->priv = g_malloc0(sizeof(*message_list->priv)); p->invisible = gtk_invisible_new(); p->destroyed = FALSE; - g_object_ref(p->invisible); - gtk_object_sink((GtkObject *)p->invisible); + g_object_ref_sink(p->invisible); matom = gdk_atom_intern ("x-uid-list", FALSE); gtk_selection_add_target(p->invisible, GDK_SELECTION_CLIPBOARD, matom, 0); diff --git a/plugins/exchange-operations/exchange-delegates-user.c b/plugins/exchange-operations/exchange-delegates-user.c index 1cbcaed5ba..0599190ebe 100644 --- a/plugins/exchange-operations/exchange-delegates-user.c +++ b/plugins/exchange-operations/exchange-delegates-user.c @@ -32,7 +32,6 @@ #include <e-util/e-dialog-utils.h> #include <e-util/e-dialog-widgets.h> -#include <e-util/e-gtk-utils.h> #include <glade/glade.h> #include <gtk/gtkbox.h> #include <gtk/gtkdialog.h> diff --git a/plugins/exchange-operations/exchange-user-dialog.c b/plugins/exchange-operations/exchange-user-dialog.c index cfb9a4559b..b3b21093d9 100644 --- a/plugins/exchange-operations/exchange-user-dialog.c +++ b/plugins/exchange-operations/exchange-user-dialog.c @@ -27,7 +27,6 @@ #include <bonobo-activation/bonobo-activation.h> #include <bonobo/bonobo-exception.h> #include <bonobo/bonobo-widget.h> -#include <e-util/e-gtk-utils.h> #include <e-util/e-dialog-utils.h> #include <gtk/gtkbutton.h> #include <gtk/gtkhbox.h> diff --git a/plugins/groupwise-features/ChangeLog b/plugins/groupwise-features/ChangeLog index bf8304d5b7..603fb87899 100644 --- a/plugins/groupwise-features/ChangeLog +++ b/plugins/groupwise-features/ChangeLog @@ -1,3 +1,10 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * status-track.c (track_status): + Use gtk_widget_set_size_request() instead of gtk_widget_set_usize(). + 2007-03-30 Sankar P <psankar@novell.com> * status-track.c: (format_date), (track_status): diff --git a/plugins/groupwise-features/status-track.c b/plugins/groupwise-features/status-track.c index f3abf9bc24..e25b63c148 100644 --- a/plugins/groupwise-features/status-track.c +++ b/plugins/groupwise-features/status-track.c @@ -229,7 +229,7 @@ track_status (EPopup *ep, EPopupItem *item, void *data) } /*set size and display the dialog*/ - gtk_widget_set_usize (GTK_WIDGET (win), 400, 300); + gtk_widget_set_size_request (GTK_WIDGET (win), 400, 300); gtk_widget_show_all (GTK_WIDGET (d)); if (gtk_dialog_run (d) == GTK_RESPONSE_OK) gtk_widget_destroy (GTK_WIDGET (d)); diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog index d74387a828..c91e6b9927 100644 --- a/plugins/itip-formatter/ChangeLog +++ b/plugins/itip-formatter/ChangeLog @@ -1,3 +1,13 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * itip-view.c (set_one_button): + e_gtk_button_new_with_icon() is dead; just do it manually. + + * itip-view.c (itip_view_class_init): + Use g_cclosure_marshal_VOID__INT instead of gtk_marshal_NONE__INT. + 2007-03-29 Matthew Barnes <mbarnes@redhat.com> * itip-formatter.c: diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index 0a20ea43d3..63fa11211e 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -43,7 +43,6 @@ #include <mail/em-format-html.h> #include <libedataserver/e-account-list.h> #include <e-util/e-icon-factory.h> -#include <e-util/e-gtk-utils.h> #include <e-util/e-util.h> #include <calendar/gui/itip-utils.h> #include "itip-view.h" @@ -729,15 +728,23 @@ set_one_button (ItipView *view, char *label, char *stock_id, ItipViewResponse re { ItipViewPrivate *priv; GtkWidget *button; + GtkWidget *image; + gpointer data; priv = view->priv; - button = e_gtk_button_new_with_icon (label, stock_id); - g_object_set_data (G_OBJECT (button), DATA_RESPONSE_KEY, GINT_TO_POINTER (response)); + button = gtk_button_new_with_mnemonic (label); + image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (button, image); + + data = GINT_TO_POINTER (response); + g_object_set_data (button, DATA_RESPONSE_KEY, data); + gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (priv->button_box), button); - g_signal_connect (button, "clicked", G_CALLBACK (button_clicked_cb), view); + g_signal_connect ( + button, "clicked", G_CALLBACK (button_clicked_cb), view); } static void @@ -852,7 +859,7 @@ itip_view_class_init (ItipViewClass *klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ItipViewClass, response), NULL, NULL, - gtk_marshal_NONE__INT, + g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); } diff --git a/plugins/startup-wizard/startup-wizard.c b/plugins/startup-wizard/startup-wizard.c index f3cfb2ac39..61739d4def 100644 --- a/plugins/startup-wizard/startup-wizard.c +++ b/plugins/startup-wizard/startup-wizard.c @@ -24,7 +24,6 @@ #include <libgnomeui/libgnomeui.h> #include "widgets/e-timezone-dialog/e-timezone-dialog.h" #include "e-util/e-icon-factory.h" -#include "e-util/e-gtk-utils.h" #include "e-util/e-error.h" #include "e-util/e-import.h" #include "shell/es-event.h" diff --git a/shell/ChangeLog b/shell/ChangeLog index cd3b213915..a24d62a802 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,25 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * e-shell.c (impl_finalize): + e_free_string_list() is dead; just do it manually. + + * e-user-creatable-items-handler.c (setup_toolbar_button): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * e-shell-importer.c: + Drop support for GnomeFileEntry. + + * importer/intelligent.c (create_gui): + Use g_object_ref() instead of gtk_widget_ref(). + + * e-history.c (e_history_init): + Clear the floating flag without using GTK_OBJECT_UNSET_FLAGS(). + + * e-shell-settings-dialog.c: + Include missing header file(s). + 2007-03-29 Matthew Barnes <mbarnes@redhat.com> * e-shell-window.c: diff --git a/shell/e-history.c b/shell/e-history.c index e279fb81bc..ebe412b8d9 100644 --- a/shell/e-history.c +++ b/shell/e-history.c @@ -79,7 +79,10 @@ e_history_init (EHistory *history) history->priv = priv; - GTK_OBJECT_UNSET_FLAGS (history, GTK_FLOATING); + /* XXX I guess just clear the floating flag. */ + /* GTK_OBJECT_UNSET_FLAGS (history, GTK_FLOATING); */ + g_object_ref_sink (history); + g_object_unref (history); } diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c index 29946319be..6e0a076e97 100644 --- a/shell/e-shell-importer.c +++ b/shell/e-shell-importer.c @@ -38,7 +38,6 @@ #include <libgnomeui/gnome-druid.h> #include <libgnomeui/gnome-druid-page-edge.h> #include <libgnomeui/gnome-druid-page-standard.h> -#include <libgnomeui/gnome-file-entry.h> #include <gtk/gtkfilechooserbutton.h> @@ -46,7 +45,6 @@ #include "e-util/e-dialog-utils.h" #include "e-util/e-error.h" -#include "e-util/e-gtk-utils.h" #include "e-util/e-icon-factory.h" #include "e-util/e-import.h" #include "e-util/e-util-private.h" @@ -188,11 +186,7 @@ filename_changed (GtkWidget *widget, page = data->filepage; -#ifdef USE_GTKFILECHOOSER filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget)); -#else - filename = gtk_entry_get_text ((GtkEntry *) gnome_file_entry_get_entry ((GnomeFileEntry *)widget)); -#endif fileok = filename && filename[0] && g_file_test(filename, G_FILE_TEST_IS_REGULAR); if (fileok) { @@ -293,16 +287,8 @@ importer_file_page_new (ImportData *data) GTK_FILL, 0, 0, 0); gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); -#ifdef USE_GTKFILECHOOSER page->filename = gtk_file_chooser_button_new (_("Select a file"), GTK_FILE_CHOOSER_ACTION_OPEN); g_signal_connect (GTK_FILE_CHOOSER_BUTTON (page->filename), "selection-changed", G_CALLBACK (filename_changed), data); -#else - page->filename = gnome_file_entry_new ("Evolution_Importer_FileName", _("Select a file")); - g_object_set (G_OBJECT (page->filename), "use_filechooser", TRUE, NULL); - entry = gnome_file_entry_gtk_entry((GnomeFileEntry *)page->filename); - g_signal_connect (entry, "changed", G_CALLBACK (filename_changed), data); - gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); -#endif gtk_table_attach (GTK_TABLE (table), page->filename, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); diff --git a/shell/e-shell-settings-dialog.c b/shell/e-shell-settings-dialog.c index 67dc214b41..9f3f24e2a2 100644 --- a/shell/e-shell-settings-dialog.c +++ b/shell/e-shell-settings-dialog.c @@ -25,6 +25,8 @@ #include <config.h> #endif +#include <glib/gi18n.h> + #include "e-shell-settings-dialog.h" #include "e-corba-config-page.h" @@ -170,7 +172,7 @@ load_pages (EShellSettingsDialog *dialog) language_names = g_get_language_names (); while (*language_names != NULL) - languages = g_list_append (languages, *language_names++); + languages = g_slist_append (languages, *language_names++); page_list = NULL; for (i = 0; i < control_list->_length; i ++) { diff --git a/shell/e-shell.c b/shell/e-shell.c index 95eb91078a..c6b380a1ec 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -474,7 +474,8 @@ impl_finalize (GObject *object) shell = E_SHELL (object); priv = shell->priv; - e_free_string_list (priv->crash_type_names); + g_list_foreach (priv->crash_type_names, (GFunc) g_free, NULL); + g_list_free (priv->crash_type_names); g_free (priv); diff --git a/shell/e-user-creatable-items-handler.c b/shell/e-user-creatable-items-handler.c index 11e859d867..392f2ab3b7 100644 --- a/shell/e-user-creatable-items-handler.c +++ b/shell/e-user-creatable-items-handler.c @@ -753,8 +753,7 @@ setup_toolbar_button (EUserCreatableItemsHandler *handler) gtk_widget_show (priv->new_button); priv->tooltips = gtk_tooltips_new (); - gtk_object_ref (GTK_OBJECT (priv->tooltips)); - gtk_object_sink (GTK_OBJECT (priv->tooltips)); + g_object_ref_sink (priv->tooltips); gtk_tooltips_set_tip (priv->tooltips, priv->new_button, priv->default_menu_item->tooltip, NULL); g_free (val); diff --git a/shell/importer/intelligent.c b/shell/importer/intelligent.c index e6130a26e7..f1cffb82aa 100644 --- a/shell/importer/intelligent.c +++ b/shell/importer/intelligent.c @@ -343,7 +343,7 @@ create_gui (GList *importers) /* Ref this widget so even if we remove it from the containers it will always have an extra ref. */ gtk_widget_show (data->widget); - gtk_widget_ref (data->widget); + g_object_ref (data->widget); } else { data->widget = gtk_label_new (""); } diff --git a/shell/main.c b/shell/main.c index b8ac07f92f..f9b59170f7 100644 --- a/shell/main.c +++ b/shell/main.c @@ -26,7 +26,6 @@ #include <glib/gstdio.h> #include "e-util/e-dialog-utils.h" -#include "e-util/e-gtk-utils.h" #include "e-util/e-bconf-map.h" #include <e-util/e-icon-factory.h> diff --git a/smime/ChangeLog b/smime/ChangeLog index fa82bf49f5..5c8d1c9945 100644 --- a/smime/ChangeLog +++ b/smime/ChangeLog @@ -1,3 +1,10 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * gui/certificate-manager.c (certificate_manager_config_control_new): + Use g_object_ref() instead of gtk_widget_ref(). + 2007-03-20 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #419524 diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index 3db0daf1c3..b324ad78dd 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -1008,7 +1008,7 @@ certificate_manager_config_control_new (void) populate_ui (cfm_data); control_widget = glade_xml_get_widget (cfm_data->gui, "cert-manager-notebook"); - gtk_widget_ref (control_widget); + g_object_ref (control_widget); gtk_container_remove (GTK_CONTAINER (control_widget->parent), control_widget); diff --git a/widgets/ChangeLog b/widgets/ChangeLog index 391b928373..06bb844447 100644 --- a/widgets/ChangeLog +++ b/widgets/ChangeLog @@ -1,3 +1,58 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * text/e-text-model-uri.c (e_text_model_uri_dispose), + (objectify_idle_flush): + Use g_source_remove() instead of gtk_idle_remove(). + + * text/e-text-model-uri.c (e_text_model_uri_objectify): + Use g_idle_add() instead of gtk_idle_add(). + + * text/e-text.c (e_text_dispose), (e_text_event): + * text/e-entry.c (e_entry_text_keypress), (proxy_changed), + (e_entry_cancel_delayed_completion), (e_entry_dispose): + Use g_source_remove() instead of gtk_timeout_remove(). + + * text/e-text.c (e_text_event): + * text/e-entry.c (proxy_changed), (e_entry_start_delayed_completion): + * e-timezone-dialog/e-timezone-dialog.c (on_map_visibility_changed): + Use g_timeout_add() instead of gtk_timeout_add(). + + * text/e-completion-view.c (e_completion_view_set_width): + * text/e-text.c (_do_tooltip): + Use gtk_widget_set_size_request() instead of gtk_widget_set_usize(). + + * text/e-completion-callbacks.c (e_completion_callbacks_new): + Use g_object_new() instead of gtk_type_new(). + + * text/e-entry.c (e_entry_enable_completion_full): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * text/e-entry.c (e_entry_class_init): + Use g_cclosure_marshal_VOID__INT instead of gtk_marshal_NONE__INT. + + * menus/gal-view-new-dialog.c (gal_view_new_dialog_init): + * menus/gal-view-instance-save-as-dialog.c + (gal_view_instance_save_as_dialog_init): + * menus/gal-define-views-dialog.c (gal_define_views_dialog_init): + Use g_object_ref() instead of gtk_widget_ref(). + Use g_object_unref() instead of gtk_widget_unref(). + + * menus/gal-view-collection.c (gal_view_collection_dispose): + e_free_object_list() is dead; just do it manually. + + * menus/gal-view-collection.c (load_single_file), (load_single_dir), + (gal_view_collection_save): + * menus/gal-view-instance.c (gal_view_instance_construct): + Use g_build_filename() instead of g_concat_dir_and_file(). + + * menus/gal-view-collection.c (gal_view_collection_load): + Use g_mkdir_with_parents() instead of e_create_directory(). + + * e-timezone-dialog/e-timezone-dialog.c (e_timezone_dialog_construct): + Use gtk_editable_set_editable() instead of gtk_entry_set_editable(). + 2007-03-20 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #419524 diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c index 66bd67bc46..291ea500ee 100644 --- a/widgets/e-timezone-dialog/e-timezone-dialog.c +++ b/widgets/e-timezone-dialog/e-timezone-dialog.c @@ -24,6 +24,8 @@ #include <config.h> #endif +#include <string.h> +#include <glib/gi18n.h> #include <gtk/gtksignal.h> #include <gtk/gtkcombo.h> #include <gtk/gtkentry.h> @@ -277,7 +279,7 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) | GDK_LEAVE_NOTIFY_MASK | GDK_VISIBILITY_NOTIFY_MASK); - gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry), FALSE); + gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->timezone_combo)->entry), FALSE); e_timezone_dialog_add_timezones (etd); @@ -547,7 +549,7 @@ on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, /* Map is visible, at least partly, so make sure we flash the selected point. */ if (!priv->timeout_id) - priv->timeout_id = gtk_timeout_add (100, on_map_timeout, etd); + priv->timeout_id = g_timeout_add (100, on_map_timeout, etd); } else { /* Map is invisible, so don't waste resources on the timeout.*/ if (priv->timeout_id) { diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 104e706b6d..3630780817 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -258,12 +258,12 @@ gal_define_views_dialog_init (GalDefineViewsDialog *dialog) if (!widget) { return; } - gtk_widget_ref(widget); + g_object_ref(widget); gtk_container_remove (GTK_CONTAINER (widget->parent), widget); gtk_window_set_default_size(GTK_WINDOW(dialog), 360, 270); gtk_container_set_border_width(GTK_CONTAINER(dialog), 6); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); - gtk_widget_unref(widget); + g_object_unref(widget); gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, diff --git a/widgets/menus/gal-view-collection.c b/widgets/menus/gal-view-collection.c index 848b789235..36f9cea25c 100644 --- a/widgets/menus/gal-view-collection.c +++ b/widgets/menus/gal-view-collection.c @@ -166,7 +166,10 @@ gal_view_collection_dispose (GObject *object) collection->view_data = NULL; collection->view_count = 0; - e_free_object_list (collection->factory_list); + g_list_foreach ( + collection->factory_list, + (GFunc) g_object_unref, NULL); + g_list_free (collection->factory_list); collection->factory_list = NULL; for (i = 0; i < collection->removed_view_count; i++) { @@ -375,7 +378,7 @@ load_single_file (GalViewCollection *collection, if (item->filename) { char *fullpath; - fullpath = g_concat_dir_and_file(dir, item->filename); + fullpath = g_build_filename(dir, item->filename, NULL); item->view = gal_view_collection_real_load_view_from_file (collection, item->type, item->title, dir, fullpath); g_free(fullpath); if (item->view) { @@ -395,7 +398,7 @@ load_single_dir (GalViewCollection *collection, xmlDoc *doc = NULL; xmlNode *root; xmlNode *child; - char *filename = g_concat_dir_and_file(dir, "galview.xml"); + char *filename = g_build_filename(dir, "galview.xml", NULL); char *default_view; if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) { @@ -488,7 +491,7 @@ gal_view_collection_load (GalViewCollection *collection) g_return_if_fail (collection->system_dir != NULL); g_return_if_fail (!collection->loaded); - if ((e_create_directory(collection->local_dir) == -1) && (errno != EEXIST)) + if ((g_mkdir_with_parents (collection->local_dir, 0777) == -1) && (errno != EEXIST)) g_warning ("Unable to create dir %s: %s", collection->local_dir, g_strerror(errno)); load_single_dir(collection, collection->local_dir, TRUE); @@ -539,7 +542,7 @@ gal_view_collection_save (GalViewCollection *collection) e_xml_set_string_prop_by_name(child, "type", item->type); if (item->changed) { - filename = g_concat_dir_and_file(collection->local_dir, item->filename); + filename = g_build_filename(collection->local_dir, item->filename, NULL); gal_view_save(item->view, filename); g_free(filename); } @@ -556,7 +559,7 @@ gal_view_collection_save (GalViewCollection *collection) e_xml_set_string_prop_by_name(child, "title", item->title); e_xml_set_string_prop_by_name(child, "type", item->type); } - filename = g_concat_dir_and_file(collection->local_dir, "galview.xml"); + filename = g_build_filename(collection->local_dir, "galview.xml", NULL); if (e_xml_save_file (filename, doc) == -1) g_warning ("Unable to save view to %s - %s", filename, g_strerror(errno)); xmlFreeDoc(doc); diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c index 663097567f..622b99a049 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.c +++ b/widgets/menus/gal-view-instance-save-as-dialog.c @@ -205,10 +205,10 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog) if (!widget) { return; } - gtk_widget_ref(widget); + g_object_ref(widget); gtk_container_remove (GTK_CONTAINER (widget->parent), widget); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); - gtk_widget_unref(widget); + g_object_unref(widget); gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, diff --git a/widgets/menus/gal-view-instance.c b/widgets/menus/gal-view-instance.c index df84a38948..821a299afb 100644 --- a/widgets/menus/gal-view-instance.c +++ b/widgets/menus/gal-view-instance.c @@ -349,11 +349,11 @@ gal_view_instance_construct (GalViewInstance *instance, GalViewCollection *colle e_filename_make_safe (safe_id); filename = g_strdup_printf ("custom_view-%s.xml", safe_id); - instance->custom_filename = g_concat_dir_and_file (instance->collection->local_dir, filename); + instance->custom_filename = g_build_filename (instance->collection->local_dir, filename, NULL); g_free (filename); filename = g_strdup_printf ("current_view-%s.xml", safe_id); - instance->current_view_filename = g_concat_dir_and_file (instance->collection->local_dir, filename); + instance->current_view_filename = g_build_filename (instance->collection->local_dir, filename, NULL); g_free (filename); g_free (safe_id); diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index a256baccdb..c41ce03123 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -100,10 +100,10 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog) if (!widget) { return; } - gtk_widget_ref(widget); + g_object_ref(widget); gtk_container_remove (GTK_CONTAINER (widget->parent), widget); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), widget, TRUE, TRUE, 0); - gtk_widget_unref(widget); + g_object_unref(widget); gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index de72bfed87..2c2f245a68 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,76 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * e-combo-cell-editable.c (ecce_init): + * e-dateedit.c (e_date_edit_set_editable): + Use gtk_editable_set_editable() instead of gtk_entry_set_editable(). + + * e-dateedit.c (create_children): + * e-cell-date-edit.c (e_cell_date_edit_init): + Use gtk_box_set_spacing() instead of gtk_button_box_set_spacing(). + Remove gtk_button_box_set_child_ipadding() and + gtk_button_box_set_child_size(). Use style properties instead. + + * e-clipped-label.c (e_clipped_label_new): + * e-combo-button.c (e_combo_button_new): + * e-config-page.c (e_config_page_init): + * e-multi-config-dialog.c (e_multi_config_dialog_init): + * e-dropdown-button.c (e_dropdown_button_new): + * e-cell-date-edit.c (e_cell_date_edit_new): + * e-filter-bar.c (e_filter_bar_new): + * e-url-entry.c (mnemonic_activate): + * e-map.c (e_map_new): + * e-search-bar.c (e_search_bar_new): + * e-calendar.c (e_calendar_new): + Use g_object_new() instead of gtk_type_new(). + + * test-calendar.c (main): + * test-info-label.c (main): + * test-multi-config-dialog.c (main): + * test-dropdown-button.c (main): + Use gnome_program_init() instead of gnome_init(). + + * e-combo-button.c (impl_released): + Replace gtk_widget_draw() with GTK's 2-line implementation. + + * e-multi-config-dialog.c (set_page_timeout_callback), + (e_multi_config_dialog_show_page): + Use gtk_notebook_set_current_page() instead of + gtk_notebook_set_page(). + + * e-dropdown-button.c (impl_destroy): + Use g_object_unref() instead of gtk_accel_group_unref(). + + * e-cell-percent.c (show_percent_warning): + * e-cell-date-edit.c (e_cell_date_edit_show_time_invalid_warning): + Use GtkMessageDialog instead of GnomeMessageDialog. + + * e-cell-date-edit.c (e_cell_date_edit_select_matching_time), + (e_cell_date_edit_on_time_selected): + Use gtk_label_get_text() instead of gtk_label_get(). + + * e-filter-bar.c (class_init): + * gal-combo-box.c (gal_combo_box_init), (gtk_combo_popup_tear_off), + (gtk_combo_popup_reparent): + * e-map.c (e_map_set_scroll_adjustments): + * e-task-widget.c (e_task_widget_construct): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * gal-combo-box.c (gtk_combo_tearoff_bg_copy), + (gtk_combo_popup_reparent): + * gal-combo-text.c (gal_combo_text_construct): + Use gtk_widget_set_size_request() instead of gtk_widget_set_usize(). + + * test-dropdown-button.c: + Use GTK_STOCK_* constants instead of GNOME_STOCK_*. + + * e-calendar.c (e_calendar_init): + Use g_signal_connect_swapped() instead of gtk_signal_connect_object(). + + * e-calendar.c (e_calendar_destroy), (e_calendar_stop_auto_move): + Use g_source_remove() instead of gtk_timeout_remove(). + 2007-04-11 Srinivasa Ragavan <sragavan@novell.com> ** Added spinner widgets. diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index 7933998445..741bdfb19d 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -155,15 +155,15 @@ e_calendar_init (ECalendar *cal) button = gtk_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_widget_show (button); - gtk_signal_connect_object (GTK_OBJECT (button), "pressed", - G_CALLBACK (e_calendar_on_prev_pressed), - GTK_OBJECT (cal)); - gtk_signal_connect_object (GTK_OBJECT (button), "released", - G_CALLBACK (e_calendar_on_prev_released), - GTK_OBJECT (cal)); - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - G_CALLBACK (e_calendar_on_prev_clicked), - GTK_OBJECT (cal)); + g_signal_connect_swapped ( + button, "pressed", + G_CALLBACK (e_calendar_on_prev_pressed), cal); + g_signal_connect_swapped ( + button, "released", + G_CALLBACK (e_calendar_on_prev_released), cal); + g_signal_connect_swapped ( + button, "clicked", + G_CALLBACK (e_calendar_on_prev_clicked), cal); pixmap = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE); gtk_widget_show (pixmap); @@ -179,15 +179,15 @@ e_calendar_init (ECalendar *cal) button = gtk_button_new (); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_widget_show (button); - gtk_signal_connect_object (GTK_OBJECT (button), "pressed", - G_CALLBACK (e_calendar_on_next_pressed), - GTK_OBJECT (cal)); - gtk_signal_connect_object (GTK_OBJECT (button), "released", - G_CALLBACK (e_calendar_on_next_released), - GTK_OBJECT (cal)); - gtk_signal_connect_object (GTK_OBJECT (button), "clicked", - G_CALLBACK (e_calendar_on_next_clicked), - GTK_OBJECT (cal)); + g_signal_connect_swapped ( + button, "pressed", + G_CALLBACK (e_calendar_on_next_pressed), cal); + g_signal_connect_swapped ( + button, "released", + G_CALLBACK (e_calendar_on_next_released), cal); + g_signal_connect_swapped ( + button, "clicked", + G_CALLBACK (e_calendar_on_next_clicked), cal); pixmap = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE); gtk_widget_show (pixmap); @@ -221,7 +221,7 @@ e_calendar_new (void) GtkWidget *cal; AtkObject *a11y; - cal = gtk_type_new (e_calendar_get_type ()); + cal = g_object_new (e_calendar_get_type (), NULL); a11y = gtk_widget_get_accessible (cal); atk_object_set_name (a11y, _("Month Calendar")); @@ -240,7 +240,7 @@ e_calendar_destroy (GtkObject *object) cal = E_CALENDAR (object); if (cal->timeout_id != 0) { - gtk_timeout_remove (cal->timeout_id); + g_source_remove (cal->timeout_id); cal->timeout_id = 0; } @@ -514,7 +514,7 @@ static void e_calendar_stop_auto_move (ECalendar *cal) { if (cal->timeout_id != 0) { - gtk_timeout_remove (cal->timeout_id); + g_source_remove (cal->timeout_id); cal->timeout_id = 0; } } diff --git a/widgets/misc/e-cell-date-edit.c b/widgets/misc/e-cell-date-edit.c index f8a4f134a2..14691b99b6 100644 --- a/widgets/misc/e-cell-date-edit.c +++ b/widgets/misc/e-cell-date-edit.c @@ -224,9 +224,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) bbox = gtk_hbutton_box_new (); gtk_container_set_border_width (GTK_CONTAINER (bbox), 4); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), 2); - gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (bbox), 2, 0); - gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), 0, 0); + gtk_box_set_spacing (GTK_BOX (bbox), 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0); gtk_widget_show (bbox); @@ -283,9 +281,7 @@ e_cell_date_edit_init (ECellDateEdit *ecde) ECell * e_cell_date_edit_new (void) { - ECellDateEdit *ecde = gtk_type_new (e_cell_date_edit_get_type ()); - - return (ECell*) ecde; + return g_object_new (e_cell_date_edit_get_type (), NULL); } @@ -513,14 +509,14 @@ e_cell_date_edit_select_matching_time (ECellDateEdit *ecde, GtkWidget *listitem, *label; GList *elem; gboolean found = FALSE; - char *list_item_text; + const gchar *list_item_text; list = GTK_LIST (ecde->time_list); elem = list->children; while (elem) { listitem = GTK_WIDGET (elem->data); label = GTK_BIN (listitem)->child; - gtk_label_get (GTK_LABEL (label), &list_item_text); + list_item_text = gtk_label_get_text (GTK_LABEL (label)); if (!strcmp (list_item_text, time)) { found = TRUE; @@ -777,7 +773,7 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) { GtkWidget *dialog; struct tm date_tm; - char buffer[64], *message; + char buffer[64]; /* Create a useful error message showing the correct format. */ date_tm.tm_year = 100; @@ -790,18 +786,16 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) e_time_format_time (&date_tm, ecde->use_24_hour_format, FALSE, buffer, sizeof (buffer)); - message = g_strdup_printf (_("The time must be in the format: %s"), - buffer); - - dialog = gnome_message_box_new (message, GNOME_MESSAGE_BOX_ERROR, - GNOME_STOCK_BUTTON_OK, NULL); /* FIXME: Fix transient settings - I'm not sure it works with popup windows. Maybe we need to use a normal window without decorations.*/ - gtk_window_set_transient_for (GTK_WINDOW (dialog), - GTK_WINDOW (ecde->popup_window)); - gnome_dialog_run (GNOME_DIALOG (dialog)); - - g_free (message); + dialog = gtk_message_dialog_new ( + GTK_WINDOW (ecde->popup_window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + _("The time must be in the format: %s"), + buffer); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); } @@ -899,14 +893,14 @@ e_cell_date_edit_on_time_selected (GtkList *list, ECellDateEdit *ecde) { GtkWidget *listitem, *label; - char *list_item_text; + const gchar *list_item_text; if (!list->selection) return; listitem = list->selection->data; label = GTK_BIN (listitem)->child; - gtk_label_get (GTK_LABEL (label), &list_item_text); + list_item_text = gtk_label_get_text (GTK_LABEL (label)); gtk_entry_set_text (GTK_ENTRY (ecde->time_entry), list_item_text); } diff --git a/widgets/misc/e-cell-percent.c b/widgets/misc/e-cell-percent.c index 76b4ffc06f..d50d0924b8 100644 --- a/widgets/misc/e-cell-percent.c +++ b/widgets/misc/e-cell-percent.c @@ -73,10 +73,12 @@ show_percent_warning (void) { GtkWidget *dialog; - dialog = gnome_message_box_new (_("The percent value must be between 0 and 100, inclusive"), - GNOME_MESSAGE_BOX_ERROR, - GNOME_STOCK_BUTTON_OK, NULL); - gtk_widget_show (dialog); + dialog = gtk_message_dialog_new ( + NULL, 0, + GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + _("The percent value must be between 0 and 100, inclusive")); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); } static void diff --git a/widgets/misc/e-clipped-label.c b/widgets/misc/e-clipped-label.c index 98e3ecf62e..0338f8529c 100644 --- a/widgets/misc/e-clipped-label.c +++ b/widgets/misc/e-clipped-label.c @@ -138,7 +138,7 @@ e_clipped_label_new (const gchar *text, GtkWidget *label; EClippedLabel *clipped; - label = GTK_WIDGET (gtk_type_new (e_clipped_label_get_type ())); + label = g_object_new (e_clipped_label_get_type (), NULL); clipped = E_CLIPPED_LABEL (label); diff --git a/widgets/misc/e-combo-button.c b/widgets/misc/e-combo-button.c index 6a8bebb8ee..08da2c1eac 100644 --- a/widgets/misc/e-combo-button.c +++ b/widgets/misc/e-combo-button.c @@ -399,7 +399,11 @@ impl_released (GtkButton *button) /* We _draw () instead of queue_draw so that if the operation blocks, the label doesn't vanish. */ - gtk_widget_draw (GTK_WIDGET (button), NULL); + /* XXX gtk_widget_draw() is deprecated. + * Replace it with GTK's implementation. */ + gtk_widget_queue_draw (GTK_WIDGET (button)); + gdk_window_process_updates ( + GTK_WIDGET (button)->window, TRUE); } } } @@ -542,7 +546,7 @@ e_combo_button_new (void) { EComboButton *new; - new = gtk_type_new (e_combo_button_get_type ()); + new = g_object_new (e_combo_button_get_type (), NULL); e_combo_button_construct (new); return GTK_WIDGET (new); diff --git a/widgets/misc/e-combo-cell-editable.c b/widgets/misc/e-combo-cell-editable.c index 5a39974f17..dc20ede481 100644 --- a/widgets/misc/e-combo-cell-editable.c +++ b/widgets/misc/e-combo-cell-editable.c @@ -327,7 +327,7 @@ ecce_init (EComboCellEditable *ecce) entry = gtk_entry_new (); ecce->priv->entry = GTK_ENTRY (entry); gtk_entry_set_has_frame (ecce->priv->entry, FALSE); - gtk_entry_set_editable (ecce->priv->entry, FALSE); + gtk_editable_set_editable (GTK_EDITABLE (ecce->priv->entry), FALSE); g_signal_connect (entry, "activate", G_CALLBACK (entry_activated_cb), ecce); g_signal_connect (entry, "key_press_event", G_CALLBACK (entry_key_press_event_cb), ecce); gtk_widget_show (entry); diff --git a/widgets/misc/e-config-page.c b/widgets/misc/e-config-page.c index 7b3f288431..df8dcd023c 100644 --- a/widgets/misc/e-config-page.c +++ b/widgets/misc/e-config-page.c @@ -44,7 +44,7 @@ e_config_page_init (EConfigPage *page) GtkWidget * e_config_page_new (void) { - return gtk_type_new (e_config_page_get_type ()); + return g_object_new (e_config_page_get_type (), NULL); } diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 9706632c6e..a3e8dc21d8 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -452,9 +452,7 @@ create_children (EDateEdit *dedit) bbox = gtk_hbutton_box_new (); gtk_container_set_border_width (GTK_CONTAINER (bbox), 4); - gtk_button_box_set_spacing (GTK_BUTTON_BOX (bbox), 2); - gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (bbox), 2, 0); - gtk_button_box_set_child_size (GTK_BUTTON_BOX (bbox), 0, 0); + gtk_box_set_spacing (GTK_BOX (bbox), 2); gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0); gtk_widget_show (bbox); @@ -547,7 +545,7 @@ e_date_edit_set_editable (EDateEdit *dedit, gboolean editable) priv = dedit->priv; - gtk_entry_set_editable (GTK_ENTRY (priv->date_entry), editable); + gtk_editable_set_editable (GTK_EDITABLE (priv->date_entry), editable); gtk_widget_set_sensitive (priv->date_button, editable); } diff --git a/widgets/misc/e-dateedit.h b/widgets/misc/e-dateedit.h index c8ee3f2832..cfd64e86bd 100644 --- a/widgets/misc/e-dateedit.h +++ b/widgets/misc/e-dateedit.h @@ -76,7 +76,7 @@ struct _EDateEditClass { GType e_date_edit_get_type (void); GtkWidget* e_date_edit_new (void); -/* Analogous to gtk_entry_set_editable. disable editing, while still +/* Analogous to gtk_editable_set_editable. disable editing, while still allowing selection. */ void e_date_edit_set_editable (EDateEdit *dedit, gboolean editable); diff --git a/widgets/misc/e-dropdown-button.c b/widgets/misc/e-dropdown-button.c index f939175661..0b0f9e25c3 100644 --- a/widgets/misc/e-dropdown-button.c +++ b/widgets/misc/e-dropdown-button.c @@ -30,7 +30,9 @@ #include <stdio.h> #include <gtk/gtkarrow.h> +#include <gtk/gtkhbox.h> #include <gtk/gtklabel.h> +#include <gtk/gtksignal.h> #include <gtk/gtkwidget.h> #include <libgnomeui/gnome-popup-menu.h> @@ -99,7 +101,7 @@ impl_destroy (GtkObject *object) dropdown_button = E_DROPDOWN_BUTTON (object); priv = dropdown_button->priv; - gtk_accel_group_unref (priv->accel_group); + g_object_unref (priv->accel_group); gtk_widget_destroy (priv->menu); g_free (priv); @@ -230,7 +232,7 @@ e_dropdown_button_new (const char *label_text, g_return_val_if_fail (menu != NULL, NULL); g_return_val_if_fail (GTK_IS_MENU (menu), NULL); - widget = gtk_type_new (e_dropdown_button_get_type ()); + widget = g_object_new (e_dropdown_button_get_type (), NULL); e_dropdown_button_construct (E_DROPDOWN_BUTTON (widget), label_text, menu); return widget; diff --git a/widgets/misc/e-filter-bar.c b/widgets/misc/e-filter-bar.c index b94e5f21da..0c1fce045c 100644 --- a/widgets/misc/e-filter-bar.c +++ b/widgets/misc/e-filter-bar.c @@ -915,7 +915,7 @@ class_init (EFilterBarClass *klass) GTK_RUN_LAST, object_class->type, G_STRUCT_OFFSET (EFilterBarClass, menu_activated), - gtk_marshal_NONE__INT, + g_cclosure_marshal_VOID__INT, GTK_TYPE_NONE, 1, GTK_TYPE_INT); gtk_object_class_add_signals (object_class, esb_signals, LAST_SIGNAL); @@ -946,7 +946,7 @@ e_filter_bar_new (RuleContext *context, EFilterBar *bar; ESearchBarItem item = { NULL, -1, 0 }; - bar = gtk_type_new (e_filter_bar_get_type ()); + bar = g_object_new (e_filter_bar_get_type (), NULL); bar->context = context; g_object_ref (context); diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index 74359a26ac..e8b5956eb8 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -507,8 +507,7 @@ e_map_set_scroll_adjustments (GtkWidget *widget, GtkAdjustment *hadj, GtkAdjustm if (priv->hadj != hadj) { priv->hadj = hadj; - g_object_ref (priv->hadj); - gtk_object_sink (GTK_OBJECT (priv->hadj)); + g_object_ref_sink (priv->hadj); g_signal_connect (priv->hadj, "value_changed", G_CALLBACK (adjustment_changed_cb), view); @@ -519,8 +518,7 @@ e_map_set_scroll_adjustments (GtkWidget *widget, GtkAdjustment *hadj, GtkAdjustm if (priv->vadj != vadj) { priv->vadj = vadj; - g_object_ref (priv->vadj); - gtk_object_sink (GTK_OBJECT (priv->vadj)); + g_object_ref_sink (priv->vadj); g_signal_connect (priv->vadj, "value_changed", G_CALLBACK (adjustment_changed_cb), view); @@ -624,7 +622,7 @@ e_map_new () GtkWidget *widget; AtkObject *a11y; - widget = GTK_WIDGET (gtk_type_new (TYPE_E_MAP)); + widget = g_object_new (TYPE_E_MAP, NULL); a11y = gtk_widget_get_accessible (widget); atk_object_set_name (a11y, _("World Map")); atk_object_set_role (a11y, ATK_ROLE_IMAGE); diff --git a/widgets/misc/e-multi-config-dialog.c b/widgets/misc/e-multi-config-dialog.c index fef0a507a9..360c124f66 100644 --- a/widgets/misc/e-multi-config-dialog.c +++ b/widgets/misc/e-multi-config-dialog.c @@ -119,7 +119,8 @@ set_page_timeout_callback (void *data) multi_config_dialog = E_MULTI_CONFIG_DIALOG (data); priv = multi_config_dialog->priv; - gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), priv->set_page_timeout_page); + gtk_notebook_set_current_page ( + GTK_NOTEBOOK (priv->notebook), priv->set_page_timeout_page); priv->set_page_timeout_id = 0; gtk_widget_grab_focus(priv->list_e_table); @@ -372,11 +373,7 @@ e_multi_config_dialog_init (EMultiConfigDialog *multi_config_dialog) GtkWidget * e_multi_config_dialog_new (void) { - EMultiConfigDialog *dialog; - - dialog = gtk_type_new (e_multi_config_dialog_get_type ()); - - return GTK_WIDGET (dialog); + return g_object_new (e_multi_config_dialog_get_type (), NULL); } @@ -440,6 +437,6 @@ e_multi_config_dialog_show_page (EMultiConfigDialog *dialog, int page) priv = dialog->priv; e_table_set_cursor_row (e_table_scrolled_get_table (E_TABLE_SCROLLED (priv->list_e_table)), page); - gtk_notebook_set_page (GTK_NOTEBOOK (priv->notebook), page); + gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook), page); } diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 6b20492e43..fdfaee0671 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -32,6 +32,7 @@ #include <gdk/gdkkeysyms.h> #include <gtk/gtkdrawingarea.h> #include <gtk/gtkeventbox.h> +#include <gtk/gtklabel.h> #include <gtk/gtkmenuitem.h> #include <gtk/gtkoptionmenu.h> #include <gtk/gtkradiomenuitem.h> @@ -1255,7 +1256,7 @@ e_search_bar_new (ESearchBarItem *menu_items, g_return_val_if_fail (option_items != NULL, NULL); - widget = GTK_WIDGET (gtk_type_new (e_search_bar_get_type ())); + widget = g_object_new (e_search_bar_get_type (), NULL); e_search_bar_construct (E_SEARCH_BAR (widget), menu_items, option_items); diff --git a/widgets/misc/e-task-widget.c b/widgets/misc/e-task-widget.c index 2f591ab49f..d0f52f9191 100644 --- a/widgets/misc/e-task-widget.c +++ b/widgets/misc/e-task-widget.c @@ -167,8 +167,7 @@ e_task_widget_construct (ETaskWidget *task_widget, g_object_unref (mask); priv->tooltips = gtk_tooltips_new (); - g_object_ref (priv->tooltips); - gtk_object_sink (GTK_OBJECT (priv->tooltips)); + g_object_ref_sink (priv->tooltips); e_task_widget_update (task_widget, information, -1.0); } diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c index 06820c0dd0..5f2eb6cd50 100644 --- a/widgets/misc/e-url-entry.c +++ b/widgets/misc/e-url-entry.c @@ -150,7 +150,7 @@ mnemonic_activate (GtkWidget *widget, gboolean group_cycling) GtkWidget * e_url_entry_new (void) { - return gtk_type_new (E_TYPE_URL_ENTRY); + return g_object_new (E_TYPE_URL_ENTRY, NULL); } diff --git a/widgets/misc/gal-combo-box.c b/widgets/misc/gal-combo-box.c index 49fddfb92f..ba010bc2d2 100644 --- a/widgets/misc/gal-combo-box.c +++ b/widgets/misc/gal-combo-box.c @@ -416,8 +416,7 @@ gal_combo_box_init (GalComboBox *combo_box) */ combo_box->priv->toplevel = gtk_window_new (GTK_WINDOW_POPUP); - gtk_widget_ref (combo_box->priv->toplevel); - gtk_object_sink (GTK_OBJECT (combo_box->priv->toplevel)); + g_object_ref_sink (combo_box->priv->toplevel); gtk_window_set_policy (GTK_WINDOW (combo_box->priv->toplevel), FALSE, TRUE, FALSE); @@ -509,8 +508,7 @@ gtk_combo_popup_tear_off (GalComboBox *combo, gboolean set_position) /* FIXME: made this a toplevel, not a dialog ! */ tearoff = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_ref (tearoff); - gtk_object_sink (GTK_OBJECT (tearoff)); + g_object_ref_sink (tearoff); combo->priv->tearoff_window = tearoff; gtk_widget_set_app_paintable (tearoff, TRUE); g_signal_connect (tearoff, "key_press_event", @@ -612,7 +610,7 @@ gtk_combo_tearoff_bg_copy (GalComboBox *combo) 0, 0, 0, 0, -1, -1); g_object_unref (gc); - gtk_widget_set_usize (combo->priv->tearoff_window, + gtk_widget_set_size_request (combo->priv->tearoff_window, widget->allocation.width, widget->allocation.height); @@ -637,11 +635,10 @@ gtk_combo_popup_reparent (GtkWidget *popup, GtkWidget *new_parent, gboolean unrealize) { - GtkObject *object = GTK_OBJECT (popup); - gboolean was_floating = GTK_OBJECT_FLOATING (object); + GObject *object = G_OBJECT (popup); + gboolean was_floating = g_object_is_floating (object); - g_object_ref (object); - gtk_object_sink (object); + g_object_ref_sink (object); if (unrealize) { g_object_ref (object); @@ -651,10 +648,10 @@ gtk_combo_popup_reparent (GtkWidget *popup, } else gtk_widget_reparent (GTK_WIDGET (popup), new_parent); - gtk_widget_set_usize (new_parent, -1, -1); + gtk_widget_set_size_request (new_parent, -1, -1); if (was_floating) - GTK_OBJECT_SET_FLAGS (object, GTK_FLOATING); + g_object_force_floating (object); else g_object_unref (object); } diff --git a/widgets/misc/gal-combo-text.c b/widgets/misc/gal-combo-text.c index ccec4b748d..fe75a7a353 100644 --- a/widgets/misc/gal-combo-text.c +++ b/widgets/misc/gal-combo-text.c @@ -392,7 +392,7 @@ gal_combo_text_construct (GalComboText *ct, gboolean const is_scrolled) GTK_CONTAINER (list), gtk_scrolled_window_get_vadjustment ( GTK_SCROLLED_WINDOW (scroll))); - gtk_widget_set_usize (scroll, 0, 200); /* MAGIC NUMBER */ + gtk_widget_set_size_request (scroll, 0, 200); /* MAGIC NUMBER */ } else display_widget = list; diff --git a/widgets/misc/test-calendar.c b/widgets/misc/test-calendar.c index 2b017ae6fe..4d341e25a4 100644 --- a/widgets/misc/test-calendar.c +++ b/widgets/misc/test-calendar.c @@ -67,7 +67,9 @@ main (int argc, char **argv) GtkWidget *vbox; ECalendarItem *calitem; - gnome_init ("test-calendar", "0.0", argc, argv); + gnome_program_init ( + "test-calendar", "0.0", LIBGNOMEUI_MODULE, + argc, argv, GNOME_PARAM_NONE); app = gnome_app_new ("Test", "Test"); gtk_window_set_default_size (GTK_WINDOW (app), 400, 400); diff --git a/widgets/misc/test-dropdown-button.c b/widgets/misc/test-dropdown-button.c index 349176d05c..ab258c0c27 100644 --- a/widgets/misc/test-dropdown-button.c +++ b/widgets/misc/test-dropdown-button.c @@ -52,25 +52,25 @@ item_activated (GtkWidget *widget, static GnomeUIInfo ui_info[] = { { GNOME_APP_UI_ITEM, "_New", "Create a new file", item_activated, "file/new", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_NEW, 'n', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_NEW, 'n', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "_Open...", "Open an existing file", item_activated, "file/open", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, 'o', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_OPEN, 'o', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "_Save", "Save the current file", item_activated, "file/save", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE, 's', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_SAVE, 's', GDK_CONTROL_MASK, NULL }, { GNOME_APP_UI_ITEM, "Save _as...", "Save the current file with a new name", item_activated, "file/save as", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_SAVE_AS, 0, 0, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_SAVE_AS, 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, "_Print...", "Print the current file", item_activated, "file/print", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_PRINT, 'p', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_PRINT, 'p', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, "_Close", "Close the current file", item_activated, "file/close", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CLOSE, 0, 0, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_CLOSE, 0, 0, NULL }, { GNOME_APP_UI_ITEM, "E_xit", "Exit the program", item_activated, "file/exit", NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXIT, 'q', GDK_CONTROL_MASK, NULL }, + GNOME_APP_PIXMAP_STOCK, GTK_STOCK_QUIT, 'q', GDK_CONTROL_MASK, NULL }, GNOMEUIINFO_END }; @@ -82,7 +82,9 @@ main (int argc, char **argv) GtkWidget *menu; GtkWidget *dropdown_button; - gnome_init ("test-dropdown-button", "0.0", argc, argv); + gnome_program_init ( + "test-dropdown-button", "0.0", LIBGNOMEUI_MODULE, + argc, argv, GNOME_PARAM_NONE); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 1, 1); diff --git a/widgets/misc/test-info-label.c b/widgets/misc/test-info-label.c index e4b053d81d..eb71e199a8 100644 --- a/widgets/misc/test-info-label.c +++ b/widgets/misc/test-info-label.c @@ -51,7 +51,9 @@ main (int argc, char **argv) GtkWidget *label; GtkWidget *vbox; - gnome_init ("test-title-bar", "0.0", argc, argv); + gnome_program_init ( + "test-title-bar", "0.0", LIBGNOMEUI_MODULE, + argc, argv, GNOME_PARAM_NONE); e_icon_factory_init (); app = gnome_app_new ("Test", "Test"); diff --git a/widgets/misc/test-multi-config-dialog.c b/widgets/misc/test-multi-config-dialog.c index 1a56af9a30..5d72087803 100644 --- a/widgets/misc/test-multi-config-dialog.c +++ b/widgets/misc/test-multi-config-dialog.c @@ -76,7 +76,9 @@ main (int argc, char **argv) { GtkWidget *dialog; - gnome_init ("test-multi-config-dialog", "0.0", argc, argv); + gnome_program_init ( + "test-multi-config-dialog", "0.0", LIBGNOMEUI_MODULE, + argc, argv, GNOME_PARAM_NONE); dialog = e_multi_config_dialog_new (); diff --git a/widgets/table/ChangeLog b/widgets/table/ChangeLog index ee46792ce3..43d102a326 100644 --- a/widgets/table/ChangeLog +++ b/widgets/table/ChangeLog @@ -1,3 +1,53 @@ +2007-04-19 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #429422 + + * e-table-size-test.c (create_table): + * test-table.c (main): + * e-cell-combo.c (e_cell_combo_show_popup): + * e-table-example-1.c (create_table): + * e-tree.c (header_canvas_size_allocate), (e_tree_setup_header): + * e-cell-text.c (ect_show_tooltip): + * e-table-example-2.c (create_table): + * e-table.c (header_canvas_size_allocate): + Use gtk_widget_set_size_request() or g_object_set() instead of + gtk_widget_set_usize(). + + * e-cell-tree.c (e_cell_tree_construct): + * e-table-header-item.c (ethi_header_context_menu), (ethi_event): + * e-table-extras.c (e_table_extras_add_cell): + Use g_object_ref_sink() instead of gtk_object_sink(). + + * e-cell-date.c (ecd_get_text): + e_strdup_strip() is dead; just do it manually. + + * e-table-header-item.c (ethi_header_context_menu): + Use gtk_radio_menu_item_get_group() instead of + gtk_radio_menu_item_group(). + + * e-table-search.c (e_table_search_class_init): + * e-table-sort-info.c (e_table_sort_info_class_init): + * e-tree-model.c (e_tree_model_class_init): + * e-tree-memory.c (e_tree_memory_class_init): + * e-table-header.c (e_table_header_class_init): + * e-table-model.c (e_table_model_class_init): + * e-table-config.c (config_class_init): + * e-tree-sorted.c (e_tree_sorted_class_init): + Use G_TYPE_FROM_CLASS() instead of E_OBJECT_CLASS_TYPE(). + + * e-table-item.c (eti_dispose), (eti_unrealize), (eti_event): + Use g_source_remove() instead of gtk_timeout_remove(). + + * e-table-item.c (eti_event): + Use g_timeout_add() instead of gtk_timeout_add(). + + * e-tree.c (et_dispose): + e_free_string_list() is dead; just do it manually. + + * e-tree-memory.c (e_tree_memory_sort_node): + * e-table-sorting-utils.c (e_table_sorting_utils_sort): + Use g_qsort_with_data() instead of e_sort(). + 2007-03-29 Matthew Barnes <mbarnes@redhat.com> * e-table-header-utils.c: diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 629a3588ed..e7fc235a05 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -365,7 +365,7 @@ e_cell_combo_show_popup (ECellCombo *ecc, int row, int view_col) } gtk_widget_set_uposition (ecc->popup_window, x, y); - gtk_widget_set_usize (ecc->popup_window, width, height); + gtk_widget_set_size_request (ecc->popup_window, width, height); gtk_widget_realize (ecc->popup_window); gdk_window_resize (ecc->popup_window->window, width, height); gtk_widget_show (ecc->popup_window); diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index d2319ee61e..85f2324ad4 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -108,8 +108,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) while ((temp = strstr (temp, " "))) { memmove (temp, temp + 1, strlen (temp)); } - temp = e_strdup_strip (buf); - return temp; + return g_strstrip (g_strdup (buf)); } static void diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 25a00085f8..47088029a6 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -1623,8 +1623,8 @@ ect_show_tooltip (ECellView *ecell_view, "x2", (double) tooltip_width + 6, "y2", (double) tooltip->row_height + 1, NULL); - gtk_widget_set_usize (window, tooltip_width + 6, - tooltip->row_height + 1); + gtk_widget_set_size_request (window, tooltip_width + 6, + tooltip->row_height + 1); gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas), 0.0, 0.0, (double) tooltip_width + 6, (double) tooltip_height); diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index fc7f835fd1..8853a7a132 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -873,10 +873,8 @@ e_cell_tree_construct (ECellTree *ect, ECell *subcell) { ect->subcell = subcell; - if (subcell) { - g_object_ref (subcell); - gtk_object_sink (GTK_OBJECT (subcell)); - } + if (subcell) + g_object_ref_sink (subcell); if (open_pixbuf) ect->open_pixbuf = open_pixbuf; else diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index f32f09cd21..7af4a8fb00 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -33,7 +33,6 @@ #include <string.h> #include <gtk/gtk.h> -#include <libgnomeui/gnome-propertybox.h> #include <glade/glade.h> #include <glib/gi18n.h> @@ -138,7 +137,7 @@ config_class_init (GObjectClass *object_class) e_table_config_signals [CHANGED] = g_signal_new ("changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableConfigClass, changed), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-example-1.c b/widgets/table/e-table-example-1.c index 37ac85770f..bbfc070d62 100644 --- a/widgets/table/e-table-example-1.c +++ b/widgets/table/e-table-example-1.c @@ -281,7 +281,7 @@ create_table (void) gtk_container_add (GTK_CONTAINER (window), frame); /* Size the initial window. */ - gtk_widget_set_usize (window, 200, 200); + gtk_widget_set_size_request (window, 200, 200); /* Show it all. */ gtk_widget_show_all (window); diff --git a/widgets/table/e-table-example-2.c b/widgets/table/e-table-example-2.c index a442ee2546..a91087c82a 100644 --- a/widgets/table/e-table-example-2.c +++ b/widgets/table/e-table-example-2.c @@ -327,7 +327,7 @@ create_table () gtk_container_add (GTK_CONTAINER (window), frame); /* Size the initial window. */ - gtk_widget_set_usize (window, 200, 200); + gtk_widget_set_size_request (window, 200, 200); /* Show it all. */ gtk_widget_show_all (window); } diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index 5b13c4e5f4..93013bbd78 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -209,10 +209,8 @@ e_table_extras_add_cell (ETableExtras *extras, g_object_unref (old_cell); } - if (cell) { - g_object_ref (cell); - gtk_object_sink (GTK_OBJECT (cell)); - } + if (cell) + g_object_ref_sink (cell); g_hash_table_insert (extras->cells, g_strdup(id), cell); } diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 596fbbcb73..7dff0b5469 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -1552,7 +1552,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) /* Custom */ menu_item = gtk_radio_menu_item_new_with_label (group, _("Custom")); - group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item)); + group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menu_item)); gtk_widget_show (menu_item); gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item); if (sort_col == -1) @@ -1587,8 +1587,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) g_signal_connect (menu_item, "activate", G_CALLBACK (sort_by_id), ethi); } - g_object_ref (popup); - gtk_object_sink (GTK_OBJECT (popup)); + g_object_ref_sink (popup); g_signal_connect (popup, "selection-done", G_CALLBACK (free_popup_info), info); e_popup_menu (popup, (GdkEvent *) event); @@ -1814,8 +1813,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + 128, info, GETTEXT_PACKAGE); - g_object_ref (popup); - gtk_object_sink (GTK_OBJECT (popup)); + g_object_ref_sink (popup); g_signal_connect (popup, "selection-done", G_CALLBACK (free_popup_info), info); e_popup_menu (popup, NULL); diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 2acfb1c446..5e7d28300b 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -277,7 +277,7 @@ e_table_header_class_init (GObjectClass *object_class) eth_signals [STRUCTURE_CHANGE] = g_signal_new ("structure_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableHeaderClass, structure_change), (GSignalAccumulator) NULL, NULL, @@ -285,7 +285,7 @@ e_table_header_class_init (GObjectClass *object_class) G_TYPE_NONE, 0); eth_signals [DIMENSION_CHANGE] = g_signal_new ("dimension_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableHeaderClass, dimension_change), (GSignalAccumulator) NULL, NULL, @@ -293,7 +293,7 @@ e_table_header_class_init (GObjectClass *object_class) G_TYPE_NONE, 1, G_TYPE_INT); eth_signals [EXPANSION_CHANGE] = g_signal_new ("expansion_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableHeaderClass, expansion_change), (GSignalAccumulator) NULL, NULL, @@ -301,7 +301,7 @@ e_table_header_class_init (GObjectClass *object_class) G_TYPE_NONE, 0); eth_signals [REQUEST_WIDTH] = g_signal_new ("request_width", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableHeaderClass, request_width), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 72a3decfca..c4b5ea17d0 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -1446,7 +1446,7 @@ eti_dispose (GObject *object) eti->tooltip->foreground = NULL; if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } g_free (eti->tooltip); @@ -1782,7 +1782,7 @@ eti_unrealize (GnomeCanvasItem *item) eti->tooltip->foreground = NULL; } if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } } @@ -2288,7 +2288,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) d(g_print("%s: GDK_BUTTON_PRESS received, button %d\n", __FUNCTION__, e->button.button)); if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } @@ -2429,7 +2429,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas)); @@ -2597,12 +2597,12 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) #ifdef DO_TOOLTIPS if (!g_getenv ("GAL_DONT_DO_TOOLTIPS")) { if (eti->tooltip->timer) - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->col = col; eti->tooltip->row = row; eti->tooltip->cx = e->motion.x; eti->tooltip->cy = e->motion.y; - eti->tooltip->timer = gtk_timeout_add (100, (GSourceFunc)_do_tooltip, eti); + eti->tooltip->timer = g_timeout_add (100, (GSourceFunc)_do_tooltip, eti); } #endif @@ -2636,7 +2636,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) NULL); if (eti->tooltip->timer) { - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; } e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(eti)->canvas)); @@ -2850,7 +2850,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_ENTER_NOTIFY: d(g_print("%s: %s received\n", __FUNCTION__, leave ? "GDK_LEAVE_NOTIFY" : "GDK_ENTER_NOTIFY")); if (eti->tooltip->timer) - gtk_timeout_remove (eti->tooltip->timer); + g_source_remove (eti->tooltip->timer); eti->tooltip->timer = 0; if (eti->motion_row != -1 && eti->motion_col != -1) return_val = eti_e_cell_event (eti, eti->cell_views [eti->motion_col], diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c index f600c0832d..cef8846049 100644 --- a/widgets/table/e-table-model.c +++ b/widgets/table/e-table-model.c @@ -284,7 +284,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_NO_CHANGE] = g_signal_new ("model_no_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_no_change), (GSignalAccumulator) NULL, NULL, @@ -294,7 +294,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_CHANGED] = g_signal_new ("model_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_changed), (GSignalAccumulator) NULL, NULL, @@ -303,7 +303,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_PRE_CHANGE] = g_signal_new ("model_pre_change", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_pre_change), (GSignalAccumulator) NULL, NULL, @@ -312,7 +312,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_ROW_CHANGED] = g_signal_new ("model_row_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_row_changed), (GSignalAccumulator) NULL, NULL, @@ -321,7 +321,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_CELL_CHANGED] = g_signal_new ("model_cell_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_cell_changed), (GSignalAccumulator) NULL, NULL, @@ -330,7 +330,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_ROWS_INSERTED] = g_signal_new ("model_rows_inserted", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_rows_inserted), (GSignalAccumulator) NULL, NULL, @@ -339,7 +339,7 @@ e_table_model_class_init (GObjectClass *object_class) e_table_model_signals [MODEL_ROWS_DELETED] = g_signal_new ("model_rows_deleted", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableModelClass, model_rows_deleted), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 898b179d16..0f014c1a76 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -127,7 +127,7 @@ e_table_search_class_init (GObjectClass *object_class) e_table_search_signals [SEARCH_SEARCH] = g_signal_new ("search", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableSearchClass, search), (GSignalAccumulator) NULL, NULL, @@ -136,7 +136,7 @@ e_table_search_class_init (GObjectClass *object_class) e_table_search_signals [SEARCH_ACCEPT] = g_signal_new ("accept", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableSearchClass, accept), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-size-test.c b/widgets/table/e-table-size-test.c index 07810d4893..308ad484b9 100644 --- a/widgets/table/e-table-size-test.c +++ b/widgets/table/e-table-size-test.c @@ -281,7 +281,7 @@ create_table (void) gtk_container_add (GTK_CONTAINER (window), frame); /* Size the initial window. */ - gtk_widget_set_usize (window, 300, 200); + gtk_widget_set_size_request (window, 300, 200); /* Show it all. */ gtk_widget_show_all (window); diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index 5bbf443b76..cfc5f05e1c 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -82,7 +82,7 @@ e_table_sort_info_class_init (ETableSortInfoClass *klass) e_table_sort_info_signals [SORT_INFO_CHANGED] = g_signal_new ("sort_info_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableSortInfoClass, sort_info_changed), (GSignalAccumulator) NULL, NULL, @@ -91,7 +91,7 @@ e_table_sort_info_class_init (ETableSortInfoClass *klass) e_table_sort_info_signals [GROUP_INFO_CHANGED] = g_signal_new ("group_info_changed", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableSortInfoClass, group_info_changed), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c index 7ac671fd84..7b3f078654 100644 --- a/widgets/table/e-table-sorting-utils.c +++ b/widgets/table/e-table-sorting-utils.c @@ -142,7 +142,8 @@ e_table_sorting_utils_sort(ETableModel *source, ETableSortInfo *sort_info, ETabl closure.ascending[j] = column.ascending; } - e_sort(map_table, rows, sizeof(int), e_sort_callback, &closure); + g_qsort_with_data ( + map_table, rows, sizeof(int), e_sort_callback, &closure); g_free(closure.vals); g_free(closure.ascending); @@ -295,7 +296,8 @@ e_table_sorting_utils_tree_sort(ETreeModel *source, ETableSortInfo *sort_info, E map[i] = i; } - e_sort(map, count, sizeof(int), e_sort_callback, &closure); + g_qsort_with_data ( + map, count, sizeof(int), e_sort_callback, &closure); map_copy = g_new(ETreePath, count); for (i = 0; i < count; i++) { diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index b42d860779..4a3e8efccc 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -621,8 +621,10 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETable *e_ header is correct */ if (GTK_WIDGET (e_table->header_canvas)->allocation.height != E_TABLE_HEADER_ITEM (e_table->header_item)->height) - gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -2, - E_TABLE_HEADER_ITEM (e_table->header_item)->height); + g_object_set ( + e_table->header_canvas, "height-request", + E_TABLE_HEADER_ITEM (e_table->header_item)->height, + NULL); } static void @@ -674,8 +676,9 @@ e_table_setup_header (ETable *e_table) G_OBJECT (e_table->header_canvas), "size_allocate", G_CALLBACK (header_canvas_size_allocate), e_table); - gtk_widget_set_usize (GTK_WIDGET (e_table->header_canvas), -2, - E_TABLE_HEADER_ITEM (e_table->header_item)->height); + g_object_set ( + e_table->header_canvas, "height-request", + E_TABLE_HEADER_ITEM (e_table->header_item)->height, NULL); } static gboolean diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 7de48802fd..b24aef5e72 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -357,7 +357,7 @@ e_tree_memory_class_init (ETreeMemoryClass *klass) signals [FILL_IN_CHILDREN] = g_signal_new ("fill_in_children", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeMemoryClass, fill_in_children), (GSignalAccumulator) NULL, NULL, @@ -679,7 +679,9 @@ e_tree_memory_sort_node (ETreeMemory *etmm, mac.closure = user_data; mac.callback = callback; - e_sort (children, count, sizeof (ETreeMemoryPath *), sort_callback, &mac); + g_qsort_with_data ( + children, count, sizeof (ETreeMemoryPath *), + sort_callback, &mac); path->first_child = NULL; last = NULL; diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index af88c0e3cb..976d3f85b9 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -69,7 +69,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [PRE_CHANGE] = g_signal_new ("pre_change", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, pre_change), (GSignalAccumulator) NULL, NULL, @@ -78,7 +78,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NO_CHANGE] = g_signal_new ("no_change", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, no_change), (GSignalAccumulator) NULL, NULL, @@ -87,7 +87,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_CHANGED] = g_signal_new ("node_changed", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_changed), (GSignalAccumulator) NULL, NULL, @@ -96,7 +96,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_DATA_CHANGED] = g_signal_new ("node_data_changed", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_data_changed), (GSignalAccumulator) NULL, NULL, @@ -105,7 +105,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_COL_CHANGED] = g_signal_new ("node_col_changed", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_col_changed), (GSignalAccumulator) NULL, NULL, @@ -114,7 +114,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_INSERTED] = g_signal_new ("node_inserted", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_inserted), (GSignalAccumulator) NULL, NULL, @@ -123,7 +123,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_REMOVED] = g_signal_new ("node_removed", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_removed), (GSignalAccumulator) NULL, NULL, @@ -132,7 +132,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_DELETED] = g_signal_new ("node_deleted", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_deleted), (GSignalAccumulator) NULL, NULL, @@ -141,7 +141,7 @@ e_tree_model_class_init (GObjectClass *klass) e_tree_model_signals [NODE_REQUEST_COLLAPSE] = g_signal_new ("node_request_collapse", - E_OBJECT_CLASS_TYPE (klass), + G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeModelClass, node_request_collapse), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index b5c67dc906..39e3a1cdfb 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -1196,7 +1196,7 @@ e_tree_sorted_class_init (ETreeSortedClass *klass) signals [NODE_RESORTED] = g_signal_new ("node_resorted", - E_OBJECT_CLASS_TYPE (object_class), + G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETreeSortedClass, node_resorted), (GSignalAccumulator) NULL, NULL, diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index f6679e59b3..6445cd14e8 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -387,7 +387,10 @@ et_dispose (GObject *object) scroll_off (et); hover_off (et); - e_free_string_list (et->priv->expanded_list); + g_list_foreach ( + et->priv->expanded_list, + (GFunc) g_free, NULL); + g_list_free (et->priv->expanded_list); et_disconnect_from_etta (et); @@ -674,7 +677,7 @@ header_canvas_size_allocate (GtkWidget *widget, GtkAllocation *alloc, ETree *e_t header is correct */ if (GTK_WIDGET (e_tree->priv->header_canvas)->allocation.height != E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height) - gtk_widget_set_usize (GTK_WIDGET (e_tree->priv->header_canvas), -1, + gtk_widget_set_size_request (GTK_WIDGET (e_tree->priv->header_canvas), -1, E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height); } @@ -705,8 +708,9 @@ e_tree_setup_header (ETree *e_tree) e_tree->priv->header_canvas, "size_allocate", G_CALLBACK (header_canvas_size_allocate), e_tree); - gtk_widget_set_usize (GTK_WIDGET (e_tree->priv->header_canvas), -1, - E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height); + gtk_widget_set_size_request ( + GTK_WIDGET (e_tree->priv->header_canvas), -1, + E_TABLE_HEADER_ITEM (e_tree->priv->header_item)->height); } static gboolean diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c index a33ecc3c15..3eb42e42a7 100644 --- a/widgets/table/test-table.c +++ b/widgets/table/test-table.c @@ -446,7 +446,7 @@ compare=\"string\"/>\n", i, column_labels[i]); gtk_box_pack_start (GTK_BOX (vbox), bhide, FALSE, FALSE, 0); #endif - gtk_widget_set_usize (window, 400, 200); + gtk_widget_set_size_request (window, 400, 200); gtk_widget_show_all (window); #ifdef BIT_ROT diff --git a/widgets/text/e-completion-callbacks.c b/widgets/text/e-completion-callbacks.c index b819513141..229a28d760 100644 --- a/widgets/text/e-completion-callbacks.c +++ b/widgets/text/e-completion-callbacks.c @@ -92,7 +92,7 @@ e_completion_callbacks_new (ECompletionCallbacksRequestCompletionFn request_comp g_return_val_if_fail (request_completion != NULL, NULL); g_return_val_if_fail (end_completion != NULL, NULL); - cc = gtk_type_new (E_COMPLETION_CALLBACKS_TYPE); + cc = g_object_new (E_COMPLETION_CALLBACKS_TYPE, NULL); cc->request_completion = request_completion; cc->end_completion = end_completion; diff --git a/widgets/text/e-completion-view.c b/widgets/text/e-completion-view.c index 57d02bb865..0837160d6f 100644 --- a/widgets/text/e-completion-view.c +++ b/widgets/text/e-completion-view.c @@ -810,7 +810,7 @@ e_completion_view_set_width (ECompletionView *cv, gint width) w = GTK_WIDGET (cv); if (! GTK_WIDGET_REALIZED (w)) { - gtk_widget_set_usize (w, width, -1); + gtk_widget_set_size_request (w, width, -1); return; } @@ -841,7 +841,7 @@ e_completion_view_set_width (ECompletionView *cv, gint width) /* We reduce the total height by a bit; in practice, this seems to work out well. */ final_height = (gint) floor (line_height * (0.5 + (float)lines) * 0.97); - gtk_widget_set_usize (w, width, final_height); + gtk_widget_set_size_request (w, width, final_height); } void diff --git a/widgets/text/e-entry.c b/widgets/text/e-entry.c index d5f7cb4fe9..979048671f 100644 --- a/widgets/text/e-entry.c +++ b/widgets/text/e-entry.c @@ -243,7 +243,7 @@ static void e_entry_text_keypress (EText *text, guint keyval, guint state, EEntry *entry) { if (entry->priv->changed_since_keypress_tag) { - gtk_timeout_remove (entry->priv->changed_since_keypress_tag); + g_source_remove (entry->priv->changed_since_keypress_tag); entry->priv->changed_since_keypress_tag = 0; } @@ -276,9 +276,9 @@ static void proxy_changed (EText *text, EEntry *entry) { if (entry->priv->changed_since_keypress_tag) - gtk_timeout_remove (entry->priv->changed_since_keypress_tag); + g_source_remove (entry->priv->changed_since_keypress_tag); entry->priv->changed_since_keypress = TRUE; - entry->priv->changed_since_keypress_tag = gtk_timeout_add (20, changed_since_keypress_timeout_fn, entry); + entry->priv->changed_since_keypress_tag = g_timeout_add (20, changed_since_keypress_timeout_fn, entry); g_signal_emit (entry, e_entry_signals [E_ENTRY_CHANGED], 0); } @@ -599,7 +599,7 @@ e_entry_start_delayed_completion (EEntry *entry, gint delay) return; e_entry_cancel_delayed_completion (entry); - entry->priv->completion_delay_tag = gtk_timeout_add (MAX (delay, 1), start_delayed_cb, entry); + entry->priv->completion_delay_tag = g_timeout_add (MAX (delay, 1), start_delayed_cb, entry); } static void @@ -609,7 +609,7 @@ e_entry_cancel_delayed_completion (EEntry *entry) return; if (entry->priv->completion_delay_tag) { - gtk_timeout_remove (entry->priv->completion_delay_tag); + g_source_remove (entry->priv->completion_delay_tag); entry->priv->completion_delay_tag = 0; } } @@ -778,8 +778,7 @@ e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint del g_return_if_fail (entry->priv->completion == NULL); entry->priv->completion = completion; - g_object_ref (completion); - gtk_object_sink (GTK_OBJECT (completion)); + g_object_ref_sink (completion); entry->priv->completion_delay = delay; entry->priv->handler = handler; @@ -840,8 +839,7 @@ e_entry_enable_completion_full (EEntry *entry, ECompletion *completion, gint del e_completion_view_connect_keys (E_COMPLETION_VIEW (entry->priv->completion_view), GTK_WIDGET (entry->canvas)); - g_object_ref (entry->priv->completion_view_popup); - gtk_object_sink (GTK_OBJECT (entry->priv->completion_view_popup)); + g_object_ref_sink (entry->priv->completion_view_popup); gtk_window_set_policy (GTK_WINDOW (entry->priv->completion_view_popup), TRUE, TRUE, TRUE); gtk_container_add (GTK_CONTAINER (entry->priv->completion_view_popup), entry->priv->completion_view); gtk_widget_show (entry->priv->completion_view); @@ -1106,7 +1104,7 @@ e_entry_dispose (GObject *object) if (entry->priv) { if (entry->priv->completion_delay_tag) - gtk_timeout_remove (entry->priv->completion_delay_tag); + g_source_remove (entry->priv->completion_delay_tag); if (entry->priv->completion) g_object_unref (entry->priv->completion); @@ -1123,7 +1121,7 @@ e_entry_dispose (GObject *object) g_free (entry->priv->pre_browse_text); if (entry->priv->changed_since_keypress_tag) - gtk_timeout_remove (entry->priv->changed_since_keypress_tag); + g_source_remove (entry->priv->changed_since_keypress_tag); g_free (entry->priv); entry->priv = NULL; @@ -1201,7 +1199,7 @@ e_entry_class_init (GObjectClass *object_class) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (EEntryClass, completion_popup), NULL, NULL, - gtk_marshal_NONE__INT, + g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); g_object_class_install_property (object_class, PROP_MODEL, diff --git a/widgets/text/e-text-model-uri.c b/widgets/text/e-text-model-uri.c index 6736b41cde..95ce7cc076 100644 --- a/widgets/text/e-text-model-uri.c +++ b/widgets/text/e-text-model-uri.c @@ -96,7 +96,7 @@ e_text_model_uri_dispose (GObject *object) GList *iter; if (model_uri->objectify_idle) { - gtk_idle_remove (model_uri->objectify_idle); + g_source_remove (model_uri->objectify_idle); model_uri->objectify_idle = 0; } @@ -252,7 +252,7 @@ e_text_model_uri_objectify (ETextModel *model) ETextModelURI *model_uri = E_TEXT_MODEL_URI (model); if (model_uri->objectify_idle == 0) - model_uri->objectify_idle = gtk_idle_add (objectify_idle_cb, model); + model_uri->objectify_idle = g_idle_add (objectify_idle_cb, model); if (E_TEXT_MODEL_CLASS(parent_class)->objectify) E_TEXT_MODEL_CLASS(parent_class)->objectify (model); @@ -262,7 +262,7 @@ static void objectify_idle_flush (ETextModelURI *model_uri) { if (model_uri->objectify_idle) { - gtk_idle_remove (model_uri->objectify_idle); + g_source_remove (model_uri->objectify_idle); model_uri->objectify_idle = 0; objectify_uris (model_uri); } diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 0ae2d2203d..be81a88232 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -244,17 +244,17 @@ e_text_dispose (GObject *object) } if ( text->tooltip_timeout ) { - gtk_timeout_remove (text->tooltip_timeout); + g_source_remove (text->tooltip_timeout); text->tooltip_timeout = 0; } if ( text->dbl_timeout ) { - gtk_timeout_remove (text->dbl_timeout); + g_source_remove (text->dbl_timeout); text->dbl_timeout = 0; } if ( text->tpl_timeout ) { - gtk_timeout_remove (text->tpl_timeout); + g_source_remove (text->tpl_timeout); text->tpl_timeout = 0; } @@ -2093,9 +2093,9 @@ _do_tooltip (gpointer data) gtk_widget_show (canvas); gtk_widget_realize (tooltip_window); - gtk_widget_set_usize (tooltip_window, - tooltip_width + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0), - tooltip_height + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0)); + gtk_widget_set_size_request (tooltip_window, + tooltip_width + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0), + tooltip_height + 4 + (text->draw_borders ? BORDER_INDENT * 2 : 0)); gnome_canvas_set_scroll_region (GNOME_CANVAS(canvas), 0.0, 0.0, tooltip_width + (text->draw_borders ? BORDER_INDENT * 2 : 0), (double)tooltip_height + (text->draw_borders ? BORDER_INDENT * 2 : 0)); @@ -2295,7 +2295,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->tooltip_count --; if ( text->tooltip_count == 0 && text->clip) { if ( text->tooltip_timeout ) { - gtk_timeout_remove (text->tooltip_timeout); + g_source_remove (text->tooltip_timeout); text->tooltip_timeout = 0; } } @@ -2344,7 +2344,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) case GDK_BUTTON_PRESS: /* Fall Through */ case GDK_BUTTON_RELEASE: if (text->tooltip_timeout) { - gtk_timeout_remove (text->tooltip_timeout); + g_source_remove (text->tooltip_timeout); text->tooltip_timeout = 0; } e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(text)->canvas)); @@ -2394,13 +2394,13 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) if (event->type == GDK_BUTTON_PRESS) { if (text->dbl_timeout == 0 && text->tpl_timeout == 0) { - text->dbl_timeout = gtk_timeout_add (200, - _click, - &(text->dbl_timeout)); + text->dbl_timeout = g_timeout_add (200, + _click, + &(text->dbl_timeout)); } else { if (text->tpl_timeout == 0) { e_tep_event.type = GDK_2BUTTON_PRESS; - text->tpl_timeout = gtk_timeout_add (200, _click, &(text->tpl_timeout)); + text->tpl_timeout = g_timeout_add (200, _click, &(text->tpl_timeout)); } else { e_tep_event.type = GDK_3BUTTON_PRESS; } @@ -2445,7 +2445,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) { if ( text->tooltip_count == 0 && text->clip) { if (!text->tooltip_timeout) - text->tooltip_timeout = gtk_timeout_add (2000, _do_tooltip, text); + text->tooltip_timeout = g_timeout_add (2000, _do_tooltip, text); } text->tooltip_count ++; } @@ -2463,7 +2463,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->tooltip_count --; if ( text->tooltip_count == 0 && text->clip) { if ( text->tooltip_timeout ) { - gtk_timeout_remove (text->tooltip_timeout); + g_source_remove (text->tooltip_timeout); text->tooltip_timeout = 0; } } |