summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-08 14:45:55 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2005-07-08 14:45:55 +0000
commitfdfe5b42f687fbf3d4537541cc1b0bd9b8c2c090 (patch)
tree81d199b6fbbb11d3f310668e5bdabf9129e5f41f /ui
parent232dbc756390d30a86ae6de0cc84600eddb1c0b2 (diff)
downloadlibrcc-fdfe5b42f687fbf3d4537541cc1b0bd9b8c2c090.tar.gz
librcc-fdfe5b42f687fbf3d4537541cc1b0bd9b8c2c090.tar.bz2
librcc-fdfe5b42f687fbf3d4537541cc1b0bd9b8c2c090.tar.xz
librcc-fdfe5b42f687fbf3d4537541cc1b0bd9b8c2c090.zip
08.07.2005
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c6
-rw-r--r--ui/librccui.c9
-rw-r--r--ui/rccnames.c2
3 files changed, 8 insertions, 9 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index c8e3a59..2fdf2f4 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -126,7 +126,7 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
config = rccGetConfig(rccctx, language_id);
charset_id = rccConfigGetSelectedCharset(config, (rcc_class_id)ctx->id);
- if (charset_id < 0) charset_id = 0;
+ if (charset_id == (rcc_charset_id)-1) charset_id = 0;
gtk_option_menu_set_history(GTK_OPTION_MENU(menu), charset_id);
break;
case RCC_UI_MENU_ENGINE:
@@ -148,12 +148,10 @@ int rccUiMenuConfigureWidget(rcc_ui_menu_context ctx) {
gtk_option_menu_remove_menu(GTK_OPTION_MENU(menu));
gtk_option_menu_set_menu(GTK_OPTION_MENU(menu), list);
-
config = rccGetConfig(rccctx, language_id);
engine_id = rccConfigGetCurrentEngine(config);
- if (engine_id < 0) engine_id = 0;
+ if (engine_id == (rcc_engine_id)-1) engine_id = 0;
gtk_option_menu_set_history(GTK_OPTION_MENU(menu), engine_id);
-
break;
case RCC_UI_MENU_OPTION:
if (!ctx->widget) {
diff --git a/ui/librccui.c b/ui/librccui.c
index c868708..3b8bcdc 100644
--- a/ui/librccui.c
+++ b/ui/librccui.c
@@ -165,12 +165,9 @@ int rccUiRestoreLanguage(rcc_ui_context ctx) {
rcc_class_ptr *classes;
rcc_language_id language_id;
- rcc_language_config config;
-
if (!ctx) return -1;
language_id = (rcc_language_id)rccUiMenuGet(ctx->language);
- config = rccGetConfig(ctx->rccctx, language_id);
rccUiMenuConfigureWidget(ctx->engine);
//rccUiMenuSet(ctx->engine, (rcc_ui_id)rccConfigGetSelectedEngine(config));
@@ -386,6 +383,7 @@ rcc_ui_frame rccUiGetEngineFrame(rcc_ui_context ctx, const char *title) {
rcc_ui_frame frame;
rcc_ui_box engine;
rcc_ui_box opt;
+ const char *optname;
if (!ctx) return NULL;
@@ -400,7 +398,10 @@ rcc_ui_frame rccUiGetEngineFrame(rcc_ui_context ctx, const char *title) {
rccUiFrameAdd(framectx, engine);
for (i=0; i<RCC_MAX_OPTIONS; i++) {
- opt = rccUiGetOptionBox(ctx, (rcc_option)i, rccUiGetOptionName(ctx, i));
+ optname = rccUiGetOptionName(ctx, i);
+ if (!optname) continue;
+
+ opt = rccUiGetOptionBox(ctx, (rcc_option)i, optname);
rccUiFrameAdd(framectx, opt);
}
diff --git a/ui/rccnames.c b/ui/rccnames.c
index 2e11165..f5bf4d8 100644
--- a/ui/rccnames.c
+++ b/ui/rccnames.c
@@ -40,5 +40,5 @@ const char *rccUiGetOptionName(rcc_ui_context ctx, rcc_option option) {
res = rccGetOptionFullName(option);
if (res) return res;
- return "";
+ return NULL;
}