Evas_Object *o_usrbg_frame;
Evas_Object *o_usrbg_fm;
Evas_Object *o_usrbg_up_button;
- Evas_Object *o_sysbg_frame;
- Evas_Object *o_sysbg_fm;
- Evas_Object *o_sysbg_up_button;
Evas_Object *o_preview;
Evas_Object *o_theme_bg;
+ Evas_Object *o_personal;
+ Evas_Object *o_system;
+ int fmdir;
+
int use_theme_bg;
char *bg;
/* advanced */
cfdata = dia->cfdata;
homedir = e_user_homedir_get();
if (!homedir) return;
+ cfdata->fmdir = 1;
+ e_widget_radio_toggle_set(cfdata->o_personal, 1);
snprintf(path, sizeof(path), "%s/.e/e/backgrounds", homedir);
E_FREE(cfdata->bg);
cfdata->bg = strdup(file);
cfdata->use_theme_bg = 0;
if (cfdata->o_usrbg_frame)
e_widget_change(cfdata->o_usrbg_frame);
- if (cfdata->o_sysbg_fm)
- e_fm2_select_set(cfdata->o_sysbg_fm, "", 0);
}
EAPI void
cfdata = dia->cfdata;
cfdata->win_import = NULL;
- printf("DONE!\n");
}
cfdata->use_theme_bg = 0;
if (cfdata->o_usrbg_frame)
e_widget_change(cfdata->o_usrbg_frame);
- e_fm2_select_set(cfdata->o_sysbg_fm, "", 0);
}
static void
e_fm2_file_show(cfdata->o_usrbg_fm, p);
}
-
static void
-_cb_sysbg_button_up(void *data1, void *data2)
-{
- E_Config_Dialog_Data *cfdata;
-
- cfdata = data1;
- if (cfdata->o_sysbg_fm)
- e_fm2_parent_go(cfdata->o_sysbg_fm);
- if (cfdata->o_sysbg_frame)
- e_widget_scrollframe_child_pos_set(cfdata->o_sysbg_frame, 0, 0);
-}
-
-static void
-_cb_sysbg_files_changed(void *data, Evas_Object *obj, void *event_info)
+_cb_theme_wallpaper(void *data, Evas_Object *obj, void *event_info)
{
E_Config_Dialog_Data *cfdata;
+ const char *f;
cfdata = data;
- if (!cfdata->o_sysbg_fm) return;
- if (!e_fm2_has_parent_get(cfdata->o_sysbg_fm))
+ if (cfdata->use_theme_bg)
{
- if (cfdata->o_sysbg_up_button)
- e_widget_disabled_set(cfdata->o_sysbg_up_button, 1);
+ f = e_theme_edje_file_get("base/theme/backgrounds", "desktop/background");
+ if (cfdata->o_preview)
+ e_widget_preview_edje_set(cfdata->o_preview, f, "desktop/background");
}
else
{
- if (cfdata->o_sysbg_up_button)
- e_widget_disabled_set(cfdata->o_sysbg_up_button, 0);
- }
- if (cfdata->o_sysbg_frame)
- e_widget_scrollframe_child_pos_set(cfdata->o_sysbg_frame, 0, 0);
-}
-
-static void
-_cb_sysbg_files_selection_change(void *data, Evas_Object *obj, void *event_info)
-{
- E_Config_Dialog_Data *cfdata;
- Evas_List *selected;
- E_Fm2_Icon_Info *ici;
- const char *realpath;
- char buf[4096];
-
- cfdata = data;
- if (!cfdata->o_sysbg_fm) return;
- selected = e_fm2_selected_list_get(cfdata->o_sysbg_fm);
- if (!selected) return;
- ici = selected->data;
- realpath = e_fm2_real_path_get(cfdata->o_sysbg_fm);
- if (!strcmp(realpath, "/"))
- snprintf(buf, sizeof(buf), "/%s", ici->file);
- else
- snprintf(buf, sizeof(buf), "%s/%s", realpath, ici->file);
- evas_list_free(selected);
- if (ecore_file_is_dir(buf)) return;
- E_FREE(cfdata->bg);
- cfdata->bg = strdup(buf);
- if (cfdata->o_preview)
- e_widget_preview_edje_set(cfdata->o_preview, buf, "desktop/background");
- if (cfdata->o_theme_bg)
- e_widget_check_checked_set(cfdata->o_theme_bg, 0);
- cfdata->use_theme_bg = 0;
- if (cfdata->o_sysbg_frame)
- e_widget_change(cfdata->o_sysbg_frame);
- e_fm2_select_set(cfdata->o_usrbg_fm, "", 0);
-}
-
-static void
-_cb_sysbg_files_selected(void *data, Evas_Object *obj, void *event_info)
-{
- E_Config_Dialog_Data *cfdata;
-
- cfdata = data;
-}
-
-static void
-_cb_sysbg_files_files_changed(void *data, Evas_Object *obj, void *event_info)
-{
- E_Config_Dialog_Data *cfdata;
- char *p, buf[4096];
-
- cfdata = data;
- if (!cfdata->bg) return;
- if (!cfdata->o_sysbg_fm) return;
- p = (char *)e_fm2_real_path_get(cfdata->o_sysbg_fm);
- if (p)
- {
- if (strncmp(p, cfdata->bg, strlen(p))) return;
+ if (cfdata->bg)
+ {
+ if (cfdata->o_preview)
+ e_widget_preview_edje_set(cfdata->o_preview, cfdata->bg, "desktop/background");
+ }
}
- snprintf(buf, sizeof(buf), "%s/data/backgrounds", e_prefix_data_get());
- if (!strncmp(cfdata->bg, buf, strlen(buf)))
- p = cfdata->bg + strlen(buf) + 1;
- else
- p = cfdata->bg;
- if (!p) return;
- e_fm2_select_set(cfdata->o_sysbg_fm, p, 1);
- e_fm2_file_show(cfdata->o_sysbg_fm, p);
}
-
static void
-_cb_theme_wallpaper(void *data, Evas_Object *obj, void *event_info)
+_cb_usrbg_dir(void *data, Evas_Object *obj, void *event_info)
{
E_Config_Dialog_Data *cfdata;
- const char *f;
+ char path[4096], *homedir;
cfdata = data;
- if (cfdata->use_theme_bg)
+ if (cfdata->fmdir == 1)
{
- f = e_theme_edje_file_get("base/theme/backgrounds", "desktop/background");
- if (cfdata->o_preview)
- e_widget_preview_edje_set(cfdata->o_preview, f, "desktop/background");
+ snprintf(path, sizeof(path), "%s/data/backgrounds", e_prefix_data_get());
}
else
{
- if (cfdata->bg)
- {
- if (cfdata->o_preview)
- e_widget_preview_edje_set(cfdata->o_preview, cfdata->bg, "desktop/background");
- }
+ homedir = e_user_homedir_get();
+ snprintf(path, sizeof(path), "%s/.e/e/backgrounds", homedir);
+ free(homedir);
}
+ e_fm2_path_set(cfdata->o_usrbg_fm, path, "/");
}
static void
E_Zone *z;
E_Desk *d;
Evas_List *l;
+ char path[4096];
if (e_config->desktop_default_background)
cfdata->bg = strdup(e_config->desktop_default_background);
}
if (!cfdata->bg) cfdata->use_theme_bg = 1;
+ if (cfdata->bg)
+ {
+ snprintf(path, sizeof(path), "%s/data/backgrounds", e_prefix_data_get());
+ if (!strncmp(cfdata->bg, path, strlen(path)))
+ cfdata->fmdir = 1;
+ }
}
static void *
const char *f;
E_Fm2_Config fmc;
E_Zone *z;
+ E_Radio_Group *rg;
homedir = e_user_homedir_get();
if (!homedir) return NULL;
z = e_zone_current_get(cfd->con);
ot = e_widget_table_add(evas, 0);
+ ol = e_widget_table_add(evas, 0);
+ il = e_widget_table_add(evas, 1);
+
+ rg = e_widget_radio_group_new(&(cfdata->fmdir));
+ o = e_widget_radio_add(evas, _("Personal"), 0, rg);
+ cfdata->o_personal = o;
+ evas_object_smart_callback_add(o, "changed",
+ _cb_usrbg_dir, cfdata);
+ e_widget_table_object_append(il, o, 0, 0, 1, 1, 1, 1, 0, 0);
+ o = e_widget_radio_add(evas, _("System"), 1, rg);
+ cfdata->o_system = o;
+ evas_object_smart_callback_add(o, "changed",
+ _cb_usrbg_dir, cfdata);
+ e_widget_table_object_append(il, o, 1, 0, 1, 1, 1, 1, 0, 0);
+
+ e_widget_table_object_append(ol, il, 0, 0, 1, 1, 0, 0, 0, 0);
-
- ol = e_widget_frametable_add(evas, _("Personal Wallpapers"), 0);
-
o = e_widget_button_add(evas, _("Go up a Directory"), "widget/up_dir",
_cb_usrbg_button_up, cfdata, NULL);
cfdata->o_usrbg_up_button = o;
- e_widget_frametable_object_append(ol, o, 0, 0, 1, 1, 0, 0, 0, 0);
+ e_widget_table_object_append(ol, o, 0, 1, 1, 1, 0, 0, 0, 0);
- snprintf(path, sizeof(path), "%s/.e/e/backgrounds", homedir);
+ if (cfdata->fmdir == 1)
+ snprintf(path, sizeof(path), "%s/data/backgrounds", e_prefix_data_get());
+ else
+ snprintf(path, sizeof(path), "%s/.e/e/backgrounds", homedir);
o = e_fm2_add(evas);
cfdata->o_usrbg_fm = o;
e_fm2_pan_max_get,
e_fm2_pan_child_size_get);
cfdata->o_usrbg_frame = of;
- e_widget_min_size_set(of, 160, 256);
- e_widget_frametable_object_append(ol, of, 0, 1, 1, 1, 1, 1, 1, 1);
+ e_widget_min_size_set(of, 160, 160);
+ e_widget_table_object_append(ol, of, 0, 2, 1, 1, 1, 1, 1, 1);
e_widget_table_object_append(ot, ol, 0, 0, 1, 1, 1, 1, 1, 1);
+ of = e_widget_list_add(evas, 0, 0);
- ol = e_widget_frametable_add(evas, _("System Wallpapers"), 0);
-
- o = e_widget_button_add(evas, _("Go up a Directory"), "widget/up_dir",
- _cb_sysbg_button_up, cfdata, NULL);
- cfdata->o_sysbg_up_button = o;
- e_widget_frametable_object_append(ol, o, 0, 0, 1, 1, 0, 0, 0, 0);
-
- snprintf(path, sizeof(path), "%s/data/backgrounds", e_prefix_data_get());
-
- o = e_fm2_add(evas);
- cfdata->o_sysbg_fm = o;
- memset(&fmc, 0, sizeof(E_Fm2_Config));
- fmc.view.mode = E_FM2_VIEW_MODE_LIST;
- fmc.view.open_dirs_in_place = 1;
- fmc.view.selector = 1;
- fmc.view.single_click = 0;
- fmc.view.no_subdir_jump = 0;
- fmc.icon.list.w = 48;
- fmc.icon.list.h = 48;
- fmc.icon.fixed.w = 1;
- fmc.icon.fixed.h = 1;
- fmc.icon.extension.show = 0;
- fmc.list.sort.no_case = 1;
- fmc.list.sort.dirs.first = 0;
- fmc.list.sort.dirs.last = 1;
- fmc.selection.single = 1;
- fmc.selection.windows_modifiers = 0;
- e_fm2_config_set(o, &fmc);
- evas_object_smart_callback_add(o, "dir_changed",
- _cb_sysbg_files_changed, cfdata);
- evas_object_smart_callback_add(o, "selection_change",
- _cb_sysbg_files_selection_change, cfdata);
- evas_object_smart_callback_add(o, "selected",
- _cb_sysbg_files_selected, cfdata);
- evas_object_smart_callback_add(o, "changed",
- _cb_sysbg_files_files_changed, cfdata);
- e_fm2_path_set(o, path, "/");
-
- of = e_widget_scrollframe_pan_add(evas, o,
- e_fm2_pan_set,
- e_fm2_pan_get,
- e_fm2_pan_max_get,
- e_fm2_pan_child_size_get);
- cfdata->o_sysbg_frame = of;
- e_widget_min_size_set(of, 160, 256);
- e_widget_frametable_object_append(ol, of, 0, 1, 1, 1, 1, 1, 1, 1);
- e_widget_table_object_append(ot, ol, 2, 0, 1, 1, 1, 1, 1, 1);
-
- il = e_widget_list_add(evas, 0, 0);
+ il = e_widget_list_add(evas, 0, 1);
o = e_widget_check_add(evas, _("Use Theme Wallpaper"), &cfdata->use_theme_bg);
cfdata->o_theme_bg = o;
evas_object_smart_callback_add(o, "changed",
NULL, cfdata, NULL);
e_widget_list_object_append(ol, o, 1, 0, 0.5);
e_widget_list_object_append(il, ol, 1, 0, 0.5);
+ e_widget_list_object_append(of, il, 1, 0, 0.0);
- o = e_widget_preview_add(evas, 240, (240 * z->h) / z->w);
+ o = e_widget_preview_add(evas, 320, (320 * z->h) / z->w);
cfdata->o_preview = o;
if (cfdata->bg)
f = cfdata->bg;
else
f = e_theme_edje_file_get("base/theme/backgrounds", "desktop/background");
e_widget_preview_edje_set(o, f, "desktop/background");
- e_widget_list_object_append(il, o, 0, 0, 0.5);
+ e_widget_list_object_append(of, o, 1, 0, 0.5);
- e_widget_table_object_append(ot, il, 1, 0, 1, 1, 0, 1, 0, 1);
+ e_widget_table_object_append(ot, of, 1, 0, 1, 1, 0, 1, 0, 1);
free(homedir);
e_dialog_resizable_set(cfd->dia, 1);
z = e_zone_current_get(cfd->con);
ot = e_widget_table_add(evas, 0);
+ ol = e_widget_table_add(evas, 0);
+ il = e_widget_table_add(evas, 1);
+
+ rg = e_widget_radio_group_new(&(cfdata->fmdir));
+ o = e_widget_radio_add(evas, _("Personal"), 0, rg);
+ cfdata->o_personal = o;
+ evas_object_smart_callback_add(o, "changed",
+ _cb_usrbg_dir, cfdata);
+ e_widget_table_object_append(il, o, 0, 0, 1, 1, 1, 1, 0, 0);
+ o = e_widget_radio_add(evas, _("System"), 1, rg);
+ cfdata->o_system = o;
+ evas_object_smart_callback_add(o, "changed",
+ _cb_usrbg_dir, cfdata);
+ e_widget_table_object_append(il, o, 1, 0, 1, 1, 1, 1, 0, 0);
+
+ e_widget_table_object_append(ol, il, 0, 0, 1, 1, 0, 0, 0, 0);
-
- ol = e_widget_frametable_add(evas, _("Personal Wallpapers"), 0);
-
o = e_widget_button_add(evas, _("Go up a Directory"), "widget/up_dir",
_cb_usrbg_button_up, cfdata, NULL);
cfdata->o_usrbg_up_button = o;
- e_widget_frametable_object_append(ol, o, 0, 0, 1, 1, 0, 0, 0, 0);
+ e_widget_table_object_append(ol, o, 0, 1, 1, 1, 0, 0, 0, 0);
- snprintf(path, sizeof(path), "%s/.e/e/backgrounds", homedir);
+ if (cfdata->fmdir == 1)
+ snprintf(path, sizeof(path), "%s/data/backgrounds", e_prefix_data_get());
+ else
+ snprintf(path, sizeof(path), "%s/.e/e/backgrounds", homedir);
o = e_fm2_add(evas);
cfdata->o_usrbg_fm = o;
e_fm2_pan_max_get,
e_fm2_pan_child_size_get);
cfdata->o_usrbg_frame = of;
- e_widget_min_size_set(of, 160, 256);
- e_widget_frametable_object_append(ol, of, 0, 1, 1, 1, 1, 1, 1, 1);
+ e_widget_min_size_set(of, 160, 160);
+ e_widget_table_object_append(ol, of, 0, 2, 1, 1, 1, 1, 1, 1);
e_widget_table_object_append(ot, ol, 0, 0, 1, 1, 1, 1, 1, 1);
+ of = e_widget_list_add(evas, 0, 0);
- ol = e_widget_frametable_add(evas, _("System Wallpapers"), 0);
-
- o = e_widget_button_add(evas, _("Go up a Directory"), "widget/up_dir",
- _cb_sysbg_button_up, cfdata, NULL);
- cfdata->o_sysbg_up_button = o;
- e_widget_frametable_object_append(ol, o, 0, 0, 1, 1, 0, 0, 0, 0);
-
- snprintf(path, sizeof(path), "%s/data/backgrounds", e_prefix_data_get());
-
- o = e_fm2_add(evas);
- cfdata->o_sysbg_fm = o;
- memset(&fmc, 0, sizeof(E_Fm2_Config));
- fmc.view.mode = E_FM2_VIEW_MODE_LIST;
- fmc.view.open_dirs_in_place = 1;
- fmc.view.selector = 1;
- fmc.view.single_click = 0;
- fmc.view.no_subdir_jump = 0;
- fmc.icon.list.w = 48;
- fmc.icon.list.h = 48;
- fmc.icon.fixed.w = 1;
- fmc.icon.fixed.h = 1;
- fmc.icon.extension.show = 0;
- fmc.list.sort.no_case = 1;
- fmc.list.sort.dirs.first = 0;
- fmc.list.sort.dirs.last = 1;
- fmc.selection.single = 1;
- fmc.selection.windows_modifiers = 0;
- e_fm2_config_set(o, &fmc);
- evas_object_smart_callback_add(o, "dir_changed",
- _cb_sysbg_files_changed, cfdata);
- evas_object_smart_callback_add(o, "selection_change",
- _cb_sysbg_files_selection_change, cfdata);
- evas_object_smart_callback_add(o, "selected",
- _cb_sysbg_files_selected, cfdata);
- evas_object_smart_callback_add(o, "changed",
- _cb_sysbg_files_files_changed, cfdata);
- e_fm2_path_set(o, path, "/");
-
- of = e_widget_scrollframe_pan_add(evas, o,
- e_fm2_pan_set,
- e_fm2_pan_get,
- e_fm2_pan_max_get,
- e_fm2_pan_child_size_get);
- cfdata->o_sysbg_frame = of;
- e_widget_min_size_set(of, 160, 256);
- e_widget_frametable_object_append(ol, of, 0, 1, 1, 1, 1, 1, 1, 1);
- e_widget_table_object_append(ot, ol, 2, 0, 1, 1, 1, 1, 1, 1);
-
- il = e_widget_list_add(evas, 0, 0);
+ il = e_widget_list_add(evas, 0, 1);
o = e_widget_check_add(evas, _("Use Theme Wallpaper"), &cfdata->use_theme_bg);
cfdata->o_theme_bg = o;
evas_object_smart_callback_add(o, "changed",
NULL, cfdata, NULL);
e_widget_list_object_append(ol, o, 1, 0, 0.5);
e_widget_list_object_append(il, ol, 1, 0, 0.5);
+ e_widget_list_object_append(of, il, 1, 0, 0.0);
- o = e_widget_preview_add(evas, 240, (240 * z->h) / z->w);
+ o = e_widget_preview_add(evas, 320, (320 * z->h) / z->w);
cfdata->o_preview = o;
if (cfdata->bg)
f = cfdata->bg;
else
f = e_theme_edje_file_get("base/theme/backgrounds", "desktop/background");
e_widget_preview_edje_set(o, f, "desktop/background");
- e_widget_list_object_append(il, o, 0, 0, 0.5);
+ e_widget_list_object_append(of, o, 1, 0, 0.5);
ol = e_widget_framelist_add(evas, _("Where to place the Wallpaper"), 0);
e_widget_framelist_content_align_set(ol, 0.0, 0.0);
e_widget_disabled_set(o, 1);
e_widget_framelist_object_append(ol, o);
- e_widget_list_object_append(il, ol, 0, 1, 0.5);
+ e_widget_list_object_append(of, ol, 0, 1, 0.5);
- e_widget_table_object_append(ot, il, 1, 0, 1, 1, 0, 1, 0, 1);
+ e_widget_table_object_append(ot, of, 1, 0, 1, 1, 0, 1, 0, 1);
free(homedir);
e_dialog_resizable_set(cfd->dia, 1);