2008-08-11 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #546892 * e-util/e-icon-factory.c (e_icon_factory_get_image): Kill this function. Use gtk_image_new_from_icon_name(). * e-util/e-icon-factory.c (e_icon_factory_get_icon_list): Kill this function. Use gtk_window_set_icon_name(). * widgets/misc/e-activity-handler.c: * widgets/misc/e-task-widget.c: Purge the GdkPixbuf arguments from the API. We've been ignoring them since the spinner icon was added. * addressbook/gui/contact-editor/e-contact-editor-fullname.c: * addressbook/gui/contact-editor/e-contact-editor-im.c: * addressbook/gui/contact-editor/e-contact-editor-address.c: * calendar/gui/alarm-notify/alarm-notify-dialog.c: * calendar/gui/dialogs/alarm-dialog.c: * calendar/gui/dialogs/alarm-list-dialog.c: * calendar/gui/dialogs/cal-attachment-select-file.c: * calendar/gui/dialogs/changed-comp.c: * calendar/gui/dialogs/delete-error.c: * calendar/gui/dialogs/select-source-dialog.c: * mail/mail-send-recv.c: * mail/message-tag-followup.c: * widgets/misc/e-combo-button.c: * widgets/misc/e-info-label.c: * widgets/misc/e-url-entry.c: * widgets/misc/e-task-widget.c: Prefer gtk_window_set_icon_name() over gtk_window_set_icon_list(). * addressbook/gui/contact-editor/e-contact-editor-im.c: * calendar/gui/dialogs/event-page.c: * calendar/gui/e-timezone-entry.c: * e-util/e-gui-utils.c: * e-util/e-popup.c: * plugins/import-ics-attachments/icsimporter.c: * plugins/itip-formatter/itip-view.c: * mail/em-folder-browser.c: * mail/em-format-html-display.c: * mail/mail-send-recv.c: * mail/message-tag-followup.c: Prefer gtk_image_new_from_icon_name() over e_icon_factory_get_image(). * calendar/gui/alarm-notify/alarm-queue.c: * plugins/mail-notification/mail-notification.c: Prefer gtk_status_icon_set_from_icon_name() over gtk_status_icon_set_from_pixbuf(). * addressbook/gui/component/addressbook-view.c: * calendar/gui/e-calendar-table.c: * calendar/gui/e-calendar-view.c: * calendar/gui/e-memo-table.c: * mail/mail-mt.c: e_activity_handler_operation_started() no longer takes a GdkPixbuf. It was ignoring the pixbuf anyway ever since we added a spinner icon. svn path=/trunk/; revision=35958
141 lines
3.8 KiB
C
141 lines
3.8 KiB
C
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
|
|
* e-shell-view.c
|
|
*
|
|
* Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
|
|
*
|
|
* Author(s): Michael Zucchi <notzed@ximian.com>
|
|
*
|
|
* 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., 51 Franklin Street, Fifth Floor,
|
|
* Boston, MA 02110-1301, USA.
|
|
*
|
|
* Helper class for evolution shells to setup a view
|
|
*/
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
#include <config.h>
|
|
#endif
|
|
|
|
#include <gtk/gtk.h>
|
|
#include <glib/gi18n.h>
|
|
|
|
#include "e-shell-view.h"
|
|
#include "e-shell-window.h"
|
|
|
|
static BonoboObjectClass *parent_class = NULL;
|
|
|
|
struct _EShellViewPrivate {
|
|
int dummy;
|
|
};
|
|
|
|
static void
|
|
impl_ShellView_setTitle(PortableServer_Servant _servant, const CORBA_char *id, const CORBA_char * title, CORBA_Environment * ev)
|
|
{
|
|
EShellView *esw = (EShellView *)bonobo_object_from_servant(_servant);
|
|
/* To translators: This is the window title and %s is the
|
|
component name. Most translators will want to keep it as is. */
|
|
char *tmp = g_strdup_printf(_("%s - Evolution"), title);
|
|
|
|
e_shell_window_set_title(esw->window, id, tmp);
|
|
g_free(tmp);
|
|
}
|
|
|
|
static void
|
|
impl_ShellView_setComponent(PortableServer_Servant _servant, const CORBA_char *id, CORBA_Environment * ev)
|
|
{
|
|
EShellView *esw = (EShellView *)bonobo_object_from_servant(_servant);
|
|
|
|
e_shell_window_switch_to_component(esw->window, id);
|
|
}
|
|
|
|
struct change_icon_struct {
|
|
const char *component_name;
|
|
const char *icon_name;
|
|
};
|
|
|
|
static gboolean
|
|
change_button_icon_func (EShell *shell, EShellWindow *window, gpointer user_data)
|
|
{
|
|
struct change_icon_struct *cis = (struct change_icon_struct*)user_data;
|
|
|
|
g_return_val_if_fail (window != NULL, FALSE);
|
|
g_return_val_if_fail (cis != NULL, FALSE);
|
|
|
|
e_shell_window_change_component_button_icon (window, cis->component_name, cis->icon_name);
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
static void
|
|
impl_ShellView_setButtonIcon (PortableServer_Servant _servant, const CORBA_char *id, const CORBA_char * iconName, CORBA_Environment * ev)
|
|
{
|
|
EShellView *esw = (EShellView *)bonobo_object_from_servant(_servant);
|
|
EShell *shell = e_shell_window_peek_shell (esw->window);
|
|
|
|
struct change_icon_struct cis;
|
|
cis.component_name = id;
|
|
cis.icon_name = iconName;
|
|
|
|
e_shell_foreach_shell_window (shell, change_button_icon_func, &cis);
|
|
}
|
|
|
|
static void
|
|
impl_dispose (GObject *object)
|
|
{
|
|
/*EShellView *esv = (EShellView *)object;*/
|
|
|
|
((GObjectClass *)parent_class)->dispose(object);
|
|
}
|
|
|
|
static void
|
|
impl_finalise (GObject *object)
|
|
{
|
|
((GObjectClass *)parent_class)->finalize(object);
|
|
}
|
|
|
|
static void
|
|
e_shell_view_class_init (EShellViewClass *klass)
|
|
{
|
|
GObjectClass *object_class;
|
|
POA_GNOME_Evolution_ShellView__epv *epv;
|
|
|
|
parent_class = g_type_class_ref(bonobo_object_get_type());
|
|
|
|
object_class = G_OBJECT_CLASS (klass);
|
|
object_class->dispose = impl_dispose;
|
|
object_class->finalize = impl_finalise;
|
|
|
|
epv = & klass->epv;
|
|
epv->setTitle = impl_ShellView_setTitle;
|
|
epv->setComponent = impl_ShellView_setComponent;
|
|
epv->setButtonIcon = impl_ShellView_setButtonIcon;
|
|
}
|
|
|
|
static void
|
|
e_shell_view_init (EShellView *shell)
|
|
{
|
|
}
|
|
|
|
EShellView *e_shell_view_new(struct _EShellWindow *window)
|
|
{
|
|
EShellView *new = g_object_new (e_shell_view_get_type (), NULL);
|
|
|
|
/* TODO: listen to destroy? */
|
|
new->window = window;
|
|
|
|
return new;
|
|
}
|
|
|
|
BONOBO_TYPE_FUNC_FULL (EShellView, GNOME_Evolution_ShellView, bonobo_object_get_type(), e_shell_view)
|
|
|