ret_if(NULL == data);
ret_if(NULL == event_info);
- elm_genlist_item_selected_set(item, 0);
+ elm_genlist_item_selected_set(item, EINA_FALSE);
if (item == ad->sd_mount->item)
storage_SD_handle_mount_unmount(ad);
SETTING_TRACE_ERROR("item(%p) Invalid", item);
}
+static void storage_format_as_portable_storage(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ Elm_Object_Item *item = event_info;
+ app_control_h app_ctl = NULL;
+
+ ret_if(!event_info);
+
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+
+ if (APP_CONTROL_ERROR_NONE != app_control_create(&app_ctl)) {
+ SETTING_TRACE_ERROR("app_ctl create failure");
+ return;
+ }
+ app_control_set_app_id(app_ctl, "org.tizen.extended-sd");
+ app_control_add_extra_data(app_ctl, "_SDCARD_SETUP_TYPE_",
+ "EXTERNAL_STORAGE_SETUP");
+ app_control_set_launch_mode(app_ctl, APP_CONTROL_LAUNCH_MODE_GROUP);
+ if (APP_CONTROL_ERROR_NONE !=
+ app_control_send_launch_request(app_ctl, NULL, NULL))
+ SETTING_TRACE_ERROR("org.tizen.extended-sd launch request failed");
+
+ app_control_destroy(app_ctl);
+}
+
+static void storage_format_as_extended_storage(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ Elm_Object_Item *item = event_info;
+ app_control_h app_ctl = NULL;
+
+ ret_if(!event_info);
+
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+
+ if (APP_CONTROL_ERROR_NONE != app_control_create(&app_ctl)) {
+ SETTING_TRACE_ERROR("app_ctl creaate fail");
+ return;
+ }
+ app_control_set_app_id(app_ctl, "org.tizen.extended-sd");
+ app_control_add_extra_data(app_ctl, "_SDCARD_SETUP_TYPE_",
+ "EXTENDED_STORAGE_SETUP");
+ app_control_set_launch_mode(app_ctl, APP_CONTROL_LAUNCH_MODE_GROUP);
+ if (APP_CONTROL_ERROR_NONE !=
+ app_control_send_launch_request(app_ctl, NULL, NULL))
+ SETTING_TRACE_ERROR("org.tizen.extended-sd launch request failed");
+
+ app_control_destroy(app_ctl);
+}
+
+
static Setting_GenGroupItem_Data *storage_SD_gl_insert_after(
Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
Elm_Object_Item *before, setting_call_back_func gl_sel,
}
}
-static inline void storage_SD_info_mounted(SettingStorage *ad)
+static void storage_SD_info_common_mounted(SettingStorage *ad)
{
double total = 0.0;
double avail = 0.0;
if (ad->default_storage)
elm_object_item_disabled_set(ad->default_storage->item, EINA_FALSE);
+}
+static inline void storage_SD_info_portable_mounted(SettingStorage *ad)
+{
+ storage_SD_info_common_mounted(ad);
+ if (ad->sd_format) {
+ ad->sd_format_as = storage_SD_gl_insert_after(ad->md.genlist,
+ &itc_1text, ad->sd_format->item,
+ storage_format_as_extended_storage, ad,
+ _("Format as device storage"), NULL, ad);
+ }
+}
+
+static inline void storage_SD_info_extended_mounted(SettingStorage *ad)
+{
+ storage_SD_info_common_mounted(ad);
+ if (ad->sd_format) {
+ ad->sd_format_as = storage_SD_gl_insert_after(ad->md.genlist,
+ &itc_1text, ad->sd_format->item,
+ storage_format_as_portable_storage, ad,
+ _("Format as portable storage"), NULL, ad);
+ }
}
static inline void storage_SD_remove_info(SettingStorage *ad)
elm_object_item_del(ad->sd_format->item);
ad->sd_format = NULL;
}
+ if (ad->sd_format_as) {
+ elm_object_item_del(ad->sd_format_as->item);
+ ad->sd_format_as = NULL;
+ }
}
void storage_main_append_SD_info(SettingStorage *ad)
if (VCONFKEY_SYSMAN_MMC_REMOVED == mmc_mode)
storage_SD_info_removed(ad);
- else if (VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED == mmc_mode)
+ if (VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED == mmc_mode)
storage_SD_info_inserted_not_mounted(ad);
- else if (VCONFKEY_SYSMAN_MMC_MOUNTED == mmc_mode)
- storage_SD_info_mounted(ad);
- else
- SETTING_TRACE_ERROR("mmc_mode(%d) Invalid", mmc_mode);
+ if (VCONFKEY_SYSMAN_MMC_MOUNTED == mmc_mode)
+ storage_SD_info_portable_mounted(ad);
+ if (VCONFKEY_SYSMAN_MMC_EXTENDEDINTERNAL_MOUNTED == mmc_mode)
+ storage_SD_info_extended_mounted(ad);
#if 0
str = vconf_get_str(storage_ENCRYPT_stat);