aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ephoto_slideshow.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ephoto_slideshow.c')
-rw-r--r--src/bin/ephoto_slideshow.c43
1 files changed, 32 insertions, 11 deletions
diff --git a/src/bin/ephoto_slideshow.c b/src/bin/ephoto_slideshow.c
index def6d2b..8695446 100644
--- a/src/bin/ephoto_slideshow.c
+++ b/src/bin/ephoto_slideshow.c
@@ -385,7 +385,7 @@ _on_transition_end(void *data, Evas_Object *obj EINA_UNUSED,
if (!ss->ephoto->gadget)
ss->timeout = ss->ephoto->config->slideshow_timeout;
else
- ss->timeout = ss->ephoto->gci->slideshow_timeout;
+ ss->timeout = ss->ephoto->gadget_config->slideshow_timeout;
if (ss->timer)
ecore_timer_del(ss->timer);
ss->timer = NULL;
@@ -812,9 +812,9 @@ _gadget_settings_save(void *data, Evas_Object *obj EINA_UNUSED,
fentry = evas_object_data_get(popup, "fentry");
spinner = evas_object_data_get(popup, "timeout");
- ss->ephoto->gci->slideshow_timeout = elm_spinner_value_get(spinner);
+ ss->ephoto->gadget_config->slideshow_timeout = elm_spinner_value_get(spinner);
path = elm_fileselector_path_get(fentry);
- eina_stringshare_replace(&ss->ephoto->gci->directory, path);
+ eina_stringshare_replace(&ss->ephoto->gadget_config->directory, path);
if (ecore_file_is_dir(path))
ephoto_directory_set(ss->ephoto, path, NULL, EINA_FALSE, EINA_TRUE);
@@ -823,6 +823,12 @@ _gadget_settings_save(void *data, Evas_Object *obj EINA_UNUSED,
}
static void
+_popup_del(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_data EINA_UNUSED)
+{
+ evas_object_del(obj);
+}
+
+static void
_gadget_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
@@ -831,8 +837,12 @@ _gadget_settings(void *data, Evas_Object *obj EINA_UNUSED,
char buf[PATH_MAX];
popup = elm_win_add(ss->ephoto->win, "win", ELM_WIN_BASIC);
- elm_win_alpha_set(popup, 1);
+ if (ss->ephoto->gadget)
+ elm_win_alpha_set(popup, 1);
+ else
+ elm_win_autodel_set(popup, 1);
evas_object_data_set(popup, "slideshow", ss);
+ evas_object_event_callback_add(popup, EVAS_CALLBACK_HIDE, _popup_del, NULL);
table = elm_table_add(popup);
elm_table_homogeneous_set(table, EINA_FALSE);
@@ -844,7 +854,7 @@ _gadget_settings(void *data, Evas_Object *obj EINA_UNUSED,
fentry = elm_fileselector_add(table);
elm_fileselector_is_save_set(fentry, EINA_FALSE);
elm_fileselector_expandable_set(fentry, EINA_FALSE);
- elm_fileselector_path_set(fentry, ss->ephoto->gci->directory);
+ elm_fileselector_path_set(fentry, ss->ephoto->gadget_config->directory);
elm_fileselector_buttons_ok_cancel_set(fentry, EINA_FALSE);
elm_fileselector_folder_only_set(fentry, EINA_TRUE);
evas_object_size_hint_weight_set(fentry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -867,7 +877,7 @@ _gadget_settings(void *data, Evas_Object *obj EINA_UNUSED,
snprintf(buf, PATH_MAX, "%%1.0f %s", _("seconds"));
elm_spinner_label_format_set(spinner, buf);
elm_spinner_step_set(spinner, 1);
- elm_spinner_value_set(spinner, ss->ephoto->gci->slideshow_timeout);
+ elm_spinner_value_set(spinner, ss->ephoto->gadget_config->slideshow_timeout);
elm_spinner_min_max_set(spinner, 1, 60);
elm_table_pack(table, spinner, 1, 5, 1, 1);
evas_object_show(spinner);
@@ -969,7 +979,7 @@ _mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
{
Ephoto_Slideshow *ss = data;
- if (ss->notify)
+ if (ss->notify && ss->entry)
{
elm_notify_timeout_set(ss->notify, 0.0);
evas_object_show(ss->notify);
@@ -982,7 +992,7 @@ _mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
{
Ephoto_Slideshow *ss = data;
- if (ss->notify)
+ if (ss->notify && ss->entry)
elm_notify_timeout_set(ss->notify, 3.0);
}
@@ -992,7 +1002,7 @@ _mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
{
Ephoto_Slideshow *ss = data;
- if (ss->notify)
+ if (ss->notify && ss->entry)
{
elm_notify_timeout_set(ss->notify, 3.0);
evas_object_show(ss->notify);
@@ -1023,7 +1033,7 @@ ephoto_slideshow_show_controls(Ephoto *ephoto)
but = _add_icon(ss->notify_box, "preferences-other", _("Settings"), NULL);
evas_object_smart_callback_add(but, "clicked", _gadget_settings, ss);
elm_notify_align_set(ss->notify, 0.5, 0.5);
- elm_notify_timeout_set(ss->notify, 3.0);
+ elm_notify_timeout_set(ss->notify, 0.0);
evas_object_show(ss->notify);
return;
}
@@ -1139,7 +1149,7 @@ ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry)
if (!ss->ephoto->gadget)
ss->timeout = ss->ephoto->config->slideshow_timeout;
else
- ss->timeout = ss->ephoto->gci->slideshow_timeout;
+ ss->timeout = ss->ephoto->gadget_config->slideshow_timeout;
_slideshow_play(ss);
ss->playing = 1;
@@ -1193,5 +1203,16 @@ ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry)
evas_object_raise(ss->event);
elm_object_focus_set(ss->event, EINA_TRUE);
}
+ else
+ {
+ if (ss->notify)
+ {
+ if (!elm_notify_timeout_get(ss->notify))
+ {
+ elm_notify_timeout_set(ss->notify, 3.0);
+ evas_object_show(ss->notify);
+ }
+ }
+ }
}