Change the file save policy.
Summary: In case when inputted file name does not contain "edc" or "edj" extention, ".edc" will be added automaticaly. T1784 Reviewers: Hermet Projects: #enventor Maniphest Tasks: T1784 Differential Revision: https://phab.enlightenment.org/D2760
This commit is contained in:
parent
a310bbd9a4
commit
43554348a4
|
@ -406,22 +406,7 @@ fileselector_save_done_cb(void *data, Evas_Object *obj, void *event_info)
|
|||
fileselector_close(md);
|
||||
return;
|
||||
}
|
||||
|
||||
//Filter to read only edc or edj extensions file.
|
||||
is_edc = eina_str_has_extension(selected, "edc");
|
||||
is_edj = eina_str_has_extension(selected, "edj");
|
||||
if (!is_edc && !is_edj)
|
||||
{
|
||||
elm_object_part_text_set(md->fileselector_layout,
|
||||
"elm.text.msg",
|
||||
"Support only .edc or .edj file.");
|
||||
elm_object_signal_emit(md->fileselector_layout,
|
||||
"elm,action,msg,show", "");
|
||||
return;
|
||||
}
|
||||
|
||||
//Directory?
|
||||
if (ecore_file_is_dir(selected))
|
||||
else if (ecore_file_is_dir(selected))
|
||||
{
|
||||
elm_object_part_text_set(md->fileselector_layout,
|
||||
"elm.text.msg", "Choose a file to save");
|
||||
|
@ -430,6 +415,15 @@ fileselector_save_done_cb(void *data, Evas_Object *obj, void *event_info)
|
|||
return;
|
||||
}
|
||||
|
||||
//Filter to read only edc or edj extensions file.
|
||||
is_edc = eina_str_has_extension(selected, "edc");
|
||||
is_edj = eina_str_has_extension(selected, "edj");
|
||||
if (!is_edc && !is_edj)
|
||||
{
|
||||
selected = eina_stringshare_printf("%s.edc", selected);
|
||||
is_edc = EINA_TRUE;
|
||||
}
|
||||
|
||||
if (is_edc)
|
||||
{
|
||||
config_edc_path_set(selected);
|
||||
|
@ -444,6 +438,7 @@ fileselector_save_done_cb(void *data, Evas_Object *obj, void *event_info)
|
|||
"elm.text.msg", buf);
|
||||
elm_object_signal_emit(md->fileselector_layout,
|
||||
"elm,action,msg,show", "");
|
||||
eina_stringshare_del(selected);
|
||||
return;
|
||||
}
|
||||
enventor_object_file_set(md->enventor, selected);
|
||||
|
|
Loading…
Reference in New Issue