Ravenlock's combined dpms/screensaver patches and new config dialogs.

Nice work :)


SVN revision: 28346
devs/princeamd/enlightenment-0.17-elive
Christopher Michael 16 years ago
parent d0e3a150b5
commit 7a3f2f0ed2
  1. 8
      src/bin/Makefile.am
  2. 120
      src/bin/e_config.c
  3. 27
      src/bin/e_config.h
  4. 4
      src/bin/e_configure.c
  5. 119
      src/bin/e_desklock.c
  6. 25
      src/bin/e_dpms.c
  7. 9
      src/bin/e_dpms.h
  8. 4
      src/bin/e_includes.h
  9. 87
      src/bin/e_int_config_desklock.c
  10. 305
      src/bin/e_int_config_dpms.c
  11. 9
      src/bin/e_int_config_dpms.h
  12. 186
      src/bin/e_int_config_screensaver.c
  13. 9
      src/bin/e_int_config_screensaver.h
  14. 34
      src/bin/e_ipc_handlers.h
  15. 13
      src/bin/e_ipc_handlers_list.h
  16. 16
      src/bin/e_main.c
  17. 2
      src/bin/e_manager.c
  18. 20
      src/bin/e_screensaver.c
  19. 9
      src/bin/e_screensaver.h

@ -138,8 +138,12 @@ e_int_config_cfgdialogs.h \
e_int_config_color_classes.h \
e_int_config_mime.h \
e_int_config_mime_edit.h \
e_int_config_screensaver.h \
e_int_config_dpms.h \
e_exebuf.h \
e_desklock.h \
e_screensaver.h \
e_dpms.h \
e_int_config_modules.h \
e_exehist.h \
e_color_class.h \
@ -295,8 +299,12 @@ e_int_config_imc_import.c \
e_int_config_color_classes.c \
e_int_config_mime.c \
e_int_config_mime_edit.c \
e_int_config_screensaver.c \
e_int_config_dpms.c \
e_exebuf.c \
e_desklock.c \
e_screensaver.c \
e_dpms.c \
e_int_config_modules.c \
e_exehist.c \
e_color_class.c \

@ -41,7 +41,6 @@ static E_Config_DD *_e_config_gadcon_client_edd = NULL;
static E_Config_DD *_e_config_shelf_edd = NULL;
static E_Config_DD *_e_config_mime_icon_edd = NULL;
/* externally accessible functions */
EAPI int
e_config_init(void)
@ -168,7 +167,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, enabled, UCHAR);
_e_config_font_default_edd = E_CONFIG_DD_NEW("E_Font_Default",
E_Font_Default);
E_Font_Default);
#undef T
#undef D
#define T E_Font_Default
@ -178,14 +177,15 @@ e_config_init(void)
E_CONFIG_VAL(D, T, size, INT);
_e_config_font_fallback_edd = E_CONFIG_DD_NEW("E_Font_Fallback",
E_Font_Fallback);
E_Font_Fallback);
#undef T
#undef D
#define T E_Font_Fallback
#define D _e_config_font_fallback_edd
E_CONFIG_VAL(D, T, name, STR);
_e_config_bindings_mouse_edd = E_CONFIG_DD_NEW("E_Config_Binding_Mouse", E_Config_Binding_Mouse);
_e_config_bindings_mouse_edd = E_CONFIG_DD_NEW("E_Config_Binding_Mouse",
E_Config_Binding_Mouse);
#undef T
#undef D
#define T E_Config_Binding_Mouse
@ -197,7 +197,8 @@ e_config_init(void)
E_CONFIG_VAL(D, T, button, UCHAR);
E_CONFIG_VAL(D, T, any_mod, UCHAR);
_e_config_bindings_key_edd = E_CONFIG_DD_NEW("E_Config_Binding_Key", E_Config_Binding_Key);
_e_config_bindings_key_edd = E_CONFIG_DD_NEW("E_Config_Binding_Key",
E_Config_Binding_Key);
#undef T
#undef D
#define T E_Config_Binding_Key
@ -209,7 +210,8 @@ e_config_init(void)
E_CONFIG_VAL(D, T, params, STR);
E_CONFIG_VAL(D, T, any_mod, UCHAR);
_e_config_bindings_signal_edd = E_CONFIG_DD_NEW("E_Config_Binding_Signal", E_Config_Binding_Signal);
_e_config_bindings_signal_edd = E_CONFIG_DD_NEW("E_Config_Binding_Signal",
E_Config_Binding_Signal);
#undef T
#undef D
#define T E_Config_Binding_Signal
@ -222,7 +224,8 @@ e_config_init(void)
E_CONFIG_VAL(D, T, action, STR);
E_CONFIG_VAL(D, T, params, STR);
_e_config_bindings_wheel_edd = E_CONFIG_DD_NEW("E_Config_Binding_Wheel", E_Config_Binding_Wheel);
_e_config_bindings_wheel_edd = E_CONFIG_DD_NEW("E_Config_Binding_Wheel",
E_Config_Binding_Wheel);
#undef T
#undef D
#define T E_Config_Binding_Wheel
@ -311,7 +314,8 @@ e_config_init(void)
E_CONFIG_VAL(D, T, b3, INT);
E_CONFIG_VAL(D, T, a3, INT);
_e_config_mime_icon_edd = E_CONFIG_DD_NEW("E_Config_Mime_Icon", E_Config_Mime_Icon);
_e_config_mime_icon_edd = E_CONFIG_DD_NEW("E_Config_Mime_Icon",
E_Config_Mime_Icon);
#undef T
#undef D
#define T E_Config_Mime_Icon
@ -474,18 +478,31 @@ e_config_init(void)
E_CONFIG_VAL(D, T, desklock_background, STR);
E_CONFIG_VAL(D, T, desklock_auth_method, INT);
E_CONFIG_VAL(D, T, desklock_login_box_zone, INT);
E_CONFIG_VAL(D, T, desklock_autolock, INT);
E_CONFIG_VAL(D, T, desklock_use_timeout, INT);
E_CONFIG_VAL(D, T, desklock_timeout, DOUBLE);
E_CONFIG_VAL(D, T, desklock_disable_screensaver, INT);
E_CONFIG_VAL(D, T, desklock_use_custom_screensaver, INT);
E_CONFIG_VAL(D, T, desklock_custom_screensaver_cmd, STR);
E_CONFIG_VAL(D, T, desklock_autolock_screensaver, INT);
E_CONFIG_VAL(D, T, desklock_autolock_idle, INT);
E_CONFIG_VAL(D, T, desklock_autolock_idle_timeout, DOUBLE);
E_CONFIG_VAL(D, T, desklock_use_custom_desklock, INT);
E_CONFIG_VAL(D, T, desklock_custom_desklock_cmd, STR);
E_CONFIG_VAL(D, T, display_res_restore, INT);
E_CONFIG_VAL(D, T, display_res_width, INT);
E_CONFIG_VAL(D, T, display_res_height, INT);
E_CONFIG_VAL(D, T, display_res_hz, INT);
E_CONFIG_VAL(D, T, display_res_rotation, INT);
E_CONFIG_VAL(D, T, screensaver_enable, INT);
E_CONFIG_VAL(D, T, screensaver_timeout, INT);
E_CONFIG_VAL(D, T, screensaver_interval, INT);
E_CONFIG_VAL(D, T, screensaver_blanking, INT);
E_CONFIG_VAL(D, T, screensaver_expose, INT);
E_CONFIG_VAL(D, T, dpms_enable, INT);
E_CONFIG_VAL(D, T, dpms_standby_enable, INT);
E_CONFIG_VAL(D, T, dpms_suspend_enable, INT);
E_CONFIG_VAL(D, T, dpms_off_enable, INT);
E_CONFIG_VAL(D, T, dpms_standby_timeout, INT);
E_CONFIG_VAL(D, T, dpms_suspend_timeout, INT);
E_CONFIG_VAL(D, T, dpms_off_timeout, INT);
E_CONFIG_VAL(D, T, border_raise_on_mouse_action, INT);
E_CONFIG_VAL(D, T, border_raise_on_focus, INT);
E_CONFIG_VAL(D, T, desk_flip_wrap, INT);
@ -678,10 +695,9 @@ e_config_init(void)
e_config->desklock_background = NULL;
e_config->desklock_auth_method = 0;
e_config->desklock_login_box_zone = -1;
e_config->desklock_autolock = 0;
e_config->desklock_use_timeout = 0;
e_config->desklock_timeout = 300.0;
e_config->desklock_disable_screensaver = 0;
e_config->desklock_autolock_screensaver = 0;
e_config->desklock_autolock_idle = 0;
e_config->desklock_autolock_idle_timeout = 300.0;
e_config->display_res_restore = 0;
e_config->display_res_width = 0;
@ -759,24 +775,15 @@ e_config_init(void)
//_restore_defaults_cb function
CFG_MOUSEBIND(E_BINDING_CONTEXT_BORDER, 1,
E_BINDING_MODIFIER_ALT, 0,
"window_move", NULL);
E_BINDING_MODIFIER_ALT, 0, "window_move", NULL);
CFG_MOUSEBIND(E_BINDING_CONTEXT_BORDER, 2,
E_BINDING_MODIFIER_ALT, 0,
"window_resize", NULL);
E_BINDING_MODIFIER_ALT, 0, "window_resize", NULL);
CFG_MOUSEBIND(E_BINDING_CONTEXT_BORDER, 3,
E_BINDING_MODIFIER_ALT, 0,
"window_menu", NULL);
CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 1,
0, 0,
"menu_show", "main");
CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 2,
0, 0,
"menu_show", "clients");
E_BINDING_MODIFIER_ALT, 0, "window_menu", NULL);
CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 1, 0, 0, "menu_show", "main");
CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 2, 0, 0, "menu_show", "clients");
#ifdef ENABLE_FAVORITES
CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 3,
0, 0,
"menu_show", "favorites");
CFG_MOUSEBIND(E_BINDING_CONTEXT_ZONE, 3, 0, 0, "menu_show", "favorites");
#endif
}
{
@ -1225,8 +1232,8 @@ e_config_init(void)
IFCFGEND;
IFCFG(0x00106);
e_config->desklock_use_custom_screensaver = 0;
e_config->desklock_custom_screensaver_cmd = NULL;
e_config->desklock_use_custom_desklock = 0;
e_config->desklock_custom_desklock_cmd = NULL;
IFCFGEND;
IFCFG(0x0107); /* the version # where this value(s) was introduced */
@ -1297,9 +1304,24 @@ e_config_init(void)
IFCFG(0x0108);
e_config->desk_auto_switch = 0;
IFCFGEND;
e_config->config_version = E_CONFIG_FILE_VERSION;
IFCFG(0x0109);
e_config->dpms_enable = 0;
e_config->dpms_standby_enable = 0;
e_config->dpms_suspend_enable = 0;
e_config->dpms_off_enable = 0;
e_config->dpms_standby_timeout = 0;
e_config->dpms_suspend_timeout = 0;
e_config->dpms_off_timeout = 0;
e_config->screensaver_enable = 0;
e_config->screensaver_timeout = 0;
e_config->screensaver_interval = 5;
e_config->screensaver_blanking = 2;
e_config->screensaver_expose = 2;
IFCFGEND;
e_config->config_version = E_CONFIG_FILE_VERSION;
#if 0 /* example of new config */
IFCFG(0x0090); /* the version # where this value(s) was introduced */
e_config->new_value = 10; /* set the value(s) */
@ -1382,11 +1404,10 @@ e_config_init(void)
E_CONFIG_LIMIT(e_config->cfgdlg_default_mode, 0, 1);
E_CONFIG_LIMIT(e_config->font_hinting, 0, 2);
E_CONFIG_LIMIT(e_config->desklock_login_box_zone, -2, 1000);
E_CONFIG_LIMIT(e_config->desklock_autolock, 0, 1);
E_CONFIG_LIMIT(e_config->desklock_use_timeout, 0, 1);
E_CONFIG_LIMIT(e_config->desklock_timeout, 1.0, 5400.0);
E_CONFIG_LIMIT(e_config->desklock_disable_screensaver, 0, 1);
E_CONFIG_LIMIT(e_config->desklock_use_custom_screensaver, 0, 1);
E_CONFIG_LIMIT(e_config->desklock_autolock_screensaver, 0, 1);
E_CONFIG_LIMIT(e_config->desklock_autolock_idle, 0, 1);
E_CONFIG_LIMIT(e_config->desklock_autolock_idle_timeout, 1.0, 5400.0);
E_CONFIG_LIMIT(e_config->desklock_use_custom_desklock, 0, 1);
E_CONFIG_LIMIT(e_config->display_res_restore, 0, 1);
E_CONFIG_LIMIT(e_config->display_res_width, 1, 8192);
E_CONFIG_LIMIT(e_config->display_res_height, 1, 8192);
@ -1397,6 +1418,19 @@ e_config_init(void)
E_CONFIG_LIMIT(e_config->desk_flip_wrap, 0, 1);
E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 1);
E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1);
E_CONFIG_LIMIT(e_config->dpms_enable, 0, 1);
E_CONFIG_LIMIT(e_config->dpms_standby_enable, 0, 1);
E_CONFIG_LIMIT(e_config->dpms_suspend_enable, 0, 1);
E_CONFIG_LIMIT(e_config->dpms_off_enable, 0, 1);
E_CONFIG_LIMIT(e_config->dpms_standby_timeout, 0, 5400);
E_CONFIG_LIMIT(e_config->dpms_suspend_timeout, 0, 5400);
E_CONFIG_LIMIT(e_config->dpms_off_timeout, 0, 5400);
E_CONFIG_LIMIT(e_config->screensaver_timeout, 0, 5400);
E_CONFIG_LIMIT(e_config->screensaver_interval, 0, 5400);
E_CONFIG_LIMIT(e_config->screensaver_blanking, 0, 2);
E_CONFIG_LIMIT(e_config->screensaver_expose, 0, 2);
/* FIXME: disabled auto apply because it causes problems */
e_config->cfgdlg_auto_apply = 0;
@ -1983,7 +2017,7 @@ _e_config_free(void)
if (e_config->wallpaper_import_last_dev) evas_stringshare_del(e_config->wallpaper_import_last_dev);
if (e_config->wallpaper_import_last_path) evas_stringshare_del(e_config->wallpaper_import_last_path);
if (e_config->theme_default_border_style) evas_stringshare_del(e_config->theme_default_border_style);
if (e_config->desklock_custom_screensaver_cmd) evas_stringshare_del(e_config->desklock_custom_screensaver_cmd);
if (e_config->desklock_custom_desklock_cmd) evas_stringshare_del(e_config->desklock_custom_desklock_cmd);
E_FREE(e_config);
}
}

@ -52,7 +52,7 @@ typedef Eet_Data_Descriptor E_Config_DD;
/* 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 0x0108
#define E_CONFIG_FILE_GENERATION 0x0109
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
#define E_EVAS_ENGINE_DEFAULT 0
@ -227,13 +227,26 @@ struct _E_Config
const char *desklock_background; // GUI
int desklock_auth_method; // GUI
int desklock_login_box_zone; // GUI
int desklock_autolock; // GUI
int desklock_use_timeout; // GUI
double desklock_timeout; // GUI
int desklock_disable_screensaver; // GUI
int desklock_use_custom_screensaver; //GUI
const char *desklock_custom_screensaver_cmd; // GUI
int desklock_autolock_screensaver; // GUI
int desklock_autolock_idle; // GUI
double desklock_autolock_idle_timeout; // GUI
int desklock_use_custom_desklock; //GUI
const char *desklock_custom_desklock_cmd; // GUI
int screensaver_enable;
int screensaver_timeout;
int screensaver_interval;
int screensaver_blanking;
int screensaver_expose;
int dpms_enable;
int dpms_standby_enable;
int dpms_standby_timeout;
int dpms_suspend_enable;
int dpms_suspend_timeout;
int dpms_off_enable;
int dpms_off_timeout;
int display_res_restore; // GUI
int display_res_width; // GUI
int display_res_height; // GUI

@ -412,7 +412,9 @@ _e_configure_fill_cat_list(void *data)
_e_configure_item_add(cat, _("Virtual Desktops"), "enlightenment/desktops", e_int_config_desks);
_e_configure_item_add(cat, _("Screen Resolution"), "enlightenment/screen_resolution", e_int_config_display);
_e_configure_item_add(cat, _("Screen Lock"), "enlightenment/desklock", e_int_config_desklock);
_e_configure_item_add(cat, _("Screen Saver"), "enlightenment/screensaver", e_int_config_screensaver);
_e_configure_item_add(cat, _("DPMS Settings"), "enlightenment/dpms", e_int_config_dpms);
cat = _e_configure_category_add(eco, _("Keyboard & Mouse"), "enlightenment/behavior");
_e_configure_item_add(cat, _("Key Bindings"), "enlightenment/keys", e_int_config_keybindings);
_e_configure_item_add(cat, _("Mouse Bindings"), "enlightenment/mouse_clean", e_int_config_mousebindings);

@ -52,8 +52,10 @@ static E_Zone *last_active_zone = NULL;
static Ecore_Event_Handler *_e_desklock_exit_handler = NULL;
static pid_t _e_desklock_child_pid = -1;
#endif
static Ecore_Exe *_e_custom_saver_exe = NULL;
static Ecore_Event_Handler *_e_custom_saver_exe_handler = NULL;
static Ecore_Exe *_e_custom_desklock_exe = NULL;
static Ecore_Event_Handler *_e_custom_desklock_exe_handler = NULL;
static Ecore_Timer *_e_desklock_idle_timer = NULL;
static int _e_desklock_user_idle = 0;
/***********************************************************************/
@ -62,7 +64,8 @@ static int _e_desklock_cb_mouse_down(void *data, int type, void *event);
static int _e_desklock_cb_mouse_up(void *data, int type, void *event);
static int _e_desklock_cb_mouse_wheel(void *data, int type, void *event);
static int _e_desklock_cb_mouse_move(void *data, int type, void *event);
static int _e_desklock_cb_custom_saver_exit(void *data, int type, void *event);
static int _e_desklock_cb_custom_desklock_exit(void *data, int type, void *event);
static int _e_desklock_cb_idle_timer(void *data, int type, void *event);
static void _e_desklock_passwd_update();
static void _e_desklock_backspace();
@ -84,20 +87,10 @@ EAPI int
e_desklock_init(void)
{
if (e_config->desklock_disable_screensaver)
ecore_x_screensaver_timeout_set(0);
else
{
if (e_config->desklock_use_timeout)
ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
}
/*
* Effectively hide the X screensaver yet allow
* it to generate the timer events for us.
*/
ecore_x_screensaver_blank_set(!e_config->desklock_use_custom_screensaver);
ecore_x_screensaver_expose_set(!e_config->desklock_use_custom_screensaver);
/* A timer to tick every second, watching for an idle user */
_e_desklock_idle_timer = ecore_timer_add(1.0,
_e_desklock_cb_idle_timer,
NULL);
if (e_config->desklock_background)
e_filereg_register(e_config->desklock_background);
@ -125,26 +118,26 @@ e_desklock_show(void)
int zone_counter;
int total_zone_num;
if (_e_custom_desklock_exe) return 0;
#ifndef HAVE_PAM
e_util_dialog_show(_("Error - no PAM support"),
_("No PAM support was built into Enlightenment, so<br>"
"desk locking is disabled."));
return 0;
#endif
if (_e_custom_saver_exe) return 0;
if (e_config->desklock_use_custom_screensaver)
if (e_config->desklock_use_custom_desklock)
{
_e_custom_saver_exe_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
_e_desklock_cb_custom_saver_exit,
_e_custom_desklock_exe_handler = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
_e_desklock_cb_custom_desklock_exit,
NULL);
e_util_library_path_strip();
_e_custom_saver_exe = ecore_exe_run(e_config->desklock_custom_screensaver_cmd, NULL);
_e_custom_desklock_exe = ecore_exe_run(e_config->desklock_custom_desklock_cmd, NULL);
e_util_library_path_restore();
return 1;
}
#ifndef HAVE_PAM
e_util_dialog_show(_("Error - no PAM support"),
_("No PAM support was built into Enlightenment, so<br>"
"desk locking is disabled."));
return 0;
#endif
if (edd) return 0;
#ifdef HAVE_PAM
@ -357,16 +350,17 @@ e_desklock_hide(void)
{
E_Desklock_Popup_Data *edp;
if ((!edd) && (!_e_custom_saver_exe)) return;
if ((!edd) && (!_e_custom_desklock_exe)) return;
if (e_config->desklock_use_custom_screensaver)
if (e_config->desklock_use_custom_desklock)
{
_e_custom_saver_exe = NULL;
_e_custom_desklock_exe = NULL;
return;
}
if (edd->elock_grab_break_wnd)
ecore_x_window_show(edd->elock_grab_break_wnd);
while (edd->elock_wnd_list)
{
edp = edd->elock_wnd_list->data;
@ -778,28 +772,65 @@ _desklock_auth_get_current_host(void)
#endif
static int
_e_desklock_cb_custom_saver_exit(void *data, int type, void *event)
_e_desklock_cb_custom_desklock_exit(void *data, int type, void *event)
{
Ecore_Exe_Event_Del *ev;
ev = event;
if (ev->exe != _e_custom_saver_exe) return 1;
if (ev->exe != _e_custom_desklock_exe) return 1;
if (ev->exit_code != 0)
{
/* do something profound here... like notify someone */
}
/*
* Miserable HACK alert!!!
* Seems I must reset this. Some reason yet unknown, my
* intended values are getting reset!?!
*/
ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
ecore_x_screensaver_blank_set(!e_config->desklock_use_custom_screensaver);
ecore_x_screensaver_expose_set(!e_config->desklock_use_custom_screensaver);
e_desklock_hide();
return 0;
}
static int
_e_desklock_cb_idle_timer(void *data, int type, void *event)
{
static double time_of_last_event = 0;
static unsigned int xtime_of_last_user_activity = 0;
if ( ecore_x_current_user_activity_time_get() > xtime_of_last_user_activity )
{
xtime_of_last_user_activity = ecore_x_current_user_activity_time_get();
time_of_last_event = ecore_time_get();
}
if (e_config->desklock_autolock_idle)
{
/* If a desklock is already up, bail */
if ((_e_custom_desklock_exe) || (edd)) return 1;
/* If we have exceeded our idle time... */
double t = ecore_time_get();
if (t - time_of_last_event >= e_config->desklock_autolock_idle_timeout)
{
/*
* Unfortunately, not all "desklocks" stay up for as long as
* the user is idle or until it is unlocked.
*
* 'xscreensaver-command -lock' for example sends a command
* to xscreensaver and then terminates. So, we have another
* check (_e_desklock_user_idle) which lets us know that we
* have locked the screen due to idleness.
*/
if (!_e_desklock_user_idle)
{
_e_desklock_user_idle = 1;
e_desklock_show();
}
}
else
{
_e_desklock_user_idle = 0;
}
}
/* Make sure our timer persists. */
return 1;
}

@ -0,0 +1,25 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#include "e.h"
EAPI int
e_dpms_init(void)
{
int standby=0, suspend=0, off=0;
ecore_x_dpms_enabled_set(e_config->dpms_enable);
if (e_config->dpms_standby_enable)
standby = e_config->dpms_standby_timeout;
if (e_config->dpms_suspend_enable)
suspend = e_config->dpms_suspend_timeout;
if (e_config->dpms_off_enable)
off = e_config->dpms_off_timeout;
ecore_x_dpms_timeouts_set(standby, suspend, off);
return 1;
}

@ -0,0 +1,9 @@
#ifdef E_TYPEDEFS
#else
#ifndef E_DPMS_H
#define E_DPMS_H
EAPI int e_dpms_init(void);
#endif
#endif

@ -102,6 +102,8 @@
#include "e_int_config_winlist.h"
#include "e_int_config_display.h"
#include "e_int_config_desklock.h"
#include "e_int_config_screensaver.h"
#include "e_int_config_dpms.h"
#include "e_int_config_exebuf.h"
#include "e_int_config_apps.h"
#include "e_int_config_cfgdialogs.h"
@ -113,6 +115,8 @@
#include "e_int_config_mime_edit.h"
#include "e_exebuf.h"
#include "e_desklock.h"
#include "e_screensaver.h"
#include "e_dpms.h"
#include "e_int_config_modules.h"
#include "e_exehist.h"
#include "e_color_class.h"

@ -51,16 +51,16 @@ struct _E_Config_Dialog_Data
char *desklock_passwd_cp;
int show_password; // local
int autolock_screensaver;
int autolock; // in e_config;
int use_timeout; // in e_config;
double timeout; // in e_config;
int login_box_zone; // in e_config;
int specific_lb_zone; // local variable
int specific_lb_zone_backup; // used to have smart iface
int use_custom_screensaver;
char *custom_screensaver_cmd;
int use_custom_desklock;
char *custom_desklock_cmd;
int zone_count; // local variable;
@ -283,9 +283,9 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->desklock_passwd_cp = strdup("");
}
cfdata->autolock = e_config->desklock_autolock;
cfdata->use_timeout = e_config->desklock_use_timeout;
cfdata->timeout = e_config->desklock_timeout / 60;
cfdata->autolock_screensaver = e_config->desklock_autolock_screensaver;
cfdata->autolock = e_config->desklock_autolock_idle;
cfdata->timeout = e_config->desklock_autolock_idle_timeout / 60;
/* should be taken from e_config */
//cfdata->login_box_on_zone = -1;
@ -341,9 +341,9 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->auth_method = e_config->desklock_auth_method;
#endif
cfdata->use_custom_screensaver = e_config->desklock_use_custom_screensaver;
if (e_config->desklock_custom_screensaver_cmd)
cfdata->custom_screensaver_cmd = strdup(e_config->desklock_custom_screensaver_cmd);
cfdata->use_custom_desklock = e_config->desklock_use_custom_desklock;
if (e_config->desklock_custom_desklock_cmd)
cfdata->custom_desklock_cmd = strdup(e_config->desklock_custom_desklock_cmd);
//vertical_lb_align = e_config->desklock_login
}
@ -378,17 +378,14 @@ _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
evas_stringshare_del(e_config->desklock_personal_passwd);
}
e_config->desklock_personal_passwd = evas_stringshare_add(cfdata->desklock_passwd_cp);
e_config->desklock_autolock = cfdata->autolock;
e_config->desklock_use_timeout = cfdata->use_timeout;
e_config->desklock_timeout = cfdata->timeout * 60;
e_config->desklock_autolock_screensaver = cfdata->autolock_screensaver;
e_config->desklock_autolock_idle = cfdata->autolock;
e_config->desklock_autolock_idle_timeout = cfdata->timeout * 60;
#ifdef HAVE_PAM
e_config->desklock_auth_method = cfdata->auth_method;
#endif
if (e_config->desklock_use_timeout)
ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
ecore_x_screensaver_blank_set(!e_config->desklock_use_custom_screensaver);
ecore_x_screensaver_expose_set(!e_config->desklock_use_custom_screensaver);
e_config_save_queue();
return 1;
@ -403,15 +400,16 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
of = e_widget_framelist_add(evas, _("Automatic Locking"), 0);
e_widget_disabled_set(of, !ecore_x_screensaver_event_available_get());
ob = e_widget_check_add(evas, _("Enable screensaver"), &(cfdata->use_timeout));
ob = e_widget_check_add(evas, _("Lock when X screensaver activates"),
&(cfdata->autolock_screensaver));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
e_widget_framelist_object_append(of, ob);
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Lock when the screensaver starts"), &(cfdata->autolock));
ob = e_widget_check_add(evas, _("Lock when idle time exceeded"), &(cfdata->autolock));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Time until screensaver starts"));
ob = e_widget_label_add(evas, _("Idle time to exceed"));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
@ -458,26 +456,21 @@ _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
else
e_config->desklock_login_box_zone = LOGINBOX_SHOW_ALL_SCREENS;
e_config->desklock_autolock = cfdata->autolock;
e_config->desklock_use_timeout = cfdata->use_timeout;
e_config->desklock_timeout = cfdata->timeout * 60;
e_config->desklock_autolock_screensaver = cfdata->autolock_screensaver;
e_config->desklock_autolock_idle = cfdata->autolock;
e_config->desklock_autolock_idle_timeout = cfdata->timeout * 60;
#ifdef HAVE_PAM
e_config->desklock_auth_method = cfdata->auth_method;
#endif
if (e_config->desklock_use_timeout)
ecore_x_screensaver_timeout_set(e_config->desklock_timeout);
e_config->desklock_use_custom_screensaver = cfdata->use_custom_screensaver;
if (cfdata->custom_screensaver_cmd)
e_config->desklock_use_custom_desklock = cfdata->use_custom_desklock;
if (cfdata->custom_desklock_cmd)
{
if (e_config->desklock_custom_screensaver_cmd)
evas_stringshare_del(e_config->desklock_custom_screensaver_cmd);
e_config->desklock_custom_screensaver_cmd = evas_stringshare_add(cfdata->custom_screensaver_cmd);
if (e_config->desklock_custom_desklock_cmd)
evas_stringshare_del(e_config->desklock_custom_desklock_cmd);
e_config->desklock_custom_desklock_cmd = evas_stringshare_add(cfdata->custom_desklock_cmd);
}
ecore_x_screensaver_blank_set(!e_config->desklock_use_custom_screensaver);
ecore_x_screensaver_expose_set(!e_config->desklock_use_custom_screensaver);
e_config_save_queue();
return 1;
}
@ -708,19 +701,16 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
*/
of = e_widget_framelist_add(evas, _("Automatic Locking"), 0);
e_widget_disabled_set(of, !ecore_x_screensaver_event_available_get());
ob = e_widget_check_add(evas, _("Enable X screensaver"), &(cfdata->use_timeout));
ob = e_widget_check_add(evas, _("Lock when X screensaver activates"),
&(cfdata->autolock_screensaver));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Lock when the screensaver starts"), &(cfdata->autolock));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
ob = e_widget_check_add(evas, _("Lock when idle time exceeded"), &(cfdata->autolock));
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Time until screensaver starts"));
e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
ob = e_widget_label_add(evas, _("Idle time to exceed"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
1.0, 90.0,
@ -734,15 +724,16 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
#endif
/*
* Allow Custom Screen Saver
* Allow Custom Desklock
* Useful, for example, for those of us who prefer
* to use things like xscreensaver, kscreesaver, etc...
* and force them to lock with a custom command.
*/
of = e_widget_framelist_add(evas, _("Custom Screensaver"), 0);
ob = e_widget_check_add(evas, _("Use custom screensaver/desklock"),
&(cfdata->use_custom_screensaver));
of = e_widget_framelist_add(evas, _("Custom Desklock"), 0);
ob = e_widget_check_add(evas, _("Use custom desklock"),
&(cfdata->use_custom_desklock));
e_widget_framelist_object_append(of, ob);
ob = e_widget_entry_add(evas, &(cfdata->custom_screensaver_cmd));
ob = e_widget_entry_add(evas, &(cfdata->custom_desklock_cmd));
e_widget_framelist_object_append(of, ob);
#ifdef HAVE_PAM
e_widget_table_object_append(ot, of, 0, 4, 2, 1, 1, 1, 1, 1);

@ -0,0 +1,305 @@
#include "e.h"
static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas,
E_Config_Dialog_Data *cfdata);
static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas,
E_Config_Dialog_Data *cfdata);
static void _cb_standby_slider_change(void *data, Evas_Object *obj);
static void _cb_suspend_slider_change(void *data, Evas_Object *obj);
static void _cb_off_slider_change(void *data, Evas_Object *obj);
struct _E_Config_Dialog_Data
{
E_Config_Dialog *cfd;
Evas_Object *standby_slider;
Evas_Object *suspend_slider;
Evas_Object *off_slider;
int enable_dpms;
int enable_standby;
int enable_suspend;
int enable_off;
/*
* The following timeouts are represented as minutes
* while the underlying e_config variables are in seconds
*/
double standby_timeout;
double suspend_timeout;
double off_timeout;
};
static E_Dialog *dpms_dialog = NULL;
static void
_cb_dpms_dialog_ok(void *data, E_Dialog *dia)
{
e_object_del(E_OBJECT(dpms_dialog));
dpms_dialog = NULL;
}
static int
_e_int_config_dpms_capable()
{
if (ecore_x_dpms_capable()) return 1;
if (dpms_dialog) e_object_del(E_OBJECT(dpms_dialog));
dpms_dialog = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_dpms_dialog");
if (!dpms_dialog) return 0;
e_dialog_title_set(dpms_dialog, _("Display Power Management Signaling"));
e_dialog_text_set(dpms_dialog, _("The current display server does not <br>"
"have the DPMS extension."));
e_dialog_icon_set(dpms_dialog, "enlightenment/dpms", 64);
e_dialog_button_add(dpms_dialog, _("Ok"), NULL, _cb_dpms_dialog_ok, NULL);
e_dialog_button_focus_num(dpms_dialog, 1);
e_win_centered_set(dpms_dialog->win, 1);
e_dialog_show(dpms_dialog);
return 0;
}
EAPI E_Config_Dialog *
e_int_config_dpms(E_Container *con)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
if ((e_config_dialog_find("E", "_config_dpms_dialog")) ||
(!_e_int_config_dpms_capable()))
return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.apply_cfdata = _advanced_apply_data;
v->basic.create_widgets = _advanced_create_widgets;
v->override_auto_apply = 1;
cfd = e_config_dialog_new(con, _("DPMS Settings"), "E",
"_config_dpms_dialog", "enlightenment/dpms",
0, v, NULL);
return cfd;
}
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
cfdata->enable_dpms = e_config->dpms_enable;
cfdata->enable_standby = e_config->dpms_standby_enable;
cfdata->standby_timeout = e_config->dpms_standby_timeout / 60;
cfdata->enable_suspend = e_config->dpms_suspend_enable;
cfdata->suspend_timeout = e_config->dpms_suspend_timeout / 60;
cfdata->enable_off = e_config->dpms_off_enable;
cfdata->off_timeout = e_config->dpms_off_timeout / 60;
}
static void *
_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->cfd = cfd;
cfdata->standby_slider = NULL;
cfdata->suspend_slider = NULL;
cfdata->off_slider = NULL;
_fill_data(cfdata);
return cfdata;
}
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
if (!cfdata) return;
cfdata->standby_slider=NULL;
cfdata->suspend_slider=NULL;
cfdata->off_slider=NULL;
E_FREE(cfdata);
}
static int
_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
e_config->dpms_enable = cfdata->enable_dpms;
e_config->dpms_standby_enable = cfdata->enable_standby;
e_config->dpms_suspend_enable = cfdata->enable_suspend;
e_config->dpms_off_enable = cfdata->enable_off;
e_config->dpms_standby_timeout = cfdata->standby_timeout * 60;
e_config->dpms_suspend_timeout = cfdata->suspend_timeout * 60;
e_config->dpms_off_timeout = cfdata->off_timeout * 60;
e_dpms_init();
e_config_save_queue();
}
static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
/*
* NOTE: Since the BASIC interface does not allow you to manipulate
* the suspend and off features, I have decided to have them disabled
* when applying changes from this dialog.
*
* I do this because the timeouts must always satisfy the following:
* standby <= suspend <= off
* and if you use the basic dialog, and increase the standby timeout
* you might very well unknowingly push it right up to the off timout.
* at which point, you monitor will turn off, instead of going into
* standby. Which could be annoying.
*/
cfdata->enable_suspend = 0;
cfdata->enable_off = 0;
_apply_data(cfd, cfdata);
return 1;
}
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *o, *of, *ob;
o = e_widget_list_add(evas, 0, 0);
ob = e_widget_check_add(evas, _("Enable DPMS"), &(cfdata->enable_dpms));
e_widget_list_object_append(o, ob, 1, 1 ,0);
of = e_widget_framelist_add(evas, _("DPMS Timer(s)"), 0);
ob = e_widget_check_add(evas, _("Standby"), &(cfdata->enable_standby));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
1.0, 90.0, 1.0, 0, &(cfdata->standby_timeout),
NULL, 200);
e_widget_on_change_hook_set(ob, _cb_standby_slider_change, cfdata);
cfdata->standby_slider = ob;
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
e_dialog_resizable_set(cfd->dia, 0);
return o;
}
/* advanced window */
static int
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
_apply_data(cfd, cfdata);
return 1;
}
static Evas_Object *
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *o, *of, *ob;
E_Radio_Group *rg;
o = e_widget_list_add(evas, 0, 0);
ob = e_widget_check_add(evas, _("Enable DPMS"), &(cfdata->enable_dpms));
e_widget_list_object_append(o, ob, 1, 1, 0);
of = e_widget_framelist_add(evas, _("DPMS Timer(s)"), 0);
ob = e_widget_check_add(evas, _("Standby"), &(cfdata->enable_standby));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"), 1.0, 90.0, 1.0, 0,
&(cfdata->standby_timeout), NULL, 200);
e_widget_on_change_hook_set(ob, _cb_standby_slider_change, cfdata);
cfdata->standby_slider = ob;
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Suspend"), &(cfdata->enable_suspend));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"), 1.0, 90.0, 1.0, 0,
&(cfdata->suspend_timeout), NULL, 200);
e_widget_on_change_hook_set(ob, _cb_suspend_slider_change, cfdata);
cfdata->suspend_slider = ob;
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(evas, _("Off"), &(cfdata->enable_off));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"), 1.0, 90.0, 1.0, 0,
&(cfdata->off_timeout), NULL, 200);
e_widget_on_change_hook_set(ob, _cb_off_slider_change, cfdata);
cfdata->off_slider = ob;
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
e_dialog_resizable_set(cfd->dia, 0);
return o;
}
/* general functionality/callbacks */
static void
_cb_standby_slider_change(void *data, Evas_Object *obj)
{
E_Config_Dialog_Data *cfdata = data;
/* standby-slider */
if (cfdata->standby_timeout > cfdata->suspend_timeout)
{
cfdata->suspend_timeout = cfdata->standby_timeout;
if (cfdata->suspend_slider)
e_widget_slider_value_double_set(cfdata->suspend_slider, cfdata->suspend_timeout);
if (cfdata->suspend_timeout > cfdata->off_timeout)
{
cfdata->off_timeout = cfdata->suspend_timeout;
if (cfdata->off_slider)
e_widget_slider_value_double_set(cfdata->off_slider, cfdata->off_timeout);
}
}
}
static void
_cb_suspend_slider_change(void *data, Evas_Object *obj)
{
E_Config_Dialog_Data *cfdata = data;
/* suspend-slider */
if (cfdata->suspend_timeout > cfdata->off_timeout)
{
cfdata->off_timeout = cfdata->suspend_timeout;
if (cfdata->off_slider)
e_widget_slider_value_double_set(cfdata->off_slider, cfdata->off_timeout);
}
if (cfdata->suspend_timeout < cfdata->standby_timeout)
{
cfdata->standby_timeout = cfdata->suspend_timeout;
if (cfdata->standby_slider)
e_widget_slider_value_double_set(cfdata->standby_slider, cfdata->standby_timeout);
}
}
static void
_cb_off_slider_change(void *data, Evas_Object *obj)
{
E_Config_Dialog_Data *cfdata = data;
/* off-slider */
if (cfdata->off_timeout < cfdata->suspend_timeout)
{
cfdata->suspend_timeout = cfdata->off_timeout;
if (cfdata->suspend_slider)
e_widget_slider_value_double_set(cfdata->suspend_slider, cfdata->suspend_timeout);
if (cfdata->suspend_timeout < cfdata->standby_timeout)
{
cfdata->standby_timeout = cfdata->suspend_timeout;
if (cfdata->standby_slider)
e_widget_slider_value_double_set(cfdata->standby_slider, cfdata->standby_timeout);
}
}
}

@ -0,0 +1,9 @@
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_CONFIG_DPMS_H
#define E_INT_CONFIG_DPMS_H
EAPI E_Config_Dialog *e_int_config_dpms(E_Container *con);
#endif
#endif

@ -0,0 +1,186 @@
#include "e.h"
#define E_CONFIG_BLANKING_DEFAULT 2
#define E_CONFIG_BLANKING_PREFERRED 1
#define E_CONFIG_BLANKING_NOT_PREFERRED 0
#define E_CONFIG_EXPOSURES_DEFAULT 2
#define E_CONFIG_EXPOSURES_ALLOWED 1
#define E_CONFIG_EXPOSURES_NOT_ALLOWED 0
static void *_create_data(E_Config_Dialog *cfd);
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas,
E_Config_Dialog_Data *cfdata);
static int _advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas,
E_Config_Dialog_Data *cfdata);
struct _E_Config_Dialog_Data
{
E_Config_Dialog *cfd;
int enable_screensaver;
double timeout;
double interval;
int blanking;
int exposures;
};
EAPI E_Config_Dialog *
e_int_config_screensaver(E_Container *con)
{
E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
//e_widget_disabled_set(ob, !ecore_x_screensaver_event_available_get());
if (e_config_dialog_find("E", "_config_screensaver_dialog")) return NULL;
v = E_NEW(E_Config_Dialog_View, 1);
v->create_cfdata = _create_data;
v->free_cfdata = _free_data;
v->basic.apply_cfdata = _basic_apply_data;
v->basic.create_widgets = _basic_create_widgets;
v->advanced.apply_cfdata = _advanced_apply_data;
v->advanced.create_widgets = _advanced_create_widgets;
v->override_auto_apply = 1;
cfd = e_config_dialog_new(con,_("Screen Saver Settings"),
"E", "_config_screensaver_dialog",
"enlightenment/screensaver", 0, v, NULL);
return cfd;
}
static void
_fill_data(E_Config_Dialog_Data *cfdata)
{
cfdata->enable_screensaver = e_config->screensaver_enable;
cfdata->timeout = e_config->screensaver_timeout / 60;
cfdata->interval = e_config->screensaver_interval;
cfdata->blanking = e_config->screensaver_blanking;
cfdata->exposures = e_config->screensaver_expose;
}
static void *
_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
cfdata->cfd = cfd;
_fill_data(cfdata);
return cfdata;
}
static void
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
if (!cfdata) return;
E_FREE(cfdata);
}
static int
_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
e_config->screensaver_enable = cfdata->enable_screensaver;
e_config->screensaver_timeout = cfdata->timeout * 60;
e_config->screensaver_interval = cfdata->interval;
e_config->screensaver_blanking = cfdata->blanking;
e_config->screensaver_expose = cfdata->exposures;
/* Apply settings */
e_screensaver_init();
}
static int
_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
_apply_data(cfd, cfdata);
e_config_save_queue();
return 1;
}
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *o, *of, *ob;
o = e_widget_list_add(evas, 0, 0);
ob = e_widget_check_add(evas, _("Enable X screensaver"), &(cfdata->enable_screensaver));
e_widget_list_object_append(o, ob, 1, 1, 0);
of = e_widget_framelist_add(evas, _("Screensaver Timer(s)"), 0);
ob = e_widget_label_add(evas, _("Time until X screensaver starts"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"), 1.0, 90.0, 1.0, 0,
&(cfdata->timeout), NULL, 200);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
e_dialog_resizable_set(cfd->dia, 0);
return o;
}
/* advanced window */
static int
_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
if (!cfdata) return 0;
_apply_data(cfd, cfdata);
e_config_save_queue();
return 1;
}
static Evas_Object *
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *o, *of, *ob;
E_Radio_Group *rg;
o = e_widget_list_add(evas, 0, 0);
ob = e_widget_check_add(evas, _("Enable X screensaver"), &(cfdata->enable_screensaver));
e_widget_list_object_append(o, ob, 1, 1, 0);
of = e_widget_framelist_add(evas, _("Screensaver Timer(s)"), 0);
ob = e_widget_label_add(evas, _("Time until X screensaver starts"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
1.0, 90.0, 1.0, 0, &(cfdata->timeout), NULL, 200);
e_widget_framelist_object_append(of, ob);
ob = e_widget_label_add(evas, _("Time until X screensaver alternates"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f seconds"),
1.0, 300.0, 1.0, 0, &(cfdata->interval), NULL, 200);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Blanking"), 0);
rg = e_widget_radio_group_new(&(cfdata->blanking));
ob = e_widget_radio_add(evas, _("Default"), E_CONFIG_BLANKING_DEFAULT, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Preferred"), E_CONFIG_BLANKING_PREFERRED, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Not Preferred"), E_CONFIG_BLANKING_NOT_PREFERRED, rg);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);
of = e_widget_framelist_add(evas, _("Exposure Events"), 0);
rg = e_widget_radio_group_new(&(cfdata->exposures));
ob = e_widget_radio_add(evas, _("Default"), E_CONFIG_EXPOSURES_DEFAULT, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Allow"), E_CONFIG_EXPOSURES_ALLOWED, rg);
e_widget_framelist_object_append(of, ob);
ob = e_widget_radio_add(evas, _("Don't Allow"), E_CONFIG_EXPOSURES_NOT_ALLOWED, rg);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 1, 1, 0.5);