forked from enlightenment/enlightenment
add config option for remembering filemanager windows globally instead of per-directory
ticket #1982 SVN revision: 83718
This commit is contained in:
parent
5aaeebde0b
commit
a4ef12329e
|
@ -1,3 +1,7 @@
|
|||
2013-02-07 Mike Blumenkrantz
|
||||
|
||||
* added option for remembering filemanager windows globally
|
||||
|
||||
2013-02-07 Carsten Haitzler
|
||||
|
||||
* fix clock timerfd usage to actually detect a date change.
|
||||
|
|
1
NEWS
1
NEWS
|
@ -36,6 +36,7 @@ Additions:
|
|||
* edge bindings can now be set to "drag only"
|
||||
* new option for disabling all pointer warps
|
||||
* added option for preventing all keyboard layout changes
|
||||
* added option for remembering filemanager windows globally
|
||||
|
||||
Changes:
|
||||
Modules:
|
||||
|
|
|
@ -623,6 +623,7 @@ _e_config_edd_init(Eina_Bool old)
|
|||
E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
|
||||
E_CONFIG_VAL(D, T, remember_internal_windows, INT);
|
||||
E_CONFIG_VAL(D, T, remember_internal_fm_windows, UCHAR);
|
||||
E_CONFIG_VAL(D, T, remember_internal_fm_windows_globally, UCHAR);
|
||||
E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
|
||||
E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
|
||||
E_CONFIG_VAL(D, T, move_info_visible, INT); /**/
|
||||
|
@ -1413,6 +1414,7 @@ e_config_load(void)
|
|||
E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 3);
|
||||
E_CONFIG_LIMIT(e_config->remember_internal_fm_windows, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->remember_internal_fm_windows_globally, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1);
|
||||
|
||||
E_CONFIG_LIMIT(e_config->screen_limits, 0, 2);
|
||||
|
|
|
@ -162,6 +162,7 @@ struct _E_Config
|
|||
Eina_List *remembers; // GUI
|
||||
int remember_internal_windows; // GUI
|
||||
Eina_Bool remember_internal_fm_windows; // GUI
|
||||
Eina_Bool remember_internal_fm_windows_globally; // GUI
|
||||
int move_info_follows; // GUI
|
||||
int resize_info_follows; // GUI
|
||||
int move_info_visible; // GUI
|
||||
|
|
|
@ -1661,7 +1661,9 @@ e_configure_option_init(void)
|
|||
OPT_ADD(BOOL, remember_internal_windows, _("Remember internal window geometry"), _("border"), _("remember"));
|
||||
OPT_HELP(_("This option causes E to remember the geometry of its internal dialogs and windows, NOT including filemanager windows"));
|
||||
OPT_ADD(BOOL, remember_internal_fm_windows, _("Remember internal filemanager window geometry"), _("border"), _("remember"), _("files"));
|
||||
OPT_HELP(_("This option causes E to remember the geometry of its internal filemanager windows, NOT including dialog windows"));
|
||||
OPT_HELP(_("This option causes E to remember the geometry of its internal filemanager windows, NOT including dialog windows, based on the directory the window is showing"));
|
||||
OPT_ADD(BOOL, remember_internal_fm_windows_globally, _("Remember internal filemanager window geometry globally"), _("border"), _("remember"), _("files"));
|
||||
OPT_HELP(_("This option causes E to remember the geometry of its internal filemanager windows globally instead of using the target directory"));
|
||||
|
||||
OPT_ADD(BOOL, move_info_follows, _("Window position info follows window when moving"), _("border"), _("placement"), _("move"));
|
||||
OPT_ADD(BOOL, resize_info_follows, _("Window geometry info follows window when resizing"), _("border"), _("placement"), _("resize"));
|
||||
|
|
|
@ -15,6 +15,7 @@ struct _E_Config_Dialog_Data
|
|||
Evas_Object *list, *btn, *name, *class, *title, *role;
|
||||
int remember_dialogs;
|
||||
int remember_fm_wins;
|
||||
int remember_internal_fm_windows_globally;
|
||||
};
|
||||
|
||||
E_Config_Dialog *
|
||||
|
@ -82,6 +83,7 @@ _create_data(E_Config_Dialog *cfd __UNUSED__)
|
|||
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
||||
cfdata->remember_dialogs = e_config->remember_internal_windows;
|
||||
cfdata->remember_fm_wins = e_config->remember_internal_fm_windows;
|
||||
cfdata->remember_internal_fm_windows_globally = e_config->remember_internal_fm_windows_globally;
|
||||
|
||||
return cfdata;
|
||||
}
|
||||
|
@ -96,7 +98,8 @@ static int
|
|||
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
return ((cfdata->remember_dialogs == e_config->remember_internal_windows) &&
|
||||
(cfdata->remember_fm_wins == e_config->remember_internal_fm_windows));
|
||||
(cfdata->remember_fm_wins == e_config->remember_internal_fm_windows) &&
|
||||
(cfdata->remember_internal_fm_windows_globally == e_config->remember_internal_fm_windows_globally));
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -104,6 +107,7 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
{
|
||||
e_config->remember_internal_windows = cfdata->remember_dialogs;
|
||||
e_config->remember_internal_fm_windows = cfdata->remember_fm_wins;
|
||||
e_config->remember_internal_fm_windows_globally = cfdata->remember_internal_fm_windows_globally;
|
||||
|
||||
e_config_save_queue();
|
||||
return 1;
|
||||
|
@ -112,7 +116,7 @@ _basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
|||
static Evas_Object *
|
||||
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Evas_Object *ol, *of2, *ow;
|
||||
Evas_Object *ol, *of2, *ow, *oc;
|
||||
Evas_Coord mw, mh;
|
||||
|
||||
e_dialog_resizable_set(cfd->dia, 1);
|
||||
|
@ -121,8 +125,12 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
|||
ow = e_widget_check_add(evas, _("Remember internal dialogs"),
|
||||
&(cfdata->remember_dialogs));
|
||||
e_widget_list_object_append(ol, ow, 1, 0, 0.0);
|
||||
ow = e_widget_check_add(evas, _("Remember file manager windows"),
|
||||
oc = e_widget_check_add(evas, _("Remember file manager windows"),
|
||||
&(cfdata->remember_fm_wins));
|
||||
e_widget_list_object_append(ol, oc, 1, 0, 0.0);
|
||||
ow = e_widget_check_add(evas, _("Don't remember file manager windows by directory"),
|
||||
&(cfdata->remember_internal_fm_windows_globally));
|
||||
e_widget_check_widget_disable_on_unchecked_add(oc, ow);
|
||||
e_widget_list_object_append(ol, ow, 1, 0, 0.0);
|
||||
|
||||
ow = e_widget_button_add(evas, _("Delete"), "list-remove",
|
||||
|
|
|
@ -239,11 +239,13 @@ static E_Fwin *drag_fwin = NULL;
|
|||
static Eina_List *fwins = NULL;
|
||||
static E_Fm2_Mime_Handler *dir_handler = NULL;
|
||||
static Efreet_Desktop *tdesktop = NULL;
|
||||
static Eina_Stringshare *fwin_class = NULL;
|
||||
|
||||
/* externally accessible functions */
|
||||
int
|
||||
e_fwin_init(void)
|
||||
{
|
||||
fwin_class = eina_stringshare_add("e_fwin");
|
||||
tdesktop = e_util_terminal_desktop_get();
|
||||
if (!tdesktop) return 1;
|
||||
dir_handler = e_fm2_mime_handler_new(_("Open Terminal here"),
|
||||
|
@ -262,6 +264,7 @@ e_fwin_shutdown(void)
|
|||
EINA_LIST_FREE(fwins, fwin)
|
||||
e_object_del(E_OBJECT(fwin));
|
||||
|
||||
eina_stringshare_replace(&fwin_class, NULL);
|
||||
if (dir_handler)
|
||||
{
|
||||
e_fm2_mime_handler_mime_del(dir_handler, "inode/directory");
|
||||
|
@ -1513,8 +1516,13 @@ _e_fwin_window_title_set(E_Fwin_Page *page)
|
|||
e_win_title_set(page->fwin->win, buf);
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "e_fwin::%s", e_fm2_real_path_get(page->fm_obj));
|
||||
e_win_name_class_set(page->fwin->win, "E", buf);
|
||||
if (e_config->remember_internal_fm_windows_globally)
|
||||
e_win_name_class_set(page->fwin->win, "E", fwin_class);
|
||||
else
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "e_fwin::%s", e_fm2_real_path_get(page->fm_obj));
|
||||
e_win_name_class_set(page->fwin->win, "E", buf);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2222,35 +2230,28 @@ _e_fwin_border_set(E_Fwin_Page *page, E_Fwin *fwin, E_Fm2_Icon_Info *ici)
|
|||
oic = e_fm2_icon_get(evas_object_evas_get(ici->fm),
|
||||
ici->ic, NULL, NULL, 0, &itype);
|
||||
if (!oic) return;
|
||||
if (fwin->win->border->internal_icon)
|
||||
eina_stringshare_del(fwin->win->border->internal_icon);
|
||||
fwin->win->border->internal_icon = NULL;
|
||||
if (fwin->win->border->internal_icon_key)
|
||||
eina_stringshare_del(fwin->win->border->internal_icon_key);
|
||||
fwin->win->border->internal_icon_key = NULL;
|
||||
|
||||
eina_stringshare_replace(&fwin->win->border->internal_icon, NULL);
|
||||
eina_stringshare_replace(&fwin->win->border->internal_icon_key, NULL);
|
||||
if (!strcmp(evas_object_type_get(oic), "edje"))
|
||||
{
|
||||
edje_object_file_get(oic, &file, &group);
|
||||
if (file)
|
||||
{
|
||||
fwin->win->border->internal_icon =
|
||||
eina_stringshare_add(file);
|
||||
if (group)
|
||||
fwin->win->border->internal_icon_key =
|
||||
eina_stringshare_add(group);
|
||||
}
|
||||
fwin->win->border->internal_icon = eina_stringshare_ref(file);
|
||||
fwin->win->border->internal_icon_key = eina_stringshare_ref(group);
|
||||
}
|
||||
else
|
||||
{
|
||||
e_icon_file_get(oic, &file, &group);
|
||||
fwin->win->border->internal_icon = eina_stringshare_add(file);
|
||||
fwin->win->border->internal_icon_key = eina_stringshare_add(group);
|
||||
fwin->win->border->internal_icon = eina_stringshare_ref(file);
|
||||
fwin->win->border->internal_icon_key = eina_stringshare_ref(group);
|
||||
}
|
||||
evas_object_del(oic);
|
||||
if (fwin->win->border->placed) return;
|
||||
|
||||
class = eina_stringshare_printf("e_fwin::%s", e_fm2_real_path_get(fwin->cur_page->fm_obj));
|
||||
if (e_config->remember_internal_fm_windows_globally)
|
||||
class = fwin_class;
|
||||
else
|
||||
class = eina_stringshare_printf("e_fwin::%s", e_fm2_real_path_get(fwin->cur_page->fm_obj));
|
||||
e_zone_useful_geometry_get(fwin->win->border->zone,
|
||||
NULL, NULL, &zw, &zh);
|
||||
EINA_LIST_FOREACH(e_config->remembers, ll, rem)
|
||||
|
@ -2263,7 +2264,8 @@ _e_fwin_border_set(E_Fwin_Page *page, E_Fwin *fwin, E_Fm2_Icon_Info *ici)
|
|||
rem->prop.pos_y = E_CLAMP(rem->prop.pos_y, 0, zh - rem->prop.h);
|
||||
break;
|
||||
}
|
||||
eina_stringshare_del(class);
|
||||
if (!e_config->remember_internal_fm_windows_globally)
|
||||
eina_stringshare_del(class);
|
||||
|
||||
if (found) return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue