Changeset 1998
- Timestamp:
- 07/18/12 19:05:44 (10 months ago)
- Location:
- branches/tsvstar-uitest
- Files:
-
- 3 added
- 1 deleted
- 4 edited
-
CHDK/CHDK.HLP (deleted)
-
CHDK/HELP (added)
-
CHDK/HELP/ENGLISH.HLP (added)
-
CHDK/HELP/russian.hlp (added)
-
core/gui.c (modified) (3 diffs)
-
core/gui_lang.h (modified) (1 diff)
-
core/gui_menu.c (modified) (4 diffs)
-
tools/makelang.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/tsvstar-uitest/core/gui.c
r1996 r1998 2704 2704 } 2705 2705 2706 static void copy_fname_w_new_ext( char* tgt, char* src, char* ext ) 2707 { 2708 if ( !src || !tgt ) return; 2709 2710 // copy filename 2711 char *str = strrchr( src, '/' ); 2712 if (!str ) { str = src; } else { str++;} 2713 strcpy( tgt, str ); 2714 2715 // replce extension 2716 str = strrchr( tgt, '.' ); 2717 if ( !str ) { str = tgt+strlen(tgt); } 2718 strcpy( str, ext ); 2719 2720 2721 } 2722 2723 2706 2724 // Called from the GUI task code to set the ALT mode state 2707 2725 void gui_activate_alt_mode() … … 2712 2730 2713 2731 // "Newbie" mode mean start help file 2732 // Break regular ALT sequence only if module ok and help exists 2714 2733 if ( conf.chdk_gui_mode_enum == CHDK_MODE_NEWBIE && !state_kbd_script_run ) 2715 2734 { … … 2717 2736 conf_save(); 2718 2737 2719 // Break regular ALT sequence only if module ok and help exists 2720 unsigned int argv[] ={ (unsigned int)"A/CHDK/CHDK.HLP" }; 2738 // make path to help file 2739 2740 char path_buf[60]; 2741 unsigned int argv[] ={ (unsigned int)path_buf }; 2742 strcpy( path_buf, "A/CHDK/HELP/"); 2743 2744 char* helpfile_name = path_buf + strlen(path_buf); 2745 2746 // if not success, try to load "_current_locale_.hlp" 2747 if ( conf.lang_file[0] ) { 2748 copy_fname_w_new_ext( helpfile_name, conf.lang_file, ".hlp"); 2749 2750 if ( module_run("txtread.flt", 0, sizeof(argv)/sizeof(argv[0]), argv, UNLOAD_IF_ERR) == 0 ) 2751 break; 2752 } 2753 2754 // if not success, try to load "_base_language_.hlp" 2755 copy_fname_w_new_ext( helpfile_name, gui_lang_source_filename, ".hlp"); 2756 if ( module_run("txtread.flt", 0, sizeof(argv)/sizeof(argv[0]), argv, UNLOAD_IF_ERR) == 0 ) 2757 break; 2758 2759 //if not success, try to load "english.hlp" 2760 argv[0] = (unsigned int)"A/CHDK/HELP/ENGLISH.HLP"; 2721 2761 if ( module_run("txtread.flt", 0, sizeof(argv)/sizeof(argv[0]), argv, UNLOAD_IF_ERR) == 0 ) 2722 2762 break; -
branches/tsvstar-uitest/core/gui_lang.h
r1976 r1998 703 703 extern void gui_lang_init(); 704 704 705 extern char* gui_lang_source_filename; 706 705 707 //------------------------------------------------------------------- 706 708 #endif -
branches/tsvstar-uitest/core/gui_menu.c
r1996 r1998 105 105 int itemid = lang_strhash31( curr_menu->menu[gui_menu_curr_item].text ); 106 106 if ( itemid == LANG_MENU_SUBJ_DIST_BRACKET_VALUE || 107 itemid == LANG_MENU_ISO_BRACKET_VALUE || 108 itemid == LANG_MENU_OVERRIDE_SUBJ_DIST_VALUE || 107 itemid == LANG_MENU_OVERRIDE_SUBJ_DIST_VALUE ) 108 { 109 int_incr = 100; 110 } 111 else if ( itemid == LANG_MENU_ISO_BRACKET_VALUE || 109 112 itemid == LANG_MENU_OVERRIDE_ISO_VALUE ) 110 113 { … … 631 634 } 632 635 636 637 // Purpose: cancel edit mode without apply changes 638 void gui_menu_cancel_editmode() 639 { 640 // cancel change 641 int *valueptr = menuitem_get_valueptr(curr_menu,gui_menu_curr_item); 642 643 if ( valueptr ) 644 *valueptr = item_prev_value; 645 646 gui_menu_set_editmode(0); 647 gui_menu_left(0); // process bounds and callbacks 648 649 // keep quickdisable state on cancel 650 if ( item_prev_value < 0 ) 651 turn_current_item_off(); 652 } 653 633 654 //------------------------------------------------------------------- 634 655 // Process button presses when in GUI_MODE_MENU mode … … 641 662 case KEY_SHOOT_HALF: 642 663 #endif 664 if ( flag_editmode ) { 665 gui_menu_cancel_editmode(); 666 break; 667 } 668 643 669 if (conf.user_menu_enable == 3) { 644 670 if (curr_menu->title != LANG_MENU_USER_MENU) { … … 815 841 case KEY_DISPLAY: 816 842 if ( flag_editmode ) { 817 818 // cancel change 819 int *valueptr = menuitem_get_valueptr(curr_menu,gui_menu_curr_item); 820 821 if ( valueptr ) 822 *valueptr = item_prev_value; 823 824 gui_menu_set_editmode(0); 825 gui_menu_left(0); // process bounds and callbacks 826 827 // keep quickdisable state on cancel 828 if ( item_prev_value < 0 ) 829 turn_current_item_off(); 830 843 gui_menu_cancel_editmode(); 831 844 } else { 832 845 gui_menu_back(); -
branches/tsvstar-uitest/tools/makelang.c
r1975 r1998 60 60 lang_load_from_mem ( file2 ); 61 61 62 63 char* lng_filename = (argc>2 && file2) ? argv[2] : argv[1]; 64 62 65 int num_empty_lines=0; 63 66 char buf[200]; 64 67 65 printf("//Auto generated file. Do not edit the contents of this file.\n//Update the CHDK/LANG/*.lng files to make changes.\n//Generated from %s\n\n",(argc>2)?argv[2]:argv[1]); 68 printf("//Auto generated file. Do not edit the contents of this file.\n//Update the CHDK/LANG/*.lng files to make changes.\n//Generated from %s\n\n",lng_filename); 69 70 printf("char* gui_lang_source_filename=\""); 71 for (i=0;i<8 && lng_filename[i] && lng_filename[i]!='.'; i++) 72 printf("%c",lng_filename[i]); 73 printf("\";\n\n"); 74 66 75 printf("static char* gui_lang_default = \\\n"); 67 76
Note: See TracChangeset
for help on using the changeset viewer.