forked from enlightenment/enlightenment
add "modes" configuration, now "presentation" and "offline".
They are presented as a submenu with check items. Need to implement support in modules, so they'll check for these variables. DESIGNERS: could you please provide the following icons: * preferences-modes: contain the other icons * preferences-modes-presentation: system is in presentation mode, no screensaver, locks and dpms will be available. * preferences-modes-offline: system is offline, modules that keep polling internet services (weather, forecasts, ...) should stop and show "I'm offline" emblem. When network systems (network manager, connman, exhalt...) are integrated, they will change this state as well. SVN revision: 40375
This commit is contained in:
parent
0c48c0367a
commit
3cbfbd69d9
|
@ -1,5 +1,5 @@
|
|||
group "E_Config" struct {
|
||||
value "config_version" int: 65838;
|
||||
value "config_version" int: 65840;
|
||||
value "show_splash" int: 0;
|
||||
value "init_default_theme" string: "default.edj";
|
||||
value "desktop_default_name" string: "Desktop %i, %i";
|
||||
|
@ -527,4 +527,6 @@ group "E_Config" struct {
|
|||
value "syscon.extra.icon_size" int: 48;
|
||||
value "syscon.timeout" double: 0.0;
|
||||
value "syscon.do_input" uchar: 0;
|
||||
value "mode.presentation" uchar: 0;
|
||||
value "mode.offline" uchar: 0;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
group "E_Config" struct {
|
||||
value "config_version" int: 65839;
|
||||
value "config_version" int: 65840;
|
||||
value "show_splash" int: 1;
|
||||
value "init_default_theme" string: "default.edj";
|
||||
value "desktop_default_name" string: "Desktop %i, %i";
|
||||
|
@ -817,4 +817,6 @@ group "E_Config" struct {
|
|||
value "is_main" int: 0;
|
||||
}
|
||||
}
|
||||
value "mode.presentation" uchar: 0;
|
||||
value "mode.offline" uchar: 0;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
group "E_Config" struct {
|
||||
value "config_version" int: 65839;
|
||||
value "config_version" int: 65840;
|
||||
value "show_splash" int: 1;
|
||||
value "init_default_theme" string: "default.edj";
|
||||
value "desktop_default_background" string: "Light_Gradient.edj";
|
||||
|
@ -2049,4 +2049,6 @@ group "E_Config" struct {
|
|||
value "is_main" int: 0;
|
||||
}
|
||||
}
|
||||
value "mode.presentation" uchar: 0;
|
||||
value "mode.offline" uchar: 0;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
group "E_Config" struct {
|
||||
value "config_version" int: 65839;
|
||||
value "config_version" int: 65840;
|
||||
value "show_splash" int: 1;
|
||||
value "init_default_theme" string: "default.edj";
|
||||
value "desktop_default_background" string: "Dark_Gradient.edj";
|
||||
|
@ -2113,4 +2113,6 @@ group "E_Config" struct {
|
|||
value "is_main" int: 0;
|
||||
}
|
||||
}
|
||||
value "mode.presentation" uchar: 0;
|
||||
value "mode.offline" uchar: 0;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
group "E_Config" struct {
|
||||
value "config_version" int: 65839;
|
||||
value "config_version" int: 65840;
|
||||
value "show_splash" int: 1;
|
||||
value "init_default_theme" string: "default.edj";
|
||||
value "desktop_default_name" string: "Desktop %i, %i";
|
||||
|
@ -2136,4 +2136,6 @@ group "E_Config" struct {
|
|||
value "is_main" int: 0;
|
||||
}
|
||||
}
|
||||
value "mode.presentation" uchar: 0;
|
||||
value "mode.offline" uchar: 0;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
group "E_Config" struct {
|
||||
value "config_version" int: 65839;
|
||||
value "config_version" int: 65840;
|
||||
value "show_splash" int: 1;
|
||||
value "init_default_theme" string: "default.edj";
|
||||
value "desktop_default_name" string: "Desktop %i, %i";
|
||||
|
@ -2146,4 +2146,6 @@ group "E_Config" struct {
|
|||
value "is_main" int: 0;
|
||||
}
|
||||
}
|
||||
value "mode.presentation" uchar: 0;
|
||||
value "mode.offline" uchar: 0;
|
||||
}
|
||||
|
|
|
@ -45,12 +45,14 @@ static E_Config_DD *_e_config_mime_icon_edd = NULL;
|
|||
static E_Config_DD *_e_config_syscon_action_edd = NULL;
|
||||
|
||||
EAPI int E_EVENT_CONFIG_ICON_THEME = 0;
|
||||
EAPI int E_EVENT_CONFIG_MODE_CHANGED = 0;
|
||||
|
||||
/* externally accessible functions */
|
||||
EAPI int
|
||||
e_config_init(void)
|
||||
{
|
||||
E_EVENT_CONFIG_ICON_THEME = ecore_event_type_new();
|
||||
E_EVENT_CONFIG_MODE_CHANGED = ecore_event_type_new();
|
||||
|
||||
_e_config_profile = getenv("E_CONF_PROFILE");
|
||||
if (_e_config_profile)
|
||||
|
@ -674,7 +676,10 @@ e_config_init(void)
|
|||
E_CONFIG_VAL(D, T, syscon.timeout, DOUBLE);
|
||||
E_CONFIG_VAL(D, T, syscon.do_input, UCHAR);
|
||||
E_CONFIG_LIST(D, T, syscon.actions, _e_config_syscon_action_edd);
|
||||
|
||||
|
||||
E_CONFIG_VAL(D, T, mode.presentation, UCHAR);
|
||||
E_CONFIG_VAL(D, T, mode.offline, UCHAR);
|
||||
|
||||
e_config_load();
|
||||
|
||||
e_config_save_queue();
|
||||
|
@ -881,6 +886,12 @@ e_config_load(void)
|
|||
IFCFG(0x012f);
|
||||
COPYVAL(icon_theme_overrides);
|
||||
IFCFGEND;
|
||||
|
||||
IFCFG(0x0130);
|
||||
COPYVAL(mode.presentation);
|
||||
COPYVAL(mode.offline);
|
||||
IFCFGEND;
|
||||
|
||||
e_config->config_version = E_CONFIG_FILE_VERSION;
|
||||
_e_config_free(tcfg);
|
||||
}
|
||||
|
@ -1014,7 +1025,10 @@ e_config_load(void)
|
|||
E_CONFIG_LIMIT(e_config->menu_apps_show, 0, 1);
|
||||
|
||||
E_CONFIG_LIMIT(e_config->ping_clients_interval, 16, 1024);
|
||||
|
||||
|
||||
E_CONFIG_LIMIT(e_config->mode.presentation, 0, 1);
|
||||
E_CONFIG_LIMIT(e_config->mode.offline, 0, 1);
|
||||
|
||||
/* FIXME: disabled auto apply because it causes problems */
|
||||
e_config->cfgdlg_auto_apply = 0;
|
||||
/* FIXME: desklock personalized password id disabled for security reasons */
|
||||
|
@ -1452,6 +1466,12 @@ e_config_binding_wheel_match(E_Config_Binding_Wheel *eb_in)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_config_mode_changed(void)
|
||||
{
|
||||
ecore_event_add(E_EVENT_CONFIG_MODE_CHANGED, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
static void
|
||||
_e_config_save_cb(void *data)
|
||||
|
|
|
@ -35,7 +35,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 0x012f
|
||||
#define E_CONFIG_FILE_GENERATION 0x0130
|
||||
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
|
||||
|
||||
#define E_EVAS_ENGINE_DEFAULT 0
|
||||
|
@ -331,6 +331,11 @@ struct _E_Config
|
|||
unsigned char do_input;
|
||||
Eina_List *actions;
|
||||
} syscon;
|
||||
|
||||
struct {
|
||||
Eina_Bool presentation;
|
||||
Eina_Bool offline;
|
||||
} mode;
|
||||
};
|
||||
|
||||
struct _E_Config_Syscon_Action
|
||||
|
@ -519,10 +524,12 @@ EAPI E_Config_Binding_Key *e_config_binding_key_match(E_Config_Binding_Key *e
|
|||
EAPI E_Config_Binding_Edge *e_config_binding_edge_match(E_Config_Binding_Edge *eb_in);
|
||||
EAPI E_Config_Binding_Signal *e_config_binding_signal_match(E_Config_Binding_Signal *eb_in);
|
||||
EAPI E_Config_Binding_Wheel *e_config_binding_wheel_match(E_Config_Binding_Wheel *eb_in);
|
||||
|
||||
EAPI void e_config_mode_changed(void);
|
||||
|
||||
extern EAPI E_Config *e_config;
|
||||
|
||||
extern EAPI int E_EVENT_CONFIG_ICON_THEME;
|
||||
extern EAPI int E_EVENT_CONFIG_MODE_CHANGED;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -205,6 +205,55 @@ _e_mod_conf_cb(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
e_configure_show(m->zone->container);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_mode_presentation_toggle(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi)
|
||||
{
|
||||
e_config->mode.presentation = !e_config->mode.presentation;
|
||||
e_menu_item_toggle_set(mi, e_config->mode.presentation);
|
||||
e_config_mode_changed();
|
||||
e_config_save_queue();
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_mode_offline_toggle(void *data __UNUSED__, E_Menu *m __UNUSED__, E_Menu_Item *mi)
|
||||
{
|
||||
e_config->mode.offline = !e_config->mode.offline;
|
||||
e_menu_item_toggle_set(mi, e_config->mode.offline);
|
||||
e_config_mode_changed();
|
||||
e_config_save_queue();
|
||||
}
|
||||
|
||||
static void
|
||||
_e_mod_submenu_modes_fill(void *data __UNUSED__, E_Menu *m)
|
||||
{
|
||||
E_Menu_Item *mi;
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_check_set(mi, 1);
|
||||
e_menu_item_toggle_set(mi, e_config->mode.presentation);
|
||||
e_menu_item_label_set(mi, _("Presentation"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-modes-presentation");
|
||||
e_menu_item_callback_set(mi, _e_mod_mode_presentation_toggle, NULL);
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_check_set(mi, 1);
|
||||
e_menu_item_toggle_set(mi, e_config->mode.offline);
|
||||
e_menu_item_label_set(mi, _("Offline"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-modes-offline");
|
||||
e_menu_item_callback_set(mi, _e_mod_mode_offline_toggle, NULL);
|
||||
|
||||
e_menu_pre_activate_callback_set(m, NULL, NULL);
|
||||
}
|
||||
|
||||
static E_Menu *
|
||||
_e_mod_submenu_modes_get(void)
|
||||
{
|
||||
E_Menu *m = e_menu_new();
|
||||
if (!m) return NULL;
|
||||
e_menu_pre_activate_callback_set(m, _e_mod_submenu_modes_fill, NULL);
|
||||
return m;
|
||||
}
|
||||
|
||||
/* menu item add hook */
|
||||
static void
|
||||
_e_mod_menu_add(void *data, E_Menu *m)
|
||||
|
@ -215,4 +264,9 @@ _e_mod_menu_add(void *data, E_Menu *m)
|
|||
e_menu_item_label_set(mi, _("Settings Panel"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-system");
|
||||
e_menu_item_callback_set(mi, _e_mod_conf_cb, NULL);
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Modes"));
|
||||
e_util_menu_item_theme_icon_set(mi, "preferences-modes");
|
||||
e_menu_item_submenu_set(mi, _e_mod_submenu_modes_get());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue