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,58 +156,51 @@ static void draw_message(struct screen* display, int msg, int y){
|
||||||
(message->slide_height*y));
|
(message->slide_height*y));
|
||||||
}
|
}
|
||||||
|
|
||||||
void load_settings(void){
|
void load_settings(void)
|
||||||
|
{
|
||||||
struct screen* display;
|
struct screen* display;
|
||||||
FOR_NB_SCREENS(i){
|
enum settings_file_status load_status = LOADED;
|
||||||
display=rb->screens[i];
|
|
||||||
display->clear_display();
|
|
||||||
draw_logo(display);
|
|
||||||
draw_message(display, MESSAGE_LOADING, 1);
|
|
||||||
display->update();
|
|
||||||
}
|
|
||||||
|
|
||||||
enum settings_file_status load_status=
|
if (rb->file_exists(settings_filename))
|
||||||
clock_settings_load(&clock_settings, settings_filename);
|
load_status = clock_settings_load(&clock_settings, settings_filename);
|
||||||
|
else
|
||||||
|
clock_settings_reset(&clock_settings);
|
||||||
|
|
||||||
FOR_NB_SCREENS(i){
|
if (load_status != LOADED)
|
||||||
display=rb->screens[i];
|
{
|
||||||
if(load_status==LOADED)
|
FOR_NB_SCREENS(i)
|
||||||
draw_message(display, MESSAGE_LOADED, 1);
|
{
|
||||||
else
|
display = rb->screens[i];
|
||||||
|
display->clear_display();
|
||||||
|
draw_logo(display);
|
||||||
draw_message(display, MESSAGE_ERRLOAD, 1);
|
draw_message(display, MESSAGE_ERRLOAD, 1);
|
||||||
display->update();
|
display->update();
|
||||||
|
}
|
||||||
|
rb->sleep(HZ);
|
||||||
}
|
}
|
||||||
rb->storage_sleep();
|
rb->storage_sleep();
|
||||||
rb->sleep(HZ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void save_settings(void){
|
void save_settings(void)
|
||||||
|
{
|
||||||
struct screen* display;
|
struct screen* display;
|
||||||
if(!settings_needs_saving(&clock_settings))
|
enum settings_file_status save_status = SAVED;
|
||||||
return;
|
|
||||||
|
|
||||||
FOR_NB_SCREENS(i){
|
if (settings_needs_saving(&clock_settings))
|
||||||
display=rb->screens[i];
|
save_status = clock_settings_save(&clock_settings, settings_filename);
|
||||||
display->clear_display();
|
|
||||||
draw_logo(display);
|
|
||||||
|
|
||||||
draw_message(display, MESSAGE_SAVING, 1);
|
if (save_status != SAVED)
|
||||||
|
{
|
||||||
display->update();
|
FOR_NB_SCREENS(i)
|
||||||
}
|
{
|
||||||
enum settings_file_status load_status=
|
display = rb->screens[i];
|
||||||
clock_settings_save(&clock_settings, settings_filename);
|
display->clear_display();
|
||||||
|
draw_logo(display);
|
||||||
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);
|
draw_message(display, MESSAGE_ERRSAVE, 1);
|
||||||
display->update();
|
display->update();
|
||||||
|
}
|
||||||
|
rb->sleep(HZ);
|
||||||
}
|
}
|
||||||
rb->sleep(HZ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void save_settings_wo_gui(void){
|
void save_settings_wo_gui(void){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue