static int _zone_count_get(void);
static void _cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event);
-static void _cb_ask_presentation_changed(void *data, Evas_Object *obj);
struct _E_Config_Dialog_Data
{
{
Evas_Object *kbd_list;
Evas_Object *loginbox_slider;
- Evas_Object *post_screensaver_slider;
Evas_Object *auto_lock_slider;
- Evas_Object *ask_presentation_slider;
Evas_Object *o_table;
Eina_List *bgs;
} gui;
E_FREE(cfdata);
}
-static void
-_basic_auto_lock_cb_changed(void *data, Evas_Object *o __UNUSED__)
-{
- E_Config_Dialog_Data *cfdata;
- int disable;
-
- if (!(cfdata = data)) return;
- disable = ((!cfdata->use_xscreensaver) || (!cfdata->auto_lock));
- e_widget_disabled_set(cfdata->gui.auto_lock_slider, disable);
-}
-
-static void
-_basic_screensaver_lock_cb_changed(void *data, Evas_Object *o __UNUSED__)
-{
- E_Config_Dialog_Data *cfdata;
- int disable;
-
- if (!(cfdata = data)) return;
- disable = ((!cfdata->use_xscreensaver) || (!cfdata->screensaver_lock));
- e_widget_disabled_set(cfdata->gui.post_screensaver_slider, disable);
-}
-
static Evas_Object *
_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
{
E_Config_XKB_Layout *cl;
int grp = 0;
- Evas_Object *otb, *ol, *ow, *of, *ot;
+ Evas_Object *otb, *ol, *ow, *of, *ot, *oc;
Eina_List *l, *ll, *lll;
E_Zone *zone;
E_Radio_Group *rg;
/* Timers */
ol = e_widget_list_add(evas, 0, 0);
- ow = e_widget_check_add(evas, _("Lock after X screensaver activates"),
+ oc = 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_list_object_append(ol, ow, 1, 1, 0.5);
+ e_widget_disabled_set(oc, !cfdata->use_xscreensaver);
+ e_widget_list_object_append(ol, oc, 1, 1, 0.5);
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.post_screensaver_slider = ow;
e_widget_disabled_set(ow, !cfdata->use_xscreensaver);
+ if (cfdata->use_xscreensaver)
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
- ow = e_widget_check_add(evas, _("Lock when idle time exceeded"),
+ oc = 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_list_object_append(ol, ow, 1, 1, 0.5);
+ e_widget_list_object_append(ol, oc, 1, 1, 0.5);
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.auto_lock_slider = ow;
- e_widget_disabled_set(ow, !cfdata->use_xscreensaver);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Timers"), ol,
1, 0, 1, 0, 0.5, 0.0);
/* Presentation */
ol = e_widget_list_add(evas, 0, 0);
- ow = e_widget_check_add(evas, _("Suggest if deactivated before"),
+ oc = 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_list_object_append(ol, ow, 1, 1, 0.5);
+ e_widget_list_object_append(ol, oc, 1, 1, 0.5);
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_disabled_set(ow, (!cfdata->ask_presentation));
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Presentation Mode"), ol,
1, 0, 1, 0, 0.5, 0.0);
e_widget_toolbook_page_show(otb, 0);
- _basic_auto_lock_cb_changed(cfdata, NULL);
- _basic_screensaver_lock_cb_changed(cfdata, NULL);
-
return otb;
}
cfdata->bg_fsel = e_int_config_desklock_fsel(cfdata->cfd, obj);
}
-static void
-_cb_ask_presentation_changed(void *data, Evas_Object *obj __UNUSED__)
-{
- E_Config_Dialog_Data *cfdata;
- Eina_Bool disable;
-
- if (!(cfdata = data)) return;
- disable = (!cfdata->ask_presentation);
- e_widget_disabled_set(cfdata->gui.ask_presentation_slider, disable);
-}
-
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_disable(void *data, Evas_Object *obj);
-static void _cb_ask_presentation_changed(void *data, Evas_Object *obj);
struct _E_Config_Dialog_Data
{
E_Config_Dialog *cfd;
- Evas_Object *backlight_slider_idle;
- Evas_Object *backlight_slider_fade;
-
char *bl_dev;
int enable_idle_dim;
double backlight_dim;
double backlight_timeout;
double backlight_transition;
-
- int ask_presentation;
- double ask_presentation_timeout;
-
- Eina_List *disable_list;
-
- struct
- {
- Evas_Object *ask_presentation_slider;
- } gui;
};
E_Config_Dialog *
cfdata->backlight_transition = e_config->backlight.transition;
cfdata->enable_idle_dim = e_config->backlight.idle_dim;
cfdata->backlight_timeout = e_config->backlight.timer;
- cfdata->ask_presentation = e_config->screensaver_ask_presentation;
- cfdata->ask_presentation_timeout = e_config->screensaver_ask_presentation_timeout;
}
static void *
e_config->backlight.transition = cfdata->backlight_transition;
e_config->backlight.timer = lround(cfdata->backlight_timeout);
e_config->backlight.idle_dim = cfdata->enable_idle_dim;
- e_config->screensaver_ask_presentation = cfdata->ask_presentation;
- e_config->screensaver_ask_presentation_timeout = cfdata->ask_presentation_timeout;
-
e_backlight_mode_set(NULL, E_BACKLIGHT_MODE_NORMAL);
e_backlight_level_set(NULL, e_config->backlight.normal, -1.0);
static int
_advanced_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
- // set state from saved config
- e_widget_disabled_set(cfdata->backlight_slider_idle, !cfdata->enable_idle_dim);
- e_widget_disabled_set(cfdata->backlight_slider_fade, !cfdata->enable_idle_dim);
-
return (e_config->backlight.normal * 100.0 != cfdata->backlight_normal) ||
(e_config->backlight.dim * 100.0 != cfdata->backlight_dim) ||
(e_config->backlight.transition != cfdata->backlight_transition) ||
(e_config->backlight.timer != cfdata->backlight_timeout) ||
- (e_config->backlight.idle_dim != cfdata->enable_idle_dim) ||
- (e_config->screensaver_ask_presentation != cfdata->ask_presentation) ||
- (e_config->screensaver_ask_presentation_timeout != cfdata->ask_presentation_timeout);
+ (e_config->backlight.idle_dim != cfdata->enable_idle_dim);
}
static int
static Evas_Object *
_advanced_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
{
- Evas_Object *otb, *o, *ob;
+ Evas_Object *otb, *o, *ob, *oc;
Eina_List *devs, *l;
const char *s, *label;
&(cfdata->backlight_dim), NULL, 100);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
- ob = e_widget_check_add(evas, _("Idle Fade Time"), &(cfdata->enable_idle_dim));
- e_widget_on_change_hook_set(ob, _cb_disable, cfdata);
+ oc = e_widget_check_add(evas, _("Idle Fade Time"), &(cfdata->enable_idle_dim));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f second(s)"), 5.0, 300.0, 1.0, 0,
&(cfdata->backlight_timeout), NULL, 100);
- cfdata->backlight_slider_idle = ob;
- e_widget_disabled_set(ob, !cfdata->enable_idle_dim); // set state from saved config
+ e_widget_check_widget_disable_on_unchecked_add(oc, ob);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_label_add(evas, _("Fade Time"));
e_widget_list_object_append(o, ob, 1, 1, 0.5);
ob = e_widget_slider_add(evas, 1, 0, _("%1.1f second(s)"), 0.0, 5.0, 0.1, 0,
&(cfdata->backlight_transition), NULL, 100);
- cfdata->backlight_slider_fade = ob;
- e_widget_disabled_set(ob, !cfdata->enable_idle_dim); // set state from saved config
+ e_widget_check_widget_disable_on_unchecked_add(oc, ob);
e_widget_list_object_append(o, ob, 1, 1, 0.5);
devs = (Eina_List *)e_backlight_devices_get();
e_widget_toolbook_page_append(otb, NULL, _("Dimming"), o,
1, 0, 1, 0, 0.5, 0.0);
- // FIXME: Disabled until someone want's to cleanup that screensaver code...
- /* Presentation */
- /*
- o = e_widget_list_add(evas, 0, 0);
- ob = e_widget_check_add(evas, _("Suggest if deactivated before"),
- &(cfdata->ask_presentation));
- e_widget_on_change_hook_set(ob, _cb_ask_presentation_changed, cfdata);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ob);
- e_widget_list_object_append(o, ob, 1, 1, 0.5);
- ob = 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 = ob;
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ob);
- e_widget_list_object_append(o, ob, 1, 1, 0.5);
- e_widget_toolbook_page_append(otb, NULL, _("Presentation"), o,
- 1, 0, 1, 0, 0.5, 0.0);
- */
-
e_widget_toolbook_page_show(otb, 0);
- // handler for enable/disable widget array
- _cb_disable(cfdata, NULL);
-
return otb;
}
-
-static void
-_cb_disable(void *data, Evas_Object *obj __UNUSED__)
-{
- E_Config_Dialog_Data *cfdata;
- const Eina_List *l;
- Evas_Object *o;
-
- if (!(cfdata = data)) return;
- EINA_LIST_FOREACH(cfdata->disable_list, l, o)
- e_widget_disabled_set(o, !cfdata->enable_idle_dim);
-
- _cb_ask_presentation_changed(cfdata, NULL);
-}
-
-static void
-_cb_ask_presentation_changed(void *data, Evas_Object *obj __UNUSED__)
-{
- E_Config_Dialog_Data *cfdata;
- Eina_Bool disable;
-
- if (!(cfdata = data)) return;
- disable = ((!cfdata->enable_idle_dim) || (!cfdata->ask_presentation));
- e_widget_disabled_set(cfdata->gui.ask_presentation_slider, disable);
-}
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
-static void _cb_disable(void *data, Evas_Object *obj);
static void _cb_ask_presentation_changed(void *data, Evas_Object *obj);
struct _E_Config_Dialog_Data
int screensaver_suspend_on_ac;
double screensaver_suspend_delay;
- Eina_List *disable_list;
-
struct
{
Evas_Object *ask_presentation_slider;
static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
- eina_list_free(cfdata->disable_list);
- E_FREE(cfdata);
+ free(cfdata);
}
static int
static Evas_Object *
_basic_create(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
{
- Evas_Object *otb, *ol, *ow;
+ Evas_Object *otb, *ol, *ow, *oc, *oc2;
otb = e_widget_toolbook_add(evas, (24 * e_scale), (24 * e_scale));
/* Screensaver */
ol = e_widget_list_add(evas, 0, 0);
- ow = e_widget_check_add(evas, _("Enable screen blanking"),
+ oc = e_widget_check_add(evas, _("Enable screen blanking"),
&(cfdata->enable_screensaver));
- e_widget_on_change_hook_set(ow, _cb_disable, cfdata);
- e_widget_list_object_append(ol, ow, 1, 1, 0.5);
+ e_widget_list_object_append(ol, oc, 1, 1, 0.5);
ow = e_widget_label_add(evas, _("Timeout"));
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f minutes"),
0.5, 90.0, 1.0, 0, &(cfdata->timeout), NULL, 100);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_check_add(evas, _("Suspend on blank"),
&(cfdata->screensaver_suspend));
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_check_add(evas, _("Suspend even if AC"),
&(cfdata->screensaver_suspend_on_ac));
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_label_add(evas, _("Suspend delay"));
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f seconds"),
1.0, 20.0, 1.0, 0, &(cfdata->screensaver_suspend_delay), NULL, 100);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Blanking"), ol,
1, 0, 1, 0, 0.5, 0.0);
/* Presentation */
ol = e_widget_list_add(evas, 0, 0);
- ow = e_widget_check_add(evas, _("Suggest if deactivated before"),
+ oc2 = e_widget_check_add(evas, _("Suggest if deactivated before"),
&(cfdata->ask_presentation));
- e_widget_on_change_hook_set(ow, _cb_ask_presentation_changed, cfdata);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
- e_widget_list_object_append(ol, ow, 1, 1, 0.5);
+ e_widget_check_widget_disable_on_unchecked_add(oc, oc2);
+ e_widget_list_object_append(ol, oc2, 1, 1, 0.5);
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;
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc2, ow);
+ e_widget_on_disable_hook_set(ow, _cb_ask_presentation_changed, cfdata);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Presentation"), ol,
1, 0, 1, 0, 0.5, 0.0);
e_widget_toolbook_page_show(otb, 0);
- // handler for enable/disable widget array
- _cb_disable(cfdata, NULL);
-
return otb;
}
static void
-_cb_disable(void *data, Evas_Object *obj __UNUSED__)
-{
- E_Config_Dialog_Data *cfdata;
- const Eina_List *l;
- Evas_Object *o;
-
- if (!(cfdata = data)) return;
- EINA_LIST_FOREACH(cfdata->disable_list, l, o)
- e_widget_disabled_set(o, !cfdata->enable_screensaver);
-
- _cb_ask_presentation_changed(cfdata, NULL);
-}
-
-static void
_cb_ask_presentation_changed(void *data, Evas_Object *obj __UNUSED__)
{
- E_Config_Dialog_Data *cfdata;
+ E_Config_Dialog_Data *cfdata = data;
Eina_Bool disable;
- if (!(cfdata = data)) return;
disable = ((!cfdata->enable_screensaver) || (!cfdata->ask_presentation));
e_widget_disabled_set(cfdata->gui.ask_presentation_slider, disable);
}
int use_e_cursor;
int cursor_size;
- Eina_List *disable_list;
struct
{
Evas_Object *idle_cursor;
e_widget_disabled_set(cfdata->gui.idle_cursor, disabled);
}
-static void
-_show_cursor_cb_change(void *data, Evas_Object *obj __UNUSED__)
-{
- E_Config_Dialog_Data *cfdata = data;
- const Eina_List *l;
- Evas_Object *o;
-
- EINA_LIST_FOREACH(cfdata->disable_list, l, o)
- e_widget_disabled_set(o, !cfdata->show_cursor);
-
- _use_e_cursor_cb_change(cfdata, NULL);
-}
-
static Evas_Object *
_basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, Evas *evas, E_Config_Dialog_Data *cfdata)
{
- Evas_Object *otb, *ol, *of, *ob;
+ Evas_Object *otb, *ol, *of, *ob, *oc;
E_Radio_Group *rg;
otb = e_widget_toolbook_add(evas, (24 * e_scale), (24 * e_scale));
/* Cursor */
ol = e_widget_list_add(evas, 0, 0);
- ob = e_widget_check_add(evas, _("Show Cursor"), &(cfdata->show_cursor));
- e_widget_on_change_hook_set(ob, _show_cursor_cb_change, cfdata);
- e_widget_list_object_append(ol, ob, 1, 0, 0.5);
+ oc = e_widget_check_add(evas, _("Show Cursor"), &(cfdata->show_cursor));
+ e_widget_list_object_append(ol, oc, 1, 0, 0.5);
of = e_widget_framelist_add(evas, _("Settings"), 0);
rg = e_widget_radio_group_new(&cfdata->use_e_cursor);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, of);
ob = e_widget_label_add(evas, _("Size"));
e_widget_framelist_object_append(of, ob);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ob);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ob);
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f pixels"),
8, 128, 4, 0, NULL, &(cfdata->cursor_size), 100);
e_widget_framelist_object_append(of, ob);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ob);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ob);
ob = e_widget_label_add(evas, _("Theme"));
e_widget_framelist_object_append(of, ob);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ob);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ob);
ob = e_widget_radio_add(evas, _("X"), 0, rg);
e_widget_on_change_hook_set(ob, _use_e_cursor_cb_change, cfdata);
e_widget_framelist_object_append(of, ob);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ob);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ob);
ob = e_widget_radio_add(evas, _("Enlightenment"), 1, rg);
e_widget_on_change_hook_set(ob, _use_e_cursor_cb_change, cfdata);
e_widget_framelist_object_append(of, ob);
- cfdata->disable_list = eina_list_append(cfdata->disable_list, ob);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ob);
+ e_widget_on_disable_hook_set(ob, _use_e_cursor_cb_change, cfdata);
ob = e_widget_check_add(evas, _("Idle effects"),
&(cfdata->idle_cursor));
return cfd;
}
-static void
-_settings_changed(void *data, Evas_Object *obj EINA_UNUSED)
-{
- E_Config_Dialog_Data *cfdata = data;
- Eina_Bool disable;
-
- disable = !cfdata->enable_xsettings;
- e_widget_disabled_set(cfdata->gui.icon_enable_apps, disable);
- e_widget_disabled_set(cfdata->gui.icon_enable_enlightenment, disable);
- e_widget_disabled_set(cfdata->gui.match_theme, disable);
- e_widget_disabled_set(cfdata->gui.widget_list, disable);
- e_widget_disabled_set(cfdata->gui.icon_list, disable);
-}
-
static void *
_create_data(E_Config_Dialog *cfd)
{
static Evas_Object *
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
- Evas_Object *otb, *ol, *ilist, *of, *ow;
+ Evas_Object *otb, *ol, *ilist, *of, *ow, *oc;
struct _fill_icon_themes_data *d;
unsigned int i;
* e_widget_list_object_append(o, ow, 0, 0, 0.0); */
// >> advanced
- ow = e_widget_check_add(evas, _("Enable X Application Settings"),
+ oc = e_widget_check_add(evas, _("Enable X Application Settings"),
&(cfdata->enable_xsettings));
- e_widget_on_change_hook_set(ow, _settings_changed, cfdata);
- e_widget_list_object_append(ol, ow, 0, 0, 0.0);
+ e_widget_list_object_append(ol, oc, 0, 0, 0.0);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ilist);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_toolbook_page_append(otb, NULL, _("GTK Applications"), ol,
1, 1, 1, 1, 0.5, 0.0);
cfdata->gui.icon_enable_apps = ow = e_widget_check_add(evas, _("Enable icon theme for applications"),
&(cfdata->match_e17_icon_theme));
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 0, 0, 0.0);
cfdata->gui.icon_enable_enlightenment = ow = e_widget_check_add(evas, _("Enable icon theme for Enlightenment"),
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
-static void _cb_disable_check(void *data, Evas_Object *obj);
-static void _cb_disable_check_list(void *data, Evas_Object *obj);
struct _E_Config_Dialog_Data
{
int desk_auto_switch;
int screen_limits;
- Eina_List *shading_list;
};
/* a nice easy setup function that does the dirty work */
static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
- eina_list_free(cfdata->shading_list);
- E_FREE(cfdata);
+ free(cfdata);
}
static int
ow = e_widget_check_add(evas, _("Follows the window"),
&(cfdata->move_info_follows));
e_widget_disabled_set(ow, !cfdata->move_info_visible);
- e_widget_on_change_hook_set(oc, _cb_disable_check, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_framelist_object_append(of, ow);
e_widget_list_object_append(ol, of, 1, 1, 0.5);
ow = e_widget_check_add(evas, _("Follows the window"),
&(cfdata->resize_info_follows));
e_widget_disabled_set(ow, !cfdata->resize_info_visible);
- e_widget_on_change_hook_set(oc, _cb_disable_check, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, 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, _("Display"), ol,
ow = e_widget_slider_add(evas, 1, 0, _("%4.0f pixels/s"),
100, 9900, 100, 0,
&(cfdata->border_shade_speed), NULL, 100);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
rg = e_widget_radio_group_new(&(cfdata->border_shade_transition));
ow = e_widget_radio_add(evas, _("Linear"), E_TRANSITION_LINEAR, rg);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Accelerate, then decelerate"), E_TRANSITION_SINUSOIDAL, rg);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Accelerate"), E_TRANSITION_ACCELERATE, rg);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Decelerate"), E_TRANSITION_DECELERATE, rg);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Pronounced Accelerate"), E_TRANSITION_ACCELERATE_LOTS, rg);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Pronounced Decelerate"), E_TRANSITION_DECELERATE_LOTS, rg);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Pronounced Accelerate, then decelerate"), E_TRANSITION_SINUSOIDAL_LOTS, rg);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Bounce"), E_TRANSITION_BOUNCE, rg);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
ow = e_widget_radio_add(evas, _("Bounce more"), E_TRANSITION_BOUNCE_LOTS, rg);
- e_widget_disabled_set(ow, !cfdata->border_shade_animate);
- cfdata->shading_list = eina_list_append(cfdata->shading_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 1, 0.5);
e_widget_toolbook_page_append(otb, NULL, _("Shading"), ol,
0, 0, 1, 0, 0.5, 0.0);
- e_widget_on_change_hook_set(oc, _cb_disable_check_list,
- cfdata->shading_list);
/* Screen Limits */
ol = e_widget_list_add(evas, 0, 0);
e_widget_toolbook_page_show(otb, 0);
return otb;
}
-
-static void
-_cb_disable_check(void *data, Evas_Object *obj)
-{
- e_widget_disabled_set(data, !e_widget_check_checked_get(obj));
-}
-
-static void
-_cb_disable_check_list(void *data, Evas_Object *obj)
-{
- Eina_List *list = data;
- const Eina_List *l;
- Evas_Object *o;
- Eina_Bool disable = !e_widget_check_checked_get(obj);
-
- EINA_LIST_FOREACH(list, l, o)
- e_widget_disabled_set(o, disable);
-}
-
static int _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
-static void _cb_disable_check_list(void *data, Evas_Object *obj);
/* Actual config data we will be playing with whil the dialog is active */
struct _E_Config_Dialog_Data
int maximize_direction;
int maximized_allow_manip;
int border_fix_on_shelf_toggle;
-
- Eina_List *resistance_list;
};
E_Config_Dialog *
static void
_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
- eina_list_free(cfdata->resistance_list);
- E_FREE(cfdata);
+ free(cfdata);
}
static int
oc = e_widget_check_add(evas, _("Resist obstacles"), &(cfdata->use_resist));
e_widget_list_object_append(ol, oc, 1, 0, 0.5);
ow = e_widget_label_add(evas, _("Other windows"));
- e_widget_disabled_set(ow, !cfdata->use_resist);
- cfdata->resistance_list = eina_list_append (cfdata->resistance_list, ow);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
ow = e_widget_slider_add(evas, 1, 0, _("%2.0f pixels"), 0, 64.0, 1.0, 0,
NULL, &(cfdata->window_resist), 100);
- cfdata->resistance_list = eina_list_append (cfdata->resistance_list, ow);
- e_widget_disabled_set(ow, !cfdata->use_resist);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
ow = e_widget_label_add(evas, _("Edge of the screen"));
- cfdata->resistance_list = eina_list_append (cfdata->resistance_list, ow);
- e_widget_disabled_set(ow, !cfdata->use_resist);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
ow = e_widget_slider_add(evas, 1, 0, _("%2.0f pixels"), 0, 64.0, 1.0, 0,
NULL, &(cfdata->desk_resist), 100);
- cfdata->resistance_list = eina_list_append (cfdata->resistance_list, ow);
- e_widget_disabled_set(ow, !cfdata->use_resist);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
ow = e_widget_label_add(evas, _("Desktop gadgets"));
- cfdata->resistance_list = eina_list_append (cfdata->resistance_list, ow);
- e_widget_disabled_set(ow, !cfdata->use_resist);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
ow = e_widget_slider_add(evas, 1, 0, _("%2.0f pixels"), 0, 64.0, 1.0, 0,
NULL, &(cfdata->gadget_resist), 100);
- cfdata->resistance_list = eina_list_append (cfdata->resistance_list, ow);
- e_widget_disabled_set(ow, !cfdata->use_resist);
+ e_widget_check_widget_disable_on_unchecked_add(oc, ow);
e_widget_list_object_append(ol, ow, 1, 0, 0.5);
- e_widget_on_change_hook_set(oc, _cb_disable_check_list,
- cfdata->resistance_list);
e_widget_toolbook_page_append(otb, NULL, _("Resistance"), ol,
1, 0, 1, 0, 0.5, 0.0);
e_widget_toolbook_page_show(otb, 0);
return otb;
}
-
-static void
-_cb_disable_check_list(void *data, Evas_Object *obj)
-{
- const Eina_List *list = data;
- const Eina_List *l;
- Evas_Object *o;
- Eina_Bool disable = !e_widget_check_checked_get(obj);
-
- EINA_LIST_FOREACH(list, l, o)
- e_widget_disabled_set(o, disable);
-}