lock on suspend option++ (also on hibernate - same options)

SVN revision: 49354
This commit is contained in:
Carsten Haitzler 2010-05-31 15:17:02 +00:00
parent c3848ae55a
commit 348d599f8b
11 changed files with 34 additions and 8 deletions

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65845; value "config_version" int: 65847;
value "show_splash" int: 0; value "show_splash" int: 0;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i"; value "desktop_default_name" string: "Desktop %i, %i";
@ -432,6 +432,7 @@ group "E_Config" struct {
value "desklock_auth_method" int: 0; value "desklock_auth_method" int: 0;
value "desklock_login_box_zone" int: -1; value "desklock_login_box_zone" int: -1;
value "desklock_start_locked" int: 0; value "desklock_start_locked" int: 0;
value "desklock_on_suspend" int: 0;
value "desklock_autolock_screensaver" int: 0; value "desklock_autolock_screensaver" int: 0;
value "desklock_post_screensaver_time" double: 0.0; value "desklock_post_screensaver_time" double: 0.0;
value "desklock_autolock_idle" int: 0; value "desklock_autolock_idle" int: 0;

View File

@ -1247,7 +1247,7 @@ group "E_Config" struct {
value "priority" int: -1000; value "priority" int: -1000;
} }
} }
value "config_version" int: 65845; value "config_version" int: 65847;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i"; value "desktop_default_name" string: "Desktop %i, %i";
@ -1358,6 +1358,7 @@ group "E_Config" struct {
value "desklock_auth_method" int: 0; value "desklock_auth_method" int: 0;
value "desklock_login_box_zone" int: -1; value "desklock_login_box_zone" int: -1;
value "desklock_start_locked" int: 0; value "desklock_start_locked" int: 0;
value "desklock_on_suspend" int: 0;
value "desklock_autolock_screensaver" int: 0; value "desklock_autolock_screensaver" int: 0;
value "desklock_post_screensaver_time" double: 0.0000000000000000000000000; value "desklock_post_screensaver_time" double: 0.0000000000000000000000000;
value "desklock_autolock_idle" int: 0; value "desklock_autolock_idle" int: 0;

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65845; value "config_version" int: 65847;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i"; value "desktop_default_name" string: "Desktop %i, %i";
@ -655,6 +655,7 @@ group "E_Config" struct {
value "desklock_auth_method" int: 0; value "desklock_auth_method" int: 0;
value "desklock_login_box_zone" int: -1; value "desklock_login_box_zone" int: -1;
value "desklock_start_locked" int: 0; value "desklock_start_locked" int: 0;
value "desklock_on_suspend" int: 0;
value "desklock_autolock_screensaver" int: 0; value "desklock_autolock_screensaver" int: 0;
value "desklock_post_screensaver_time" double: 0.0; value "desklock_post_screensaver_time" double: 0.0;
value "desklock_autolock_idle" int: 0; value "desklock_autolock_idle" int: 0;

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65845; value "config_version" int: 65847;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_background" string: "Light_Gradient.edj"; value "desktop_default_background" string: "Light_Gradient.edj";
@ -1846,6 +1846,7 @@ group "E_Config" struct {
value "desklock_auth_method" int: 0; value "desklock_auth_method" int: 0;
value "desklock_login_box_zone" int: -1; value "desklock_login_box_zone" int: -1;
value "desklock_start_locked" int: 0; value "desklock_start_locked" int: 0;
value "desklock_on_suspend" int: 0;
value "desklock_autolock_screensaver" int: 0; value "desklock_autolock_screensaver" int: 0;
value "desklock_post_screensaver_time" double: 0.0; value "desklock_post_screensaver_time" double: 0.0;
value "desklock_autolock_idle" int: 0; value "desklock_autolock_idle" int: 0;

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65845; value "config_version" int: 65847;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_background" string: "Dark_Gradient.edj"; value "desktop_default_background" string: "Dark_Gradient.edj";
@ -1910,6 +1910,7 @@ group "E_Config" struct {
value "desklock_auth_method" int: 0; value "desklock_auth_method" int: 0;
value "desklock_login_box_zone" int: -1; value "desklock_login_box_zone" int: -1;
value "desklock_start_locked" int: 0; value "desklock_start_locked" int: 0;
value "desklock_on_suspend" int: 0;
value "desklock_autolock_screensaver" int: 0; value "desklock_autolock_screensaver" int: 0;
value "desklock_post_screensaver_time" double: 0.0; value "desklock_post_screensaver_time" double: 0.0;
value "desklock_autolock_idle" int: 0; value "desklock_autolock_idle" int: 0;

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65845; value "config_version" int: 65847;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i"; value "desktop_default_name" string: "Desktop %i, %i";
@ -1946,6 +1946,7 @@ group "E_Config" struct {
value "desklock_auth_method" int: 0; value "desklock_auth_method" int: 0;
value "desklock_login_box_zone" int: -1; value "desklock_login_box_zone" int: -1;
value "desklock_start_locked" int: 0; value "desklock_start_locked" int: 0;
value "desklock_on_suspend" int: 0;
value "desklock_autolock_screensaver" int: 0; value "desklock_autolock_screensaver" int: 0;
value "desklock_post_screensaver_time" double: 0.0; value "desklock_post_screensaver_time" double: 0.0;
value "desklock_autolock_idle" int: 0; value "desklock_autolock_idle" int: 0;

View File

@ -1,5 +1,5 @@
group "E_Config" struct { group "E_Config" struct {
value "config_version" int: 65845; value "config_version" int: 65847;
value "show_splash" int: 1; value "show_splash" int: 1;
value "init_default_theme" string: "default.edj"; value "init_default_theme" string: "default.edj";
value "desktop_default_name" string: "Desktop %i, %i"; value "desktop_default_name" string: "Desktop %i, %i";
@ -2043,6 +2043,7 @@ group "E_Config" struct {
value "desklock_auth_method" int: 0; value "desklock_auth_method" int: 0;
value "desklock_login_box_zone" int: -1; value "desklock_login_box_zone" int: -1;
value "desklock_start_locked" int: 0; value "desklock_start_locked" int: 0;
value "desklock_on_suspend" int: 0;
value "desklock_autolock_screensaver" int: 0; value "desklock_autolock_screensaver" int: 0;
value "desklock_post_screensaver_time" double: 0.0; value "desklock_post_screensaver_time" double: 0.0;
value "desklock_autolock_idle" int: 0; value "desklock_autolock_idle" int: 0;

View File

@ -622,6 +622,7 @@ e_config_init(void)
E_CONFIG_VAL(D, T, desklock_auth_method, INT); 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_login_box_zone, INT);
E_CONFIG_VAL(D, T, desklock_start_locked, INT); E_CONFIG_VAL(D, T, desklock_start_locked, INT);
E_CONFIG_VAL(D, T, desklock_on_suspend, INT);
E_CONFIG_VAL(D, T, desklock_autolock_screensaver, INT); E_CONFIG_VAL(D, T, desklock_autolock_screensaver, INT);
E_CONFIG_VAL(D, T, desklock_post_screensaver_time, DOUBLE); E_CONFIG_VAL(D, T, desklock_post_screensaver_time, DOUBLE);
E_CONFIG_VAL(D, T, desklock_autolock_idle, INT); E_CONFIG_VAL(D, T, desklock_autolock_idle, INT);
@ -999,6 +1000,10 @@ e_config_load(void)
_e_config_acpi_bindings_add(); _e_config_acpi_bindings_add();
IFCFGEND; IFCFGEND;
IFCFG(0x0137);
COPYVAL(desklock_on_suspend);
IFCFGEND;
e_config->config_version = E_CONFIG_FILE_VERSION; e_config->config_version = E_CONFIG_FILE_VERSION;
_e_config_free(tcfg); _e_config_free(tcfg);
} }

View File

@ -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 /* 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 * config doesn't need to be wiped - simply new values need to be put in
*/ */
#define E_CONFIG_FILE_GENERATION 0x0136 #define E_CONFIG_FILE_GENERATION 0x0137
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION) #define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
#define E_EVAS_ENGINE_DEFAULT 0 #define E_EVAS_ENGINE_DEFAULT 0
@ -205,6 +205,7 @@ struct _E_Config
int desklock_auth_method; // GUI int desklock_auth_method; // GUI
int desklock_login_box_zone; // GUI int desklock_login_box_zone; // GUI
int desklock_start_locked; // GUI int desklock_start_locked; // GUI
int desklock_on_suspend; // GUI
int desklock_autolock_screensaver; // GUI int desklock_autolock_screensaver; // GUI
double desklock_post_screensaver_time; // GUI double desklock_post_screensaver_time; // GUI
int desklock_autolock_idle; // GUI int desklock_autolock_idle; // GUI

View File

@ -629,6 +629,8 @@ _e_sys_action_do(E_Sys_Action a, char *param)
} }
else else
{ {
if (e_config->desklock_on_suspend) e_desklock_show();
_e_sys_exe = ecore_exe_run(buf, NULL); _e_sys_exe = ecore_exe_run(buf, NULL);
od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()),
_("Suspending"), "E", "_sys_suspend"); _("Suspending"), "E", "_sys_suspend");
@ -655,6 +657,8 @@ _e_sys_action_do(E_Sys_Action a, char *param)
} }
else else
{ {
if (e_config->desklock_on_suspend) e_desklock_show();
_e_sys_exe = ecore_exe_run(buf, NULL); _e_sys_exe = ecore_exe_run(buf, NULL);
od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()), od = e_obj_dialog_new(e_container_current_get(e_manager_current_get()),
_("Hibernating"), "E", "_sys_hibernate"); _("Hibernating"), "E", "_sys_hibernate");

View File

@ -43,6 +43,7 @@ struct _E_Config_Dialog_Data
/* Basic props */ /* Basic props */
int start_locked; int start_locked;
int lock_on_suspend;
int auto_lock; int auto_lock;
int screensaver_lock; int screensaver_lock;
double idle_time; double idle_time;
@ -129,6 +130,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->custom_lock_cmd = strdup(e_config->desklock_custom_desklock_cmd); cfdata->custom_lock_cmd = strdup(e_config->desklock_custom_desklock_cmd);
cfdata->start_locked = e_config->desklock_start_locked; cfdata->start_locked = e_config->desklock_start_locked;
cfdata->lock_on_suspend = e_config->desklock_on_suspend;
cfdata->auto_lock = e_config->desklock_autolock_idle; cfdata->auto_lock = e_config->desklock_autolock_idle;
cfdata->screensaver_lock = e_config->desklock_autolock_screensaver; cfdata->screensaver_lock = e_config->desklock_autolock_screensaver;
cfdata->idle_time = e_config->desklock_autolock_idle_timeout / 60; cfdata->idle_time = e_config->desklock_autolock_idle_timeout / 60;
@ -202,6 +204,10 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
&cfdata->start_locked); &cfdata->start_locked);
e_widget_disabled_set(ow, !cfdata->use_xscreensaver); e_widget_disabled_set(ow, !cfdata->use_xscreensaver);
e_widget_framelist_object_append(of, ow); e_widget_framelist_object_append(of, ow);
ow = e_widget_check_add(evas, _("Lock on Suspend"),
&cfdata->lock_on_suspend);
e_widget_disabled_set(ow, !cfdata->use_xscreensaver);
e_widget_framelist_object_append(of, ow);
ow = e_widget_check_add(evas, _("Lock when X screensaver activates"), ow = e_widget_check_add(evas, _("Lock when X screensaver activates"),
&cfdata->screensaver_lock); &cfdata->screensaver_lock);
e_widget_on_change_hook_set(ow, _basic_screensaver_lock_cb_changed, cfdata); e_widget_on_change_hook_set(ow, _basic_screensaver_lock_cb_changed, cfdata);
@ -239,6 +245,7 @@ static int
_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{ {
e_config->desklock_start_locked = cfdata->start_locked; e_config->desklock_start_locked = cfdata->start_locked;
e_config->desklock_on_suspend = cfdata->lock_on_suspend;
e_config->desklock_autolock_idle = cfdata->auto_lock; e_config->desklock_autolock_idle = cfdata->auto_lock;
e_config->desklock_autolock_screensaver = cfdata->screensaver_lock; e_config->desklock_autolock_screensaver = cfdata->screensaver_lock;
e_config->desklock_post_screensaver_time = cfdata->post_screensaver_time; e_config->desklock_post_screensaver_time = cfdata->post_screensaver_time;
@ -252,6 +259,7 @@ _basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{ {
return return
((e_config->desklock_start_locked != cfdata->start_locked) || ((e_config->desklock_start_locked != cfdata->start_locked) ||
(e_config->desklock_on_suspend != cfdata->lock_on_suspend) ||
(e_config->desklock_autolock_idle != cfdata->auto_lock) || (e_config->desklock_autolock_idle != cfdata->auto_lock) ||
(e_config->desklock_autolock_screensaver != cfdata->screensaver_lock) || (e_config->desklock_autolock_screensaver != cfdata->screensaver_lock) ||
(e_config->desklock_post_screensaver_time != cfdata->post_screensaver_time) || (e_config->desklock_post_screensaver_time != cfdata->post_screensaver_time) ||
@ -473,6 +481,7 @@ static int
_adv_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) _adv_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{ {
e_config->desklock_start_locked = cfdata->start_locked; e_config->desklock_start_locked = cfdata->start_locked;
e_config->desklock_on_suspend = cfdata->lock_on_suspend;
e_config->desklock_autolock_idle = cfdata->auto_lock; e_config->desklock_autolock_idle = cfdata->auto_lock;
e_config->desklock_autolock_screensaver = cfdata->screensaver_lock; e_config->desklock_autolock_screensaver = cfdata->screensaver_lock;
e_config->desklock_autolock_idle_timeout = cfdata->idle_time * 60; e_config->desklock_autolock_idle_timeout = cfdata->idle_time * 60;