forked from enlightenment/enlightenment
- file selector work (files can be selected using double click)
- eap editor bugs - lets start using the built in eap editor and iron out bugs SVN revision: 18158
This commit is contained in:
parent
6caefdb50d
commit
7114c99203
|
@ -989,10 +989,7 @@ e_app_fields_fill(E_App *a, const char *path)
|
|||
eet_close(ef);
|
||||
}
|
||||
|
||||
/* If we are saving a new non-existant .eap, we need to add more info
|
||||
* so edje can decompile it. Image saving doesnt work yet with newly
|
||||
* created eaps.
|
||||
*
|
||||
/*
|
||||
* We also need to fix startup-notify and wait-exit as they currently
|
||||
* dont save too.
|
||||
*/
|
||||
|
|
|
@ -40,7 +40,6 @@ static void _e_eap_edit_save_cb(void *data, E_Dialog *dia);
|
|||
static void _e_eap_edit_cancel_cb(void *data, E_Dialog *dia);
|
||||
static void _e_eap_edit_browse_cb(void *data1, void *data2);
|
||||
static void _e_eap_edit_free(E_App_Edit *app);
|
||||
static void _e_eap_edit_selector_cb(E_Fileman *fileman, char *file, void *data);
|
||||
static void _e_eap_edit_fill_data(E_App_Edit_CFData *cdfata);
|
||||
static void *_e_eap_edit_create_data(E_Config_Dialog *cfd);
|
||||
static void _e_eap_edit_free_data(E_Config_Dialog *cfd, void *data);
|
||||
|
@ -97,6 +96,8 @@ _e_eap_edit_fill_data(E_App_Edit_CFData *cfdata)
|
|||
IFDUP(cfdata->editor->eap->win_title, cfdata->wtitle);
|
||||
IFDUP(cfdata->editor->eap->win_role, cfdata->wrole);
|
||||
IFDUP(cfdata->editor->eap->path, cfdata->path);
|
||||
cfdata->startup_notify = cfdata->editor->eap->startup_notify;
|
||||
cfdata->wait_exit = cfdata->editor->eap->wait_exit;
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -139,9 +140,12 @@ _e_eap_edit_basic_apply_data(E_Config_Dialog *cfd, void *data)
|
|||
IFDUP(cfdata->exe, eap->exe);
|
||||
IFDUP(cfdata->image, eap->image);
|
||||
|
||||
eap->startup_notify = cfdata->startup_notify;
|
||||
eap->wait_exit = cfdata->wait_exit;
|
||||
|
||||
e_app_fields_save(eap);
|
||||
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -169,8 +173,11 @@ _e_eap_edit_advanced_apply_data(E_Config_Dialog *cfd, void *data)
|
|||
|
||||
if(cfdata->startup_notify)
|
||||
eap->startup_notify = 1;
|
||||
else eap->startup_notify = 0;
|
||||
if(cfdata->wait_exit)
|
||||
eap->wait_exit = 1;
|
||||
else eap->wait_exit = 0;
|
||||
|
||||
|
||||
IFDUP(cfdata->generic, eap->generic);
|
||||
IFDUP(cfdata->comment, eap->comment);
|
||||
|
@ -181,6 +188,8 @@ _e_eap_edit_advanced_apply_data(E_Config_Dialog *cfd, void *data)
|
|||
IFDUP(cfdata->iclass, eap->icon_class);
|
||||
IFDUP(cfdata->path, eap->path);
|
||||
|
||||
|
||||
|
||||
e_app_fields_save(eap);
|
||||
|
||||
return 1;
|
||||
|
@ -200,7 +209,9 @@ _e_eap_edit_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data)
|
|||
editor = cfdata->editor;
|
||||
eap = editor->eap;
|
||||
|
||||
ol = e_widget_list_add(evas, 0, 1);
|
||||
//ol = e_widget_list_add(evas, 0, 1);
|
||||
ol = e_widget_table_add(evas, _("Settings"), 0);
|
||||
|
||||
o = e_widget_frametable_add(evas, _("Icon"), 0);
|
||||
|
||||
if(eap->path)
|
||||
|
@ -223,7 +234,9 @@ _e_eap_edit_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data)
|
|||
1, 1, 1, 1);
|
||||
|
||||
|
||||
e_widget_list_object_append(ol, o, 1, 1, 0.5);
|
||||
//e_widget_list_object_append(ol, o, 1, 1, 0.5);
|
||||
e_widget_table_object_append(ol, o, 0, 0, 1, 1, 1 ,1, 1, 1);
|
||||
|
||||
|
||||
o = e_widget_frametable_add(evas, _("Basic Info"), 0);
|
||||
|
||||
|
@ -244,7 +257,8 @@ _e_eap_edit_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data)
|
|||
1, 1, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
|
||||
e_widget_list_object_append(ol, o, 1, 1, 0.5);
|
||||
//e_widget_list_object_append(ol, o, 1, 1, 0.5);
|
||||
e_widget_table_object_append(ol, o, 1, 0, 1, 1, 1 ,1, 1, 1);
|
||||
|
||||
return ol;
|
||||
}
|
||||
|
@ -262,7 +276,8 @@ _e_eap_edit_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data
|
|||
editor = cfdata->editor;
|
||||
eap = editor->eap;
|
||||
|
||||
ol = e_widget_table_add(evas, _("Advanced"), 0);
|
||||
//ol = e_widget_table_add(evas, _("Advanced"), 0);
|
||||
ol = _e_eap_edit_basic_create_widgets(cfd, evas, data);
|
||||
|
||||
o = e_widget_frametable_add(evas, _("General"), 0);
|
||||
|
||||
|
@ -283,7 +298,7 @@ _e_eap_edit_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data
|
|||
1, 1, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
|
||||
e_widget_table_object_append(ol, o, 0, 0, 1, 1, 1 ,1, 1, 1);
|
||||
e_widget_table_object_append(ol, o, 0, 1, 1, 1, 1 ,1, 1, 1);
|
||||
|
||||
|
||||
/*- window info -*/
|
||||
|
@ -320,7 +335,7 @@ _e_eap_edit_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data
|
|||
1, 3, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
|
||||
e_widget_table_object_append(ol, o, 0, 1, 1, 1, 1 ,1, 1, 1);
|
||||
e_widget_table_object_append(ol, o, 0, 2, 1, 1, 1 ,1, 1, 1);
|
||||
|
||||
/*- icon info -*/
|
||||
|
||||
|
@ -343,28 +358,22 @@ _e_eap_edit_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, void *data
|
|||
1, 1, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
|
||||
e_widget_table_object_append(ol, o, 1, 0, 1, 1, 1 ,1, 1, 1);
|
||||
e_widget_table_object_append(ol, o, 1, 1, 1, 1, 1 ,1, 1, 1);
|
||||
|
||||
|
||||
/*- misc info -*/
|
||||
|
||||
o = e_widget_frametable_add(evas, _("Misc"), 0);
|
||||
|
||||
e_widget_frametable_object_append(o, e_widget_label_add(evas, "Startup notify"),
|
||||
0, 0, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
e_widget_frametable_object_append(o, e_widget_check_add(evas, "", &(cfdata->startup_notify)),
|
||||
1, 0, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
e_widget_frametable_object_append(o, e_widget_check_add(evas, "Startup Notify", &(cfdata->startup_notify)),
|
||||
0, 0, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
|
||||
e_widget_frametable_object_append(o, e_widget_label_add(evas, "Wait exit"),
|
||||
0, 1, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
e_widget_frametable_object_append(o, e_widget_check_add(evas, "", &(cfdata->wait_exit)),
|
||||
1, 1, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
e_widget_frametable_object_append(o, e_widget_check_add(evas, "Wait Exit", &(cfdata->wait_exit)),
|
||||
0, 1, 1, 1,
|
||||
1, 1, 1, 1);
|
||||
|
||||
e_widget_table_object_append(ol, o, 1, 1, 1, 1, 1 ,1, 1, 1);
|
||||
e_widget_table_object_append(ol, o, 1, 2, 1, 1, 1 ,1, 1, 1);
|
||||
|
||||
return ol;
|
||||
}
|
||||
|
|
|
@ -130,13 +130,12 @@ _e_file_dialog_file_select_cb(Evas_Object *obj, char *file, void *data)
|
|||
|
||||
printf("e_file_dialog: %s\n", file);
|
||||
|
||||
_e_file_dialog_free(dia);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_dialog_free(E_File_Dialog *dia)
|
||||
{
|
||||
e_object_del(E_OBJECT(dia->dia));
|
||||
e_object_unref(E_OBJECT(dia->dia));
|
||||
E_FREE(dia->file);
|
||||
free(dia);
|
||||
}
|
||||
|
|
|
@ -11,14 +11,13 @@
|
|||
#define SMART_NAME "e_fileselector"
|
||||
#define API_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if ((!obj) || (!sd) || (evas_object_type_get(obj) && strcmp(evas_object_type_get(obj), SMART_NAME)))
|
||||
#define INTERNAL_ENTRY E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if (!sd) return;
|
||||
#define THEME_SET(OBJ, GROUP) e_theme_edje_object_set(OBJ, "base/theme/widgets/fileselector", "widgets/fileselector/"GROUP)
|
||||
|
||||
typedef struct _E_Smart_Data E_Smart_Data;
|
||||
|
||||
struct _E_Smart_Data
|
||||
{
|
||||
Evas_Object *parent;
|
||||
Evas_Object *theme; /* theme object */
|
||||
Evas_Object *frame; /* scrollframe object */
|
||||
Evas_Object *files; /* file view object */
|
||||
|
||||
int view; /* view type, icons, list */
|
||||
|
@ -41,6 +40,11 @@ static void _e_smart_clip_set(Evas_Object *obj, Evas_Object * clip);
|
|||
static void _e_smart_clip_unset(Evas_Object *obj);
|
||||
static void _e_smart_init(void);
|
||||
static void _e_file_selector_selected_cb(Evas_Object *obj, char *file, void *data);
|
||||
static void _e_file_selector_scroll_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
|
||||
static void _e_file_selector_scroll_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
|
||||
static void _e_file_selector_scroll_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
|
||||
static void _e_file_selector_scroll_child_size_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y);
|
||||
|
||||
|
||||
/* local subsystem globals */
|
||||
static Evas_Smart *_e_smart = NULL;
|
||||
|
@ -83,6 +87,31 @@ e_file_selector_callback_add(Evas_Object *obj, void (*func) (Evas_Object *obj, c
|
|||
sd->func_data = data;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_selector_scroll_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
e_fm_scroll_set(obj, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_selector_scroll_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
e_fm_scroll_get(obj, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_selector_scroll_max_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
e_fm_scroll_max_get(obj, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_file_selector_scroll_child_size_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
e_fm_geometry_virtual_get(obj, x, y);
|
||||
}
|
||||
|
||||
|
||||
/* local subsystem functions */
|
||||
static void
|
||||
_e_smart_add(Evas_Object *obj)
|
||||
|
@ -102,21 +131,23 @@ _e_smart_add(Evas_Object *obj)
|
|||
sd->view = E_FILE_SELECTOR_ICONVIEW;
|
||||
|
||||
evas = evas_object_evas_get(obj);
|
||||
// sd->theme = edje_object_add(evas);
|
||||
sd->theme = e_scrollframe_add(evas);
|
||||
evas_object_smart_member_add(sd->theme, obj);
|
||||
// THEME_SET(sd->theme, "main");
|
||||
|
||||
sd->frame = e_scrollframe_add(evas);
|
||||
evas_object_smart_member_add(sd->frame, obj);
|
||||
|
||||
sd->files = e_fm_add(evas);
|
||||
e_fm_selector_enable(sd->files, _e_file_selector_selected_cb, sd);
|
||||
evas_object_smart_member_add(sd->files, obj);
|
||||
|
||||
//edje_object_part_swallow(sd->theme, "items", sd->files);
|
||||
e_scrollframe_child_set(sd->theme, sd->files);
|
||||
e_scrollframe_extern_pan_set(sd->frame, sd->files,
|
||||
_e_file_selector_scroll_set,
|
||||
_e_file_selector_scroll_get,
|
||||
_e_file_selector_scroll_max_get,
|
||||
_e_file_selector_scroll_child_size_get);
|
||||
|
||||
evas_object_smart_data_set(obj, sd);
|
||||
|
||||
evas_object_show(sd->theme);
|
||||
evas_object_show(sd->frame);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -124,7 +155,7 @@ _e_smart_del(Evas_Object *obj)
|
|||
{
|
||||
INTERNAL_ENTRY;
|
||||
|
||||
evas_object_del(sd->theme);
|
||||
evas_object_del(sd->frame);
|
||||
evas_object_del(sd->files);
|
||||
|
||||
free(sd);
|
||||
|
@ -136,7 +167,7 @@ _e_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
|
|||
INTERNAL_ENTRY;
|
||||
sd->x = x;
|
||||
sd->y = y;
|
||||
evas_object_move(sd->theme, x, y);
|
||||
evas_object_move(sd->frame, x, y);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -145,42 +176,42 @@ _e_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|||
INTERNAL_ENTRY;
|
||||
sd->w = w;
|
||||
sd->h = h;
|
||||
evas_object_resize(sd->theme, w, h);
|
||||
evas_object_resize(sd->frame, w, h);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_show(Evas_Object *obj)
|
||||
{
|
||||
INTERNAL_ENTRY;
|
||||
evas_object_show(sd->theme);
|
||||
evas_object_show(sd->frame);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_hide(Evas_Object *obj)
|
||||
{
|
||||
INTERNAL_ENTRY;
|
||||
evas_object_hide(sd->theme);
|
||||
evas_object_hide(sd->frame);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_color_set(Evas_Object *obj, int r, int g, int b, int a)
|
||||
{
|
||||
INTERNAL_ENTRY;
|
||||
evas_object_color_set(sd->theme, r, g, b, a);
|
||||
evas_object_color_set(sd->frame, r, g, b, a);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_clip_set(Evas_Object *obj, Evas_Object *clip)
|
||||
{
|
||||
INTERNAL_ENTRY;
|
||||
evas_object_clip_set(sd->theme, clip);
|
||||
evas_object_clip_set(sd->frame, clip);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_smart_clip_unset(Evas_Object *obj)
|
||||
{
|
||||
INTERNAL_ENTRY;
|
||||
evas_object_clip_unset(sd->theme);
|
||||
evas_object_clip_unset(sd->frame);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -208,6 +208,7 @@ e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_
|
|||
}
|
||||
else if (bd->client.icccm.class) /* icons with no class useless to borders */
|
||||
{
|
||||
#if 0
|
||||
static char buf[PATH_MAX + 50];
|
||||
char *name, *homedir;
|
||||
int i, l;
|
||||
|
@ -229,9 +230,10 @@ e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_
|
|||
bd->client.icccm.class, homedir, name);
|
||||
free(homedir);
|
||||
free(name);
|
||||
#endif
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Create Icon"));
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, buf);
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, strdup(bd->client.icccm.class));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -399,6 +401,40 @@ _e_border_menu_cb_shade(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
static void
|
||||
_e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||
{
|
||||
E_App *a;
|
||||
|
||||
if(ecore_file_exists(data))
|
||||
{
|
||||
a = e_app_new(data, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
static char buf[PATH_MAX + 50];
|
||||
char *name, *homedir;
|
||||
int i, l;
|
||||
|
||||
buf[0] = '\0';
|
||||
/* generate a reasonable file name from the window class */
|
||||
/* FIXME - I think there could be duplicates - how better to do this? */
|
||||
name = strdup(data);
|
||||
l = strlen(name);
|
||||
for (i = 0; i < l; i++)
|
||||
{
|
||||
if (name[i] == ' ') name[i] = '_';
|
||||
}
|
||||
/* previously this could be null, but it will exist now */
|
||||
homedir = e_user_homedir_get();
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/.e/e/applications/all/%s.eap",
|
||||
homedir, name);
|
||||
free(homedir);
|
||||
free(name);
|
||||
a = e_app_empty_new(buf);
|
||||
a->win_class = strdup(data);
|
||||
free(data);
|
||||
}
|
||||
e_eap_edit_show(m->zone->container, a);
|
||||
#if 0
|
||||
char *file;
|
||||
char *command;
|
||||
char *full;
|
||||
|
@ -415,6 +451,7 @@ _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
_("Error starting icon editor\n\n"
|
||||
"please install e_util_eapp_edit\n"
|
||||
"or make sure it is in your PATH\n"));
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -57,7 +57,7 @@ _e_wid_fileman_selected_cb(Evas_Object *obj, char *file, void *data)
|
|||
snprintf(*(wd->valptr), size, "%s", file);
|
||||
#endif
|
||||
if(wd->select_func)
|
||||
wd->select_func(wd->wid, file, wd->select_data);
|
||||
wd->select_func(wd->wid, strdup(file), wd->select_data);
|
||||
|
||||
|
||||
printf("e_widget_fileman: %s\n", file);
|
||||
|
|
Loading…
Reference in New Issue