forked from enlightenment/enlightenment
add gui option for secure deletion in efm
SVN revision: 77434
This commit is contained in:
parent
b5842b7b86
commit
c310836bb3
|
@ -856,6 +856,7 @@ e_config_init(void)
|
|||
E_CONFIG_VAL(D, T, device_auto_mount, INT);
|
||||
E_CONFIG_VAL(D, T, device_auto_open, INT);
|
||||
E_CONFIG_VAL(D, T, filemanager_copy, UCHAR);
|
||||
E_CONFIG_VAL(D, T, filemanager_secure_rm, UCHAR);
|
||||
|
||||
E_CONFIG_VAL(D, T, border_keyboard.timeout, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, border_keyboard.move.dx, UCHAR);
|
||||
|
|
|
@ -37,7 +37,7 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
|
|||
/* increment this whenever a new set of config values are added but the users
|
||||
* config doesn't need to be wiped - simply new values need to be put in
|
||||
*/
|
||||
#define E_CONFIG_FILE_GENERATION 0x0158
|
||||
#define E_CONFIG_FILE_GENERATION 0x0159
|
||||
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
|
||||
|
||||
struct _E_Config
|
||||
|
@ -267,6 +267,7 @@ struct _E_Config
|
|||
int device_auto_open; // GUI
|
||||
Efm_Mode device_detect_mode; /* not saved, display-only */
|
||||
unsigned char filemanager_copy; // GUI
|
||||
unsigned char filemanager_secure_rm; // GUI
|
||||
|
||||
struct
|
||||
{
|
||||
|
|
|
@ -440,7 +440,7 @@ static void _e_fm2_client_spawn(void);
|
|||
static E_Fm2_Client *_e_fm2_client_get(void);
|
||||
static int _e_fm2_client_monitor_add(const char *path);
|
||||
static void _e_fm2_client_monitor_del(int id, const char *path);
|
||||
static int _e_fm_client_file_del(const char *args, Evas_Object *e_fm);
|
||||
static int _e_fm_client_file_del(const char *files, Eina_Bool secure, Evas_Object *e_fm);
|
||||
//static int _e_fm2_client_file_trash(const char *path, Evas_Object *e_fm);
|
||||
static int _e_fm2_client_file_mkdir(const char *path, const char *rel, int rel_to, int x, int y, int res_w, int res_h, Evas_Object *e_fm);
|
||||
static int _e_fm_client_file_move(const char *args, Evas_Object *e_fm);
|
||||
|
@ -2403,10 +2403,14 @@ _e_fm2_client_monitor_del(int id, const char *path)
|
|||
}
|
||||
|
||||
static int
|
||||
_e_fm_client_file_del(const char *files, Evas_Object *e_fm)
|
||||
_e_fm_client_file_del(const char *files, Eina_Bool secure, Evas_Object *e_fm)
|
||||
{
|
||||
int id = _e_fm_client_send_new(E_FM_OP_REMOVE, (void *)files, strlen(files) + 1);
|
||||
e_fm2_op_registry_entry_add(id, e_fm, E_FM_OP_REMOVE, _e_fm2_operation_abort_internal);
|
||||
int id, op = E_FM_OP_REMOVE;
|
||||
|
||||
if (secure) op = E_FM_OP_SECURE_REMOVE;
|
||||
|
||||
id = _e_fm_client_send_new(op, (void *)files, strlen(files) + 1);
|
||||
e_fm2_op_registry_entry_add(id, e_fm, op, _e_fm2_operation_abort_internal);
|
||||
return id;
|
||||
}
|
||||
|
||||
|
@ -10531,7 +10535,7 @@ _e_fm2_file_delete_yes_cb(void *data, E_Dialog *dialog)
|
|||
}
|
||||
if (files)
|
||||
{
|
||||
_e_fm_client_file_del(files, ic->sd->obj);
|
||||
_e_fm_client_file_del(files, e_config->filemanager_secure_rm, ic->sd->obj);
|
||||
free(files);
|
||||
}
|
||||
|
||||
|
|
|
@ -573,6 +573,12 @@ _e_fm_ipc_cb_server_data(void *data __UNUSED__, int type __UNUSED__, void *event
|
|||
}
|
||||
break;
|
||||
|
||||
case E_FM_OP_SECURE_REMOVE: /* fop delete file/dir */
|
||||
{
|
||||
_e_fm_ipc_slave_run(E_FM_OP_SECURE_REMOVE, (const char *)e->data, e->ref);
|
||||
}
|
||||
break;
|
||||
|
||||
case E_FM_OP_TRASH: /* fop trash file/dir */
|
||||
{
|
||||
E_Fop *fop;
|
||||
|
@ -1437,6 +1443,8 @@ _e_fm_ipc_prepare_command(E_Fm_Op_Type type, const char *args)
|
|||
strcpy(command, "mv");
|
||||
else if (type == E_FM_OP_REMOVE)
|
||||
strcpy(command, "rm");
|
||||
else if (type == E_FM_OP_SECURE_REMOVE)
|
||||
strcpy(command, "srm");
|
||||
else if (type == E_FM_OP_COPY)
|
||||
strcpy(command, "cp");
|
||||
else if (type == E_FM_OP_SYMLINK)
|
||||
|
|
|
@ -84,6 +84,7 @@ struct _E_Config_Dialog_Data
|
|||
} dbus;
|
||||
|
||||
int copy;
|
||||
int secure_rm;
|
||||
|
||||
Evas_Object *dir_sort_first;
|
||||
Evas_Object *dir_sort_last;
|
||||
|
@ -142,6 +143,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
|
|||
cfdata->view.open_dirs_in_place = fileman_config->view.open_dirs_in_place;
|
||||
cfdata->view.single_click = fileman_config->view.single_click;
|
||||
cfdata->copy = e_config->filemanager_copy;
|
||||
cfdata->secure_rm = e_config->filemanager_secure_rm;
|
||||
cfdata->view.show_full_path = fileman_config->view.show_full_path;
|
||||
cfdata->view.show_desktop_icons = fileman_config->view.show_desktop_icons;
|
||||
cfdata->view.show_toolbar = fileman_config->view.show_toolbar;
|
||||
|
@ -182,6 +184,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__,
|
|||
fileman_config->view.open_dirs_in_place = cfdata->view.open_dirs_in_place;
|
||||
e_config->filemanager_single_click = fileman_config->view.single_click = cfdata->view.single_click;
|
||||
e_config->filemanager_copy = cfdata->copy;
|
||||
e_config->filemanager_secure_rm = cfdata->secure_rm;
|
||||
fileman_config->view.show_full_path = cfdata->view.show_full_path;
|
||||
fileman_config->view.show_desktop_icons = cfdata->view.show_desktop_icons;
|
||||
fileman_config->view.show_toolbar = cfdata->view.show_toolbar;
|
||||
|
@ -231,7 +234,7 @@ _basic_check_changed(E_Config_Dialog *cfd __UNUSED__,
|
|||
(fileman_config->view.mode != cfdata->view.mode) ||
|
||||
(fileman_config->view.open_dirs_in_place != cfdata->view.open_dirs_in_place) ||
|
||||
(fileman_config->view.single_click != cfdata->view.single_click) ||
|
||||
(e_config->filemanager_copy != cfdata->copy) ||
|
||||
(e_config->filemanager_secure_rm != cfdata->secure_rm) ||
|
||||
(fileman_config->view.show_full_path != cfdata->view.show_full_path) ||
|
||||
(fileman_config->view.show_desktop_icons != cfdata->view.show_desktop_icons) ||
|
||||
(fileman_config->view.show_toolbar != cfdata->view.show_toolbar) ||
|
||||
|
@ -387,6 +390,9 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__,
|
|||
ob = e_widget_check_add(evas, _("Really Move"),
|
||||
&(cfdata->copy));
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
ob = e_widget_check_add(evas, _("Secure Deletion"),
|
||||
&(cfdata->secure_rm));
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
ob = e_widget_check_add(evas, _("Use Alternate Selection Modifiers"),
|
||||
&(cfdata->selection.windows_modifiers));
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
|
|
Loading…
Reference in New Issue