e: Add preferred desktop environment for apps

In preferences we show which external applications can be used for
setting preferences. If several desktop environments are installed, this
list will have several duplicates, as there can be many different apps
for setting a preference.

With this setting we can filter out for one desktop_environment.

@feature
This commit is contained in:
Sebastian Dransfeld 2014-09-18 10:49:47 +02:00
parent ff31c0533b
commit 764755eb9f
5 changed files with 69 additions and 3 deletions

View File

@ -92,7 +92,7 @@ extern char **environ;
AC_DEFINE(HAVE_ENVIRON, 1, [Have environ var])
])
efl_version="1.11"
efl_version="1.11.99"
AC_SUBST(efl_version)
AC_CHECK_HEADERS([sys/timerfd.h sys/ptrace.h arpa/inet.h netinet/in.h])

View File

@ -621,6 +621,7 @@ _e_config_edd_init(Eina_Bool old)
E_CONFIG_VAL(D, T, icon_theme, STR);
E_CONFIG_VAL(D, T, icon_theme_overrides, UCHAR);
E_CONFIG_VAL(D, T, desktop_environment, STR);
E_CONFIG_VAL(D, T, desk_flip_animate_mode, INT);
E_CONFIG_VAL(D, T, desk_flip_animate_type, STR);
@ -2250,6 +2251,7 @@ _e_config_free(E_Config *ecf)
if (ecf->input_method) eina_stringshare_del(ecf->input_method);
if (ecf->exebuf_term_cmd) eina_stringshare_del(ecf->exebuf_term_cmd);
if (ecf->icon_theme) eina_stringshare_del(ecf->icon_theme);
if (ecf->desktop_environment) eina_stringshare_del(ecf->desktop_environment);
if (ecf->wallpaper_import_last_dev) eina_stringshare_del(ecf->wallpaper_import_last_dev);
if (ecf->wallpaper_import_last_path) eina_stringshare_del(ecf->wallpaper_import_last_path);
if (ecf->theme_default_border_style) eina_stringshare_del(ecf->theme_default_border_style);

View File

@ -264,6 +264,7 @@ struct _E_Config
const char *icon_theme; // GUI
unsigned char icon_theme_overrides; // GUI
const char *desktop_environment; // GUI
/* modes:
* 1-"pane") horizontal or vertical movement to/from next/previous "screen"

View File

@ -524,6 +524,7 @@ main(int argc, char **argv)
TS("E_Env Init Done");
_e_main_shutdown_push(e_env_shutdown);
efreet_desktop_environment_set(e_config->desktop_environment);
e_util_env_set("E_ICON_THEME", e_config->icon_theme);
ecore_exe_run_priority_set(e_config->priority);
locked |= e_config->desklock_start_locked;

View File

@ -16,6 +16,9 @@ struct _E_Config_Dialog_Data
int load_gnome;
int load_kde;
int exe_always_single_instance;
const char *desktop_environment;
Eina_List *desktop_environments;
int desktop_environment_id;
};
/* a nice easy setup function that does the dirty work */
@ -52,6 +55,25 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->load_gnome = e_config->deskenv.load_gnome;
cfdata->load_kde = e_config->deskenv.load_kde;
cfdata->exe_always_single_instance = e_config->exe_always_single_instance;
cfdata->desktop_environments = efreet_util_desktop_environments_list();
eina_stringshare_replace(&(cfdata->desktop_environment), e_config->desktop_environment);
cfdata->desktop_environment_id = 0;
if (e_config->desktop_environment)
{
Eina_List *l;
const char *de;
int cde = 0;
EINA_LIST_FOREACH(cfdata->desktop_environments, l, de)
{
cde++;
if (!strcmp(e_config->desktop_environment, de))
{
cfdata->desktop_environment_id = cde;
break;
}
}
}
}
static void *
@ -67,17 +89,39 @@ _create_data(E_Config_Dialog *cfd __UNUSED__)
static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
eina_list_free(cfdata->desktop_environments);
E_FREE(cfdata);
}
static int
_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
if (cfdata->desktop_environment_id > 0)
{
Eina_List *l;
const char *de;
int cde = 0;
EINA_LIST_FOREACH(cfdata->desktop_environments, l, de)
{
if ((++cde) == cfdata->desktop_environment_id)
{
eina_stringshare_replace(&(cfdata->desktop_environment), de);
break;
}
}
}
else
{
eina_stringshare_replace(&(cfdata->desktop_environment), NULL);
}
return (e_config->deskenv.load_xrdb != cfdata->load_xrdb) ||
(e_config->deskenv.load_xmodmap != cfdata->load_xmodmap) ||
(e_config->deskenv.load_gnome != cfdata->load_gnome) ||
(e_config->deskenv.load_kde != cfdata->load_kde) ||
(e_config->exe_always_single_instance != cfdata->exe_always_single_instance);
(e_config->exe_always_single_instance != cfdata->exe_always_single_instance) ||
(e_util_strcmp(e_config->desktop_environment, cfdata->desktop_environment));
}
/**--APPLY--**/
@ -89,7 +133,9 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
e_config->deskenv.load_gnome = cfdata->load_gnome;
e_config->deskenv.load_kde = cfdata->load_kde;
e_config->exe_always_single_instance = cfdata->exe_always_single_instance;
eina_stringshare_replace(&(e_config->desktop_environment), cfdata->desktop_environment);
e_config_save_queue();
efreet_desktop_environment_set(e_config->desktop_environment);
return 1; /* Apply was OK */
}
@ -99,6 +145,10 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
{
/* generate the core widget layout for a basic dialog */
Evas_Object *o, *fr, *ob;
Eina_List *l;
E_Radio_Group *rg;
const char *de;
int cde = 0;
o = e_widget_list_add(evas, 0, 0);
@ -125,7 +175,19 @@ _basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data
&(cfdata->load_kde));
e_widget_framelist_object_append(fr, ob);
e_widget_list_object_append(o, fr, 1, 0, 0.0);
fr = e_widget_framelist_add(evas, _("Prefer applications from Desktop Environment"), 0);
rg = e_widget_radio_group_new(&(cfdata->desktop_environment_id));
ob = e_widget_radio_add(evas, _("All"), cde, rg);
e_widget_framelist_object_append(fr, ob);
EINA_LIST_FOREACH(cfdata->desktop_environments, l, de)
{
ob = e_widget_radio_add(evas, de, ++cde, rg);
e_widget_framelist_object_append(fr, ob);
}
e_widget_list_object_append(o, fr, 1, 0, 0.0);
return o;
}