fileman's "Use Single Click" option now toggles a global config option which is picked up by fileselector widgets, also added a menu item to the right click efm menu to toggle this on a case-by-case basis

ticket #663


SVN revision: 74230
devs/princeamd/enlightenment-0.17-elive
Mike Blumenkrantz 11 years ago
parent c48e60963a
commit 11b99c6513
  1. 1
      src/bin/e_config.c
  2. 3
      src/bin/e_config.h
  3. 32
      src/bin/e_fm.c
  4. 3
      src/bin/e_fm.h
  5. 3
      src/bin/e_widget_fsel.c
  6. 2
      src/modules/fileman/e_mod_config.c
  7. 4
      src/modules/fileman/e_mod_main.c
  8. 2
      src/modules/fileman/e_mod_main.h

@ -849,6 +849,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, thumbscroll_momentum_threshhold, DOUBLE);
E_CONFIG_VAL(D, T, thumbscroll_friction, DOUBLE);
E_CONFIG_VAL(D, T, filemanager_single_click, UCHAR);
E_CONFIG_VAL(D, T, device_desktop, INT);
E_CONFIG_VAL(D, T, device_auto_mount, INT);
E_CONFIG_VAL(D, T, device_auto_open, INT);

@ -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 0x0152
#define E_CONFIG_FILE_GENERATION 0x0153
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
struct _E_Config
@ -260,6 +260,7 @@ struct _E_Config
double thumbscroll_momentum_threshhold; // GUI
double thumbscroll_friction; // GUI
Eina_Bool filemanager_single_click; // GUI
int device_desktop; // GUI
int device_auto_mount; // GUI
int device_auto_open; // GUI

@ -348,6 +348,7 @@ static void _e_fm2_view_image_sel(E_Fm2_Smart_Data *sd, const char *tit
static void _e_fm2_view_image_sel_close(void *data, E_Dialog *dia);
static void _e_fm2_refresh(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_fm2_toggle_hidden_files(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_fm2_toggle_single_click(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_fm2_toggle_ordering(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_fm2_sort(void *data, E_Menu *m, E_Menu_Item *mi);
static void _e_fm2_new_directory(void *data, E_Menu *m, E_Menu_Item *mi);
@ -945,7 +946,7 @@ e_fm2_path_set(Evas_Object *obj, const char *dev, const char *path)
sd->config->view.mode = E_FM2_VIEW_MODE_LIST;
sd->config->view.open_dirs_in_place = EINA_TRUE;
sd->config->view.selector = EINA_TRUE;
sd->config->view.single_click = EINA_FALSE;
sd->config->view.single_click = e_config->filemanager_single_click;
sd->config->view.single_click_delay = EINA_FALSE;
sd->config->view.no_subdir_jump = EINA_FALSE;
sd->config->icon.icon.w = 128;
@ -8017,7 +8018,15 @@ _e_fm2_menu(Evas_Object *obj, unsigned int timestamp)
e_menu_item_callback_set(mi, _e_fm2_sort, sd);
}
}
if (!(sd->icon_menu.flags & E_FM2_MENU_NO_ACTIVATE_CHANGE))
{
mi = e_menu_item_new(mn);
e_menu_item_label_set(mi, _("Single Click Activation"));
/* FIXME: e_util_menu_item_theme_icon_set(mi, NULL); */
e_menu_item_check_set(mi, 1);
e_menu_item_toggle_set(mi, sd->config->view.single_click);
e_menu_item_callback_set(mi, _e_fm2_toggle_single_click, sd);
}
if (!(sd->icon_menu.flags & E_FM2_MENU_NO_NEW_DIRECTORY))
{
mi = e_menu_item_new(mn);
@ -8172,7 +8181,15 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
e_menu_item_callback_set(mi, _e_fm2_sort, sd);
}
}
if (!(sd->icon_menu.flags & E_FM2_MENU_NO_ACTIVATE_CHANGE))
{
mi = e_menu_item_new(mn);
e_menu_item_label_set(mi, _("Single Click Activation"));
/* FIXME: e_util_menu_item_theme_icon_set(mi, NULL); */
e_menu_item_check_set(mi, 1);
e_menu_item_toggle_set(mi, sd->config->view.single_click);
e_menu_item_callback_set(mi, _e_fm2_toggle_single_click, sd);
}
if (!(sd->icon_menu.flags & E_FM2_MENU_NO_NEW_DIRECTORY))
{
/* FIXME: stat the dir itself - move to e_fm_main */
@ -8975,6 +8992,15 @@ _e_fm2_toggle_hidden_files(void *data, E_Menu *m, E_Menu_Item *mi)
_e_fm2_refresh(data, m, mi);
}
static void
_e_fm2_toggle_single_click(void *data, E_Menu *m __UNUSED__, E_Menu_Item *mi __UNUSED__)
{
E_Fm2_Smart_Data *sd;
sd = data;
sd->config->view.single_click = !sd->config->view.single_click;
}
static void
_e_fm2_toggle_ordering(void *data, E_Menu *m, E_Menu_Item *mi)
{

@ -29,7 +29,8 @@ typedef enum _E_Fm2_Menu_Flags
E_FM2_MENU_NO_PASTE = (1 << 8),
E_FM2_MENU_NO_SYMLINK = (1 << 9),
E_FM2_MENU_NO_VIEW_MENU = (1 << 10),
E_FM2_MENU_NO_INHERIT_PARENT = (1 << 11)
E_FM2_MENU_NO_INHERIT_PARENT = (1 << 11),
E_FM2_MENU_NO_ACTIVATE_CHANGE = (1 << 12)
} E_Fm2_Menu_Flags;
typedef enum _E_Fm2_View_Flags

@ -330,6 +330,7 @@ e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected,
fmc.selection.single = 1;
fmc.selection.windows_modifiers = 0;
e_fm2_config_set(o, &fmc);
e_fm2_icon_menu_flags_set(o, E_FM2_MENU_NO_ACTIVATE_CHANGE);
evas_object_smart_callback_add(o, "changed",
_e_wid_fsel_favorites_files_changed, wd);
evas_object_smart_callback_add(o, "selected",
@ -356,7 +357,7 @@ e_widget_fsel_add(Evas *evas, const char *dev, const char *path, char *selected,
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
fmc.view.open_dirs_in_place = 1;
fmc.view.selector = 1;
fmc.view.single_click = 0;
fmc.view.single_click = e_config->filemanager_single_click;
fmc.view.no_subdir_jump = 0;
fmc.icon.list.w = 24;
fmc.icon.list.h = 24;

@ -157,7 +157,7 @@ _basic_apply(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_single_click = fileman_config->view.single_click = cfdata->view.single_click;
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;

@ -535,6 +535,10 @@ _e_mod_fileman_config_load(void)
fileman_config->tooltip.size = 30.0;
IFMODCFGEND;
IFMODCFG(0x0105);
e_config->filemanager_single_click = fileman_config->view.single_click;
IFMODCFGEND;
fileman_config->config_version = MOD_CONFIG_FILE_VERSION;
/* UCHAR's give nasty compile warnings about comparisons so not gonna limit those */

@ -4,7 +4,7 @@
/* Increment for Major Changes */
#define MOD_CONFIG_FILE_EPOCH 0x0001
/* Increment for Minor Changes (ie: user doesn't need a new config) */
#define MOD_CONFIG_FILE_GENERATION 0x0104
#define MOD_CONFIG_FILE_GENERATION 0x0105
#define MOD_CONFIG_FILE_VERSION ((MOD_CONFIG_FILE_EPOCH << 16) | MOD_CONFIG_FILE_GENERATION)
typedef struct _Config Config;

Loading…
Cancel
Save