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/intelligent.c | |
parent | be05081ea93b28c601dcb62a5190200c995c9d4d (diff) | |
download | gsoc2013-evolution-abda9814844d31daaf4c6355da9a886c69bda9be.tar gsoc2013-evolution-abda9814844d31daaf4c6355da9a886c69bda9be.tar.gz gsoc2013-evolution-abda9814844d31daaf4c6355da9a886c69bda9be.tar.bz2 gsoc2013-evolution-abda9814844d31daaf4c6355da9a886c69bda9be.tar.lz gsoc2013-evolution-abda9814844d31daaf4c6355da9a886c69bda9be.tar.xz 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/intelligent.c')
-rw-r--r-- | shell/importer/intelligent.c | 80 |
1 files changed, 39 insertions, 41 deletions
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; } |