Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 99810 | Differences between
and this patch

Collapse All | Expand All

(-)linux-2.6.13.1.orig/scripts/kconfig/Makefile (-11 / +3 lines)
Lines 2-8 Link Here
2
# Kernel configuration targets
2
# Kernel configuration targets
3
# These targets are used from top-level makefile
3
# These targets are used from top-level makefile
4
4
5
.PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config
5
.PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig
6
6
7
xconfig: $(obj)/qconf
7
xconfig: $(obj)/qconf
8
	$< arch/$(ARCH)/Kconfig
8
	$< arch/$(ARCH)/Kconfig
Lines 23-35 oldconfig: $(obj)/conf Link Here
23
silentoldconfig: $(obj)/conf
23
silentoldconfig: $(obj)/conf
24
	$< -s arch/$(ARCH)/Kconfig
24
	$< -s arch/$(ARCH)/Kconfig
25
25
26
update-po-config: $(obj)/kxgettext
27
	xgettext --default-domain=linux \
28
          --add-comments --keyword=_ --keyword=N_ \
29
          --files-from=scripts/kconfig/POTFILES.in \
30
	-o scripts/kconfig/linux.pot
31
	scripts/kconfig/kxgettext arch/$(ARCH)/Kconfig >> scripts/kconfig/linux.pot
32
33
.PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
26
.PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
34
27
35
randconfig: $(obj)/conf
28
randconfig: $(obj)/conf
Lines 79-88 help: Link Here
79
#         Based on GTK which needs to be installed to compile it
72
#         Based on GTK which needs to be installed to compile it
80
# object files used by all kconfig flavours
73
# object files used by all kconfig flavours
81
74
82
hostprogs-y	:= conf mconf qconf gconf kxgettext
75
hostprogs-y	:= conf mconf qconf gconf
83
conf-objs	:= conf.o  zconf.tab.o
76
conf-objs	:= conf.o  zconf.tab.o
84
mconf-objs	:= mconf.o zconf.tab.o
77
mconf-objs	:= mconf.o zconf.tab.o
85
kxgettext-objs	:= kxgettext.o zconf.tab.o
86
78
87
ifeq ($(MAKECMDGOALS),xconfig)
79
ifeq ($(MAKECMDGOALS),xconfig)
88
	qconf-target := 1
80
	qconf-target := 1
Lines 115-121 HOSTLOADLIBES_gconf = `pkg-config gtk+-2 Link Here
115
HOSTCFLAGS_gconf.o	= `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \
107
HOSTCFLAGS_gconf.o	= `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \
116
                          -D LKC_DIRECT_LINK
108
                          -D LKC_DIRECT_LINK
117
109
118
$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o $(obj)/kxgettext: $(obj)/zconf.tab.h
110
$(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h
119
111
120
$(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped
112
$(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped
121
$(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped
113
$(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped
(-)linux-2.6.13.1.orig/scripts/kconfig/POTFILES.in (-5 lines)
Lines 1-5 Link Here
1
scripts/kconfig/mconf.c
2
scripts/kconfig/conf.c
3
scripts/kconfig/confdata.c
4
scripts/kconfig/gconf.c
5
scripts/kconfig/qconf.cc
(-)linux-2.6.13.1.orig/scripts/kconfig/conf.c (-10 / +10 lines)
Lines 34-40 static int conf_cnt; Link Here
34
static char line[128];
34
static char line[128];
35
static struct menu *rootEntry;
35
static struct menu *rootEntry;
36
36
37
static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n");
37
static char nohelp_text[] = "Sorry, no help available for this option yet.\n";
38
38
39
static void strip(char *str)
39
static void strip(char *str)
40
{
40
{
Lines 56-64 static void strip(char *str) Link Here
56
static void check_stdin(void)
56
static void check_stdin(void)
57
{
57
{
58
	if (!valid_stdin && input_mode == ask_silent) {
58
	if (!valid_stdin && input_mode == ask_silent) {
59
		printf(_("aborted!\n\n"));
59
		printf("aborted!\n\n");
60
		printf(_("Console input/output is redirected. "));
60
		printf("Console input/output is redirected. ");
61
		printf(_("Run 'make oldconfig' to update configuration.\n\n"));
61
		printf("Run 'make oldconfig' to update configuration.\n\n");
62
		exit(1);
62
		exit(1);
63
	}
63
	}
64
}
64
}
Lines 470-476 static void check_conf(struct menu *menu Link Here
470
	if (sym) {
470
	if (sym) {
471
		if (sym_is_changable(sym) && !sym_has_value(sym)) {
471
		if (sym_is_changable(sym) && !sym_has_value(sym)) {
472
			if (!conf_cnt++)
472
			if (!conf_cnt++)
473
				printf(_("*\n* Restart config...\n*\n"));
473
				printf("*\n* Restart config...\n*\n");
474
			rootEntry = menu_get_parent_menu(menu);
474
			rootEntry = menu_get_parent_menu(menu);
475
			conf(rootEntry);
475
			conf(rootEntry);
476
		}
476
		}
Lines 504-510 int main(int ac, char **av) Link Here
504
			input_mode = set_default;
504
			input_mode = set_default;
505
			defconfig_file = av[i++];
505
			defconfig_file = av[i++];
506
			if (!defconfig_file) {
506
			if (!defconfig_file) {
507
				printf(_("%s: No default config file specified\n"),
507
				printf("%s: No default config file specified\n",
508
					av[0]);
508
					av[0]);
509
				exit(1);
509
				exit(1);
510
			}
510
			}
Lines 530-536 int main(int ac, char **av) Link Here
530
	}
530
	}
531
  	name = av[i];
531
  	name = av[i];
532
	if (!name) {
532
	if (!name) {
533
		printf(_("%s: Kconfig file missing\n"), av[0]);
533
		printf("%s: Kconfig file missing\n", av[0]);
534
	}
534
	}
535
	conf_parse(name);
535
	conf_parse(name);
536
	//zconfdump(stdout);
536
	//zconfdump(stdout);
Lines 547-558 int main(int ac, char **av) Link Here
547
		break;
547
		break;
548
	case ask_silent:
548
	case ask_silent:
549
		if (stat(".config", &tmpstat)) {
549
		if (stat(".config", &tmpstat)) {
550
			printf(_("***\n"
550
			printf("***\n"
551
				"*** You have not yet configured your kernel!\n"
551
				"*** You have not yet configured your kernel!\n"
552
				"***\n"
552
				"***\n"
553
				"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
553
				"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
554
				"*** \"make menuconfig\" or \"make xconfig\").\n"
554
				"*** \"make menuconfig\" or \"make xconfig\").\n"
555
				"***\n"));
555
				"***\n");
556
			exit(1);
556
			exit(1);
557
		}
557
		}
558
	case ask_all:
558
	case ask_all:
Lines 576-582 int main(int ac, char **av) Link Here
576
		check_conf(&rootmenu);
576
		check_conf(&rootmenu);
577
	} while (conf_cnt);
577
	} while (conf_cnt);
578
	if (conf_write(NULL)) {
578
	if (conf_write(NULL)) {
579
		fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n"));
579
		fprintf(stderr, "\n*** Error during writing of the kernel configuration.\n\n");
580
		return 1;
580
		return 1;
581
	}
581
	}
582
	return 0;
582
	return 0;
(-)linux-2.6.13.1.orig/scripts/kconfig/confdata.c (-8 / +8 lines)
Lines 88-96 int conf_read(const char *name) Link Here
88
			name = conf_expand_value(name);
88
			name = conf_expand_value(name);
89
			in = zconf_fopen(name);
89
			in = zconf_fopen(name);
90
			if (in) {
90
			if (in) {
91
				printf(_("#\n"
91
				printf("#\n"
92
				         "# using defaults found in %s\n"
92
				       "# using defaults found in %s\n"
93
				         "#\n"), name);
93
				       "#\n", name);
94
				break;
94
				break;
95
			}
95
			}
96
		}
96
		}
Lines 312-322 int conf_write(const char *name) Link Here
312
	if (env && *env)
312
	if (env && *env)
313
		use_timestamp = 0;
313
		use_timestamp = 0;
314
314
315
	fprintf(out, _("#\n"
315
	fprintf(out, "#\n"
316
		       "# Automatically generated make config: don't edit\n"
316
		     "# Automatically generated make config: don't edit\n"
317
		       "# Linux kernel version: %s\n"
317
		     "# Linux kernel version: %s\n"
318
		       "%s%s"
318
		     "%s%s"
319
		       "#\n"),
319
		     "#\n",
320
		     sym_get_string_value(sym),
320
		     sym_get_string_value(sym),
321
		     use_timestamp ? "# " : "",
321
		     use_timestamp ? "# " : "",
322
		     use_timestamp ? ctime(&now) : "");
322
		     use_timestamp ? ctime(&now) : "");
(-)linux-2.6.13.1.orig/scripts/kconfig/gconf.c (-28 / +24 lines)
Lines 41-47 static gboolean resizeable = FALSE; Link Here
41
static gboolean config_changed = FALSE;
41
static gboolean config_changed = FALSE;
42
42
43
static char nohelp_text[] =
43
static char nohelp_text[] =
44
    N_("Sorry, no help available for this option yet.\n");
44
    "Sorry, no help available for this option yet.\n";
45
45
46
GtkWidget *main_wnd = NULL;
46
GtkWidget *main_wnd = NULL;
47
GtkWidget *tree1_w = NULL;	// left  frame
47
GtkWidget *tree1_w = NULL;	// left  frame
Lines 207-213 void init_main_window(const gchar * glad Link Here
207
207
208
	xml = glade_xml_new(glade_file, "window1", NULL);
208
	xml = glade_xml_new(glade_file, "window1", NULL);
209
	if (!xml)
209
	if (!xml)
210
		g_error(_("GUI loading failed !\n"));
210
		g_error("GUI loading failed !\n");
211
	glade_xml_signal_autoconnect(xml);
211
	glade_xml_signal_autoconnect(xml);
212
212
213
	main_wnd = glade_xml_get_widget(xml, "window1");
213
	main_wnd = glade_xml_get_widget(xml, "window1");
Lines 275-281 void init_main_window(const gchar * glad Link Here
275
					  /*"style", PANGO_STYLE_OBLIQUE, */
275
					  /*"style", PANGO_STYLE_OBLIQUE, */
276
					  NULL);
276
					  NULL);
277
277
278
	sprintf(title, _("Linux Kernel v%s Configuration"),
278
	sprintf(title, "Linux Kernel v%s Configuration",
279
		getenv("KERNELRELEASE"));
279
		getenv("KERNELRELEASE"));
280
	gtk_window_set_title(GTK_WINDOW(main_wnd), title);
280
	gtk_window_set_title(GTK_WINDOW(main_wnd), title);
281
281
Lines 325-331 void init_left_tree(void) Link Here
325
325
326
	column = gtk_tree_view_column_new();
326
	column = gtk_tree_view_column_new();
327
	gtk_tree_view_append_column(view, column);
327
	gtk_tree_view_append_column(view, column);
328
	gtk_tree_view_column_set_title(column, _("Options"));
328
	gtk_tree_view_column_set_title(column, "Options");
329
329
330
	renderer = gtk_cell_renderer_toggle_new();
330
	renderer = gtk_cell_renderer_toggle_new();
331
	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
331
	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
Lines 370-376 void init_right_tree(void) Link Here
370
370
371
	column = gtk_tree_view_column_new();
371
	column = gtk_tree_view_column_new();
372
	gtk_tree_view_append_column(view, column);
372
	gtk_tree_view_append_column(view, column);
373
	gtk_tree_view_column_set_title(column, _("Options"));
373
	gtk_tree_view_column_set_title(column, "Options");
374
374
375
	renderer = gtk_cell_renderer_pixbuf_new();
375
	renderer = gtk_cell_renderer_pixbuf_new();
376
	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
376
	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
Lines 401-407 void init_right_tree(void) Link Here
401
401
402
	renderer = gtk_cell_renderer_text_new();
402
	renderer = gtk_cell_renderer_text_new();
403
	gtk_tree_view_insert_column_with_attributes(view, -1,
403
	gtk_tree_view_insert_column_with_attributes(view, -1,
404
						    _("Name"), renderer,
404
						    "Name", renderer,
405
						    "text", COL_NAME,
405
						    "text", COL_NAME,
406
						    "foreground-gdk",
406
						    "foreground-gdk",
407
						    COL_COLOR, NULL);
407
						    COL_COLOR, NULL);
Lines 425-431 void init_right_tree(void) Link Here
425
						    COL_COLOR, NULL);
425
						    COL_COLOR, NULL);
426
	renderer = gtk_cell_renderer_text_new();
426
	renderer = gtk_cell_renderer_text_new();
427
	gtk_tree_view_insert_column_with_attributes(view, -1,
427
	gtk_tree_view_insert_column_with_attributes(view, -1,
428
						    _("Value"), renderer,
428
						    "Value", renderer,
429
						    "text", COL_VALUE,
429
						    "text", COL_VALUE,
430
						    "editable",
430
						    "editable",
431
						    COL_EDIT,
431
						    COL_EDIT,
Lines 466-480 static void text_insert_help(struct menu Link Here
466
	GtkTextIter start, end;
466
	GtkTextIter start, end;
467
	const char *prompt = menu_get_prompt(menu);
467
	const char *prompt = menu_get_prompt(menu);
468
	gchar *name;
468
	gchar *name;
469
	const char *help = _(nohelp_text);
469
	const char *help = nohelp_text;
470
470
471
	if (!menu->sym)
471
	if (!menu->sym)
472
		help = "";
472
		help = "";
473
	else if (menu->sym->help)
473
	else if (menu->sym->help)
474
		help = _(menu->sym->help);
474
		help = menu->sym->help;
475
475
476
	if (menu->sym && menu->sym->name)
476
	if (menu->sym && menu->sym->name)
477
		name = g_strdup_printf(_(menu->sym->name));
477
		name = g_strdup_printf(menu->sym->name);
478
	else
478
	else
479
		name = g_strdup("");
479
		name = g_strdup("");
480
480
Lines 530-536 gboolean on_window1_delete_event(GtkWidg Link Here
530
	if (config_changed == FALSE)
530
	if (config_changed == FALSE)
531
		return FALSE;
531
		return FALSE;
532
532
533
	dialog = gtk_dialog_new_with_buttons(_("Warning !"),
533
	dialog = gtk_dialog_new_with_buttons("Warning !",
534
					     GTK_WINDOW(main_wnd),
534
					     GTK_WINDOW(main_wnd),
535
					     (GtkDialogFlags)
535
					     (GtkDialogFlags)
536
					     (GTK_DIALOG_MODAL |
536
					     (GTK_DIALOG_MODAL |
Lines 544-550 gboolean on_window1_delete_event(GtkWidg Link Here
544
	gtk_dialog_set_default_response(GTK_DIALOG(dialog),
544
	gtk_dialog_set_default_response(GTK_DIALOG(dialog),
545
					GTK_RESPONSE_CANCEL);
545
					GTK_RESPONSE_CANCEL);
546
546
547
	label = gtk_label_new(_("\nSave configuration ?\n"));
547
	label = gtk_label_new("\nSave configuration ?\n");
548
	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
548
	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
549
	gtk_widget_show(label);
549
	gtk_widget_show(label);
550
550
Lines 604-610 load_filename(GtkFileSelection * file_se Link Here
604
					     (user_data));
604
					     (user_data));
605
605
606
	if (conf_read(fn))
606
	if (conf_read(fn))
607
		text_insert_msg(_("Error"), _("Unable to load configuration !"));
607
		text_insert_msg("Error", "Unable to load configuration !");
608
	else
608
	else
609
		display_tree(&rootmenu);
609
		display_tree(&rootmenu);
610
}
610
}
Lines 613-619 void on_load1_activate(GtkMenuItem * men Link Here
613
{
613
{
614
	GtkWidget *fs;
614
	GtkWidget *fs;
615
615
616
	fs = gtk_file_selection_new(_("Load file..."));
616
	fs = gtk_file_selection_new("Load file...");
617
	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
617
	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
618
			 "clicked",
618
			 "clicked",
619
			 G_CALLBACK(load_filename), (gpointer) fs);
619
			 G_CALLBACK(load_filename), (gpointer) fs);
Lines 632-638 void on_load1_activate(GtkMenuItem * men Link Here
632
void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data)
632
void on_save1_activate(GtkMenuItem * menuitem, gpointer user_data)
633
{
633
{
634
	if (conf_write(NULL))
634
	if (conf_write(NULL))
635
		text_insert_msg(_("Error"), _("Unable to save configuration !"));
635
		text_insert_msg("Error", "Unable to save configuration !");
636
636
637
	config_changed = FALSE;
637
	config_changed = FALSE;
638
}
638
}
Lines 647-653 store_filename(GtkFileSelection * file_s Link Here
647
					     (user_data));
647
					     (user_data));
648
648
649
	if (conf_write(fn))
649
	if (conf_write(fn))
650
		text_insert_msg(_("Error"), _("Unable to save configuration !"));
650
		text_insert_msg("Error", "Unable to save configuration !");
651
651
652
	gtk_widget_destroy(GTK_WIDGET(user_data));
652
	gtk_widget_destroy(GTK_WIDGET(user_data));
653
}
653
}
Lines 656-662 void on_save_as1_activate(GtkMenuItem * Link Here
656
{
656
{
657
	GtkWidget *fs;
657
	GtkWidget *fs;
658
658
659
	fs = gtk_file_selection_new(_("Save file as..."));
659
	fs = gtk_file_selection_new("Save file as...");
660
	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
660
	g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
661
			 "clicked",
661
			 "clicked",
662
			 G_CALLBACK(store_filename), (gpointer) fs);
662
			 G_CALLBACK(store_filename), (gpointer) fs);
Lines 740-746 on_show_debug_info1_activate(GtkMenuItem Link Here
740
void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
740
void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
741
{
741
{
742
	GtkWidget *dialog;
742
	GtkWidget *dialog;
743
	const gchar *intro_text = _(
743
	const gchar *intro_text =
744
	    "Welcome to gkc, the GTK+ graphical kernel configuration tool\n"
744
	    "Welcome to gkc, the GTK+ graphical kernel configuration tool\n"
745
	    "for Linux.\n"
745
	    "for Linux.\n"
746
	    "For each option, a blank box indicates the feature is disabled, a\n"
746
	    "For each option, a blank box indicates the feature is disabled, a\n"
Lines 756-762 void on_introduction1_activate(GtkMenuIt Link Here
756
	    "option.\n"
756
	    "option.\n"
757
	    "\n"
757
	    "\n"
758
	    "Toggling Show Debug Info under the Options menu will show \n"
758
	    "Toggling Show Debug Info under the Options menu will show \n"
759
	    "the dependencies, which you can then match by examining other options.");
759
	    "the dependencies, which you can then match by examining other options.";
760
760
761
	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
761
	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
762
					GTK_DIALOG_DESTROY_WITH_PARENT,
762
					GTK_DIALOG_DESTROY_WITH_PARENT,
Lines 773-780 void on_about1_activate(GtkMenuItem * me Link Here
773
{
773
{
774
	GtkWidget *dialog;
774
	GtkWidget *dialog;
775
	const gchar *about_text =
775
	const gchar *about_text =
776
	    _("gkc is copyright (c) 2002 Romain Lievin <roms@lpg.ticalc.org>.\n"
776
	    "gkc is copyright (c) 2002 Romain Lievin <roms@lpg.ticalc.org>.\n"
777
	      "Based on the source code from Roman Zippel.\n");
777
	    "Based on the source code from Roman Zippel.\n";
778
778
779
	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
779
	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
780
					GTK_DIALOG_DESTROY_WITH_PARENT,
780
					GTK_DIALOG_DESTROY_WITH_PARENT,
Lines 791-799 void on_license1_activate(GtkMenuItem * Link Here
791
{
791
{
792
	GtkWidget *dialog;
792
	GtkWidget *dialog;
793
	const gchar *license_text =
793
	const gchar *license_text =
794
	    _("gkc is released under the terms of the GNU GPL v2.\n"
794
	    "gkc is released under the terms of the GNU GPL v2.\n"
795
	      "For more information, please see the source code or\n"
795
	    "For more information, please see the source code or\n"
796
	      "visit http://www.fsf.org/licenses/licenses.html\n");
796
	    "visit http://www.fsf.org/licenses/licenses.html\n";
797
797
798
	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
798
	dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
799
					GTK_DIALOG_DESTROY_WITH_PARENT,
799
					GTK_DIALOG_DESTROY_WITH_PARENT,
Lines 1581-1590 int main(int ac, char *av[]) Link Here
1581
	kconfig_load();
1581
	kconfig_load();
1582
#endif
1582
#endif
1583
1583
1584
	bindtextdomain(PACKAGE, LOCALEDIR);
1585
	bind_textdomain_codeset(PACKAGE, "UTF-8");
1586
	textdomain(PACKAGE);
1587
1588
	/* GTK stuffs */
1584
	/* GTK stuffs */
1589
	gtk_set_locale();
1585
	gtk_set_locale();
1590
	gtk_init(&ac, &av);
1586
	gtk_init(&ac, &av);
(-)linux-2.6.13.1.orig/scripts/kconfig/kxgettext.c (-221 lines)
Lines 1-221 Link Here
1
/*
2
 * Arnaldo Carvalho de Melo <acme@conectiva.com.br>, 2005
3
 *
4
 * Released under the terms of the GNU GPL v2.0
5
 */
6
7
#include <stdlib.h>
8
#include <string.h>
9
10
#define LKC_DIRECT_LINK
11
#include "lkc.h"
12
13
static char *escape(const char* text, char *bf, int len)
14
{
15
	char *bfp = bf;
16
	int multiline = strchr(text, '\n') != NULL;
17
18
	*bfp++ = '"';
19
	--len;
20
21
	if (multiline) {
22
		*bfp++ = '"';
23
		*bfp++ = '\n';
24
		*bfp++ = '"';
25
		len -= 3;
26
	}
27
28
	while (*text != '\0' && len > 1) {
29
		if (*text == '"')
30
			*bfp++ = '\\';
31
		else if (*text == '\n') {
32
			*bfp++ = '\\';
33
			*bfp++ = 'n';
34
			*bfp++ = '"';
35
			*bfp++ = '\n';
36
			*bfp++ = '"';
37
			len -= 5;
38
			++text;
39
			goto next;
40
		}
41
		*bfp++ = *text++;
42
next:
43
		--len;
44
	}
45
46
	if (multiline)
47
		bfp -= 3;
48
49
	*bfp++ = '"';
50
	*bfp = '\0';
51
52
	return bf;
53
}
54
55
struct file_line {
56
	struct file_line *next;
57
	char*		 file;
58
	int		 lineno;
59
};
60
61
static struct file_line *file_line__new(char *file, int lineno)
62
{
63
	struct file_line *self = malloc(sizeof(*self));
64
65
	if (self == NULL)
66
		goto out;
67
68
	self->file   = file;
69
	self->lineno = lineno;
70
	self->next   = NULL;
71
out:
72
	return self;
73
}
74
75
struct message {
76
	const char	 *msg;
77
	const char	 *option;
78
	struct message	 *next;
79
	struct file_line *files;
80
};
81
82
static struct message *message__list;
83
84
static struct message *message__new(const char *msg, char *option, char *file, int lineno)
85
{
86
	struct message *self = malloc(sizeof(*self));
87
88
	if (self == NULL)
89
		goto out;
90
91
	self->files = file_line__new(file, lineno);
92
	if (self->files == NULL)
93
		goto out_fail;
94
95
	self->msg = strdup(msg);
96
	if (self->msg == NULL)
97
		goto out_fail_msg;
98
99
	self->option = option;
100
	self->next = NULL;
101
out:
102
	return self;
103
out_fail_msg:
104
	free(self->files);
105
out_fail:
106
	free(self);
107
	self = NULL;
108
	goto out;
109
}
110
111
static struct message *mesage__find(const char *msg)
112
{
113
	struct message *m = message__list;
114
115
	while (m != NULL) {
116
		if (strcmp(m->msg, msg) == 0)
117
			break;
118
		m = m->next;
119
	}
120
121
	return m;
122
}
123
124
static int message__add_file_line(struct message *self, char *file, int lineno)
125
{
126
	int rc = -1;
127
	struct file_line *fl = file_line__new(file, lineno);
128
129
	if (fl == NULL)
130
		goto out;
131
132
	fl->next    = self->files;
133
	self->files = fl;
134
	rc = 0;
135
out:
136
	return rc;
137
}
138
139
static int message__add(const char *msg, char *option, char *file, int lineno)
140
{
141
	int rc = 0;
142
	char bf[16384];
143
	char *escaped = escape(msg, bf, sizeof(bf));
144
	struct message *m = mesage__find(escaped);
145
146
	if (m != NULL)
147
		rc = message__add_file_line(m, file, lineno);
148
	else {
149
		m = message__new(escaped, option, file, lineno);
150
151
		if (m != NULL) {
152
			m->next	      = message__list;
153
			message__list = m;
154
		} else
155
			rc = -1;
156
	}
157
	return rc;
158
}
159
160
void menu_build_message_list(struct menu *menu)
161
{
162
	struct menu *child;
163
164
	message__add(menu_get_prompt(menu), NULL,
165
		     menu->file == NULL ? "Root Menu" : menu->file->name,
166
		     menu->lineno);
167
168
	if (menu->sym != NULL && menu->sym->help != NULL)
169
		message__add(menu->sym->help, menu->sym->name,
170
			     menu->file == NULL ? "Root Menu" : menu->file->name,
171
			     menu->lineno);
172
173
	for (child = menu->list; child != NULL; child = child->next)
174
		if (child->prompt != NULL)
175
			menu_build_message_list(child);
176
}
177
178
static void message__print_file_lineno(struct message *self)
179
{
180
	struct file_line *fl = self->files;
181
182
	printf("\n#: %s:%d", fl->file, fl->lineno);
183
	fl = fl->next;
184
185
	while (fl != NULL) {
186
		printf(", %s:%d", fl->file, fl->lineno);
187
		fl = fl->next;
188
	}
189
190
	if (self->option != NULL)
191
		printf(", %s:00000", self->option);
192
193
	putchar('\n');
194
}
195
196
static void message__print_gettext_msgid_msgstr(struct message *self)
197
{
198
	message__print_file_lineno(self);
199
200
	printf("msgid %s\n"
201
	       "msgstr \"\"\n", self->msg);
202
}
203
204
void menu__xgettext(void)
205
{
206
	struct message *m = message__list;
207
208
	while (m != NULL) {
209
		message__print_gettext_msgid_msgstr(m);
210
		m = m->next;
211
	}
212
}
213
214
int main(int ac, char **av)
215
{
216
	conf_parse(av[1]);
217
218
	menu_build_message_list(menu_get_root_menu(NULL));
219
	menu__xgettext();
220
	return 0;
221
}
(-)linux-2.6.13.1.orig/scripts/kconfig/lkc.h (-8 lines)
Lines 8-15 Link Here
8
8
9
#include "expr.h"
9
#include "expr.h"
10
10
11
#include <libintl.h>
12
13
#ifdef __cplusplus
11
#ifdef __cplusplus
14
extern "C" {
12
extern "C" {
15
#endif
13
#endif
Lines 25-36 extern "C" { Link Here
25
23
26
#define SRCTREE "srctree"
24
#define SRCTREE "srctree"
27
25
28
#define PACKAGE "linux"
29
#define LOCALEDIR "/usr/share/locale"
30
31
#define _(text) gettext(text)
32
#define N_(text) (text)
33
34
int zconfparse(void);
26
int zconfparse(void);
35
void zconfdump(FILE *out);
27
void zconfdump(FILE *out);
36
28
(-)linux-2.6.13.1.orig/scripts/kconfig/mconf.c (-63 / +57 lines)
Lines 4-11 Link Here
4
 *
4
 *
5
 * Introduced single menu mode (show all sub-menus in one large tree).
5
 * Introduced single menu mode (show all sub-menus in one large tree).
6
 * 2002-11-06 Petr Baudis <pasky@ucw.cz>
6
 * 2002-11-06 Petr Baudis <pasky@ucw.cz>
7
 *
8
 * i18n, 2005, Arnaldo Carvalho de Melo <acme@conectiva.com.br>
9
 */
7
 */
10
8
11
#include <sys/ioctl.h>
9
#include <sys/ioctl.h>
Lines 26-32 Link Here
26
#include "lkc.h"
24
#include "lkc.h"
27
25
28
static char menu_backtitle[128];
26
static char menu_backtitle[128];
29
static const char mconf_readme[] = N_(
27
static const char mconf_readme[] =
30
"Overview\n"
28
"Overview\n"
31
"--------\n"
29
"--------\n"
32
"Some kernel features may be built directly into the kernel.\n"
30
"Some kernel features may be built directly into the kernel.\n"
Lines 159-197 static const char mconf_readme[] = N_( Link Here
159
"\n"
157
"\n"
160
"Note that this mode can eventually be a little more CPU expensive\n"
158
"Note that this mode can eventually be a little more CPU expensive\n"
161
"(especially with a larger number of unrolled categories) than the\n"
159
"(especially with a larger number of unrolled categories) than the\n"
162
"default mode.\n"),
160
"default mode.\n",
163
menu_instructions[] = N_(
161
menu_instructions[] =
164
	"Arrow keys navigate the menu.  "
162
	"Arrow keys navigate the menu.  "
165
	"<Enter> selects submenus --->.  "
163
	"<Enter> selects submenus --->.  "
166
	"Highlighted letters are hotkeys.  "
164
	"Highlighted letters are hotkeys.  "
167
	"Pressing <Y> includes, <N> excludes, <M> modularizes features.  "
165
	"Pressing <Y> includes, <N> excludes, <M> modularizes features.  "
168
	"Press <Esc><Esc> to exit, <?> for Help, </> for Search.  "
166
	"Press <Esc><Esc> to exit, <?> for Help, </> for Search.  "
169
	"Legend: [*] built-in  [ ] excluded  <M> module  < > module capable"),
167
	"Legend: [*] built-in  [ ] excluded  <M> module  < > module capable",
170
radiolist_instructions[] = N_(
168
radiolist_instructions[] =
171
	"Use the arrow keys to navigate this window or "
169
	"Use the arrow keys to navigate this window or "
172
	"press the hotkey of the item you wish to select "
170
	"press the hotkey of the item you wish to select "
173
	"followed by the <SPACE BAR>. "
171
	"followed by the <SPACE BAR>. "
174
	"Press <?> for additional information about this option."),
172
	"Press <?> for additional information about this option.",
175
inputbox_instructions_int[] = N_(
173
inputbox_instructions_int[] =
176
	"Please enter a decimal value. "
174
	"Please enter a decimal value. "
177
	"Fractions will not be accepted.  "
175
	"Fractions will not be accepted.  "
178
	"Use the <TAB> key to move from the input field to the buttons below it."),
176
	"Use the <TAB> key to move from the input field to the buttons below it.",
179
inputbox_instructions_hex[] = N_(
177
inputbox_instructions_hex[] =
180
	"Please enter a hexadecimal value. "
178
	"Please enter a hexadecimal value. "
181
	"Use the <TAB> key to move from the input field to the buttons below it."),
179
	"Use the <TAB> key to move from the input field to the buttons below it.",
182
inputbox_instructions_string[] = N_(
180
inputbox_instructions_string[] =
183
	"Please enter a string value. "
181
	"Please enter a string value. "
184
	"Use the <TAB> key to move from the input field to the buttons below it."),
182
	"Use the <TAB> key to move from the input field to the buttons below it.",
185
setmod_text[] = N_(
183
setmod_text[] =
186
	"This feature depends on another which has been configured as a module.\n"
184
	"This feature depends on another which has been configured as a module.\n"
187
	"As a result, this feature will be built as a module."),
185
	"As a result, this feature will be built as a module.",
188
nohelp_text[] = N_(
186
nohelp_text[] =
189
	"There is no help available for this kernel option.\n"),
187
	"There is no help available for this kernel option.\n",
190
load_config_text[] = N_(
188
load_config_text[] =
191
	"Enter the name of the configuration file you wish to load.  "
189
	"Enter the name of the configuration file you wish to load.  "
192
	"Accept the name shown to restore the configuration you "
190
	"Accept the name shown to restore the configuration you "
193
	"last retrieved.  Leave blank to abort."),
191
	"last retrieved.  Leave blank to abort.",
194
load_config_help[] = N_(
192
load_config_help[] =
195
	"\n"
193
	"\n"
196
	"For various reasons, one may wish to keep several different kernel\n"
194
	"For various reasons, one may wish to keep several different kernel\n"
197
	"configurations available on a single machine.\n"
195
	"configurations available on a single machine.\n"
Lines 201-211 load_config_help[] = N_( Link Here
201
	"to modify that configuration.\n"
199
	"to modify that configuration.\n"
202
	"\n"
200
	"\n"
203
	"If you are uncertain, then you have probably never used alternate\n"
201
	"If you are uncertain, then you have probably never used alternate\n"
204
	"configuration files.  You should therefor leave this blank to abort.\n"),
202
	"configuration files.  You should therefor leave this blank to abort.\n",
205
save_config_text[] = N_(
203
save_config_text[] =
206
	"Enter a filename to which this configuration should be saved "
204
	"Enter a filename to which this configuration should be saved "
207
	"as an alternate.  Leave blank to abort."),
205
	"as an alternate.  Leave blank to abort.",
208
save_config_help[] = N_(
206
save_config_help[] =
209
	"\n"
207
	"\n"
210
	"For various reasons, one may wish to keep different kernel\n"
208
	"For various reasons, one may wish to keep different kernel\n"
211
	"configurations available on a single machine.\n"
209
	"configurations available on a single machine.\n"
Lines 215-222 save_config_help[] = N_( Link Here
215
	"configuration options you have selected at that time.\n"
213
	"configuration options you have selected at that time.\n"
216
	"\n"
214
	"\n"
217
	"If you are uncertain what all this means then you should probably\n"
215
	"If you are uncertain what all this means then you should probably\n"
218
	"leave this blank.\n"),
216
	"leave this blank.\n",
219
search_help[] = N_(
217
search_help[] =
220
	"\n"
218
	"\n"
221
	"Search for CONFIG_ symbols and display their relations.\n"
219
	"Search for CONFIG_ symbols and display their relations.\n"
222
	"Example: search for \"^FOO\"\n"
220
	"Example: search for \"^FOO\"\n"
Lines 253-259 search_help[] = N_( Link Here
253
	"Examples: USB	=> find all CONFIG_ symbols containing USB\n"
251
	"Examples: USB	=> find all CONFIG_ symbols containing USB\n"
254
	"          ^USB => find all CONFIG_ symbols starting with USB\n"
252
	"          ^USB => find all CONFIG_ symbols starting with USB\n"
255
	"          USB$ => find all CONFIG_ symbols ending with USB\n"
253
	"          USB$ => find all CONFIG_ symbols ending with USB\n"
256
	"\n");
254
	"\n";
257
255
258
static char buf[4096], *bufptr = buf;
256
static char buf[4096], *bufptr = buf;
259
static char input_buf[4096];
257
static char input_buf[4096];
Lines 308-315 static void init_wsize(void) Link Here
308
	}
306
	}
309
307
310
	if (rows < 19 || cols < 80) {
308
	if (rows < 19 || cols < 80) {
311
		fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
309
		fprintf(stderr, "Your display is too small to run Menuconfig!\n");
312
		fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
310
		fprintf(stderr, "It must be at least 19 lines by 80 columns.\n");
313
		exit(1);
311
		exit(1);
314
	}
312
	}
315
313
Lines 529-537 static void search_conf(void) Link Here
529
again:
527
again:
530
	cprint_init();
528
	cprint_init();
531
	cprint("--title");
529
	cprint("--title");
532
	cprint(_("Search Configuration Parameter"));
530
	cprint("Search Configuration Parameter");
533
	cprint("--inputbox");
531
	cprint("--inputbox");
534
	cprint(_("Enter Keyword"));
532
	cprint("Enter Keyword");
535
	cprint("10");
533
	cprint("10");
536
	cprint("75");
534
	cprint("75");
537
	cprint("");
535
	cprint("");
Lines 542-548 again: Link Here
542
	case 0:
540
	case 0:
543
		break;
541
		break;
544
	case 1:
542
	case 1:
545
		show_helptext(_("Search Configuration"), search_help);
543
		show_helptext("Search Configuration", search_help);
546
		goto again;
544
		goto again;
547
	default:
545
	default:
548
		return;
546
		return;
Lines 551-557 again: Link Here
551
	sym_arr = sym_re_search(input_buf);
549
	sym_arr = sym_re_search(input_buf);
552
	res = get_relations_str(sym_arr);
550
	res = get_relations_str(sym_arr);
553
	free(sym_arr);
551
	free(sym_arr);
554
	show_textbox(_("Search Results"), str_get(&res), 0, 0);
552
	show_textbox("Search Results", str_get(&res), 0, 0);
555
	str_free(&res);
553
	str_free(&res);
556
}
554
}
557
555
Lines 724-732 static void conf(struct menu *menu) Link Here
724
	while (1) {
722
	while (1) {
725
		cprint_init();
723
		cprint_init();
726
		cprint("--title");
724
		cprint("--title");
727
		cprint("%s", prompt ? prompt : _("Main Menu"));
725
		cprint("%s", prompt ? prompt : "Main Menu");
728
		cprint("--menu");
726
		cprint("--menu");
729
		cprint(_(menu_instructions));
727
		cprint(menu_instructions);
730
		cprint("%d", rows);
728
		cprint("%d", rows);
731
		cprint("%d", cols);
729
		cprint("%d", cols);
732
		cprint("%d", rows - 10);
730
		cprint("%d", rows - 10);
Lines 739-747 static void conf(struct menu *menu) Link Here
739
			cprint(":");
737
			cprint(":");
740
			cprint("--- ");
738
			cprint("--- ");
741
			cprint("L");
739
			cprint("L");
742
			cprint(_("    Load an Alternate Configuration File"));
740
			cprint("    Load an Alternate Configuration File");
743
			cprint("S");
741
			cprint("S");
744
			cprint(_("    Save Configuration to an Alternate File"));
742
			cprint("    Save Configuration to an Alternate File");
745
		}
743
		}
746
		stat = exec_conf();
744
		stat = exec_conf();
747
		if (stat < 0)
745
		if (stat < 0)
Lines 796-802 static void conf(struct menu *menu) Link Here
796
			if (sym)
794
			if (sym)
797
				show_help(submenu);
795
				show_help(submenu);
798
			else
796
			else
799
				show_helptext("README", _(mconf_readme));
797
				show_helptext("README", mconf_readme);
800
			break;
798
			break;
801
		case 3:
799
		case 3:
802
			if (type == 't') {
800
			if (type == 't') {
Lines 852-858 static void show_help(struct menu *menu) Link Here
852
	{
850
	{
853
		if (sym->name) {
851
		if (sym->name) {
854
			str_printf(&help, "CONFIG_%s:\n\n", sym->name);
852
			str_printf(&help, "CONFIG_%s:\n\n", sym->name);
855
			str_append(&help, _(sym->help));
853
			str_append(&help, sym->help);
856
			str_append(&help, "\n");
854
			str_append(&help, "\n");
857
		}
855
		}
858
	} else {
856
	} else {
Lines 889-897 static void conf_choice(struct menu *men Link Here
889
	while (1) {
887
	while (1) {
890
		cprint_init();
888
		cprint_init();
891
		cprint("--title");
889
		cprint("--title");
892
		cprint("%s", prompt ? prompt : _("Main Menu"));
890
		cprint("%s", prompt ? prompt : "Main Menu");
893
		cprint("--radiolist");
891
		cprint("--radiolist");
894
		cprint(_(radiolist_instructions));
892
		cprint(radiolist_instructions);
895
		cprint("15");
893
		cprint("15");
896
		cprint("70");
894
		cprint("70");
897
		cprint("6");
895
		cprint("6");
Lines 938-954 static void conf_string(struct menu *men Link Here
938
	while (1) {
936
	while (1) {
939
		cprint_init();
937
		cprint_init();
940
		cprint("--title");
938
		cprint("--title");
941
		cprint("%s", prompt ? prompt : _("Main Menu"));
939
		cprint("%s", prompt ? prompt : "Main Menu");
942
		cprint("--inputbox");
940
		cprint("--inputbox");
943
		switch (sym_get_type(menu->sym)) {
941
		switch (sym_get_type(menu->sym)) {
944
		case S_INT:
942
		case S_INT:
945
			cprint(_(inputbox_instructions_int));
943
			cprint(inputbox_instructions_int);
946
			break;
944
			break;
947
		case S_HEX:
945
		case S_HEX:
948
			cprint(_(inputbox_instructions_hex));
946
			cprint(inputbox_instructions_hex);
949
			break;
947
			break;
950
		case S_STRING:
948
		case S_STRING:
951
			cprint(_(inputbox_instructions_string));
949
			cprint(inputbox_instructions_string);
952
			break;
950
			break;
953
		default:
951
		default:
954
			/* panic? */;
952
			/* panic? */;
Lines 961-967 static void conf_string(struct menu *men Link Here
961
		case 0:
959
		case 0:
962
			if (sym_set_string_value(menu->sym, input_buf))
960
			if (sym_set_string_value(menu->sym, input_buf))
963
				return;
961
				return;
964
			show_textbox(NULL, _("You have made an invalid entry."), 5, 43);
962
			show_textbox(NULL, "You have made an invalid entry.", 5, 43);
965
			break;
963
			break;
966
		case 1:
964
		case 1:
967
			show_help(menu);
965
			show_help(menu);
Lines 990-999 static void conf_load(void) Link Here
990
				return;
988
				return;
991
			if (!conf_read(input_buf))
989
			if (!conf_read(input_buf))
992
				return;
990
				return;
993
			show_textbox(NULL, _("File does not exist!"), 5, 38);
991
			show_textbox(NULL, "File does not exist!", 5, 38);
994
			break;
992
			break;
995
		case 1:
993
		case 1:
996
			show_helptext(_("Load Alternate Configuration"), load_config_help);
994
			show_helptext("Load Alternate Configuration", load_config_help);
997
			break;
995
			break;
998
		case 255:
996
		case 255:
999
			return;
997
			return;
Lines 1019-1028 static void conf_save(void) Link Here
1019
				return;
1017
				return;
1020
			if (!conf_write(input_buf))
1018
			if (!conf_write(input_buf))
1021
				return;
1019
				return;
1022
			show_textbox(NULL, _("Can't create file!  Probably a nonexistent directory."), 5, 60);
1020
			show_textbox(NULL, "Can't create file!  Probably a nonexistent directory.", 5, 60);
1023
			break;
1021
			break;
1024
		case 1:
1022
		case 1:
1025
			show_helptext(_("Save Alternate Configuration"), save_config_help);
1023
			show_helptext("Save Alternate Configuration", save_config_help);
1026
			break;
1024
			break;
1027
		case 255:
1025
		case 255:
1028
			return;
1026
			return;
Lines 1043-1058 int main(int ac, char **av) Link Here
1043
	char *mode;
1041
	char *mode;
1044
	int stat;
1042
	int stat;
1045
1043
1046
	setlocale(LC_ALL, "");
1047
	bindtextdomain(PACKAGE, LOCALEDIR);
1048
	textdomain(PACKAGE);
1049
1050
	conf_parse(av[1]);
1044
	conf_parse(av[1]);
1051
	conf_read(NULL);
1045
	conf_read(NULL);
1052
1046
1053
	sym = sym_lookup("KERNELRELEASE", 0);
1047
	sym = sym_lookup("KERNELRELEASE", 0);
1054
	sym_calc_value(sym);
1048
	sym_calc_value(sym);
1055
	sprintf(menu_backtitle, _("Linux Kernel v%s Configuration"),
1049
	sprintf(menu_backtitle, "Linux Kernel v%s Configuration",
1056
		sym_get_string_value(sym));
1050
		sym_get_string_value(sym));
1057
1051
1058
	mode = getenv("MENUCONFIG_MODE");
1052
	mode = getenv("MENUCONFIG_MODE");
Lines 1069-1075 int main(int ac, char **av) Link Here
1069
	do {
1063
	do {
1070
		cprint_init();
1064
		cprint_init();
1071
		cprint("--yesno");
1065
		cprint("--yesno");
1072
		cprint(_("Do you wish to save your new kernel configuration?"));
1066
		cprint("Do you wish to save your new kernel configuration?");
1073
		cprint("5");
1067
		cprint("5");
1074
		cprint("60");
1068
		cprint("60");
1075
		stat = exec_conf();
1069
		stat = exec_conf();
Lines 1077-1096 int main(int ac, char **av) Link Here
1077
1071
1078
	if (stat == 0) {
1072
	if (stat == 0) {
1079
		if (conf_write(NULL)) {
1073
		if (conf_write(NULL)) {
1080
			fprintf(stderr, _("\n\n"
1074
			fprintf(stderr, "\n\n"
1081
				"Error during writing of the kernel configuration.\n"
1075
				"Error during writing of the kernel configuration.\n"
1082
				"Your kernel configuration changes were NOT saved."
1076
				"Your kernel configuration changes were NOT saved."
1083
				"\n\n"));
1077
				"\n\n");
1084
			return 1;
1078
			return 1;
1085
		}
1079
		}
1086
		printf(_("\n\n"
1080
		printf("\n\n"
1087
			"*** End of Linux kernel configuration.\n"
1081
			"*** End of Linux kernel configuration.\n"
1088
			"*** Execute 'make' to build the kernel or try 'make help'."
1082
			"*** Execute 'make' to build the kernel or try 'make help'."
1089
			"\n\n"));
1083
			"\n\n");
1090
	} else {
1084
	} else {
1091
		fprintf(stderr, _("\n\n"
1085
		fprintf(stderr, "\n\n"
1092
			"Your kernel configuration changes were NOT saved."
1086
			"Your kernel configuration changes were NOT saved."
1093
			"\n\n"));
1087
			"\n\n");
1094
	}
1088
	}
1095
1089
1096
	return 0;
1090
	return 0;
(-)linux-2.6.13.1.orig/scripts/kconfig/menu.c (-2 / +2 lines)
Lines 365-373 bool menu_is_visible(struct menu *menu) Link Here
365
const char *menu_get_prompt(struct menu *menu)
365
const char *menu_get_prompt(struct menu *menu)
366
{
366
{
367
	if (menu->prompt)
367
	if (menu->prompt)
368
		return _(menu->prompt->text);
368
		return menu->prompt->text;
369
	else if (menu->sym)
369
	else if (menu->sym)
370
		return _(menu->sym->name);
370
		return menu->sym->name;
371
	return NULL;
371
	return NULL;
372
}
372
}
373
373
(-)linux-2.6.13.1.orig/scripts/kconfig/qconf.cc (-39 / +20 lines)
Lines 26-48 Link Here
26
#include "qconf.moc"
26
#include "qconf.moc"
27
#include "images.c"
27
#include "images.c"
28
28
29
#ifdef _
30
# undef _
31
# define _ qgettext
32
#endif
33
34
static QApplication *configApp;
29
static QApplication *configApp;
35
30
36
static inline QString qgettext(const char* str)
37
{
38
  return QString::fromLocal8Bit(gettext(str));
39
}
40
41
static inline QString qgettext(const QString& str)
42
{
43
  return QString::fromLocal8Bit(gettext(str.latin1()));
44
}
45
46
ConfigSettings::ConfigSettings()
31
ConfigSettings::ConfigSettings()
47
	: showAll(false), showName(false), showRange(false), showData(false)
32
	: showAll(false), showName(false), showRange(false), showData(false)
48
{
33
{
Lines 192-198 void ConfigItem::updateMenu(void) Link Here
192
177
193
	sym = menu->sym;
178
	sym = menu->sym;
194
	prop = menu->prompt;
179
	prop = menu->prompt;
195
	prompt = QString::fromLocal8Bit(menu_get_prompt(menu));
180
	prompt = menu_get_prompt(menu);
196
181
197
	if (prop) switch (prop->type) {
182
	if (prop) switch (prop->type) {
198
	case P_MENU:
183
	case P_MENU:
Lines 218-224 void ConfigItem::updateMenu(void) Link Here
218
	if (!sym)
203
	if (!sym)
219
		goto set_prompt;
204
		goto set_prompt;
220
205
221
	setText(nameColIdx, QString::fromLocal8Bit(sym->name));
206
	setText(nameColIdx, sym->name);
222
207
223
	type = sym_get_type(sym);
208
	type = sym_get_type(sym);
224
	switch (type) {
209
	switch (type) {
Lines 228-236 void ConfigItem::updateMenu(void) Link Here
228
213
229
		if (!sym_is_changable(sym) && !list->showAll) {
214
		if (!sym_is_changable(sym) && !list->showAll) {
230
			setPixmap(promptColIdx, 0);
215
			setPixmap(promptColIdx, 0);
231
			setText(noColIdx, QString::null);
216
			setText(noColIdx, 0);
232
			setText(modColIdx, QString::null);
217
			setText(modColIdx, 0);
233
			setText(yesColIdx, QString::null);
218
			setText(yesColIdx, 0);
234
			break;
219
			break;
235
		}
220
		}
236
		expr = sym_get_tristate_value(sym);
221
		expr = sym_get_tristate_value(sym);
Lines 272-278 void ConfigItem::updateMenu(void) Link Here
272
		const char* data;
257
		const char* data;
273
258
274
		data = sym_get_string_value(sym);
259
		data = sym_get_string_value(sym);
275
276
#if QT_VERSION >= 300
260
#if QT_VERSION >= 300
277
		int i = list->mapIdx(dataColIdx);
261
		int i = list->mapIdx(dataColIdx);
278
		if (i >= 0)
262
		if (i >= 0)
Lines 280-288 void ConfigItem::updateMenu(void) Link Here
280
#endif
264
#endif
281
		setText(dataColIdx, data);
265
		setText(dataColIdx, data);
282
		if (type == S_STRING)
266
		if (type == S_STRING)
283
			prompt = QString("%1: %2").arg(prompt).arg(data);
267
			prompt.sprintf("%s: %s", prompt.latin1(), data);
284
		else
268
		else
285
			prompt = QString("(%2) %1").arg(prompt).arg(data);
269
			prompt.sprintf("(%s) %s", data, prompt.latin1());
286
		break;
270
		break;
287
	}
271
	}
288
	if (!sym_has_value(sym) && visible)
272
	if (!sym_has_value(sym) && visible)
Lines 359-367 void ConfigLineEdit::show(ConfigItem* i) Link Here
359
{
343
{
360
	item = i;
344
	item = i;
361
	if (sym_get_string_value(item->menu->sym))
345
	if (sym_get_string_value(item->menu->sym))
362
		setText(QString::fromLocal8Bit(sym_get_string_value(item->menu->sym)));
346
		setText(sym_get_string_value(item->menu->sym));
363
	else
347
	else
364
		setText(QString::null);
348
		setText(0);
365
	Parent::show();
349
	Parent::show();
366
	setFocus();
350
	setFocus();
367
}
351
}
Lines 977-983 ConfigMainWindow::ConfigMainWindow(void) Link Here
977
	delete configSettings;
961
	delete configSettings;
978
}
962
}
979
963
980
static QString print_filter(const QString &str)
964
static QString print_filter(const char *str)
981
{
965
{
982
	QRegExp re("[<>&\"\\n]");
966
	QRegExp re("[<>&\"\\n]");
983
	QString res = str;
967
	QString res = str;
Lines 1010-1016 static QString print_filter(const QStrin Link Here
1010
994
1011
static void expr_print_help(void *data, const char *str)
995
static void expr_print_help(void *data, const char *str)
1012
{
996
{
1013
	reinterpret_cast<QString*>(data)->append(print_filter(str));
997
	((QString*)data)->append(print_filter(str));
1014
}
998
}
1015
999
1016
/*
1000
/*
Lines 1025-1031 void ConfigMainWindow::setHelp(QListView Link Here
1025
	if (item)
1009
	if (item)
1026
		menu = ((ConfigItem*)item)->menu;
1010
		menu = ((ConfigItem*)item)->menu;
1027
	if (!menu) {
1011
	if (!menu) {
1028
		helpText->setText(QString::null);
1012
		helpText->setText(NULL);
1029
		return;
1013
		return;
1030
	}
1014
	}
1031
1015
Lines 1035-1050 void ConfigMainWindow::setHelp(QListView Link Here
1035
	if (sym) {
1019
	if (sym) {
1036
		if (menu->prompt) {
1020
		if (menu->prompt) {
1037
			head += "<big><b>";
1021
			head += "<big><b>";
1038
			head += print_filter(_(menu->prompt->text));
1022
			head += print_filter(menu->prompt->text);
1039
			head += "</b></big>";
1023
			head += "</b></big>";
1040
			if (sym->name) {
1024
			if (sym->name) {
1041
				head += " (";
1025
				head += " (";
1042
				head += print_filter(_(sym->name));
1026
				head += print_filter(sym->name);
1043
				head += ")";
1027
				head += ")";
1044
			}
1028
			}
1045
		} else if (sym->name) {
1029
		} else if (sym->name) {
1046
			head += "<big><b>";
1030
			head += "<big><b>";
1047
			head += print_filter(_(sym->name));
1031
			head += print_filter(sym->name);
1048
			head += "</b></big>";
1032
			head += "</b></big>";
1049
		}
1033
		}
1050
		head += "<br><br>";
1034
		head += "<br><br>";
Lines 1065-1071 void ConfigMainWindow::setHelp(QListView Link Here
1065
				case P_PROMPT:
1049
				case P_PROMPT:
1066
				case P_MENU:
1050
				case P_MENU:
1067
					debug += "prompt: ";
1051
					debug += "prompt: ";
1068
					debug += print_filter(_(prop->text));
1052
					debug += print_filter(prop->text);
1069
					debug += "<br>";
1053
					debug += "<br>";
1070
					break;
1054
					break;
1071
				case P_DEFAULT:
1055
				case P_DEFAULT:
Lines 1104-1113 void ConfigMainWindow::setHelp(QListView Link Here
1104
			debug += "<br>";
1088
			debug += "<br>";
1105
		}
1089
		}
1106
1090
1107
		help = print_filter(_(sym->help));
1091
		help = print_filter(sym->help);
1108
	} else if (menu->prompt) {
1092
	} else if (menu->prompt) {
1109
		head += "<big><b>";
1093
		head += "<big><b>";
1110
		head += print_filter(_(menu->prompt->text));
1094
		head += print_filter(menu->prompt->text);
1111
		head += "</b></big><br><br>";
1095
		head += "</b></big><br><br>";
1112
		if (showDebug) {
1096
		if (showDebug) {
1113
			if (menu->prompt->visible.expr) {
1097
			if (menu->prompt->visible.expr) {
Lines 1127-1133 void ConfigMainWindow::loadConfig(void) Link Here
1127
	QString s = QFileDialog::getOpenFileName(".config", NULL, this);
1111
	QString s = QFileDialog::getOpenFileName(".config", NULL, this);
1128
	if (s.isNull())
1112
	if (s.isNull())
1129
		return;
1113
		return;
1130
	if (conf_read(QFile::encodeName(s)))
1114
	if (conf_read(s.latin1()))
1131
		QMessageBox::information(this, "qconf", "Unable to load configuration!");
1115
		QMessageBox::information(this, "qconf", "Unable to load configuration!");
1132
	ConfigView::updateListAll();
1116
	ConfigView::updateListAll();
1133
}
1117
}
Lines 1143-1149 void ConfigMainWindow::saveConfigAs(void Link Here
1143
	QString s = QFileDialog::getSaveFileName(".config", NULL, this);
1127
	QString s = QFileDialog::getSaveFileName(".config", NULL, this);
1144
	if (s.isNull())
1128
	if (s.isNull())
1145
		return;
1129
		return;
1146
	if (conf_write(QFile::encodeName(s)))
1130
	if (conf_write(s.latin1()))
1147
		QMessageBox::information(this, "qconf", "Unable to save configuration!");
1131
		QMessageBox::information(this, "qconf", "Unable to save configuration!");
1148
}
1132
}
1149
1133
Lines 1388-1396 int main(int ac, char** av) Link Here
1388
	ConfigMainWindow* v;
1372
	ConfigMainWindow* v;
1389
	const char *name;
1373
	const char *name;
1390
1374
1391
	bindtextdomain(PACKAGE, LOCALEDIR);
1392
	textdomain(PACKAGE);
1393
1394
#ifndef LKC_DIRECT_LINK
1375
#ifndef LKC_DIRECT_LINK
1395
	kconfig_load();
1376
	kconfig_load();
1396
#endif
1377
#endif

Return to bug 99810