Ephoto: Delete menus upon dismissal, and fix opening ephoto with an image path.
This commit is contained in:
parent
a55e0d2097
commit
85dcb34cfc
|
@ -47,7 +47,7 @@ static void _fsel_mouse_up_cb(void *data, Evas *e EINA_UNUSED,
|
|||
Evas_Object *obj EINA_UNUSED, void *event_info);
|
||||
|
||||
/*File Pane Callbacks*/
|
||||
/*static void
|
||||
static void
|
||||
_menu_dismissed_cb(void *data, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ _menu_dismissed_cb(void *data, Evas_Object *obj,
|
|||
db->ephoto->menu_blocking = EINA_FALSE;
|
||||
evas_object_del(obj);
|
||||
elm_object_focus_set(db->main, EINA_TRUE);
|
||||
}*/
|
||||
}
|
||||
|
||||
static void
|
||||
_menu_empty_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
|
@ -648,8 +648,8 @@ _fsel_mouse_up_cb(void *data, Evas *e EINA_UNUSED,
|
|||
menu_it = elm_menu_item_add(menu, NULL, "user-trash", _("Trash"),
|
||||
_dir_go_trash, db);
|
||||
}
|
||||
/*evas_object_smart_callback_add(menu, "dismissed", _menu_dismissed_cb,
|
||||
db);*/
|
||||
evas_object_smart_callback_add(menu, "dismissed", _menu_dismissed_cb,
|
||||
db);
|
||||
evas_object_show(menu);
|
||||
}
|
||||
|
||||
|
|
|
@ -651,8 +651,7 @@ ephoto_window_add(const char *path)
|
|||
eina_stringshare_replace(&ephoto->config->directory,
|
||||
ecore_file_realpath(dir));
|
||||
free(dir);
|
||||
ephoto_single_browser_path_pending_set(ephoto->single_browser, path);
|
||||
|
||||
ephoto_single_browser_path_pending_set(ephoto->single_browser, path);
|
||||
elm_naviframe_item_simple_promote(ephoto->pager,
|
||||
ephoto->single_browser);
|
||||
ephoto_single_browser_show_controls(ephoto);
|
||||
|
|
|
@ -150,7 +150,7 @@ _ephoto_get_file_size(const char *path)
|
|||
return strdup(isize);
|
||||
}
|
||||
|
||||
/*static void
|
||||
static void
|
||||
_menu_dismissed_cb(void *data, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ _menu_dismissed_cb(void *data, Evas_Object *obj,
|
|||
|
||||
evas_object_del(obj);
|
||||
elm_object_focus_set(sb->event, EINA_TRUE);
|
||||
}*/
|
||||
}
|
||||
|
||||
/*Image Viewer Callbacks*/
|
||||
static Evas_Object *
|
||||
|
@ -1273,9 +1273,15 @@ _entry_free(void *data, const Ephoto_Entry *entry)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ephoto_single_populate_end(void *data EINA_UNUSED, int type EINA_UNUSED,
|
||||
_ephoto_single_populate_end(void *data, int type EINA_UNUSED,
|
||||
void *event EINA_UNUSED)
|
||||
{
|
||||
Ephoto_Single_Browser *sb = data;
|
||||
|
||||
if (!sb->entry)
|
||||
ephoto_single_browser_entry_set(sb->main,
|
||||
eina_list_nth(sb->ephoto->entries, 0));
|
||||
|
||||
return ECORE_CALLBACK_PASS_ON;
|
||||
}
|
||||
|
||||
|
@ -1442,8 +1448,8 @@ _ephoto_main_edit_menu(Ephoto_Single_Browser *sb)
|
|||
|
||||
_add_edit_menu_items(sb, menu);
|
||||
|
||||
/*evas_object_smart_callback_add(menu, "dismissed", _menu_dismissed_cb,
|
||||
sb);*/
|
||||
evas_object_smart_callback_add(menu, "dismissed", _menu_dismissed_cb,
|
||||
sb);
|
||||
evas_object_show(menu);
|
||||
}
|
||||
|
||||
|
@ -1664,15 +1670,23 @@ void
|
|||
ephoto_single_browser_entry_set(Evas_Object *obj, Ephoto_Entry *entry)
|
||||
{
|
||||
Ephoto_Single_Browser *sb = evas_object_data_get(obj, "single_browser");
|
||||
char *dir;
|
||||
|
||||
if (sb->entry)
|
||||
ephoto_entry_free_listener_del(sb->entry, _entry_free, sb);
|
||||
|
||||
sb->entry = entry;
|
||||
|
||||
if (sb->entry && !entry)
|
||||
{
|
||||
dir = ecore_file_dir_get(sb->entry->path);
|
||||
if (!eina_streq(sb->ephoto->config->directory, dir))
|
||||
{
|
||||
ephoto_entry_free_listener_del(sb->entry, _entry_free, sb);
|
||||
sb->entry = entry;
|
||||
}
|
||||
free(dir);
|
||||
}
|
||||
if (entry)
|
||||
ephoto_entry_free_listener_add(entry, _entry_free, sb);
|
||||
|
||||
{
|
||||
sb->entry = entry;
|
||||
ephoto_entry_free_listener_add(entry, _entry_free, sb);
|
||||
}
|
||||
_ephoto_single_browser_recalc(sb);
|
||||
if (sb->edited_image_data)
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ static void _ephoto_thumb_search_start(void *data, Evas_Object *obj EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED);
|
||||
|
||||
/*Common Callbacks*/
|
||||
/*static void
|
||||
static void
|
||||
_menu_dismissed_cb(void *data, Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
|
@ -87,7 +87,7 @@ _menu_dismissed_cb(void *data, Evas_Object *obj,
|
|||
|
||||
evas_object_del(obj);
|
||||
elm_object_focus_set(tb->main, EINA_TRUE);
|
||||
}*/
|
||||
}
|
||||
|
||||
static void
|
||||
_menu_empty_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||
|
@ -814,8 +814,8 @@ _grid_mouse_up_cb(void *data, Evas *e EINA_UNUSED,
|
|||
_grid_menu_delete_cb, tb);
|
||||
}
|
||||
}
|
||||
/*evas_object_smart_callback_add(menu, "dismissed", _menu_dismissed_cb,
|
||||
tb);*/
|
||||
evas_object_smart_callback_add(menu, "dismissed", _menu_dismissed_cb,
|
||||
tb);
|
||||
evas_object_show(menu);
|
||||
}
|
||||
static void
|
||||
|
@ -1373,19 +1373,14 @@ _ephoto_thumb_populate_end(void *data, int type EINA_UNUSED,
|
|||
}
|
||||
else if (tb->ephoto->state == EPHOTO_STATE_SINGLE)
|
||||
{
|
||||
ephoto_single_browser_entry_set(tb->ephoto->single_browser, NULL);
|
||||
if (tb->ephoto->entries)
|
||||
{
|
||||
ephoto_single_browser_entry_set(tb->ephoto->single_browser, NULL);
|
||||
ephoto_single_browser_entries_set(tb->ephoto->single_browser,
|
||||
tb->ephoto->entries);
|
||||
ephoto_single_browser_entry_set(tb->ephoto->single_browser,
|
||||
eina_list_nth(tb->ephoto->entries, 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
ephoto_single_browser_entry_set(tb->ephoto->single_browser, NULL);
|
||||
ephoto_title_set(tb->ephoto, tb->ephoto->config->directory);
|
||||
}
|
||||
ephoto_title_set(tb->ephoto, tb->ephoto->config->directory);
|
||||
}
|
||||
tb->entries = tb->ephoto->entries;
|
||||
if (eina_list_count(tb->entries) < 1)
|
||||
|
|
Loading…
Reference in New Issue