Ephoto: Don't dismiss menus as that causes a crash. Make Ephoto's thumbnailer portable to Windows.

master
Stephen okra Houston 6 years ago
parent fda3f76926
commit fae7a5e26c
  1. 13
      src/bin/ephoto_directory_browser.c
  2. 31
      src/bin/ephoto_ipc.c
  3. 8
      src/bin/ephoto_single_browser.c
  4. 10
      src/bin/ephoto_thumb_browser.c

@ -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,
@ -446,7 +446,6 @@ _dir_go_trash(void *data, Evas_Object *obj EINA_UNUSED,
evas_object_show(but);
db->fsel = elm_genlist_add(db->leftbox);
elm_genlist_homogeneous_set(db->fsel, EINA_FALSE);
elm_genlist_select_mode_set(db->fsel, ELM_OBJECT_SELECT_MODE_ALWAYS);
evas_object_size_hint_weight_set(db->fsel, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
@ -649,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);
}
@ -676,9 +675,7 @@ _ephoto_directory_view_add(Ephoto_Directory_Browser *db)
evas_object_show(db->leftbox);
db->fsel = elm_genlist_add(db->leftbox);
elm_genlist_homogeneous_set(db->fsel, EINA_FALSE);
elm_genlist_select_mode_set(db->fsel, ELM_OBJECT_SELECT_MODE_ALWAYS);
evas_object_size_hint_weight_set(db->fsel, EVAS_HINT_EXPAND,
elm_genlist_select_mode_set(db->fsel, ELM_OBJECT_SELECT_MODE_ALWAYS); evas_object_size_hint_weight_set(db->fsel, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(db->fsel, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_smart_callback_add(db->fsel, "expand,request",

@ -17,23 +17,20 @@ static Ecore_Ipc_Server *_e_ipc_server = NULL;
int
e_ipc_init(void)
{
char buf[4096], buf2[128], buf3[4096];
char *tmp, *user, *base;
char buf[4096], buf3[4096];
const char *tmp, *user, *base;
int pid, trynum = 0, id1 = 0;
struct stat st;
tmp = getenv("TMPDIR");
tmp = eina_environment_tmp_get();
if (!tmp) tmp = "/tmp";
base = tmp;
tmp = getenv("XDG_RUNTIME_DIR");
if (tmp)
{
if (stat(tmp, &st) == 0)
if (ecore_file_exists(tmp))
{
if ((st.st_uid == getuid()) &&
((st.st_mode & (S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)) ==
(S_IRWXU | S_IFDIR)))
if (ecore_file_is_dir(tmp) && ecore_file_can_write(tmp))
base = tmp;
else
ERR("XDG_RUNTIME_DIR of '%s' failed permissions check", tmp);
@ -45,11 +42,9 @@ e_ipc_init(void)
tmp = getenv("SD_USER_SOCKETS_DIR");
if (tmp)
{
if (stat(tmp, &st) == 0)
if (ecore_file_exists(tmp))
{
if ((st.st_uid == getuid()) &&
((st.st_mode & (S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)) ==
(S_IRWXU | S_IFDIR)))
if (ecore_file_is_dir(tmp) && ecore_file_can_write(tmp))
base = tmp;
else
ERR("SD_USER_SOCKETS_DIR of '%s' failed permissions check", tmp);
@ -59,18 +54,6 @@ e_ipc_init(void)
}
user = getenv("USER");
if (!user)
{
int uidint;
user = "__unknown__";
uidint = getuid();
if (uidint >= 0)
{
snprintf(buf2, sizeof(buf2), "%i", uidint);
user = buf2;
}
}
setenv("EPHOTO_IPC_SOCKET", "", 1);

@ -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 *
@ -1442,8 +1442,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);
}

@ -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
@ -1842,7 +1842,7 @@ ephoto_thumb_browser_show_controls(Ephoto *ephoto)
ic = elm_icon_add(ephoto->controls_left);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
ret = elm_icon_standard_set(ic, "image-x-generic");
ret = elm_icon_standard_set(ic, "view-list-details");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
if (!ret)
ret = elm_image_file_set(ic, PACKAGE_DATA_DIR "/images/single.png", NULL);

Loading…
Cancel
Save