aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/conf_desklock/e_int_config_desklock.c
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2009-04-25 18:32:34 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2009-04-25 18:32:34 +0000
commit8f923e67c15891d986667fc0730bd17bf420e223 (patch)
tree7123819b5f2d835129d553d68d4b5aa491554b0c /src/modules/conf_desklock/e_int_config_desklock.c
parentd2be2c99a735541b290872e81a1c453692a70a6e (diff)
downloadenlightenment-8f923e67c15891d986667fc0730bd17bf420e223.tar.gz
enlightenment-8f923e67c15891d986667fc0730bd17bf420e223.tar.xz
enlightenment-8f923e67c15891d986667fc0730bd17bf420e223.zip
new special case for desklock wallpaper.
desklock now can use the same wallpaper as desktop, this is what I use and was annoyed to have to remember to change in both places. SVN revision: 40383
Diffstat (limited to 'src/modules/conf_desklock/e_int_config_desklock.c')
-rw-r--r--src/modules/conf_desklock/e_int_config_desklock.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/src/modules/conf_desklock/e_int_config_desklock.c b/src/modules/conf_desklock/e_int_config_desklock.c
index cdc8fb770..a0305146b 100644
--- a/src/modules/conf_desklock/e_int_config_desklock.c
+++ b/src/modules/conf_desklock/e_int_config_desklock.c
@@ -105,8 +105,10 @@ _fill_data(E_Config_Dialog_Data *cfdata)
cfdata->bg_method = 0;
else if (!strcmp(cfdata->bg, "theme_background"))
cfdata->bg_method = 1;
- else
+ else if (!strcmp(cfdata->bg, "user_background"))
cfdata->bg_method = 2;
+ else
+ cfdata->bg_method = 3;
cfdata->use_xscreensaver = ecore_x_screensaver_event_available_get();
cfdata->zone_count = _zone_count_get();
@@ -217,6 +219,23 @@ _basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
(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)
{
@@ -309,6 +328,13 @@ _adv_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
E_FREE(cfdata->bg);
cfdata->bg = strdup("theme_background");
}
+ else if (cfdata->bg_method == 2)
+ {
+ f = _user_wallpaper_get();
+ e_widget_preview_edje_set(cfdata->o_prev, f, "e/desktop/background");
+ E_FREE(cfdata->bg);
+ cfdata->bg = strdup("user_background");
+ }
else
{
if (cfdata->bg)
@@ -358,10 +384,13 @@ _adv_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
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);
- cfdata->o_custom = e_widget_radio_add(evas, _("Custom"), 2, rg);
+ 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, 2, 1, 1,
+ 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);
@@ -487,6 +516,13 @@ _cb_method_change(void *data, Evas_Object *obj, void *event_info)
E_FREE(cfdata->bg);
cfdata->bg = strdup("theme_background");
}
+ else if (cfdata->bg_method == 2)
+ {
+ f = _user_wallpaper_get();
+ e_widget_preview_edje_set(cfdata->o_prev, f, "e/desktop/background");
+ E_FREE(cfdata->bg);
+ cfdata->bg = strdup("user_background");
+ }
else
{
sel = e_fm2_selected_list_get(cfdata->o_fm);