/*
-* Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+ * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
#include <stdio.h>
#include <dbus/dbus.h>
#include "mf-search-view.h"
#include "mf-media-content.h"
+#include "mf-compress.h"
+#include "mf-minizip.h"
+#include "mf-miniunzip.h"
+#include <string.h>
+
#include "mf-ug-detail.h"
#include "mf-file-util.h"
#define MF_SHARE_ITEM_COUNT_MAX 500
#define MF_POPUP_MENUSTYLE_HEIGHT(x) (52*x)
#define MF_SORT_BY_ITEM 6
+
+/*#define _WDLOG_PRINT(prio, fmt, args...) \
+ dlog_print( prio, "MYFILES", "%s: %s(%d) > " fmt, _WFILE_NAME, _func_, _LINE_, ##args)
+#define WDEBUG(fmt, args...) _WDLOG_PRINT(DLOG_DEBUG, fmt, ##args)
+ */
+
struct appdata *temp_data;
/* mutex for refresh */
/* mutex for dbus message */
int g_mf_create_thumbnail_count = 0;
#define MF_MAX_MAKE_THUNBNAIL_COUNT 10
-void mf_callback_cancel_cb(void *data, Evas_Object *obj, void *event_info);
+//static Eina_List *edit_file_list = NULL;
+char new_filename[1000] ={0,};
+char *str[1000] = {0,};
+
static void __mf_callback_mmc_removed(void *data, MF_STORAGE storage);
Eina_Bool mf_callback_is_duplicated_without_case(Eina_List *folder_list, char *name);
}
/******************************
-** Prototype : mf_callback_warning_popup_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_warning_popup_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_warning_popup_cb(void *data, Evas_Object *obj, void *event_info)
{
struct appdata *ap = (struct appdata *)data;
}
/******************************
-** Prototype : mf_callback_app_rotate_cb
-** Description :
-** Input : enum appcore_rm mode
-** void *data
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_app_rotate_cb
+ ** Description :
+ ** Input : enum appcore_rm mode
+ ** void *data
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_app_rotate_cb(void *data, Evas_Object *obj, void *event)
{
MF_TRACE_BEGIN;
break;
}
ug_send_event(new_event);
- */
+ */
const char *config = elm_config_profile_get();
if (!strcmp(config, "desktop")) {
return;
} else {
if (changed_angle == APP_DEVICE_ORIENTATION_90 || changed_angle == APP_DEVICE_ORIENTATION_270) {
evas_object_size_hint_min_set(ap->mf_MainWindow.pPopupBox, -1,
- ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(MF_SORT_BY_ITEM / 2)));
+ ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(MF_SORT_BY_ITEM / 2)));
} else {
evas_object_size_hint_min_set(ap->mf_MainWindow.pPopupBox, -1,
- ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(MF_SORT_BY_ITEM)));
+ ELM_SCALE_SIZE(MF_POPUP_MENUSTYLE_HEIGHT(MF_SORT_BY_ITEM)));
}
if (ap->mf_Status.view_type != mf_view_root_category && ap->mf_Status.view_type != mf_view_recent && ap->mf_Status.view_type != mf_view_storage) {
mf_navi_bar_pathinfo_refresh(ap);
}
/******************************
-** Prototype : click_callback
-** Description :
-** Input : struct appdata* data
-** mfAction key
-** GString* path
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : click_callback
+ ** Description :
+ ** Input : struct appdata* data
+ ** mfAction key
+ ** GString* path
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_upper_click_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
}
/******************************
-** Prototype : mf_callback_illegal_char_popup_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_illegal_char_popup_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_illegal_char_popup_cb(void *data, Evas_Object *obj, void *event_info)
{
struct appdata *ap = (struct appdata *)data;
}
/******************************
-** Prototype : mf_callback_cancel_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_cancel_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
+
+void mf_rename_done_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ struct appdata *ap = (struct appdata *)data;
+
+
+
+ ap->new_file = strdup(elm_entry_entry_get(ap->mf_MainWindow.pEntry));
+
+ mf_debug("entry content is %s", ap->new_file);
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
+ mf_file_compression_start(ap);
+}
+
void mf_callback_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
mf_retm_if(ap->mf_Status.path == NULL, "ap->mf_Status.path is NULL");
mf_retm_if(ap->mf_Status.path->str == NULL, "ap->mf_Status.path->str is NULL");
- mf_error("more is [%d]", ap->mf_Status.more);
+ mf_error("more is [%d], extra is [%d]", ap->mf_Status.more, ap->mf_Status.extra);
Evas_Object *newContent;
//mf_object_enable_virtualkeypad();
break;
case MORE_EDIT:
case MORE_EDIT_COPY:
+ case MORE_COMPRESS:
+ case MORE_DECOMPRESS:
case MORE_EDIT_MOVE:
case MORE_EDIT_DELETE:
case MORE_EDIT_DETAIL:
if (ap->mf_Status.view_type != mf_view_root) {
mf_navi_add_back_button(ap, mf_callback_navi_backbutton_clicked_cb);
-// Evas_Object *pImage = elm_image_add(ap->mf_MainWindow.pNaviLayout);
-// elm_image_file_set(pImage, EDJ_IMAGE, MF_ICON_SOFT_BACK);
-// elm_image_resizable_set(pImage, EINA_TRUE, EINA_TRUE);
-// evas_object_show(pImage);
-//
-// Evas_Object *btn = elm_button_add(ap->mf_MainWindow.pNaviLayout);
-// elm_object_content_set(btn,pImage);
-// elm_object_style_set(btn, "transparent");
-// evas_object_smart_callback_add(btn, "clicked", mf_callback_backbutton_clicked_cb, ap);
-// //elm_object_part_content_set(ap->mf_MainWindow.pNaviLayout, "back_key", btn);
-// elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, "title_left_btn", btn);
+ // Evas_Object *pImage = elm_image_add(ap->mf_MainWindow.pNaviLayout);
+ // elm_image_file_set(pImage, EDJ_IMAGE, MF_ICON_SOFT_BACK);
+ // elm_image_resizable_set(pImage, EINA_TRUE, EINA_TRUE);
+ // evas_object_show(pImage);
+ //
+ // Evas_Object *btn = elm_button_add(ap->mf_MainWindow.pNaviLayout);
+ // elm_object_content_set(btn,pImage);
+ // elm_object_style_set(btn, "transparent");
+ // evas_object_smart_callback_add(btn, "clicked", mf_callback_backbutton_clicked_cb, ap);
+ // //elm_object_part_content_set(ap->mf_MainWindow.pNaviLayout, "back_key", btn);
+ // elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, "title_left_btn", btn);
}
if (ap->mf_Status.more == MORE_DEFAULT) {
}
/******************************
-** Prototype : __mf_popup_show_vk_cb
-** Description : Samsung
-** Input : void *data
-** Evas_Object * obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : __mf_popup_show_vk_cb
+ ** Description : Samsung
+ ** Input : void *data
+ ** Evas_Object * obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_popup_show_vk_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
}
/******************************
-** Prototype : mf_callback_rename_save_cb
-** Description :
-** Input : void *ad
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_rename_save_cb
+ ** Description :
+ ** Input : void *ad
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
static int __mf_callback_idle_rename_refresh(void *data)
{
struct appdata *ap = (struct appdata *)data;
} else {
goto NORMAL_EXIT;
}
-NORMAL_EXIT:
+ NORMAL_EXIT:
SAFE_FREE_CHAR(strstrip_name);
SAFE_FREE_CHAR(pName);
SAFE_FREE_CHAR(pFullPath);
MF_TRACE_END;
return;
-INVAILD_NAME_EXIT:
+ INVAILD_NAME_EXIT:
SAFE_FREE_CHAR(strstrip_name);
SAFE_FREE_CHAR(pName);
SAFE_FREE_CHAR(pFullPath);
//ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_TWO_BTN, NULL, message,LABEL_CANCEL, MF_BUTTON_LABEL_OK, NULL, mf_callback_illegal_char_popup_cb, ap);
mf_callback_entry_unfocus(pEntry);
mf_popup_second_popup_create(ap, ap->mf_MainWindow.pWindow, message,
- MF_BUTTON_LABEL_OK, mf_popup_show_vk_cb, ap);
+ MF_BUTTON_LABEL_OK, mf_popup_show_vk_cb, ap);
mf_callback_monitor_media_db_update_flag_set(EINA_FALSE);
mf_callback_monitor_internal_update_flag_set(EINA_FALSE);
return;
MF_TRACE_END;
return;
-ALLOC_FAILED_EXIT:
+ ALLOC_FAILED_EXIT:
SAFE_FREE_CHAR(strstrip_name);
SAFE_FREE_CHAR(pName);
SAFE_FREE_CHAR(pFullPath);
}
/******************************
-** Prototype : mf_callback_rename_save_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_rename_save_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_popup_error_exit_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
SAFE_FREE_CHAR(name);
return;
-ERROR_WARNING_EXIT:
+ ERROR_WARNING_EXIT:
SAFE_FREE_CHAR(name);
SAFE_FREE_CHAR(fullpath);
mf_callback_entry_unfocus(ap->mf_MainWindow.pEntry);
mf_popup_warning_popup_create(ap, ap->mf_MainWindow.pWindow, MF_POP_MAX_WARNING_TITEL, message, MF_BUTTON_LABEL_OK, mf_popup_show_vk_cb, ap);
return;
-ERROR_EXIT_CREATE:
+ ERROR_EXIT_CREATE:
SAFE_FREE_CHAR(name);
SAFE_FREE_CHAR(fullpath);
ap->mf_Status.more = ap->mf_Status.pre_create_more;
ap->mf_MainWindow.pEntry = NULL;
SAFE_FREE_OBJ(ap->mf_MainWindow.pNewFolderPopup);
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, message,
- MF_BUTTON_LABEL_OK, NULL, NULL, mf_popup_error_exit_cb, ap);
+ MF_BUTTON_LABEL_OK, NULL, NULL, mf_popup_error_exit_cb, ap);
return;
}
/******************************
-** Prototype : __mf_callback_list_by_response_cb
-** Description : Samsung
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : __mf_callback_list_by_response_cb
+ ** Description : Samsung
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_list_by_response_cb(void *data, Evas_Object *obj, void *event_info)
{
struct appdata *ap = (struct appdata *)data;
}
/******************************
-** Prototype : mf_callback_list_by_view_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_list_by_view_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_list_by_view_cb(void *data, Evas_Object *obj, void *event_info)
{
mf_debug();
}
/******************************
-** Prototype : mf_callback_edit_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_edit_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
static void __mf_callback_save_edit_view_status(void *data)
{
MF_TRACE_BEGIN;
MF_TRACE_END;
}
-void mf_callback_edit_shortcut_cb(void *data, Evas_Object *obj, void *event_info)
+void mf_callback_edit_compress_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
SAFE_FREE_OBJ(ap->mf_MainWindow.pContextPopup);
SAFE_FREE_OBJ(ap->mf_MainWindow.pLongpressPopup);
+ if (ap->mf_MainWindow.pButton) {
+ elm_object_part_content_unset(ap->mf_MainWindow.pNaviLayout, "search_icon");
+ evas_object_hide(ap->mf_MainWindow.pButton);
+ }
- ap->mf_Status.more = MORE_EDIT_ADD_SHORTCUT;
+ if (ap->mf_Status.more == MORE_SEARCH) {
+ if (ap->mf_MainWindow.pNaviSearchBar) {
+ elm_object_signal_emit(ap->mf_MainWindow.pNaviLayout, "hide", "search_bar");
+ elm_object_signal_emit(ap->mf_MainWindow.pNaviLayout, "show", "elm.swallow.content");
+ //ap->mf_Status.extra = MORE_SHARE_EDIT;
+ }
+ } else {
+ ap->mf_Status.extra = MORE_SHARE_EDIT;
+ }
+ ap->mf_Status.more = MORE_COMPRESS;
__mf_callback_edit_share_view(ap);
/*disable all the tab item if tab exists */
MF_TRACE_END;
}
+void mf_callback_edit_decompress_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ MF_TRACE_BEGIN;
+ struct appdata *ap = (struct appdata *)data;
+ mf_retm_if(ap == NULL, "ap is NULL");
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pContextPopup);
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pLongpressPopup);
+ if (ap->mf_MainWindow.pButton) {
+ elm_object_part_content_unset(ap->mf_MainWindow.pNaviLayout, "search_icon");
+ evas_object_hide(ap->mf_MainWindow.pButton);
+ }
+
+ if (ap->mf_Status.more == MORE_SEARCH) {
+ if (ap->mf_MainWindow.pNaviSearchBar) {
+ elm_object_signal_emit(ap->mf_MainWindow.pNaviLayout, "hide", "search_bar");
+ elm_object_signal_emit(ap->mf_MainWindow.pNaviLayout, "show", "elm.swallow.content");
+ //ap->mf_Status.extra = MORE_SHARE_EDIT;
+ }
+ } else {
+ ap->mf_Status.extra = MORE_SHARE_EDIT;
+ }
+ ap->mf_Status.more = MORE_DECOMPRESS;
+ __mf_callback_edit_share_view(ap);
+
+ /*disable all the tab item if tab exists */
+ MF_TRACE_END;
+
+
+}
+
void mf_callback_edit_rename_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
EINA_LIST_FOREACH(selected_list, l, it) {
if (it) {
item_data = elm_object_item_data_get(it);
- {
+ {
mfItemData_s *select_item = (mfItemData_s *)item_data;
if (select_item && select_item->m_ItemName && select_item->m_ItemName->str) {
mf_util_db_remove_shortcut(ap->mf_MainWindow.mfd_handle, select_item->m_ItemName->str);
int count = mf_edit_file_count_get();
if (count > 1) {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, MF_LABEL_DELETE_SHORTCUT,
- MF_LABEL_DELETE_SHORTCUTS_Q,
- LABEL_CANCEL, LABEL_DELETE, mf_callback_do_delete_shortcut_cb, ap, count);
+ MF_LABEL_DELETE_SHORTCUTS_Q,
+ LABEL_CANCEL, LABEL_DELETE, mf_callback_do_delete_shortcut_cb, ap, count);
} else {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, MF_LABEL_DELETE_ITEM,
- MF_LABEL_DELETE_THIS_SHORTCUT,
- LABEL_CANCEL, LABEL_DELETE, mf_callback_do_delete_shortcut_cb, ap, count);
+ MF_LABEL_DELETE_THIS_SHORTCUT,
+ LABEL_CANCEL, LABEL_DELETE, mf_callback_do_delete_shortcut_cb, ap, count);
}
}
int count = mf_edit_file_count_get();
if (count > 1) {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, MF_LABEL_REMOVE,
- MF_LABEL_DELETE_RECENT_Q,
- LABEL_CANCEL, MF_LABEL_REMOVE, mf_callback_do_delete_recent_files, ap, count);
+ MF_LABEL_DELETE_RECENT_Q,
+ LABEL_CANCEL, MF_LABEL_REMOVE, mf_callback_do_delete_recent_files, ap, count);
} else {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, MF_LABEL_REMOVE,
- MF_LABEL_DELETE_THIS_RECENT,
- LABEL_CANCEL, MF_LABEL_REMOVE, mf_callback_do_delete_recent_files, ap, count);
+ MF_LABEL_DELETE_THIS_RECENT,
+ LABEL_CANCEL, MF_LABEL_REMOVE, mf_callback_do_delete_recent_files, ap, count);
}
}
mf_retm_if(data == NULL, "data is NULL");
struct appdata *ap = (struct appdata *)data;
- {
+ {
int location = mf_fm_svc_wrapper_get_location(ap->mf_Status.path->str);
bool find = mf_util_db_find_shortcut(ap->mf_MainWindow.mfd_handle, ap->mf_Status.path->str, mf_file_get(ap->mf_Status.path->str), location);
mf_error("find is [%d]", find);
}
/******************************
-** Prototype : mf_callback_icu_update_cb
-** Description :
-** Input : void *data
-** Output : int
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2011/06/30
-** Author : Samsung
-** Modification : Created function
-**/
+ ** Prototype : mf_callback_icu_update_cb
+ ** Description :
+ ** Input : void *data
+ ** Output : int
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2011/06/30
+ ** Author : Samsung
+ ** Modification : Created function
+ **/
void mf_callback_icu_update_cb(app_event_info_h event_info, void *data)
{
/*
ug_send_event(UG_EVENT_REGION_CHANGE);
- */
+ */
mf_debug("region changed");
assert(data);
struct appdata *ap = (struct appdata *)data;
}
/******************************
-** Prototype : mf_callback_new_folder_create_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_new_folder_create_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_new_folder_create_cb(void *data, Evas_Object *obj, void *event_info)
{
mf_debug();
struct appdata *ap = (struct appdata *)data;
mf_retm_if(ap == NULL, "ap is NULL");
evas_object_smart_callback_del(ap->mf_MainWindow.pEntry, "clicked", (Evas_Smart_Cb) mf_callback_clicked_cb);
-// elm_entry_select_none(ap->mf_MainWindow.pEntry);
+ // elm_entry_select_none(ap->mf_MainWindow.pEntry);
MF_TRACE_END;
}
}
/******************************
-** Prototype : mf_callback_init_operation_cancel
-** Description : Samsung
-** Input : void *data
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_init_operation_cancel
+ ** Description : Samsung
+ ** Input : void *data
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_init_operation_cancel(void *data)
{
MF_TRACE_BEGIN;
}
/******************************
-** Prototype : __mf_callback_idle_refresh
-** Description : Samsung
-** Input : void *data
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : __mf_callback_idle_refresh
+ ** Description : Samsung
+ ** Input : void *data
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
static int __mf_callback_idle_refresh(void *data)
{
MF_TRACE_BEGIN;
}
/******************************
-** Prototype : __mf_callback_progress_bar_state_cb
-** Description : Samsung
-** Input : void *data
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : __mf_callback_progress_bar_state_cb
+ ** Description : Samsung
+ ** Input : void *data
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_progress_bar_state_cb(void *data)
{
MF_TRACE_BEGIN;
total_count = ap->mf_FileOperation.iTotalCount;
count = msg->current_index;
mf_error("processing ,current_size[%d], total_size[%ld]", msg->current_size,
- msg->total_size);
+ msg->total_size);
value = (double)msg->current_size / msg->total_size;
//add protection to avoid the percent passed 100%
if (value > 1 && count <= total_count) {
}
/******************************
-** Prototype : mf_callback_progress_bar_cancel_cb
-** Description : Samsung
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_progress_bar_cancel_cb
+ ** Description : Samsung
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_progress_bar_cancel_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
}
/******************************
-** Prototype : mfCopyCB
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mfCopyCB
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_item_copy_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
MF_TRACE_END;
}
+void * mf_callback_compress_cb(void *data)
+{
+ MF_TRACE_BEGIN;
+ struct appdata *ap = (struct appdata *)data;
+ if (ap == NULL)
+ return NULL;
+
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pContextPopup);
+
+
+ Eina_List *folder_list = NULL, *file_list = NULL;
+ Eina_List *l = NULL;
+ GString *it = NULL;
+ Eina_List *source_folder_list = NULL, *source_file_list = NULL;
+ if (ap->mf_FileRecordList.value_saver != NULL) {
+
+ mf_util_free_eina_list_with_data(&ap->mf_FileRecordList.value_saver, MYFILE_TYPE_GSTRING);
+ ap->mf_FileRecordList.value_saver = NULL;
+ }
+ ap->mf_FileRecordList.value_saver = mf_edit_get_all_selected_files();
+ if (ap->mf_FileOperation.source != NULL) {
+ g_string_free(ap->mf_FileOperation.source, TRUE);
+ ap->mf_FileOperation.source = NULL;
+ }
+ ap->mf_FileOperation.source = g_string_new(ap->mf_Status.path->str);
+
+ if (source_folder_list != NULL) {
+ mf_util_free_eina_list_with_data(&source_folder_list, MYFILE_TYPE_GSTRING);
+ source_folder_list = NULL;
+ }
+ source_folder_list = mf_get_selected_folders();
+
+
+ if (source_file_list != NULL) {
+ mf_util_free_eina_list_with_data(&source_file_list, MYFILE_TYPE_GSTRING);
+ source_file_list = NULL;
+ }
+ source_file_list = mf_get_selected_files();
+
+
+ char *dest_name;
+
+ if (!ap->new_file) {
+ if(mf_util_get_eina_list_len(source_file_list) + mf_util_get_eina_list_len(source_folder_list) == 1){
+ if(mf_util_get_eina_list_len(source_file_list) == 1){
+ l = source_file_list;
+
+ }
+ if(mf_util_get_eina_list_len(source_folder_list) == 1){
+ l = source_folder_list;
+ }
+ it = eina_list_data_get(l);
+ dest_name = g_strdup(it->str);
+ } else{
+ dest_name = g_strdup(ap->mf_FileOperation.source->str);
+ }
+
+ dest_name = strrchr(dest_name, '/');
+ dest_name++;
+ } else {
+ dest_name = strdup(ap->new_file);
+ }
+
+ if (mf_util_get_eina_list_len(ap->mf_FileRecordList.value_saver) < 1) {
+ ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_LABEL_NOTHING_SELECTED,
+ MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
+ return NULL;
+ }
+
+ EINA_LIST_FOREACH(source_folder_list, l, it){
+ if (folder_list) {
+ mf_util_free_eina_list_with_data(&(folder_list), MYFILE_TYPE_FSNODE);
+ }
+ if (file_list) {
+ mf_util_free_eina_list_with_data(&(file_list), MYFILE_TYPE_FSNODE);
+ }
+ if(it && it->str){
+ mf_util_generate_list_data(it->str, &folder_list, &file_list);
+ mf_error("\n%s:", it->str);
+ }
+
+ Eina_List *l2 = NULL;
+ fsNodeInfo *pNode2 = NULL;
+ for (l2 = folder_list, pNode2 = eina_list_data_get(l2); l2; l2 = eina_list_next(l2), pNode2 = eina_list_data_get(l2)){
+ if(pNode2 && pNode2->name){
+ char *real_name = g_strconcat(pNode2->path, "/", pNode2->name, NULL);
+ GString *pTemp = g_string_new(real_name);
+ source_folder_list = eina_list_append(source_folder_list, pTemp);
+ mf_error("\n>>>%s", real_name);
+ }
+ }
+ for (l2 = file_list, pNode2 = eina_list_data_get(l2); l2; l2 = eina_list_next(l2), pNode2 = eina_list_data_get(l2)){
+ if(pNode2 && pNode2->name){
+ char *real_name = g_strconcat(pNode2->path, "/", pNode2->name, NULL);
+ GString *pTemp = g_string_new(real_name);
+ source_file_list = eina_list_append(source_file_list, pTemp);
+
+ mf_error("\n>>>%s", real_name);
+ }
+ }
+
+ }
+
+ EINA_LIST_FOREACH(source_file_list, l, it) {
+ if (it && it->str) {
+ mf_error("\nFiles : %s", it->str);
+ }
+ else{
+ mf_error("\nFiles : %d", 0);
+ }
+ }
+
+ int argc = mf_util_get_eina_list_len(source_file_list) + 2;
+ char **argv = (char **)malloc(argc*sizeof(char *));
+ argv[0] = (char*)malloc(sizeof(char)*10);
+ strcpy(argv[0], "minizip");
+ argv[1] = (char*)malloc(sizeof(char)*strlen(dest_name));
+ strcpy(argv[1], dest_name);
+ int i = 2;
+ EINA_LIST_FOREACH(source_file_list, l, it){
+ char *source_name = g_strdup(it->str);
+ int n = strlen(ap->mf_FileOperation.source->str) + 1;
+ source_name += n;
+ argv[i] = (char*)malloc(sizeof(char)*strlen(source_name));
+ strcpy(argv[i], source_name);
+ i++;
+ }
+
+ mf_file_do_zip(argc, argv, ap->mf_FileOperation.source->str);
+
+ ap->mf_Status.view_type = mf_view_normal;
+ mf_debug("thread function done");
+ // ap->new_file = NULL;
+ MF_TRACE_END;
+ pthread_exit(0);
+ return NULL;
+}
+
+void mf_callback_compress_replace_cb(void *data , Evas_Object *obj, void *event_info)
+{
+ struct appdata *ap = (struct appdata *)data;
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
+ mf_file_compression_start(ap);
+}
+
+void mf_callback_compress_rename_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ struct appdata *ap = (struct appdata *)data;
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
+
+ Evas_Object *popup;
+ popup = elm_popup_add(ap->mf_MainWindow.pMainLayout);
+ elm_object_signal_emit(popup, "elm,action,center_popup,entry", "");
+
+ Evas_Object *layout = mf_popup_entry_layout_create(popup);
+ elm_object_content_set(popup, layout);
+
+ Evas_Object *en = NULL;
+ en = mf_popup_entry_create(layout);
+ elm_object_part_content_set(layout, "elm.swallow.content", en);
+
+ char *text = strdup(str);
+
+ text = strrchr(text,'/');
+ text++;
+ char * ext = strrchr(text, '.');
+ if(ext){
+ *ext = '\0';
+ }
+
+ elm_entry_entry_set(en, text);
+ elm_entry_select_all(en);
+
+ mf_object_text_set(popup, LABEL_RENAME_CHAP, "title,text");
+
+ Evas_Object *btn1 = mf_object_create_button(popup,
+ NULL, //"popup_button/default",
+ LABEL_CANCEL,
+ NULL,
+ mf_callback_cancel_cb,
+ ap,
+ EINA_FALSE);
+
+ Evas_Object *btn2 = mf_object_create_button(popup,
+ NULL, //"popup_button/default",
+ LABEL_RENAME,//Change MF_LABEL_DONE to MF_BUTTON_LABEL_OK for fixing(P131029-02752).
+ NULL,
+ mf_rename_done_cb,
+ ap,
+ EINA_FALSE);
+
+ elm_object_part_content_set(popup, "button1", btn1);
+ elm_object_part_content_set(popup, "button2", btn2);
+
+ evas_object_show(popup);
+ // evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, mf_popup_new_folder_del_cb, ap);
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, eext_popup_back_cb, NULL);
+ // evas_object_data_set(popup, "item_data", params);
+ elm_entry_cursor_end_set(en);
+ ap->mf_MainWindow.pEntry = en;
+ ap->mf_MainWindow.pNormalPopup = popup;
+ // evas_object_show(en);
+ // mf_file_compression_start(ap);
+}
+
+void mf_callback_decompress_cb(void *data)
+{
+ MF_TRACE_BEGIN;
+ struct appdata *ap = (struct appdata *)data;
+ mf_retm_if(ap == NULL, "ap is NULL");
+ unzFile uf=NULL;
+ int i;
+
+ if (ap->mf_FileOperation.source != NULL) {
+ g_string_free(ap->mf_FileOperation.source, TRUE);
+ ap->mf_FileOperation.source = NULL;
+ }
+ ap->mf_FileOperation.source = g_string_new(ap->mf_Status.path->str);
+
+ int argc = 4;
+ char **argv = (char **)malloc(argc*sizeof(char *));
+ argv[0] = (char*)malloc(sizeof(char)*15);
+ strcpy(argv[0], "miniunzip");
+
+ if(!ap->launched_file_name) {
+ mf_debug("Null File Name");
+ }
+
+ char *source_name = g_strdup(ap->launched_file_name);
+ char *dest_name = g_strdup(ap->launched_file_name);
+
+ mf_debug("dest name is %s", dest_name);
+
+
+
+ uf = unzOpen(source_name);
+ if (uf==NULL) {
+ strcat(source_name,".zip");
+ uf = unzOpen(source_name);
+ }
+
+ if(uf == NULL) {
+ mf_debug("unable to extract files");
+ }
+
+ unz_global_info gi;
+ int err;
+ char filename_inzip[256];
+ unz_file_info file_info;
+ err = unzGetGlobalInfo (uf,&gi);
+
+ if(gi.number_entry == 0) {
+ //TODO show error message
+ return;
+ }
+
+ for (i=0;i<gi.number_entry;i++) {
+ err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
+ mf_debug("files in zipped are %s", filename_inzip);
+ if (i+1 < gi.number_entry) {
+ err = unzGoToNextFile(uf);
+ if (err!=UNZ_OK) {
+ mf_debug("error %d with zipfile in unzGoToNextFile\n",err);
+ break;
+ }
+ }
+ }
+
+ mf_error("Source : %s", source_name);
+ argv[1] = (char*)malloc(sizeof(char)*strlen(source_name));
+ strcpy(argv[1], source_name);
+ argv[2] = (char*)malloc(sizeof(char)*10);
+ strcpy(argv[2], "-d");
+ argv[3] = (char*)malloc(sizeof(char)*strlen(dest_name));
+ strcpy(argv[3], dest_name);
+ mf_do_file_unzip(ap,argc, argv);
+
+ mf_error("\nMORE : %d. EXTRA : %d", ap->mf_Status.more, ap->mf_Status.extra);
+
+ if (ap->mf_Status.extra == MORE_SEARCH) {
+ ap->mf_Status.more = MORE_SEARCH;
+ mf_search_view_create(ap);
+ } else {
+ ap->mf_Status.more = MORE_DEFAULT;
+ SAFE_FREE_CHAR(ap->mf_Status.entry_path);
+ ap->mf_Status.entry_more = MORE_DEFAULT;
+ if (ap->mf_Status.view_type != mf_view_root_category && ap->mf_Status.more != MORE_SEARCH) {
+ mf_navi_bar_recover_info_box(ap);
+ }
+ mf_naviframe_title_button_delete(ap->mf_MainWindow.pNaviItem);
+ }
+
+
+ ap->mf_Status.view_type = mf_view_normal;
+ MF_TRACE_END;
+}
+
void mf_callback_copy_move_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
if (ap->mf_FileRecordList.value_saver != NULL) {
mf_util_free_eina_list_with_data(&ap->mf_FileRecordList.value_saver, MYFILE_TYPE_GSTRING);
ap->mf_FileRecordList.value_saver = NULL;
+ ap->mf_FileRecordList.value_saver = mf_edit_get_all_selected_files();
}
- ap->mf_FileRecordList.value_saver = mf_edit_get_all_selected_files();
if (mf_util_get_eina_list_len(ap->mf_FileRecordList.value_saver) < 1) {
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_LABEL_NOTHING_SELECTED,
- MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
+ MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
return;
}
Eina_List *select_list = mf_edit_get_all_selected_files();
if (mf_util_get_eina_list_len(select_list) < 1) {
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_LABEL_NOTHING_SELECTED,
- MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
+ MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
return;
}
}
/******************************
-** Prototype : mf_callback_paste_here_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_paste_here_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_paste_here_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
}
/******************************
-** Prototype : mf_move_here_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_move_here_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_move_here_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
}
/******************************
-** Prototype : __mf_callback_confirm_delete
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : __mf_callback_confirm_delete
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
static void __mf_callback_confirm_delete(void *data, Evas_Object *obj, void *event_info)
{
struct appdata *ap = (struct appdata *)data;
/*setting item check */
Eina_List *selected_list = mf_edit_get_all_selected_files();
+ mf_debug("shubham after selected list");
if (ap->mf_FileRecordList.value_saver != NULL) {
mf_util_free_eina_list_with_data(&ap->mf_FileRecordList.value_saver, MYFILE_TYPE_GSTRING);
ap->mf_FileRecordList.value_saver = NULL;
}
+ mf_debug("shubham after value saver");
ap->mf_FileRecordList.value_saver = selected_list;
if (mf_util_get_eina_list_len(ap->mf_FileRecordList.value_saver) < 1) {
ap->mf_MainWindow.pNormalPopup =
- mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_LABEL_NOTHING_SELECTED,
- MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
+ mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_LABEL_NOTHING_SELECTED,
+ MF_BUTTON_LABEL_OK, NULL, NULL, mf_callback_warning_popup_cb, ap);
} else {
GList *pSourceList = NULL;
int count = 0;
ap->mf_FileOperation.iOperationSuccessFlag = TRUE;
mf_fs_monitor_remove_dir_watch();
ap->mf_MainWindow.pProgressPopup =
- mf_popup_create_pb_popup(ap, LABEL_DELETE, MF_MSG_DELETING, count, mf_callback_progress_bar_cancel_cb, ap);
+ mf_popup_create_pb_popup(ap, LABEL_DELETE, MF_MSG_DELETING, count, mf_callback_progress_bar_cancel_cb, ap);
} else {
mf_util_exception_func(ap);
}
}
/******************************
-** Prototype : mf_callback_delete_cb
-** Description :
-** Input : void *data
-** Evas_Object *obj
-** void *event_info
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_delete_cb
+ ** Description :
+ ** Input : void *data
+ ** Evas_Object *obj
+ ** void *event_info
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_delete_cb(void *data, Evas_Object *obj, void *event_info)
{
struct appdata *ap = (struct appdata *)data;
int count = mf_edit_file_count_get();
if (count > 1) {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, LABEL_DELETE,
- MF_LABEL_ITEMS_WILL_DELETE,
- LABEL_CANCEL, LABEL_DELETE, __mf_callback_confirm_delete, ap, count);
+ MF_LABEL_ITEMS_WILL_DELETE,
+ LABEL_CANCEL, LABEL_DELETE, __mf_callback_confirm_delete, ap, count);
} else {
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap,
- LABEL_DELETE,
- MF_LABEL_THIS_ITEM_WILL_DELETE,
- LABEL_CANCEL, LABEL_DELETE, __mf_callback_confirm_delete, ap, count);
+ LABEL_DELETE,
+ MF_LABEL_THIS_ITEM_WILL_DELETE,
+ LABEL_CANCEL, LABEL_DELETE, __mf_callback_confirm_delete, ap, count);
}
}
/******************************
-** Prototype : mf_callback_thread_pipe_cb
-** Description :
-** Input : void *data
-** void *buffer
-** unsigned int nbyte
-** Output : None
-** Return Value :
-** Calls :
-** Called By :
-**
-** History :
-** 1.Date : 2010/12/10
-** Author : Samsung
-** Modification : Created function
-**
-******************************/
+ ** Prototype : mf_callback_thread_pipe_cb
+ ** Description :
+ ** Input : void *data
+ ** void *buffer
+ ** unsigned int nbyte
+ ** Output : None
+ ** Return Value :
+ ** Calls :
+ ** Called By :
+ **
+ ** History :
+ ** 1.Date : 2010/12/10
+ ** Author : Samsung
+ ** Modification : Created function
+ **
+ ******************************/
void mf_callback_operation_request_rename_cb(void *data, Evas_Object *obj, void *event_info)
{
MF_TRACE_BEGIN;
ap->file_name = mf_fm_svc_get_file_name(path);
char *message = g_strdup_printf(label, ap->file_name);
ap->mf_MainWindow.pNormalPopup = mf_popup_replace_create(MF_LABEL_SAME_FOLDER, message, mf_callback_popup_cancel_cb,
- mf_callback_replace_cb, mf_callback_rename_cb, ap);
+ mf_callback_replace_cb, mf_callback_rename_cb, ap);
} else {
char *label = gettext(MF_LABEL_SAME_FILE_LABEL);
ap->file_name = mf_fm_svc_get_file_name(path);
char *message = g_strdup_printf(label, ap->file_name);
ap->mf_MainWindow.pNormalPopup = mf_popup_replace_create(MF_LABEL_SAME_FILE, message, mf_callback_popup_cancel_cb,
- mf_callback_replace_cb, mf_callback_rename_cb, ap);
+ mf_callback_replace_cb, mf_callback_rename_cb, ap);
}
}
mf_util_set_pm_lock(ap, EINA_TRUE);
ap->mf_MainWindow.pProgressPopup = NULL;
}
ap->mf_MainWindow.pFinishPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_CANCELING, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_CANCELING, NULL, NULL, NULL, NULL, NULL);
mf_msg_request_handled_send();
ap->mf_FileOperation.iOperationSuccessFlag = FALSE;
break;
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_TWO_BTN, MF_LABEL_UNABLE_TO_SAVE_DATA, MF_LABEL_NO_SPACE_TO_SETTING, LABEL_CANCEL, MF_LABEL_SETTINGS, NULL, mf_callback_setting_popup_cb, ap);
}
break;
- case MF_MSG_END:
- ap->mf_Status.check = 0;
- if (ap->mf_FileOperation.source) {
- g_string_free(ap->mf_FileOperation.source, TRUE);
- ap->mf_FileOperation.source = NULL;
- }
- if (ap->mf_FileOperation.pSourceList) {
- g_list_free(ap->mf_FileOperation.pSourceList);
- ap->mf_FileOperation.pSourceList = NULL;
- }
- if (ap->mf_MainWindow.pProgressPopup) {
- evas_object_del(ap->mf_MainWindow.pProgressPopup);
- ap->mf_MainWindow.pProgressPopup = NULL;
- }
- mf_ecore_idler_del(ap->mf_Status.operation_refresh_idler);
- ap->mf_Status.operation_refresh_idler = ecore_idler_add((Ecore_Task_Cb)__mf_callback_idle_refresh, ap);
- if (pPipeMsg->pipe) {
- ecore_pipe_del(pPipeMsg->pipe);
- pPipeMsg->pipe = NULL;
- }
- mf_msg_request_handled_send();
+ case MF_MSG_END:
+ ap->mf_Status.check = 0;
+ if (ap->mf_FileOperation.source) {
+ g_string_free(ap->mf_FileOperation.source, TRUE);
+ ap->mf_FileOperation.source = NULL;
+ }
+ if (ap->mf_FileOperation.pSourceList) {
+ g_list_free(ap->mf_FileOperation.pSourceList);
+ ap->mf_FileOperation.pSourceList = NULL;
+ }
+ if (ap->mf_MainWindow.pProgressPopup) {
+ evas_object_del(ap->mf_MainWindow.pProgressPopup);
+ ap->mf_MainWindow.pProgressPopup = NULL;
+ }
+ mf_ecore_idler_del(ap->mf_Status.operation_refresh_idler);
+ ap->mf_Status.operation_refresh_idler = ecore_idler_add((Ecore_Task_Cb)__mf_callback_idle_refresh, ap);
+ if (pPipeMsg->pipe) {
+ ecore_pipe_del(pPipeMsg->pipe);
+ pPipeMsg->pipe = NULL;
+ }
+ mf_msg_request_handled_send();
- mf_util_set_pm_lock(ap, EINA_FALSE);
- if (ap->mf_FileRecordList.value_saver != NULL) {
- mf_util_free_eina_list_with_data(&ap->mf_FileRecordList.value_saver, MYFILE_TYPE_GSTRING);
- ap->mf_FileRecordList.value_saver = NULL;
- }
- break;
- default:
- mf_msg_request_handled_send();
- break;
+ mf_util_set_pm_lock(ap, EINA_FALSE);
+ if (ap->mf_FileRecordList.value_saver != NULL) {
+ mf_util_free_eina_list_with_data(&ap->mf_FileRecordList.value_saver, MYFILE_TYPE_GSTRING);
+ ap->mf_FileRecordList.value_saver = NULL;
+ }
+ break;
+ default:
+ mf_msg_request_handled_send();
+ break;
}
}
}
if (ap->mf_MainWindow.record.location == optStorage) {
ap->mf_MainWindow.pMmcRemovedPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
}
break;
mf_debug("===================== MMC remove ==================");
ap->mf_MainWindow.pMmcRemovedPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
/*ToDo: check whether get the error before this; */
if (ap->mf_FileOperation.pCancel) {
mf_cancel_do_cancel(ap->mf_FileOperation.pCancel);
ap->mf_MainWindow.pProgressPopup = NULL;
}
ap->mf_MainWindow.pMmcRemovedPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
mf_navi_bar_reset(ap);
mf_view_update(ap);
case MORE_DELETE:
mf_debug("===================== MMC remove ==================");
ap->mf_MainWindow.pMmcRemovedPopup = mf_popup_create_popup(ap, POPMODE_TEXT_NOT_DISABLED, NULL,
- MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
+ MF_LABEL_MMC_REMOVED, NULL, NULL, NULL, NULL, NULL);
if (ap->mf_FileOperation.pCancel) {
mf_cancel_do_cancel(ap->mf_FileOperation.pCancel);
}
}
static void __mf_callback_storage_changed_cb(int storage_id,
- storage_dev_e dev, storage_state_e state,
- const char *fstype, const char *fsuuid, const char *mountpath,
- bool primary, int flags, void *user_data)
+ storage_dev_e dev, storage_state_e state,
+ const char *fstype, const char *fsuuid, const char *mountpath,
+ bool primary, int flags, void *user_data)
{
mf_debug("Storage Changed for memory card");
struct appdata *ap = (struct appdata *)user_data;
int mf_callback_set_mmc_state_cb(void *data)
{
struct appdata *ap = (struct appdata *)data;
- int storage_id = 0;
int mmc_state = 0;
mf_retvm_if(ap == NULL, -1, "appdata is NULL");
}
mf_callback_entry_unfocus(ap->mf_MainWindow.pEntry);
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap, POPMODE_TEXT_BTN, NULL, MF_MSG_RENAME_ILLEGAL_CHAR, MF_BUTTON_LABEL_OK, NULL,
- NULL, mf_popup_show_vk_cb, ap);
+ NULL, mf_popup_show_vk_cb, ap);
}
SAFE_FREE_CHAR(name);
MF_TRACE_END;
SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
ap->mf_FileOperation.idle_delete_item = params->item;
ap->mf_MainWindow.pDeleteConfirmPopup = mf_popup_create_delete_confirm_popup(ap, MF_LABEL_DELETE_ITEM,
- MF_LABEL_THIS_ITEM_WILL_DELETE,
- LABEL_CANCEL, LABEL_DELETE,
- __mf_callback_delete_in_idle, ap, 1);
+ MF_LABEL_THIS_ITEM_WILL_DELETE,
+ LABEL_CANCEL, LABEL_DELETE,
+ __mf_callback_delete_in_idle, ap, 1);
}
void mf_callback_view_as_cb(void *data, Evas_Object *obj, void *event_info)
} else if (ap->mf_Status.more == MORE_SEARCH) {
mf_context_popup_create_more(ap, more);
} else if (ap->mf_Status.more == MORE_INTERNAL_MOVE
- || ap->mf_Status.more == MORE_DATA_MOVING
- || ap->mf_Status.more == MORE_INTERNAL_COPY
- || ap->mf_Status.more == MORE_DATA_COPYING) {
+ || ap->mf_Status.more == MORE_DATA_MOVING
+ || ap->mf_Status.more == MORE_INTERNAL_COPY
+ || ap->mf_Status.more == MORE_DATA_COPYING) {
if (ap->mf_Status.view_type != mf_view_root && ap->mf_Status.view_type != mf_view_storage) {
mf_context_popup_create_more(ap, more);
}
void mf_callback_eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
{
elm_entry_entry_set(data, "");
-// elm_object_focus_set(data, EINA_TRUE);
+ // elm_object_focus_set(data, EINA_TRUE);
}
void mf_callback_extension_cb(void *data, Evas_Object *obj, void *event_info)
if (g_mf_create_thumbnail_count < MF_MAX_MAKE_THUNBNAIL_COUNT) {//Fixed P140827-07370
ret = media_info_create_thumbnail(pListData->media, callback,
- pListData);
+ pListData);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
mf_debug("Failed to create thumbnail! ret is [%d]", ret);
if (pListData->file_type == FILE_TYPE_IMAGE || pListData->file_type == FILE_TYPE_VIDEO) {
SAFE_FREE_OBJ(ap->mf_MainWindow.pLongpressPopup);
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap,
- POPMODE_TEXT_TWO_BTN,
- MF_LABEL_REMOVE_SHORTCUT,
- MF_LABEL_REMOVE_FROM_SHORTCUT,
- LABEL_CANCEL,
- MF_LABEL_REMOVE,
- NULL,
- __mf_callback_shortcut_confirm_delete,
- item_data);
+ POPMODE_TEXT_TWO_BTN,
+ MF_LABEL_REMOVE_SHORTCUT,
+ MF_LABEL_REMOVE_FROM_SHORTCUT,
+ LABEL_CANCEL,
+ MF_LABEL_REMOVE,
+ NULL,
+ __mf_callback_shortcut_confirm_delete,
+ item_data);
MF_TRACE_END;
}
SAFE_FREE_OBJ(ap->mf_MainWindow.pLongpressPopup);
ap->mf_MainWindow.pNormalPopup = mf_popup_create_popup(ap,
- POPMODE_TEXT_TWO_BTN,
- MF_LABEL_REMOVE_FILE,
- MF_LABEL_REMOVE_FROME_RECENT,
- LABEL_CANCEL,
- MF_LABEL_REMOVE,
- NULL,
- __mf_callback_recent_files_confirm_delete,
- item_data);
+ POPMODE_TEXT_TWO_BTN,
+ MF_LABEL_REMOVE_FILE,
+ MF_LABEL_REMOVE_FROME_RECENT,
+ LABEL_CANCEL,
+ MF_LABEL_REMOVE,
+ NULL,
+ __mf_callback_recent_files_confirm_delete,
+ item_data);
//elm_object_item_del(item_data->item);
} else {
goto NORMAL_EXIT;
}
-NORMAL_EXIT:
+ NORMAL_EXIT:
if (ap->mf_Status.view_type == mf_view_root)
elm_naviframe_item_title_enabled_set(ap->mf_MainWindow.pNaviItem, EINA_FALSE, EINA_FALSE);
SAFE_FREE_CHAR(strstrip_name);
MF_TRACE_END;
return;
-INVAILD_NAME_EXIT:
+ INVAILD_NAME_EXIT:
SAFE_FREE_CHAR(strstrip_name);
SAFE_FREE_CHAR(pName);
mf_callback_entry_unfocus(ap->mf_MainWindow.pEntry);
mf_popup_second_popup_create(ap, ap->mf_MainWindow.pWindow, message,
- MF_BUTTON_LABEL_OK, mf_popup_show_vk_cb, ap);
+ MF_BUTTON_LABEL_OK, mf_popup_show_vk_cb, ap);
MF_TRACE_END;
return;
-ALLOC_FAILED_EXIT:
+ ALLOC_FAILED_EXIT:
SAFE_FREE_CHAR(strstrip_name);
SAFE_FREE_CHAR(pName);
mf_util_operation_alloc_failed(ap);
mf_callback_item_storage_usage_cb(ap, NULL, NULL);
}
}
+
+void mf_callback_popup_decompress_cancel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ struct appdata *ap = (struct appdata *)data;
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
+ mf_callback_cancel_cb(ap,NULL,NULL);
+}
+
+void mf_callback_popup_compress_cancel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ struct appdata *ap = (struct appdata *)data;
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
+ mf_callback_cancel_cb(ap,NULL,NULL);
+}
+
+void mf_callback_decompress_replace_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ struct appdata *ap = (struct appdata *)data;
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
+ char *dest = g_strdup(ap->launched_file_name);
+ char olddir[1000] = {0};
+ int i = 0;
+
+ //system("rm -rf de")
+ mf_debug("start replacing dest is %s", dest);
+
+ char *temp = g_strdup(dest);
+
+ for (i = strlen(temp)-1; i>=0; i--) {
+ if (temp[i] == '.') {
+ temp[i] = '\0';
+ break;
+ }
+ }
+
+ snprintf(olddir,strlen(temp)+8, "rm -rf %s", temp);
+ if (temp) {
+ g_free(temp);
+ }
+ mf_debug("old dir is %s", olddir);
+ int err = system(olddir);
+ if (err == -1) {
+ mf_debug("unable to delete file");
+ return;
+ } else {
+ mf_debug("%s file deleted", temp);
+ }
+ char *ptemp = strrchr(dest, '.');
+ if (ptemp) {
+ *ptemp = '\0';
+ }
+ strncpy(ptemp, "\0\0\0\0", 4);
+ ap->dir_name = g_strdup(dest);
+ mf_file_decompression_start(ap);
+ return;
+}
+
+void mf_callback_decompress_rename_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ struct appdata *ap = (struct appdata *)data;
+ SAFE_FREE_OBJ(ap->mf_MainWindow.pNormalPopup);
+ gchar *dest_string = g_strdup(ap->launched_file_name);
+
+ char *ptr = strstr(dest_string, ".zip");
+ if (ptr) {
+ strcpy(ptr,"\0");
+ }
+ GString *fullpath = g_string_new(dest_string);
+ GString *filename = NULL;
+ mf_fm_svc_wrapper_file_auto_rename(ap, fullpath, 0 , &filename);
+
+ if (filename->str)
+ mf_debug("file name is %s", filename->str);
+
+ ap->dir_name = g_strdup(filename->str);
+ mf_debug("file name is %s", ap->dir_name);
+ mf_file_decompression_start(ap);
+
+}
+
+void mf_file_compress_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ struct appdata *ap = (struct appdata *)data;
+
+ Evas_Object *popup = NULL;
+
+ Eina_List *source_folder_list = NULL;
+ Eina_List *source_file_list = NULL;
+ Eina_List *l = NULL;
+ GString *it = NULL;
+
+ if (source_folder_list != NULL) {
+ mf_debug("source_folder_list is NULL");
+ mf_util_free_eina_list_with_data(&source_folder_list, MYFILE_TYPE_GSTRING);
+ source_folder_list = NULL;
+ }
+
+ if (source_file_list != NULL) {
+ mf_debug("source_file_list is NULL");
+ mf_util_free_eina_list_with_data(&source_file_list, MYFILE_TYPE_GSTRING);
+ source_file_list = NULL;
+ }
+
+ source_folder_list = mf_get_selected_folders();
+ source_file_list = mf_get_selected_files();
+
+ char *dest_name;
+
+ if(mf_util_get_eina_list_len(source_file_list) + mf_util_get_eina_list_len(source_folder_list) == 1){
+ if(mf_util_get_eina_list_len(source_file_list) == 1){
+ l = source_file_list;
+
+ }
+ if(mf_util_get_eina_list_len(source_folder_list) == 1){
+ l = source_folder_list;
+ }
+ it = eina_list_data_get(l);
+ dest_name = g_strdup(it->str);
+ } else{
+ if(mf_util_get_eina_list_len(source_file_list)) {
+ it = eina_list_last_data_get(source_file_list);
+ } else {
+ it = eina_list_last_data_get(source_folder_list);
+ }
+ ap->mf_FileOperation.source = mf_fm_svc_wrapper_get_file_parent_path(it);
+ dest_name = g_strdup(ap->mf_FileOperation.source->str);
+ }
+
+
+ char * ext = strrchr(dest_name, '/');
+ if(ext){
+ ext++;
+ }
+
+ snprintf(str, strlen(dest_name)+strlen(ext)+7, "%s/%s.zip", dest_name, ext );
+
+ mf_debug("\destination is %s", dest_name);
+ mf_debug("string dest is %s", str);
+
+ if (mf_file_exists(str)) {
+ char *label = gettext(MF_LABEL_SAME_FOLDER_LABEL);
+ mf_debug("label is %s", label);
+ char *message = g_strdup_printf(label, dest_name);
+ mf_debug("message is %s", message);
+
+ popup = mf_popup_replace_create(MF_LABEL_SAME_FOLDER, message, mf_callback_popup_compress_cancel_cb,
+ mf_callback_compress_replace_cb, mf_callback_compress_rename_cb, ap);
+ evas_object_show(popup);
+ ap->mf_MainWindow.pNormalPopup = popup;
+ } else {
+ mf_file_compression_start(ap);
+ }
+
+
+}
+
+
+void mf_callback_decompress_done_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ struct appdata *ap = (struct appdata *)data;
+ Evas_Object *popup = NULL;
+
+ mf_debug("value of launched file name is %s", ap->launched_file_name);
+
+ char *dest = g_strdup(ap->launched_file_name);
+
+ char *ptemp = strrchr(dest, '.');
+ if (ptemp) {
+ *ptemp = '\0';
+ }
+ strncpy(ptemp, "\0\0\0\0", 4);
+
+ mf_debug("directory name is %s", dest);
+
+ DIR *dir = opendir(dest);
+
+ if (mf_file_exists(str) || dir) {
+ char *label = gettext(MF_LABEL_SAME_FOLDER_LABEL);
+ mf_debug("label is %s", label);
+ char *message = g_strdup_printf(label, dest);
+ mf_debug("message is %s", message);
+
+
+ popup = mf_popup_replace_create(MF_LABEL_SAME_FOLDER, message, mf_callback_popup_decompress_cancel_cb,
+ mf_callback_decompress_replace_cb, mf_callback_decompress_rename_cb, ap);
+ evas_object_show(popup);
+ ap->mf_MainWindow.pNormalPopup = popup;
+ } else if (ENOENT == errno) {
+ mf_debug("No such file or directory");
+ ap->dir_name = g_strdup(dest);
+ mf_file_decompression_start(ap);
+
+ } else {
+ mf_debug("something else happened");
+ }
+ int ret = closedir(dir);
+ if (ret) {
+ mf_debug("ubable to close directory");
+ }
+
+}