diff options
author | Christopher Michael <cp.michael@samsung.com> | 2013-02-19 11:00:56 +0000 |
---|---|---|
committer | Deon Thomas <PrinceAMD.Elive@gmail.com> | 2013-06-28 03:28:52 -0400 |
commit | e87f09c5688567a350d84cbff8392ef9cbdbb39b (patch) | |
tree | d8513709d0c28a8477bf1795c89f1a480e7ec956 /src/modules | |
parent | d96738b2ed37fa7c123c26ca0a1fd383d113b814 (diff) | |
download | enlightenment-e87f09c5688567a350d84cbff8392ef9cbdbb39b.tar.gz |
Backport: 8f728d1 :: Add restore checkbox to dialog.
Signed-off-by: Christopher Michael <cp.michael@samsung.com>
SVN revision: 84222
Signed-off-by: Deon Thomas <PrinceAMD.Elive@gmail.com>
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/conf_randr/e_int_config_randr.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/modules/conf_randr/e_int_config_randr.c b/src/modules/conf_randr/e_int_config_randr.c index 1aa213ea41..8265a9320d 100644 --- a/src/modules/conf_randr/e_int_config_randr.c +++ b/src/modules/conf_randr/e_int_config_randr.c @@ -7,6 +7,8 @@ struct _E_Config_Dialog_Data { Evas_Object *o_randr; + + int restore; }; /* local function prototypes */ @@ -14,6 +16,8 @@ static void *_create_data(E_Config_Dialog *cfd EINA_UNUSED); static void _free_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata); static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata); static int _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata); +static int _basic_check(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata); + static void _randr_cb_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED); /* public functions */ @@ -36,6 +40,7 @@ e_int_config_randr(E_Container *con, const char *params EINA_UNUSED) v->free_cfdata = _free_data; v->basic.create_widgets = _basic_create; v->basic.apply_cfdata = _basic_apply; + v->basic.check_changed = _basic_check; v->override_auto_apply = EINA_TRUE; /* create new dialog */ @@ -57,6 +62,8 @@ _create_data(E_Config_Dialog *cfd EINA_UNUSED) if (!(cfdata = E_NEW(E_Config_Dialog_Data, 1))) return NULL; + cfdata->restore = e_randr_cfg->restore; + return cfdata; } @@ -78,6 +85,8 @@ static Evas_Object * _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) { Evas_Object *o; + Evas_Object *ow; + Evas_Coord mw = 0, mh = 0, ch = 0; /* create the base list widget */ o = e_widget_list_add(evas, 0, 0); @@ -85,8 +94,6 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) /* try to create randr smart widget */ if ((cfdata->o_randr = e_smart_randr_add(evas))) { - Evas_Coord mw = 0, mh = 0; - /* hook into randr widget changed callback */ evas_object_smart_callback_add(cfdata->o_randr, "randr_changed", _randr_cb_changed, cfd); @@ -102,11 +109,15 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) /* ask randr widget to calculate min size */ e_smart_randr_min_size_get(cfdata->o_randr, &mw, &mh); - - /* set min size of the list widget */ - e_widget_size_min_set(o, mw, mh); } + ow = e_widget_check_add(evas, _("Restore On Startup"), &(cfdata->restore)); + e_widget_list_object_append(o, ow, 1, 0, 0.5); + e_widget_size_min_get(ow, NULL, &ch); + + /* set min size of the list widget */ + e_widget_size_min_set(o, mw, mh + ch); + e_util_win_auto_resize_fill(cfd->dia->win); e_win_centered_set(cfd->dia->win, 1); @@ -116,15 +127,20 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) static int _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata) { - e_smart_randr_changes_apply(cfdata->o_randr); + e_randr_cfg->restore = cfdata->restore; + e_randr_config_save(); - /* FIXME: NB: TODO: TESTING !!! */ - /* ecore_x_randr_crtc_clone_set(ecore_x_window_root_first_get(), 96, 95); */ - /* ecore_x_randr_screen_reset(ecore_x_window_root_first_get()); */ + e_smart_randr_changes_apply(cfdata->o_randr); return 1; } +static int +_basic_check(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata) +{ + return (e_randr_cfg->restore != cfdata->restore); +} + static void _randr_cb_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED) { |