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 */
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);
/*Ephoto Flow Browser*/

View File

@ -39,16 +39,20 @@ ephoto_config_init(Ephoto *em)
default:
return EINA_TRUE;
}
ephoto_config_save(em);
ephoto_config_save(em, EINA_FALSE);
return EINA_TRUE;
}
void
ephoto_config_save(Ephoto *em)
ephoto_config_save(Ephoto *em, Eina_Bool instant)
{
if (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

View File

@ -126,6 +126,8 @@ ephoto_create_main_window(const char *directory, const char *image)
static void
_ephoto_delete_main_window(void *data, Evas_Object *obj, void *event_info)
{
ephoto_config_save(em, EINA_TRUE);
if (em->thumb_browser)
evas_object_del(em->thumb_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);
em->config->thumb_size = val;
ephoto_config_save(em);
ephoto_config_save(em, EINA_FALSE);
}
/*Callback when the client is connected*/