Skip to content

Commit

Permalink
* updated french.lng
Browse files Browse the repository at this point in the history
+ added "saving time switch" in raw menu (better in debug menu?) - it is disabled at default (when enabled, shows time it takes to save raw/dng)
+ added a feature that allows using cfgs from a different camera by resetting "critical" settings on startup of the platform id doesnt match (more settings? less settings? need input)
+ added "get_platform_id" to ubasic, which returns platformid (integer), with the help of this you can code platform depending scripts (in lua we dont need this, as we can get strings there)
+ finally added Bill's user menu mod - see http://chdk.setepontos.com/index.php/topic,2179.msg20301.html#msg20301 (something's still need to be done about the models without zoom lever)


git-svn-id: http://tools.assembla.com/svn/chdk/trunk@593 6794e30b-3f2a-0410-a806-a2bbca1c07ff
  • Loading branch information
phyrephox committed Nov 25, 2008
1 parent f2e1516 commit 5cac94f
Show file tree
Hide file tree
Showing 17 changed files with 243 additions and 70 deletions.
1 change: 1 addition & 0 deletions CHDK/LANG/english.lng
Original file line number Diff line number Diff line change
Expand Up @@ -565,3 +565,4 @@
424 "DNG format"
425 "RAW buffer cached"
426 "Cannot load CHDK/badpixel.bin"
427 "Show raw saving time"
10 changes: 10 additions & 0 deletions CHDK/LANG/french.lng
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,13 @@
414 " Clear on start"
415 "Ajouter un suffix RAW"
416 " Fahrenheit"
417 "Load Edge Overlay"
418 "Save Edge Overlay"
419 "Enable in Play"
420 "Free internal Memory"
421 "Load+Set Zoom"
422 "Lock Edge Overlay"
423 "Rear curtain flash sync"
424 "DNG format"
425 "RAW buffer cached"
426 "Cannot load CHDK/badpixel.bin"
3 changes: 2 additions & 1 deletion CHDK/LANG/german.lng
Original file line number Diff line number Diff line change
Expand Up @@ -601,4 +601,5 @@
// DNG
424 "DNG-Format"
425 "RAW-Puffer nutzen"
426 "Datei badpixel.bin fehlt!"
426 "Datei badpixel.bin fehlt!"
427 "Zeige raw speicherzeit"
13 changes: 13 additions & 0 deletions core/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ int ubasic_camera_get_nr()

void clear_values()
{
if (conf.platformid != (int)PLATFORMID) // the following config entries will be resetted if you switch the camera using the same cfg
{
conf.raw_cache = 0;
conf.zoom_override_value = 0;
conf.fast_ev = 0;
conf.fast_movie_control = 0;
conf.fast_movie_quality_control = 0;
conf.zoom_scale = 100;
conf.platformid = (int)PLATFORMID;
}

if (conf.clear_override)
{
conf.av_override_value=0;
Expand Down Expand Up @@ -377,6 +388,8 @@ static const ConfInfo conf_info[] = {
CONF_INFO(225, conf.raw_cache, CONF_DEF_VALUE, i:0, NULL),
CONF_INFO(226, conf.dng_raw, CONF_DEF_VALUE, i:0, conf_change_dng),
CONF_INFO(227, conf.flash_sync_curtain, CONF_DEF_VALUE, i:0, NULL),
CONF_INFO(228, conf.raw_timer, CONF_DEF_VALUE, i:0, NULL),
CONF_INFO(229, conf.platformid, CONF_DEF_VALUE, i:(int)PLATFORMID, NULL),
};
#define CONF_NUM (sizeof(conf_info)/sizeof(conf_info[0]))

Expand Down
130 changes: 91 additions & 39 deletions core/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -652,27 +652,17 @@ static CMenuItem visual_submenu_items[] = {
};
static CMenu visual_submenu = {0x28,LANG_MENU_VIS_TITLE, NULL, visual_submenu_items };

void blank_menu()
{};

static CMenuItem user_submenu_items[] = {
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0},
{0x20,LANG_MENU_MAIN_TITLE, MENUITEM_PROC, (int*)rinit},
{0}
/*
* 1 extra entry for the "Main menu" and 1 for null when the menu is full with user selections
* Compiler will zero init remaining portion of array so no there is no hidden relationship between
* this structure and the value of USER_MENU_ITEMS. The value of USER_MENU_ITEMS can be anything you
* wish and everything automagically works.
*/

static CMenuItem user_submenu_items[USER_MENU_ITEMS + 2] = {
{0x20,LANG_MENU_MAIN_TITLE, MENUITEM_PROC, (int*)rinit}
};

static CMenu user_submenu = {0x2e,LANG_MENU_USER_MENU, NULL, user_submenu_items };

static CMenuItem raw_state_submenu_items[] = {
Expand Down Expand Up @@ -767,6 +757,7 @@ static CMenuItem raw_submenu_items[] = {
{0x5c, LANG_MENU_DNG_FORMAT, MENUITEM_BOOL | MENUITEM_ARG_CALLBACK, &conf.dng_raw , (int)cb_change_dng },
#endif
{0x5c,LANG_MENU_RAW_CACHED, MENUITEM_BOOL, &conf.raw_cache },
{0x5c,LANG_MENU_RAW_TIMER, MENUITEM_BOOL, &conf.raw_timer },
{0x51,LANG_MENU_BACK, MENUITEM_UP },
{0}
};
Expand Down Expand Up @@ -827,21 +818,75 @@ static int gui_user_menu_flag;

void rinit(){
gui_menu_init(&root_menu);
draw_restore();
gui_force_restore();
}

static CMenuItem blank_menu_item = {0x0,LANG_MENU_ITEM_BLANK, MENUITEM_PROC, (int*)blank_menu,0};
//-------------------------------------------------------------------
void
mod_user_menu(CMenuItem curr_menu_item, int* cur_memnu_item_indx, int mod) {
int i;
CMenuItem tmp_menu_item;
switch(mod) {

void add_user_menu(CMenuItem curr_menu_item, int* gui_menu_add_item, int del) {
if (*gui_menu_add_item<USER_MENU_ITEMS){
if (del) {
user_submenu_items[*gui_menu_add_item] = blank_menu_item;
} else {
user_submenu_items[*gui_menu_add_item] = curr_menu_item;
*gui_menu_add_item += 1;
}
}
case 0:
/*
* Delete user menu entry by sliding all the lower valid/existing entries up.
*/

if (*cur_memnu_item_indx == 0) /* don't allow deleting "user menu" */
break;
for(i = *cur_memnu_item_indx; user_submenu_items[i].text; i++) {
user_submenu_items[i] = user_submenu_items[i+1];
}

/*
* there were no valid entries below this one, so
* the index pointer must be decremented.
*/
if(!user_submenu_items[*cur_memnu_item_indx].text)
*cur_memnu_item_indx -= 1;

break;

case 1:
/*
* Insert new Item at end of existing entries
*/
for(i = 1; i < USER_MENU_ITEMS + 1; i++) {
if(!user_submenu_items[i].text) {
user_submenu_items[i] = curr_menu_item;
break;
}
}
break;

case 2:
/*
* Move entry up
*/

if((*cur_memnu_item_indx > 1)) {
tmp_menu_item = user_submenu_items[*cur_memnu_item_indx -1];
user_submenu_items[*cur_memnu_item_indx -1] = user_submenu_items[*cur_memnu_item_indx];
user_submenu_items[*cur_memnu_item_indx] = tmp_menu_item;
*cur_memnu_item_indx -=1;
}
break;

case 3:
/*
* Move entry down below next entry if next entry is not empty
*/
if (*cur_memnu_item_indx == 0) /* don't allow moving "user menu" */
break;
if((*cur_memnu_item_indx < (USER_MENU_ITEMS)) && (user_submenu_items[*cur_memnu_item_indx +1].text)) {
tmp_menu_item = user_submenu_items[*cur_memnu_item_indx +1];
user_submenu_items[*cur_memnu_item_indx + 1] = user_submenu_items[*cur_memnu_item_indx];
user_submenu_items[*cur_memnu_item_indx] = tmp_menu_item;
*cur_memnu_item_indx +=1;
}
break;

}
}

//-------------------------------------------------------------------
Expand Down Expand Up @@ -3083,15 +3128,22 @@ int find_mnu(CMenu *curr_menu, int mnu, int count)
void user_menu_save() {
int x;
for (x=0; x<USER_MENU_ITEMS; x++) {
conf.user_menu_vars[x] = user_submenu_items[x].text;
/*
* First entry in user_submenu_items is reserved for the "Main Menu"
* conf.user_menu_vars only traks/saves the real user entries.
*/
conf.user_menu_vars[x] = user_submenu_items[x+1].text;
}
}

void user_menu_restore() {
int x;
for (x=0; x<USER_MENU_ITEMS; x++) {
find_mnu(&root_menu, conf.user_menu_vars[x], x);
}
int x;
for (x=0; x<USER_MENU_ITEMS; x++) {
/*
* First entry in user_submenu_items is reserved for the "Main Menu"
* conf.user_menu_vars only traks/saves the real user entries.
*/
find_mnu(&root_menu, conf.user_menu_vars[x], x+1);
}
}


1 change: 1 addition & 0 deletions core/gui_lang.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ static char* gui_lang_default = \
"424 \"DNG format\"\n"
"425 \"RAW buffer cached\"\n"
"426 \"Cannot load CHDK/badpixel.bin\"\n"
"427 \"Show saving time\"\n"
;

//-------------------------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion core/gui_lang.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,10 @@
#define LANG_MENU_DNG_FORMAT 424
#define LANG_MENU_RAW_CACHED 425
#define LANG_CANNOT_OPEN_BADPIXEL_FILE 426
#define LANG_MENU_RAW_TIMER 427
//-------------------------------------------------------------------

#define GUI_LANG_ITEMS 426
#define GUI_LANG_ITEMS 427

//-------------------------------------------------------------------
extern void gui_lang_init();
Expand Down
Loading

0 comments on commit 5cac94f

Please sign in to comment.