Files
evolution/shell/evolution-shell-component-utils.c
Ettore Perazzoli 8cf2b93847 Set GTK_RESPONSE_OK as the default response.
* e-shell-importer.c (choose_importer_from_list): Set
GTK_RESPONSE_OK as the default response.

* Makefile.am (INCLUDES): Add -DGNOME_DISABLE_DEPRECATED,
-DBONOBO_DISABLE_DEPRECATED.

* e-shortcuts.c (update_shortcut_and_emit_signal): Use
g_signal_emit() instead of gtk_signal_emit().

* e-shortcuts-view.c (destroy_group_cb): Port from GnomeMessageBox
to GtkMessageDialog.

* e-shell.c (get_icon_path_for_component_info): Use
gnome_program_locate_file() instead of gnome_pixmap_file().
(impl_finalize): Use bonobo_activation_unregister_active_server()
instead of bonobo_activation_active_server_register().
(e_shell_construct): Use
bonobo_activation_register_active_server() instead of
bonobo_activation_active_server_register().

* e-shell-view-menu.c (command_submit_bug): Use e_notice().
(launch_pilot_settings): Use g_find_program_in_path() instead of
gnome_is_program_in_path().
(command_submit_bug): Likewise.

* e-shell-utils.c (get_icon_path): Use g_file_test() instead of
g_file_exists().

* e-shell-startup-wizard.c (prepare_importer_page): Port from
GnomeMessageBox to GtkMessageDialog.

* e-shell-shared-folder-picker-dialog.c (show_dialog): Update for
GtkDialog.
(progress_dialog_close_callback): Removed.
(progress_dialog_clicked_callback): Removed.
(progress_dialog_response_callback): New.
(create_progress_dialog): Ported to GnomeDialog.

* e-shell-offline-sync.c: Add member parent_window to struct
SyncData.
(e_shell_offline_sync_all_folders): Set it from the parent_window
arg.
(progress_dialog_close_callback): Removed.
(progress_dialog_clicked_callback): Removed.
(progress_dialog_response_callback): New.
(setup_dialog): Create a GtkDialog instead of a GnomeDialog.
(sync_folder): Updated for GtkDialog.

* e-shell-offline-handler.c (dialog_handle_ok): Make it get a
GtkDialog instead of a GnomeDialog.
(dialog_handle_cancel): Likewise.
(dialog_clicked_cb): Removed.
(dialog_response_cb): New.
(pop_up_confirmation_dialog): Connect the new dialog_response_cb()
instead of the old dialog_clicked_cb().  Removed
gnome_dialog_set_default() call.

* e-shell-folder-creation-dialog.c (dialog_response_cb): Make
first arg a GtkDialog, not a GnomeDialog.

* e-shell-folder-commands.c (e_shell_command_delete_folder):
Expect delete_dialog() to return a GtkResponseType.
(delete_dialog): Ported to GtkMessageDialog; Return a
GtkResponseType.

* e-shell-config-default-folders.c
(e_shell_config_default_folders_create_widget): Removed unused
variable.

* e-setup.c (check_evolution_directory): Remove Evolution
directory installation message.
(e_setup): Remove check for the Executive-Summary directory.

* e-local-storage.c (create_folder_directory): Use g_file_test()
instead of g_file_exists().

* evolution-shell-component-utils.c (e_pixmaps_update): Use
g_build_filename() of g_concat_dir_and_file().
* e-folder-dnd-bridge.c (handle_data_received_path): Likewise.
* e-local-folder.c (construct_loading_metadata): Likewise.
(save_metadata): Likewise.
* e-local-storage.c (remove_folder_directory): Likewise.
(append_xfer_item_list): Likewise.
* e-setup.c (check_dir_recur): Likewise.
(e_shell_rm_dir): Likewise.
(setup_bonobo_conf_private_directory): Likewise.
* e-shell-folder-commands.c
(folder_selection_dialog_folder_selected_callback): Likewise.
(e_shell_command_rename_folder): Likewise.
* e-shell-folder-creation-dialog.c (dialog_response_cb): Likewise.
* e-shell-settings-dialog.c (load_pages): Likewise.
* e-shell-utils.c (get_icon_path): Likewise.
* e-shell.c (setup_local_storage): Likewise.
(get_icon_path_for_component_info): Likewise.
(e_shell_construct): Likewise.
* main.c (main): Likewise.

svn path=/trunk/; revision=19658
2003-01-27 21:09:56 +00:00

168 lines
4.5 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* evolution-shell-component-utils.c
*
* Copyright (C) 2000, 2001 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.
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "evolution-shell-component-utils.h"
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
#include <bonobo/bonobo-ui-util.h>
#include <bonobo/bonobo-moniker-util.h>
#include <bonobo/bonobo-exception.h>
#include <bonobo-activation/bonobo-activation.h>
#include <gal/widgets/e-gui-utils.h>
static void free_pixmaps (void);
static GSList *inited_arrays = NULL;
void e_pixmaps_update (BonoboUIComponent *uic, EPixmap *pixcache)
{
static int done_init = 0;
int i;
if (!done_init) {
g_atexit (free_pixmaps);
done_init = 1;
}
if (g_slist_find (inited_arrays, pixcache) == NULL)
inited_arrays = g_slist_prepend (inited_arrays, pixcache);
for (i = 0; pixcache [i].path; i++) {
if (!pixcache [i].pixbuf) {
char *path;
GdkPixbuf *pixbuf;
path = g_build_filename (EVOLUTION_IMAGES, pixcache [i].fname, NULL);
pixbuf = gdk_pixbuf_new_from_file (path, NULL);
if (pixbuf == NULL) {
g_warning ("Cannot load image -- %s", path);
} else {
pixcache [i].pixbuf = bonobo_ui_util_pixbuf_to_xml (pixbuf);
g_object_unref (pixbuf);
bonobo_ui_component_set_prop (uic,
pixcache [i].path, "pixname",
pixcache [i].pixbuf, NULL);
}
g_free (path);
} else {
bonobo_ui_component_set_prop (uic, pixcache [i].path,
"pixname",
pixcache [i].pixbuf,
NULL);
}
}
}
static void
free_pixmaps (void)
{
int i;
GSList *li;
for (li = inited_arrays; li != NULL; li = li->next) {
EPixmap *pixcache = li->data;
for (i = 0; pixcache [i].path; i++)
g_free (pixcache [i].pixbuf);
}
g_slist_free (inited_arrays);
}
/**
* e_activation_failure_dialog:
* @parent: parent window of the dialog, or %NULL
* @msg: the context-specific part of the error message
* @oafiid: the OAFIID of the component that failed to start
* @repo_id: the repo_id of the component that failed to start
*
* This puts up an error dialog about a failed component activation
* containing as much information as we can manage to gather about
* why it failed.
**/
void
e_activation_failure_dialog (GtkWindow *parent, const char *msg,
const char *oafiid, const char *repo_id)
{
Bonobo_Unknown object;
CORBA_Environment ev;
char *errmsg;
CORBA_exception_init (&ev);
object = bonobo_get_object (oafiid, repo_id, &ev);
if (ev._major == CORBA_NO_EXCEPTION) {
if (object) {
Bonobo_Unknown_unref (object, &ev);
CORBA_Object_release (object, &ev);
}
errmsg = g_strdup_printf (_("%s\n\nUnknown error."), msg);
} else if (strcmp (CORBA_exception_id (&ev), ex_Bonobo_GeneralError) != 0) {
char *bonobo_err = bonobo_exception_get_text (&ev);
errmsg = g_strdup_printf (_("%s\n\nThe error from the "
"component system is:\n%s"),
msg, bonobo_err);
g_free (bonobo_err);
} else {
Bonobo_GeneralError *errval = CORBA_exception_value (&ev);
errmsg = g_strdup_printf (_("%s\n\nThe error from the "
"activation system is:\n%s"),
msg, errval->description);
}
CORBA_exception_free (&ev);
e_notice (parent, GTK_MESSAGE_ERROR, errmsg);
g_free (errmsg);
}
/**
* e_get_activation_failure_msg:
* @ev: An exception returned by an oaf_activate call.
*
* Get a descriptive error message from @ev.
*
* Return value: A newly allocated string with the printable error message.
**/
char *
e_get_activation_failure_msg (CORBA_Environment *ev)
{
g_return_val_if_fail (ev != NULL, NULL);
if (CORBA_exception_id (ev) == NULL)
return NULL;
if (strcmp (CORBA_exception_id (ev), ex_Bonobo_GeneralError) != 0) {
return bonobo_exception_get_text (ev);
} else {
const Bonobo_GeneralError *oaf_general_error;
oaf_general_error = CORBA_exception_value (ev);
return g_strdup (oaf_general_error->description);
}
}