summaryrefslogtreecommitdiff
path: root/apps/menus/main_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus/main_menu.c')
-rw-r--r--apps/menus/main_menu.c69
1 files changed, 8 insertions, 61 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index ea223d9702..5231181296 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -131,46 +131,17 @@ struct info_data
131enum infoscreenorder 131enum infoscreenorder
132{ 132{
133 INFO_VERSION = 0, 133 INFO_VERSION = 0,
134 INFO_GAP1,
135#if CONFIG_RTC 134#if CONFIG_RTC
136 INFO_TIME, 135 INFO_TIME,
137 INFO_DATE, 136 INFO_DATE,
138 INFO_GAP2,
139#endif 137#endif
140 INFO_BUFFER, 138 INFO_BUFFER,
141 INFO_BATTERY, 139 INFO_BATTERY,
142 INFO_DISK1, /* capacity or internal capacity/free on hotswap */ 140 INFO_DISK1, /* capacity or internal capacity/free on hotswap */
143 INFO_DISK2, /* free space or external capacity/free on hotswap */ 141 INFO_DISK2, /* free space or external capacity/free on hotswap */
144 INFO_COUNT 142 INFO_COUNT
145}; 143};
146#if CONFIG_RTC
147const int dayname[] =
148{
149 LANG_WEEKDAY_SUNDAY,
150 LANG_WEEKDAY_MONDAY,
151 LANG_WEEKDAY_TUESDAY,
152 LANG_WEEKDAY_WEDNESDAY,
153 LANG_WEEKDAY_THURSDAY,
154 LANG_WEEKDAY_FRIDAY,
155 LANG_WEEKDAY_SATURDAY
156};
157 144
158const int monthname[] =
159{
160 LANG_MONTH_JANUARY,
161 LANG_MONTH_FEBRUARY,
162 LANG_MONTH_MARCH,
163 LANG_MONTH_APRIL,
164 LANG_MONTH_MAY,
165 LANG_MONTH_JUNE,
166 LANG_MONTH_JULY,
167 LANG_MONTH_AUGUST,
168 LANG_MONTH_SEPTEMBER,
169 LANG_MONTH_OCTOBER,
170 LANG_MONTH_NOVEMBER,
171 LANG_MONTH_DECEMBER
172};
173#endif
174static char* info_getname(int selected_item, void *data, char *buffer) 145static char* info_getname(int selected_item, void *data, char *buffer)
175{ 146{
176 struct info_data *info = (struct info_data*)data; 147 struct info_data *info = (struct info_data*)data;
@@ -204,11 +175,6 @@ static char* info_getname(int selected_item, void *data, char *buffer)
204 snprintf(buffer, MAX_PATH, "%s: %s", 175 snprintf(buffer, MAX_PATH, "%s: %s",
205 str(LANG_VERSION), appsversion); 176 str(LANG_VERSION), appsversion);
206 break; 177 break;
207 case INFO_GAP1:
208#if CONFIG_RTC
209 case INFO_GAP2:
210#endif
211 return "";
212#if CONFIG_RTC 178#if CONFIG_RTC
213 case INFO_TIME: 179 case INFO_TIME:
214 tm = get_time(); 180 tm = get_time();
@@ -220,11 +186,10 @@ static char* info_getname(int selected_item, void *data, char *buffer)
220 break; 186 break;
221 case INFO_DATE: 187 case INFO_DATE:
222 tm = get_time(); 188 tm = get_time();
223 snprintf(buffer, MAX_PATH, "%s %d %s %d", 189 snprintf(buffer, MAX_PATH, "%s %d %d",
224 str(dayname[tm->tm_wday]), 190 str(LANG_MONTH_JANUARY + tm->tm_mon),
225 tm->tm_year+1900, 191 tm->tm_mday,
226 str(monthname[tm->tm_mon]), 192 tm->tm_year+1900);
227 tm->tm_mday);
228 break; 193 break;
229#endif 194#endif
230 case INFO_BUFFER: /* buffer */ 195 case INFO_BUFFER: /* buffer */
@@ -379,30 +344,12 @@ static int info_action_callback(int action, struct gui_synclist *lists)
379#ifdef HAVE_MULTIVOLUME 344#ifdef HAVE_MULTIVOLUME
380 if (fat_ismounted(1)) 345 if (fat_ismounted(1))
381 fat_recalc_free(1); 346 fat_recalc_free(1);
382#endif 347#endif
348#else
349 (void) lists;
383#endif 350#endif
384 return ACTION_REDRAW; 351 return ACTION_REDRAW;
385 } 352 }
386 else if (lists->gui_list[SCREEN_MAIN].show_selection_marker == true)
387 {
388 if (lists->gui_list[SCREEN_MAIN].selected_item == INFO_GAP1
389#if CONFIG_RTC
390 || lists->gui_list[SCREEN_MAIN].selected_item == INFO_GAP2
391#endif
392 )
393 {
394 if (action == ACTION_STD_PREV)
395 {
396 gui_synclist_select_item(lists, lists->gui_list[SCREEN_MAIN].selected_item-1);
397 return ACTION_REDRAW;
398 }
399 else if (action == ACTION_STD_NEXT)
400 {
401 gui_synclist_select_item(lists, lists->gui_list[SCREEN_MAIN].selected_item+1);
402 return ACTION_REDRAW;
403 }
404 }
405 }
406 return action; 353 return action;
407} 354}
408static bool show_info(void) 355static bool show_info(void)