diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gtk.c | 6 | ||||
-rw-r--r-- | ui/librccui.c | 9 | ||||
-rw-r--r-- | ui/rccnames.c | 2 |
3 files changed, 8 insertions, 9 deletions
@@ -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; } |