diff options
author | Not Zed <NotZed@Ximian.com> | 2002-11-18 19:29:35 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-11-18 19:29:35 +0800 |
commit | abda9814844d31daaf4c6355da9a886c69bda9be (patch) | |
tree | 96d29ba229f701c22f6af2216cb1336d45b0c773 /shell/importer | |
parent | be05081ea93b28c601dcb62a5190200c995c9d4d (diff) | |
download | gsoc2013-evolution-abda9814844d31daaf4c6355da9a886c69bda9be.tar.gz gsoc2013-evolution-abda9814844d31daaf4c6355da9a886c69bda9be.tar.zst gsoc2013-evolution-abda9814844d31daaf4c6355da9a886c69bda9be.zip |
from clicked_cb. (start_import): gtkdialogise.
2002-11-18 Not Zed <NotZed@Ximian.com>
* importer/importer.c (dialog_response_cb): from clicked_cb.
(start_import): gtkdialogise.
* e-shell-importer.c: removed redundant header.
(create_html): Removed utf8 from locale stuff.
(get_name_from_component_info): oaf->bonobo activation.
(get_iid_for_filetype): "
(create_plugin_menu): Likewise, and change oafiid to bonoboiid
(get_intelligent_importers): "
(prepare_intelligent_page): "
(show_import_wizard): add null domain to glade_xml_new.
(choose_importer_from_list): gtkdialogise.
(dialog_response_cb): changed from dialog_clicked_cb.
(start_import): gtkdialogise.
(show_error): use gtk message box.
(error_response_cb): callback to close error box.
(show_import_wizard): gnome_druid_page_start/finish ->
gnome_druid_page_edge.
(prepare_file_page):
(filename_changed): set HELP button insensitive.
(create_plugin_menu): casts for warnings and fix a typo,
set_data->set_data_full.
(import_druid_finish): folder_selection_dialog api change(?),
allow create.
(dialog_weak_notify): renamed from close_dialog().
(show_import_wizard): remove gnome_dialog_close_hides -> its a
gtkwindow anyway(!).
* Makefile.am (evolution_LDADD): Added back importer.
(evolution_SOURCES): Added back importer.
* importer/intelligent.c (get_intelligent_importers):
bonobo-activationised.
(create_gui): gtkdialogise.
(intelligent_importer_init): gtkdialogise.
(create_gui): remove gnome_util_user_home().
(intelligent_importer_init): "
* importer/evolution-importer.c (finalise): from destroy.
(evolution_importer_new): type_new->object_new.
* importer/evolution-importer-listener.c (finalise): from destroy.
(evolution_importer_listener_new): type_new->object_new.
* importer/evolution-importer-client.c (destroy): removed, as it
wasn't used anyway.
(evolution_importer_client_new): g_object_new.
(finalise): added, tho doesn't do anythign yet, should it unref
the client->objref? This whole class doesn't seem much use.
* importer/evolution-importer-client.h: removed
bonobo-object-client, change to g_object.
* importer/*.[ch]: ran fix script over everything.
* importer/evolution-intelligent-importer.c: gobjectise.
(finalise): renamed from destroy.
(evolution_intelligent_importer_new): gtk_type_new -> g_object_new
svn path=/trunk/; revision=18821
Diffstat (limited to 'shell/importer')
-rw-r--r-- | shell/importer/evolution-importer-client.c | 24 | ||||
-rw-r--r-- | shell/importer/evolution-importer-client.h | 15 | ||||
-rw-r--r-- | shell/importer/evolution-importer-listener.c | 16 | ||||
-rw-r--r-- | shell/importer/evolution-importer-listener.h | 10 | ||||
-rw-r--r-- | shell/importer/evolution-importer.c | 14 | ||||
-rw-r--r-- | shell/importer/evolution-importer.h | 10 | ||||
-rw-r--r-- | shell/importer/evolution-intelligent-importer.c | 14 | ||||
-rw-r--r-- | shell/importer/evolution-intelligent-importer.h | 10 | ||||
-rw-r--r-- | shell/importer/intelligent.c | 80 |
9 files changed, 95 insertions, 98 deletions
diff --git a/shell/importer/evolution-importer-client.c b/shell/importer/evolution-importer-client.c index 0597b1127b..99e096a833 100644 --- a/shell/importer/evolution-importer-client.c +++ b/shell/importer/evolution-importer-client.c @@ -32,29 +32,29 @@ #include <bonobo/bonobo-main.h> #include <gal/util/e-util.h> -#include <liboaf/liboaf.h> - #include "GNOME_Evolution_Importer.h" -#define PARENT_TYPE gtk_object_get_type () -static GtkObjectClass *parent_class = NULL; +#define PARENT_TYPE G_TYPE_OBJECT +static GObjectClass *parent_class = NULL; static void -destroy (GtkObject *object) +finalise (GObject *object) { - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + /* FIXME: should this unref the client->objref?? */ + + parent_class->finalize(object); } static void class_init (EvolutionImporterClientClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; - object_class = GTK_OBJECT_CLASS (klass); - parent_class = gtk_type_class (PARENT_TYPE); + object_class = G_OBJECT_CLASS (klass); + parent_class = g_type_class_ref(PARENT_TYPE); - object_class->destroy = destroy; + object_class->finalize = finalise; } static void @@ -77,7 +77,7 @@ evolution_importer_client_new (const CORBA_Object objref) g_return_val_if_fail (objref != CORBA_OBJECT_NIL, NULL); - client = gtk_type_new (evolution_importer_client_get_type ()); + client = g_object_new (evolution_importer_client_get_type (), NULL); client->objref = objref; return client; @@ -100,7 +100,7 @@ evolution_importer_client_new_from_id (const char *id) g_return_val_if_fail (id != NULL, NULL); CORBA_exception_init (&ev); - objref = oaf_activate_from_id ((char *) id, 0, NULL, &ev); + objref = bonobo_activation_activate_from_id ((char *) id, 0, NULL, &ev); if (ev._major != CORBA_NO_EXCEPTION) { CORBA_exception_free (&ev); g_warning ("Could not start %s.", id); diff --git a/shell/importer/evolution-importer-client.h b/shell/importer/evolution-importer-client.h index 9485c7307f..13d144e076 100644 --- a/shell/importer/evolution-importer-client.h +++ b/shell/importer/evolution-importer-client.h @@ -24,7 +24,6 @@ #define EVOLUTION_IMPORTER_CLIENT_H #include <glib.h> -#include <bonobo/bonobo-object-client.h> #include <importer/evolution-importer.h> #include <importer/evolution-importer-listener.h> @@ -34,26 +33,26 @@ extern "C" { #endif #define EVOLUTION_TYPE_IMPORTER_CLIENT (evolution_importer_client_get_type ()) -#define EVOLUTION_IMPORTER_CLIENT(obj) (GTK_CHECK_CAST ((obj), EVOLUTION_TYPE_IMPORTER_CLIENT, EvolutionImporterClient)) -#define EVOLUTION_IMPORTER_CLIENT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_IMPORTER_CLIENT, EvolutionImporterClientClass)) -#define EVOLUTION_IS_IMPORTER_CLIENT(obj) (GTK_CHECK_TYPE ((obj), EVOLUTION_TYPE_IMPORTER_CLIENT)) -#define EVOLUTION_IS_IMPORTER_CLIENT_CLASS(klass) (GTK_CHECK_TYPE ((klass), EVOLUTION_TYPE_IMPORTER_CLIENT)) +#define EVOLUTION_IMPORTER_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVOLUTION_TYPE_IMPORTER_CLIENT, EvolutionImporterClient)) +#define EVOLUTION_IMPORTER_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_IMPORTER_CLIENT, EvolutionImporterClientClass)) +#define EVOLUTION_IS_IMPORTER_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVOLUTION_TYPE_IMPORTER_CLIENT)) +#define EVOLUTION_IS_IMPORTER_CLIENT_CLASS(klass) (G_TYPE_CHECK_INSTANCE_TYPE ((klass), EVOLUTION_TYPE_IMPORTER_CLIENT)) typedef struct _EvolutionImporterClient EvolutionImporterClient; typedef struct _EvolutionImporterClientClass EvolutionImporterClientClass; struct _EvolutionImporterClient { - GtkObject parent_type; + GObject parent_type; GNOME_Evolution_Importer objref; }; struct _EvolutionImporterClientClass { - GtkObjectClass parent_class; + GObjectClass parent_class; }; -GtkType evolution_importer_client_get_type (void); +GType evolution_importer_client_get_type (void); EvolutionImporterClient *evolution_importer_client_new (const CORBA_Object objref); EvolutionImporterClient *evolution_importer_client_new_from_id (const char *id); diff --git a/shell/importer/evolution-importer-listener.c b/shell/importer/evolution-importer-listener.c index f67b963cbb..84bcfe3b7e 100644 --- a/shell/importer/evolution-importer-listener.c +++ b/shell/importer/evolution-importer-listener.c @@ -118,9 +118,9 @@ impl_GNOME_Evolution_ImporterListener_notifyResult (PortableServer_Servant serva } -/* GtkObject methods */ +/* GObject methods */ static void -destroy (GtkObject *object) +finalise (GObject *object) { EvolutionImporterListener *listener; EvolutionImporterListenerPrivate *priv; @@ -134,7 +134,7 @@ destroy (GtkObject *object) g_free (priv); listener->priv = NULL; - GTK_OBJECT_CLASS (parent_class)->destroy (object); + G_OBJECT_CLASS (parent_class)->finalize(object); } #if 0 @@ -163,13 +163,13 @@ corba_class_init (void) static void evolution_importer_listener_class_init (EvolutionImporterListenerClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; POA_GNOME_Evolution_ImporterListener__epv *epv = &klass->epv; - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = destroy; + object_class = G_OBJECT_CLASS (klass); + object_class->finalize = finalise; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref(PARENT_TYPE); epv->notifyResult = impl_GNOME_Evolution_ImporterListener_notifyResult; } @@ -213,7 +213,7 @@ evolution_importer_listener_new (EvolutionImporterListenerCallback callback, { EvolutionImporterListener *listener; - listener = gtk_type_new (evolution_importer_listener_get_type ()); + listener = g_object_new (evolution_importer_listener_get_type (), NULL); evolution_importer_listener_construct (listener, callback, closure); return listener; diff --git a/shell/importer/evolution-importer-listener.h b/shell/importer/evolution-importer-listener.h index 2c9c28422c..bbdf750140 100644 --- a/shell/importer/evolution-importer-listener.h +++ b/shell/importer/evolution-importer-listener.h @@ -34,10 +34,10 @@ extern "C" { #endif /* cplusplus */ #define EVOLUTION_TYPE_IMPORTER_LISTENER (evolution_importer_listener_get_type ()) -#define EVOLUTION_IMPORTER_LISTENER(obj) (GTK_CHECK_CAST ((obj), EVOLUTION_TYPE_IMPORTER_LISTENER, EvolutionImporterListener)) -#define EVOLUTION_IMPORTER_LISTENER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_IMPORTER_LISTENER, EvolutionImporterListenerClass)) -#define EVOLUTION_IS_IMPORTER_LISTENER(obj) (GTK_CHECK_TYPE ((obj), EVOLUTION_TYPE_IMPORTER_LISTENER)) -#define EVOLUTION_IS_IMPORTER_LISTENER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_IMPORTER_LISTENER)) +#define EVOLUTION_IMPORTER_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVOLUTION_TYPE_IMPORTER_LISTENER, EvolutionImporterListener)) +#define EVOLUTION_IMPORTER_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_IMPORTER_LISTENER, EvolutionImporterListenerClass)) +#define EVOLUTION_IS_IMPORTER_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVOLUTION_TYPE_IMPORTER_LISTENER)) +#define EVOLUTION_IS_IMPORTER_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_IMPORTER_LISTENER)) typedef struct _EvolutionImporterListener EvolutionImporterListener; typedef struct _EvolutionImporterListenerPrivate EvolutionImporterListenerPrivate; @@ -59,7 +59,7 @@ struct _EvolutionImporterListenerClass { POA_GNOME_Evolution_ImporterListener__epv epv; }; -GtkType evolution_importer_listener_get_type (void); +GType evolution_importer_listener_get_type (void); EvolutionImporterListener *evolution_importer_listener_new (EvolutionImporterListenerCallback callback, void *closure); diff --git a/shell/importer/evolution-importer.c b/shell/importer/evolution-importer.c index 8ae67a3e22..3b5603d2e1 100644 --- a/shell/importer/evolution-importer.c +++ b/shell/importer/evolution-importer.c @@ -125,7 +125,7 @@ impl_GNOME_Evolution_Importer_getError (PortableServer_Servant servant, static void -destroy (GtkObject *object) +finalise (GObject *object) { EvolutionImporter *importer; EvolutionImporterPrivate *priv; @@ -139,19 +139,19 @@ destroy (GtkObject *object) g_free (priv); importer->priv = NULL; - GTK_OBJECT_CLASS (parent_class)->destroy (object); + G_OBJECT_CLASS (parent_class)->finalize (object); } static void evolution_importer_class_init (EvolutionImporterClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; POA_GNOME_Evolution_Importer__epv *epv = &klass->epv; - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = destroy; + object_class = G_OBJECT_CLASS (klass); + object_class->finalize = finalise; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref(PARENT_TYPE); epv->supportFormat = impl_GNOME_Evolution_Importer_supportFormat; epv->loadFile = impl_GNOME_Evolution_Importer_loadFile; epv->processItem = impl_GNOME_Evolution_Importer_processItem; @@ -217,7 +217,7 @@ evolution_importer_new (EvolutionImporterSupportFormatFn support_format_fn, { EvolutionImporter *importer; - importer = gtk_type_new (evolution_importer_get_type ()); + importer = g_object_new(evolution_importer_get_type (), NULL); evolution_importer_construct (importer, support_format_fn, load_file_fn, process_item_fn, get_error_fn, closure); return importer; diff --git a/shell/importer/evolution-importer.h b/shell/importer/evolution-importer.h index eea1eb6078..b4322d091e 100644 --- a/shell/importer/evolution-importer.h +++ b/shell/importer/evolution-importer.h @@ -33,10 +33,10 @@ extern "C" { #endif /* cplusplus */ #define EVOLUTION_TYPE_IMPORTER (evolution_importer_get_type ()) -#define EVOLUTION_IMPORTER(obj) (GTK_CHECK_CAST ((obj), EVOLUTION_TYPE_IMPORTER, EvolutionImporter)) -#define EVOLUTION_IMPORTER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_IMPORTER, EvolutionImporterClass)) -#define EVOLUTION_IS_IMPORTER(obj) (GTK_CHECK_TYPE ((obj), EVOLUTION_TYPE_IMPORTER)) -#define EVOLUTION_IS_IMPORTER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_IMPORTER)) +#define EVOLUTION_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVOLUTION_TYPE_IMPORTER, EvolutionImporter)) +#define EVOLUTION_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_IMPORTER, EvolutionImporterClass)) +#define EVOLUTION_IS_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVOLUTION_TYPE_IMPORTER)) +#define EVOLUTION_IS_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_IMPORTER)) typedef struct _EvolutionImporter EvolutionImporter; typedef struct _EvolutionImporterPrivate EvolutionImporterPrivate; @@ -80,7 +80,7 @@ struct _EvolutionImporterClass { POA_GNOME_Evolution_Importer__epv epv; }; -GtkType evolution_importer_get_type (void); +GType evolution_importer_get_type (void); EvolutionImporter *evolution_importer_new (EvolutionImporterSupportFormatFn support_format_fn, EvolutionImporterLoadFileFn load_file_fn, diff --git a/shell/importer/evolution-intelligent-importer.c b/shell/importer/evolution-intelligent-importer.c index 436b019c60..79450a8458 100644 --- a/shell/importer/evolution-intelligent-importer.c +++ b/shell/importer/evolution-intelligent-importer.c @@ -105,7 +105,7 @@ impl_GNOME_Evolution_IntelligentImporter_importData (PortableServer_Servant serv static void -destroy (GtkObject *object) +finalise (GObject *object) { EvolutionIntelligentImporter *ii; @@ -118,19 +118,19 @@ destroy (GtkObject *object) g_free (ii->priv); ii->priv = NULL; - GTK_OBJECT_CLASS (parent_class)->destroy (object); + G_OBJECT_CLASS (parent_class)->finalize (object); } static void evolution_intelligent_importer_class_init (EvolutionIntelligentImporterClass *klass) { - GtkObjectClass *object_class; + GObjectClass *object_class; POA_GNOME_Evolution_IntelligentImporter__epv *epv = &klass->epv; - object_class = GTK_OBJECT_CLASS (klass); - object_class->destroy = destroy; + object_class = G_OBJECT_CLASS (klass); + object_class->finalize = finalise; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_ref(PARENT_TYPE); epv->_get_importername = impl_GNOME_Evolution_IntelligentImporter__get_importername; epv->_get_message = impl_GNOME_Evolution_IntelligentImporter__get_message; epv->canImport = impl_GNOME_Evolution_IntelligentImporter_canImport; @@ -184,7 +184,7 @@ evolution_intelligent_importer_new (EvolutionIntelligentImporterCanImportFn can_ { EvolutionIntelligentImporter *ii; - ii = gtk_type_new (evolution_intelligent_importer_get_type ()); + ii = g_object_new (evolution_intelligent_importer_get_type (), NULL); evolution_intelligent_importer_construct (ii, can_import_fn, import_data_fn, importername, message, closure); diff --git a/shell/importer/evolution-intelligent-importer.h b/shell/importer/evolution-intelligent-importer.h index 27aa35fd41..814bb9ad24 100644 --- a/shell/importer/evolution-intelligent-importer.h +++ b/shell/importer/evolution-intelligent-importer.h @@ -33,10 +33,10 @@ extern "C" { #endif /* __cplusplus */ #define EVOLUTION_TYPE_INTELLIGENT_IMPORTER (evolution_intelligent_importer_get_type ()) -#define EVOLUTION_INTELLIGENT_IMPORTER(obj) (GTK_CHECK_CAST ((obj), EVOLUTION_TYPE_INTELLIGENT_IMPORTER, EvolutionIntelligentImporter)) -#define EVOLUTION_INTELLIGENT_IMPORTER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_INTELLIGENT_IMPORTER, EvolutionIntelligentImporterClass)) -#define EVOLUTION_IS_INTELLIGENT_IMPORTER(obj) (GTK_CHECK_TYPE ((obj), EVOLUTION_TYPE_INTELLIGENT_IMPORTER)) -#define EVOLUTION_IS_INTELLIGENT_IMPORTER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_INTELLIGENT_IMPORTER)) +#define EVOLUTION_INTELLIGENT_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EVOLUTION_TYPE_INTELLIGENT_IMPORTER, EvolutionIntelligentImporter)) +#define EVOLUTION_INTELLIGENT_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EVOLUTION_TYPE_INTELLIGENT_IMPORTER, EvolutionIntelligentImporterClass)) +#define EVOLUTION_IS_INTELLIGENT_IMPORTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EVOLUTION_TYPE_INTELLIGENT_IMPORTER)) +#define EVOLUTION_IS_INTELLIGENT_IMPORTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), EVOLUTION_TYPE_INTELLIGENT_IMPORTER)) typedef struct _EvolutionIntelligentImporter EvolutionIntelligentImporter; typedef struct _EvolutionIntelligentImporterPrivate EvolutionIntelligentImporterPrivate; @@ -59,7 +59,7 @@ struct _EvolutionIntelligentImporterClass { POA_GNOME_Evolution_IntelligentImporter__epv epv; }; -GtkType evolution_intelligent_importer_get_type (void); +GType evolution_intelligent_importer_get_type (void); EvolutionIntelligentImporter *evolution_intelligent_importer_new (EvolutionIntelligentImporterCanImportFn can_import_fn, EvolutionIntelligentImporterImportDataFn import_data_fn, diff --git a/shell/importer/intelligent.c b/shell/importer/intelligent.c index 44b0be9398..1eee3c238e 100644 --- a/shell/importer/intelligent.c +++ b/shell/importer/intelligent.c @@ -32,6 +32,7 @@ #include <gtk/gtkdrawingarea.h> #include <gtk/gtkbox.h> #include <gtk/gtkhbox.h> +#include <gtk/gtkvbox.h> #include <gtk/gtkcheckbutton.h> #include <gtk/gtklabel.h> #include <gtk/gtkmain.h> @@ -43,15 +44,12 @@ #include <gtk/gtkclist.h> #include <gtk/gtknotebook.h> #include <gtk/gtkscrolledwindow.h> +#include <gtk/gtkdialog.h> +#include <gtk/gtkstock.h> -#include <libgnome/gnome-defs.h> #include <libgnome/gnome-config.h> +/*#include <libgnome/gnome-util.h>*/ #include <libgnome/gnome-i18n.h> -#include <libgnome/gnome-util.h> -#include <libgnomeui/gnome-dialog.h> -#include <libgnomeui/gnome-stock.h> - -#include <liboaf/liboaf.h> #include <bonobo/bonobo-object.h> #include <bonobo/bonobo-widget.h> @@ -138,17 +136,17 @@ start_importers (GList *selected) static GList * get_intelligent_importers (void) { - OAF_ServerInfoList *info_list; + Bonobo_ServerInfoList *info_list; GList *iids_ret = NULL; CORBA_Environment ev; int i; CORBA_exception_init (&ev); - info_list = oaf_query ("repo_ids.has ('IDL:GNOME/Evolution/IntelligentImporter:1.0')", NULL, &ev); + info_list = bonobo_activation_query ("repo_ids.has ('IDL:GNOME/Evolution/IntelligentImporter:1.0')", NULL, &ev); CORBA_exception_free (&ev); for (i = 0; i < info_list->_length; i++) { - const OAF_ServerInfo *info; + const Bonobo_ServerInfo *info; info = info_list->_buffer + i; iids_ret = g_list_prepend (iids_ret, g_strdup (info->iid)); @@ -187,18 +185,19 @@ create_gui (GList *importers) int running = 0; d = g_new (IntelligentImporterDialog, 1); - d->dialog = dialog = gnome_dialog_new (_("Importers"), - NULL); - gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (dialog), - _("Import"), - GNOME_STOCK_PIXMAP_CONVERT); - gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (dialog), - _("Don't import"), - GNOME_STOCK_BUTTON_NO); - gnome_dialog_append_button_with_pixmap (GNOME_DIALOG (dialog), _("Don't ask me again"), - GNOME_STOCK_BUTTON_CANCEL); - - gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE); + d->dialog = dialog = gtk_dialog_new(); + gtk_window_set_title((GtkWindow *)dialog, _("Importers")); + dummy = gtk_button_new_from_stock(GTK_STOCK_CONVERT); + gtk_button_set_label((GtkButton *)dummy, _("Import")); + gtk_dialog_add_action_widget((GtkDialog *)dialog, dummy, GTK_RESPONSE_ACCEPT); + + dummy = gtk_button_new_from_stock(GTK_STOCK_NO); + gtk_button_set_label((GtkButton *)dummy, _("Don't import")); + gtk_dialog_add_action_widget((GtkDialog *)dialog, dummy, GTK_RESPONSE_REJECT); + + dummy = gtk_button_new_from_stock(GTK_STOCK_CANCEL); + gtk_button_set_label((GtkButton *)dummy, _("Don't ask me again")); + gtk_dialog_add_action_widget((GtkDialog *)dialog, dummy, GTK_RESPONSE_CANCEL); d->importers = NULL; d->current = NULL; @@ -207,20 +206,20 @@ create_gui (GList *importers) label = gtk_label_new (_("Evolution can import data from the following files:")); gtk_misc_set_alignment(GTK_MISC(label), 0, .5); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, TRUE, TRUE, 0); hbox = gtk_hbox_new (FALSE, 2); gtk_container_set_border_width (GTK_CONTAINER (hbox), 2); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), hbox, + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_widget_set_usize (sw, 300, 150); + gtk_widget_set_size_request (sw, 300, 150); gtk_container_add (GTK_CONTAINER (sw), clist); gtk_box_pack_start (GTK_BOX (hbox), sw, TRUE, TRUE, 0); @@ -239,7 +238,7 @@ create_gui (GList *importers) char *text[1], *prefix; /* Check if we want to show this one again */ - prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", gnome_util_user_home ()); + prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", g_get_home_dir ()); gnome_config_push_prefix (prefix); g_free (prefix); @@ -253,7 +252,7 @@ create_gui (GList *importers) data->iid = g_strdup (l->data); CORBA_exception_init (&ev); - data->object = oaf_activate_from_id ((char *) data->iid, 0, + data->object = bonobo_activation_activate_from_id ((char *) data->iid, 0, NULL, &ev); if (ev._major != CORBA_NO_EXCEPTION) { g_warning ("Could not start %s: %s", data->iid, @@ -361,12 +360,12 @@ create_gui (GList *importers) /* Set the start to the blank page */ gtk_notebook_set_page (GTK_NOTEBOOK (d->placeholder), running); - gtk_signal_connect (GTK_OBJECT (clist), "select-row", - GTK_SIGNAL_FUNC (select_row_cb), d); - gtk_signal_connect (GTK_OBJECT (clist), "unselect-row", - GTK_SIGNAL_FUNC (unselect_row_cb), d); + g_signal_connect((clist), "select-row", + G_CALLBACK (select_row_cb), d); + g_signal_connect((clist), "unselect-row", + G_CALLBACK (unselect_row_cb), d); - gtk_widget_show_all (GNOME_DIALOG (dialog)->vbox); + gtk_widget_show_all (GTK_DIALOG (dialog)->vbox); return d; } @@ -377,8 +376,9 @@ intelligent_importer_init (void) IntelligentImporterDialog *d; char *prefix; gboolean dontaskagain; + int resp; - prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", gnome_util_user_home ()); + prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", g_get_home_dir()); gnome_config_push_prefix (prefix); g_free (prefix); @@ -399,8 +399,10 @@ intelligent_importer_init (void) return; /* No runnable intelligent importers. */ } - switch (gnome_dialog_run_and_close (GNOME_DIALOG (d->dialog))) { - case 0: /* Okay button */ + resp = gtk_dialog_run((GtkDialog *)d->dialog); + gtk_widget_destroy(d->dialog); + switch (resp) { + case GTK_RESPONSE_ACCEPT: /* Make a list of the importers */ /* FIXME: Sort this list and don't do it a slow way */ @@ -458,13 +460,8 @@ intelligent_importer_init (void) break; - case 1: /* No button */ - free_importer_dialog (d); - break; - - case 2: /* Dont ask again */ - prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", - gnome_util_user_home ()); + case GTK_RESPONSE_CANCEL: /* Dont ask again */ + prefix = g_strdup_printf ("=%s/evolution/config/Shell=/intelligent-importers/", g_get_home_dir()); gnome_config_push_prefix (prefix); g_free (prefix); @@ -478,6 +475,7 @@ intelligent_importer_init (void) break; default: + case GTK_RESPONSE_REJECT: /* No button */ free_importer_dialog (d); break; } |