a few enhancements, bugfixes - done - page 5 - General Discussion and Assistance - CHDK Forum

Poll

Day Light saving time option, watcha think about it?

Whats DST? (dont need it)
1 (4.8%)
gimme gimme gimme (need it)
5 (23.8%)
Just a hint twice a year is sufficient
4 (19%)
might be useful
10 (47.6%)
can it cure STDs?
1 (4.8%)

Total Members Voted: 20

a few enhancements, bugfixes - done

  • 88 Replies
  • 26125 Views
*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: a few enhancements, bugfixes
« Reply #40 on: 10 / March / 2008, 01:27:21 »
Advertisements
yeah, already noticed the glitch in the icon. uploaded fixed version, its in the same thread.
i'd like to add fingalos menu, and also wontollas raw purge feature (already miss it in my build :D), but i dont want to mix these features, as i already changed lot of sourcecode, and i guess all of our changes will make it to official trunk sooner or later.
as soon as whim is finished with the chdk switcher, testing different flavors of chdk will be much easier. :)

Re: a few enhancements, bugfixes
« Reply #41 on: 10 / March / 2008, 09:55:38 »
Deleted
« Last Edit: 22 / April / 2008, 13:37:26 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline wontolla

  • ****
  • 413
  • S3 & G9 & A720
Re: a few enhancements, bugfixes
« Reply #42 on: 10 / March / 2008, 10:08:13 »
Now THAT'S what I call enhancements!

Quote
New:
- width/height of spacebar now toggable (between about 7 ("canvas" is about 6 pixels, so the actual minimum information bar can be set to ONE pixel, almost too small) pixels and 17 pixels, check it out)
That's much better than a very thin spacebar. Now people can choose.
I don't get what you mean by "between about 7". I see your code and it looks like the user can select from 10 different widths. But I'll try it in my camera tonite.

Quote
- New Warning tresholds introduced, you can choose between treshold in MB and Percent.
Very handy when taking a lot of continuous shots, I loose notion of memory space. Now I have almost everything I need for that beach setup.

Quote
- New RAW Counter treshold, you can set it so that the RAW counter blinks when for example under 10. Previous setting was hardcoded to 1. Also changed: No "Warning" String anymore, just blinking between warning color and OSD color.
- Raw Counter now enabled by default
As I said, that is very helpful. Now the camera reminds you when have a few shots before memory is full. Like the Boy Scouts, you can now "be prepared" when you know a number of action shots is comming.
I agree with Barney on that "too many options in menu" problem. I even was thinking about having a "Simple menu" and an "Advanced menu". So you can go to advanced from time to time only. But now that is solved in a much better way with fingalo's reconfigurable highly-adaptive user-customizable menu.

Quote
- new get statements available in ubasic: get_disk_size & get_free_disk_space - returns values in KB. you can build scripts now which stop when specific disk limit exceeded, for example.Divide by 1024 to have an "easier" calculation. This is my first fiddling around with ubasic, please test thoroughly.
That is a good adition. You can add them to the Wiki too! These new statemens remaind me I should get more into scripts because in the end, must of the problems can/should be solved with a simple script instead of "modifying the trunk"

Quote
as always: ugly code, i am relying on your advisories, tips & tricks to clean my code.
Unfortunately, I'm not that kind of programmer that can "see" the code and find probable errors or unineficient implementations. But someone mentioned that CHDK code is not very well commented. According to whim's cross referencing files the Ratio/Comment code is 0.31. To start commenting more than 100,000 lines of code sounds crazy. What we can do now is to comment our own input.

Quote
oh and another small question to the people who code for chdk but dont have write access to official trunk: how do you handle your code at home? have a local svn, but its always such a pain in the A$$ to make a diff vs. official trunk and merge when there is a new revision... any hints?
I'll second that question. I tried to download the trunk with Eclipse but I couldn't, no reading permissions, that's odd. I've been reading the svn manual but I guess input from more experienced developers would be very useful. May be we should start a new thread with this question. The other one where everybody states their editing environment only asks for that, no details.

Keep it going PhyrePhox, these additions really enchance our photography.

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: a few enhancements, bugfixes
« Reply #43 on: 10 / March / 2008, 10:21:18 »
Cool. The little line if pixels is filled. Thanks. But .... umm ... the space icons (bar and SD card icon) are still getting color from the OSD Text color. :( Changing "Remaining Space Icon Color" has no effect on them.

Did you change anything else from build 95 to 98 that I should look for to test?



oh, ur totally right! i made a mistake. when you set warning "type" to percent, space color is in effect, you can use that as temporary workaround. just a few lines of code have to be changed. darn, i hate my copy & paste coding style :D

Quote
I don't get what you mean by "between about 7". I see your code and it looks like the user can select from 10 different widths. But I'll try it in my camera tonite.

well, there are 3 lines around the actual bar, one rect in black, then one rect in space color, then one rect in black. makes it easier to distinguish from the background. this makes 6 pixels (top & bottom must be added).

yeah i probably should start commenting my code. but i always think: well, the function is called spacebar, it's purpose is obvious :D well well


Re: a few enhancements, bugfixes
« Reply #44 on: 10 / March / 2008, 13:01:52 »
Deleted
« Last Edit: 22 / April / 2008, 13:37:52 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: a few enhancements, bugfixes
« Reply #45 on: 10 / March / 2008, 15:50:28 »
a penny for your thoughts, better yet: ideas :D
fiddling around with the colors i noticed i should also add two new entries in visualisation menu: warning background and filespace background color. especially helpful for text items.
that means a few things to be added/changed before i finally will commit to allbest:

- two more color options (as mentioned above)
- clock with 12/24 h toggle (day time saving anyone? :D do you know if the internal canon clock can be set by chdk? i guess it is possible. i always forget to set clock according to winter/summer time in germany. i guess this will be added in a future release, along with date, day & internationa timezones)
- make jpge/raw counter available in script (Need help by a developer here, please)
 so many ideas. 

Re: a few enhancements, bugfixes
« Reply #46 on: 10 / March / 2008, 16:31:08 »
Deleted
« Last Edit: 22 / April / 2008, 13:38:23 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: a few enhancements, bugfixes
« Reply #47 on: 10 / March / 2008, 16:40:10 »
yeah, i left it there visible on purpose, to be able to time things precisely.
extra colors isnt much code, piece of cake :D
you can set DST in canon menu? on my a620, this isnt an option, unfortunately.


*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: a few enhancements, bugfixes
« Reply #48 on: 15 / March / 2008, 12:22:54 »
wow, two days off and allbest includes the code in official trunk, even though it isnt bugfree (yet). will publish fixed code so that it can be patched quickly (even though those are minor bugs - color fixes). thanks 2 all who helped along the way :)

*

Offline PhyrePhoX

  • *****
  • 2254
  • make RAW not WAR
    • PhyreWorX
Re: a few enhancements, bugfixes
« Reply #49 on: 16 / March / 2008, 06:30:22 »
okay i beefed up the clock. i added a new clock submenu to not clutter up osd menu.
you can now switch between seconds shown and hour format - 24h or 12 h.
as in 12h format AM/PM is added to the string, it is pretty long now, especially with seconds shown as well.
i COULD add a function that shows the day or the weeknumber, but that is a) not a very useful feature in my eyes (please provide reasons if you think otherwise) and b) not so easy to implement (12/24 h switch was easy).

edit: for 12/24h switch i took the "rules" of wikipedia: http://de.wikipedia.org/wiki/Ante_meridiem

edit: here is the diff.
against latest # of trunk (#330).
changed:
Quote
- added new color: file space icon BACKGROUND (easier reading with a dark transparent background).
- filespace icons & text now actually USE the defined colors.
- allbest made clock disappear when shutter half-press, i made it appear again
- added new clock submenu (will add DST or timezone later, in this menu)
- switch between 12/24h format of clock
the code for 12/24 h switch is ugly as hell, but it should be bugfree and functional.
will attach binaries for testing soon, but not now, as i want to test something else first, sorry.
edit3: attached binaries for a620 and s3is (maybe barney can test the color stuff, as he was the one who noticed the bug, and maybe he can also test the 12/24h switch, as he is a NA citizen and probably knows best the 12h clock's behaviour :D)
Code: (diff) [Select]
Index: lang/english.lng
===================================================================
--- lang/english.lng (revision 330)
+++ lang/english.lng (working copy)
@@ -405,4 +405,7 @@
 307 "  MB Treshold"

 308 "Warning Unit"

 309 "  Warning treshold"

-

+310 "Clock Settings->"

+311 "Clock Settings"

+312 "Clock format"

+313 "Remaining Space Background Color"

Index: lang/german.lng
===================================================================
--- lang/german.lng (revision 330)
+++ lang/german.lng (working copy)
@@ -428,3 +428,7 @@
 307 "  MB Untergrenze"

 308 " Einheit der Warnung"

 309 " Untergrenze Warnung"

+310 "UhrzeitEinstellungen->"

+311 "UhrzeitEinstellungen"

+312 "Uhrzeit Format"

+313 "Speicherplatz Hintergrund"

Index: include/conf.h
===================================================================
--- include/conf.h (revision 330)
+++ include/conf.h (working copy)
@@ -35,6 +35,7 @@
     int space_bar_width;
     int space_icon_show;
     int show_clock;
+    int clock_format;
     int space_perc_show;
     int space_mb_show;
     int space_perc_warn;

Index: core/gui_lang.c
===================================================================
--- core/gui_lang.c (revision 330)
+++ core/gui_lang.c (working copy)
@@ -390,6 +390,10 @@
 "307 \"  MB treshold\"\n"

 "308 \"Warning Unit\"\n"

 "309 \"  Warning treshold\"\n"

+"310 \"Clock Settings->\"\n"

+"311 \"Clock Settings\"\n"

+"312 \"Clock format\"\n"

+"313 \"Remaining Space Background Color\"\n"

 ;

 

 //-------------------------------------------------------------------

Index: core/conf.c
===================================================================
--- core/conf.c (revision 330)
+++ core/conf.c (working copy)
@@ -254,7 +254,7 @@
     CONF_INFO(129, conf.histo_show_ev_grid,  CONF_DEF_VALUE, i:0, NULL),
     
     CONF_INFO(130, conf.osd_color_warn,   CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_RED), NULL),
-    CONF_INFO(131, conf.space_color,        CONF_DEF_VALUE, cl:COLOR_WHITE, NULL),
+    CONF_INFO(131, conf.space_color,              CONF_DEF_VALUE, cl:MAKE_COLOR(COLOR_BG, COLOR_FG), NULL),
     CONF_INFO(132, conf.space_icon_show,         CONF_DEF_VALUE, i:1, NULL),
     CONF_INFO(133, conf.space_icon_pos,          CONF_DEF_PTR, ptr:&def_space_icon_pos, NULL),
     CONF_INFO(134, conf.space_perc_show,         CONF_DEF_VALUE, i:0, NULL),
@@ -279,6 +279,7 @@
     CONF_INFO(151, conf.space_mb_warn,        CONF_DEF_VALUE, i:20, NULL),
     CONF_INFO(152, conf.space_warn_type,         CONF_DEF_VALUE, i:0, NULL),
     CONF_INFO(153, conf.remaining_raw_treshold,             CONF_DEF_VALUE, i:0, NULL),
+    CONF_INFO(154, conf.clock_format,             CONF_DEF_VALUE, i:0, NULL),
 
 };
 #define CONF_NUM (sizeof(conf_info)/sizeof(conf_info[0]))
Index: core/gui_osd.c
===================================================================
--- core/gui_osd.c (revision 330)
+++ core/gui_osd.c (working copy)
@@ -802,11 +802,42 @@
     ttm = localtime(&t);
     if (conf.show_clock == 1)
     {
-    sprintf(osd_buf, "%2u:%02u", ttm->tm_hour, ttm->tm_min);
-    draw_string(conf.clock_pos.x, conf.clock_pos.y, osd_buf, conf.osd_color);
+        if (conf.clock_format == 0)
+        {
+            sprintf(osd_buf, "%2u:%02u", ttm->tm_hour, ttm->tm_min);
+            draw_string(conf.clock_pos.x, conf.clock_pos.y, osd_buf, conf.osd_color);
+        }
+        else
+        {
+        sprintf(osd_buf, "%2u:%02u AM", ttm->tm_hour, ttm->tm_min);
+        if ((ttm->tm_hour)==12)
+        {
+        sprintf(osd_buf, "%2u:%02u PM", ttm->tm_hour, ttm->tm_min);
+        }
+        if ((ttm->tm_hour)==00)
+        {
+        sprintf(osd_buf, "%2u:%02u AM", 12,ttm->tm_min);
+        }
+        if ((ttm->tm_hour)>12)
+        {
+        sprintf(osd_buf, "%2u:%02u PM", ttm->tm_hour-12, ttm->tm_min);
+        }
+       
+        if (conf.clock_pos.x<3*FONT_WIDTH)
+        {
+            draw_string(conf.clock_pos.x, conf.clock_pos.y, osd_buf, conf.osd_color);
+        }
+        else
+        {
+            draw_string(conf.clock_pos.x-3*FONT_WIDTH, conf.clock_pos.y, osd_buf, conf.osd_color);
+        }
+        }
+   
     }
     else if (conf.show_clock == 2)
     {
+        if (conf.clock_format == 0)
+        {
         sprintf(osd_buf, "%2u:%02u:%02u", ttm->tm_hour, ttm->tm_min,ttm->tm_sec);
         if (conf.clock_pos.x<3*FONT_WIDTH)
         {
@@ -816,8 +847,33 @@
         {
             draw_string(conf.clock_pos.x-3*FONT_WIDTH, conf.clock_pos.y, osd_buf, conf.osd_color);
         }
+        }
+        else
+        {
+        sprintf(osd_buf, "%2u:%02u:%02u AM", ttm->tm_hour, ttm->tm_min,ttm->tm_sec);
+        if ((ttm->tm_hour)==12)
+        {
+        sprintf(osd_buf, "%2u:%02u:%02u PM", ttm->tm_hour, ttm->tm_min,ttm->tm_sec);
+        }
+        if ((ttm->tm_hour)==00)
+        {
+        sprintf(osd_buf, "%2u:%02u:%02u AM", 12,ttm->tm_min,ttm->tm_sec);
+        }
+        if ((ttm->tm_hour)>12)
+        {
+        sprintf(osd_buf, "%2u:%02u:%02u PM", ttm->tm_hour-12, ttm->tm_min,ttm->tm_sec);
+        }
+       
+        if (conf.clock_pos.x<6*FONT_WIDTH)
+        {
+            draw_string(conf.clock_pos.x, conf.clock_pos.y, osd_buf, conf.osd_color);
+        }
+        else
+        {
+            draw_string(conf.clock_pos.x-6*FONT_WIDTH, conf.clock_pos.y, osd_buf, conf.osd_color);
+        }
     }
     
 }
-
+}
 //-------------------------------------------------------------------
Index: core/gui_lang.h
===================================================================
--- core/gui_lang.h (revision 330)
+++ core/gui_lang.h (working copy)
@@ -400,9 +400,14 @@
 #define LANG_MENU_SPACE_WARN_MB 307
 #define LANG_MENU_SPACE_WARN_TYPE 308
 #define LANG_MENU_OSD_RAW_TRESHOLD 309
+#define LANG_MENU_CLOCK_SETTINGS 310
+#define LANG_MENU_CLOCK_SETTINGS_TITLE 311
+#define LANG_MENU_OSD_CLOCK_FORMAT 312
+#define LANG_MENU_VIS_SPACE_ICON_BKG 313
 
+
 //-------------------------------------------------------------------
-#define GUI_LANG_ITEMS                  309
+#define GUI_LANG_ITEMS                  313
 
 //-------------------------------------------------------------------
 extern void gui_lang_init();
Index: core/gui_space.c
===================================================================
--- core/gui_space.c (revision 330)
+++ core/gui_space.c (working copy)
@@ -19,17 +19,17 @@
 
 static void gui_space_draw_spacebar_horizontal () {
     coord x;
-    color cl = conf.space_color&0xFF;
+    color cl = conf.space_color;
     int perc = get_space_perc(),height = 2;
     float size = 0;
     if (conf.space_warn_type == 0){
-    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);
+    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;
+    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
-    cl = conf.space_color&0xFF;
+    cl = conf.space_color;
     }
        // space icon / bar
     height = conf.space_bar_width+1;
@@ -72,17 +72,17 @@
 
 static void gui_space_draw_spacebar_vertical () {
     coord y;
-    color cl = conf.space_color&0xFF;
+    color cl = conf.space_color;
     int perc = get_space_perc(), width = 2;
     float size = 0;
     if (conf.space_warn_type == 0){
-    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);
+    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;
+    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
-    cl = conf.space_color&0xFF;
+    cl = conf.space_color;
     }
     
        // space icon / bar
@@ -127,16 +127,16 @@
 
 static void gui_space_draw_icon () {
     coord x;
-    color cl = conf.space_color&0xFF;
+    color cl = conf.space_color;
     int perc = get_space_perc();
     if (conf.space_warn_type == 0){
-    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);
+    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;
+    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
-    cl = conf.space_color&0xFF;
+    cl = conf.space_color;
     }
     int i;
     int le = 23;//length
@@ -177,15 +177,15 @@
 //-------------------------------------------------------------------
 static void gui_space_draw_percent(){
     int perc = get_space_perc();
-    color cl = conf.space_color&0xFF;
+    color cl = conf.space_color;
     if (conf.space_warn_type == 0){
-    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);
+    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;
+    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
-    cl = conf.space_color&0xFF;
+    cl = conf.space_color;
     }
     sprintf(osd_buf, "%3d%%", get_space_perc());
     osd_buf[5]=0;
@@ -195,15 +195,15 @@
 //-------------------------------------------------------------------
 static void gui_space_draw_mb() {
     int perc = get_space_perc();
-    color cl = conf.space_color&0xFF;
+    color cl = conf.space_color;
     if (conf.space_warn_type == 0){
-    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color&0xFF);
+    cl = (perc<=conf.space_perc_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 1){
-    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:conf.osd_color;
+    cl = (GetFreeCardSpaceKb()/1024<=conf.space_mb_warn)?conf.osd_color_warn:(conf.space_color);
     }
     if (conf.space_warn_type == 2){
-    cl = conf.space_color&0xFF;
+    cl = conf.space_color;
     }
   sprintf(osd_buf, "%3d%M",GetFreeCardSpaceKb()/1024 );
   osd_buf[5]=0;
Index: core/gui.c
===================================================================
--- core/gui.c (revision 330)
+++ core/gui.c (working copy)
@@ -161,6 +161,7 @@
 //static const char* gui_tv_enum(int change, int arg);
 const char* gui_user_menu_show_enum(int change, int arg);
 static const char* gui_show_clock_enum(int change, int arg);
+static const char* gui_clock_format_enum(int change, int arg);
 static const char* gui_space_bar_enum(int change, int arg);
 static const char* gui_space_bar_size_enum(int change, int arg);
 static const char* gui_space_bar_width_enum(int change, int arg);
@@ -337,6 +338,15 @@
 };
 static CMenu values_submenu = { LANG_MENU_OSD_VALUES_TITLE, /*cb_values_menu_change*/ NULL, values_submenu_items };
 
+
+static CMenuItem clock_submenu_items[] = {
+    {LANG_MENU_OSD_SHOW_CLOCK,          MENUITEM_ENUM,      (int*)gui_show_clock_enum },
+    {LANG_MENU_OSD_CLOCK_FORMAT,          MENUITEM_ENUM,      (int*)gui_clock_format_enum },
+   {LANG_MENU_BACK,                           MENUITEM_UP },
+    {0}
+};
+static CMenu clock_submenu = { LANG_MENU_CLOCK_SETTINGS_TITLE, NULL, clock_submenu_items };
+
 static CMenuItem video_submenu_items[] = {
    {LANG_MENU_VIDEO_MODE,              MENUITEM_ENUM,    (int*)gui_video_mode_enum},
       {LANG_MENU_VIDEO_BITRATE,           MENUITEM_ENUM,    (int*)gui_video_bitrate_enum},
@@ -430,6 +440,7 @@
     {LANG_MENU_VIS_ZEBRA_OVER,          MENUITEM_COLOR_FG,  (int*)&conf.zebra_color },
     {LANG_MENU_VIS_BATT_ICON,           MENUITEM_COLOR_FG,  (int*)&conf.batt_icon_color },
     {LANG_MENU_VIS_SPACE_ICON,           MENUITEM_COLOR_FG,  (int*)&conf.space_color },
+    {LANG_MENU_VIS_SPACE_ICON_BKG,           MENUITEM_COLOR_BG,  (int*)&conf.space_color },
     {LANG_MENU_VIS_MENU_TEXT,           MENUITEM_COLOR_FG,  (int*)&conf.menu_color },
     {LANG_MENU_VIS_MENU_BKG,            MENUITEM_COLOR_BG,  (int*)&conf.menu_color },
     {LANG_MENU_VIS_READER_TEXT,         MENUITEM_COLOR_FG,  (int*)&conf.reader_color },
@@ -463,8 +474,7 @@
     {LANG_MENU_USER_MENU,      MENUITEM_SUBMENU,   (int*)&user_submenu},
     {LANG_MENU_USER_MENU_ENABLE, MENUITEM_ENUM,      (int*)gui_user_menu_show_enum },
     {LANG_MENU_OSD_SHOW_STATES,         MENUITEM_BOOL,      &conf.show_state },
-   
-    {LANG_MENU_OSD_SHOW_CLOCK,          MENUITEM_ENUM,      (int*)gui_show_clock_enum },
+    {LANG_MENU_CLOCK_SETTINGS,      MENUITEM_SUBMENU,   (int*)&clock_submenu },
     {LANG_MENU_OSD_LAYOUT_EDITOR,       MENUITEM_PROC,      (int*)gui_draw_osd_le },
     {LANG_MENU_OSD_VALUES,      MENUITEM_SUBMENU,   (int*)&values_submenu },
     {LANG_MENU_OSD_DOF_CALC,            MENUITEM_SUBMENU,   (int*)&dof_submenu },
@@ -821,6 +831,18 @@
     return modes[conf.show_clock];
 }
 
+const char* gui_clock_format_enum(int change, int arg) {
+    static const char* modes[]={ "24h", "12h"};
+
+    conf.clock_format+=change;
+    if (conf.clock_format<0)
+        conf.clock_format=(sizeof(modes)/sizeof(modes[0]))-1;
+    else if (conf.clock_format>=(sizeof(modes)/sizeof(modes[0])))
+        conf.clock_format=0;
+
+    return modes[conf.clock_format];
+}
+
 const char* gui_space_bar_enum(int change, int arg) {
     static const char* modes[]={ "Don't", "Horizontal", "Vertical"};
 
@@ -1765,7 +1787,7 @@
         gui_space_draw_osd();
     }
     
-    if ((conf.show_clock) && (recreview_hold==0) &&  (!kbd_is_key_pressed(KEY_SHOOT_HALF))) {
+    if ((conf.show_clock) && (recreview_hold==0)) {
         gui_osd_draw_clock();
     }
 

edit: attached diff :)
« Last Edit: 16 / March / 2008, 07:42:20 by PhyrePhoX »

 

Related Topics