aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/conf_desklock/e_int_config_desklock.c
diff options
context:
space:
mode:
authorPeter van de Werken <pwerken-e@A-Eskwadraat.nl>2010-06-05 14:15:18 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-06-05 14:15:18 +0000
commit3fd53655aeb8289ded67d3f741534cc8c81d1640 (patch)
treec381dda5d538e42bfdd9d644e25918f0f797d3cb /src/modules/conf_desklock/e_int_config_desklock.c
parent4b5cb7836c5753a203377f6ee41a1a9ed74b4d45 (diff)
downloadenlightenment-3fd53655aeb8289ded67d3f741534cc8c81d1640.tar.gz
enlightenment-3fd53655aeb8289ded67d3f741534cc8c81d1640.tar.xz
enlightenment-3fd53655aeb8289ded67d3f741534cc8c81d1640.zip
From: Peter van de Werken <pwerken-e@A-Eskwadraat.nl>
Attached is a patch that makes the config dialog of the conf_desklock module work better on small screens. I moved the advanced dialog options into a toolbook on the basic dialog. (I used the Screen Saver dialog as an example.) In order to make the wallpaper stuff fit I removed the preview widget. SVN revision: 49472
Diffstat (limited to 'src/modules/conf_desklock/e_int_config_desklock.c')
-rw-r--r--src/modules/conf_desklock/e_int_config_desklock.c494
1 files changed, 192 insertions, 302 deletions
diff --git a/src/modules/conf_desklock/e_int_config_desklock.c b/src/modules/conf_desklock/e_int_config_desklock.c
index b3271409a..ebae40890 100644
--- a/src/modules/conf_desklock/e_int_config_desklock.c
+++ b/src/modules/conf_desklock/e_int_config_desklock.c
@@ -31,20 +31,22 @@ static void _cb_ask_presentation_changed(void *data, Evas_Object *obj);
struct _E_Config_Dialog_Data
{
E_Config_Dialog *cfd;
- Evas_Object *o_prev;
- Evas_Object *o_fm, *o_sf;
- Evas_Object *o_btn, *o_custom;
- Evas_Object *o_login_slider;
/* Common vars */
int use_xscreensaver;
int fmdir;
int zone_count;
- /* Basic props */
+ /* Locking */
int start_locked;
int lock_on_suspend;
int auto_lock;
+ int locking_method;
+ int login_zone;
+ int zone;
+ char *custom_lock_cmd;
+
+ /* Timers */
int screensaver_lock;
double idle_time;
double post_screensaver_time;
@@ -53,23 +55,16 @@ struct _E_Config_Dialog_Data
int bg_method;
const char *bg;
int custom_lock;
- char *custom_lock_cmd;
- int login_zone;
- int zone;
int ask_presentation;
double ask_presentation_timeout;
- struct {
- struct {
- Evas_Object *auto_lock_label;
- Evas_Object *auto_lock_slider;
- Evas_Object *post_screensaver_label;
- Evas_Object *post_screensaver_slider;
- } basic;
- struct {
- Evas_Object *ask_presentation_label;
- Evas_Object *ask_presentation_slider;
- } adv;
+ struct
+ {
+ Evas_Object *loginbox_slider;
+ Evas_Object *post_screensaver_slider;
+ Evas_Object *auto_lock_slider;
+ Evas_Object *ask_presentation_slider;
+ Evas_Object *o_fm, *o_sf, *o_btn, *o_custom;
} gui;
};
@@ -89,9 +84,6 @@ e_int_config_desklock(E_Container *con, const char *params __UNUSED__)
v->basic.create_widgets = _basic_create;
v->basic.apply_cfdata = _basic_apply;
v->basic.check_changed = _basic_check_changed;
- v->advanced.create_widgets = _adv_create;
- v->advanced.apply_cfdata = _adv_apply;
- v->advanced.check_changed = _adv_check_changed;
v->override_auto_apply = 1;
cfd = e_config_dialog_new(con, _("Screen Lock Settings"), "E",
@@ -176,8 +168,7 @@ _basic_auto_lock_cb_changed(void *data, Evas_Object *o)
disable = ((!cfdata->use_xscreensaver) ||
(!cfdata->auto_lock));
- e_widget_disabled_set(cfdata->gui.basic.auto_lock_label, disable);
- e_widget_disabled_set(cfdata->gui.basic.auto_lock_slider, disable);
+ e_widget_disabled_set(cfdata->gui.auto_lock_slider, disable);
}
static void
@@ -188,120 +179,134 @@ _basic_screensaver_lock_cb_changed(void *data, Evas_Object *o)
disable = ((!cfdata->use_xscreensaver) ||
(!cfdata->screensaver_lock));
- e_widget_disabled_set(cfdata->gui.basic.post_screensaver_label, disable);
- e_widget_disabled_set(cfdata->gui.basic.post_screensaver_slider, disable);
+ e_widget_disabled_set(cfdata->gui.post_screensaver_slider, disable);
}
static Evas_Object *
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
- Evas_Object *o, *of, *ow;
-
+ Evas_Object *o, *otb, *ol, *of, *ow, *rt;
+ E_Radio_Group *rg;
+ E_Fm2_Config fmc;
+ E_Zone *zone;
+ int screen_count;
+ char path[PATH_MAX];
+
+ zone = e_zone_current_get(cfd->con);
+ screen_count = ecore_x_xinerama_screen_count_get();
+
o = e_widget_list_add(evas, 0, 0);
- of = e_widget_framelist_add(evas, _("Automatic Locking"), 0);
- e_widget_disabled_set(of, !cfdata->use_xscreensaver);
+ otb = e_widget_toolbook_add(evas, (48 * e_scale), (48 * e_scale));
+
+ ol = e_widget_list_add(evas, 0, 0);
ow = e_widget_check_add(evas, _("Lock when Enlightenment starts"),
&cfdata->start_locked);
e_widget_disabled_set(ow, !cfdata->use_xscreensaver);
+ e_widget_list_object_append(ol, ow, 1, 1, 0.5);
+
+ of = e_widget_framelist_add(evas, _("Custom Screenlock Command"), 0);
+ ow = e_widget_entry_add(evas, &(cfdata->custom_lock_cmd), NULL, NULL, NULL);
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_list_object_append(ol, ow, 1, 1, 0.5);
+
+ of = e_widget_framelist_add(evas, _("Custom Screenlock Command"), 0);
+ ow = e_widget_entry_add(evas, &(cfdata->custom_lock_cmd), NULL, NULL, NULL);
+ e_widget_framelist_object_append(of, ow);
+ e_widget_list_object_append(ol, of, 1, 1, 0.5);
+
+ of = e_widget_framelist_add(evas, _("Login Box Settings"), 0);
+ e_widget_disabled_set(of, (screen_count <= 0));
+ rg = e_widget_radio_group_new(&(cfdata->login_zone));
+ ow = e_widget_radio_add(evas, _("Show on all screen zones"), -1, rg);
+ e_widget_on_change_hook_set(ow, _cb_login_change, cfdata);
+ e_widget_disabled_set(ow, (screen_count <= 0));
e_widget_framelist_object_append(of, ow);
- ow = e_widget_check_add(evas, _("Lock when X screensaver activates"),
+ ow = e_widget_radio_add(evas, _("Show on current screen zone"), -2, rg);
+ e_widget_on_change_hook_set(ow, _cb_login_change, cfdata);
+ e_widget_disabled_set(ow, (screen_count <= 0));
+ e_widget_framelist_object_append(of, ow);
+ ow = e_widget_radio_add(evas, _("Show on screen zone #:"), 0, rg);
+ e_widget_on_change_hook_set(ow, _cb_login_change, cfdata);
+ e_widget_disabled_set(ow, (screen_count <= 0));
+ e_widget_framelist_object_append(of, ow);
+ cfdata->gui.loginbox_slider =
+ e_widget_slider_add(evas, 1, 0, _("%1.0f"), 0.0, (cfdata->zone_count - 1),
+ 1.0, 0, NULL, &(cfdata->zone), 100);
+ e_widget_disabled_set(cfdata->gui.loginbox_slider, (screen_count <= 0));
+ e_widget_framelist_object_append(of, cfdata->gui.loginbox_slider);
+ e_widget_list_object_append(ol, of, 1, 1, 0.5);
+
+ e_widget_toolbook_page_append(otb, NULL, _("Locking"), ol,
+ 1, 0, 1, 0, 0.5, 0.0);
+
+ ol = e_widget_list_add(evas, 0, 0);
+
+ of = e_widget_framelist_add(evas, _("Screen Lock Timers"), 0);
+ ow = e_widget_check_add(evas, _("Lock after X screensaver activates"),
&cfdata->screensaver_lock);
e_widget_on_change_hook_set(ow, _basic_screensaver_lock_cb_changed, cfdata);
e_widget_disabled_set(ow, !cfdata->use_xscreensaver);
e_widget_framelist_object_append(of, ow);
- ow = e_widget_label_add(evas, _("Time after screensaver activated"));
- cfdata->gui.basic.post_screensaver_label = ow;
- e_widget_framelist_object_append(of, ow);
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f seconds"), 0.0, 300.0, 10.0, 0,
&(cfdata->post_screensaver_time), NULL, 100);
- cfdata->gui.basic.post_screensaver_slider = ow;
+ cfdata->gui.post_screensaver_slider = ow;
e_widget_disabled_set(ow, !cfdata->use_xscreensaver);
e_widget_framelist_object_append(of, ow);
ow = e_widget_check_add(evas, _("Lock when idle time exceeded"),
&cfdata->auto_lock);
e_widget_on_change_hook_set(ow, _basic_auto_lock_cb_changed, cfdata);
e_widget_framelist_object_append(of, ow);
- ow = e_widget_label_add(evas, _("Idle time to exceed"));
- cfdata->gui.basic.auto_lock_label = ow;
- e_widget_framelist_object_append(of, ow);
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"), 1.0, 90.0, 1.0, 0,
&(cfdata->idle_time), NULL, 100);
- cfdata->gui.basic.auto_lock_slider = ow;
+ cfdata->gui.auto_lock_slider = ow;
e_widget_disabled_set(ow, !cfdata->use_xscreensaver);
e_widget_framelist_object_append(of, ow);
- e_widget_list_object_append(o, of, 1, 0, 0.5);
- _basic_auto_lock_cb_changed(cfdata, NULL);
- _basic_screensaver_lock_cb_changed(cfdata, NULL);
-
- return o;
-}
-
-static int
-_basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
-{
- 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_screensaver = cfdata->screensaver_lock;
- e_config->desklock_post_screensaver_time = cfdata->post_screensaver_time;
- e_config->desklock_autolock_idle_timeout = cfdata->idle_time * 60;
- e_config_save_queue();
- return 1;
-}
-
-static int
-_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
-{
- return
- ((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_screensaver != cfdata->screensaver_lock) ||
- (e_config->desklock_post_screensaver_time != cfdata->post_screensaver_time) ||
- (e_config->desklock_autolock_idle_timeout != cfdata->idle_time * 60));
-}
-
-static const char *
-_user_wallpaper_get(void)
-{
- const E_Config_Desktop_Background *cdbg;
- const Eina_List *l;
-
- if (e_config->desktop_default_background)
- return e_config->desktop_default_background;
-
- EINA_LIST_FOREACH(e_config->desktop_backgrounds, l, cdbg)
- if (cdbg->file)
- return cdbg->file;
-
- return e_theme_edje_file_get("base/theme/desklock",
- "e/desklock/background");
-}
-
-static Evas_Object *
-_adv_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
-{
- Evas_Object *mt, *rt, *ft, *ow, *of;
- Evas_Object *custom_screenlock_check;
- E_Radio_Group *rg;
- E_Fm2_Config fmc;
- E_Zone *zone;
- int screen_count;
- char path[PATH_MAX];
- const char *f;
-
- zone = e_zone_current_get(cfd->con);
- screen_count = ecore_x_xinerama_screen_count_get();
-
- mt = e_widget_table_add(evas, 0);
- ft = e_widget_table_add(evas, 0);
-
- rt = e_widget_table_add(evas, 1);
+ e_widget_list_object_append(ol, of, 1, 1, 0.5);
+
+ of = e_widget_framelist_add(evas, _("Presentation Mode"), 0);
+ ow =
+ e_widget_check_add(evas, _("Suggest if deactivated before"),
+ &(cfdata->ask_presentation));
+ e_widget_on_change_hook_set(ow, _cb_ask_presentation_changed, cfdata);
+ e_widget_framelist_object_append(of, ow);
+ ow = e_widget_slider_add(evas, 1, 0, _("%1.0f seconds"),
+ 1.0, 300.0, 10.0, 0,
+ &(cfdata->ask_presentation_timeout), NULL, 100);
+ cfdata->gui.ask_presentation_slider = ow;
+ e_widget_framelist_object_append(of, ow);
+
+ e_widget_list_object_append(ol, of, 1, 1, 0.5);
+
+ e_widget_toolbook_page_append(otb, NULL, _("Timers"), ol,
+ 1, 0, 1, 0, 0.5, 0.0);
+
+ ol = e_widget_list_add(evas, 0, 0);
+
+ of = e_widget_framelist_add(evas, _("Wallpaper Mode"), 0);
+ rg = e_widget_radio_group_new(&(cfdata->bg_method));
+ ow = e_widget_radio_add(evas, _("Theme Defined"), 0, rg);
+ evas_object_smart_callback_add(ow, "changed", _cb_method_change, cfdata);
+ e_widget_framelist_object_append(of, ow);
+ ow = e_widget_radio_add(evas, _("Theme Wallpaper"), 1, rg);
+ evas_object_smart_callback_add(ow, "changed", _cb_method_change, cfdata);
+ e_widget_framelist_object_append(of, ow);
+ ow = e_widget_radio_add(evas, _("User Wallpaper"), 2, rg);
+ evas_object_smart_callback_add(ow, "changed", _cb_method_change, cfdata);
+ e_widget_framelist_object_append(of, ow);
+ ow = e_widget_radio_add(evas, _("Custom"), 3, rg);
+ evas_object_smart_callback_add(ow, "changed", _cb_method_change, cfdata);
+ cfdata->gui.o_custom = ow;
+ e_widget_framelist_object_append(of, ow);
+
+ e_widget_list_object_append(ol, of, 1, 1, 0.5);
+
+ of = e_widget_framelist_add(evas, _("Custom Wallpaper"), 0);
+
+ rt = e_widget_table_add(evas, 0);
rg = e_widget_radio_group_new(&(cfdata->fmdir));
ow = e_widget_radio_add(evas, _("Personal"), 0, rg);
e_widget_on_change_hook_set(ow, _cb_radio_change, cfdata);
@@ -309,11 +314,11 @@ _adv_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
ow = e_widget_radio_add(evas, _("System"), 1, rg);
e_widget_on_change_hook_set(ow, _cb_radio_change, cfdata);
e_widget_table_object_append(rt, ow, 1, 0, 1, 1, 1, 1, 0, 0);
- e_widget_table_object_append(ft, rt, 0, 0, 1, 1, 0, 0, 0, 0);
- cfdata->o_btn = e_widget_button_add(evas, _("Go up a Directory"),
+ cfdata->gui.o_btn = e_widget_button_add(evas, _("Directory up"),
"go-up", _cb_button_up,
cfdata, NULL);
- e_widget_table_object_append(ft, cfdata->o_btn, 0, 1, 1, 1, 0, 0, 0, 0);
+ e_widget_table_object_append(rt, cfdata->gui.o_btn, 2, 0, 1, 1, 1, 1, 1, 0);
+ e_widget_framelist_object_append(of, rt);
if (cfdata->fmdir == 1)
e_prefix_data_concat_static(path, "data/backgrounds");
@@ -321,7 +326,7 @@ _adv_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
e_user_dir_concat_static(path, "backgrounds");
ow = e_fm2_add(evas);
- cfdata->o_fm = ow;
+ cfdata->gui.o_fm = ow;
memset(&fmc, 0, sizeof(E_Fm2_Config));
fmc.view.mode = E_FM2_VIEW_MODE_LIST;
fmc.view.open_dirs_in_place = 1;
@@ -349,140 +354,35 @@ _adv_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
_cb_fm_sel_change, cfdata);
evas_object_smart_callback_add(ow, "changed", _cb_fm_change, cfdata);
- cfdata->o_sf = e_widget_scrollframe_pan_add(evas, ow, e_fm2_pan_set,
- e_fm2_pan_get,
- e_fm2_pan_max_get,
- e_fm2_pan_child_size_get);
- e_widget_size_min_set(cfdata->o_sf, 100, 100);
- e_widget_table_object_append(ft, cfdata->o_sf, 0, 2, 1, 1, 1, 1, 1, 1);
- e_widget_table_object_append(mt, ft, 0, 0, 1, 3, 1, 1, 1, 1);
-
- ow = e_widget_preview_add(evas, 200, (200 * zone->h) / zone->w);
- cfdata->o_prev = ow;
- if (cfdata->bg_method == 0)
- {
- f = e_theme_edje_file_get("base/theme/desklock",
- "e/desklock/background");
- e_widget_preview_edje_set(cfdata->o_prev, f, "e/desklock/background");
- eina_stringshare_replace(&cfdata->bg, "theme_desklock_background");
- }
- else if (cfdata->bg_method == 1)
- {
- f = e_theme_edje_file_get("base/theme/backgrounds",
- "e/desktop/background");
- e_widget_preview_edje_set(cfdata->o_prev, f, "e/desktop/background");
- eina_stringshare_replace(&cfdata->bg, "theme_background");
- }
- else if (cfdata->bg_method == 2)
- {
- f = _user_wallpaper_get();
- e_widget_preview_edje_set(cfdata->o_prev, f, "e/desktop/background");
- eina_stringshare_replace(&cfdata->bg, "user_background");
- }
- else
- {
- if (cfdata->bg)
- {
- e_widget_preview_edje_set(cfdata->o_prev, cfdata->bg,
- "e/desktop/background");
- }
- else
- {
- f = e_theme_edje_file_get("base/theme/backgrounds",
- "e/desktop/background");
- e_widget_preview_edje_set(cfdata->o_prev, f, "e/desktop/background");
- cfdata->bg = eina_stringshare_add("theme_background");
- }
- }
- e_widget_table_object_append(mt, ow, 1, 0, 1, 1, 1, 1, 1, 1);
-
- of = e_widget_frametable_add(evas, _("Login Box Settings"), 0);
- e_widget_disabled_set(of, (screen_count <= 0));
- rg = e_widget_radio_group_new(&(cfdata->login_zone));
- ow = e_widget_radio_add(evas, _("Show on all screen zones"), -1, rg);
- e_widget_on_change_hook_set(ow, _cb_login_change, cfdata);
- e_widget_disabled_set(ow, (screen_count <= 0));
- e_widget_frametable_object_append(of, ow, 0, 0, 1, 1, 1, 0, 1, 0);
- ow = e_widget_radio_add(evas, _("Show on current screen zone"), -2, rg);
- e_widget_on_change_hook_set(ow, _cb_login_change, cfdata);
- e_widget_disabled_set(ow, (screen_count <= 0));
- e_widget_frametable_object_append(of, ow, 0, 1, 1, 1, 1, 0, 1, 0);
- ow = e_widget_radio_add(evas, _("Show on screen zone #:"), 0, rg);
- e_widget_on_change_hook_set(ow, _cb_login_change, cfdata);
- e_widget_disabled_set(ow, (screen_count <= 0));
- e_widget_frametable_object_append(of, ow, 0, 2, 1, 1, 1, 0, 1, 0);
- cfdata->o_login_slider = e_widget_slider_add(evas, 1, 0, _("%1.0f"), 0.0,
- (cfdata->zone_count -1), 1.0,
- 0, NULL, &(cfdata->zone), 100);
- e_widget_disabled_set(cfdata->o_login_slider, (screen_count <= 0));
- e_widget_frametable_object_append(of, cfdata->o_login_slider, 0, 3, 1, 1,
- 1, 0, 1, 0);
- e_widget_table_object_append(mt, of, 2, 0, 1, 1, 1, 1, 1, 1);
-
- of = e_widget_frametable_add(evas, _("Wallpaper Mode"), 0);
- rg = e_widget_radio_group_new(&(cfdata->bg_method));
- ow = e_widget_radio_add(evas, _("Theme Defined"), 0, rg);
- evas_object_smart_callback_add(ow, "changed", _cb_method_change, cfdata);
- e_widget_frametable_object_append(of, ow, 0, 0, 1, 1, 1, 0, 1, 0);
- ow = e_widget_radio_add(evas, _("Theme Wallpaper"), 1, rg);
- evas_object_smart_callback_add(ow, "changed", _cb_method_change, cfdata);
- e_widget_frametable_object_append(of, ow, 0, 1, 1, 1, 1, 0, 1, 0);
- ow = e_widget_radio_add(evas, _("User Wallpaper"), 2, rg);
- evas_object_smart_callback_add(ow, "changed", _cb_method_change, cfdata);
- e_widget_frametable_object_append(of, ow, 0, 2, 1, 1, 1, 0, 1, 0);
- cfdata->o_custom = e_widget_radio_add(evas, _("Custom"), 3, rg);
- evas_object_smart_callback_add(cfdata->o_custom, "changed",
- _cb_method_change, cfdata);
- e_widget_frametable_object_append(of, cfdata->o_custom, 0, 3, 1, 1,
- 1, 0, 1, 0);
- e_widget_table_object_append(mt, of, 1, 1, 1, 1, 1, 1, 1, 1);
+ cfdata->gui.o_sf = e_widget_scrollframe_pan_add(evas, ow, e_fm2_pan_set,
+ e_fm2_pan_get,
+ e_fm2_pan_max_get,
+ e_fm2_pan_child_size_get);
+ e_widget_size_min_set(cfdata->gui.o_sf, 100, 100);
+ e_widget_framelist_object_append(of, cfdata->gui.o_sf);
+ e_widget_list_object_append(ol, of, 1, 1, 0.5);
+
+ e_widget_toolbook_page_append(otb, NULL, _("Wallpaper"), ol,
+ 1, 0, 1, 0, 0.5, 0.0);
+
+ e_widget_list_object_append(o, otb, 1, 1, 0.5);
+ e_widget_toolbook_page_show(otb, 0);
+ _basic_auto_lock_cb_changed(cfdata, NULL);
+ _basic_screensaver_lock_cb_changed(cfdata, NULL);
of = e_widget_framelist_add(evas, _("Enter Presentation Mode"), 0);
-
- ow = e_widget_check_add(evas, _("Suggest entering presentation mode"), &(cfdata->ask_presentation));
- e_widget_on_change_hook_set(ow, _cb_ask_presentation_changed, cfdata);
- e_widget_framelist_object_append(of, ow);
-
- ow = e_widget_label_add(evas, _("If deactivated before"));
- cfdata->gui.adv.ask_presentation_label = ow;
- e_widget_framelist_object_append(of, ow);
-
- ow = e_widget_slider_add(evas, 1, 0, _("%1.0f seconds"),
- 1.0, 300.0, 10.0, 0,
- &(cfdata->ask_presentation_timeout), NULL, 100);
- cfdata->gui.adv.ask_presentation_slider = ow;
- e_widget_framelist_object_append(of, ow);
-
- _cb_ask_presentation_changed(cfdata, NULL);
-
- e_widget_table_object_append(mt, of, 1, 2, 1, 1, 1, 1, 1, 1);
-
-
- ow = _basic_create(cfd, evas, cfdata);
- e_widget_table_object_append(mt, ow, 2, 1, 1, 2, 1, 1, 1, 1);
-
- of = e_widget_framelist_add(evas, _("Custom Screenlock"), 0);
- custom_screenlock_check = e_widget_check_add(evas, _("Use custom screenlock"),
- &(cfdata->custom_lock));
- e_widget_framelist_object_append(of, custom_screenlock_check);
- ow = e_widget_entry_add(evas, &(cfdata->custom_lock_cmd), NULL, NULL, NULL);
- e_widget_disabled_set(ow, !cfdata->custom_lock); // set state from saved config
- e_widget_framelist_object_append(of, ow);
- e_widget_table_object_append(mt, of, 1, 3, 2, 1, 1, 1, 1, 1);
-
- // handler for enable/disable widget array
- e_widget_on_change_hook_set(custom_screenlock_check, _cb_disable_check, ow);
-
- return mt;
+
+ return o;
}
static int
-_adv_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_on_suspend = cfdata->lock_on_suspend;
e_config->desklock_autolock_idle = cfdata->auto_lock;
+ e_config->desklock_post_screensaver_time = cfdata->post_screensaver_time;
e_config->desklock_autolock_screensaver = cfdata->screensaver_lock;
e_config->desklock_autolock_idle_timeout = cfdata->idle_time * 60;
e_config->desklock_ask_presentation = cfdata->ask_presentation;
@@ -517,9 +417,22 @@ _adv_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
}
static int
-_adv_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
+_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
- if (_basic_check_changed(cfd, cfdata))
+ if (e_config->desklock_start_locked != cfdata->start_locked)
+ return 1;
+
+ if (e_config->desklock_autolock_idle != cfdata->auto_lock)
+ return 1;
+
+ if (e_config->desklock_autolock_screensaver != cfdata->screensaver_lock)
+ return 1;
+
+ if (e_config->desklock_post_screensaver_time !=
+ cfdata->post_screensaver_time)
+ return 1;
+
+ if (e_config->desklock_autolock_idle_timeout != cfdata->idle_time * 60)
return 1;
if (e_config->desklock_background != cfdata->bg)
@@ -552,7 +465,7 @@ _adv_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
}
static void
-_cb_method_change(void *data, Evas_Object *obj, void *event_info)
+_cb_method_change(void *data, Evas_Object * obj, void *event_info)
{
E_Config_Dialog_Data *cfdata;
Eina_List *sel;
@@ -561,61 +474,51 @@ _cb_method_change(void *data, Evas_Object *obj, void *event_info)
const char *f;
cfdata = data;
- if (cfdata->bg_method == 0)
+ switch(cfdata->bg_method)
{
- f = e_theme_edje_file_get("base/theme/desklock",
- "e/desklock/background");
- e_widget_preview_edje_set(cfdata->o_prev, f, "e/desklock/background");
+ case 0:
eina_stringshare_replace(&cfdata->bg, "theme_desklock_background");
- }
- else if (cfdata->bg_method == 1)
- {
- f = e_theme_edje_file_get("base/theme/backgrounds",
- "e/desktop/background");
- e_widget_preview_edje_set(cfdata->o_prev, f, "e/desktop/background");
+ break;
+ case 1:
eina_stringshare_replace(&cfdata->bg, "theme_background");
- }
- else if (cfdata->bg_method == 2)
- {
- f = _user_wallpaper_get();
- e_widget_preview_edje_set(cfdata->o_prev, f, "e/desktop/background");
+ break;
+ case 2:
eina_stringshare_replace(&cfdata->bg, "user_background");
- }
- else
- {
- sel = e_fm2_selected_list_get(cfdata->o_fm);
- if (!sel) sel = e_fm2_all_list_get(cfdata->o_fm);
+ break;
+ default:
+ sel = e_fm2_selected_list_get(cfdata->gui.o_fm);
+ if (!sel) sel = e_fm2_all_list_get(cfdata->gui.o_fm);
if (!sel) return;
ic = eina_list_nth(sel, 0);
eina_list_free(sel);
- if (!ic) return;
- e_fm2_select_set(cfdata->o_fm, ic->file, 1);
+ if (!ic)
+ return;
+ e_fm2_select_set(cfdata->gui.o_fm, ic->file, 1);
if (cfdata->fmdir == 0)
- e_user_dir_snprintf(path, sizeof(path), "backgrounds/%s",
- ic->file);
+ e_user_dir_snprintf(path, sizeof(path), "backgrounds/%s", ic->file);
else
- e_prefix_data_snprintf(path, sizeof(path), "data/backgrounds/%s",
- ic->file);
- if (ecore_file_is_dir(path)) return;
+ e_prefix_data_snprintf(path, sizeof(path), "data/backgrounds/%s",
+ ic->file);
+ if (ecore_file_is_dir(path))
+ return;
eina_stringshare_replace(&cfdata->bg, path);
- e_widget_preview_edje_set(cfdata->o_prev, path,
- "e/desktop/background");
+ break;
}
}
static void
-_cb_radio_change(void *data, Evas_Object *obj)
+_cb_radio_change(void *data, Evas_Object * obj)
{
E_Config_Dialog_Data *cfdata;
char path[4096];
cfdata = data;
- if (!cfdata->o_fm) return;
+ if (!cfdata->gui.o_fm) return;
if (cfdata->fmdir == 0)
e_user_dir_concat_static(path, "backgrounds");
else
e_prefix_data_concat_static(path, "data/backgrounds");
- e_fm2_path_set(cfdata->o_fm, path, "/");
+ e_fm2_path_set(cfdata->gui.o_fm, path, "/");
}
static void
@@ -625,9 +528,9 @@ _cb_login_change(void *data, Evas_Object *obj)
cfdata = data;
if (cfdata->login_zone < 0)
- e_widget_disabled_set(cfdata->o_login_slider, 1);
+ e_widget_disabled_set(cfdata->gui.loginbox_slider, 1);
else
- e_widget_disabled_set(cfdata->o_login_slider, 0);
+ e_widget_disabled_set(cfdata->gui.loginbox_slider, 0);
}
static void
@@ -636,9 +539,9 @@ _cb_button_up(void *data1, void *data2)
E_Config_Dialog_Data *cfdata;
cfdata = data1;
- if (!cfdata->o_fm) return;
- e_fm2_parent_go(cfdata->o_fm);
- e_widget_scrollframe_child_pos_set(cfdata->o_sf, 0, 0);
+ if (!cfdata->gui.o_fm) return;
+ e_fm2_parent_go(cfdata->gui.o_fm);
+ e_widget_scrollframe_child_pos_set(cfdata->gui.o_sf, 0, 0);
}
static void
@@ -647,12 +550,12 @@ _cb_fm_dir_change(void *data, Evas_Object *obj, void *event_info)
E_Config_Dialog_Data *cfdata;
cfdata = data;
- if (!cfdata->o_fm) return;
- if (!e_fm2_has_parent_get(cfdata->o_fm))
- e_widget_disabled_set(cfdata->o_btn, 1);
+ if (!cfdata->gui.o_fm) return;
+ if (!e_fm2_has_parent_get(cfdata->gui.o_fm))
+ e_widget_disabled_set(cfdata->gui.o_btn, 1);
else
- e_widget_disabled_set(cfdata->o_btn, 0);
- e_widget_scrollframe_child_pos_set(cfdata->o_sf, 0, 0);
+ e_widget_disabled_set(cfdata->gui.o_btn, 0);
+ e_widget_scrollframe_child_pos_set(cfdata->gui.o_sf, 0, 0);
}
static void
@@ -664,8 +567,8 @@ _cb_fm_sel_change(void *data, Evas_Object *obj, void *event_info)
char path[PATH_MAX];
cfdata = data;
- if (!cfdata->o_fm) return;
- sel = e_fm2_selected_list_get(cfdata->o_fm);
+ if (!cfdata->gui.o_fm) return;
+ sel = e_fm2_selected_list_get(cfdata->gui.o_fm);
if (!sel) return;
ic = sel->data;
eina_list_free(sel);
@@ -682,9 +585,8 @@ _cb_fm_sel_change(void *data, Evas_Object *obj, void *event_info)
}
if (ecore_file_is_dir(path)) return;
eina_stringshare_replace(&cfdata->bg, path);
- e_widget_preview_edje_set(cfdata->o_prev, path, "e/desktop/background");
- e_widget_change(cfdata->o_sf);
- e_widget_radio_toggle_set(cfdata->o_custom, 1);
+ e_widget_change(cfdata->gui.o_sf);
+ e_widget_radio_toggle_set(cfdata->gui.o_custom, 1);
}
static void
@@ -697,8 +599,8 @@ _cb_fm_change(void *data, Evas_Object *obj, void *event_info)
cfdata = data;
if (!cfdata->bg) return;
- if (!cfdata->o_fm) return;
- p = e_fm2_real_path_get(cfdata->o_fm);
+ if (!cfdata->gui.o_fm) return;
+ p = e_fm2_real_path_get(cfdata->gui.o_fm);
if (p)
{
if (strncmp(p, cfdata->bg, strlen(p))) return;
@@ -717,8 +619,8 @@ _cb_fm_change(void *data, Evas_Object *obj, void *event_info)
else
p = cfdata->bg;
}
- e_fm2_select_set(cfdata->o_fm, p, 1);
- e_fm2_file_show(cfdata->o_fm, p);
+ e_fm2_select_set(cfdata->gui.o_fm, p, 1);
+ e_fm2_file_show(cfdata->gui.o_fm, p);
}
static int
@@ -745,17 +647,6 @@ _zone_count_get(void)
return num;
}
-/*!
- * @param data A Evas_Object to chain together with the checkbox
- * @param obj A Evas_Object checkbox created with e_widget_check_add()
- */
-static void
-_cb_disable_check(void *data, Evas_Object *obj)
-{
- e_widget_disabled_set((Evas_Object *) data,
- !e_widget_check_checked_get(obj));
-}
-
static void
_cb_ask_presentation_changed(void *data, Evas_Object *obj __UNUSED__)
{
@@ -764,6 +655,5 @@ _cb_ask_presentation_changed(void *data, Evas_Object *obj __UNUSED__)
disable = (!cfdata->ask_presentation);
- e_widget_disabled_set(cfdata->gui.adv.ask_presentation_label, disable);
- e_widget_disabled_set(cfdata->gui.adv.ask_presentation_slider, disable);
+ e_widget_disabled_set(cfdata->gui.ask_presentation_slider, disable);
}