GL_TL_VIEW_EDIT,
GL_TL_VIEW_SHARE,
GL_TL_VIEW_MAX,
+ GL_TL_VIEW_COPY,
} gl_tl_view_e;
typedef struct _gl_tm_t gl_tm_s;
int mode = timeline_d->view_m;
Elm_Object_Item *it = (Elm_Object_Item *)ei;
elm_genlist_item_selected_set(it, EINA_FALSE);
- if (mode != GL_TL_VIEW_EDIT) {
+ if (!(mode == GL_TL_VIEW_EDIT || mode == GL_TL_VIEW_COPY)) {
gl_dbgE("not edit mode");
return;
}
return layout;
} else if (!g_strcmp0(part, GL_THUMB_CHECKBOX)) {
Evas_Object *ck = NULL;
- if (mode == GL_TL_VIEW_EDIT) {
+ if (mode == GL_TL_VIEW_EDIT || mode == GL_TL_VIEW_COPY) {
ck = elm_check_add(obj);
GL_CHECK_NULL(ck);
return ck;
} else if (!g_strcmp0(part, "elm_image_open_icon_swallow_blocker")) {
Evas_Object *btn1 = NULL;
- if (mode == GL_TL_VIEW_EDIT) {
+ if (mode == GL_TL_VIEW_EDIT || mode == GL_TL_VIEW_COPY) {
btn1 = evas_object_rectangle_add(evas_object_evas_get(obj));
evas_object_color_set(btn1, 0, 255, 0, 0);
evas_object_propagate_events_set(btn1, EINA_FALSE);
return btn1;
} else if (!g_strcmp0(part, "elm_image_open_icon_swallow")) {
Evas_Object *btn = NULL;
- if (mode == GL_TL_VIEW_EDIT) {
+ if (mode == GL_TL_VIEW_EDIT || mode == GL_TL_VIEW_COPY) {
btn = elm_button_add(obj);
elm_object_style_set(btn, "transparent");
evas_object_show(btn);
if (!g_strcmp0(pPart, "select.all.data.check")) {
Evas_Object *ck = NULL;
- if (mode == GL_TL_VIEW_EDIT) {
+ if (mode == GL_TL_VIEW_EDIT || mode == GL_TL_VIEW_COPY) {
ck = elm_check_add(pObject);
GL_CHECK_NULL(ck);
int win_h = 0;
char *style = NULL;
_gl_get_win_factor(ad->maininfo.win, &win_w, &win_h);
- if (_gl_is_timeline_edit_mode(data)) {
+ if (_gl_is_timeline_edit_mode(data) || _gl_is_timeline_edit_copy_mode(data)) {
ad->pinchinfo.zoom_level = GL_ZOOM_IN_ONE;
}
if ((rotate_mode == APP_DEVICE_ORIENTATION_270) ||
if (!update) {
_gl_data_get_items(-1, -1, &list);
_gl_time_finialize_media_data(timeline_d);
- if (timeline_d->view_m == GL_TL_VIEW_EDIT) {
+ if (timeline_d->view_m == GL_TL_VIEW_EDIT || timeline_d->view_m == GL_TL_VIEW_COPY) {
_gl_time_update_selected_media(timeline_d, list);
}
timeline_d->data_list = list;
__gl_timeline_change_mode(data, GL_TL_VIEW_EDIT);
}
+static void __gl_timeline_copy_cb(void *data, Evas_Object *obj, void *ei)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ _gl_ctxpopup_del(data);
+ if (ad->uginfo.ug) {
+ /**
+ * Prevent changed to edit view in wrong way.
+ * 1. When invoke imageviewer UG;
+ */
+ gl_dbgW("UG invoked!");
+ return;
+ }
+ __gl_timeline_change_mode(data, GL_TL_VIEW_COPY);
+}
+
static void __gl_albums_viewas_pop_cb(void *data, Evas_Object *obj, void *ei)
{
gl_dbg("ENTRY");
__gl_timeline_change_mode(data, GL_TL_VIEW_NORMAL);
}
+#endif
+
/* 'Move medias' is only available in tab Albums */
static int __gl_timeline_move_copy_op(void *data)
{
return 0;
}
-static int __gl_timeline_move_copy(void *data)
+int __gl_timeline_move_copy(void *data)
{
GL_CHECK_VAL(data, -1);
gl_appdata *ad = (gl_appdata *)data;
*/
if (ad->albuminfo.path == NULL) {
gl_dbg("New album");
- if (gl_make_new_album(ad->albuminfo.new_name) != 0) {
+ if (gl_make_new_album(ad->albuminfo.new_name) == false) {
gl_popup_create_popup(ad, GL_POPUP_NOBUT,
GL_STR_SAME_NAME_ALREADY_IN_USE);
gl_dbgE("Failed to make a new directory!");
return -1;
}
+#if 0
/* move media to album in edit view */
static void __gl_timeline_move_cb(void *data, Evas_Object *obj, void *ei)
{
}
/* move media to album in edit view */
-static void __gl_timeline_copy_cb(void *data, Evas_Object *obj, void *ei)
+static void _gl_timeline_copy_cb(void *data, Evas_Object *obj, void *ei)
{
GL_CHECK(data);
_gl_ctxpopup_del(data);
gl_appdata *ad = (gl_appdata *)data;
GL_CHECK(ad->tlinfo);
gl_timeline_s *timeline_d = ad->tlinfo;
- gl_dbg("");
if (__gl_timeline_get_sel_cnt(timeline_d) == 0) {
gl_dbgW("No thumbs selected!");
/* Sort */
_gl_ctxpopup_append(parent, GL_STR_SORT,
__gl_timeline_sort_cb, data);
+ /* Copy to album */
+ _gl_ctxpopup_append(parent, GL_STR_ID_COPY_TO_ALBUM,
+ __gl_timeline_copy_cb, data);
#ifdef SUPPORT_SLIDESHOW
/* Slide show */
_gl_ctxpopup_append(parent, GL_STR_ID_SLIDESHOW,
/* Check MMC state for cancel operation */
gl_check_mmc_state(ad, NULL);
gl_dbg("MMC state: %d.", ad->maininfo.mmc_state);
- _gl_db_update_lock_always(data, true);
- _gl_set_file_op_cbs(data, __gl_timeline_del_op, NULL,
- __gl_timeline_update_del_view, cnt);
- _gl_use_thread_operate_medias(ad, GL_STR_ID_DELETING, cnt,
- GL_MEDIA_OP_DELETE_TIMELINE);
+
+ if (ad->tlinfo->view_m == GL_TL_VIEW_COPY) {
+ gl_dbg("copy operation from time view");
+ _gl_popup_create_copy_move(data, __gl_timeline_get_sel_cnt, data);
+ } else {
+ _gl_db_update_lock_always(data, true);
+ _gl_set_file_op_cbs(data, __gl_timeline_del_op, NULL,
+ __gl_timeline_update_del_view, cnt);
+ _gl_use_thread_operate_medias(ad, GL_STR_ID_DELETING, cnt,
+ GL_MEDIA_OP_DELETE_TIMELINE);
+ }
+
}
/* Select-all checkbox selected/deselected */
break;
case GL_TL_VIEW_EDIT:
case GL_TL_VIEW_SHARE:
+ case GL_TL_VIEW_COPY:
GL_GFREEIF(ad->tlinfo->sel_d);
ad->tlinfo->sel_d = g_new0(gl_sel_s, 1);
GL_CHECK_VAL(ad->tlinfo->sel_d, -1);
_gl_ui_change_navi_title(ad->tlinfo->nf_it, GL_STR_ID_SELECT_ITEM,
false);
- if (GL_TL_VIEW_EDIT == mode) {
+ if (GL_TL_VIEW_EDIT == mode || GL_TL_VIEW_COPY == mode) {
__gl_timeline_edit_add_btns(data);
}
#ifdef GL_EXTENDED_FEATURES
__gl_timeline_reset_btns(data);
/* Update naviframe item title */
__gl_timeline_reset_label(data);
+
+ if (ad->popupinfo.popup) {
+ gl_dbg("updating genlist");
+ _gl_update_copy_move_popup(data);
+ }
return 0;
}
} else {
elm_object_signal_emit(ad->tlinfo->parent, "timelineview,portrait", "");
}
- if (ad->tlinfo->view_m == GL_TL_VIEW_EDIT) {
+ if (ad->tlinfo->view_m == GL_TL_VIEW_EDIT || ad->tlinfo->view_m == GL_TL_VIEW_COPY) {
elm_object_signal_emit(ad->ctrlinfo.ctrlbar_view_ly, "elm,selectall,state,visible,bg", "elm");
elm_object_signal_emit(ad->ctrlinfo.ctrlbar_view_ly, "elm,selectall,state,visible", "elm");
}
}
return false;
}
+
+bool _gl_is_timeline_edit_copy_mode(void *data)
+{
+ GL_CHECK_FALSE(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_FALSE(ad->tlinfo);
+ if (ad->tlinfo->view_m == GL_TL_VIEW_COPY) {
+ return true;
+ }
+ return false;
+}
ad->popupinfo.popup = NULL;
ad->albuminfo.path = NULL;
ad->albuminfo.file_mc_mode = GL_MC_COPY;
- if (_gl_thumbs_get_edit_mode(data) == GL_THUMBS_EDIT_COPY) {
+ if (_gl_thumbs_get_edit_mode(data) == GL_THUMBS_EDIT_COPY || _gl_is_timeline_edit_copy_mode(ad)) {
ad->albuminfo.file_mc_mode = GL_MC_COPY;
} else if (_gl_thumbs_get_edit_mode(data) == GL_THUMBS_EDIT_MOVE) {
ad->albuminfo.file_mc_mode = GL_MC_MOVE;
}
- _gl_albums_new_create_view(ad, gl_move_copy_to_album);
+ if (_gl_is_timeline_edit_copy_mode(ad)) {
+ _gl_albums_new_create_view(ad, __gl_timeline_move_copy);
+ } else {
+ _gl_albums_new_create_view(ad, gl_move_copy_to_album);
+ }
return;
}
__gl_thumbs_edit_copy_cb(ad, NULL, NULL);
} else if (_gl_thumbs_get_edit_mode(ad) == GL_THUMBS_EDIT_MOVE) {
__gl_thumbs_edit_move_cb(ad, NULL, NULL);
+ } else if (_gl_is_timeline_edit_copy_mode(ad)) {
+ if (ad->popupinfo.popup) {
+ evas_object_del(ad->popupinfo.popup);
+ }
+ ad->albuminfo.file_mc_mode = GL_MC_COPY;
+ __gl_timeline_move_copy(ad);
}
return;
}
Evas_Object *popup = elm_popup_add(parent);
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
- if (_gl_thumbs_get_edit_mode(data) == GL_THUMBS_EDIT_COPY) {
+ if (_gl_thumbs_get_edit_mode(data) == GL_THUMBS_EDIT_COPY || _gl_is_timeline_edit_copy_mode(ad)) {
_gl_ui_set_translate_part_str(popup, "title,text", GL_STR_ID_COPY);
} else if (_gl_thumbs_get_edit_mode(data) == GL_THUMBS_EDIT_MOVE) {
_gl_ui_set_translate_part_str(popup, "title,text", GL_STR_ID_MOVE);