Ephoto: Formatting
This commit is contained in:
parent
95c5f41301
commit
f656110fc1
|
@ -231,12 +231,12 @@ _ephoto_eina_file_direct_info_image_useful(const Eina_File_Direct_Info *info)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
const char *filters[] = {
|
const char *filters[] = {
|
||||||
"png", "jpeg", "jpg", "eet", "xpm", "tiff", "gif", "svg", "webp", "pmaps",
|
"png", "jpeg", "jpg", "eet", "xpm", "tiff", "gif", "svg", "webp",
|
||||||
"bmp", "tga", "wbmp", "ico", "psd", "jp2k", "generic", "3fr", "ari", "arw",
|
"pmaps", "bmp", "tga", "wbmp", "ico", "psd", "jp2k", "generic", "3fr",
|
||||||
"bay", "crw", "cr2", "cap", "dcs", "dcr", "dng", "drf", "eip", "erf",
|
"ari", "arw", "bay", "crw", "cr2", "cap", "dcs", "dcr", "dng", "drf",
|
||||||
"fff", "iiq", "k25", "kdc", "mdc", "mef", "mos", "mrw", "nef", "nrw", "obm",
|
"eip", "erf", "fff", "iiq", "k25", "kdc", "mdc", "mef", "mos", "mrw",
|
||||||
"orf", "pef", "ptx", "pxn", "r3d", "raf", "raw", "rwl", "rw2", "rwz",
|
"nef", "nrw", "obm", "orf", "pef", "ptx", "pxn", "r3d", "raf", "raw",
|
||||||
"sr2", "srf", "srw", "tif", "x3f"
|
"rwl", "rw2", "rwz", "sr2", "srf", "srw", "tif", "x3f"
|
||||||
};
|
};
|
||||||
|
|
||||||
bname = info->path + info->name_start;
|
bname = info->path + info->name_start;
|
||||||
|
|
|
@ -337,7 +337,8 @@ ephoto_bcg_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
|
||||||
ebcg->frame = elm_frame_add(parent);
|
ebcg->frame = elm_frame_add(parent);
|
||||||
elm_object_text_set(ebcg->frame, _("Brightness/Contrast/Gamma"));
|
elm_object_text_set(ebcg->frame, _("Brightness/Contrast/Gamma"));
|
||||||
evas_object_size_hint_weight_set(ebcg->frame, 0.3, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(ebcg->frame, 0.3, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(ebcg->frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(ebcg->frame,
|
||||||
|
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
elm_box_pack_end(parent, ebcg->frame);
|
elm_box_pack_end(parent, ebcg->frame);
|
||||||
evas_object_data_set(ebcg->frame, "ebcg", ebcg);
|
evas_object_data_set(ebcg->frame, "ebcg", ebcg);
|
||||||
evas_object_event_callback_add(ebcg->frame, EVAS_CALLBACK_DEL, _frame_del,
|
evas_object_event_callback_add(ebcg->frame, EVAS_CALLBACK_DEL, _frame_del,
|
||||||
|
|
|
@ -257,7 +257,8 @@ _color_apply(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
image_data =
|
image_data =
|
||||||
evas_object_image_data_get(elm_image_object_get(eco->image), EINA_FALSE);
|
evas_object_image_data_get(elm_image_object_get(eco->image),
|
||||||
|
EINA_FALSE);
|
||||||
evas_object_image_size_get(elm_image_object_get(eco->image), &w, &h);
|
evas_object_image_size_get(elm_image_object_get(eco->image), &w, &h);
|
||||||
ephoto_single_browser_image_data_update(eco->main, eco->image, EINA_TRUE,
|
ephoto_single_browser_image_data_update(eco->main, eco->image, EINA_TRUE,
|
||||||
image_data, w, h);
|
image_data, w, h);
|
||||||
|
@ -310,7 +311,8 @@ ephoto_color_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
|
||||||
eco->parent = parent;
|
eco->parent = parent;
|
||||||
eco->image = image;
|
eco->image = image;
|
||||||
im_data =
|
im_data =
|
||||||
evas_object_image_data_get(elm_image_object_get(eco->image), EINA_FALSE);
|
evas_object_image_data_get(elm_image_object_get(eco->image),
|
||||||
|
EINA_FALSE);
|
||||||
evas_object_image_size_get(elm_image_object_get(eco->image), &eco->w,
|
evas_object_image_size_get(elm_image_object_get(eco->image), &eco->w,
|
||||||
&eco->h);
|
&eco->h);
|
||||||
eco->original_im_data = malloc(sizeof(unsigned int) * eco->w * eco->h);
|
eco->original_im_data = malloc(sizeof(unsigned int) * eco->w * eco->h);
|
||||||
|
@ -370,8 +372,8 @@ ephoto_color_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
|
||||||
elm_slider_unit_format_set(slider, "%1.0f");
|
elm_slider_unit_format_set(slider, "%1.0f");
|
||||||
evas_object_size_hint_weight_set(slider, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
|
evas_object_size_hint_weight_set(slider, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
|
||||||
evas_object_size_hint_align_set(slider, EVAS_HINT_FILL, 0.5);
|
evas_object_size_hint_align_set(slider, EVAS_HINT_FILL, 0.5);
|
||||||
evas_object_smart_callback_add(slider, "delay,changed", _blue_slider_changed,
|
evas_object_smart_callback_add(slider, "delay,changed",
|
||||||
eco);
|
_blue_slider_changed, eco);
|
||||||
elm_box_pack_end(box, slider);
|
elm_box_pack_end(box, slider);
|
||||||
evas_object_show(slider);
|
evas_object_show(slider);
|
||||||
eco->bslider = slider;
|
eco->bslider = slider;
|
||||||
|
|
|
@ -463,7 +463,8 @@ _cropper_mouse_move(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
Edje_Message_Int_Set *msg;
|
Edje_Message_Int_Set *msg;
|
||||||
int mx, my, cx, cy, cw, ch, nx, ny, lx, ly, lw, lh;
|
int mx, my, cx, cy, cw, ch, nx, ny, lx, ly, lw, lh;
|
||||||
|
|
||||||
evas_pointer_canvas_xy_get(evas_object_evas_get(ec->cropper), &mx, &my);
|
evas_pointer_canvas_xy_get(evas_object_evas_get(ec->cropper),
|
||||||
|
&mx, &my);
|
||||||
evas_object_geometry_get(ec->cropper, &cx, &cy, &cw, &ch);
|
evas_object_geometry_get(ec->cropper, &cx, &cy, &cw, &ch);
|
||||||
evas_object_geometry_get(ec->layout, &lx, &ly, &lw, &lh);
|
evas_object_geometry_get(ec->layout, &lx, &ly, &lw, &lh);
|
||||||
|
|
||||||
|
@ -668,7 +669,8 @@ ephoto_cropper_add(Evas_Object *main, Evas_Object *parent,
|
||||||
|
|
||||||
evas_object_event_callback_add(ec->layout, EVAS_CALLBACK_RESIZE,
|
evas_object_event_callback_add(ec->layout, EVAS_CALLBACK_RESIZE,
|
||||||
_image_resize, ec);
|
_image_resize, ec);
|
||||||
evas_object_event_callback_add(ec->box, EVAS_CALLBACK_DEL, _cropper_del, ec);
|
evas_object_event_callback_add(ec->box, EVAS_CALLBACK_DEL,
|
||||||
|
_cropper_del, ec);
|
||||||
|
|
||||||
ec->frame = elm_frame_add(parent);
|
ec->frame = elm_frame_add(parent);
|
||||||
elm_object_text_set(ec->frame, _("Crop Image"));
|
elm_object_text_set(ec->frame, _("Crop Image"));
|
||||||
|
|
|
@ -344,7 +344,8 @@ ephoto_hsv_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
|
||||||
ehsv->frame = elm_frame_add(parent);
|
ehsv->frame = elm_frame_add(parent);
|
||||||
elm_object_text_set(ehsv->frame, _("Hue/Saturation/Value"));
|
elm_object_text_set(ehsv->frame, _("Hue/Saturation/Value"));
|
||||||
evas_object_size_hint_weight_set(ehsv->frame, 0.3, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(ehsv->frame, 0.3, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(ehsv->frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(ehsv->frame,
|
||||||
|
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
elm_box_pack_end(parent, ehsv->frame);
|
elm_box_pack_end(parent, ehsv->frame);
|
||||||
evas_object_data_set(ehsv->frame, "ehsv", ehsv);
|
evas_object_data_set(ehsv->frame, "ehsv", ehsv);
|
||||||
evas_object_event_callback_add(ehsv->frame, EVAS_CALLBACK_DEL, _frame_del,
|
evas_object_event_callback_add(ehsv->frame, EVAS_CALLBACK_DEL, _frame_del,
|
||||||
|
|
|
@ -49,11 +49,14 @@ static void
|
||||||
_ephoto_single_browser_show(Ephoto *ephoto, Ephoto_Entry *entry)
|
_ephoto_single_browser_show(Ephoto *ephoto, Ephoto_Entry *entry)
|
||||||
{
|
{
|
||||||
if (ephoto->selentries)
|
if (ephoto->selentries)
|
||||||
ephoto_single_browser_entries_set(ephoto->single_browser, ephoto->selentries);
|
ephoto_single_browser_entries_set(ephoto->single_browser,
|
||||||
|
ephoto->selentries);
|
||||||
else if (ephoto->searchentries)
|
else if (ephoto->searchentries)
|
||||||
ephoto_single_browser_entries_set(ephoto->single_browser, ephoto->searchentries);
|
ephoto_single_browser_entries_set(ephoto->single_browser,
|
||||||
|
ephoto->searchentries);
|
||||||
else
|
else
|
||||||
ephoto_single_browser_entries_set(ephoto->single_browser, ephoto->entries);
|
ephoto_single_browser_entries_set(ephoto->single_browser,
|
||||||
|
ephoto->entries);
|
||||||
|
|
||||||
ephoto_single_browser_entry_set(ephoto->single_browser, entry);
|
ephoto_single_browser_entry_set(ephoto->single_browser, entry);
|
||||||
elm_naviframe_item_simple_promote(ephoto->pager, ephoto->single_browser);
|
elm_naviframe_item_simple_promote(ephoto->pager, ephoto->single_browser);
|
||||||
|
@ -212,8 +215,8 @@ ephoto_window_add(const char *path)
|
||||||
|
|
||||||
evas_object_event_callback_add(ephoto->win, EVAS_CALLBACK_FREE, _win_free,
|
evas_object_event_callback_add(ephoto->win, EVAS_CALLBACK_FREE, _win_free,
|
||||||
ephoto);
|
ephoto);
|
||||||
evas_object_event_callback_add(ephoto->win, EVAS_CALLBACK_RESIZE, _resize_cb,
|
evas_object_event_callback_add(ephoto->win, EVAS_CALLBACK_RESIZE,
|
||||||
ephoto);
|
_resize_cb, ephoto);
|
||||||
elm_win_autodel_set(ephoto->win, EINA_TRUE);
|
elm_win_autodel_set(ephoto->win, EINA_TRUE);
|
||||||
|
|
||||||
if (!ephoto_config_init(ephoto))
|
if (!ephoto_config_init(ephoto))
|
||||||
|
@ -443,7 +446,8 @@ _ephoto_populate_entries(Ephoto_Dir_Data *ed)
|
||||||
|
|
||||||
ed->ephoto->ls =
|
ed->ephoto->ls =
|
||||||
eio_file_stat_ls(ed->ephoto->config->directory, _ephoto_populate_filter,
|
eio_file_stat_ls(ed->ephoto->config->directory, _ephoto_populate_filter,
|
||||||
_ephoto_populate_main, _ephoto_populate_end, _ephoto_populate_error, ed);
|
_ephoto_populate_main, _ephoto_populate_end, _ephoto_populate_error,
|
||||||
|
ed);
|
||||||
|
|
||||||
ecore_event_add(EPHOTO_EVENT_POPULATE_START, NULL, NULL, NULL);
|
ecore_event_add(EPHOTO_EVENT_POPULATE_START, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
@ -592,7 +596,8 @@ ephoto_directory_set(Ephoto *ephoto, const char *path, Evas_Object *expanded,
|
||||||
ed->thumbs_only = thumbs_only;
|
ed->thumbs_only = thumbs_only;
|
||||||
|
|
||||||
ephoto_title_set(ephoto, NULL);
|
ephoto_title_set(ephoto, NULL);
|
||||||
eina_stringshare_replace(&ephoto->config->directory, ecore_file_realpath(path));
|
eina_stringshare_replace(&ephoto->config->directory,
|
||||||
|
ecore_file_realpath(path));
|
||||||
|
|
||||||
if (ed->ephoto->job.change_dir)
|
if (ed->ephoto->job.change_dir)
|
||||||
ecore_job_del(ed->ephoto->job.change_dir);
|
ecore_job_del(ed->ephoto->job.change_dir);
|
||||||
|
@ -607,11 +612,14 @@ ephoto_directory_set(Ephoto *ephoto, const char *path, Evas_Object *expanded,
|
||||||
}
|
}
|
||||||
ephoto->monitor = eio_monitor_add(path);
|
ephoto->monitor = eio_monitor_add(path);
|
||||||
ephoto->monitor_handlers = eina_list_append(ephoto->monitor_handlers,
|
ephoto->monitor_handlers = eina_list_append(ephoto->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, _monitor_created, ephoto));
|
ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, _monitor_created,
|
||||||
|
ephoto));
|
||||||
ephoto->monitor_handlers = eina_list_append(ephoto->monitor_handlers,
|
ephoto->monitor_handlers = eina_list_append(ephoto->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, _monitor_deleted, ephoto));
|
ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, _monitor_deleted,
|
||||||
|
ephoto));
|
||||||
ephoto->monitor_handlers = eina_list_append(ephoto->monitor_handlers,
|
ephoto->monitor_handlers = eina_list_append(ephoto->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _monitor_modified, ephoto));
|
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _monitor_modified,
|
||||||
|
ephoto));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -788,7 +796,8 @@ ephoto_entry_free(Ephoto *ephoto, Ephoto_Entry *entry)
|
||||||
if (ephoto->selentries)
|
if (ephoto->selentries)
|
||||||
{
|
{
|
||||||
node = eina_list_data_find_list(ephoto->selentries, entry);
|
node = eina_list_data_find_list(ephoto->selentries, entry);
|
||||||
ephoto->selentries = eina_list_remove_list(ephoto->selentries, node);
|
ephoto->selentries = eina_list_remove_list(ephoto->selentries,
|
||||||
|
node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eina_stringshare_del(entry->path);
|
eina_stringshare_del(entry->path);
|
||||||
|
|
|
@ -209,7 +209,8 @@ _viewer_add(Evas_Object *parent, const char *path, Ephoto_Single_Browser *sb)
|
||||||
v->scroller = elm_scroller_add(parent);
|
v->scroller = elm_scroller_add(parent);
|
||||||
evas_object_size_hint_weight_set(v->scroller, EVAS_HINT_EXPAND,
|
evas_object_size_hint_weight_set(v->scroller, EVAS_HINT_EXPAND,
|
||||||
EVAS_HINT_EXPAND);
|
EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(v->scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(v->scroller,
|
||||||
|
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
evas_object_data_set(v->scroller, "viewer", v);
|
evas_object_data_set(v->scroller, "viewer", v);
|
||||||
evas_object_event_callback_add(v->scroller, EVAS_CALLBACK_DEL, _viewer_del,
|
evas_object_event_callback_add(v->scroller, EVAS_CALLBACK_DEL, _viewer_del,
|
||||||
v);
|
v);
|
||||||
|
@ -248,7 +249,8 @@ _viewer_add(Evas_Object *parent, const char *path, Ephoto_Single_Browser *sb)
|
||||||
|
|
||||||
v->monitor = eio_monitor_add(path);
|
v->monitor = eio_monitor_add(path);
|
||||||
v->handlers = eina_list_append(v->handlers,
|
v->handlers = eina_list_append(v->handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _monitor_modified, sb));
|
ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED,
|
||||||
|
_monitor_modified, sb));
|
||||||
v->handlers = eina_list_append(v->handlers,
|
v->handlers = eina_list_append(v->handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, _monitor_closed, sb));
|
ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, _monitor_closed, sb));
|
||||||
|
|
||||||
|
@ -672,14 +674,14 @@ _ephoto_get_file_size(const char *path)
|
||||||
{
|
{
|
||||||
dsize /= 1024.0;
|
dsize /= 1024.0;
|
||||||
if (dsize < 1024)
|
if (dsize < 1024)
|
||||||
snprintf(isize, sizeof(isize), "%'.0f%s", dsize, ngettext("KB", "KB",
|
snprintf(isize, sizeof(isize), "%'.0f%s", dsize,
|
||||||
dsize));
|
ngettext("KB", "KB", dsize));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dsize /= 1024.0;
|
dsize /= 1024.0;
|
||||||
if (dsize < 1024)
|
if (dsize < 1024)
|
||||||
snprintf(isize, sizeof(isize), "%'.1f%s", dsize, ngettext("MB",
|
snprintf(isize, sizeof(isize), "%'.1f%s", dsize,
|
||||||
"MB", dsize));
|
ngettext("MB", "MB", dsize));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dsize /= 1024.0;
|
dsize /= 1024.0;
|
||||||
|
@ -733,7 +735,8 @@ _ephoto_single_browser_recalc(Ephoto_Single_Browser *sb)
|
||||||
evas_object_event_callback_add(sb->viewer,
|
evas_object_event_callback_add(sb->viewer,
|
||||||
EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel, sb);
|
EVAS_CALLBACK_MOUSE_WHEEL, _mouse_wheel, sb);
|
||||||
|
|
||||||
evas_object_image_size_get(elm_image_object_get(v->image), &w, &h);
|
evas_object_image_size_get(elm_image_object_get(v->image),
|
||||||
|
&w, &h);
|
||||||
tmp = _ephoto_get_file_size(sb->entry->path);
|
tmp = _ephoto_get_file_size(sb->entry->path);
|
||||||
snprintf(image_info, PATH_MAX,
|
snprintf(image_info, PATH_MAX,
|
||||||
"<b>%s:</b> %s <b>%s:</b> %dx%d <b>%s:</b> %s",
|
"<b>%s:</b> %s <b>%s:</b> %dx%d <b>%s:</b> %s",
|
||||||
|
@ -1189,7 +1192,8 @@ _save_image_as_overwrite(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
success =
|
success =
|
||||||
evas_object_image_save(elm_image_object_get(v->image), file, NULL, NULL);
|
evas_object_image_save(elm_image_object_get(v->image), file,
|
||||||
|
NULL, NULL);
|
||||||
if (!success)
|
if (!success)
|
||||||
_failed_save(sb);
|
_failed_save(sb);
|
||||||
else
|
else
|
||||||
|
@ -1198,7 +1202,8 @@ _save_image_as_overwrite(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
|
|
||||||
ephoto_thumb_browser_fsel_clear(sb->ephoto);
|
ephoto_thumb_browser_fsel_clear(sb->ephoto);
|
||||||
ephoto_directory_set(sb->ephoto, dir, NULL, EINA_FALSE, EINA_FALSE);
|
ephoto_directory_set(sb->ephoto, dir, NULL, EINA_FALSE, EINA_FALSE);
|
||||||
ephoto_thumb_browser_top_dir_set(sb->ephoto, sb->ephoto->config->directory);
|
ephoto_thumb_browser_top_dir_set(sb->ephoto,
|
||||||
|
sb->ephoto->config->directory);
|
||||||
free(dir);
|
free(dir);
|
||||||
ephoto_single_browser_path_pending_set(sb->ephoto->single_browser,
|
ephoto_single_browser_path_pending_set(sb->ephoto->single_browser,
|
||||||
file);
|
file);
|
||||||
|
@ -1238,7 +1243,8 @@ _save_image_as_done(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
evas_object_freeze_events_set(sb->event, EINA_TRUE);
|
evas_object_freeze_events_set(sb->event, EINA_TRUE);
|
||||||
|
|
||||||
popup = elm_popup_add(sb->ephoto->win);
|
popup = elm_popup_add(sb->ephoto->win);
|
||||||
elm_object_part_text_set(popup, "title,text", _("Overwite Image"));
|
elm_object_part_text_set(popup, "title,text",
|
||||||
|
_("Overwite Image"));
|
||||||
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
|
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
|
||||||
|
|
||||||
box = elm_box_add(popup);
|
box = elm_box_add(popup);
|
||||||
|
@ -1282,7 +1288,8 @@ _save_image_as_done(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
button = elm_button_add(popup);
|
button = elm_button_add(popup);
|
||||||
elm_object_text_set(button, _("No"));
|
elm_object_text_set(button, _("No"));
|
||||||
elm_object_part_content_set(button, "icon", ic);
|
elm_object_part_content_set(button, "icon", ic);
|
||||||
evas_object_smart_callback_add(button, "clicked", _save_no, popup);
|
evas_object_smart_callback_add(button, "clicked",
|
||||||
|
_save_no, popup);
|
||||||
elm_object_part_content_set(popup, "button2", button);
|
elm_object_part_content_set(popup, "button2", button);
|
||||||
evas_object_show(button);
|
evas_object_show(button);
|
||||||
|
|
||||||
|
@ -1305,7 +1312,8 @@ _save_image_as_done(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
ephoto_thumb_browser_fsel_clear(sb->ephoto);
|
ephoto_thumb_browser_fsel_clear(sb->ephoto);
|
||||||
ephoto_directory_set(sb->ephoto, dir, NULL,
|
ephoto_directory_set(sb->ephoto, dir, NULL,
|
||||||
EINA_FALSE, EINA_FALSE);
|
EINA_FALSE, EINA_FALSE);
|
||||||
ephoto_thumb_browser_top_dir_set(sb->ephoto, sb->ephoto->config->directory);
|
ephoto_thumb_browser_top_dir_set(sb->ephoto,
|
||||||
|
sb->ephoto->config->directory);
|
||||||
free(dir);
|
free(dir);
|
||||||
ephoto_single_browser_path_pending_set(sb->ephoto->
|
ephoto_single_browser_path_pending_set(sb->ephoto->
|
||||||
single_browser, buf);
|
single_browser, buf);
|
||||||
|
@ -1354,7 +1362,8 @@ _save_image_as(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
elm_fileselector_expandable_set(fsel, EINA_FALSE);
|
elm_fileselector_expandable_set(fsel, EINA_FALSE);
|
||||||
elm_fileselector_path_set(fsel, sb->ephoto->config->directory);
|
elm_fileselector_path_set(fsel, sb->ephoto->config->directory);
|
||||||
elm_fileselector_current_name_set(fsel, sb->entry->basename);
|
elm_fileselector_current_name_set(fsel, sb->entry->basename);
|
||||||
elm_fileselector_mime_types_filter_append(fsel, "image/*", _("Image Files"));
|
elm_fileselector_mime_types_filter_append(fsel, "image/*",
|
||||||
|
_("Image Files"));
|
||||||
evas_object_size_hint_weight_set(fsel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(fsel, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(fsel, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(fsel, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
evas_object_smart_callback_add(fsel, "done", _save_image_as_done, popup);
|
evas_object_smart_callback_add(fsel, "done", _save_image_as_done, popup);
|
||||||
|
@ -1643,8 +1652,8 @@ _upload_image_confirm(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
Eina_Bool success;
|
Eina_Bool success;
|
||||||
|
|
||||||
ext++;
|
ext++;
|
||||||
snprintf(tmp_path, PATH_MAX, "%s/.config/ephoto/tmp.%s", getenv("HOME"),
|
snprintf(tmp_path, PATH_MAX, "%s/.config/ephoto/tmp.%s",
|
||||||
ext);
|
getenv("HOME"), ext);
|
||||||
success =
|
success =
|
||||||
evas_object_image_save(elm_image_object_get(v->image), tmp_path,
|
evas_object_image_save(elm_image_object_get(v->image), tmp_path,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
@ -1673,7 +1682,8 @@ _upload_image_confirm(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
|
|
||||||
sb->upload_handlers =
|
sb->upload_handlers =
|
||||||
eina_list_append(sb->upload_handlers,
|
eina_list_append(sb->upload_handlers,
|
||||||
ecore_event_handler_add(ECORE_CON_EVENT_URL_DATA, _upload_image_cb, sb));
|
ecore_event_handler_add(ECORE_CON_EVENT_URL_DATA,
|
||||||
|
_upload_image_cb, sb));
|
||||||
sb->upload_handlers =
|
sb->upload_handlers =
|
||||||
eina_list_append(sb->upload_handlers,
|
eina_list_append(sb->upload_handlers,
|
||||||
ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE,
|
ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE,
|
||||||
|
@ -1813,26 +1823,33 @@ _delete_apply(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
|
|
||||||
box = elm_box_add(ppopup);
|
box = elm_box_add(ppopup);
|
||||||
elm_box_horizontal_set(box, EINA_FALSE);
|
elm_box_horizontal_set(box, EINA_FALSE);
|
||||||
evas_object_size_hint_weight_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_weight_set(box,
|
||||||
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_size_hint_align_set(box,
|
||||||
|
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
evas_object_show(box);
|
evas_object_show(box);
|
||||||
|
|
||||||
label = elm_label_add(box);
|
label = elm_label_add(box);
|
||||||
elm_object_text_set(label, _("There was an error deleting this file"));
|
elm_object_text_set(label,
|
||||||
evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
_("There was an error deleting this file"));
|
||||||
evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_weight_set(label,
|
||||||
|
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_size_hint_align_set(label,
|
||||||
|
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
elm_box_pack_end(box, label);
|
elm_box_pack_end(box, label);
|
||||||
evas_object_show(label);
|
evas_object_show(label);
|
||||||
|
|
||||||
ic = elm_icon_add(ppopup);
|
ic = elm_icon_add(ppopup);
|
||||||
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
|
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
|
||||||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
|
evas_object_size_hint_aspect_set(ic,
|
||||||
|
EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
|
||||||
elm_icon_standard_set(ic, "window-close");
|
elm_icon_standard_set(ic, "window-close");
|
||||||
|
|
||||||
button = elm_button_add(ppopup);
|
button = elm_button_add(ppopup);
|
||||||
elm_object_text_set(button, _("Ok"));
|
elm_object_text_set(button, _("Ok"));
|
||||||
elm_object_part_content_set(button, "icon", ic);
|
elm_object_part_content_set(button, "icon", ic);
|
||||||
evas_object_smart_callback_add(button, "clicked", _error_ok, popup);
|
evas_object_smart_callback_add(button, "clicked",
|
||||||
|
_error_ok, popup);
|
||||||
elm_object_part_content_set(popup, "button1", button);
|
elm_object_part_content_set(popup, "button1", button);
|
||||||
evas_object_show(button);
|
evas_object_show(button);
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,8 @@ ephoto_slideshow_add(Ephoto *ephoto, Evas_Object *parent)
|
||||||
ss->pause_after =
|
ss->pause_after =
|
||||||
elm_toolbar_item_append(ss->bar, "go-next", _("Next"), _next,
|
elm_toolbar_item_append(ss->bar, "go-next", _("Next"), _next,
|
||||||
ss->slideshow);
|
ss->slideshow);
|
||||||
elm_toolbar_item_append(ss->bar, "go-last", _("Last"), _last, ss->slideshow);
|
elm_toolbar_item_append(ss->bar, "go-last", _("Last"),
|
||||||
|
_last, ss->slideshow);
|
||||||
ss->fullscreen =
|
ss->fullscreen =
|
||||||
elm_toolbar_item_append(ss->bar, "view-fullscreen", _("Fullscreen"),
|
elm_toolbar_item_append(ss->bar, "view-fullscreen", _("Fullscreen"),
|
||||||
_fullscreen, ss);
|
_fullscreen, ss);
|
||||||
|
@ -444,7 +445,8 @@ ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry)
|
||||||
{
|
{
|
||||||
Elm_Object_Item *slideshow_item;
|
Elm_Object_Item *slideshow_item;
|
||||||
|
|
||||||
slideshow_item = elm_slideshow_item_add(ss->slideshow, &_item_cls, itr);
|
slideshow_item = elm_slideshow_item_add(ss->slideshow,
|
||||||
|
&_item_cls, itr);
|
||||||
if (itr == entry)
|
if (itr == entry)
|
||||||
elm_slideshow_item_show(slideshow_item);
|
elm_slideshow_item_show(slideshow_item);
|
||||||
}
|
}
|
||||||
|
|
|
@ -477,14 +477,14 @@ _monitor_created(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
e->monitor = eio_monitor_add(e->path);
|
e->monitor = eio_monitor_add(e->path);
|
||||||
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED, _monitor_created,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED,
|
||||||
e));
|
_monitor_created, e));
|
||||||
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED, _monitor_deleted,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED,
|
||||||
e));
|
_monitor_deleted, e));
|
||||||
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED, _monitor_modified,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED,
|
||||||
e));
|
_monitor_modified, e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (elm_genlist_item_type_get(entry->item) == ELM_GENLIST_ITEM_NONE)
|
if (elm_genlist_item_type_get(entry->item) == ELM_GENLIST_ITEM_NONE)
|
||||||
|
@ -508,14 +508,14 @@ _monitor_created(void *data, int type EINA_UNUSED, void *event)
|
||||||
entry->no_delete = EINA_FALSE;
|
entry->no_delete = EINA_FALSE;
|
||||||
entry->monitor = eio_monitor_add(entry->path);
|
entry->monitor = eio_monitor_add(entry->path);
|
||||||
entry->monitor_handlers = eina_list_append(entry->monitor_handlers,
|
entry->monitor_handlers = eina_list_append(entry->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED, _monitor_created,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED,
|
||||||
entry));
|
_monitor_created, entry));
|
||||||
entry->monitor_handlers = eina_list_append(entry->monitor_handlers,
|
entry->monitor_handlers = eina_list_append(entry->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED, _monitor_deleted,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED,
|
||||||
entry));
|
_monitor_deleted, entry));
|
||||||
entry->monitor_handlers = eina_list_append(entry->monitor_handlers,
|
entry->monitor_handlers = eina_list_append(entry->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED, _monitor_modified,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED,
|
||||||
entry));
|
_monitor_modified, entry));
|
||||||
}
|
}
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
@ -651,15 +651,18 @@ _todo_items_process(void *data)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
entry->monitor = eio_monitor_add(entry->path);
|
entry->monitor = eio_monitor_add(entry->path);
|
||||||
entry->monitor_handlers = eina_list_append(entry->monitor_handlers,
|
entry->monitor_handlers = eina_list_append(
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED, _monitor_created,
|
entry->monitor_handlers,
|
||||||
entry));
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED,
|
||||||
entry->monitor_handlers = eina_list_append(entry->monitor_handlers,
|
_monitor_created, entry));
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED, _monitor_deleted,
|
entry->monitor_handlers = eina_list_append(
|
||||||
entry));
|
entry->monitor_handlers,
|
||||||
entry->monitor_handlers = eina_list_append(entry->monitor_handlers,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED, _monitor_modified,
|
_monitor_deleted, entry));
|
||||||
entry));
|
entry->monitor_handlers = eina_list_append(
|
||||||
|
entry->monitor_handlers,
|
||||||
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED,
|
||||||
|
_monitor_modified, entry));
|
||||||
entry->genlist = tb->fsel;
|
entry->genlist = tb->fsel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -730,7 +733,8 @@ _ephoto_dir_go_up(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
ephoto_directory_set(tb->ephoto, dirname(path), NULL,
|
ephoto_directory_set(tb->ephoto, dirname(path), NULL,
|
||||||
tb->dirs_only, tb->thumbs_only);
|
tb->dirs_only, tb->thumbs_only);
|
||||||
ephoto_title_set(tb->ephoto, tb->ephoto->config->directory);
|
ephoto_title_set(tb->ephoto, tb->ephoto->config->directory);
|
||||||
ephoto_thumb_browser_top_dir_set(tb->ephoto, tb->ephoto->config->directory);
|
ephoto_thumb_browser_top_dir_set(tb->ephoto,
|
||||||
|
tb->ephoto->config->directory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -769,7 +773,8 @@ _ephoto_direntry_go(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
ephoto_directory_set(tb->ephoto, dir, NULL,
|
ephoto_directory_set(tb->ephoto, dir, NULL,
|
||||||
tb->dirs_only, tb->thumbs_only);
|
tb->dirs_only, tb->thumbs_only);
|
||||||
ephoto_title_set(tb->ephoto, tb->ephoto->config->directory);
|
ephoto_title_set(tb->ephoto, tb->ephoto->config->directory);
|
||||||
ephoto_thumb_browser_top_dir_set(tb->ephoto, tb->ephoto->config->directory);
|
ephoto_thumb_browser_top_dir_set(tb->ephoto,
|
||||||
|
tb->ephoto->config->directory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -813,8 +818,8 @@ _ephoto_search_go(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
if (found == elm_gengrid_last_item_get(tb->grid))
|
if (found == elm_gengrid_last_item_get(tb->grid))
|
||||||
break;
|
break;
|
||||||
next = elm_gengrid_item_next_get(found);
|
next = elm_gengrid_item_next_get(found);
|
||||||
found = elm_gengrid_search_by_text_item_get(tb->grid, next, NULL, pattern,
|
found = elm_gengrid_search_by_text_item_get(tb->grid, next, NULL,
|
||||||
ELM_GLOB_MATCH_NOCASE);
|
pattern, ELM_GLOB_MATCH_NOCASE);
|
||||||
}
|
}
|
||||||
tb->original_grid = tb->grid;
|
tb->original_grid = tb->grid;
|
||||||
elm_box_unpack(tb->gridbox, tb->original_grid);
|
elm_box_unpack(tb->gridbox, tb->original_grid);
|
||||||
|
@ -826,14 +831,15 @@ _ephoto_search_go(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
evas_object_size_hint_align_set(tb->grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(tb->grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
elm_gengrid_align_set(tb->grid, 0.5, 0.0);
|
elm_gengrid_align_set(tb->grid, 0.5, 0.0);
|
||||||
elm_gengrid_multi_select_set(tb->grid, EINA_TRUE);
|
elm_gengrid_multi_select_set(tb->grid, EINA_TRUE);
|
||||||
elm_gengrid_multi_select_mode_set(tb->grid, ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT);
|
elm_gengrid_multi_select_mode_set(tb->grid,
|
||||||
|
ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT);
|
||||||
elm_scroller_bounce_set(tb->grid, EINA_FALSE, EINA_TRUE);
|
elm_scroller_bounce_set(tb->grid, EINA_FALSE, EINA_TRUE);
|
||||||
evas_object_smart_callback_add(tb->grid, "activated",
|
evas_object_smart_callback_add(tb->grid, "activated",
|
||||||
_ephoto_thumb_activated, tb);
|
_ephoto_thumb_activated, tb);
|
||||||
evas_object_event_callback_add(tb->grid, EVAS_CALLBACK_MOUSE_UP,
|
evas_object_event_callback_add(tb->grid, EVAS_CALLBACK_MOUSE_UP,
|
||||||
_grid_mouse_up_cb, tb);
|
_grid_mouse_up_cb, tb);
|
||||||
elm_drag_item_container_add(tb->grid, ANIM_TIME, DRAG_TIMEOUT, _dnd_item_get,
|
elm_drag_item_container_add(tb->grid, ANIM_TIME, DRAG_TIMEOUT,
|
||||||
_dnd_item_data_get);
|
_dnd_item_get, _dnd_item_data_get);
|
||||||
evas_object_data_set(tb->grid, "thumb_browser", tb);
|
evas_object_data_set(tb->grid, "thumb_browser", tb);
|
||||||
_zoom_set(tb, tb->ephoto->config->thumb_size);
|
_zoom_set(tb, tb->ephoto->config->thumb_size);
|
||||||
elm_box_pack_end(tb->gridbox, tb->grid);
|
elm_box_pack_end(tb->gridbox, tb->grid);
|
||||||
|
@ -1009,13 +1015,14 @@ _ephoto_search_cancel(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
{
|
{
|
||||||
tb->totsize /= 1024.0;
|
tb->totsize /= 1024.0;
|
||||||
if (tb->totsize < 1024)
|
if (tb->totsize < 1024)
|
||||||
snprintf(isize, sizeof(isize), "%'.1f%s", tb->totsize,
|
snprintf(isize, sizeof(isize), "%'.1f%s",
|
||||||
ngettext("GB", "GB", tb->totsize));
|
tb->totsize, ngettext("GB", "GB", tb->totsize));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tb->totsize /= 1024.0;
|
tb->totsize /= 1024.0;
|
||||||
snprintf(isize, sizeof(isize), "%'.1f%s",
|
snprintf(isize, sizeof(isize), "%'.1f%s",
|
||||||
tb->totsize, ngettext("TB", "TB", tb->totsize));
|
tb->totsize,
|
||||||
|
ngettext("TB", "TB", tb->totsize));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1181,7 +1188,8 @@ _search(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
elm_object_text_set(but, _("Cancel"));
|
elm_object_text_set(but, _("Cancel"));
|
||||||
evas_object_size_hint_weight_set(but, 0.0, 0.0);
|
evas_object_size_hint_weight_set(but, 0.0, 0.0);
|
||||||
evas_object_size_hint_align_set(but, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(but, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
evas_object_smart_callback_add(but, "clicked", _ephoto_search_cancel, search);
|
evas_object_smart_callback_add(but, "clicked",
|
||||||
|
_ephoto_search_cancel, search);
|
||||||
elm_box_pack_end(hbox, but);
|
elm_box_pack_end(hbox, but);
|
||||||
evas_object_show(but);
|
evas_object_show(but);
|
||||||
|
|
||||||
|
@ -1257,8 +1265,8 @@ _ephoto_dir_show_folders(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
elm_table_unpack(tb->table, tb->gridbox);
|
elm_table_unpack(tb->table, tb->gridbox);
|
||||||
elm_table_pack(tb->table, tb->gridbox, 1, 0, 4, 1);
|
elm_table_pack(tb->table, tb->gridbox, 1, 0, 4, 1);
|
||||||
elm_object_item_del(tb->ficon);
|
elm_object_item_del(tb->ficon);
|
||||||
tb->ficon = elm_toolbar_item_prepend(tb->bar, "system-file-manager", _("Folders"),
|
tb->ficon = elm_toolbar_item_prepend(tb->bar, "system-file-manager",
|
||||||
_ephoto_dir_hide_folders, tb);
|
_("Folders"), _ephoto_dir_hide_folders, tb);
|
||||||
tb->ephoto->config->fsel_hide = 0;
|
tb->ephoto->config->fsel_hide = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1275,8 +1283,8 @@ _ephoto_dir_hide_folders(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
elm_table_unpack(tb->table, tb->gridbox);
|
elm_table_unpack(tb->table, tb->gridbox);
|
||||||
elm_table_pack(tb->table, tb->gridbox, 0, 0, 5, 1);
|
elm_table_pack(tb->table, tb->gridbox, 0, 0, 5, 1);
|
||||||
elm_object_item_del(tb->ficon);
|
elm_object_item_del(tb->ficon);
|
||||||
tb->ficon = elm_toolbar_item_prepend(tb->bar, "system-file-manager", _("Folders"),
|
tb->ficon = elm_toolbar_item_prepend(tb->bar, "system-file-manager",
|
||||||
_ephoto_dir_show_folders, tb);
|
_("Folders"), _ephoto_dir_show_folders, tb);
|
||||||
elm_object_focus_set(tb->main, EINA_TRUE);
|
elm_object_focus_set(tb->main, EINA_TRUE);
|
||||||
tb->ephoto->config->fsel_hide = 1;
|
tb->ephoto->config->fsel_hide = 1;
|
||||||
}
|
}
|
||||||
|
@ -1576,7 +1584,8 @@ _new_dir_confirm(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
ret = ecore_file_mkdir(new_file_name);
|
ret = ecore_file_mkdir(new_file_name);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
_complete(tb, _("Error"), _("There was an error creating this directory."));
|
_complete(tb, _("Error"),
|
||||||
|
_("There was an error creating this directory."));
|
||||||
}
|
}
|
||||||
evas_object_del(popup);
|
evas_object_del(popup);
|
||||||
evas_object_freeze_events_set(tb->main, EINA_FALSE);
|
evas_object_freeze_events_set(tb->main, EINA_FALSE);
|
||||||
|
@ -1686,9 +1695,11 @@ _rename_confirm(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
if (ecore_file_is_dir(new_file_name))
|
if (ecore_file_is_dir(new_file_name))
|
||||||
_complete(tb, _("Error"), _("There was an error renaming this directory."));
|
_complete(tb, _("Error"),
|
||||||
|
_("There was an error renaming this directory."));
|
||||||
else
|
else
|
||||||
_complete(tb, _("Error"), _("There was an error renaming this file."));
|
_complete(tb, _("Error"),
|
||||||
|
_("There was an error renaming this file."));
|
||||||
}
|
}
|
||||||
evas_object_del(popup);
|
evas_object_del(popup);
|
||||||
evas_object_freeze_events_set(tb->main, EINA_FALSE);
|
evas_object_freeze_events_set(tb->main, EINA_FALSE);
|
||||||
|
@ -2242,11 +2253,11 @@ _drop_dropcb(void *data EINA_UNUSED, Evas_Object *obj, Elm_Object_Item *it,
|
||||||
elm_object_text_set(button, _("Yes"));
|
elm_object_text_set(button, _("Yes"));
|
||||||
elm_object_part_content_set(button, "icon", ic);
|
elm_object_part_content_set(button, "icon", ic);
|
||||||
if (tb->ephoto->config->move_drop)
|
if (tb->ephoto->config->move_drop)
|
||||||
evas_object_smart_callback_add(button, "clicked", _prompt_move_apply,
|
evas_object_smart_callback_add(button, "clicked",
|
||||||
popup);
|
_prompt_move_apply, popup);
|
||||||
else
|
else
|
||||||
evas_object_smart_callback_add(button, "clicked", _prompt_copy_apply,
|
evas_object_smart_callback_add(button, "clicked",
|
||||||
popup);
|
_prompt_copy_apply, popup);
|
||||||
elm_object_part_content_set(popup, "button1", button);
|
elm_object_part_content_set(popup, "button1", button);
|
||||||
evas_object_show(button);
|
evas_object_show(button);
|
||||||
|
|
||||||
|
@ -2760,7 +2771,8 @@ _grid_menu_paste_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
|
|
||||||
evas_object_data_set(popup, "files",
|
evas_object_data_set(popup, "files",
|
||||||
eina_list_clone(tb->cut_items));
|
eina_list_clone(tb->cut_items));
|
||||||
evas_object_data_set(popup, "path", tb->ephoto->config->directory);
|
evas_object_data_set(popup, "path",
|
||||||
|
tb->ephoto->config->directory);
|
||||||
|
|
||||||
evas_object_show(popup);
|
evas_object_show(popup);
|
||||||
}
|
}
|
||||||
|
@ -2813,7 +2825,8 @@ _grid_menu_paste_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
|
|
||||||
evas_object_data_set(popup, "files",
|
evas_object_data_set(popup, "files",
|
||||||
eina_list_clone(tb->copy_items));
|
eina_list_clone(tb->copy_items));
|
||||||
evas_object_data_set(popup, "path", tb->ephoto->config->directory);
|
evas_object_data_set(popup, "path",
|
||||||
|
tb->ephoto->config->directory);
|
||||||
|
|
||||||
evas_object_show(popup);
|
evas_object_show(popup);
|
||||||
}
|
}
|
||||||
|
@ -2892,8 +2905,8 @@ _fsel_menu_delete_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
button = elm_button_add(popup);
|
button = elm_button_add(popup);
|
||||||
elm_object_text_set(button, _("Yes"));
|
elm_object_text_set(button, _("Yes"));
|
||||||
elm_object_part_content_set(button, "icon", ic);
|
elm_object_part_content_set(button, "icon", ic);
|
||||||
evas_object_smart_callback_add(button, "clicked", _prompt_delete_dir_apply,
|
evas_object_smart_callback_add(button, "clicked",
|
||||||
popup);
|
_prompt_delete_dir_apply, popup);
|
||||||
elm_object_part_content_set(popup, "button1", button);
|
elm_object_part_content_set(popup, "button1", button);
|
||||||
evas_object_show(button);
|
evas_object_show(button);
|
||||||
|
|
||||||
|
@ -3080,8 +3093,8 @@ _click_timer_cb(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_fsel_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
_fsel_mouse_up_cb(void *data, Evas *e EINA_UNUSED,
|
||||||
void *event_info)
|
Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ephoto_Thumb_Browser *tb = data;
|
Ephoto_Thumb_Browser *tb = data;
|
||||||
Evas_Object *menu;
|
Evas_Object *menu;
|
||||||
|
@ -3139,7 +3152,8 @@ _fsel_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
tb);
|
tb);
|
||||||
evas_object_show(menu);
|
evas_object_show(menu);
|
||||||
}
|
}
|
||||||
else if (item && !strncmp(tb->ephoto->config->directory, trash, strlen(trash)))
|
else if (item && !strncmp(tb->ephoto->config->directory,
|
||||||
|
trash, strlen(trash)))
|
||||||
{
|
{
|
||||||
menu = elm_menu_add(tb->main);
|
menu = elm_menu_add(tb->main);
|
||||||
elm_menu_move(menu, x, y);
|
elm_menu_move(menu, x, y);
|
||||||
|
@ -3169,8 +3183,8 @@ _fsel_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_grid_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
_grid_mouse_up_cb(void *data, Evas *e EINA_UNUSED,
|
||||||
void *event_info)
|
Evas_Object *obj EINA_UNUSED, void *event_info)
|
||||||
{
|
{
|
||||||
Ephoto_Thumb_Browser *tb = data;
|
Ephoto_Thumb_Browser *tb = data;
|
||||||
Evas_Object *menu;
|
Evas_Object *menu;
|
||||||
|
@ -3337,7 +3351,8 @@ _key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
Evas_Event_Key_Down *ev = event_info;
|
Evas_Event_Key_Down *ev = event_info;
|
||||||
Eina_Bool ctrl = evas_key_modifier_is_set(ev->modifiers, "Control");
|
Eina_Bool ctrl = evas_key_modifier_is_set(ev->modifiers, "Control");
|
||||||
Eina_Bool shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
|
Eina_Bool shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
|
||||||
Eina_List *selected = eina_list_clone(elm_gengrid_selected_items_get(tb->grid));
|
Eina_List *selected =
|
||||||
|
eina_list_clone(elm_gengrid_selected_items_get(tb->grid));
|
||||||
const char *k = ev->keyname;
|
const char *k = ev->keyname;
|
||||||
|
|
||||||
if (ctrl)
|
if (ctrl)
|
||||||
|
@ -3380,13 +3395,15 @@ _key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
if (tb->ephoto->selentries)
|
if (tb->ephoto->selentries)
|
||||||
eina_list_free(tb->ephoto->selentries);
|
eina_list_free(tb->ephoto->selentries);
|
||||||
tb->ephoto->selentries = NULL;
|
tb->ephoto->selentries = NULL;
|
||||||
tb->ephoto->searchentries = eina_list_clone(tb->searchentries);
|
tb->ephoto->searchentries =
|
||||||
|
eina_list_clone(tb->searchentries);
|
||||||
}
|
}
|
||||||
else if (eina_list_count(selected) > 1)
|
else if (eina_list_count(selected) > 1)
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(selected, s, item)
|
EINA_LIST_FOREACH(selected, s, item)
|
||||||
{
|
{
|
||||||
tb->ephoto->selentries = eina_list_append(tb->ephoto->selentries,
|
tb->ephoto->selentries =
|
||||||
|
eina_list_append(tb->ephoto->selentries,
|
||||||
elm_object_item_data_get(item));
|
elm_object_item_data_get(item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3485,7 +3502,8 @@ _key_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
||||||
{
|
{
|
||||||
EINA_LIST_FOREACH(selected, s, item)
|
EINA_LIST_FOREACH(selected, s, item)
|
||||||
{
|
{
|
||||||
tb->ephoto->selentries = eina_list_append(tb->ephoto->selentries,
|
tb->ephoto->selentries =
|
||||||
|
eina_list_append(tb->ephoto->selentries,
|
||||||
elm_object_item_data_get(item));
|
elm_object_item_data_get(item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3715,14 +3733,14 @@ _top_monitor_created(void *data, int type EINA_UNUSED, void *event)
|
||||||
{
|
{
|
||||||
e->monitor = eio_monitor_add(e->path);
|
e->monitor = eio_monitor_add(e->path);
|
||||||
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED, _monitor_created,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED,
|
||||||
e));
|
_monitor_created, e));
|
||||||
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED, _monitor_deleted,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED,
|
||||||
e));
|
_monitor_deleted, e));
|
||||||
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
e->monitor_handlers = eina_list_append(e->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED, _monitor_modified,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED,
|
||||||
e));
|
_monitor_modified, e));
|
||||||
}
|
}
|
||||||
|
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
|
@ -3940,8 +3958,8 @@ ephoto_thumb_browser_remove(Ephoto *ephoto, Ephoto_Entry *entry)
|
||||||
|
|
||||||
totsize = tb->totsize;
|
totsize = tb->totsize;
|
||||||
if (totsize < 1024.0)
|
if (totsize < 1024.0)
|
||||||
snprintf(isize, sizeof(isize), "%'.0f%s", totsize, ngettext("B",
|
snprintf(isize, sizeof(isize), "%'.0f%s", totsize,
|
||||||
"B", totsize));
|
ngettext("B", "B", totsize));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
totsize /= 1024.0;
|
totsize /= 1024.0;
|
||||||
|
@ -3958,8 +3976,8 @@ ephoto_thumb_browser_remove(Ephoto *ephoto, Ephoto_Entry *entry)
|
||||||
{
|
{
|
||||||
totsize /= 1024.0;
|
totsize /= 1024.0;
|
||||||
if (totsize < 1024)
|
if (totsize < 1024)
|
||||||
snprintf(isize, sizeof(isize), "%'.1f%s", totsize,
|
snprintf(isize, sizeof(isize), "%'.1f%s",
|
||||||
ngettext("GB", "GB", totsize));
|
totsize, ngettext("GB", "GB", totsize));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
totsize /= 1024.0;
|
totsize /= 1024.0;
|
||||||
|
@ -3969,9 +3987,9 @@ ephoto_thumb_browser_remove(Ephoto *ephoto, Ephoto_Entry *entry)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
snprintf(image_info, PATH_MAX, "<b>%s:</b> %d %s <b>%s:</b> %s",
|
snprintf(image_info, PATH_MAX, "<b>%s:</b> %d %s "
|
||||||
_("Total"), tb->totimages, ngettext("image", "images",
|
"<b>%s:</b> %s", _("Total"), tb->totimages,
|
||||||
tb->totimages), _("Size"), isize);
|
ngettext("image", "images", tb->totimages), _("Size"), isize);
|
||||||
elm_object_text_set(tb->infolabel, image_info);
|
elm_object_text_set(tb->infolabel, image_info);
|
||||||
}
|
}
|
||||||
elm_object_item_del(entry->item);
|
elm_object_item_del(entry->item);
|
||||||
|
@ -3997,14 +4015,14 @@ ephoto_thumb_browser_top_dir_set(Ephoto *ephoto, const char *dir)
|
||||||
ephoto->top_directory = eina_stringshare_add(dir);
|
ephoto->top_directory = eina_stringshare_add(dir);
|
||||||
tb->monitor = eio_monitor_add(dir);
|
tb->monitor = eio_monitor_add(dir);
|
||||||
tb->monitor_handlers = eina_list_append(tb->monitor_handlers,
|
tb->monitor_handlers = eina_list_append(tb->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED, _top_monitor_created,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_CREATED,
|
||||||
tb));
|
_top_monitor_created, tb));
|
||||||
tb->monitor_handlers = eina_list_append(tb->monitor_handlers,
|
tb->monitor_handlers = eina_list_append(tb->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED, _top_monitor_deleted,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_DELETED,
|
||||||
tb));
|
_top_monitor_deleted, tb));
|
||||||
tb->monitor_handlers = eina_list_append(tb->monitor_handlers,
|
tb->monitor_handlers = eina_list_append(tb->monitor_handlers,
|
||||||
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED, _top_monitor_modified,
|
ecore_event_handler_add(EIO_MONITOR_DIRECTORY_MODIFIED,
|
||||||
tb));
|
_top_monitor_modified, tb));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -4074,13 +4092,14 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
|
||||||
evas_object_size_hint_align_set(tb->bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(tb->bar, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
|
||||||
if (!tb->ephoto->config->fsel_hide)
|
if (!tb->ephoto->config->fsel_hide)
|
||||||
tb->ficon = elm_toolbar_item_prepend(tb->bar, "system-file-manager", _("Folders"),
|
tb->ficon = elm_toolbar_item_prepend(tb->bar, "system-file-manager",
|
||||||
_ephoto_dir_hide_folders, tb);
|
_("Folders"), _ephoto_dir_hide_folders, tb);
|
||||||
else
|
else
|
||||||
tb->ficon = elm_toolbar_item_prepend(tb->bar, "system-file-manager", _("Folders"),
|
tb->ficon = elm_toolbar_item_prepend(tb->bar, "system-file-manager",
|
||||||
_ephoto_dir_show_folders, tb);
|
_("Folders"), _ephoto_dir_show_folders, tb);
|
||||||
icon =
|
icon =
|
||||||
elm_toolbar_item_append(tb->bar, "view-sort-descending", _("Sort"), NULL, NULL);
|
elm_toolbar_item_append(tb->bar, "view-sort-descending",
|
||||||
|
_("Sort"), NULL, NULL);
|
||||||
elm_toolbar_item_menu_set(icon, EINA_TRUE);
|
elm_toolbar_item_menu_set(icon, EINA_TRUE);
|
||||||
elm_toolbar_menu_parent_set(tb->bar, tb->ephoto->win);
|
elm_toolbar_menu_parent_set(tb->bar, tb->ephoto->win);
|
||||||
menu = elm_toolbar_item_menu_get(icon);
|
menu = elm_toolbar_item_menu_get(icon);
|
||||||
|
@ -4120,7 +4139,8 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
|
||||||
|
|
||||||
tb->leftbox = elm_box_add(tb->table);
|
tb->leftbox = elm_box_add(tb->table);
|
||||||
evas_object_size_hint_weight_set(tb->leftbox, 0.1, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(tb->leftbox, 0.1, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(tb->leftbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(tb->leftbox,
|
||||||
|
EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
|
||||||
hbox = elm_box_add(tb->leftbox);
|
hbox = elm_box_add(tb->leftbox);
|
||||||
elm_box_horizontal_set(hbox, EINA_TRUE);
|
elm_box_horizontal_set(hbox, EINA_TRUE);
|
||||||
|
@ -4244,14 +4264,15 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
|
||||||
evas_object_size_hint_align_set(tb->grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(tb->grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
elm_gengrid_align_set(tb->grid, 0.5, 0.0);
|
elm_gengrid_align_set(tb->grid, 0.5, 0.0);
|
||||||
elm_gengrid_multi_select_set(tb->grid, EINA_TRUE);
|
elm_gengrid_multi_select_set(tb->grid, EINA_TRUE);
|
||||||
elm_gengrid_multi_select_mode_set(tb->grid, ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT);
|
elm_gengrid_multi_select_mode_set(tb->grid,
|
||||||
|
ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT);
|
||||||
elm_scroller_bounce_set(tb->grid, EINA_FALSE, EINA_TRUE);
|
elm_scroller_bounce_set(tb->grid, EINA_FALSE, EINA_TRUE);
|
||||||
evas_object_smart_callback_add(tb->grid, "activated",
|
evas_object_smart_callback_add(tb->grid, "activated",
|
||||||
_ephoto_thumb_activated, tb);
|
_ephoto_thumb_activated, tb);
|
||||||
evas_object_event_callback_add(tb->grid, EVAS_CALLBACK_MOUSE_UP,
|
evas_object_event_callback_add(tb->grid, EVAS_CALLBACK_MOUSE_UP,
|
||||||
_grid_mouse_up_cb, tb);
|
_grid_mouse_up_cb, tb);
|
||||||
elm_drag_item_container_add(tb->grid, ANIM_TIME, DRAG_TIMEOUT, _dnd_item_get,
|
elm_drag_item_container_add(tb->grid, ANIM_TIME, DRAG_TIMEOUT,
|
||||||
_dnd_item_data_get);
|
_dnd_item_get, _dnd_item_data_get);
|
||||||
evas_object_data_set(tb->grid, "thumb_browser", tb);
|
evas_object_data_set(tb->grid, "thumb_browser", tb);
|
||||||
|
|
||||||
_zoom_set(tb, tb->ephoto->config->thumb_size);
|
_zoom_set(tb, tb->ephoto->config->thumb_size);
|
||||||
|
@ -4270,8 +4291,8 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
|
||||||
evas_object_size_hint_weight_set(tb->infolabel, EVAS_HINT_EXPAND, 0.0);
|
evas_object_size_hint_weight_set(tb->infolabel, EVAS_HINT_EXPAND, 0.0);
|
||||||
evas_object_size_hint_align_set(tb->infolabel, EVAS_HINT_FILL,
|
evas_object_size_hint_align_set(tb->infolabel, EVAS_HINT_FILL,
|
||||||
EVAS_HINT_FILL);
|
EVAS_HINT_FILL);
|
||||||
evas_object_size_hint_aspect_set(tb->infolabel, EVAS_ASPECT_CONTROL_VERTICAL,
|
evas_object_size_hint_aspect_set(tb->infolabel,
|
||||||
1, 1);
|
EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
|
||||||
evas_object_show(tb->infolabel);
|
evas_object_show(tb->infolabel);
|
||||||
elm_table_pack(tb->table, tb->infolabel, 0, 1, 5, 1);
|
elm_table_pack(tb->table, tb->infolabel, 0, 1, 5, 1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue