diff --git a/apps/plugins/clock/clock.c b/apps/plugins/clock/clock.c index 06e7e1e127..7fa9a3c2f2 100644 --- a/apps/plugins/clock/clock.c +++ b/apps/plugins/clock/clock.c @@ -65,7 +65,6 @@ const struct button_mapping* plugin_contexts[]={ *************************/ static void cleanup(void) { - clock_draw_restore_colors(); if(clock_settings.general.save_settings == 1) save_settings(); @@ -181,7 +180,6 @@ enum plugin_status plugin_start(const void* parameter){ break; #endif case ACTION_MENU: - clock_draw_restore_colors(); FOR_NB_SCREENS(i) rb->viewportmanager_theme_enable(i, true, NULL); exit_clock=main_menu(); @@ -198,7 +196,8 @@ enum plugin_status plugin_start(const void* parameter){ break; } - if(redraw){ + if (redraw && !exit_clock) + { clock_draw_set_colors(); FOR_NB_SCREENS(i) clock_draw(rb->screens[i], &time, &counter); diff --git a/apps/plugins/clock/clock_draw.c b/apps/plugins/clock/clock_draw.c index ac1722c8c5..12f39a2d65 100644 --- a/apps/plugins/clock/clock_draw.c +++ b/apps/plugins/clock/clock_draw.c @@ -64,11 +64,6 @@ static void skin_set_background(struct screen* display, int mode, int skin){ white_background(display); } -static void skin_restore_background(struct screen* display, int mode, int skin){ - if(skin_require_black_background(mode, skin) ) - white_background(display); -} - void clock_draw_set_colors(void){ FOR_NB_SCREENS(i) skin_set_background(rb->screens[i], @@ -76,15 +71,6 @@ void clock_draw_set_colors(void){ clock_settings.skin[clock_settings.mode]); } -void clock_draw_restore_colors(void){ - FOR_NB_SCREENS(i){ - skin_restore_background(rb->screens[i], - clock_settings.mode, - clock_settings.skin[clock_settings.mode]); - rb->screens[i]->update(); - } -} - void clock_draw(struct screen* display, struct time* time, struct counter* counter){ if(!show_counter) diff --git a/apps/plugins/clock/clock_settings.c b/apps/plugins/clock/clock_settings.c index 7631663e41..11d4fae343 100644 --- a/apps/plugins/clock/clock_settings.c +++ b/apps/plugins/clock/clock_settings.c @@ -58,11 +58,25 @@ static bool settings_needs_saving(struct clock_settings* settings){ void clock_settings_reset(struct clock_settings* settings){ settings->mode = ANALOG; - int i; - for(i=0;iskin[i]=0; - } settings->general.date_format = EUROPEAN; + settings->skin[ANALOG] = 1; /* round */ + settings->skin[DIGITAL] = 1; /* LCD-style */ + settings->skin[BINARY] = 2; /* LCD-style */ + for (const char *ptr = rb->str(LANG_VOICED_DATE_FORMAT) ; *ptr; ptr++) + { + if (*ptr == 'd') + break; + else if (*ptr == 'Y') + { + settings->general.date_format = JAPANESE; + break; + } + else if (*ptr == 'A' || *ptr == 'm') + { + settings->general.date_format = ENGLISH; + break; + } + } settings->general.save_settings = true; settings->general.idle_poweroff=true; settings->general.backlight = ROCKBOX_SETTING; diff --git a/manual/plugins/clock.tex b/manual/plugins/clock.tex index 16220792df..d444b4272c 100644 --- a/manual/plugins/clock.tex +++ b/manual/plugins/clock.tex @@ -1,7 +1,8 @@ \subsection{Clock} \screenshot{plugins/images/ss-clock}{Clock}{img:clock} -This is a fully featured analogue and digital clock plugin. +Clock with an analog, digital, and binary mode. +Includes a handy timer and can show the current date. \subsubsection{Key configuration} @@ -13,92 +14,63 @@ This is a fully featured analogue and digital clock plugin. \nopt{IPOD_4G_PAD,IPOD_3G_PAD}{\PluginUp{} / \PluginDown} \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\PluginDown} \opt{HAVEREMOTEKEYMAP}{& \PluginRCUp{} / \PluginRCDown} - & Cycle through skins \\ + & Cycle through different skins in each mode \\ + + \PluginSelect + \opt{HAVEREMOTEKEYMAP}{& \PluginRCSelect} + & Start or stop timer (visible in analog or digital mode) \\ + + \PluginSelectRepeat + \opt{HAVEREMOTEKEYMAP}{& \PluginRCSelectRepeat} + & Reset and hide the timer \\ \nopt{IPOD_4G_PAD,IPOD_3G_PAD}{\PluginCancel} \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu} \opt{HAVEREMOTEKEYMAP}{& \PluginRCCancel} - & Main Menu \\ - - \PluginSelect - \opt{HAVEREMOTEKEYMAP}{& \PluginRCSelect} - & Start / Stop Counter \\ - - \PluginSelectRepeat - \opt{HAVEREMOTEKEYMAP}{& \PluginRCSelectRepeat} - & Reset Counter \\ + & Open Clock menu \\ \end{btnmap} \textbf{Clock Menu} \begin{description} -\item[View Clock] Exits the menu and returns to the current clock mode display. -\item[Mode Selector] Opens a menu from which you can select a clock mode to view. -\item[Counter Settings] Opens a menu from which you can adjust settings - pertaining to the counter. -\item[Mode Settings] Opens a menu from which you can adjust settings pertaining to - the current clock mode (analog, digital, binary). -\item[General Settings] +\item[Mode] Select analog, digital, or binary mode. +\item[Settings] \begin{description} - \item[Reset Settings] - Reset all settings to their default values. + \item[Analog] Adjust settings pertaining to the analog mode. + \item[Digital] Adjust settings pertaining to the digital mode. + \item[Date Format] + Switch between formatting used in the United States (M-D-Y), Europe (D-M-Y), and Japan (Y-M-D). + \item[Backlight] + Keep backlight turned off, on, or have it respect the system setting. + \item[Idle Poweroff] + Temporarily enable or disable Idle Poweroff while the plugin is running. + \item[Save On Exit] + Save settings to disk when the plugin is quit (enabled by default). \item[Save Settings] Save all settings to disk. - \item[Show Counter] - Toggle Counter display. - \item[Save] - Choose whether to disable automatic saving, saving to disk on exit, or - saving to disk every settings change. - \item[Backlight] - Choose whether to disable the backlight, use the user's timeout setting, - or keep the backlight on. - \item[Idle Poweroff] - Toggle Idle Poweroff. - \note{This setting is not saved to disk.} + \item[Reset Settings] + Reset all settings to their default values. \end{description} -\item[Help] Opens a brief help screen with key mappings and functionality. -\item[Credits] Displays a credits roll. +\item[Playback Control] Show the playback control menu. +\item[Quit] Quit the plugin. \end{description} -\subsubsection{Analog mode} -Small, round, analog clock is displayed in the middle of the LCD. -Time readout, if enabled, is displayed at the upper left. -If Time readout is in 12-hour (``12h'') mode, AM or PM will be displayed at the -upper right. The Date readout, if enabled, is displayed at the lower left. -The Counter, if enabled, is displayed at the lower right. -The second hand, if enabled, is displayed along with the hour and minute hands. -Digit display, if enabled, places ``12'', ``3'', ``6'', and ``9'' around the -face of the clock in their respective positions. +\subsubsection{Analog} +In analog mode, you can switch between two skins: One is round, the other square. +Both the second hand and the border can be hidden by going into Settings. +You can also choose to display the current date in the lower left corner. +Any running timer will appear in the lower right corner. -\subsubsection{Digital mode} -An imitation of an LCD, this mode shows a Clock comprised of digital ``segments''. -The Date readout, if enabled, is displayed at the bottom, center. -The Second readout, if in ``Text'' mode, is displayed at the top, center; if in -``Bar'' mode, is displayed as a progress bar at the top of the LCD; if in -``Invert'' mode, will invert the LCD left-to-right as the seconds pass (a -fully-inverted LCD means the entire minute has passed). -The Counter, if displayed, is shown at the upper left. -The Blinking Colon, if enabled, blinks the colon once every second. -12-hour mode, if enabled, will display the time in a 12-hour format. -\subsubsection{LCD mode} -Based on the Digital Mode, the LCD mode is another imitation of an LCD. -The settings available in this mode are exactly the same as Digital Mode, but -they are independent of Digital Mode. For example, you can have the Date -Readout enabled in Digital Mode and disabled in LCD Mode. +\subsubsection{Digital} +Digital mode imitates a segmented LCD by default. A plain display style is +also available, by switching to a different skin. +The current date is displayed on the bottom, unless it is disabled. +You can hide seconds, or make the colon blink once every second. +Any running timer will appear on the bottom. -\subsubsection{Fullscreen} -A Fullscreen clock is displayed. Show Border, if enabled, will draw a small -box at every hour position (1 to 12 inclusive). -Invert Seconds, if enabled, will invert the LCD as the seconds pass. -Second Hand, if enabled, will draw a second hand among the hour and minute hands. - -\subsubsection{Binary mode} -This mode shows a Binary clock. -The hour is displayed on the top line, the minute is displayed on the middle -line, and the seconds are on the last line. -Circle mode, if enabled, draws empty and full circles, instead of zeros and ones. +\subsubsection{Binary} +Binary mode can either display ones and zeros, or filled and empty circles, depending +on your chosen skin. The default binary skin imitates a segmented LCD. +The three rows show hours on top, followed by minutes, then seconds. For help on reading binary, please visit: \url{http://en.wikipedia.org/wiki/Binary_numeral_system} - -\subsubsection{Plain mode} -This mode shows a ``plain'' clock in large text that takes up nearly the whole LCD.