Changeset 1960


Ignore:
Timestamp:
07/08/12 01:26:08 (11 months ago)
Author:
philmoz
Message:

Convert ALT help text to language strings.

Location:
branches/philmoz-uitest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/philmoz-uitest/CHDK/LANG/english.lng

    r1949 r1960  
    681681557 "  Help Screen Delay" 
    682682558 "CHDK Settings" 
     683 
     684// <ALT> mode help screen text 
     685559 "%-20s %-14s"                           // Header format, adjust if needed; but total len must be 35 
     686560 "<ALT> Shortcuts"                       // Len must be <= first string in header format (20) 
     687561 "Shutter Half Press +"                  // Len must be <= first string in header format (20) 
     688562 "MENU=CHDK Menu"                        // Len must be <= second string in header format (14) 
     689563 "MENU=User Menu"                        // Len must be <= second string in header format (14) 
     690564 "SET=Script Menu, SHUTTER=Run Script"   // Len must be <= 35 
     691565 "Focus  %5s=Inf.  %5s=HyperFocal"       // Len must be <= 35 
     692566 "Manual Focus" 
     693567 "Hide CHDK OSD while pressed" 
     694568 "  * - not available in <ALT> mode  "   // Len must be <= 35 
  • branches/philmoz-uitest/core/gui.c

    r1959 r1960  
    21342134} 
    21352135 
    2136 static int shortcut_text(int x, int y, int button, int func_str, const char *state) 
     2136static int shortcut_text(int x, int y, int button, int func_str, const char *state, color col) 
    21372137{ 
    21382138    buf[0] = 0; 
    2139     sprintf(buf,"%-5s %20s",gui_shortcut_text(button),lang_str(func_str)); 
    2140     buf[26] = 0; 
    21412139    if (state) 
    21422140    { 
     2141        sprintf(buf,"%-5s %20s",gui_shortcut_text(button),lang_str(func_str)); 
     2142        buf[26] = 0; 
    21432143        sprintf(buf+strlen(buf)," [%6s",state); 
    21442144        buf[34] = 0; 
    21452145        strcat(buf,"]"); 
    21462146    } 
     2147    else if (button) 
     2148    { 
     2149        sprintf(buf,"%-5s %29s",gui_shortcut_text(button),lang_str(func_str)); 
     2150    } 
    21472151    else 
    2148         strcat(buf,"         "); 
    2149     draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
     2152    { 
     2153        sprintf(buf,"%-35s",lang_str(func_str)); 
     2154    } 
     2155    buf[35] = 0; 
     2156    draw_string(x, y, buf, col); 
    21502157    return y + FONT_HEIGHT; 
    21512158} 
     
    21782185    int x = ((CAM_SCREEN_WIDTH/2)-(FONT_WIDTH*35/2)); 
    21792186 
    2180     if (conf.user_menu_enable && conf.user_menu_as_root) 
    2181         draw_string(x, y, "<ALT> Shortcuts      MENU=User Menu", MAKE_COLOR(COLOR_FG, COLOR_ALT_BG)); 
    2182     else 
    2183         draw_string(x, y, "<ALT> Shortcuts      MENU=CHDK Menu", MAKE_COLOR(COLOR_FG, COLOR_ALT_BG)); 
     2187    sprintf(buf,lang_str(LANG_HELP_HEADER), 
     2188            lang_str(LANG_HELP_ALT_SHORTCUTS), 
     2189            (conf.user_menu_enable && conf.user_menu_as_root)?lang_str(LANG_HELP_USER_MENU):lang_str(LANG_HELP_CHDK_MENU));  
     2190    buf[35] = 0; 
     2191    draw_string(x, y, buf, MAKE_COLOR(COLOR_FG, COLOR_ALT_BG)); 
    21842192    y += FONT_HEIGHT; 
    2185     if (conf.user_menu_enable) 
    2186     { 
    2187         if (conf.user_menu_as_root) 
    2188             draw_string(x, y, "Shutter Half Press + MENU=CHDK Menu", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    2189         else 
    2190             draw_string(x, y, "Shutter Half Press + MENU=User Menu", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    2191         y += FONT_HEIGHT; 
    2192     } 
    2193     draw_string(x, y, "SET=Script Menu, SHUTTER=Run Script", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
     2193 
     2194    sprintf(buf,lang_str(LANG_HELP_HEADER), 
     2195            lang_str(LANG_HELP_HALF_PRESS), 
     2196            (conf.user_menu_enable)?((conf.user_menu_enable && conf.user_menu_as_root)?lang_str(LANG_HELP_CHDK_MENU):lang_str(LANG_HELP_USER_MENU)):"");  
     2197    buf[35] = 0; 
     2198    draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    21942199    y += FONT_HEIGHT; 
    21952200 
     2201    draw_string(x, y, lang_str(LANG_HELP_SCRIPTS), MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
     2202    y += FONT_HEIGHT; 
     2203 
    21962204#if !defined(CAM_HAS_MANUAL_FOCUS) && defined(SHORTCUT_MF_TOGGLE) 
    2197     y = shortcut_text(x, y, SHORTCUT_MF_TOGGLE,(int)"Manual Focus",gui_on_off_enum(0,&conf.subj_dist_override_koef)); 
     2205    y = shortcut_text(x, y, SHORTCUT_MF_TOGGLE,LANG_HELP_MANUAL_FOCUS,gui_on_off_enum(0,&conf.subj_dist_override_koef), MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    21982206#endif 
    21992207 
    22002208    if (shooting_get_common_focus_mode())           // Check in manual focus mode 
    22012209    { 
    2202         sprintf(buf,"Focus  %5s=Inf.  %5s=HyperFocal",gui_shortcut_text(SHORTCUT_SET_INFINITY),gui_shortcut_text(SHORTCUT_SET_HYPERFOCAL)); 
     2210        sprintf(buf,lang_str(LANG_HELP_FOCUS),gui_shortcut_text(SHORTCUT_SET_INFINITY),gui_shortcut_text(SHORTCUT_SET_HYPERFOCAL)); 
    22032211        draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    22042212        y += FONT_HEIGHT; 
     
    22072215#ifdef OPT_DEBUGGING 
    22082216    if (conf.debug_shortcut_action) 
    2209         y = shortcut_text(x, y, SHORTCUT_TOGGLE_RAW,LANG_MENU_DEBUG_SHORTCUT_ACTION,gui_debug_shortcut_modes[conf.debug_shortcut_action]); 
     2217        y = shortcut_text(x, y, SHORTCUT_TOGGLE_RAW,LANG_MENU_DEBUG_SHORTCUT_ACTION,gui_debug_shortcut_modes[conf.debug_shortcut_action], MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    22102218    else 
    22112219#endif 
    2212         y = shortcut_text(x, y, SHORTCUT_TOGGLE_RAW,LANG_MENU_RAW_SAVE,(conf.save_raw?(conf.dng_raw?"DNG":"RAW"):"Off")); 
    2213  
    2214     draw_string(x, y, "Shutter Half Press +               ", MAKE_COLOR(COLOR_FG, COLOR_ALT_BG)); 
    2215     y += FONT_HEIGHT; 
    2216  
    2217     y = shortcut_text(x, y, SHORTCUT_DISABLE_OVERRIDES,LANG_MENU_OVERRIDE_DISABLE,gui_override_disable_modes[conf.override_disable]); 
    2218     y = shortcut_text(x, y, SHORTCUT_TOGGLE_HISTO,LANG_MENU_HISTO_SHOW,gui_histo_show_modes[conf.show_histo]); 
    2219     y = shortcut_text(x, y, SHORTCUT_TOGGLE_ZEBRA,LANG_MENU_ZEBRA_DRAW,gui_on_off_enum(0,&conf.zebra_draw)); 
    2220     y = shortcut_text(x, y, SHORTCUT_TOGGLE_OSD,LANG_MENU_OSD_SHOW,gui_on_off_enum(0,&conf.show_osd)); 
     2220        y = shortcut_text(x, y, SHORTCUT_TOGGLE_RAW,LANG_MENU_RAW_SAVE,(conf.save_raw?(conf.dng_raw?"DNG":"RAW"):"Off"), MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
     2221 
     2222    y = shortcut_text(x, y, 0 ,LANG_HELP_HALF_PRESS, 0, MAKE_COLOR(COLOR_FG, COLOR_ALT_BG)); 
     2223 
     2224    y = shortcut_text(x, y, SHORTCUT_DISABLE_OVERRIDES,LANG_MENU_OVERRIDE_DISABLE,gui_override_disable_modes[conf.override_disable], MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
     2225    y = shortcut_text(x, y, SHORTCUT_TOGGLE_HISTO,LANG_MENU_HISTO_SHOW,gui_histo_show_modes[conf.show_histo], MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
     2226    y = shortcut_text(x, y, SHORTCUT_TOGGLE_ZEBRA,LANG_MENU_ZEBRA_DRAW,gui_on_off_enum(0,&conf.zebra_draw), MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
     2227    y = shortcut_text(x, y, SHORTCUT_TOGGLE_OSD,LANG_MENU_OSD_SHOW,gui_on_off_enum(0,&conf.show_osd), MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    22212228 
    22222229    if (conf.hide_osd == 0) 
    2223     { 
    2224         sprintf(buf,"%-5s = Hide CHDK OSD while pressed",gui_shortcut_text(KEY_DISPLAY)); 
    2225         draw_string(x, y, buf, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    2226         y += FONT_HEIGHT; 
    2227     } 
     2230        y = shortcut_text(x, y, KEY_DISPLAY, LANG_HELP_HIDE_OSD, 0, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    22282231 
    22292232    if (is_menu_shortcut) 
    2230     { 
    2231         draw_string(x, y, "  * - not available in <ALT> mode  ", MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    2232         y += FONT_HEIGHT; 
    2233     } 
     2233        y = shortcut_text(x, y, 0 ,LANG_HELP_NOT_ALT, 0, MAKE_COLOR(COLOR_ALT_BG, COLOR_FG)); 
    22342234} 
    22352235 
  • branches/philmoz-uitest/core/gui_lang.h

    r1945 r1960  
    684684#define LANG_MENU_CHDK_SETTINGS                 558 
    685685 
    686 #define GUI_LANG_ITEMS                          558 
     686// <ALT> mode help screen text 
     687#define LANG_HELP_HEADER                        559 
     688#define LANG_HELP_ALT_SHORTCUTS                 560 
     689#define LANG_HELP_HALF_PRESS                    561 
     690#define LANG_HELP_CHDK_MENU                     562 
     691#define LANG_HELP_USER_MENU                     563 
     692#define LANG_HELP_SCRIPTS                       564 
     693#define LANG_HELP_FOCUS                         565 
     694#define LANG_HELP_MANUAL_FOCUS                  566 
     695#define LANG_HELP_HIDE_OSD                      567 
     696#define LANG_HELP_NOT_ALT                       568 
     697 
     698#define GUI_LANG_ITEMS                          568 
    687699 
    688700//------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.