Ephoto: Add renme and delete to single browser.

master
Stephen Houston 7 years ago
parent 5dcc34c16f
commit b73233d8fb
  1. 2
      src/bin/ephoto_config.c
  2. 17
      src/bin/ephoto_single_browser.c

@ -361,6 +361,8 @@ _config_bindings(Evas_Object *parent)
"<b>Left Arrow:</b> Navigate Previous<br/>"
"<b>Right Arrow:</b> Navigate Next<br/>"
"<b>End:</b> Navigate Last<br/>"
"<b>Ctrl+Delete:</b> Delete Image<br/>"
"<b>F2</b> Rename Image<br/>"
"<b>Escape:</b> Return to Thumbnail Browser<br/><br/>"
"<b><hilight>Slideshow Bindings</hilight></b><br/>"
"<b>Space:</b> Play/Pause Slideshow<br/>"

@ -963,6 +963,15 @@ _delete_image(void *data, Evas_Object *obj EINA_UNUSED,
ephoto_file_delete(sb->ephoto, files, EINA_FILE_REG);
}
static void
_rename_image(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto_Single_Browser *sb = data;
ephoto_file_rename(sb->ephoto, sb->entry->path);
}
static void
_go_first(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
@ -1377,6 +1386,8 @@ _add_edit_menu_items(Ephoto_Single_Browser *sb, Evas_Object *menu)
_save_image_as, sb);
elm_menu_item_add(menu, menu_it, "document-send", _("Upload"), _upload_image,
sb);
elm_menu_item_add(menu, menu_it, "edit", _("Rename"),
_rename_image, sb);
elm_menu_item_add(menu, menu_it, "edit-delete", _("Delete"),
_delete_image, sb);
menu_it =
@ -1427,7 +1438,7 @@ _add_edit_menu_items(Ephoto_Single_Browser *sb, Evas_Object *menu)
elm_menu_item_add(menu, NULL, "document-properties", _("View"), NULL,
NULL);
menu_itt =
elm_menu_item_add(menu, menu_it, "go-first", _("Go"), NULL, NULL);
elm_menu_item_add(menu, menu_it, "go-next", _("Go"), NULL, NULL);
elm_menu_item_add(menu, menu_itt, "go-first", _("First"), _go_first, sb);
elm_menu_item_add(menu, menu_itt, "go-previous", _("Previous"), _go_prev, sb);
elm_menu_item_add(menu, menu_itt, "go-next", _("Next"), _go_next, sb);
@ -1543,6 +1554,10 @@ _ephoto_main_key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU
{
_ephoto_show_settings(sb, NULL, NULL);
}
else if (!strcmp(k, "F2"))
{
_rename_image(sb, NULL, NULL);
}
else if (!strcmp(k, "F5") && !sb->editing)
{
if (sb->entry)

Loading…
Cancel
Save