mirror of
https://github.com/torvalds/linux.git
synced 2024-12-30 23:02:08 +00:00
kconfig: drop localization support
The localization support is broken and appears unused. There is no google hits on the update-po-config target. And there is no recent (5 years) activity related to the localization. So lets just drop this as it is no longer used. Suggested-by: Ulf Magnusson <ulfalizer@gmail.com> Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
1c5af5cf93
commit
694c49a7c0
4
scripts/kconfig/.gitignore
vendored
4
scripts/kconfig/.gitignore
vendored
@ -2,9 +2,6 @@
|
|||||||
# Generated files
|
# Generated files
|
||||||
#
|
#
|
||||||
*.moc
|
*.moc
|
||||||
gconf.glade.h
|
|
||||||
*.pot
|
|
||||||
*.mo
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# configuration programs
|
# configuration programs
|
||||||
@ -14,4 +11,3 @@ mconf
|
|||||||
nconf
|
nconf
|
||||||
qconf
|
qconf
|
||||||
gconf
|
gconf
|
||||||
kxgettext
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
# Kernel configuration targets
|
# Kernel configuration targets
|
||||||
# These targets are used from top-level makefile
|
# These targets are used from top-level makefile
|
||||||
|
|
||||||
PHONY += xconfig gconfig menuconfig config syncconfig update-po-config \
|
PHONY += xconfig gconfig menuconfig config syncconfig \
|
||||||
localmodconfig localyesconfig
|
localmodconfig localyesconfig
|
||||||
|
|
||||||
ifdef KBUILD_KCONFIG
|
ifdef KBUILD_KCONFIG
|
||||||
@ -55,29 +55,6 @@ localyesconfig localmodconfig: $(obj)/conf
|
|||||||
fi
|
fi
|
||||||
$(Q)rm -f .tmp.config
|
$(Q)rm -f .tmp.config
|
||||||
|
|
||||||
# Create new linux.pot file
|
|
||||||
# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
|
|
||||||
update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
|
|
||||||
$(Q)$(kecho) " GEN config.pot"
|
|
||||||
$(Q)xgettext --default-domain=linux \
|
|
||||||
--add-comments --keyword=_ --keyword=N_ \
|
|
||||||
--from-code=UTF-8 \
|
|
||||||
--files-from=$(srctree)/scripts/kconfig/POTFILES.in \
|
|
||||||
--directory=$(srctree) --directory=$(objtree) \
|
|
||||||
--output $(obj)/config.pot
|
|
||||||
$(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
|
|
||||||
$(Q)(for i in `ls $(srctree)/arch/*/Kconfig \
|
|
||||||
$(srctree)/arch/*/um/Kconfig`; \
|
|
||||||
do \
|
|
||||||
$(kecho) " GEN $$i"; \
|
|
||||||
$(obj)/kxgettext $$i \
|
|
||||||
>> $(obj)/config.pot; \
|
|
||||||
done )
|
|
||||||
$(Q)$(kecho) " GEN linux.pot"
|
|
||||||
$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
|
|
||||||
--output $(obj)/linux.pot
|
|
||||||
$(Q)rm -f $(obj)/config.pot
|
|
||||||
|
|
||||||
# These targets map 1:1 to the commandline options of 'conf'
|
# These targets map 1:1 to the commandline options of 'conf'
|
||||||
simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
|
simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
|
||||||
alldefconfig randconfig listnewconfig olddefconfig
|
alldefconfig randconfig listnewconfig olddefconfig
|
||||||
@ -179,19 +156,11 @@ help:
|
|||||||
# object files used by all kconfig flavours
|
# object files used by all kconfig flavours
|
||||||
|
|
||||||
conf-objs := conf.o zconf.tab.o
|
conf-objs := conf.o zconf.tab.o
|
||||||
kxgettext-objs := kxgettext.o zconf.tab.o
|
|
||||||
|
|
||||||
hostprogs-y := conf kxgettext
|
hostprogs-y := conf
|
||||||
|
|
||||||
targets += zconf.lex.c
|
targets += zconf.lex.c
|
||||||
clean-files += gconf.glade.h
|
|
||||||
clean-files += config.pot linux.pot
|
|
||||||
|
|
||||||
# Add environment specific flags
|
|
||||||
HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) \
|
|
||||||
-DLOCALE
|
|
||||||
HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCXX) $(HOSTCXXFLAGS)) \
|
|
||||||
-DLOCALE
|
|
||||||
# generated files seem to need this to find local include files
|
# generated files seem to need this to find local include files
|
||||||
HOSTCFLAGS_zconf.lex.o := -I$(src)
|
HOSTCFLAGS_zconf.lex.o := -I$(src)
|
||||||
HOSTCFLAGS_zconf.tab.o := -I$(src)
|
HOSTCFLAGS_zconf.tab.o := -I$(src)
|
||||||
@ -244,11 +213,6 @@ $(obj)/gconf.o: $(obj)/.gconf-cfg
|
|||||||
|
|
||||||
$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
|
$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
|
||||||
|
|
||||||
# Extract gconf menu items for i18n support
|
|
||||||
$(obj)/gconf.glade.h: $(obj)/gconf.glade
|
|
||||||
$(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
|
|
||||||
$(obj)/gconf.glade
|
|
||||||
|
|
||||||
# check if necessary packages are available, and configure build flags
|
# check if necessary packages are available, and configure build flags
|
||||||
define filechk_conf_cfg
|
define filechk_conf_cfg
|
||||||
$(CONFIG_SHELL) $<
|
$(CONFIG_SHELL) $<
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
scripts/kconfig/lxdialog/checklist.c
|
|
||||||
scripts/kconfig/lxdialog/inputbox.c
|
|
||||||
scripts/kconfig/lxdialog/menubox.c
|
|
||||||
scripts/kconfig/lxdialog/textbox.c
|
|
||||||
scripts/kconfig/lxdialog/util.c
|
|
||||||
scripts/kconfig/lxdialog/yesno.c
|
|
||||||
scripts/kconfig/mconf.c
|
|
||||||
scripts/kconfig/conf.c
|
|
||||||
scripts/kconfig/confdata.c
|
|
||||||
scripts/kconfig/gconf.c
|
|
||||||
scripts/kconfig/gconf.glade.h
|
|
||||||
scripts/kconfig/qconf.cc
|
|
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
|
||||||
# Needed for systems without gettext
|
|
||||||
$* -x c -o /dev/null - > /dev/null 2>&1 << EOF
|
|
||||||
#include <libintl.h>
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
gettext("");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
if [ ! "$?" -eq "0" ]; then
|
|
||||||
echo -DKBUILD_NO_NLS;
|
|
||||||
fi
|
|
@ -3,7 +3,6 @@
|
|||||||
* Released under the terms of the GNU GPL v2.0.
|
* Released under the terms of the GNU GPL v2.0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <locale.h>
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -86,7 +85,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
|
|||||||
enum symbol_type type = sym_get_type(sym);
|
enum symbol_type type = sym_get_type(sym);
|
||||||
|
|
||||||
if (!sym_has_value(sym))
|
if (!sym_has_value(sym))
|
||||||
printf(_("(NEW) "));
|
printf("(NEW) ");
|
||||||
|
|
||||||
line[0] = '\n';
|
line[0] = '\n';
|
||||||
line[1] = 0;
|
line[1] = 0;
|
||||||
@ -133,7 +132,7 @@ static int conf_string(struct menu *menu)
|
|||||||
const char *def;
|
const char *def;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
printf("%*s%s ", indent - 1, "", _(menu->prompt->text));
|
printf("%*s%s ", indent - 1, "", menu->prompt->text);
|
||||||
printf("(%s) ", sym->name);
|
printf("(%s) ", sym->name);
|
||||||
def = sym_get_string_value(sym);
|
def = sym_get_string_value(sym);
|
||||||
if (sym_get_string_value(sym))
|
if (sym_get_string_value(sym))
|
||||||
@ -166,7 +165,7 @@ static int conf_sym(struct menu *menu)
|
|||||||
tristate oldval, newval;
|
tristate oldval, newval;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
printf("%*s%s ", indent - 1, "", _(menu->prompt->text));
|
printf("%*s%s ", indent - 1, "", menu->prompt->text);
|
||||||
if (sym->name)
|
if (sym->name)
|
||||||
printf("(%s) ", sym->name);
|
printf("(%s) ", sym->name);
|
||||||
putchar('[');
|
putchar('[');
|
||||||
@ -251,7 +250,7 @@ static int conf_choice(struct menu *menu)
|
|||||||
case no:
|
case no:
|
||||||
return 1;
|
return 1;
|
||||||
case mod:
|
case mod:
|
||||||
printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu)));
|
printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
|
||||||
return 0;
|
return 0;
|
||||||
case yes:
|
case yes:
|
||||||
break;
|
break;
|
||||||
@ -261,7 +260,7 @@ static int conf_choice(struct menu *menu)
|
|||||||
while (1) {
|
while (1) {
|
||||||
int cnt, def;
|
int cnt, def;
|
||||||
|
|
||||||
printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu)));
|
printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
|
||||||
def_sym = sym_get_choice_value(sym);
|
def_sym = sym_get_choice_value(sym);
|
||||||
cnt = def = 0;
|
cnt = def = 0;
|
||||||
line[0] = 0;
|
line[0] = 0;
|
||||||
@ -269,7 +268,7 @@ static int conf_choice(struct menu *menu)
|
|||||||
if (!menu_is_visible(child))
|
if (!menu_is_visible(child))
|
||||||
continue;
|
continue;
|
||||||
if (!child->sym) {
|
if (!child->sym) {
|
||||||
printf("%*c %s\n", indent, '*', _(menu_get_prompt(child)));
|
printf("%*c %s\n", indent, '*', menu_get_prompt(child));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
cnt++;
|
cnt++;
|
||||||
@ -278,14 +277,14 @@ static int conf_choice(struct menu *menu)
|
|||||||
printf("%*c", indent, '>');
|
printf("%*c", indent, '>');
|
||||||
} else
|
} else
|
||||||
printf("%*c", indent, ' ');
|
printf("%*c", indent, ' ');
|
||||||
printf(" %d. %s", cnt, _(menu_get_prompt(child)));
|
printf(" %d. %s", cnt, menu_get_prompt(child));
|
||||||
if (child->sym->name)
|
if (child->sym->name)
|
||||||
printf(" (%s)", child->sym->name);
|
printf(" (%s)", child->sym->name);
|
||||||
if (!sym_has_value(child->sym))
|
if (!sym_has_value(child->sym))
|
||||||
printf(_(" (NEW)"));
|
printf(" (NEW)");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
printf(_("%*schoice"), indent - 1, "");
|
printf("%*schoice", indent - 1, "");
|
||||||
if (cnt == 1) {
|
if (cnt == 1) {
|
||||||
printf("[1]: 1\n");
|
printf("[1]: 1\n");
|
||||||
goto conf_childs;
|
goto conf_childs;
|
||||||
@ -372,7 +371,7 @@ static void conf(struct menu *menu)
|
|||||||
if (prompt)
|
if (prompt)
|
||||||
printf("%*c\n%*c %s\n%*c\n",
|
printf("%*c\n%*c %s\n%*c\n",
|
||||||
indent, '*',
|
indent, '*',
|
||||||
indent, '*', _(prompt),
|
indent, '*', prompt,
|
||||||
indent, '*');
|
indent, '*');
|
||||||
default:
|
default:
|
||||||
;
|
;
|
||||||
@ -437,7 +436,7 @@ static void check_conf(struct menu *menu)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!conf_cnt++)
|
if (!conf_cnt++)
|
||||||
printf(_("*\n* Restart config...\n*\n"));
|
printf("*\n* Restart config...\n*\n");
|
||||||
rootEntry = menu_get_parent_menu(menu);
|
rootEntry = menu_get_parent_menu(menu);
|
||||||
conf(rootEntry);
|
conf(rootEntry);
|
||||||
}
|
}
|
||||||
@ -498,10 +497,6 @@ int main(int ac, char **av)
|
|||||||
const char *name, *defconfig_file = NULL /* gcc uninit */;
|
const char *name, *defconfig_file = NULL /* gcc uninit */;
|
||||||
struct stat tmpstat;
|
struct stat tmpstat;
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
|
||||||
textdomain(PACKAGE);
|
|
||||||
|
|
||||||
tty_stdio = isatty(0) && isatty(1);
|
tty_stdio = isatty(0) && isatty(1);
|
||||||
|
|
||||||
while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
|
while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
|
||||||
@ -559,7 +554,7 @@ int main(int ac, char **av)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ac == optind) {
|
if (ac == optind) {
|
||||||
fprintf(stderr, _("%s: Kconfig file missing\n"), av[0]);
|
fprintf(stderr, "%s: Kconfig file missing\n", av[0]);
|
||||||
conf_usage(progname);
|
conf_usage(progname);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -569,12 +564,12 @@ int main(int ac, char **av)
|
|||||||
if (sync_kconfig) {
|
if (sync_kconfig) {
|
||||||
name = conf_get_configname();
|
name = conf_get_configname();
|
||||||
if (stat(name, &tmpstat)) {
|
if (stat(name, &tmpstat)) {
|
||||||
fprintf(stderr, _("***\n"
|
fprintf(stderr, "***\n"
|
||||||
"*** Configuration file \"%s\" not found!\n"
|
"*** Configuration file \"%s\" not found!\n"
|
||||||
"***\n"
|
"***\n"
|
||||||
"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
|
"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
|
||||||
"*** \"make menuconfig\" or \"make xconfig\").\n"
|
"*** \"make menuconfig\" or \"make xconfig\").\n"
|
||||||
"***\n"), name);
|
"***\n", name);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -585,9 +580,9 @@ int main(int ac, char **av)
|
|||||||
defconfig_file = conf_get_default_confname();
|
defconfig_file = conf_get_default_confname();
|
||||||
if (conf_read(defconfig_file)) {
|
if (conf_read(defconfig_file)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("***\n"
|
"***\n"
|
||||||
"*** Can't find default configuration \"%s\"!\n"
|
"*** Can't find default configuration \"%s\"!\n"
|
||||||
"***\n"),
|
"***\n",
|
||||||
defconfig_file);
|
defconfig_file);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -611,7 +606,7 @@ int main(int ac, char **av)
|
|||||||
if ((strcmp(name, "") != 0) && (strcmp(name, "1") != 0)) {
|
if ((strcmp(name, "") != 0) && (strcmp(name, "1") != 0)) {
|
||||||
if (conf_read_simple(name, S_DEF_USER)) {
|
if (conf_read_simple(name, S_DEF_USER)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("*** Can't read seed configuration \"%s\"!\n"),
|
"*** Can't read seed configuration \"%s\"!\n",
|
||||||
name);
|
name);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -628,7 +623,7 @@ int main(int ac, char **av)
|
|||||||
if (conf_read_simple(name, S_DEF_USER) &&
|
if (conf_read_simple(name, S_DEF_USER) &&
|
||||||
conf_read_simple("all.config", S_DEF_USER)) {
|
conf_read_simple("all.config", S_DEF_USER)) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n"),
|
"*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n",
|
||||||
name);
|
name);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -642,7 +637,7 @@ int main(int ac, char **av)
|
|||||||
name = getenv("KCONFIG_NOSILENTUPDATE");
|
name = getenv("KCONFIG_NOSILENTUPDATE");
|
||||||
if (name && *name) {
|
if (name && *name) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
_("\n*** The configuration requires explicit update.\n\n"));
|
"\n*** The configuration requires explicit update.\n\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -694,22 +689,22 @@ int main(int ac, char **av)
|
|||||||
* All other commands are only used to generate a config.
|
* All other commands are only used to generate a config.
|
||||||
*/
|
*/
|
||||||
if (conf_get_changed() && conf_write(NULL)) {
|
if (conf_get_changed() && conf_write(NULL)) {
|
||||||
fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
|
fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (conf_write_autoconf()) {
|
if (conf_write_autoconf()) {
|
||||||
fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
|
fprintf(stderr, "\n*** Error during update of the configuration.\n\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else if (input_mode == savedefconfig) {
|
} else if (input_mode == savedefconfig) {
|
||||||
if (conf_write_defconfig(defconfig_file)) {
|
if (conf_write_defconfig(defconfig_file)) {
|
||||||
fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"),
|
fprintf(stderr, "n*** Error while saving defconfig to: %s\n\n",
|
||||||
defconfig_file);
|
defconfig_file);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else if (input_mode != listnewconfig) {
|
} else if (input_mode != listnewconfig) {
|
||||||
if (conf_write(NULL)) {
|
if (conf_write(NULL)) {
|
||||||
fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
|
fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -277,7 +277,7 @@ int conf_read_simple(const char *name, int def)
|
|||||||
name = conf_expand_value(prop->expr->left.sym->name);
|
name = conf_expand_value(prop->expr->left.sym->name);
|
||||||
in = zconf_fopen(name);
|
in = zconf_fopen(name);
|
||||||
if (in) {
|
if (in) {
|
||||||
conf_message(_("using defaults found in %s"),
|
conf_message("using defaults found in %s",
|
||||||
name);
|
name);
|
||||||
goto load;
|
goto load;
|
||||||
}
|
}
|
||||||
@ -831,7 +831,7 @@ next:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_message(_("configuration written to %s"), newname);
|
conf_message("configuration written to %s", newname);
|
||||||
|
|
||||||
sym_set_change_count(0);
|
sym_set_change_count(0);
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ void init_main_window(const gchar * glade_file)
|
|||||||
|
|
||||||
xml = glade_xml_new(glade_file, "window1", NULL);
|
xml = glade_xml_new(glade_file, "window1", NULL);
|
||||||
if (!xml)
|
if (!xml)
|
||||||
g_error(_("GUI loading failed !\n"));
|
g_error("GUI loading failed !\n");
|
||||||
glade_xml_signal_autoconnect(xml);
|
glade_xml_signal_autoconnect(xml);
|
||||||
|
|
||||||
main_wnd = glade_xml_get_widget(xml, "window1");
|
main_wnd = glade_xml_get_widget(xml, "window1");
|
||||||
@ -233,7 +233,7 @@ void init_left_tree(void)
|
|||||||
|
|
||||||
column = gtk_tree_view_column_new();
|
column = gtk_tree_view_column_new();
|
||||||
gtk_tree_view_append_column(view, column);
|
gtk_tree_view_append_column(view, column);
|
||||||
gtk_tree_view_column_set_title(column, _("Options"));
|
gtk_tree_view_column_set_title(column, "Options");
|
||||||
|
|
||||||
renderer = gtk_cell_renderer_toggle_new();
|
renderer = gtk_cell_renderer_toggle_new();
|
||||||
gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
|
gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
|
||||||
@ -276,7 +276,7 @@ void init_right_tree(void)
|
|||||||
|
|
||||||
column = gtk_tree_view_column_new();
|
column = gtk_tree_view_column_new();
|
||||||
gtk_tree_view_append_column(view, column);
|
gtk_tree_view_append_column(view, column);
|
||||||
gtk_tree_view_column_set_title(column, _("Options"));
|
gtk_tree_view_column_set_title(column, "Options");
|
||||||
|
|
||||||
renderer = gtk_cell_renderer_pixbuf_new();
|
renderer = gtk_cell_renderer_pixbuf_new();
|
||||||
gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
|
gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
|
||||||
@ -305,7 +305,7 @@ void init_right_tree(void)
|
|||||||
|
|
||||||
renderer = gtk_cell_renderer_text_new();
|
renderer = gtk_cell_renderer_text_new();
|
||||||
gtk_tree_view_insert_column_with_attributes(view, -1,
|
gtk_tree_view_insert_column_with_attributes(view, -1,
|
||||||
_("Name"), renderer,
|
"Name", renderer,
|
||||||
"text", COL_NAME,
|
"text", COL_NAME,
|
||||||
"foreground-gdk",
|
"foreground-gdk",
|
||||||
COL_COLOR, NULL);
|
COL_COLOR, NULL);
|
||||||
@ -329,7 +329,7 @@ void init_right_tree(void)
|
|||||||
COL_COLOR, NULL);
|
COL_COLOR, NULL);
|
||||||
renderer = gtk_cell_renderer_text_new();
|
renderer = gtk_cell_renderer_text_new();
|
||||||
gtk_tree_view_insert_column_with_attributes(view, -1,
|
gtk_tree_view_insert_column_with_attributes(view, -1,
|
||||||
_("Value"), renderer,
|
"Value", renderer,
|
||||||
"text", COL_VALUE,
|
"text", COL_VALUE,
|
||||||
"editable",
|
"editable",
|
||||||
COL_EDIT,
|
COL_EDIT,
|
||||||
@ -368,7 +368,7 @@ static void text_insert_help(struct menu *menu)
|
|||||||
{
|
{
|
||||||
GtkTextBuffer *buffer;
|
GtkTextBuffer *buffer;
|
||||||
GtkTextIter start, end;
|
GtkTextIter start, end;
|
||||||
const char *prompt = _(menu_get_prompt(menu));
|
const char *prompt = menu_get_prompt(menu);
|
||||||
struct gstr help = str_new();
|
struct gstr help = str_new();
|
||||||
|
|
||||||
menu_get_ext_help(menu, &help);
|
menu_get_ext_help(menu, &help);
|
||||||
@ -422,7 +422,7 @@ gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event,
|
|||||||
if (!conf_get_changed())
|
if (!conf_get_changed())
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
dialog = gtk_dialog_new_with_buttons(_("Warning !"),
|
dialog = gtk_dialog_new_with_buttons("Warning !",
|
||||||
GTK_WINDOW(main_wnd),
|
GTK_WINDOW(main_wnd),
|
||||||
(GtkDialogFlags)
|
(GtkDialogFlags)
|
||||||
(GTK_DIALOG_MODAL |
|
(GTK_DIALOG_MODAL |
|
||||||
@ -436,7 +436,7 @@ gboolean on_window1_delete_event(GtkWidget * widget, GdkEvent * event,
|
|||||||
gtk_dialog_set_default_response(GTK_DIALOG(dialog),
|
gtk_dialog_set_default_response(GTK_DIALOG(dialog),
|
||||||
GTK_RESPONSE_CANCEL);
|
GTK_RESPONSE_CANCEL);
|
||||||
|
|
||||||
label = gtk_label_new(_("\nSave configuration ?\n"));
|
label = gtk_label_new("\nSave configuration ?\n");
|
||||||
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
|
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label);
|
||||||
gtk_widget_show(label);
|
gtk_widget_show(label);
|
||||||
|
|
||||||
@ -496,7 +496,7 @@ load_filename(GtkFileSelection * file_selector, gpointer user_data)
|
|||||||
(user_data));
|
(user_data));
|
||||||
|
|
||||||
if (conf_read(fn))
|
if (conf_read(fn))
|
||||||
text_insert_msg(_("Error"), _("Unable to load configuration !"));
|
text_insert_msg("Error", "Unable to load configuration !");
|
||||||
else
|
else
|
||||||
display_tree(&rootmenu);
|
display_tree(&rootmenu);
|
||||||
}
|
}
|
||||||
@ -505,7 +505,7 @@ void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
|||||||
{
|
{
|
||||||
GtkWidget *fs;
|
GtkWidget *fs;
|
||||||
|
|
||||||
fs = gtk_file_selection_new(_("Load file..."));
|
fs = gtk_file_selection_new("Load file...");
|
||||||
g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
|
g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
|
||||||
"clicked",
|
"clicked",
|
||||||
G_CALLBACK(load_filename), (gpointer) fs);
|
G_CALLBACK(load_filename), (gpointer) fs);
|
||||||
@ -524,7 +524,7 @@ void on_load1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
|||||||
void on_save_activate(GtkMenuItem * menuitem, gpointer user_data)
|
void on_save_activate(GtkMenuItem * menuitem, gpointer user_data)
|
||||||
{
|
{
|
||||||
if (conf_write(NULL))
|
if (conf_write(NULL))
|
||||||
text_insert_msg(_("Error"), _("Unable to save configuration !"));
|
text_insert_msg("Error", "Unable to save configuration !");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -537,7 +537,7 @@ store_filename(GtkFileSelection * file_selector, gpointer user_data)
|
|||||||
(user_data));
|
(user_data));
|
||||||
|
|
||||||
if (conf_write(fn))
|
if (conf_write(fn))
|
||||||
text_insert_msg(_("Error"), _("Unable to save configuration !"));
|
text_insert_msg("Error", "Unable to save configuration !");
|
||||||
|
|
||||||
gtk_widget_destroy(GTK_WIDGET(user_data));
|
gtk_widget_destroy(GTK_WIDGET(user_data));
|
||||||
}
|
}
|
||||||
@ -546,7 +546,7 @@ void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
|||||||
{
|
{
|
||||||
GtkWidget *fs;
|
GtkWidget *fs;
|
||||||
|
|
||||||
fs = gtk_file_selection_new(_("Save file as..."));
|
fs = gtk_file_selection_new("Save file as...");
|
||||||
g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
|
g_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(fs)->ok_button),
|
||||||
"clicked",
|
"clicked",
|
||||||
G_CALLBACK(store_filename), (gpointer) fs);
|
G_CALLBACK(store_filename), (gpointer) fs);
|
||||||
@ -639,7 +639,7 @@ on_set_option_mode3_activate(GtkMenuItem *menuitem, gpointer user_data)
|
|||||||
void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
const gchar *intro_text = _(
|
const gchar *intro_text =
|
||||||
"Welcome to gkc, the GTK+ graphical configuration tool\n"
|
"Welcome to gkc, the GTK+ graphical configuration tool\n"
|
||||||
"For each option, a blank box indicates the feature is disabled, a\n"
|
"For each option, a blank box indicates the feature is disabled, a\n"
|
||||||
"check indicates it is enabled, and a dot indicates that it is to\n"
|
"check indicates it is enabled, and a dot indicates that it is to\n"
|
||||||
@ -654,7 +654,7 @@ void on_introduction1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
|||||||
"option.\n"
|
"option.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Toggling Show Debug Info under the Options menu will show \n"
|
"Toggling Show Debug Info under the Options menu will show \n"
|
||||||
"the dependencies, which you can then match by examining other options.");
|
"the dependencies, which you can then match by examining other options.";
|
||||||
|
|
||||||
dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
|
dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
|
||||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
@ -671,8 +671,8 @@ void on_about1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
|||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
const gchar *about_text =
|
const gchar *about_text =
|
||||||
_("gkc is copyright (c) 2002 Romain Lievin <roms@lpg.ticalc.org>.\n"
|
"gkc is copyright (c) 2002 Romain Lievin <roms@lpg.ticalc.org>.\n"
|
||||||
"Based on the source code from Roman Zippel.\n");
|
"Based on the source code from Roman Zippel.\n";
|
||||||
|
|
||||||
dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
|
dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
|
||||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
@ -689,9 +689,9 @@ void on_license1_activate(GtkMenuItem * menuitem, gpointer user_data)
|
|||||||
{
|
{
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
const gchar *license_text =
|
const gchar *license_text =
|
||||||
_("gkc is released under the terms of the GNU GPL v2.\n"
|
"gkc is released under the terms of the GNU GPL v2.\n"
|
||||||
"For more information, please see the source code or\n"
|
"For more information, please see the source code or\n"
|
||||||
"visit http://www.fsf.org/licenses/licenses.html\n");
|
"visit http://www.fsf.org/licenses/licenses.html\n";
|
||||||
|
|
||||||
dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
|
dialog = gtk_message_dialog_new(GTK_WINDOW(main_wnd),
|
||||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||||
@ -1049,7 +1049,7 @@ static gchar **fill_row(struct menu *menu)
|
|||||||
bzero(row, sizeof(row));
|
bzero(row, sizeof(row));
|
||||||
|
|
||||||
row[COL_OPTION] =
|
row[COL_OPTION] =
|
||||||
g_strdup_printf("%s %s", _(menu_get_prompt(menu)),
|
g_strdup_printf("%s %s", menu_get_prompt(menu),
|
||||||
sym && !sym_has_value(sym) ? "(NEW)" : "");
|
sym && !sym_has_value(sym) ? "(NEW)" : "");
|
||||||
|
|
||||||
if (opt_mode == OPT_ALL && !menu_is_visible(menu))
|
if (opt_mode == OPT_ALL && !menu_is_visible(menu))
|
||||||
@ -1102,7 +1102,7 @@ static gchar **fill_row(struct menu *menu)
|
|||||||
|
|
||||||
if (def_menu)
|
if (def_menu)
|
||||||
row[COL_VALUE] =
|
row[COL_VALUE] =
|
||||||
g_strdup(_(menu_get_prompt(def_menu)));
|
g_strdup(menu_get_prompt(def_menu));
|
||||||
}
|
}
|
||||||
if (sym->flags & SYMBOL_CHOICEVAL)
|
if (sym->flags & SYMBOL_CHOICEVAL)
|
||||||
row[COL_BTNRAD] = GINT_TO_POINTER(TRUE);
|
row[COL_BTNRAD] = GINT_TO_POINTER(TRUE);
|
||||||
@ -1447,10 +1447,6 @@ int main(int ac, char *av[])
|
|||||||
char *env;
|
char *env;
|
||||||
gchar *glade_file;
|
gchar *glade_file;
|
||||||
|
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
|
||||||
bind_textdomain_codeset(PACKAGE, "UTF-8");
|
|
||||||
textdomain(PACKAGE);
|
|
||||||
|
|
||||||
/* GTK stuffs */
|
/* GTK stuffs */
|
||||||
gtk_set_locale();
|
gtk_set_locale();
|
||||||
gtk_init(&ac, &av);
|
gtk_init(&ac, &av);
|
||||||
|
@ -1,235 +0,0 @@
|
|||||||
/*
|
|
||||||
* Arnaldo Carvalho de Melo <acme@conectiva.com.br>, 2005
|
|
||||||
*
|
|
||||||
* Released under the terms of the GNU GPL v2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "lkc.h"
|
|
||||||
|
|
||||||
static char *escape(const char* text, char *bf, int len)
|
|
||||||
{
|
|
||||||
char *bfp = bf;
|
|
||||||
int multiline = strchr(text, '\n') != NULL;
|
|
||||||
int eol = 0;
|
|
||||||
int textlen = strlen(text);
|
|
||||||
|
|
||||||
if ((textlen > 0) && (text[textlen-1] == '\n'))
|
|
||||||
eol = 1;
|
|
||||||
|
|
||||||
*bfp++ = '"';
|
|
||||||
--len;
|
|
||||||
|
|
||||||
if (multiline) {
|
|
||||||
*bfp++ = '"';
|
|
||||||
*bfp++ = '\n';
|
|
||||||
*bfp++ = '"';
|
|
||||||
len -= 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (*text != '\0' && len > 1) {
|
|
||||||
if (*text == '"')
|
|
||||||
*bfp++ = '\\';
|
|
||||||
else if (*text == '\n') {
|
|
||||||
*bfp++ = '\\';
|
|
||||||
*bfp++ = 'n';
|
|
||||||
*bfp++ = '"';
|
|
||||||
*bfp++ = '\n';
|
|
||||||
*bfp++ = '"';
|
|
||||||
len -= 5;
|
|
||||||
++text;
|
|
||||||
goto next;
|
|
||||||
}
|
|
||||||
else if (*text == '\\') {
|
|
||||||
*bfp++ = '\\';
|
|
||||||
len--;
|
|
||||||
}
|
|
||||||
*bfp++ = *text++;
|
|
||||||
next:
|
|
||||||
--len;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (multiline && eol)
|
|
||||||
bfp -= 3;
|
|
||||||
|
|
||||||
*bfp++ = '"';
|
|
||||||
*bfp = '\0';
|
|
||||||
|
|
||||||
return bf;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct file_line {
|
|
||||||
struct file_line *next;
|
|
||||||
const char *file;
|
|
||||||
int lineno;
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct file_line *file_line__new(const char *file, int lineno)
|
|
||||||
{
|
|
||||||
struct file_line *self = malloc(sizeof(*self));
|
|
||||||
|
|
||||||
if (self == NULL)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
self->file = file;
|
|
||||||
self->lineno = lineno;
|
|
||||||
self->next = NULL;
|
|
||||||
out:
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct message {
|
|
||||||
const char *msg;
|
|
||||||
const char *option;
|
|
||||||
struct message *next;
|
|
||||||
struct file_line *files;
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct message *message__list;
|
|
||||||
|
|
||||||
static struct message *message__new(const char *msg, char *option,
|
|
||||||
const char *file, int lineno)
|
|
||||||
{
|
|
||||||
struct message *self = malloc(sizeof(*self));
|
|
||||||
|
|
||||||
if (self == NULL)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
self->files = file_line__new(file, lineno);
|
|
||||||
if (self->files == NULL)
|
|
||||||
goto out_fail;
|
|
||||||
|
|
||||||
self->msg = xstrdup(msg);
|
|
||||||
if (self->msg == NULL)
|
|
||||||
goto out_fail_msg;
|
|
||||||
|
|
||||||
self->option = option;
|
|
||||||
self->next = NULL;
|
|
||||||
out:
|
|
||||||
return self;
|
|
||||||
out_fail_msg:
|
|
||||||
free(self->files);
|
|
||||||
out_fail:
|
|
||||||
free(self);
|
|
||||||
self = NULL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct message *mesage__find(const char *msg)
|
|
||||||
{
|
|
||||||
struct message *m = message__list;
|
|
||||||
|
|
||||||
while (m != NULL) {
|
|
||||||
if (strcmp(m->msg, msg) == 0)
|
|
||||||
break;
|
|
||||||
m = m->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int message__add_file_line(struct message *self, const char *file,
|
|
||||||
int lineno)
|
|
||||||
{
|
|
||||||
int rc = -1;
|
|
||||||
struct file_line *fl = file_line__new(file, lineno);
|
|
||||||
|
|
||||||
if (fl == NULL)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
fl->next = self->files;
|
|
||||||
self->files = fl;
|
|
||||||
rc = 0;
|
|
||||||
out:
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int message__add(const char *msg, char *option, const char *file,
|
|
||||||
int lineno)
|
|
||||||
{
|
|
||||||
int rc = 0;
|
|
||||||
char bf[16384];
|
|
||||||
char *escaped = escape(msg, bf, sizeof(bf));
|
|
||||||
struct message *m = mesage__find(escaped);
|
|
||||||
|
|
||||||
if (m != NULL)
|
|
||||||
rc = message__add_file_line(m, file, lineno);
|
|
||||||
else {
|
|
||||||
m = message__new(escaped, option, file, lineno);
|
|
||||||
|
|
||||||
if (m != NULL) {
|
|
||||||
m->next = message__list;
|
|
||||||
message__list = m;
|
|
||||||
} else
|
|
||||||
rc = -1;
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void menu_build_message_list(struct menu *menu)
|
|
||||||
{
|
|
||||||
struct menu *child;
|
|
||||||
|
|
||||||
message__add(menu_get_prompt(menu), NULL,
|
|
||||||
menu->file == NULL ? "Root Menu" : menu->file->name,
|
|
||||||
menu->lineno);
|
|
||||||
|
|
||||||
if (menu->sym != NULL && menu_has_help(menu))
|
|
||||||
message__add(menu_get_help(menu), menu->sym->name,
|
|
||||||
menu->file == NULL ? "Root Menu" : menu->file->name,
|
|
||||||
menu->lineno);
|
|
||||||
|
|
||||||
for (child = menu->list; child != NULL; child = child->next)
|
|
||||||
if (child->prompt != NULL)
|
|
||||||
menu_build_message_list(child);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void message__print_file_lineno(struct message *self)
|
|
||||||
{
|
|
||||||
struct file_line *fl = self->files;
|
|
||||||
|
|
||||||
putchar('\n');
|
|
||||||
if (self->option != NULL)
|
|
||||||
printf("# %s:00000\n", self->option);
|
|
||||||
|
|
||||||
printf("#: %s:%d", fl->file, fl->lineno);
|
|
||||||
fl = fl->next;
|
|
||||||
|
|
||||||
while (fl != NULL) {
|
|
||||||
printf(", %s:%d", fl->file, fl->lineno);
|
|
||||||
fl = fl->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
putchar('\n');
|
|
||||||
}
|
|
||||||
|
|
||||||
static void message__print_gettext_msgid_msgstr(struct message *self)
|
|
||||||
{
|
|
||||||
message__print_file_lineno(self);
|
|
||||||
|
|
||||||
printf("msgid %s\n"
|
|
||||||
"msgstr \"\"\n", self->msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void menu__xgettext(void)
|
|
||||||
{
|
|
||||||
struct message *m = message__list;
|
|
||||||
|
|
||||||
while (m != NULL) {
|
|
||||||
/* skip empty lines ("") */
|
|
||||||
if (strlen(m->msg) > sizeof("\"\""))
|
|
||||||
message__print_gettext_msgid_msgstr(m);
|
|
||||||
m = m->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int ac, char **av)
|
|
||||||
{
|
|
||||||
conf_parse(av[1]);
|
|
||||||
|
|
||||||
menu_build_message_list(menu_get_root_menu(NULL));
|
|
||||||
menu__xgettext();
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -8,15 +8,6 @@
|
|||||||
|
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
|
|
||||||
#ifndef KBUILD_NO_NLS
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
static inline const char *gettext(const char *txt) { return txt; }
|
|
||||||
static inline void textdomain(const char *domainname) {}
|
|
||||||
static inline void bindtextdomain(const char *name, const char *dir) {}
|
|
||||||
static inline char *bind_textdomain_codeset(const char *dn, char *c) { return c; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -29,11 +20,6 @@ extern "C" {
|
|||||||
#define PACKAGE "linux"
|
#define PACKAGE "linux"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LOCALEDIR "/usr/share/locale"
|
|
||||||
|
|
||||||
#define _(text) gettext(text)
|
|
||||||
#define N_(text) (text)
|
|
||||||
|
|
||||||
#ifndef CONFIG_
|
#ifndef CONFIG_
|
||||||
#define CONFIG_ "CONFIG_"
|
#define CONFIG_ "CONFIG_"
|
||||||
#endif
|
#endif
|
||||||
|
@ -103,8 +103,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
|
|||||||
int x = width / 2 - 11;
|
int x = width / 2 - 11;
|
||||||
int y = height - 2;
|
int y = height - 2;
|
||||||
|
|
||||||
print_button(dialog, gettext("Select"), y, x, selected == 0);
|
print_button(dialog, "Select", y, x, selected == 0);
|
||||||
print_button(dialog, gettext(" Help "), y, x + 14, selected == 1);
|
print_button(dialog, " Help ", y, x + 14, selected == 1);
|
||||||
|
|
||||||
wmove(dialog, y, x + 1 + 14 * selected);
|
wmove(dialog, y, x + 1 + 14 * selected);
|
||||||
wrefresh(dialog);
|
wrefresh(dialog);
|
||||||
|
@ -26,12 +26,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#ifndef KBUILD_NO_NLS
|
|
||||||
# include <libintl.h>
|
|
||||||
#else
|
|
||||||
# define gettext(Msgid) ((const char *) (Msgid))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __sun__
|
#ifdef __sun__
|
||||||
#define CURS_MACROS
|
#define CURS_MACROS
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,8 +31,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
|
|||||||
int x = width / 2 - 11;
|
int x = width / 2 - 11;
|
||||||
int y = height - 2;
|
int y = height - 2;
|
||||||
|
|
||||||
print_button(dialog, gettext(" Ok "), y, x, selected == 0);
|
print_button(dialog, " Ok ", y, x, selected == 0);
|
||||||
print_button(dialog, gettext(" Help "), y, x + 14, selected == 1);
|
print_button(dialog, " Help ", y, x + 14, selected == 1);
|
||||||
|
|
||||||
wmove(dialog, y, x + 1 + 14 * selected);
|
wmove(dialog, y, x + 1 + 14 * selected);
|
||||||
wrefresh(dialog);
|
wrefresh(dialog);
|
||||||
|
@ -157,11 +157,11 @@ static void print_buttons(WINDOW * win, int height, int width, int selected)
|
|||||||
int x = width / 2 - 28;
|
int x = width / 2 - 28;
|
||||||
int y = height - 2;
|
int y = height - 2;
|
||||||
|
|
||||||
print_button(win, gettext("Select"), y, x, selected == 0);
|
print_button(win, "Select", y, x, selected == 0);
|
||||||
print_button(win, gettext(" Exit "), y, x + 12, selected == 1);
|
print_button(win, " Exit ", y, x + 12, selected == 1);
|
||||||
print_button(win, gettext(" Help "), y, x + 24, selected == 2);
|
print_button(win, " Help ", y, x + 24, selected == 2);
|
||||||
print_button(win, gettext(" Save "), y, x + 36, selected == 3);
|
print_button(win, " Save ", y, x + 36, selected == 3);
|
||||||
print_button(win, gettext(" Load "), y, x + 48, selected == 4);
|
print_button(win, " Load ", y, x + 48, selected == 4);
|
||||||
|
|
||||||
wmove(win, y, x + 1 + 12 * selected);
|
wmove(win, y, x + 1 + 12 * selected);
|
||||||
wrefresh(win);
|
wrefresh(win);
|
||||||
|
@ -129,7 +129,7 @@ do_resize:
|
|||||||
|
|
||||||
print_title(dialog, title, width);
|
print_title(dialog, title, width);
|
||||||
|
|
||||||
print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE);
|
print_button(dialog, " Exit ", height - 2, width / 2 - 4, TRUE);
|
||||||
wnoutrefresh(dialog);
|
wnoutrefresh(dialog);
|
||||||
getyx(dialog, cur_y, cur_x); /* Save cursor position */
|
getyx(dialog, cur_y, cur_x); /* Save cursor position */
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
|
|||||||
int x = width / 2 - 10;
|
int x = width / 2 - 10;
|
||||||
int y = height - 2;
|
int y = height - 2;
|
||||||
|
|
||||||
print_button(dialog, gettext(" Yes "), y, x, selected == 0);
|
print_button(dialog, " Yes ", y, x, selected == 0);
|
||||||
print_button(dialog, gettext(" No "), y, x + 13, selected == 1);
|
print_button(dialog, " No ", y, x + 13, selected == 1);
|
||||||
|
|
||||||
wmove(dialog, y, x + 1 + 13 * selected);
|
wmove(dialog, y, x + 1 + 13 * selected);
|
||||||
wrefresh(dialog);
|
wrefresh(dialog);
|
||||||
|
@ -17,12 +17,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <locale.h>
|
|
||||||
|
|
||||||
#include "lkc.h"
|
#include "lkc.h"
|
||||||
#include "lxdialog/dialog.h"
|
#include "lxdialog/dialog.h"
|
||||||
|
|
||||||
static const char mconf_readme[] = N_(
|
static const char mconf_readme[] =
|
||||||
"Overview\n"
|
"Overview\n"
|
||||||
"--------\n"
|
"--------\n"
|
||||||
"This interface lets you select features and parameters for the build.\n"
|
"This interface lets you select features and parameters for the build.\n"
|
||||||
@ -171,37 +170,37 @@ static const char mconf_readme[] = N_(
|
|||||||
" blackbg => selects a color scheme with black background\n"
|
" blackbg => selects a color scheme with black background\n"
|
||||||
" classic => theme with blue background. The classic look\n"
|
" classic => theme with blue background. The classic look\n"
|
||||||
" bluetitle => an LCD friendly version of classic. (default)\n"
|
" bluetitle => an LCD friendly version of classic. (default)\n"
|
||||||
"\n"),
|
"\n",
|
||||||
menu_instructions[] = N_(
|
menu_instructions[] =
|
||||||
"Arrow keys navigate the menu. "
|
"Arrow keys navigate the menu. "
|
||||||
"<Enter> selects submenus ---> (or empty submenus ----). "
|
"<Enter> selects submenus ---> (or empty submenus ----). "
|
||||||
"Highlighted letters are hotkeys. "
|
"Highlighted letters are hotkeys. "
|
||||||
"Pressing <Y> includes, <N> excludes, <M> modularizes features. "
|
"Pressing <Y> includes, <N> excludes, <M> modularizes features. "
|
||||||
"Press <Esc><Esc> to exit, <?> for Help, </> for Search. "
|
"Press <Esc><Esc> to exit, <?> for Help, </> for Search. "
|
||||||
"Legend: [*] built-in [ ] excluded <M> module < > module capable"),
|
"Legend: [*] built-in [ ] excluded <M> module < > module capable",
|
||||||
radiolist_instructions[] = N_(
|
radiolist_instructions[] =
|
||||||
"Use the arrow keys to navigate this window or "
|
"Use the arrow keys to navigate this window or "
|
||||||
"press the hotkey of the item you wish to select "
|
"press the hotkey of the item you wish to select "
|
||||||
"followed by the <SPACE BAR>. "
|
"followed by the <SPACE BAR>. "
|
||||||
"Press <?> for additional information about this option."),
|
"Press <?> for additional information about this option.",
|
||||||
inputbox_instructions_int[] = N_(
|
inputbox_instructions_int[] =
|
||||||
"Please enter a decimal value. "
|
"Please enter a decimal value. "
|
||||||
"Fractions will not be accepted. "
|
"Fractions will not be accepted. "
|
||||||
"Use the <TAB> key to move from the input field to the buttons below it."),
|
"Use the <TAB> key to move from the input field to the buttons below it.",
|
||||||
inputbox_instructions_hex[] = N_(
|
inputbox_instructions_hex[] =
|
||||||
"Please enter a hexadecimal value. "
|
"Please enter a hexadecimal value. "
|
||||||
"Use the <TAB> key to move from the input field to the buttons below it."),
|
"Use the <TAB> key to move from the input field to the buttons below it.",
|
||||||
inputbox_instructions_string[] = N_(
|
inputbox_instructions_string[] =
|
||||||
"Please enter a string value. "
|
"Please enter a string value. "
|
||||||
"Use the <TAB> key to move from the input field to the buttons below it."),
|
"Use the <TAB> key to move from the input field to the buttons below it.",
|
||||||
setmod_text[] = N_(
|
setmod_text[] =
|
||||||
"This feature depends on another which has been configured as a module.\n"
|
"This feature depends on another which has been configured as a module.\n"
|
||||||
"As a result, this feature will be built as a module."),
|
"As a result, this feature will be built as a module.",
|
||||||
load_config_text[] = N_(
|
load_config_text[] =
|
||||||
"Enter the name of the configuration file you wish to load. "
|
"Enter the name of the configuration file you wish to load. "
|
||||||
"Accept the name shown to restore the configuration you "
|
"Accept the name shown to restore the configuration you "
|
||||||
"last retrieved. Leave blank to abort."),
|
"last retrieved. Leave blank to abort.",
|
||||||
load_config_help[] = N_(
|
load_config_help[] =
|
||||||
"\n"
|
"\n"
|
||||||
"For various reasons, one may wish to keep several different\n"
|
"For various reasons, one may wish to keep several different\n"
|
||||||
"configurations available on a single machine.\n"
|
"configurations available on a single machine.\n"
|
||||||
@ -211,11 +210,11 @@ load_config_help[] = N_(
|
|||||||
"configuration.\n"
|
"configuration.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"If you are uncertain, then you have probably never used alternate\n"
|
"If you are uncertain, then you have probably never used alternate\n"
|
||||||
"configuration files. You should therefore leave this blank to abort.\n"),
|
"configuration files. You should therefore leave this blank to abort.\n",
|
||||||
save_config_text[] = N_(
|
save_config_text[] =
|
||||||
"Enter a filename to which this configuration should be saved "
|
"Enter a filename to which this configuration should be saved "
|
||||||
"as an alternate. Leave blank to abort."),
|
"as an alternate. Leave blank to abort.",
|
||||||
save_config_help[] = N_(
|
save_config_help[] =
|
||||||
"\n"
|
"\n"
|
||||||
"For various reasons, one may wish to keep different configurations\n"
|
"For various reasons, one may wish to keep different configurations\n"
|
||||||
"available on a single machine.\n"
|
"available on a single machine.\n"
|
||||||
@ -225,8 +224,8 @@ save_config_help[] = N_(
|
|||||||
"configuration options you have selected at that time.\n"
|
"configuration options you have selected at that time.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"If you are uncertain what all this means then you should probably\n"
|
"If you are uncertain what all this means then you should probably\n"
|
||||||
"leave this blank.\n"),
|
"leave this blank.\n",
|
||||||
search_help[] = N_(
|
search_help[] =
|
||||||
"\n"
|
"\n"
|
||||||
"Search for symbols and display their relations.\n"
|
"Search for symbols and display their relations.\n"
|
||||||
"Regular expressions are allowed.\n"
|
"Regular expressions are allowed.\n"
|
||||||
@ -271,7 +270,7 @@ search_help[] = N_(
|
|||||||
"Examples: USB => find all symbols containing USB\n"
|
"Examples: USB => find all symbols containing USB\n"
|
||||||
" ^USB => find all symbols starting with USB\n"
|
" ^USB => find all symbols starting with USB\n"
|
||||||
" USB$ => find all symbols ending with USB\n"
|
" USB$ => find all symbols ending with USB\n"
|
||||||
"\n");
|
"\n";
|
||||||
|
|
||||||
static int indent;
|
static int indent;
|
||||||
static struct menu *current_menu;
|
static struct menu *current_menu;
|
||||||
@ -400,19 +399,19 @@ static void search_conf(void)
|
|||||||
struct subtitle_part stpart;
|
struct subtitle_part stpart;
|
||||||
|
|
||||||
title = str_new();
|
title = str_new();
|
||||||
str_printf( &title, _("Enter (sub)string or regexp to search for "
|
str_printf( &title, "Enter (sub)string or regexp to search for "
|
||||||
"(with or without \"%s\")"), CONFIG_);
|
"(with or without \"%s\")", CONFIG_);
|
||||||
|
|
||||||
again:
|
again:
|
||||||
dialog_clear();
|
dialog_clear();
|
||||||
dres = dialog_inputbox(_("Search Configuration Parameter"),
|
dres = dialog_inputbox("Search Configuration Parameter",
|
||||||
str_get(&title),
|
str_get(&title),
|
||||||
10, 75, "");
|
10, 75, "");
|
||||||
switch (dres) {
|
switch (dres) {
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
show_helptext(_("Search Configuration"), search_help);
|
show_helptext("Search Configuration", search_help);
|
||||||
goto again;
|
goto again;
|
||||||
default:
|
default:
|
||||||
str_free(&title);
|
str_free(&title);
|
||||||
@ -443,7 +442,7 @@ again:
|
|||||||
|
|
||||||
res = get_relations_str(sym_arr, &head);
|
res = get_relations_str(sym_arr, &head);
|
||||||
set_subtitle();
|
set_subtitle();
|
||||||
dres = show_textbox_ext(_("Search Results"), (char *)
|
dres = show_textbox_ext("Search Results", (char *)
|
||||||
str_get(&res), 0, 0, keys, &vscroll,
|
str_get(&res), 0, 0, keys, &vscroll,
|
||||||
&hscroll, &update_text, (void *)
|
&hscroll, &update_text, (void *)
|
||||||
&data);
|
&data);
|
||||||
@ -491,7 +490,7 @@ static void build_conf(struct menu *menu)
|
|||||||
switch (prop->type) {
|
switch (prop->type) {
|
||||||
case P_MENU:
|
case P_MENU:
|
||||||
child_count++;
|
child_count++;
|
||||||
prompt = _(prompt);
|
prompt = prompt;
|
||||||
if (single_menu_mode) {
|
if (single_menu_mode) {
|
||||||
item_make("%s%*c%s",
|
item_make("%s%*c%s",
|
||||||
menu->data ? "-->" : "++>",
|
menu->data ? "-->" : "++>",
|
||||||
@ -508,7 +507,7 @@ static void build_conf(struct menu *menu)
|
|||||||
case P_COMMENT:
|
case P_COMMENT:
|
||||||
if (prompt) {
|
if (prompt) {
|
||||||
child_count++;
|
child_count++;
|
||||||
item_make(" %*c*** %s ***", indent + 1, ' ', _(prompt));
|
item_make(" %*c*** %s ***", indent + 1, ' ', prompt);
|
||||||
item_set_tag(':');
|
item_set_tag(':');
|
||||||
item_set_data(menu);
|
item_set_data(menu);
|
||||||
}
|
}
|
||||||
@ -516,7 +515,7 @@ static void build_conf(struct menu *menu)
|
|||||||
default:
|
default:
|
||||||
if (prompt) {
|
if (prompt) {
|
||||||
child_count++;
|
child_count++;
|
||||||
item_make("---%*c%s", indent + 1, ' ', _(prompt));
|
item_make("---%*c%s", indent + 1, ' ', prompt);
|
||||||
item_set_tag(':');
|
item_set_tag(':');
|
||||||
item_set_data(menu);
|
item_set_data(menu);
|
||||||
}
|
}
|
||||||
@ -560,10 +559,10 @@ static void build_conf(struct menu *menu)
|
|||||||
item_set_data(menu);
|
item_set_data(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
item_add_str("%*c%s", indent + 1, ' ', _(menu_get_prompt(menu)));
|
item_add_str("%*c%s", indent + 1, ' ', menu_get_prompt(menu));
|
||||||
if (val == yes) {
|
if (val == yes) {
|
||||||
if (def_menu) {
|
if (def_menu) {
|
||||||
item_add_str(" (%s)", _(menu_get_prompt(def_menu)));
|
item_add_str(" (%s)", menu_get_prompt(def_menu));
|
||||||
item_add_str(" --->");
|
item_add_str(" --->");
|
||||||
if (def_menu->list) {
|
if (def_menu->list) {
|
||||||
indent += 2;
|
indent += 2;
|
||||||
@ -575,7 +574,7 @@ static void build_conf(struct menu *menu)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (menu == current_menu) {
|
if (menu == current_menu) {
|
||||||
item_make("---%*c%s", indent + 1, ' ', _(menu_get_prompt(menu)));
|
item_make("---%*c%s", indent + 1, ' ', menu_get_prompt(menu));
|
||||||
item_set_tag(':');
|
item_set_tag(':');
|
||||||
item_set_data(menu);
|
item_set_data(menu);
|
||||||
goto conf_childs;
|
goto conf_childs;
|
||||||
@ -618,17 +617,17 @@ static void build_conf(struct menu *menu)
|
|||||||
tmp = indent - tmp + 4;
|
tmp = indent - tmp + 4;
|
||||||
if (tmp < 0)
|
if (tmp < 0)
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
item_add_str("%*c%s%s", tmp, ' ', _(menu_get_prompt(menu)),
|
item_add_str("%*c%s%s", tmp, ' ', menu_get_prompt(menu),
|
||||||
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
||||||
"" : _(" (NEW)"));
|
"" : " (NEW)");
|
||||||
item_set_tag('s');
|
item_set_tag('s');
|
||||||
item_set_data(menu);
|
item_set_data(menu);
|
||||||
goto conf_childs;
|
goto conf_childs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item_add_str("%*c%s%s", indent + 1, ' ', _(menu_get_prompt(menu)),
|
item_add_str("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu),
|
||||||
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
||||||
"" : _(" (NEW)"));
|
"" : " (NEW)");
|
||||||
if (menu->prompt->type == P_MENU) {
|
if (menu->prompt->type == P_MENU) {
|
||||||
item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
|
item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
|
||||||
return;
|
return;
|
||||||
@ -665,8 +664,8 @@ static void conf(struct menu *menu, struct menu *active_menu)
|
|||||||
break;
|
break;
|
||||||
set_subtitle();
|
set_subtitle();
|
||||||
dialog_clear();
|
dialog_clear();
|
||||||
res = dialog_menu(prompt ? _(prompt) : _("Main Menu"),
|
res = dialog_menu(prompt ? prompt : "Main Menu",
|
||||||
_(menu_instructions),
|
menu_instructions,
|
||||||
active_menu, &s_scroll);
|
active_menu, &s_scroll);
|
||||||
if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL)
|
if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL)
|
||||||
break;
|
break;
|
||||||
@ -708,7 +707,7 @@ static void conf(struct menu *menu, struct menu *active_menu)
|
|||||||
show_help(submenu);
|
show_help(submenu);
|
||||||
else {
|
else {
|
||||||
reset_subtitle();
|
reset_subtitle();
|
||||||
show_helptext(_("README"), _(mconf_readme));
|
show_helptext("README", mconf_readme);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
@ -793,13 +792,13 @@ static void show_help(struct menu *menu)
|
|||||||
help.max_width = getmaxx(stdscr) - 10;
|
help.max_width = getmaxx(stdscr) - 10;
|
||||||
menu_get_ext_help(menu, &help);
|
menu_get_ext_help(menu, &help);
|
||||||
|
|
||||||
show_helptext(_(menu_get_prompt(menu)), str_get(&help));
|
show_helptext(menu_get_prompt(menu), str_get(&help));
|
||||||
str_free(&help);
|
str_free(&help);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void conf_choice(struct menu *menu)
|
static void conf_choice(struct menu *menu)
|
||||||
{
|
{
|
||||||
const char *prompt = _(menu_get_prompt(menu));
|
const char *prompt = menu_get_prompt(menu);
|
||||||
struct menu *child;
|
struct menu *child;
|
||||||
struct symbol *active;
|
struct symbol *active;
|
||||||
|
|
||||||
@ -814,9 +813,9 @@ static void conf_choice(struct menu *menu)
|
|||||||
if (!menu_is_visible(child))
|
if (!menu_is_visible(child))
|
||||||
continue;
|
continue;
|
||||||
if (child->sym)
|
if (child->sym)
|
||||||
item_make("%s", _(menu_get_prompt(child)));
|
item_make("%s", menu_get_prompt(child));
|
||||||
else {
|
else {
|
||||||
item_make("*** %s ***", _(menu_get_prompt(child)));
|
item_make("*** %s ***", menu_get_prompt(child));
|
||||||
item_set_tag(':');
|
item_set_tag(':');
|
||||||
}
|
}
|
||||||
item_set_data(child);
|
item_set_data(child);
|
||||||
@ -826,8 +825,8 @@ static void conf_choice(struct menu *menu)
|
|||||||
item_set_tag('X');
|
item_set_tag('X');
|
||||||
}
|
}
|
||||||
dialog_clear();
|
dialog_clear();
|
||||||
res = dialog_checklist(prompt ? _(prompt) : _("Main Menu"),
|
res = dialog_checklist(prompt ? prompt : "Main Menu",
|
||||||
_(radiolist_instructions),
|
radiolist_instructions,
|
||||||
MENUBOX_HEIGTH_MIN,
|
MENUBOX_HEIGTH_MIN,
|
||||||
MENUBOX_WIDTH_MIN,
|
MENUBOX_WIDTH_MIN,
|
||||||
CHECKLIST_HEIGTH_MIN);
|
CHECKLIST_HEIGTH_MIN);
|
||||||
@ -868,26 +867,26 @@ static void conf_string(struct menu *menu)
|
|||||||
|
|
||||||
switch (sym_get_type(menu->sym)) {
|
switch (sym_get_type(menu->sym)) {
|
||||||
case S_INT:
|
case S_INT:
|
||||||
heading = _(inputbox_instructions_int);
|
heading = inputbox_instructions_int;
|
||||||
break;
|
break;
|
||||||
case S_HEX:
|
case S_HEX:
|
||||||
heading = _(inputbox_instructions_hex);
|
heading = inputbox_instructions_hex;
|
||||||
break;
|
break;
|
||||||
case S_STRING:
|
case S_STRING:
|
||||||
heading = _(inputbox_instructions_string);
|
heading = inputbox_instructions_string;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
heading = _("Internal mconf error!");
|
heading = "Internal mconf error!";
|
||||||
}
|
}
|
||||||
dialog_clear();
|
dialog_clear();
|
||||||
res = dialog_inputbox(prompt ? _(prompt) : _("Main Menu"),
|
res = dialog_inputbox(prompt ? prompt : "Main Menu",
|
||||||
heading, 10, 75,
|
heading, 10, 75,
|
||||||
sym_get_string_value(menu->sym));
|
sym_get_string_value(menu->sym));
|
||||||
switch (res) {
|
switch (res) {
|
||||||
case 0:
|
case 0:
|
||||||
if (sym_set_string_value(menu->sym, dialog_input_result))
|
if (sym_set_string_value(menu->sym, dialog_input_result))
|
||||||
return;
|
return;
|
||||||
show_textbox(NULL, _("You have made an invalid entry."), 5, 43);
|
show_textbox(NULL, "You have made an invalid entry.", 5, 43);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
show_help(menu);
|
show_help(menu);
|
||||||
@ -915,10 +914,10 @@ static void conf_load(void)
|
|||||||
sym_set_change_count(1);
|
sym_set_change_count(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
show_textbox(NULL, _("File does not exist!"), 5, 38);
|
show_textbox(NULL, "File does not exist!", 5, 38);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
show_helptext(_("Load Alternate Configuration"), load_config_help);
|
show_helptext("Load Alternate Configuration", load_config_help);
|
||||||
break;
|
break;
|
||||||
case KEY_ESC:
|
case KEY_ESC:
|
||||||
return;
|
return;
|
||||||
@ -941,10 +940,10 @@ static void conf_save(void)
|
|||||||
set_config_filename(dialog_input_result);
|
set_config_filename(dialog_input_result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60);
|
show_textbox(NULL, "Can't create file! Probably a nonexistent directory.", 5, 60);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
show_helptext(_("Save Alternate Configuration"), save_config_help);
|
show_helptext("Save Alternate Configuration", save_config_help);
|
||||||
break;
|
break;
|
||||||
case KEY_ESC:
|
case KEY_ESC:
|
||||||
return;
|
return;
|
||||||
@ -961,8 +960,8 @@ static int handle_exit(void)
|
|||||||
dialog_clear();
|
dialog_clear();
|
||||||
if (conf_get_changed())
|
if (conf_get_changed())
|
||||||
res = dialog_yesno(NULL,
|
res = dialog_yesno(NULL,
|
||||||
_("Do you wish to save your new configuration?\n"
|
"Do you wish to save your new configuration?\n"
|
||||||
"(Press <ESC><ESC> to continue kernel configuration.)"),
|
"(Press <ESC><ESC> to continue kernel configuration.)",
|
||||||
6, 60);
|
6, 60);
|
||||||
else
|
else
|
||||||
res = -1;
|
res = -1;
|
||||||
@ -972,26 +971,26 @@ static int handle_exit(void)
|
|||||||
switch (res) {
|
switch (res) {
|
||||||
case 0:
|
case 0:
|
||||||
if (conf_write(filename)) {
|
if (conf_write(filename)) {
|
||||||
fprintf(stderr, _("\n\n"
|
fprintf(stderr, "\n\n"
|
||||||
"Error while writing of the configuration.\n"
|
"Error while writing of the configuration.\n"
|
||||||
"Your configuration changes were NOT saved."
|
"Your configuration changes were NOT saved."
|
||||||
"\n\n"));
|
"\n\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case -1:
|
case -1:
|
||||||
if (!silent)
|
if (!silent)
|
||||||
printf(_("\n\n"
|
printf("\n\n"
|
||||||
"*** End of the configuration.\n"
|
"*** End of the configuration.\n"
|
||||||
"*** Execute 'make' to start the build or try 'make help'."
|
"*** Execute 'make' to start the build or try 'make help'."
|
||||||
"\n\n"));
|
"\n\n");
|
||||||
res = 0;
|
res = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (!silent)
|
if (!silent)
|
||||||
fprintf(stderr, _("\n\n"
|
fprintf(stderr, "\n\n"
|
||||||
"Your configuration changes were NOT saved."
|
"Your configuration changes were NOT saved."
|
||||||
"\n\n"));
|
"\n\n");
|
||||||
if (res != KEY_ESC)
|
if (res != KEY_ESC)
|
||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
@ -1009,10 +1008,6 @@ int main(int ac, char **av)
|
|||||||
char *mode;
|
char *mode;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
|
||||||
textdomain(PACKAGE);
|
|
||||||
|
|
||||||
signal(SIGINT, sig_handler);
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
if (ac > 1 && strcmp(av[1], "-s") == 0) {
|
if (ac > 1 && strcmp(av[1], "-s") == 0) {
|
||||||
@ -1031,8 +1026,8 @@ int main(int ac, char **av)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (init_dialog(NULL)) {
|
if (init_dialog(NULL)) {
|
||||||
fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
|
fprintf(stderr, "Your display is too small to run Menuconfig!\n");
|
||||||
fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
|
fprintf(stderr, "It must be at least 19 lines by 80 columns.\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,7 +711,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
|
|||||||
struct menu *submenu[8], *menu, *location = NULL;
|
struct menu *submenu[8], *menu, *location = NULL;
|
||||||
struct jump_key *jump = NULL;
|
struct jump_key *jump = NULL;
|
||||||
|
|
||||||
str_printf(r, _("Prompt: %s\n"), _(prop->text));
|
str_printf(r, "Prompt: %s\n", prop->text);
|
||||||
menu = prop->menu->parent;
|
menu = prop->menu->parent;
|
||||||
for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
|
for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) {
|
||||||
bool accessible = menu_is_visible(menu);
|
bool accessible = menu_is_visible(menu);
|
||||||
@ -744,16 +744,16 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
str_printf(r, _(" Location:\n"));
|
str_printf(r, " Location:\n");
|
||||||
for (j = 4; --i >= 0; j += 2) {
|
for (j = 4; --i >= 0; j += 2) {
|
||||||
menu = submenu[i];
|
menu = submenu[i];
|
||||||
if (jump && menu == location)
|
if (jump && menu == location)
|
||||||
jump->offset = strlen(r->s);
|
jump->offset = strlen(r->s);
|
||||||
str_printf(r, "%*c-> %s", j, ' ',
|
str_printf(r, "%*c-> %s", j, ' ',
|
||||||
_(menu_get_prompt(menu)));
|
menu_get_prompt(menu));
|
||||||
if (menu->sym) {
|
if (menu->sym) {
|
||||||
str_printf(r, " (%s [=%s])", menu->sym->name ?
|
str_printf(r, " (%s [=%s])", menu->sym->name ?
|
||||||
menu->sym->name : _("<choice>"),
|
menu->sym->name : "<choice>",
|
||||||
sym_get_string_value(menu->sym));
|
sym_get_string_value(menu->sym));
|
||||||
}
|
}
|
||||||
str_append(r, "\n");
|
str_append(r, "\n");
|
||||||
@ -817,23 +817,23 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym,
|
|||||||
|
|
||||||
prop = get_symbol_prop(sym);
|
prop = get_symbol_prop(sym);
|
||||||
if (prop) {
|
if (prop) {
|
||||||
str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name,
|
str_printf(r, " Defined at %s:%d\n", prop->menu->file->name,
|
||||||
prop->menu->lineno);
|
prop->menu->lineno);
|
||||||
if (!expr_is_yes(prop->visible.expr)) {
|
if (!expr_is_yes(prop->visible.expr)) {
|
||||||
str_append(r, _(" Depends on: "));
|
str_append(r, " Depends on: ");
|
||||||
expr_gstr_print(prop->visible.expr, r);
|
expr_gstr_print(prop->visible.expr, r);
|
||||||
str_append(r, "\n");
|
str_append(r, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get_symbol_props_str(r, sym, P_SELECT, _(" Selects: "));
|
get_symbol_props_str(r, sym, P_SELECT, " Selects: ");
|
||||||
if (sym->rev_dep.expr) {
|
if (sym->rev_dep.expr) {
|
||||||
expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, " Selected by [y]:\n");
|
expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, " Selected by [y]:\n");
|
||||||
expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, " Selected by [m]:\n");
|
expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, " Selected by [m]:\n");
|
||||||
expr_gstr_print_revdep(sym->rev_dep.expr, r, no, " Selected by [n]:\n");
|
expr_gstr_print_revdep(sym->rev_dep.expr, r, no, " Selected by [n]:\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
get_symbol_props_str(r, sym, P_IMPLY, _(" Implies: "));
|
get_symbol_props_str(r, sym, P_IMPLY, " Implies: ");
|
||||||
if (sym->implied.expr) {
|
if (sym->implied.expr) {
|
||||||
expr_gstr_print_revdep(sym->implied.expr, r, yes, " Implied by [y]:\n");
|
expr_gstr_print_revdep(sym->implied.expr, r, yes, " Implied by [y]:\n");
|
||||||
expr_gstr_print_revdep(sym->implied.expr, r, mod, " Implied by [m]:\n");
|
expr_gstr_print_revdep(sym->implied.expr, r, mod, " Implied by [m]:\n");
|
||||||
@ -852,7 +852,7 @@ struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head)
|
|||||||
for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
|
for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
|
||||||
get_symbol_str(&res, sym, head);
|
get_symbol_str(&res, sym, head);
|
||||||
if (!i)
|
if (!i)
|
||||||
str_append(&res, _("No matches found.\n"));
|
str_append(&res, "No matches found.\n");
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -867,7 +867,7 @@ void menu_get_ext_help(struct menu *menu, struct gstr *help)
|
|||||||
str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
|
str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
|
||||||
help_text = menu_get_help(menu);
|
help_text = menu_get_help(menu);
|
||||||
}
|
}
|
||||||
str_printf(help, "%s\n", _(help_text));
|
str_printf(help, "%s\n", help_text);
|
||||||
if (sym)
|
if (sym)
|
||||||
get_symbol_str(help, sym, NULL);
|
get_symbol_str(help, sym, NULL);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include "nconf.h"
|
#include "nconf.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
static const char nconf_global_help[] = N_(
|
static const char nconf_global_help[] =
|
||||||
"Help windows\n"
|
"Help windows\n"
|
||||||
"------------\n"
|
"------------\n"
|
||||||
"o Global help: Unless in a data entry window, pressing <F1> will give \n"
|
"o Global help: Unless in a data entry window, pressing <F1> will give \n"
|
||||||
@ -130,8 +130,8 @@ static const char nconf_global_help[] = N_(
|
|||||||
"\n"
|
"\n"
|
||||||
"Note that this mode can eventually be a little more CPU expensive than\n"
|
"Note that this mode can eventually be a little more CPU expensive than\n"
|
||||||
"the default mode, especially with a larger number of unfolded submenus.\n"
|
"the default mode, especially with a larger number of unfolded submenus.\n"
|
||||||
"\n"),
|
"\n",
|
||||||
menu_no_f_instructions[] = N_(
|
menu_no_f_instructions[] =
|
||||||
"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
|
"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
|
||||||
"Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
|
"Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -147,8 +147,8 @@ menu_no_f_instructions[] = N_(
|
|||||||
"You do not have function keys support.\n"
|
"You do not have function keys support.\n"
|
||||||
"Press <1> instead of <F1>, <2> instead of <F2>, etc.\n"
|
"Press <1> instead of <F1>, <2> instead of <F2>, etc.\n"
|
||||||
"For verbose global help use key <1>.\n"
|
"For verbose global help use key <1>.\n"
|
||||||
"For help related to the current menu entry press <?> or <h>.\n"),
|
"For help related to the current menu entry press <?> or <h>.\n",
|
||||||
menu_instructions[] = N_(
|
menu_instructions[] =
|
||||||
"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
|
"Legend: [*] built-in [ ] excluded <M> module < > module capable.\n"
|
||||||
"Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
|
"Submenus are designated by a trailing \"--->\", empty ones by \"----\".\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -163,30 +163,30 @@ menu_instructions[] = N_(
|
|||||||
"\n"
|
"\n"
|
||||||
"Pressing <1> may be used instead of <F1>, <2> instead of <F2>, etc.\n"
|
"Pressing <1> may be used instead of <F1>, <2> instead of <F2>, etc.\n"
|
||||||
"For verbose global help press <F1>.\n"
|
"For verbose global help press <F1>.\n"
|
||||||
"For help related to the current menu entry press <?> or <h>.\n"),
|
"For help related to the current menu entry press <?> or <h>.\n",
|
||||||
radiolist_instructions[] = N_(
|
radiolist_instructions[] =
|
||||||
"Press <Up>, <Down>, <Home> or <End> to navigate a radiolist, select\n"
|
"Press <Up>, <Down>, <Home> or <End> to navigate a radiolist, select\n"
|
||||||
"with <Space>.\n"
|
"with <Space>.\n"
|
||||||
"For help related to the current entry press <?> or <h>.\n"
|
"For help related to the current entry press <?> or <h>.\n"
|
||||||
"For global help press <F1>.\n"),
|
"For global help press <F1>.\n",
|
||||||
inputbox_instructions_int[] = N_(
|
inputbox_instructions_int[] =
|
||||||
"Please enter a decimal value.\n"
|
"Please enter a decimal value.\n"
|
||||||
"Fractions will not be accepted.\n"
|
"Fractions will not be accepted.\n"
|
||||||
"Press <Enter> to apply, <Esc> to cancel."),
|
"Press <Enter> to apply, <Esc> to cancel.",
|
||||||
inputbox_instructions_hex[] = N_(
|
inputbox_instructions_hex[] =
|
||||||
"Please enter a hexadecimal value.\n"
|
"Please enter a hexadecimal value.\n"
|
||||||
"Press <Enter> to apply, <Esc> to cancel."),
|
"Press <Enter> to apply, <Esc> to cancel.",
|
||||||
inputbox_instructions_string[] = N_(
|
inputbox_instructions_string[] =
|
||||||
"Please enter a string value.\n"
|
"Please enter a string value.\n"
|
||||||
"Press <Enter> to apply, <Esc> to cancel."),
|
"Press <Enter> to apply, <Esc> to cancel.",
|
||||||
setmod_text[] = N_(
|
setmod_text[] =
|
||||||
"This feature depends on another feature which has been configured as a\n"
|
"This feature depends on another feature which has been configured as a\n"
|
||||||
"module. As a result, the current feature will be built as a module too."),
|
"module. As a result, the current feature will be built as a module too.",
|
||||||
load_config_text[] = N_(
|
load_config_text[] =
|
||||||
"Enter the name of the configuration file you wish to load.\n"
|
"Enter the name of the configuration file you wish to load.\n"
|
||||||
"Accept the name shown to restore the configuration you last\n"
|
"Accept the name shown to restore the configuration you last\n"
|
||||||
"retrieved. Leave empty to abort."),
|
"retrieved. Leave empty to abort.",
|
||||||
load_config_help[] = N_(
|
load_config_help[] =
|
||||||
"For various reasons, one may wish to keep several different\n"
|
"For various reasons, one may wish to keep several different\n"
|
||||||
"configurations available on a single machine.\n"
|
"configurations available on a single machine.\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -194,11 +194,11 @@ load_config_help[] = N_(
|
|||||||
"default one, entering its name here will allow you to load and modify\n"
|
"default one, entering its name here will allow you to load and modify\n"
|
||||||
"that configuration.\n"
|
"that configuration.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Leave empty to abort.\n"),
|
"Leave empty to abort.\n",
|
||||||
save_config_text[] = N_(
|
save_config_text[] =
|
||||||
"Enter a filename to which this configuration should be saved\n"
|
"Enter a filename to which this configuration should be saved\n"
|
||||||
"as an alternate. Leave empty to abort."),
|
"as an alternate. Leave empty to abort.",
|
||||||
save_config_help[] = N_(
|
save_config_help[] =
|
||||||
"For various reasons, one may wish to keep several different\n"
|
"For various reasons, one may wish to keep several different\n"
|
||||||
"configurations available on a single machine.\n"
|
"configurations available on a single machine.\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -206,8 +206,8 @@ save_config_help[] = N_(
|
|||||||
"and use the current configuration as an alternate to whatever\n"
|
"and use the current configuration as an alternate to whatever\n"
|
||||||
"configuration options you have selected at that time.\n"
|
"configuration options you have selected at that time.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Leave empty to abort.\n"),
|
"Leave empty to abort.\n",
|
||||||
search_help[] = N_(
|
search_help[] =
|
||||||
"Search for symbols (configuration variable names CONFIG_*) and display\n"
|
"Search for symbols (configuration variable names CONFIG_*) and display\n"
|
||||||
"their relations. Regular expressions are supported.\n"
|
"their relations. Regular expressions are supported.\n"
|
||||||
"Example: Search for \"^FOO\".\n"
|
"Example: Search for \"^FOO\".\n"
|
||||||
@ -244,7 +244,7 @@ search_help[] = N_(
|
|||||||
"USB => find all symbols containing USB\n"
|
"USB => find all symbols containing USB\n"
|
||||||
"^USB => find all symbols starting with USB\n"
|
"^USB => find all symbols starting with USB\n"
|
||||||
"USB$ => find all symbols ending with USB\n"
|
"USB$ => find all symbols ending with USB\n"
|
||||||
"\n");
|
"\n";
|
||||||
|
|
||||||
struct mitem {
|
struct mitem {
|
||||||
char str[256];
|
char str[256];
|
||||||
@ -388,7 +388,7 @@ static void print_function_line(void)
|
|||||||
static void handle_f1(int *key, struct menu *current_item)
|
static void handle_f1(int *key, struct menu *current_item)
|
||||||
{
|
{
|
||||||
show_scroll_win(main_window,
|
show_scroll_win(main_window,
|
||||||
_("Global help"), _(nconf_global_help));
|
"Global help", nconf_global_help);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,8 +403,8 @@ static void handle_f2(int *key, struct menu *current_item)
|
|||||||
static void handle_f3(int *key, struct menu *current_item)
|
static void handle_f3(int *key, struct menu *current_item)
|
||||||
{
|
{
|
||||||
show_scroll_win(main_window,
|
show_scroll_win(main_window,
|
||||||
_("Short help"),
|
"Short help",
|
||||||
_(current_instructions));
|
current_instructions);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ static void handle_f3(int *key, struct menu *current_item)
|
|||||||
static void handle_f4(int *key, struct menu *current_item)
|
static void handle_f4(int *key, struct menu *current_item)
|
||||||
{
|
{
|
||||||
int res = btn_dialog(main_window,
|
int res = btn_dialog(main_window,
|
||||||
_("Show all symbols?"),
|
"Show all symbols?",
|
||||||
2,
|
2,
|
||||||
" <Show All> ",
|
" <Show All> ",
|
||||||
"<Don't show all>");
|
"<Don't show all>");
|
||||||
@ -653,8 +653,8 @@ static int do_exit(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
res = btn_dialog(main_window,
|
res = btn_dialog(main_window,
|
||||||
_("Do you wish to save your new configuration?\n"
|
"Do you wish to save your new configuration?\n"
|
||||||
"<ESC> to cancel and resume nconfig."),
|
"<ESC> to cancel and resume nconfig.",
|
||||||
2,
|
2,
|
||||||
" <save> ",
|
" <save> ",
|
||||||
"<don't save>");
|
"<don't save>");
|
||||||
@ -670,15 +670,15 @@ static int do_exit(void)
|
|||||||
if (res)
|
if (res)
|
||||||
btn_dialog(
|
btn_dialog(
|
||||||
main_window,
|
main_window,
|
||||||
_("Error during writing of configuration.\n"
|
"Error during writing of configuration.\n"
|
||||||
"Your configuration changes were NOT saved."),
|
"Your configuration changes were NOT saved.",
|
||||||
1,
|
1,
|
||||||
"<OK>");
|
"<OK>");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
btn_dialog(
|
btn_dialog(
|
||||||
main_window,
|
main_window,
|
||||||
_("Your configuration changes were NOT saved."),
|
"Your configuration changes were NOT saved.",
|
||||||
1,
|
1,
|
||||||
"<OK>");
|
"<OK>");
|
||||||
break;
|
break;
|
||||||
@ -697,12 +697,12 @@ static void search_conf(void)
|
|||||||
int dres;
|
int dres;
|
||||||
|
|
||||||
title = str_new();
|
title = str_new();
|
||||||
str_printf( &title, _("Enter (sub)string or regexp to search for "
|
str_printf( &title, "Enter (sub)string or regexp to search for "
|
||||||
"(with or without \"%s\")"), CONFIG_);
|
"(with or without \"%s\")", CONFIG_);
|
||||||
|
|
||||||
again:
|
again:
|
||||||
dres = dialog_inputbox(main_window,
|
dres = dialog_inputbox(main_window,
|
||||||
_("Search Configuration Parameter"),
|
"Search Configuration Parameter",
|
||||||
str_get(&title),
|
str_get(&title),
|
||||||
"", &dialog_input_result, &dialog_input_result_len);
|
"", &dialog_input_result, &dialog_input_result_len);
|
||||||
switch (dres) {
|
switch (dres) {
|
||||||
@ -710,7 +710,7 @@ again:
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
show_scroll_win(main_window,
|
show_scroll_win(main_window,
|
||||||
_("Search Configuration"), search_help);
|
"Search Configuration", search_help);
|
||||||
goto again;
|
goto again;
|
||||||
default:
|
default:
|
||||||
str_free(&title);
|
str_free(&title);
|
||||||
@ -726,7 +726,7 @@ again:
|
|||||||
res = get_relations_str(sym_arr, NULL);
|
res = get_relations_str(sym_arr, NULL);
|
||||||
free(sym_arr);
|
free(sym_arr);
|
||||||
show_scroll_win(main_window,
|
show_scroll_win(main_window,
|
||||||
_("Search Results"), str_get(&res));
|
"Search Results", str_get(&res));
|
||||||
str_free(&res);
|
str_free(&res);
|
||||||
str_free(&title);
|
str_free(&title);
|
||||||
}
|
}
|
||||||
@ -754,7 +754,7 @@ static void build_conf(struct menu *menu)
|
|||||||
switch (ptype) {
|
switch (ptype) {
|
||||||
case P_MENU:
|
case P_MENU:
|
||||||
child_count++;
|
child_count++;
|
||||||
prompt = _(prompt);
|
prompt = prompt;
|
||||||
if (single_menu_mode) {
|
if (single_menu_mode) {
|
||||||
item_make(menu, 'm',
|
item_make(menu, 'm',
|
||||||
"%s%*c%s",
|
"%s%*c%s",
|
||||||
@ -775,7 +775,7 @@ static void build_conf(struct menu *menu)
|
|||||||
item_make(menu, ':',
|
item_make(menu, ':',
|
||||||
" %*c*** %s ***",
|
" %*c*** %s ***",
|
||||||
indent + 1, ' ',
|
indent + 1, ' ',
|
||||||
_(prompt));
|
prompt);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -783,7 +783,7 @@ static void build_conf(struct menu *menu)
|
|||||||
child_count++;
|
child_count++;
|
||||||
item_make(menu, ':', "---%*c%s",
|
item_make(menu, ':', "---%*c%s",
|
||||||
indent + 1, ' ',
|
indent + 1, ' ',
|
||||||
_(prompt));
|
prompt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -829,11 +829,11 @@ static void build_conf(struct menu *menu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
item_add_str("%*c%s", indent + 1,
|
item_add_str("%*c%s", indent + 1,
|
||||||
' ', _(menu_get_prompt(menu)));
|
' ', menu_get_prompt(menu));
|
||||||
if (val == yes) {
|
if (val == yes) {
|
||||||
if (def_menu) {
|
if (def_menu) {
|
||||||
item_add_str(" (%s)",
|
item_add_str(" (%s)",
|
||||||
_(menu_get_prompt(def_menu)));
|
menu_get_prompt(def_menu));
|
||||||
item_add_str(" --->");
|
item_add_str(" --->");
|
||||||
if (def_menu->list) {
|
if (def_menu->list) {
|
||||||
indent += 2;
|
indent += 2;
|
||||||
@ -847,7 +847,7 @@ static void build_conf(struct menu *menu)
|
|||||||
if (menu == current_menu) {
|
if (menu == current_menu) {
|
||||||
item_make(menu, ':',
|
item_make(menu, ':',
|
||||||
"---%*c%s", indent + 1,
|
"---%*c%s", indent + 1,
|
||||||
' ', _(menu_get_prompt(menu)));
|
' ', menu_get_prompt(menu));
|
||||||
goto conf_childs;
|
goto conf_childs;
|
||||||
}
|
}
|
||||||
child_count++;
|
child_count++;
|
||||||
@ -894,17 +894,17 @@ static void build_conf(struct menu *menu)
|
|||||||
if (tmp < 0)
|
if (tmp < 0)
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
item_add_str("%*c%s%s", tmp, ' ',
|
item_add_str("%*c%s%s", tmp, ' ',
|
||||||
_(menu_get_prompt(menu)),
|
menu_get_prompt(menu),
|
||||||
(sym_has_value(sym) ||
|
(sym_has_value(sym) ||
|
||||||
!sym_is_changable(sym)) ? "" :
|
!sym_is_changable(sym)) ? "" :
|
||||||
_(" (NEW)"));
|
" (NEW)");
|
||||||
goto conf_childs;
|
goto conf_childs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item_add_str("%*c%s%s", indent + 1, ' ',
|
item_add_str("%*c%s%s", indent + 1, ' ',
|
||||||
_(menu_get_prompt(menu)),
|
menu_get_prompt(menu),
|
||||||
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
(sym_has_value(sym) || !sym_is_changable(sym)) ?
|
||||||
"" : _(" (NEW)"));
|
"" : " (NEW)");
|
||||||
if (menu->prompt && menu->prompt->type == P_MENU) {
|
if (menu->prompt && menu->prompt->type == P_MENU) {
|
||||||
item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
|
item_add_str(" %s", menu_is_empty(menu) ? "----" : "--->");
|
||||||
return;
|
return;
|
||||||
@ -1086,8 +1086,8 @@ static void conf(struct menu *menu)
|
|||||||
if (!child_count)
|
if (!child_count)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
show_menu(prompt ? _(prompt) : _("Main Menu"),
|
show_menu(prompt ? prompt : "Main Menu",
|
||||||
_(menu_instructions),
|
menu_instructions,
|
||||||
current_index, &last_top_row);
|
current_index, &last_top_row);
|
||||||
keypad((menu_win(curses_menu)), TRUE);
|
keypad((menu_win(curses_menu)), TRUE);
|
||||||
while (!global_exit) {
|
while (!global_exit) {
|
||||||
@ -1227,13 +1227,13 @@ static void show_help(struct menu *menu)
|
|||||||
|
|
||||||
help = str_new();
|
help = str_new();
|
||||||
menu_get_ext_help(menu, &help);
|
menu_get_ext_help(menu, &help);
|
||||||
show_scroll_win(main_window, _(menu_get_prompt(menu)), str_get(&help));
|
show_scroll_win(main_window, menu_get_prompt(menu), str_get(&help));
|
||||||
str_free(&help);
|
str_free(&help);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void conf_choice(struct menu *menu)
|
static void conf_choice(struct menu *menu)
|
||||||
{
|
{
|
||||||
const char *prompt = _(menu_get_prompt(menu));
|
const char *prompt = menu_get_prompt(menu);
|
||||||
struct menu *child = NULL;
|
struct menu *child = NULL;
|
||||||
struct symbol *active;
|
struct symbol *active;
|
||||||
int selected_index = 0;
|
int selected_index = 0;
|
||||||
@ -1256,13 +1256,13 @@ static void conf_choice(struct menu *menu)
|
|||||||
|
|
||||||
if (child->sym == sym_get_choice_value(menu->sym))
|
if (child->sym == sym_get_choice_value(menu->sym))
|
||||||
item_make(child, ':', "<X> %s",
|
item_make(child, ':', "<X> %s",
|
||||||
_(menu_get_prompt(child)));
|
menu_get_prompt(child));
|
||||||
else if (child->sym)
|
else if (child->sym)
|
||||||
item_make(child, ':', " %s",
|
item_make(child, ':', " %s",
|
||||||
_(menu_get_prompt(child)));
|
menu_get_prompt(child));
|
||||||
else
|
else
|
||||||
item_make(child, ':', "*** %s ***",
|
item_make(child, ':', "*** %s ***",
|
||||||
_(menu_get_prompt(child)));
|
menu_get_prompt(child));
|
||||||
|
|
||||||
if (child->sym == active){
|
if (child->sym == active){
|
||||||
last_top_row = top_row(curses_menu);
|
last_top_row = top_row(curses_menu);
|
||||||
@ -1270,8 +1270,8 @@ static void conf_choice(struct menu *menu)
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
show_menu(prompt ? _(prompt) : _("Choice Menu"),
|
show_menu(prompt ? prompt : "Choice Menu",
|
||||||
_(radiolist_instructions),
|
radiolist_instructions,
|
||||||
selected_index,
|
selected_index,
|
||||||
&last_top_row);
|
&last_top_row);
|
||||||
while (!global_exit) {
|
while (!global_exit) {
|
||||||
@ -1358,19 +1358,19 @@ static void conf_string(struct menu *menu)
|
|||||||
|
|
||||||
switch (sym_get_type(menu->sym)) {
|
switch (sym_get_type(menu->sym)) {
|
||||||
case S_INT:
|
case S_INT:
|
||||||
heading = _(inputbox_instructions_int);
|
heading = inputbox_instructions_int;
|
||||||
break;
|
break;
|
||||||
case S_HEX:
|
case S_HEX:
|
||||||
heading = _(inputbox_instructions_hex);
|
heading = inputbox_instructions_hex;
|
||||||
break;
|
break;
|
||||||
case S_STRING:
|
case S_STRING:
|
||||||
heading = _(inputbox_instructions_string);
|
heading = inputbox_instructions_string;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
heading = _("Internal nconf error!");
|
heading = "Internal nconf error!";
|
||||||
}
|
}
|
||||||
res = dialog_inputbox(main_window,
|
res = dialog_inputbox(main_window,
|
||||||
prompt ? _(prompt) : _("Main Menu"),
|
prompt ? prompt : "Main Menu",
|
||||||
heading,
|
heading,
|
||||||
sym_get_string_value(menu->sym),
|
sym_get_string_value(menu->sym),
|
||||||
&dialog_input_result,
|
&dialog_input_result,
|
||||||
@ -1381,7 +1381,7 @@ static void conf_string(struct menu *menu)
|
|||||||
dialog_input_result))
|
dialog_input_result))
|
||||||
return;
|
return;
|
||||||
btn_dialog(main_window,
|
btn_dialog(main_window,
|
||||||
_("You have made an invalid entry."), 0);
|
"You have made an invalid entry.", 0);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
show_help(menu);
|
show_help(menu);
|
||||||
@ -1410,11 +1410,11 @@ static void conf_load(void)
|
|||||||
sym_set_change_count(1);
|
sym_set_change_count(1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btn_dialog(main_window, _("File does not exist!"), 0);
|
btn_dialog(main_window, "File does not exist!", 0);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
show_scroll_win(main_window,
|
show_scroll_win(main_window,
|
||||||
_("Load Alternate Configuration"),
|
"Load Alternate Configuration",
|
||||||
load_config_help);
|
load_config_help);
|
||||||
break;
|
break;
|
||||||
case KEY_EXIT:
|
case KEY_EXIT:
|
||||||
@ -1441,13 +1441,13 @@ static void conf_save(void)
|
|||||||
set_config_filename(dialog_input_result);
|
set_config_filename(dialog_input_result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btn_dialog(main_window, _("Can't create file! "
|
btn_dialog(main_window, "Can't create file! "
|
||||||
"Probably a nonexistent directory."),
|
"Probably a nonexistent directory.",
|
||||||
1, "<OK>");
|
1, "<OK>");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
show_scroll_win(main_window,
|
show_scroll_win(main_window,
|
||||||
_("Save Alternate Configuration"),
|
"Save Alternate Configuration",
|
||||||
save_config_help);
|
save_config_help);
|
||||||
break;
|
break;
|
||||||
case KEY_EXIT:
|
case KEY_EXIT:
|
||||||
@ -1480,10 +1480,6 @@ int main(int ac, char **av)
|
|||||||
int lines, columns;
|
int lines, columns;
|
||||||
char *mode;
|
char *mode;
|
||||||
|
|
||||||
setlocale(LC_ALL, "");
|
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
|
||||||
textdomain(PACKAGE);
|
|
||||||
|
|
||||||
if (ac > 1 && strcmp(av[1], "-s") == 0) {
|
if (ac > 1 && strcmp(av[1], "-s") == 0) {
|
||||||
/* Silence conf_read() until the real callback is set up */
|
/* Silence conf_read() until the real callback is set up */
|
||||||
conf_set_message_callback(NULL);
|
conf_set_message_callback(NULL);
|
||||||
@ -1541,8 +1537,8 @@ int main(int ac, char **av)
|
|||||||
/* check for KEY_FUNC(1) */
|
/* check for KEY_FUNC(1) */
|
||||||
if (has_key(KEY_F(1)) == FALSE) {
|
if (has_key(KEY_F(1)) == FALSE) {
|
||||||
show_scroll_win(main_window,
|
show_scroll_win(main_window,
|
||||||
_("Instructions"),
|
"Instructions",
|
||||||
_(menu_no_f_instructions));
|
menu_no_f_instructions);
|
||||||
}
|
}
|
||||||
|
|
||||||
conf_set_message_callback(conf_message_callback);
|
conf_set_message_callback(conf_message_callback);
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <locale.h>
|
|
||||||
#include <ncurses.h>
|
#include <ncurses.h>
|
||||||
#include <menu.h>
|
#include <menu.h>
|
||||||
#include <panel.h>
|
#include <panel.h>
|
||||||
|
@ -34,10 +34,6 @@
|
|||||||
#include "qconf.moc"
|
#include "qconf.moc"
|
||||||
#include "images.c"
|
#include "images.c"
|
||||||
|
|
||||||
#ifdef _
|
|
||||||
# undef _
|
|
||||||
# define _ qgettext
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static QApplication *configApp;
|
static QApplication *configApp;
|
||||||
static ConfigSettings *configSettings;
|
static ConfigSettings *configSettings;
|
||||||
@ -46,12 +42,7 @@ QAction *ConfigMainWindow::saveAction;
|
|||||||
|
|
||||||
static inline QString qgettext(const char* str)
|
static inline QString qgettext(const char* str)
|
||||||
{
|
{
|
||||||
return QString::fromLocal8Bit(gettext(str));
|
return QString::fromLocal8Bit(str);
|
||||||
}
|
|
||||||
|
|
||||||
static inline QString qgettext(const QString& str)
|
|
||||||
{
|
|
||||||
return QString::fromLocal8Bit(gettext(str.toLatin1()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigSettings::ConfigSettings()
|
ConfigSettings::ConfigSettings()
|
||||||
@ -127,7 +118,7 @@ void ConfigItem::updateMenu(void)
|
|||||||
|
|
||||||
sym = menu->sym;
|
sym = menu->sym;
|
||||||
prop = menu->prompt;
|
prop = menu->prompt;
|
||||||
prompt = _(menu_get_prompt(menu));
|
prompt = qgettext(menu_get_prompt(menu));
|
||||||
|
|
||||||
if (prop) switch (prop->type) {
|
if (prop) switch (prop->type) {
|
||||||
case P_MENU:
|
case P_MENU:
|
||||||
@ -216,7 +207,7 @@ void ConfigItem::updateMenu(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!sym_has_value(sym) && visible)
|
if (!sym_has_value(sym) && visible)
|
||||||
prompt += _(" (NEW)");
|
prompt += " (NEW)";
|
||||||
set_prompt:
|
set_prompt:
|
||||||
setText(promptColIdx, prompt);
|
setText(promptColIdx, prompt);
|
||||||
}
|
}
|
||||||
@ -327,7 +318,7 @@ ConfigList::ConfigList(ConfigView* p, const char *name)
|
|||||||
setVerticalScrollMode(ScrollPerPixel);
|
setVerticalScrollMode(ScrollPerPixel);
|
||||||
setHorizontalScrollMode(ScrollPerPixel);
|
setHorizontalScrollMode(ScrollPerPixel);
|
||||||
|
|
||||||
setHeaderLabels(QStringList() << _("Option") << _("Name") << "N" << "M" << "Y" << _("Value"));
|
setHeaderLabels(QStringList() << "Option" << "Name" << "N" << "M" << "Y" << "Value");
|
||||||
|
|
||||||
connect(this, SIGNAL(itemSelectionChanged(void)),
|
connect(this, SIGNAL(itemSelectionChanged(void)),
|
||||||
SLOT(updateSelection(void)));
|
SLOT(updateSelection(void)));
|
||||||
@ -883,7 +874,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
|
|||||||
QAction *action;
|
QAction *action;
|
||||||
|
|
||||||
headerPopup = new QMenu(this);
|
headerPopup = new QMenu(this);
|
||||||
action = new QAction(_("Show Name"), this);
|
action = new QAction("Show Name", this);
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
connect(action, SIGNAL(toggled(bool)),
|
connect(action, SIGNAL(toggled(bool)),
|
||||||
parent(), SLOT(setShowName(bool)));
|
parent(), SLOT(setShowName(bool)));
|
||||||
@ -891,7 +882,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
|
|||||||
action, SLOT(setOn(bool)));
|
action, SLOT(setOn(bool)));
|
||||||
action->setChecked(showName);
|
action->setChecked(showName);
|
||||||
headerPopup->addAction(action);
|
headerPopup->addAction(action);
|
||||||
action = new QAction(_("Show Range"), this);
|
action = new QAction("Show Range", this);
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
connect(action, SIGNAL(toggled(bool)),
|
connect(action, SIGNAL(toggled(bool)),
|
||||||
parent(), SLOT(setShowRange(bool)));
|
parent(), SLOT(setShowRange(bool)));
|
||||||
@ -899,7 +890,7 @@ void ConfigList::contextMenuEvent(QContextMenuEvent *e)
|
|||||||
action, SLOT(setOn(bool)));
|
action, SLOT(setOn(bool)));
|
||||||
action->setChecked(showRange);
|
action->setChecked(showRange);
|
||||||
headerPopup->addAction(action);
|
headerPopup->addAction(action);
|
||||||
action = new QAction(_("Show Data"), this);
|
action = new QAction("Show Data", this);
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
connect(action, SIGNAL(toggled(bool)),
|
connect(action, SIGNAL(toggled(bool)),
|
||||||
parent(), SLOT(setShowData(bool)));
|
parent(), SLOT(setShowData(bool)));
|
||||||
@ -1086,7 +1077,7 @@ void ConfigInfoView::menuInfo(void)
|
|||||||
if (sym) {
|
if (sym) {
|
||||||
if (_menu->prompt) {
|
if (_menu->prompt) {
|
||||||
head += "<big><b>";
|
head += "<big><b>";
|
||||||
head += print_filter(_(_menu->prompt->text));
|
head += print_filter(_menu->prompt->text);
|
||||||
head += "</b></big>";
|
head += "</b></big>";
|
||||||
if (sym->name) {
|
if (sym->name) {
|
||||||
head += " (";
|
head += " (";
|
||||||
@ -1117,7 +1108,7 @@ void ConfigInfoView::menuInfo(void)
|
|||||||
str_free(&help_gstr);
|
str_free(&help_gstr);
|
||||||
} else if (_menu->prompt) {
|
} else if (_menu->prompt) {
|
||||||
head += "<big><b>";
|
head += "<big><b>";
|
||||||
head += print_filter(_(_menu->prompt->text));
|
head += print_filter(_menu->prompt->text);
|
||||||
head += "</b></big><br><br>";
|
head += "</b></big><br><br>";
|
||||||
if (showDebug()) {
|
if (showDebug()) {
|
||||||
if (_menu->prompt->visible.expr) {
|
if (_menu->prompt->visible.expr) {
|
||||||
@ -1152,7 +1143,7 @@ QString ConfigInfoView::debug_info(struct symbol *sym)
|
|||||||
case P_PROMPT:
|
case P_PROMPT:
|
||||||
case P_MENU:
|
case P_MENU:
|
||||||
debug += QString().sprintf("prompt: <a href=\"m%p\">", prop->menu);
|
debug += QString().sprintf("prompt: <a href=\"m%p\">", prop->menu);
|
||||||
debug += print_filter(_(prop->text));
|
debug += print_filter(prop->text);
|
||||||
debug += "</a><br>";
|
debug += "</a><br>";
|
||||||
break;
|
break;
|
||||||
case P_DEFAULT:
|
case P_DEFAULT:
|
||||||
@ -1234,7 +1225,7 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
|
|||||||
QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
|
QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
|
||||||
{
|
{
|
||||||
QMenu* popup = Parent::createStandardContextMenu(pos);
|
QMenu* popup = Parent::createStandardContextMenu(pos);
|
||||||
QAction* action = new QAction(_("Show Debug Info"), popup);
|
QAction* action = new QAction("Show Debug Info", popup);
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
|
connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool)));
|
||||||
connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
|
connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool)));
|
||||||
@ -1261,11 +1252,11 @@ ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *nam
|
|||||||
QHBoxLayout* layout2 = new QHBoxLayout(0);
|
QHBoxLayout* layout2 = new QHBoxLayout(0);
|
||||||
layout2->setContentsMargins(0, 0, 0, 0);
|
layout2->setContentsMargins(0, 0, 0, 0);
|
||||||
layout2->setSpacing(6);
|
layout2->setSpacing(6);
|
||||||
layout2->addWidget(new QLabel(_("Find:"), this));
|
layout2->addWidget(new QLabel("Find:", this));
|
||||||
editField = new QLineEdit(this);
|
editField = new QLineEdit(this);
|
||||||
connect(editField, SIGNAL(returnPressed()), SLOT(search()));
|
connect(editField, SIGNAL(returnPressed()), SLOT(search()));
|
||||||
layout2->addWidget(editField);
|
layout2->addWidget(editField);
|
||||||
searchButton = new QPushButton(_("Search"), this);
|
searchButton = new QPushButton("Search", this);
|
||||||
searchButton->setAutoDefault(false);
|
searchButton->setAutoDefault(false);
|
||||||
connect(searchButton, SIGNAL(clicked()), SLOT(search()));
|
connect(searchButton, SIGNAL(clicked()), SLOT(search()));
|
||||||
layout2->addWidget(searchButton);
|
layout2->addWidget(searchButton);
|
||||||
@ -1387,44 +1378,44 @@ ConfigMainWindow::ConfigMainWindow(void)
|
|||||||
toolBar = new QToolBar("Tools", this);
|
toolBar = new QToolBar("Tools", this);
|
||||||
addToolBar(toolBar);
|
addToolBar(toolBar);
|
||||||
|
|
||||||
backAction = new QAction(QPixmap(xpm_back), _("Back"), this);
|
backAction = new QAction(QPixmap(xpm_back), "Back", this);
|
||||||
connect(backAction, SIGNAL(triggered(bool)), SLOT(goBack()));
|
connect(backAction, SIGNAL(triggered(bool)), SLOT(goBack()));
|
||||||
backAction->setEnabled(false);
|
backAction->setEnabled(false);
|
||||||
QAction *quitAction = new QAction(_("&Quit"), this);
|
QAction *quitAction = new QAction("&Quit", this);
|
||||||
quitAction->setShortcut(Qt::CTRL + Qt::Key_Q);
|
quitAction->setShortcut(Qt::CTRL + Qt::Key_Q);
|
||||||
connect(quitAction, SIGNAL(triggered(bool)), SLOT(close()));
|
connect(quitAction, SIGNAL(triggered(bool)), SLOT(close()));
|
||||||
QAction *loadAction = new QAction(QPixmap(xpm_load), _("&Load"), this);
|
QAction *loadAction = new QAction(QPixmap(xpm_load), "&Load", this);
|
||||||
loadAction->setShortcut(Qt::CTRL + Qt::Key_L);
|
loadAction->setShortcut(Qt::CTRL + Qt::Key_L);
|
||||||
connect(loadAction, SIGNAL(triggered(bool)), SLOT(loadConfig()));
|
connect(loadAction, SIGNAL(triggered(bool)), SLOT(loadConfig()));
|
||||||
saveAction = new QAction(QPixmap(xpm_save), _("&Save"), this);
|
saveAction = new QAction(QPixmap(xpm_save), "&Save", this);
|
||||||
saveAction->setShortcut(Qt::CTRL + Qt::Key_S);
|
saveAction->setShortcut(Qt::CTRL + Qt::Key_S);
|
||||||
connect(saveAction, SIGNAL(triggered(bool)), SLOT(saveConfig()));
|
connect(saveAction, SIGNAL(triggered(bool)), SLOT(saveConfig()));
|
||||||
conf_set_changed_callback(conf_changed);
|
conf_set_changed_callback(conf_changed);
|
||||||
// Set saveAction's initial state
|
// Set saveAction's initial state
|
||||||
conf_changed();
|
conf_changed();
|
||||||
QAction *saveAsAction = new QAction(_("Save &As..."), this);
|
QAction *saveAsAction = new QAction("Save &As...", this);
|
||||||
connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs()));
|
connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs()));
|
||||||
QAction *searchAction = new QAction(_("&Find"), this);
|
QAction *searchAction = new QAction("&Find", this);
|
||||||
searchAction->setShortcut(Qt::CTRL + Qt::Key_F);
|
searchAction->setShortcut(Qt::CTRL + Qt::Key_F);
|
||||||
connect(searchAction, SIGNAL(triggered(bool)), SLOT(searchConfig()));
|
connect(searchAction, SIGNAL(triggered(bool)), SLOT(searchConfig()));
|
||||||
singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), this);
|
singleViewAction = new QAction(QPixmap(xpm_single_view), "Single View", this);
|
||||||
singleViewAction->setCheckable(true);
|
singleViewAction->setCheckable(true);
|
||||||
connect(singleViewAction, SIGNAL(triggered(bool)), SLOT(showSingleView()));
|
connect(singleViewAction, SIGNAL(triggered(bool)), SLOT(showSingleView()));
|
||||||
splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), this);
|
splitViewAction = new QAction(QPixmap(xpm_split_view), "Split View", this);
|
||||||
splitViewAction->setCheckable(true);
|
splitViewAction->setCheckable(true);
|
||||||
connect(splitViewAction, SIGNAL(triggered(bool)), SLOT(showSplitView()));
|
connect(splitViewAction, SIGNAL(triggered(bool)), SLOT(showSplitView()));
|
||||||
fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), this);
|
fullViewAction = new QAction(QPixmap(xpm_tree_view), "Full View", this);
|
||||||
fullViewAction->setCheckable(true);
|
fullViewAction->setCheckable(true);
|
||||||
connect(fullViewAction, SIGNAL(triggered(bool)), SLOT(showFullView()));
|
connect(fullViewAction, SIGNAL(triggered(bool)), SLOT(showFullView()));
|
||||||
|
|
||||||
QAction *showNameAction = new QAction(_("Show Name"), this);
|
QAction *showNameAction = new QAction("Show Name", this);
|
||||||
showNameAction->setCheckable(true);
|
showNameAction->setCheckable(true);
|
||||||
connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
|
connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool)));
|
||||||
showNameAction->setChecked(configView->showName());
|
showNameAction->setChecked(configView->showName());
|
||||||
QAction *showRangeAction = new QAction(_("Show Range"), this);
|
QAction *showRangeAction = new QAction("Show Range", this);
|
||||||
showRangeAction->setCheckable(true);
|
showRangeAction->setCheckable(true);
|
||||||
connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
|
connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool)));
|
||||||
QAction *showDataAction = new QAction(_("Show Data"), this);
|
QAction *showDataAction = new QAction("Show Data", this);
|
||||||
showDataAction->setCheckable(true);
|
showDataAction->setCheckable(true);
|
||||||
connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
|
connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool)));
|
||||||
|
|
||||||
@ -1435,21 +1426,21 @@ ConfigMainWindow::ConfigMainWindow(void)
|
|||||||
connect(optGroup, SIGNAL(triggered(QAction *)), menuView,
|
connect(optGroup, SIGNAL(triggered(QAction *)), menuView,
|
||||||
SLOT(setOptionMode(QAction *)));
|
SLOT(setOptionMode(QAction *)));
|
||||||
|
|
||||||
configView->showNormalAction = new QAction(_("Show Normal Options"), optGroup);
|
configView->showNormalAction = new QAction("Show Normal Options", optGroup);
|
||||||
configView->showAllAction = new QAction(_("Show All Options"), optGroup);
|
configView->showAllAction = new QAction("Show All Options", optGroup);
|
||||||
configView->showPromptAction = new QAction(_("Show Prompt Options"), optGroup);
|
configView->showPromptAction = new QAction("Show Prompt Options", optGroup);
|
||||||
configView->showNormalAction->setCheckable(true);
|
configView->showNormalAction->setCheckable(true);
|
||||||
configView->showAllAction->setCheckable(true);
|
configView->showAllAction->setCheckable(true);
|
||||||
configView->showPromptAction->setCheckable(true);
|
configView->showPromptAction->setCheckable(true);
|
||||||
|
|
||||||
QAction *showDebugAction = new QAction( _("Show Debug Info"), this);
|
QAction *showDebugAction = new QAction("Show Debug Info", this);
|
||||||
showDebugAction->setCheckable(true);
|
showDebugAction->setCheckable(true);
|
||||||
connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
|
connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool)));
|
||||||
showDebugAction->setChecked(helpText->showDebug());
|
showDebugAction->setChecked(helpText->showDebug());
|
||||||
|
|
||||||
QAction *showIntroAction = new QAction( _("Introduction"), this);
|
QAction *showIntroAction = new QAction("Introduction", this);
|
||||||
connect(showIntroAction, SIGNAL(triggered(bool)), SLOT(showIntro()));
|
connect(showIntroAction, SIGNAL(triggered(bool)), SLOT(showIntro()));
|
||||||
QAction *showAboutAction = new QAction( _("About"), this);
|
QAction *showAboutAction = new QAction("About", this);
|
||||||
connect(showAboutAction, SIGNAL(triggered(bool)), SLOT(showAbout()));
|
connect(showAboutAction, SIGNAL(triggered(bool)), SLOT(showAbout()));
|
||||||
|
|
||||||
// init tool bar
|
// init tool bar
|
||||||
@ -1463,7 +1454,7 @@ ConfigMainWindow::ConfigMainWindow(void)
|
|||||||
toolBar->addAction(fullViewAction);
|
toolBar->addAction(fullViewAction);
|
||||||
|
|
||||||
// create config menu
|
// create config menu
|
||||||
QMenu* config = menu->addMenu(_("&File"));
|
QMenu* config = menu->addMenu("&File");
|
||||||
config->addAction(loadAction);
|
config->addAction(loadAction);
|
||||||
config->addAction(saveAction);
|
config->addAction(saveAction);
|
||||||
config->addAction(saveAsAction);
|
config->addAction(saveAsAction);
|
||||||
@ -1471,11 +1462,11 @@ ConfigMainWindow::ConfigMainWindow(void)
|
|||||||
config->addAction(quitAction);
|
config->addAction(quitAction);
|
||||||
|
|
||||||
// create edit menu
|
// create edit menu
|
||||||
QMenu* editMenu = menu->addMenu(_("&Edit"));
|
QMenu* editMenu = menu->addMenu("&Edit");
|
||||||
editMenu->addAction(searchAction);
|
editMenu->addAction(searchAction);
|
||||||
|
|
||||||
// create options menu
|
// create options menu
|
||||||
QMenu* optionMenu = menu->addMenu(_("&Option"));
|
QMenu* optionMenu = menu->addMenu("&Option");
|
||||||
optionMenu->addAction(showNameAction);
|
optionMenu->addAction(showNameAction);
|
||||||
optionMenu->addAction(showRangeAction);
|
optionMenu->addAction(showRangeAction);
|
||||||
optionMenu->addAction(showDataAction);
|
optionMenu->addAction(showDataAction);
|
||||||
@ -1486,7 +1477,7 @@ ConfigMainWindow::ConfigMainWindow(void)
|
|||||||
|
|
||||||
// create help menu
|
// create help menu
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
QMenu* helpMenu = menu->addMenu(_("&Help"));
|
QMenu* helpMenu = menu->addMenu("&Help");
|
||||||
helpMenu->addAction(showIntroAction);
|
helpMenu->addAction(showIntroAction);
|
||||||
helpMenu->addAction(showAboutAction);
|
helpMenu->addAction(showAboutAction);
|
||||||
|
|
||||||
@ -1534,14 +1525,14 @@ void ConfigMainWindow::loadConfig(void)
|
|||||||
if (s.isNull())
|
if (s.isNull())
|
||||||
return;
|
return;
|
||||||
if (conf_read(QFile::encodeName(s)))
|
if (conf_read(QFile::encodeName(s)))
|
||||||
QMessageBox::information(this, "qconf", _("Unable to load configuration!"));
|
QMessageBox::information(this, "qconf", "Unable to load configuration!");
|
||||||
ConfigView::updateListAll();
|
ConfigView::updateListAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConfigMainWindow::saveConfig(void)
|
bool ConfigMainWindow::saveConfig(void)
|
||||||
{
|
{
|
||||||
if (conf_write(NULL)) {
|
if (conf_write(NULL)) {
|
||||||
QMessageBox::information(this, "qconf", _("Unable to save configuration!"));
|
QMessageBox::information(this, "qconf", "Unable to save configuration!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1723,11 +1714,11 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e)
|
|||||||
e->accept();
|
e->accept();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QMessageBox mb("qconf", _("Save configuration?"), QMessageBox::Warning,
|
QMessageBox mb("qconf", "Save configuration?", QMessageBox::Warning,
|
||||||
QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape);
|
QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape);
|
||||||
mb.setButtonText(QMessageBox::Yes, _("&Save Changes"));
|
mb.setButtonText(QMessageBox::Yes, "&Save Changes");
|
||||||
mb.setButtonText(QMessageBox::No, _("&Discard Changes"));
|
mb.setButtonText(QMessageBox::No, "&Discard Changes");
|
||||||
mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit"));
|
mb.setButtonText(QMessageBox::Cancel, "Cancel Exit");
|
||||||
switch (mb.exec()) {
|
switch (mb.exec()) {
|
||||||
case QMessageBox::Yes:
|
case QMessageBox::Yes:
|
||||||
if (saveConfig())
|
if (saveConfig())
|
||||||
@ -1746,7 +1737,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e)
|
|||||||
|
|
||||||
void ConfigMainWindow::showIntro(void)
|
void ConfigMainWindow::showIntro(void)
|
||||||
{
|
{
|
||||||
static const QString str = _("Welcome to the qconf graphical configuration tool.\n\n"
|
static const QString str = "Welcome to the qconf graphical configuration tool.\n\n"
|
||||||
"For each option, a blank box indicates the feature is disabled, a check\n"
|
"For each option, a blank box indicates the feature is disabled, a check\n"
|
||||||
"indicates it is enabled, and a dot indicates that it is to be compiled\n"
|
"indicates it is enabled, and a dot indicates that it is to be compiled\n"
|
||||||
"as a module. Clicking on the box will cycle through the three states.\n\n"
|
"as a module. Clicking on the box will cycle through the three states.\n\n"
|
||||||
@ -1756,16 +1747,16 @@ void ConfigMainWindow::showIntro(void)
|
|||||||
"options must be enabled to support the option you are interested in, you can\n"
|
"options must be enabled to support the option you are interested in, you can\n"
|
||||||
"still view the help of a grayed-out option.\n\n"
|
"still view the help of a grayed-out option.\n\n"
|
||||||
"Toggling Show Debug Info under the Options menu will show the dependencies,\n"
|
"Toggling Show Debug Info under the Options menu will show the dependencies,\n"
|
||||||
"which you can then match by examining other options.\n\n");
|
"which you can then match by examining other options.\n\n";
|
||||||
|
|
||||||
QMessageBox::information(this, "qconf", str);
|
QMessageBox::information(this, "qconf", str);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigMainWindow::showAbout(void)
|
void ConfigMainWindow::showAbout(void)
|
||||||
{
|
{
|
||||||
static const QString str = _("qconf is Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>.\n"
|
static const QString str = "qconf is Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>.\n"
|
||||||
"Copyright (C) 2015 Boris Barbulovski <bbarbulovski@gmail.com>.\n\n"
|
"Copyright (C) 2015 Boris Barbulovski <bbarbulovski@gmail.com>.\n\n"
|
||||||
"Bug reports and feature request can also be entered at http://bugzilla.kernel.org/\n");
|
"Bug reports and feature request can also be entered at http://bugzilla.kernel.org/\n";
|
||||||
|
|
||||||
QMessageBox::information(this, "qconf", str);
|
QMessageBox::information(this, "qconf", str);
|
||||||
}
|
}
|
||||||
@ -1826,7 +1817,7 @@ static const char *progname;
|
|||||||
|
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
printf(_("%s [-s] <config>\n").toLatin1().constData(), progname);
|
printf("%s [-s] <config>\n", progname);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1835,9 +1826,6 @@ int main(int ac, char** av)
|
|||||||
ConfigMainWindow* v;
|
ConfigMainWindow* v;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
bindtextdomain(PACKAGE, LOCALEDIR);
|
|
||||||
textdomain(PACKAGE);
|
|
||||||
|
|
||||||
progname = av[0];
|
progname = av[0];
|
||||||
configApp = new QApplication(ac, av);
|
configApp = new QApplication(ac, av);
|
||||||
if (ac > 1 && av[1][0] == '-') {
|
if (ac > 1 && av[1][0] == '-') {
|
||||||
|
@ -546,7 +546,7 @@ void conf_parse(const char *name)
|
|||||||
modules_sym = sym_find( "n" );
|
modules_sym = sym_find( "n" );
|
||||||
|
|
||||||
tmp = rootmenu.prompt->text;
|
tmp = rootmenu.prompt->text;
|
||||||
rootmenu.prompt->text = _(rootmenu.prompt->text);
|
rootmenu.prompt->text = rootmenu.prompt->text;
|
||||||
rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
|
rootmenu.prompt->text = sym_expand_string_value(rootmenu.prompt->text);
|
||||||
free((char*)tmp);
|
free((char*)tmp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user