aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-component-registry.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-11-11 05:21:47 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-11-11 05:21:47 +0800
commitd40faeb22e27c8df9e8d626fcbea2efe1741d768 (patch)
tree509778f727256a431a87dd2f420e2f6d53ed7b94 /shell/e-component-registry.c
parent8648d27d3a1d02fe76e639f521241eae8fed679d (diff)
downloadgsoc2013-evolution-d40faeb22e27c8df9e8d626fcbea2efe1741d768.tar.gz
gsoc2013-evolution-d40faeb22e27c8df9e8d626fcbea2efe1741d768.tar.zst
gsoc2013-evolution-d40faeb22e27c8df9e8d626fcbea2efe1741d768.zip
New member "component_alias". (component_view_new): Get a new "alias" arg,
* e-shell-window.c (struct _ComponentView): New member "component_alias". (component_view_new): Get a new "alias" arg, set the member in the struct accordingly. (component_view_free): Free ->component_alias. (setup_widgets): Pass the alias from the ComponentInfo to e_component_view(). (switch_view): New utility function. (sidebar_button_selected_callback): Use it. (e_shell_window_switch_to_component): New public function. (e_shell_window_new): Switch to the component whose id is in the /apps/evolution/shell/view_defaults/component_id GConf key. * apps_evolution_shell.schemas: Removed view_defaults/folder_path. New key view_defaults/component_id. * e-component-registry.c (component_info_free): Free ->alias. (component_info_new): Get an "alias" arg and set the member accordingly. (query_components): Remove debugging messages. Get an "evolution:component_alias" property from the component and set the alias from that. * e-component-registry.h (struct _EComponentInfo): New member "alias". svn path=/trunk/; revision=23265
Diffstat (limited to 'shell/e-component-registry.c')
-rw-r--r--shell/e-component-registry.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c
index 66d23a2f35..474ed06576 100644
--- a/shell/e-component-registry.c
+++ b/shell/e-component-registry.c
@@ -53,6 +53,7 @@ struct _EComponentRegistryPrivate {
static EComponentInfo *
component_info_new (const char *id,
+ const char *alias,
const char *button_label,
int sort_order,
GdkPixbuf *button_icon)
@@ -60,6 +61,7 @@ component_info_new (const char *id,
EComponentInfo *info = g_new0 (EComponentInfo, 1);
info->id = g_strdup (id);
+ info->alias = g_strdup (alias);
info->button_label = g_strdup (button_label);
info->sort_order = sort_order;
@@ -73,6 +75,7 @@ static void
component_info_free (EComponentInfo *info)
{
g_free (info->id);
+ g_free (info->alias);
g_free (info->button_label);
if (info->iface != NULL)
@@ -118,6 +121,7 @@ query_components (EComponentRegistry *registry)
for (i = 0; i < info_list->_length; i++) {
const char *id;
const char *label;
+ const char *alias;
const char *icon_name;
const char *sort_order_string;
GdkPixbuf *icon;
@@ -125,18 +129,16 @@ query_components (EComponentRegistry *registry)
id = info_list->_buffer[i].iid;
label = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:button_label", language_list);
- if (label == NULL) {
- g_print ("no label for %s\n", id);
+ if (label == NULL)
label = g_strdup (_("Unknown"));
- }
+
+ alias = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:component_alias", NULL);
icon_name = bonobo_server_info_prop_lookup (& info_list->_buffer[i], "evolution:button_icon", NULL);
if (icon_name == NULL) {
icon = NULL;
- g_print ("no icon for %s\n", id);
} else {
char *full_path = e_shell_get_icon_path (icon_name, TRUE);
- g_print ("icon %s\n", full_path);
icon = gdk_pixbuf_new_from_file (full_path, NULL);
}
@@ -148,7 +150,7 @@ query_components (EComponentRegistry *registry)
sort_order = atoi (sort_order_string);
registry->priv->infos = g_slist_prepend (registry->priv->infos,
- component_info_new (id, label, sort_order, icon));
+ component_info_new (id, alias, label, sort_order, icon));
if (icon != NULL)
g_object_unref (icon);