add e_fm2_view_flags_{get,set}

with these you can opt to ignore things like custom directory options,
very useful for widgets to choose files (e_widget_fsel) since you
don't want them to show your items as 128x128 :-)



SVN revision: 39322
devs/princeamd/enlightenment-0.17-elive
Gustavo Sverzut Barbieri 14 years ago
parent 9cee5ead3c
commit 155495866f
  1. 43
      src/bin/e_fm.c
  2. 12
      src/bin/e_fm.h
  3. 1
      src/bin/e_widget_flist.c
  4. 2
      src/bin/e_widget_fsel.c
  5. 2
      src/modules/conf_desklock/e_int_config_desklock.c
  6. 1
      src/modules/conf_imc/e_int_config_imc.c
  7. 1
      src/modules/conf_startup/e_int_config_startup.c
  8. 2
      src/modules/fileman/e_fwin.c
  9. 1
      src/modules/gadman/e_mod_config.c

@ -86,7 +86,8 @@ struct _E_Fm2_Smart_Data
unsigned char inherited_dir_props : 1;
signed char view_mode; /* -1 = unset */
signed short icon_size; /* -1 = unset */
E_Fm2_View_Flags view_flags;
E_Fm2_Config *config;
const char *custom_theme;
const char *custom_theme_content;
@ -881,6 +882,8 @@ _e_fm2_dir_load_props(E_Fm2_Smart_Data *sd)
{
E_Fm2_Custom_File *cf;
if (sd->view_flags & E_FM2_VIEW_NO_LOAD_DIR_CUSTOM) return;
cf = e_fm2_custom_file_get(sd->realpath);
if ((cf) && (cf->dir))
{
@ -914,6 +917,16 @@ _e_fm2_dir_load_props(E_Fm2_Smart_Data *sd)
sd->pos.y = 0;
}
if (sd->view_flags & E_FM2_VIEW_NO_INHERIT_DIR_CUSTOM)
{
sd->view_mode = -1;
sd->icon_size = -1;
sd->order_file = 0;
sd->show_hidden_files = 0;
sd->inherited_dir_props = 0;
return;
}
sd->inherited_dir_props = 1;
cf = _e_fm2_dir_load_props_from_parent(sd->realpath);
@ -939,6 +952,8 @@ _e_fm2_dir_save_props(E_Fm2_Smart_Data *sd)
E_Fm2_Custom_File *cf, cf0;
E_Fm2_Custom_Dir dir0;
if (sd->view_flags & E_FM2_VIEW_NO_SAVE_DIR_CUSTOM) return;
cf = e_fm2_custom_file_get(sd->realpath);
if (!cf)
{
@ -1232,6 +1247,26 @@ e_fm2_icon_menu_flags_get(Evas_Object *obj)
return sd->icon_menu.flags;
}
EAPI void
e_fm2_view_flags_set(Evas_Object *obj, E_Fm2_View_Flags flags)
{
E_Fm2_Smart_Data *sd = evas_object_smart_data_get(obj);
if (!sd) return; // safety
if (!evas_object_type_get(obj)) return; // safety
if (strcmp(evas_object_type_get(obj), "e_fm")) return; // safety
sd->view_flags = flags;
}
EAPI E_Fm2_View_Flags
e_fm2_view_flags_get(Evas_Object *obj)
{
E_Fm2_Smart_Data *sd = evas_object_smart_data_get(obj);
if (!sd) return 0; // safety
if (!evas_object_type_get(obj)) return 0; // safety
if (strcmp(evas_object_type_get(obj), "e_fm")) return 0; // safety
return sd->view_flags;
}
EAPI void
e_fm2_window_object_set(Evas_Object *obj, E_Object *eobj)
{
@ -6922,7 +6957,8 @@ _e_fm2_menu(Evas_Object *obj, unsigned int timestamp)
mi = e_menu_item_new(mn);
e_menu_item_separator_set(mi, 1);
}
if (!(sd->icon_menu.flags & E_FM2_MENU_NO_INHERIT_PARENT))
if ((!(sd->icon_menu.flags & E_FM2_MENU_NO_INHERIT_PARENT)) &&
(!(sd->view_flags & E_FM2_VIEW_NO_INHERIT_DIR_CUSTOM)))
{
mi = e_menu_item_new(mn);
e_menu_item_label_set(mi, _("Inherit parent settings"));
@ -7104,7 +7140,8 @@ _e_fm2_icon_menu(E_Fm2_Icon *ic, Evas_Object *obj, unsigned int timestamp)
e_menu_item_separator_set(mi, 1);
}
if (!(sd->icon_menu.flags & E_FM2_MENU_NO_INHERIT_PARENT))
if ((!(sd->icon_menu.flags & E_FM2_MENU_NO_INHERIT_PARENT)) &&
(!(sd->view_flags & E_FM2_VIEW_NO_INHERIT_DIR_CUSTOM)))
{
mi = e_menu_item_new(mn);
e_menu_item_label_set(mi, _("Inherit parent settings"));

@ -35,6 +35,16 @@ typedef enum _E_Fm2_Menu_Flags
E_FM2_MENU_NO_INHERIT_PARENT = (1 << 11)
} E_Fm2_Menu_Flags;
typedef enum _E_Fm2_View_Flags
{
E_FM2_VIEW_NO_LOAD_DIR_CUSTOM = (1 << 0),
E_FM2_VIEW_NO_SAVE_DIR_CUSTOM = (1 << 1),
E_FM2_VIEW_NO_INHERIT_DIR_CUSTOM = (1 << 2),
E_FM2_VIEW_NO_DIR_CUSTOM = (E_FM2_VIEW_NO_LOAD_DIR_CUSTOM |
E_FM2_VIEW_NO_SAVE_DIR_CUSTOM |
E_FM2_VIEW_NO_INHERIT_DIR_CUSTOM)
} E_Fm2_View_Flags;
typedef struct _E_Fm2_Config E_Fm2_Config;
typedef struct _E_Fm2_Icon E_Fm2_Icon;
typedef struct _E_Fm2_Icon_Info E_Fm2_Icon_Info;
@ -143,6 +153,8 @@ EAPI void e_fm2_icon_menu_start_extend_callback_set(Evas_Object
EAPI void e_fm2_icon_menu_end_extend_callback_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *info), void *data);
EAPI void e_fm2_icon_menu_flags_set(Evas_Object *obj, E_Fm2_Menu_Flags flags);
EAPI E_Fm2_Menu_Flags e_fm2_icon_menu_flags_get(Evas_Object *obj);
EAPI void e_fm2_view_flags_set(Evas_Object *obj, E_Fm2_View_Flags flags);
EAPI E_Fm2_View_Flags e_fm2_view_flags_get(Evas_Object *obj);
EAPI void e_fm2_window_object_set(Evas_Object *obj, E_Object *eobj);
EAPI void e_fm2_icons_update(Evas_Object *obj);

@ -59,6 +59,7 @@ e_widget_flist_add(Evas *evas)
wd->fmc.selection.windows_modifiers = 0;
e_fm2_config_set(wd->o_fm, &wd->fmc);
e_fm2_icon_menu_flags_set(wd->o_fm, E_FM2_MENU_NO_SHOW_HIDDEN);
e_fm2_view_flags_set(wd->o_fm, E_FM2_VIEW_NO_DIR_CUSTOM);
evas_object_smart_callback_add(wd->o_fm, "dir_changed",
_e_wid_cb_dir_changed, obj);

@ -408,6 +408,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_view_flags_set(o, E_FM2_VIEW_NO_DIR_CUSTOM);
evas_object_smart_callback_add(o, "changed",
_e_wid_fsel_favorites_files_changed, wd);
evas_object_smart_callback_add(o, "selected",
@ -448,6 +449,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_view_flags_set(o, E_FM2_VIEW_NO_DIR_CUSTOM);
evas_object_smart_callback_add(o, "dir_changed",
_e_wid_fsel_files_changed, wd);
evas_object_smart_callback_add(o, "selection_change",

@ -234,6 +234,8 @@ _adv_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
fmc.selection.windows_modifiers = 0;
e_fm2_config_set(ow, &fmc);
e_fm2_icon_menu_flags_set(ow, E_FM2_MENU_NO_SHOW_HIDDEN);
e_fm2_view_flags_set(ow, E_FM2_VIEW_NO_DIR_CUSTOM);
e_fm2_path_set(ow, path, "/");
evas_object_smart_callback_add(ow, "dir_changed",
_cb_fm_dir_change, cfdata);

@ -861,6 +861,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
fmc.selection.windows_modifiers = 0;
e_fm2_config_set(o, &fmc);
e_fm2_icon_menu_flags_set(o, E_FM2_MENU_NO_SHOW_HIDDEN);
e_fm2_view_flags_set(o, E_FM2_VIEW_NO_DIR_CUSTOM);
evas_object_smart_callback_add(o, "dir_changed",
_cb_files_changed, cfdata);

@ -309,6 +309,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
fmc.selection.windows_modifiers = 0;
e_fm2_config_set(o, &fmc);
e_fm2_icon_menu_flags_set(o, E_FM2_MENU_NO_SHOW_HIDDEN);
e_fm2_view_flags_set(o, E_FM2_VIEW_NO_DIR_CUSTOM);
evas_object_smart_callback_add(o, "dir_changed",
_cb_files_changed, cfdata);
evas_object_smart_callback_add(o, "selection_change",

@ -176,6 +176,8 @@ e_fwin_zone_new(E_Zone *zone, const char *dev, const char *path)
_e_fwin_config_set(fwin);
e_fm2_custom_theme_content_set(o, "desktop");
e_fm2_view_flags_set(o, E_FM2_VIEW_NO_DIR_CUSTOM);
evas_object_smart_callback_add(o, "dir_changed",
_e_fwin_changed, fwin);
evas_object_smart_callback_add(o, "dir_deleted",

@ -222,6 +222,7 @@ _adv_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfda
fmc.selection.windows_modifiers = 0;
e_fm2_config_set(ow, &fmc);
e_fm2_icon_menu_flags_set(ow, E_FM2_MENU_NO_SHOW_HIDDEN);
e_fm2_view_flags_set(ow, E_FM2_VIEW_NO_DIR_CUSTOM);
e_fm2_path_set(ow, path, "/");
evas_object_smart_callback_add(ow, "selection_change",

Loading…
Cancel
Save