always save the config on exit

SVN revision: 52236
This commit is contained in:
Viktor Kojouharov 2010-09-14 07:02:04 +00:00
parent cbdc82096b
commit 1dcf8aef39
4 changed files with 11 additions and 5 deletions

View File

@ -33,7 +33,7 @@ void ephoto_create_main_window(const char *directory, const char *image);
/* Configuration */ /* Configuration */
Eina_Bool ephoto_config_init(Ephoto *em); Eina_Bool ephoto_config_init(Ephoto *em);
void ephoto_config_save(Ephoto *em); void ephoto_config_save(Ephoto *em, Eina_Bool instant);
void ephoto_config_free(Ephoto *em); void ephoto_config_free(Ephoto *em);
/*Ephoto Flow Browser*/ /*Ephoto Flow Browser*/

View File

@ -39,16 +39,20 @@ ephoto_config_init(Ephoto *em)
default: default:
return EINA_TRUE; return EINA_TRUE;
} }
ephoto_config_save(em); ephoto_config_save(em, EINA_FALSE);
return EINA_TRUE; return EINA_TRUE;
} }
void void
ephoto_config_save(Ephoto *em) ephoto_config_save(Ephoto *em, Eina_Bool instant)
{ {
if (em->config_save) if (em->config_save)
ecore_timer_del(em->config_save); ecore_timer_del(em->config_save);
em->config_save = ecore_timer_add(5, _ephoto_on_config_save, em);
if (instant)
_ephoto_on_config_save(em);
else
em->config_save = ecore_timer_add(5, _ephoto_on_config_save, em);
} }
void void

View File

@ -126,6 +126,8 @@ ephoto_create_main_window(const char *directory, const char *image)
static void static void
_ephoto_delete_main_window(void *data, Evas_Object *obj, void *event_info) _ephoto_delete_main_window(void *data, Evas_Object *obj, void *event_info)
{ {
ephoto_config_save(em, EINA_TRUE);
if (em->thumb_browser) if (em->thumb_browser)
evas_object_del(em->thumb_browser); evas_object_del(em->thumb_browser);
if (em->flow_browser) if (em->flow_browser)

View File

@ -267,7 +267,7 @@ _ephoto_slider_changed(void *data, Evas_Object *obj, void *event)
elm_gengrid_item_size_set(tb->thumb_browser, val, val / THUMB_RATIO); elm_gengrid_item_size_set(tb->thumb_browser, val, val / THUMB_RATIO);
em->config->thumb_size = val; em->config->thumb_size = val;
ephoto_config_save(em); ephoto_config_save(em, EINA_FALSE);
} }
/*Callback when the client is connected*/ /*Callback when the client is connected*/