summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-04-15 22:16:28 +0000
committerJens Arnold <amiconn@rockbox.org>2007-04-15 22:16:28 +0000
commitce05addf52ed784026d9ca8397f3c2e239ff9ed4 (patch)
tree2371e53a613848849ed7ada266b92c26fb3542d2 /apps/settings.c
parent49cf05cb91c9160b79323bb8c798604b3cd8e2f2 (diff)
downloadrockbox-ce05addf52ed784026d9ca8397f3c2e239ff9ed4.zip
rockbox-ce05addf52ed784026d9ca8397f3c2e239ff9ed4.tar.gz
rockbox-ce05addf52ed784026d9ca8397f3c2e239ff9ed4.tar.bz2
rockbox-ce05addf52ed784026d9ca8397f3c2e239ff9ed4.tar.xz
Revert recording/repeat timer for now. It is useful as a feature, but didn't receive enough testing on multiple targets, and fixing it is non-trivial. Later reversal would be complicated because of .lng spreading. * The patch should probably redone in a different way, as it's huge for what it does... * Issues: (1) The repeat timer setting has NULL pointer hits. (2) The multi-int setting screen breaks with proportional fonts, and with somewhat larger fonts. (3) On some targets, all values except the leftmost one are unreachable. * Hint: The timer itself would be much simpler if it'd just store & compare ticks (497 days before it wraps).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13172 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c188
1 files changed, 0 insertions, 188 deletions
diff --git a/apps/settings.c b/apps/settings.c
index e8963b0..23b8117 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -1245,194 +1245,6 @@ bool set_int(const unsigned char* string,
return set_int_ex(string, unit, voice_unit, variable, function,
step, min, max, formatter, NULL);
}
-
-/* Useful for time and other multi integer settings */
-bool set_multi_int(const char* string,
- const struct opt_items * names,
- struct opt_settings * variable,
- int varcount,
- bool *changes_accepted)
-{
- int i, j, w, h;
- char buf[32];
- long button;
- int cursor = 0;
- bool done = false;
- int value[varcount];
- int pos = 0;
-
- /* store current values in temp array */
- for(j = 0; j < varcount; j++)
- value[j] = *(int*)variable[j].setting;
-
- /* initialize screen */
- FOR_NB_SCREENS(i)
- {
- screens[i].clear_display();
-#ifdef HAVE_LCD_BITMAP
- screens[i].setmargins(0, 8);
-#endif
- }
-
- gui_syncstatusbar_draw(&statusbars, true);
-
- FOR_NB_SCREENS(i)
- screens[i].getstringsize("3", &w, &h);
-
- /* print title */
- snprintf(buf, sizeof(buf), "%s", string);
- FOR_NB_SCREENS(i)
- screens[i].puts(0, 0, buf);
-
- /* print variable names */
- for(j = 0; j < varcount ; j++)
- {
- if (j > 0)
- {
- snprintf(buf, sizeof(buf), ":");
- FOR_NB_SCREENS(i)
- screens[i].puts(pos - 2, 1, buf);
- }
-
- snprintf(buf, sizeof(buf), "%s", P2STR(names[j].string));
- FOR_NB_SCREENS(i)
- screens[i].puts(pos, 1, buf);
-
- pos += strlen(buf) + 3;
- }
-
- /* print button instructions */
- snprintf(buf, sizeof(buf), "%s", str(LANG_MULTIINT_CONFIRM));
- FOR_NB_SCREENS(i)
- screens[i].puts(0, 5, buf);
-
- while(!done)
- {
- pos = 0;
-
- /* print variables */
- for(j = 0; j < varcount; j++)
- {
- if (j > 0)
- {
- snprintf(buf, sizeof(buf), " :");
- FOR_NB_SCREENS(i)
- screens[i].puts(pos - 3, 3, buf);
- }
-
- snprintf(buf, sizeof(buf), "%d", value[j]);
-
- FOR_NB_SCREENS(i)
- screens[i].puts(pos, 3, buf);
-
- snprintf(buf, sizeof(buf), "%d", variable[j].setting_max);
-
-#ifdef HAVE_LCD_BITMAP
- /* highlight currently selected integer */
- if (cursor == j)
- {
- FOR_NB_SCREENS(i)
- {
- screens[i].set_drawmode(DRMODE_COMPLEMENT);
- screens[i].fillrect(pos * w - 1, 8 + 3 * h,
- strlen(buf)*w + 1, h);
- screens[i].set_drawmode(DRMODE_SOLID);
- }
- }
-#endif
-
- pos += strlen(buf) + 3;
- }
-
-#ifdef HAVE_LCD_BITMAP
- FOR_NB_SCREENS(i)
- screens[i].update();
-#endif
-
- button = get_action(CONTEXT_SETTINGS, TIMEOUT_BLOCK);
-
- switch (button)
- {
- case ACTION_STD_NEXT:
- cursor ++;
-
- if (cursor >= varcount)
- cursor = varcount - 1;
-
- if (global_settings.talk_menu)
- talk_id(names[cursor].voice_id, false);
- break;
-
- case ACTION_STD_PREV:
- /* cancel if pressing left when cursor
- is already at the far left */
- if (cursor == 0)
- {
- *changes_accepted = false;
- gui_syncsplash(HZ/2, str(LANG_MENU_SETTING_CANCEL));
- done = true;
- }
- else
- {
- cursor --;
-
- if (cursor < 0)
- cursor = 0;
-
- if (global_settings.talk_menu)
- talk_id(names[cursor].voice_id, false);
- }
- break;
-
- case ACTION_SETTINGS_INC:
- case ACTION_SETTINGS_INCREPEAT:
- value[cursor] += 1;
-
- if (value[cursor] > variable[cursor].setting_max)
- value[cursor] = 0;
-
- if (global_settings.talk_menu)
- talk_unit(INT, value[cursor], NULL);
- break;
-
- case ACTION_SETTINGS_DEC:
- case ACTION_SETTINGS_DECREPEAT:
- value[cursor] -= 1;
-
- if (value[cursor] < 0)
- value[cursor] = variable[cursor].setting_max;
-
- if (global_settings.talk_menu)
- talk_unit(INT, value[cursor], NULL);
- break;
-
- case ACTION_STD_OK:
- *changes_accepted = true;
- done = true;
- break;
-
- case ACTION_STD_CANCEL:
- *changes_accepted = false;
- gui_syncsplash(HZ/2, str(LANG_MENU_SETTING_CANCEL));
- done = true;
-
- default:
- if (default_event_handler(button) == SYS_USB_CONNECTED)
- return true;
- }
- }
- /* store values if accepted */
- if(*changes_accepted)
- {
- for(j = 0; j < varcount; j++)
- *(int*)variable[j].setting = value[j];
- }
-
- action_signalscreenchange();
-
- return false;
-}
-
/* NOTE: the 'type' parameter specifies the actual type of the variable
that 'variable' points to. not the value within. Only variables with
type 'bool' should use parameter BOOL.