[Feature] Add UI of Miscellaneous files in Storage (No data, only UI) .
authorJing Yigang <yigang.jing@samsung.com>
Thu, 20 Sep 2012 07:43:09 +0000 (15:43 +0800)
committerJing Yigang <yigang.jing@samsung.com>
Thu, 20 Sep 2012 07:43:42 +0000 (15:43 +0800)
Change-Id: Ib57ae4c65e536c3e36ba2801df94e08306d983da

setting-storage/CMakeLists.txt
setting-storage/include/setting-storage-miscellaneous-files.h [new file with mode: 0755]
setting-storage/include/setting-storage.h
setting-storage/src/setting-storage-main.c
setting-storage/src/setting-storage-miscellaneous-files.c [new file with mode: 0755]
setting-storage/src/setting-storage.c

index 714c761..9806960 100755 (executable)
@@ -26,6 +26,7 @@ ADD_LIBRARY(${SETTING_STORAGE_UG} SHARED
        ./src/setting-storage.c
        ./src/setting-storage-main.c
        ./src/setting-storage-default-storage.c
+       ./src/setting-storage-miscellaneous-files.c
        )
 
 TARGET_LINK_LIBRARIES(${SETTING_STORAGE_UG} -L${CMAKE_BINARY_DIR}/${SETTING_COMMON} -lsetting-common)
diff --git a/setting-storage/include/setting-storage-miscellaneous-files.h b/setting-storage/include/setting-storage-miscellaneous-files.h
new file mode 100755 (executable)
index 0000000..b8a8fde
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * setting
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Contact: MyoungJune Park <mj2004.park@samsung.com>
+ *
+ * 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.
+ *
+ */
+#ifndef __SETTING_STORAGE_MISCELLANEOUS_FILES_H__
+#define __SETTING_STORAGE_MISCELLANEOUS_FILES_H__
+
+#include <setting-storage.h>
+
+static void __setting_storage_miscellaneous_files_delete_cb(void *data,
+                                                     Evas_Object *obj,
+                                                     void *event_info);
+static void __setting_storage_miscellaneous_files_cancel_cb(void *data,
+                                                      Evas_Object *obj,
+                                                      void *event_info);
+
+#endif                         /* __SETTING_STORAGE_MISCELLANEOUS_FILES_H__ */
index 3b96083..b5b07a6 100755 (executable)
@@ -161,9 +161,12 @@ struct _SettingStorageUG {
        Setting_GenGroupItem_Data *data_vrec;
        Setting_GenGroupItem_Data *data_rdo;
        Setting_GenGroupItem_Data *data_dvb_h;
+
+       Setting_Done_List_Data *miscellaneous_list;  /* miscellaneous files list */
 };
 
 extern setting_view setting_view_storage_main;
 extern setting_view setting_view_storage_default_storage;
+extern setting_view setting_view_storage_miscellaneous_files;
 
 #endif                         /* __SETTING_STORAGE_H__ */
index f2ec2ec..93e0cad 100755 (executable)
@@ -595,7 +595,8 @@ static void __setting_storage_main_Gendial_mouse_up_cb(void *data, Evas_Object *
        } else if (!safeStrCmp(SETTING_STORAGE_AUDIO_STR, list_item->keyStr)) {
                __setting_storage_main_app_launch("org.tizen.music-player");
        } else if (!safeStrCmp(SETTING_STORAGE_MISCES_STR, list_item->keyStr)) {
-               //__setting_storage_main_app_launch("org.tizen.myfile");
+               setting_view_change(&setting_view_storage_main,
+                                   &setting_view_storage_miscellaneous_files, ad);
        } else {
                // do nothing now
        }
@@ -1258,7 +1259,6 @@ static int setting_storage_main_create(void *cb)
                                             others_desc, NULL);
        if (ad->others) {
                ad->others->userdata = ad;
-               elm_genlist_item_select_mode_set(ad->others->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
        } else {
                SETTING_TRACE_ERROR("ad->others is NULL");
                return SETTING_RETURN_FAIL;
diff --git a/setting-storage/src/setting-storage-miscellaneous-files.c b/setting-storage/src/setting-storage-miscellaneous-files.c
new file mode 100755 (executable)
index 0000000..c818c38
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * setting
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Contact: MyoungJune Park <mj2004.park@samsung.com>
+ *
+ * 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 <setting-storage-miscellaneous-files.h>
+
+static int setting_storage_miscellaneous_files_create(void *cb);
+static int setting_storage_miscellaneous_files_destroy(void *cb);
+static int setting_storage_miscellaneous_files_update(void *cb);
+static int setting_storage_miscellaneous_files_cleanup(void *cb);
+
+setting_view setting_view_storage_miscellaneous_files = {
+       .create = setting_storage_miscellaneous_files_create,
+       .destroy = setting_storage_miscellaneous_files_destroy,
+       .update = setting_storage_miscellaneous_files_update,
+       .cleanup = setting_storage_miscellaneous_files_cleanup,
+};
+
+static int setting_storage_miscellaneous_files_create(void *cb)
+{
+       SETTING_TRACE_BEGIN;
+       /* error check */
+       retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
+
+       SettingStorageUG *ad = (SettingStorageUG *) cb;
+       Evas_Object *scroller = NULL;
+       Evas_Object *controllbar = NULL;
+
+       Evas_Object *view_layout = elm_layout_add(ad->win_main_layout);
+       elm_layout_file_set(view_layout, SETTING_THEME_EDJ_NAME, "selinfo_bottom");
+       evas_object_size_hint_weight_set(view_layout, EVAS_HINT_EXPAND, 0.0);
+
+       /*  Evas_Object * win_layout, Evas_Object * win_obj */
+       setting_push_layout_navi_bar(_(SETTING_STORAGE_MISCES_STR),
+                                  _("IDS_COM_SK_DELETE"),
+                                  _("IDS_COM_SK_CANCEL"), NULL,
+                                  __setting_storage_miscellaneous_files_delete_cb,
+                                  __setting_storage_miscellaneous_files_cancel_cb,
+                                  NULL, ad, view_layout, ad->navibar,
+                                  &controllbar);
+
+       Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)calloc(1, sizeof(Setting_Done_List_Data));
+       setting_retvm_if(list_data == NULL, SETTING_RETURN_FAIL, "failed to calloc");
+
+       ad->miscellaneous_list = list_data;
+       list_data->win_main = ad->win_main_layout;
+       list_data->UG_data = ad;
+       list_data->ly_parent = view_layout;
+       list_data->controllbar = controllbar;
+       list_data->select_all_checked = EINA_FALSE;
+
+       int i = 0;
+       for (; i < 2; i++) {
+               list_data->chk_items[i].item_name = "file";
+       }
+
+       list_data->cur_item_num = i;
+       SETTING_TRACE("list_data->cur_item_num:%d", list_data->cur_item_num);
+       scroller = setting_create_done_list(list_data);
+       elm_object_part_content_set(view_layout, "elm.swallow.contents", scroller);
+
+       setting_view_storage_miscellaneous_files.is_create = 1;
+       return SETTING_RETURN_SUCCESS;
+}
+
+static int setting_storage_miscellaneous_files_destroy(void *cb)
+{
+       SETTING_TRACE_BEGIN;
+       retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
+       SettingStorageUG *ad = (SettingStorageUG *)cb;
+
+       if (ad->miscellaneous_list->selInfoPop) {
+               evas_object_del(ad->miscellaneous_list->selInfoPop);
+               ad->miscellaneous_list->selInfoPop = NULL;
+       }
+
+       elm_naviframe_item_pop(ad->navibar);
+       setting_view_storage_miscellaneous_files.is_create = 0;
+       return SETTING_RETURN_SUCCESS;
+}
+
+static int setting_storage_miscellaneous_files_update(void *cb)
+{
+       SETTING_TRACE_BEGIN;
+
+       return SETTING_RETURN_SUCCESS;
+}
+
+static int setting_storage_miscellaneous_files_cleanup(void *cb)
+{
+       SETTING_TRACE_BEGIN;
+       retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
+       setting_storage_miscellaneous_files_destroy(cb);
+       return SETTING_RETURN_SUCCESS;
+}
+
+static void __setting_storage_miscellaneous_files_cancel_cb(void *data,
+                                       Evas_Object *obj, void *event_info)
+{
+       SETTING_TRACE_BEGIN;
+       retm_if(data == NULL, "Data parameter is NULL");
+       SettingStorageUG *ad = (SettingStorageUG *) data;
+
+       setting_view_change(&setting_view_storage_miscellaneous_files, &setting_view_storage_main, ad);
+}
+
+static void __setting_storage_miscellaneous_files_delete_cb(void *data,
+                                       Evas_Object *obj, void *event_info)
+{
+       SETTING_TRACE_BEGIN;
+       retm_if(data == NULL, "Data parameter is NULL");
+       //SettingStorageUG *ad = (SettingStorageUG *) data;
+}
index df1bdb9..045dd0f 100755 (executable)
@@ -49,6 +49,8 @@ static void *setting_storage_ug_on_create(ui_gadget_h ug, enum ug_mode mode,
        setting_view_node_table_register(&setting_view_storage_main, NULL);
        setting_view_node_table_register(&setting_view_storage_default_storage,
                                         &setting_view_storage_main);
+       setting_view_node_table_register(&setting_view_storage_miscellaneous_files,
+                                        &setting_view_storage_main);
 
        storageUG->itc_seperator.item_style = "dialogue/separator/21/with_line";
        storageUG->itc_seperator.func.text_get = NULL;
@@ -98,6 +100,7 @@ static void setting_storage_ug_on_destroy(ui_gadget_h ug, service_h service,
        storageUG->ug = ug;
 
        /*  delete the allocated objects. */
+       setting_view_destroy(&setting_view_storage_miscellaneous_files, storageUG);
        setting_view_destroy(&setting_view_storage_default_storage, storageUG);
        setting_view_destroy(&setting_view_storage_main, storageUG);