kconfig: make use of menu_get_ext_help in gconfig
authorCheng Renquan <crquan@gmail.com>
Sun, 12 Jul 2009 08:11:46 +0000 (16:11 +0800)
committerSam Ravnborg <sam@ravnborg.org>
Sun, 20 Sep 2009 10:27:42 +0000 (12:27 +0200)
Futhermore, gconfig interface lack the "search a symbol" function, do later.

Signed-off-by: Cheng Renquan <crquan@gmail.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
[sam: fix SEGV in gconfig]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
scripts/kconfig/gconf.c
scripts/kconfig/menu.c

index 199b22bb49e2a7940bae8f84e38348e6aca30480..65464366fe389ab67e631c64646717c67303d05b 100644 (file)
@@ -456,19 +456,9 @@ static void text_insert_help(struct menu *menu)
        GtkTextBuffer *buffer;
        GtkTextIter start, end;
        const char *prompt = _(menu_get_prompt(menu));
-       gchar *name;
-       const char *help;
+       struct gstr help = str_new();
 
-       help = menu_get_help(menu);
-
-       /* Gettextize if the help text not empty */
-       if ((help != 0) && (help[0] != 0))
-               help = _(help);
-
-       if (menu->sym && menu->sym->name)
-               name = g_strdup_printf(menu->sym->name);
-       else
-               name = g_strdup("");
+       menu_get_ext_help(menu, &help);
 
        buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
        gtk_text_buffer_get_bounds(buffer, &start, &end);
@@ -478,14 +468,11 @@ static void text_insert_help(struct menu *menu)
        gtk_text_buffer_get_end_iter(buffer, &end);
        gtk_text_buffer_insert_with_tags(buffer, &end, prompt, -1, tag1,
                                         NULL);
-       gtk_text_buffer_insert_at_cursor(buffer, " ", 1);
-       gtk_text_buffer_get_end_iter(buffer, &end);
-       gtk_text_buffer_insert_with_tags(buffer, &end, name, -1, tag1,
-                                        NULL);
        gtk_text_buffer_insert_at_cursor(buffer, "\n\n", 2);
        gtk_text_buffer_get_end_iter(buffer, &end);
-       gtk_text_buffer_insert_with_tags(buffer, &end, help, -1, tag2,
+       gtk_text_buffer_insert_with_tags(buffer, &end, str_get(&help), -1, tag2,
                                         NULL);
+       str_free(&help);
 }
 
 
index 931d782a2392ffbe14314f71b4994c967cdf0222..b74f746870052089f95ab92d15e6aa8a84a7188f 100644 (file)
@@ -528,5 +528,6 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help)
        } else {
                str_append(help, nohelp_text);
        }
-       get_symbol_str(help, sym);
+       if (sym)
+               get_symbol_str(help, sym);
 }