forked from enlightenment/enlightenment
Finish icon creation code, a little feeble now, but works
big feature: passes in window class - no moew xprop nonsense :) SVN revision: 12567
This commit is contained in:
parent
3104772a04
commit
98f23cefae
|
@ -2318,10 +2318,28 @@ _e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
static char buf[PATH_MAX + 50];
|
||||||
|
char *name, *homedir;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
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(bd->client.icccm.class);
|
||||||
|
for (i = 0; i < strlen(name); 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),
|
||||||
|
"--win-class %s %s/.e/e/applications/all/%s.eapp",
|
||||||
|
bd->client.icccm.class, homedir, name);
|
||||||
mi = e_menu_item_new(m);
|
mi = e_menu_item_new(m);
|
||||||
e_menu_item_label_set(mi, "Create Icon");
|
e_menu_item_label_set(mi, "Create Icon");
|
||||||
/* FIXME need to create path for newly created 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, "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
e_menu_activate_mouse(m, bd->container, x, y, 1, 1,
|
e_menu_activate_mouse(m, bd->container, x, y, 1, 1,
|
||||||
|
@ -2389,7 +2407,7 @@ _e_border_menu_cb_icon_edit(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||||
full = malloc(strlen(file) + strlen(command) + 1);
|
full = malloc(strlen(file) + strlen(command) + 1);
|
||||||
strcpy(full, command);
|
strcpy(full, command);
|
||||||
strcat(full, file);
|
strcat(full, file);
|
||||||
printf("e_util_eapp_edit %s\n", full);
|
printf("EXEC %s\n", full);
|
||||||
process = ecore_exe_run(full, NULL);
|
process = ecore_exe_run(full, NULL);
|
||||||
if (!process || !ecore_exe_pid_get(process))
|
if (!process || !ecore_exe_pid_get(process))
|
||||||
e_error_dialog_show("Icon Edit Error", "Error starting icon editor\n\n \
|
e_error_dialog_show("Icon Edit Error", "Error starting icon editor\n\n \
|
||||||
|
|
Loading…
Reference in New Issue