Re:patch for libgnomeui for enabling help on GNOME2]
- From: "satyajit kanungo" <satyajit kanungo wipro com>
- To: hp redhat com
- Cc: desktop-devel-list gnome org, jrb redhat com, andersca gnu org, micke codefactory se
- Subject: Re:patch for libgnomeui for enabling help on GNOME2]
- Date: Sat, 30 Mar 2002 11:46:08 +0500
> Hi All,
> + label = create_label ("Help Contents");
>
> This needs translating with _() probably
Yeah correct.. I just changed as per above .
> + gtk_container_add (GTK_CONTAINER (item), label);
> +
> + g_object_set_data_full (G_OBJECT (item), "docname",
> + g_strdup (uiinfo->moreinfo),g_free);
> +
> + g_signal_connect_data (item, "activate",
> + G_CALLBACK
(help_view_display_callback),
> + uiinfo->moreinfo,
> + (GClosureNotify) g_free,0);
>
> >What does this g_free free? Should uiinfo->moreinfo be freed?
> > Havoc
oops.. I don't think so . I am just passing NULL now .
I have also put a check condition for uiuinfo->moreinfo (taken
from the previous code )
Please verify the attched diff file . Thanks Havoc ...
Thanks and Regards
Satyajit
Index: libgnomeui//gnome-app-helper.c
===================================================================
RCS file:
/export/cvs/gnome-2.0/libgnomeui/libgnomeui/gnome-app-helper.c,v
retrieving revision 1.1.1.1
diff -p -u -5 -r1.1.1.1 gnome-app-helper.c
--- libgnomeui//gnome-app-helper.c 2002/03/05 20:44:44 1.1.1.1
+++ libgnomeui//gnome-app-helper.c 2002/03/29 13:22:32
@@ -1218,54 +1218,33 @@ help_view_display_callback (GtkWidget *w
/* Creates the menu entries for help topics. Returns the updated
position
* value. */
static int
create_help_entries (GtkMenuShell *menu_shell, GnomeUIInfo *uiinfo,
gint
pos)
{
- GSList *topics, *cur;
+ GtkWidget *item;
+ GtkWidget *label;
- uiinfo->widget = NULL; /* No relevant widget, as we may have created
- several of them */
-
if (!uiinfo->moreinfo) {
g_warning ("GnomeUIInfo->moreinfo cannot be NULL for "
"GNOME_APP_UI_HELP");
return pos;
}
-
- topics = get_topics ((const char *)uiinfo->moreinfo);
-
- for (cur = topics; cur && cur->next; cur = cur->next->next) {
- GtkWidget *item;
- GtkWidget *label;
-
- item = gtk_menu_item_new ();
- label = create_label (cur->data);
- g_free(cur->data);
- cur->data = NULL;
-
- gtk_container_add (GTK_CONTAINER (item), label);
-/* gtk_widget_lock_accelerators (item); */
- g_object_set_data_full (G_OBJECT (item), "docname",
- g_strdup (uiinfo->moreinfo),
- g_free);
+ item = gtk_menu_item_new ();
+ label = create_label ("Help Contents");
+ gtk_container_add (GTK_CONTAINER (item), label);
+
+ g_object_set_data_full (G_OBJECT (item), "docname",
+ g_strdup (uiinfo->moreinfo),g_free);
+
+ g_signal_connect_data (item, "activate",
+ G_CALLBACK (help_view_display_callback),
+ uiinfo->moreinfo,
+ NULL,0);
- g_signal_connect_data (item, "activate",
- G_CALLBACK (help_view_display_callback),
- cur->next->data,
- (GClosureNotify) g_free,
- 0);
-
- cur->next->data = NULL;
-
- gtk_menu_shell_insert (menu_shell, item, pos);
- pos++;
-
- gtk_widget_show (item);
-
- }
- g_slist_free(topics);
+ gtk_menu_shell_insert (menu_shell, item, 0);
+ gtk_widget_show (item);
return pos;
}
typedef struct
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]