[evolution-patches] Cleanups for evolution
- From: Kjartan Maraas <kmaraas broadpark no>
- To: Matthew Barnes <mbarnes redhat com>
- Cc: evolution-patches <evolution-patches gnome org>
- Subject: [evolution-patches] Cleanups for evolution
- Date: Wed, 25 Apr 2007 23:37:04 +0200
Here's a patch for evolution that tries to address a lot of issues
reported by gcc/sparse.
Cheers
Kjartan
Index: addressbook/tools/evolution-addressbook-export.c
===================================================================
--- addressbook/tools/evolution-addressbook-export.c (revision 33422)
+++ addressbook/tools/evolution-addressbook-export.c (working copy)
@@ -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);
Index: addressbook/gui/contact-editor/e-contact-editor.c
===================================================================
--- addressbook/gui/contact-editor/e-contact-editor.c (revision 33422)
+++ addressbook/gui/contact-editor/e-contact-editor.c (working copy)
@@ -3348,7 +3348,7 @@ e_contact_editor_init (EContactEditor *e
/* 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 */
Index: addressbook/gui/widgets/e-addressbook-table-adapter.c
===================================================================
--- addressbook/gui/widgets/e-addressbook-table-adapter.c (revision 33422)
+++ addressbook/gui/widgets/e-addressbook-table-adapter.c (working copy)
@@ -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"
Index: addressbook/gui/widgets/eab-vcard-control.c
===================================================================
--- addressbook/gui/widgets/eab-vcard-control.c (revision 33422)
+++ addressbook/gui/widgets/eab-vcard-control.c (working copy)
@@ -125,7 +125,11 @@ pstream_load (BonoboPersistStream *ps, c
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 s
}
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);
}
Index: addressbook/gui/widgets/e-addressbook-model.c
===================================================================
--- addressbook/gui/widgets/e-addressbook-model.c (revision 33422)
+++ addressbook/gui/widgets/e-addressbook-model.c (working copy)
@@ -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>
Index: addressbook/gui/widgets/eab-gui-util.c
===================================================================
--- addressbook/gui/widgets/eab-gui-util.c (revision 33422)
+++ addressbook/gui/widgets/eab-gui-util.c (working copy)
@@ -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 *proce
{
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);
Index: addressbook/gui/widgets/e-addressbook-view.c
===================================================================
--- addressbook/gui/widgets/e-addressbook-view.c (revision 33422)
+++ addressbook/gui/widgets/e-addressbook-view.c (working copy)
@@ -1859,7 +1859,8 @@ eab_view_print(EABView *view, int previe
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 previe
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,
!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,
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, gboolea
}
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
Index: addressbook/conduit/address-conduit.c
===================================================================
--- addressbook/conduit/address-conduit.c (revision 33422)
+++ addressbook/conduit/address-conduit.c (working copy)
@@ -168,11 +168,9 @@ addrconduit_load_configuration (guint32
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);
Index: addressbook/printing/e-contact-print.c
===================================================================
--- addressbook/printing/e-contact-print.c (revision 33422)
+++ addressbook/printing/e-contact-print.c (working copy)
@@ -651,7 +651,7 @@ e_contact_build_style(EContactPrintStyle
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) {
Index: addressbook/printing/e-contact-print-style-editor.c
===================================================================
--- addressbook/printing/e-contact-print-style-editor.c (revision 33422)
+++ addressbook/printing/e-contact-print-style-editor.c (working copy)
@@ -128,8 +128,7 @@ e_contact_print_style_editor_destroy (Gt
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
Index: shell/e-shell.c
===================================================================
--- shell/e-shell.c (revision 33422)
+++ shell/e-shell.c (working copy)
@@ -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);
Index: shell/e-user-creatable-items-handler.c
===================================================================
--- shell/e-user-creatable-items-handler.c (revision 33422)
+++ shell/e-user-creatable-items-handler.c (working copy)
@@ -753,8 +753,7 @@ setup_toolbar_button (EUserCreatableItem
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);
Index: shell/e-shell-importer.c
===================================================================
--- shell/e-shell-importer.c (revision 33422)
+++ shell/e-shell-importer.c (working copy)
@@ -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);
Index: shell/importer/intelligent.c
===================================================================
--- shell/importer/intelligent.c (revision 33422)
+++ shell/importer/intelligent.c (working copy)
@@ -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 ("");
}
Index: shell/e-history.c
===================================================================
--- shell/e-history.c (revision 33422)
+++ shell/e-history.c (working copy)
@@ -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);
}
Index: shell/main.c
===================================================================
--- shell/main.c (revision 33422)
+++ shell/main.c (working copy)
@@ -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>
Index: shell/e-shell-settings-dialog.c
===================================================================
--- shell/e-shell-settings-dialog.c (revision 33422)
+++ shell/e-shell-settings-dialog.c (working copy)
@@ -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 ++) {
Index: smime/gui/certificate-manager.c
===================================================================
--- smime/gui/certificate-manager.c (revision 33422)
+++ smime/gui/certificate-manager.c (working copy)
@@ -1008,7 +1008,7 @@ certificate_manager_config_control_new (
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);
Index: plugins/groupwise-features/status-track.c
===================================================================
--- plugins/groupwise-features/status-track.c (revision 33422)
+++ plugins/groupwise-features/status-track.c (working copy)
@@ -229,7 +229,7 @@ track_status (EPopup *ep, EPopupItem *it
}
/*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));
Index: plugins/exchange-operations/exchange-user-dialog.c
===================================================================
--- plugins/exchange-operations/exchange-user-dialog.c (revision 33422)
+++ plugins/exchange-operations/exchange-user-dialog.c (working copy)
@@ -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>
Index: plugins/exchange-operations/exchange-delegates-user.c
===================================================================
--- plugins/exchange-operations/exchange-delegates-user.c (revision 33422)
+++ plugins/exchange-operations/exchange-delegates-user.c (working copy)
@@ -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>
Index: plugins/startup-wizard/startup-wizard.c
===================================================================
--- plugins/startup-wizard/startup-wizard.c (revision 33422)
+++ plugins/startup-wizard/startup-wizard.c (working copy)
@@ -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"
Index: plugins/itip-formatter/itip-view.c
===================================================================
--- plugins/itip-formatter/itip-view.c (revision 33422)
+++ plugins/itip-formatter/itip-view.c (working copy)
@@ -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 *la
{
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 *kla
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);
}
Index: mail/mail-tools.c
===================================================================
--- mail/mail-tools.c (revision 33422)
+++ mail/mail-tools.c (working copy)
@@ -116,7 +116,7 @@ mail_tool_get_local_movemail_path (const
*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);
Index: mail/mail-send-recv.c
===================================================================
--- mail/mail-send-recv.c (revision 33422)
+++ mail/mail-send-recv.c (working copy)
@@ -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(C
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
{
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 _fold
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 butto
}
}
-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, con
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(cons
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
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, Ca
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, Ca
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_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_set_policy (
+ GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+ 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, Ca
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, Ca
} 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
}
}
-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 *drive
}
}
-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,
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,
/* 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, Cam
}
}
-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 k
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;
Index: mail/em-format-html-display.c
===================================================================
--- mail/em-format-html-display.c (revision 33422)
+++ mail/em-format-html-display.c (working copy)
@@ -1982,7 +1982,7 @@ efhd_bonobo_object(EMFormatHTML *efh, Gt
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, Gt
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;
}
Index: mail/em-account-prefs.c
===================================================================
--- mail/em-account-prefs.c (revision 33422)
+++ mail/em-account-prefs.c (working copy)
@@ -566,10 +566,10 @@ em_account_prefs_construct (EMAccountPre
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");
Index: mail/em-folder-view.c
===================================================================
--- mail/em-folder-view.c (revision 33422)
+++ mail/em-folder-view.c (working copy)
@@ -571,10 +571,10 @@ emfv_setup_view_instance(EMFolderView *e
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);
Index: mail/em-utils.c
===================================================================
--- mail/em-utils.c (revision 33422)
+++ mail/em-utils.c (working copy)
@@ -489,7 +489,7 @@ em_utils_save_part_to_file(GtkWidget *pa
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;
Index: mail/em-migrate.c
===================================================================
--- mail/em-migrate.c (revision 33422)
+++ mail/em-migrate.c (working copy)
@@ -1523,7 +1523,7 @@ cp_r (const char *src, const char *dest,
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 *sess
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 cha
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 cha
/* 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 (cons
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 (con
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 *ev
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_di
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_
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, i
/* 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));
Index: mail/em-folder-tree-model.c
===================================================================
--- mail/em-folder-tree-model.c (revision 33422)
+++ mail/em-folder-tree-model.c (working copy)
@@ -1054,7 +1054,7 @@ em_folder_tree_model_save_state (EMFolde
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;
}
Index: mail/em-format-html.c
===================================================================
--- mail/em-format-html.c (revision 33422)
+++ mail/em-format-html.c (working copy)
@@ -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);
Index: mail/mail-component.c
===================================================================
--- mail/mail-component.c (revision 33422)
+++ mail/mail-component.c (working copy)
@@ -1181,7 +1181,7 @@ mail_component_init (MailComponent *comp
*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);
Index: mail/message-list.c
===================================================================
--- mail/message-list.c (revision 33422)
+++ mail/message-list.c (working copy)
@@ -2043,8 +2043,7 @@ message_list_init (MessageList *message_
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);
Index: filter/filter-label.c
===================================================================
--- filter/filter-label.c (revision 33422)
+++ filter/filter-label.c (working copy)
@@ -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>
Index: composer/e-msg-composer-hdrs.c
===================================================================
--- composer/e-msg-composer-hdrs.c (revision 33422)
+++ composer/e-msg-composer-hdrs.c (working copy)
@@ -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 (BonoboUICompone
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);
Index: e-util/e-gtk-utils.c
===================================================================
--- e-util/e-gtk-utils.c (revision 33422)
+++ e-util/e-gtk-utils.c (working copy)
@@ -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;
-}
Index: e-util/e-gtk-utils.h
===================================================================
--- e-util/e-gtk-utils.h (revision 33422)
+++ e-util/e-gtk-utils.h (working copy)
@@ -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
Index: e-util/e-mktemp.c
===================================================================
--- e-util/e-mktemp.c (revision 33422)
+++ e-util/e-mktemp.c (working copy)
@@ -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;
}
Index: e-util/e-gui-utils.c
===================================================================
--- e-util/e-gui-utils.c (revision 33422)
+++ e-util/e-gui-utils.c (working copy)
@@ -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
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;
}
-
Index: e-util/e-gui-utils.h
===================================================================
--- e-util/e-gui-utils.h (revision 33422)
+++ e-util/e-gui-utils.h (working copy)
@@ -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);
Index: e-util/eggtrayicon.c
===================================================================
--- e-util/eggtrayicon.c (revision 33422)
+++ e-util/eggtrayicon.c (working copy)
@@ -1253,8 +1253,7 @@ gtk_status_icon_init (GtkStatusIcon *sta
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
Index: e-util/e-sorter-array.c
===================================================================
--- e-util/e-sorter-array.c (revision 33422)
+++ e-util/e-sorter-array.c (working copy)
@@ -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
Index: e-util/e-util.c
===================================================================
--- e-util/e-util.c (revision 33422)
+++ e-util/e-util.c (working copy)
@@ -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
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
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
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,
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)
-{
- size_t l, u, idx;
- const void *p;
- int comparison;
+void
+e_bsearch (gconstpointer key,
+ gconstpointer base,
+ gsize nmemb,
+ gsize size,
+ ESortCompareFunc compare,
+ gpointer closure,
+ gsize *start,
+ gsize *end)
+{
+ gsize l, u, idx;
+ gconstpointer p;
+ gint comparison;
if (!(start || end))
return;
@@ -625,20 +353,20 @@ void e_bsearch
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
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
*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)
-{
- char buf[10];
- char *sp;
- char *ffmt;
- size_t ret;
+gsize
+e_strftime_fix_am_pm (gchar *str, gsize max, const gchar *fmt,
+ const struct tm *tm)
+{
+ 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, siz
* 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, siz
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, siz
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_
* 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_st
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_st
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_st
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, gbool
* 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);
Index: e-util/e-util.h
===================================================================
--- e-util/e-util.h (revision 33422)
+++ e-util/e-util.h (working copy)
@@ -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
}
Index: e-util/e-icon-factory.c
===================================================================
--- e-util/e-icon-factory.c (revision 33422)
+++ e-util/e-icon-factory.c (working copy)
@@ -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 c
{
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 c
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 c
} 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 *ico
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 *ico
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 *ic
{
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
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
g_object_ref (icon->pixbuf);
}
}
-
- pthread_mutex_unlock (&lock);
-
+
+ g_static_mutex_unlock (&mutex);
+
return list;
}
Index: e-util/e-xml-utils.c
===================================================================
--- e-util/e-xml-utils.c (revision 33422)
+++ e-util/e-xml-utils.c (working copy)
@@ -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>
Index: e-util/e-dialog-widgets.c
===================================================================
--- e-util/e-dialog-widgets.c (revision 33422)
+++ e-util/e-dialog-widgets.c (working copy)
@@ -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, in
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,
*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, Gtk
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, GtkToggl
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 *toggl
*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, Gtk
/* 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 *sp
*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, GtkEdi
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.
**/
Index: e-util/Makefile.am
===================================================================
--- e-util/Makefile.am (revision 33422)
+++ e-util/Makefile.am (working copy)
@@ -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 \
Index: widgets/text/e-text-model-uri.c
===================================================================
--- widgets/text/e-text-model-uri.c (revision 33422)
+++ widgets/text/e-text-model-uri.c (working copy)
@@ -96,7 +96,7 @@ e_text_model_uri_dispose (GObject *objec
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 *
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);
}
Index: widgets/text/e-completion-view.c
===================================================================
--- widgets/text/e-completion-view.c (revision 33422)
+++ widgets/text/e-completion-view.c (working copy)
@@ -810,7 +810,7 @@ e_completion_view_set_width (ECompletion
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 (ECompletion
/* 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
Index: widgets/text/e-text.c
===================================================================
--- widgets/text/e-text.c (revision 33422)
+++ widgets/text/e-text.c (working copy)
@@ -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, Gdk
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, Gdk
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, Gdk
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, Gdk
{
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, Gdk
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;
}
}
Index: widgets/text/e-completion-callbacks.c
===================================================================
--- widgets/text/e-completion-callbacks.c (revision 33422)
+++ widgets/text/e-completion-callbacks.c (working copy)
@@ -92,7 +92,7 @@ e_completion_callbacks_new (ECompletionC
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;
Index: widgets/text/e-entry.c
===================================================================
--- widgets/text/e-entry.c (revision 33422)
+++ widgets/text/e-entry.c (working copy)
@@ -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
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 (EEntr
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 *
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 *
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
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,
Index: widgets/menus/gal-view-new-dialog.c
===================================================================
--- widgets/menus/gal-view-new-dialog.c (revision 33422)
+++ widgets/menus/gal-view-new-dialog.c (working copy)
@@ -100,10 +100,10 @@ gal_view_new_dialog_init (GalViewNewDial
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,
Index: widgets/menus/gal-view-collection.c
===================================================================
--- widgets/menus/gal-view-collection.c (revision 33422)
+++ widgets/menus/gal-view-collection.c (working copy)
@@ -166,7 +166,10 @@ gal_view_collection_dispose (GObject *ob
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 *col
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 *coll
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 (G
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 (G
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 (G
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);
Index: widgets/menus/gal-view-instance-save-as-dialog.c
===================================================================
--- widgets/menus/gal-view-instance-save-as-dialog.c (revision 33422)
+++ widgets/menus/gal-view-instance-save-as-dialog.c (working copy)
@@ -205,10 +205,10 @@ gal_view_instance_save_as_dialog_init (G
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,
Index: widgets/menus/gal-view-instance.c
===================================================================
--- widgets/menus/gal-view-instance.c (revision 33422)
+++ widgets/menus/gal-view-instance.c (working copy)
@@ -349,11 +349,11 @@ gal_view_instance_construct (GalViewInst
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);
Index: widgets/menus/gal-define-views-dialog.c
===================================================================
--- widgets/menus/gal-define-views-dialog.c (revision 33422)
+++ widgets/menus/gal-define-views-dialog.c (working copy)
@@ -258,12 +258,12 @@ gal_define_views_dialog_init (GalDefineV
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,
Index: widgets/table/e-table-size-test.c
===================================================================
--- widgets/table/e-table-size-test.c (revision 33422)
+++ widgets/table/e-table-size-test.c (working copy)
@@ -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);
Index: widgets/table/e-cell-tree.c
===================================================================
--- widgets/table/e-cell-tree.c (revision 33422)
+++ widgets/table/e-cell-tree.c (working copy)
@@ -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
Index: widgets/table/e-cell-date.c
===================================================================
--- widgets/table/e-cell-date.c (revision 33422)
+++ widgets/table/e-cell-date.c (working copy)
@@ -108,8 +108,7 @@ ecd_get_text(ECellText *cell, ETableMode
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
Index: widgets/table/e-table-header-item.c
===================================================================
--- widgets/table/e-table-header-item.c (revision 33422)
+++ widgets/table/e-table-header-item.c (working copy)
@@ -1552,7 +1552,7 @@ ethi_header_context_menu (ETableHeaderIt
/* 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 (ETableHeaderIt
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, GdkEv
((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);
Index: widgets/table/test-table.c
===================================================================
--- widgets/table/test-table.c (revision 33422)
+++ widgets/table/test-table.c (working copy)
@@ -446,7 +446,7 @@ compare=\"string\"/>\n", i, column_label
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
Index: widgets/table/e-table-search.c
===================================================================
--- widgets/table/e-table-search.c (revision 33422)
+++ widgets/table/e-table-search.c (working copy)
@@ -127,7 +127,7 @@ e_table_search_class_init (GObjectClass
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
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,
Index: widgets/table/e-table-extras.c
===================================================================
--- widgets/table/e-table-extras.c (revision 33422)
+++ widgets/table/e-table-extras.c (working copy)
@@ -209,10 +209,8 @@ e_table_extras_add_cell (ETableExtra
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);
}
Index: widgets/table/e-cell-combo.c
===================================================================
--- widgets/table/e-cell-combo.c (revision 33422)
+++ widgets/table/e-cell-combo.c (working copy)
@@ -365,7 +365,7 @@ e_cell_combo_show_popup (ECellCombo *e
}
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);
Index: widgets/table/e-table-example-1.c
===================================================================
--- widgets/table/e-table-example-1.c (revision 33422)
+++ widgets/table/e-table-example-1.c (working copy)
@@ -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);
Index: widgets/table/e-table-item.c
===================================================================
--- widgets/table/e-table-item.c (revision 33422)
+++ widgets/table/e-table-item.c (working copy)
@@ -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, GdkEve
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, GdkEve
}
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, GdkEve
#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, GdkEve
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, GdkEve
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],
Index: widgets/table/e-tree.c
===================================================================
--- widgets/table/e-tree.c (revision 33422)
+++ widgets/table/e-tree.c (working copy)
@@ -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 *
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
Index: widgets/table/e-table-sort-info.c
===================================================================
--- widgets/table/e-table-sort-info.c (revision 33422)
+++ widgets/table/e-table-sort-info.c (working copy)
@@ -82,7 +82,7 @@ e_table_sort_info_class_init (ETableSort
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 (ETableSort
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,
Index: widgets/table/e-tree-model.c
===================================================================
--- widgets/table/e-tree-model.c (revision 33422)
+++ widgets/table/e-tree-model.c (working copy)
@@ -69,7 +69,7 @@ e_tree_model_class_init (GObjectClass *k
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 *k
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 *k
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 *k
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 *k
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 *k
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 *k
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 *k
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 *k
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,
Index: widgets/table/e-cell-text.c
===================================================================
--- widgets/table/e-cell-text.c (revision 33422)
+++ widgets/table/e-cell-text.c (working copy)
@@ -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);
Index: widgets/table/e-table-example-2.c
===================================================================
--- widgets/table/e-table-example-2.c (revision 33422)
+++ widgets/table/e-table-example-2.c (working copy)
@@ -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);
}
Index: widgets/table/e-tree-memory.c
===================================================================
--- widgets/table/e-tree-memory.c (revision 33422)
+++ widgets/table/e-tree-memory.c (working copy)
@@ -357,7 +357,7 @@ e_tree_memory_class_init (ETreeMemoryCla
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 (ETr
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;
Index: widgets/table/e-table-sorting-utils.c
===================================================================
--- widgets/table/e-table-sorting-utils.c (revision 33422)
+++ widgets/table/e-table-sorting-utils.c (working copy)
@@ -142,7 +142,8 @@ e_table_sorting_utils_sort(ETableModel *
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(ETreeMod
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++) {
Index: widgets/table/e-table.c
===================================================================
--- widgets/table/e-table.c (revision 33422)
+++ widgets/table/e-table.c (working copy)
@@ -621,8 +621,10 @@ header_canvas_size_allocate (GtkWidget *
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
Index: widgets/table/e-table-header.c
===================================================================
--- widgets/table/e-table-header.c (revision 33422)
+++ widgets/table/e-table-header.c (working copy)
@@ -277,7 +277,7 @@ e_table_header_class_init (GObjectClass
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
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
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
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,
Index: widgets/table/e-table-model.c
===================================================================
--- widgets/table/e-table-model.c (revision 33422)
+++ widgets/table/e-table-model.c (working copy)
@@ -284,7 +284,7 @@ e_table_model_class_init (GObjectClass *
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 *
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 *
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 *
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 *
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 *
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 *
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,
Index: widgets/table/e-table-config.c
===================================================================
--- widgets/table/e-table-config.c (revision 33422)
+++ widgets/table/e-table-config.c (working copy)
@@ -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_
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,
Index: widgets/table/e-tree-sorted.c
===================================================================
--- widgets/table/e-tree-sorted.c (revision 33422)
+++ widgets/table/e-tree-sorted.c (working copy)
@@ -1196,7 +1196,7 @@ e_tree_sorted_class_init (ETreeSortedCla
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,
Index: widgets/e-timezone-dialog/e-timezone-dialog.c
===================================================================
--- widgets/e-timezone-dialog/e-timezone-dialog.c (revision 33422)
+++ widgets/e-timezone-dialog/e-timezone-dialog.c (working copy)
@@ -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 (ETimezoneDi
| 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,
/* 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) {
Index: widgets/misc/e-dateedit.c
===================================================================
--- widgets/misc/e-dateedit.c (revision 33422)
+++ widgets/misc/e-dateedit.c (working copy)
@@ -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 *ded
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);
}
Index: widgets/misc/e-combo-cell-editable.c
===================================================================
--- widgets/misc/e-combo-cell-editable.c (revision 33422)
+++ widgets/misc/e-combo-cell-editable.c (working copy)
@@ -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);
Index: widgets/misc/e-dateedit.h
===================================================================
--- widgets/misc/e-dateedit.h (revision 33422)
+++ widgets/misc/e-dateedit.h (working copy)
@@ -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);
Index: widgets/misc/e-clipped-label.c
===================================================================
--- widgets/misc/e-clipped-label.c (revision 33422)
+++ widgets/misc/e-clipped-label.c (working copy)
@@ -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);
Index: widgets/misc/test-calendar.c
===================================================================
--- widgets/misc/test-calendar.c (revision 33422)
+++ widgets/misc/test-calendar.c (working copy)
@@ -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);
Index: widgets/misc/e-combo-button.c
===================================================================
--- widgets/misc/e-combo-button.c (revision 33422)
+++ widgets/misc/e-combo-button.c (working copy)
@@ -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);
Index: widgets/misc/e-config-page.c
===================================================================
--- widgets/misc/e-config-page.c (revision 33422)
+++ widgets/misc/e-config-page.c (working copy)
@@ -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);
}
Index: widgets/misc/e-multi-config-dialog.c
===================================================================
--- widgets/misc/e-multi-config-dialog.c (revision 33422)
+++ widgets/misc/e-multi-config-dialog.c (working copy)
@@ -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 (EMultiConfig
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 (EMultiC
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);
}
Index: widgets/misc/test-info-label.c
===================================================================
--- widgets/misc/test-info-label.c (revision 33422)
+++ widgets/misc/test-info-label.c (working copy)
@@ -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");
Index: widgets/misc/e-dropdown-button.c
===================================================================
--- widgets/misc/e-dropdown-button.c (revision 33422)
+++ widgets/misc/e-dropdown-button.c (working copy)
@@ -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
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;
Index: widgets/misc/e-cell-date-edit.c
===================================================================
--- widgets/misc/e-cell-date-edit.c (revision 33422)
+++ widgets/misc/e-cell-date-edit.c (working copy)
@@ -224,9 +224,7 @@ e_cell_date_edit_init (ECellDateEdit *
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 *
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 (E
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_warni
{
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_warni
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 (GtkLi
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);
}
Index: widgets/misc/e-cell-percent.c
===================================================================
--- widgets/misc/e-cell-percent.c (revision 33422)
+++ widgets/misc/e-cell-percent.c (working copy)
@@ -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
Index: widgets/misc/e-filter-bar.c
===================================================================
--- widgets/misc/e-filter-bar.c (revision 33422)
+++ widgets/misc/e-filter-bar.c (working copy)
@@ -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);
Index: widgets/misc/e-url-entry.c
===================================================================
--- widgets/misc/e-url-entry.c (revision 33422)
+++ widgets/misc/e-url-entry.c (working copy)
@@ -150,7 +150,7 @@ mnemonic_activate (GtkWidget *widget, gb
GtkWidget *
e_url_entry_new (void)
{
- return gtk_type_new (E_TYPE_URL_ENTRY);
+ return g_object_new (E_TYPE_URL_ENTRY, NULL);
}
Index: widgets/misc/gal-combo-box.c
===================================================================
--- widgets/misc/gal-combo-box.c (revision 33422)
+++ widgets/misc/gal-combo-box.c (working copy)
@@ -416,8 +416,7 @@ gal_combo_box_init (GalComboBox *combo_b
*/
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 *c
/* 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 *
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 *pop
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 *pop
}
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);
}
Index: widgets/misc/e-map.c
===================================================================
--- widgets/misc/e-map.c (revision 33422)
+++ widgets/misc/e-map.c (working copy)
@@ -507,8 +507,7 @@ e_map_set_scroll_adjustments (GtkWidget
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
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);
Index: widgets/misc/e-task-widget.c
===================================================================
--- widgets/misc/e-task-widget.c (revision 33422)
+++ widgets/misc/e-task-widget.c (working copy)
@@ -167,8 +167,7 @@ e_task_widget_construct (ETaskWidget *ta
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);
}
Index: widgets/misc/test-multi-config-dialog.c
===================================================================
--- widgets/misc/test-multi-config-dialog.c (revision 33422)
+++ widgets/misc/test-multi-config-dialog.c (working copy)
@@ -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 ();
Index: widgets/misc/gal-combo-text.c
===================================================================
--- widgets/misc/gal-combo-text.c (revision 33422)
+++ widgets/misc/gal-combo-text.c (working copy)
@@ -392,7 +392,7 @@ gal_combo_text_construct (GalComboText *
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;
Index: widgets/misc/test-dropdown-button.c
===================================================================
--- widgets/misc/test-dropdown-button.c (revision 33422)
+++ widgets/misc/test-dropdown-button.c (working copy)
@@ -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);
Index: widgets/misc/e-search-bar.c
===================================================================
--- widgets/misc/e-search-bar.c (revision 33422)
+++ widgets/misc/e-search-bar.c (working copy)
@@ -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_i
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);
Index: widgets/misc/e-calendar.c
===================================================================
--- widgets/misc/e-calendar.c (revision 33422)
+++ widgets/misc/e-calendar.c (working copy)
@@ -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;
}
}
Index: calendar/gui/e-select-names-renderer.c
===================================================================
--- calendar/gui/e-select-names-renderer.c (revision 33422)
+++ calendar/gui/e-select-names-renderer.c (working copy)
@@ -61,7 +61,7 @@ e_select_names_renderer_editing_done (Gt
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;
}
Index: calendar/gui/dialogs/task-details-page.c
===================================================================
--- calendar/gui/dialogs/task-details-page.c (revision 33422)
+++ calendar/gui/dialogs/task-details-page.c (working copy)
@@ -158,7 +158,7 @@ task_details_page_finalize (GObject *obj
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 *tdpa
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");
Index: calendar/gui/dialogs/schedule-page.c
===================================================================
--- calendar/gui/dialogs/schedule-page.c (revision 33422)
+++ calendar/gui/dialogs/schedule-page.c (working copy)
@@ -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
Index: calendar/gui/dialogs/task-page.c
===================================================================
--- calendar/gui/dialogs/task-page.c (revision 33422)
+++ calendar/gui/dialogs/task-page.c (working copy)
@@ -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, ECa
{
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;
Index: calendar/gui/dialogs/comp-editor.c
===================================================================
--- calendar/gui/dialogs/comp-editor.c (revision 33422)
+++ calendar/gui/dialogs/comp-editor.c (working copy)
@@ -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 *edito
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 *ob
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);
}
Index: calendar/gui/dialogs/alarm-dialog.glade
===================================================================
--- calendar/gui/dialogs/alarm-dialog.glade (revision 33422)
+++ calendar/gui/dialogs/alarm-dialog.glade (working copy)
@@ -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>
Index: calendar/gui/dialogs/event-editor.c
===================================================================
--- calendar/gui/dialogs/event-editor.c (revision 33422)
+++ calendar/gui/dialogs/event-editor.c (working copy)
@@ -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,
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,
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);
Index: calendar/gui/dialogs/recurrence-page.c
===================================================================
--- calendar/gui/dialogs/recurrence-page.c (revision 33422)
+++ calendar/gui/dialogs/recurrence-page.c (working copy)
@@ -286,7 +286,7 @@ recurrence_page_finalize (GObject *objec
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");
Index: calendar/gui/dialogs/calendar-setup.c
===================================================================
--- calendar/gui/dialogs/calendar-setup.c (revision 33422)
+++ calendar/gui/dialogs/calendar-setup.c (working copy)
@@ -23,6 +23,8 @@
#include <config.h>
#endif
+#include <string.h>
+
#include <gtk/gtkbox.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkstock.h>
Index: calendar/gui/dialogs/memo-editor.c
===================================================================
--- calendar/gui/dialogs/memo-editor.c (revision 33422)
+++ calendar/gui/dialogs/memo-editor.c (working copy)
@@ -213,8 +213,7 @@ memo_editor_construct (MemoEditor *me, E
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);
Index: calendar/gui/dialogs/task-editor.c
===================================================================
--- calendar/gui/dialogs/task-editor.c (revision 33422)
+++ calendar/gui/dialogs/task-editor.c (working copy)
@@ -418,8 +418,7 @@ task_editor_construct (TaskEditor *te, E
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, E
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);
Index: calendar/gui/dialogs/alarm-dialog.c
===================================================================
--- calendar/gui/dialogs/alarm-dialog.c (revision 33422)
+++ calendar/gui/dialogs/alarm-dialog.c (working copy)
@@ -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 *
}
}
- 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;
Index: calendar/gui/dialogs/event-page.c
===================================================================
--- calendar/gui/dialogs/event-page.c (revision 33422)
+++ calendar/gui/dialogs/event-page.c (working copy)
@@ -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
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");
Index: calendar/gui/dialogs/memo-page.c
===================================================================
--- calendar/gui/dialogs/memo-page.c (revision 33422)
+++ calendar/gui/dialogs/memo-page.c (working copy)
@@ -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 *
} 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, C
{
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;
Index: calendar/gui/dialogs/comp-editor-page.c
===================================================================
--- calendar/gui/dialogs/comp-editor-page.c (revision 33422)
+++ calendar/gui/dialogs/comp-editor-page.c (working copy)
@@ -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 *obj
}
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_erro
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);
}
Index: calendar/gui/e-memos.c
===================================================================
--- calendar/gui/e-memos.c (revision 33422)
+++ calendar/gui/e-memos.c (working copy)
@@ -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);
}
Index: calendar/gui/e-day-view.c
===================================================================
--- calendar/gui/e-day-view.c (revision 33422)
+++ calendar/gui/e-day-view.c (working copy)
@@ -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_v
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;
}
}
Index: calendar/gui/tasks-component.c
===================================================================
--- calendar/gui/tasks-component.c (revision 33422)
+++ calendar/gui/tasks-component.c (working copy)
@@ -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);
Index: calendar/gui/e-itip-control.c
===================================================================
--- calendar/gui/e-itip-control.c (revision 33422)
+++ calendar/gui/e-itip-control.c (working copy)
@@ -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 *it
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 *it
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 *it
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 *it
}
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
Index: calendar/gui/e-timezone-entry.c
===================================================================
--- calendar/gui/e-timezone-entry.c (revision 33422)
+++ calendar/gui/e-timezone-entry.c (working copy)
@@ -120,7 +120,7 @@ e_timezone_entry_init (ETimezoneEntry *
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);
Index: calendar/gui/gnome-cal.c
===================================================================
--- calendar/gui/gnome-cal.c (revision 33422)
+++ calendar/gui/gnome-cal.c (working copy)
@@ -2211,7 +2211,8 @@ display_view (GnomeCalendar *gcal, Gnome
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
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;
Index: calendar/gui/e-tasks.c
===================================================================
--- calendar/gui/e-tasks.c (revision 33422)
+++ calendar/gui/e-tasks.c (working copy)
@@ -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);
}
Index: calendar/gui/e-calendar-table.c
===================================================================
--- calendar/gui/e-calendar-table.c (revision 33422)
+++ calendar/gui/e-calendar-table.c (working copy)
@@ -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>
Index: calendar/gui/e-week-view.c
===================================================================
--- calendar/gui/e-week-view.c (revision 33422)
+++ calendar/gui/e-week-view.c (working copy)
@@ -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;
}
}
Index: calendar/gui/print.c
===================================================================
--- calendar/gui/print.c (revision 33422)
+++ calendar/gui/print.c (working copy)
@@ -2046,7 +2046,7 @@ range_selector_new (GtkWidget *dialog, t
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, t
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
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;
Index: calendar/gui/calendar-component.c
===================================================================
--- calendar/gui/calendar-component.c (revision 33422)
+++ calendar/gui/calendar-component.c (working copy)
@@ -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));
Index: calendar/gui/memos-component.c
===================================================================
--- calendar/gui/memos-component.c (revision 33422)
+++ calendar/gui/memos-component.c (working copy)
@@ -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);
Index: calendar/gui/e-day-view-time-item.c
===================================================================
--- calendar/gui/e-day-view-time-item.c (revision 33422)
+++ calendar/gui/e-day-view-time-item.c (working copy)
@@ -806,9 +806,9 @@ e_day_view_time_item_show_popup_menu (ED
*/
_("%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);
Index: calendar/gui/e-cal-component-preview.c
===================================================================
--- calendar/gui/e-cal-component-preview.c (revision 33422)
+++ calendar/gui/e-cal-component-preview.c (working copy)
@@ -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>
Index: calendar/gui/e-meeting-time-sel.c
===================================================================
--- calendar/gui/e-meeting-time-sel.c (revision 33422)
+++ calendar/gui/e-meeting-time-sel.c (working copy)
@@ -351,7 +351,7 @@ e_meeting_time_selector_construct (EMeet
/* 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 (EMeet
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 (EMeet
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 (EMeet
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 (EMeet
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 (EMeet
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 (E
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
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 (GtkWi
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 (GtkWi
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 (EMe
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
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;
Index: calendar/gui/e-cal-component-memo-preview.c
===================================================================
--- calendar/gui/e-cal-component-memo-preview.c (revision 33422)
+++ calendar/gui/e-cal-component-memo-preview.c (working copy)
@@ -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>
Index: calendar/gui/e-memo-table.c
===================================================================
--- calendar/gui/e-memo-table.c (revision 33422)
+++ calendar/gui/e-memo-table.c (working copy)
@@ -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>
Index: calendar/gui/e-cell-date-edit-text.c
===================================================================
--- calendar/gui/e-cell-date-edit-text.c (revision 33422)
+++ calendar/gui/e-cell-date-edit-text.c (working copy)
@@ -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 *ec
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);
}
Index: calendar/importers/icalendar-importer.c
===================================================================
--- calendar/importers/icalendar-importer.c (revision 33422)
+++ calendar/importers/icalendar-importer.c (working copy)
@@ -198,7 +198,7 @@ button_toggled_cb (GtkWidget *widget, st
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
Index: calendar/conduits/todo/todo-conduit.c
===================================================================
--- calendar/conduits/todo/todo-conduit.c (revision 33422)
+++ calendar/conduits/todo/todo-conduit.c (working copy)
@@ -127,11 +127,9 @@ todoconduit_load_configuration (guint32
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));
Index: calendar/conduits/calendar/calendar-conduit.c
===================================================================
--- calendar/conduits/calendar/calendar-conduit.c (revision 33422)
+++ calendar/conduits/calendar/calendar-conduit.c (working copy)
@@ -120,11 +120,9 @@ calconduit_load_configuration (guint32 p
/* 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));
Index: calendar/conduits/memo/memo-conduit.c
===================================================================
--- calendar/conduits/memo/memo-conduit.c (revision 33422)
+++ calendar/conduits/memo/memo-conduit.c (working copy)
@@ -125,11 +125,9 @@ memoconduit_load_configuration (guint32
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));
Index: a11y/e-text/gal-a11y-e-text.c
===================================================================
--- a11y/e-text/gal-a11y-e-text.c (revision 33422)
+++ a11y/e-text/gal-a11y-e-text.c (working copy)
@@ -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);
}
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]