mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
plugins: clock: remove messages when starting/quitting
- When loading or saving clock settings, only show message if an error occurred - Eliminate error message that was displayed when clock settings file didn't exist (yet). Change-Id: I6d9c646d3895dba1f18ef3c2f9e73fa15fbc2c1c
This commit is contained in:
parent
2d00292df5
commit
ab161a3d89
1 changed files with 32 additions and 39 deletions
|
@ -156,59 +156,52 @@ static void draw_message(struct screen* display, int msg, int y){
|
|||
(message->slide_height*y));
|
||||
}
|
||||
|
||||
void load_settings(void){
|
||||
void load_settings(void)
|
||||
{
|
||||
struct screen* display;
|
||||
FOR_NB_SCREENS(i){
|
||||
enum settings_file_status load_status = LOADED;
|
||||
|
||||
if (rb->file_exists(settings_filename))
|
||||
load_status = clock_settings_load(&clock_settings, settings_filename);
|
||||
else
|
||||
clock_settings_reset(&clock_settings);
|
||||
|
||||
if (load_status != LOADED)
|
||||
{
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
display = rb->screens[i];
|
||||
display->clear_display();
|
||||
draw_logo(display);
|
||||
draw_message(display, MESSAGE_LOADING, 1);
|
||||
display->update();
|
||||
}
|
||||
|
||||
enum settings_file_status load_status=
|
||||
clock_settings_load(&clock_settings, settings_filename);
|
||||
|
||||
FOR_NB_SCREENS(i){
|
||||
display=rb->screens[i];
|
||||
if(load_status==LOADED)
|
||||
draw_message(display, MESSAGE_LOADED, 1);
|
||||
else
|
||||
draw_message(display, MESSAGE_ERRLOAD, 1);
|
||||
display->update();
|
||||
}
|
||||
rb->storage_sleep();
|
||||
rb->sleep(HZ);
|
||||
}
|
||||
rb->storage_sleep();
|
||||
}
|
||||
|
||||
void save_settings(void){
|
||||
void save_settings(void)
|
||||
{
|
||||
struct screen* display;
|
||||
if(!settings_needs_saving(&clock_settings))
|
||||
return;
|
||||
enum settings_file_status save_status = SAVED;
|
||||
|
||||
FOR_NB_SCREENS(i){
|
||||
if (settings_needs_saving(&clock_settings))
|
||||
save_status = clock_settings_save(&clock_settings, settings_filename);
|
||||
|
||||
if (save_status != SAVED)
|
||||
{
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
display = rb->screens[i];
|
||||
display->clear_display();
|
||||
draw_logo(display);
|
||||
|
||||
draw_message(display, MESSAGE_SAVING, 1);
|
||||
|
||||
display->update();
|
||||
}
|
||||
enum settings_file_status load_status=
|
||||
clock_settings_save(&clock_settings, settings_filename);
|
||||
|
||||
FOR_NB_SCREENS(i){
|
||||
display=rb->screens[i];
|
||||
|
||||
if(load_status==SAVED)
|
||||
draw_message(display, MESSAGE_SAVED, 1);
|
||||
else
|
||||
draw_message(display, MESSAGE_ERRSAVE, 1);
|
||||
display->update();
|
||||
}
|
||||
rb->sleep(HZ);
|
||||
}
|
||||
}
|
||||
|
||||
void save_settings_wo_gui(void){
|
||||
clock_settings_save(&clock_settings, settings_filename);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue