forked from enlightenment/enlightenment
Put the exe and it's parameters back together when needed.
SVN revision: 25575
This commit is contained in:
parent
be9dd395e1
commit
bd51254720
|
@ -473,6 +473,7 @@ e_app_exec(E_App *a, int launch_id)
|
|||
Ecore_Exe *exe;
|
||||
E_App_Instance *inst;
|
||||
Evas_List *l;
|
||||
char *command;
|
||||
|
||||
E_OBJECT_CHECK_RETURN(a, 0);
|
||||
E_OBJECT_TYPE_CHECK_RETURN(a, E_APP_TYPE, 0);
|
||||
|
@ -486,16 +487,32 @@ e_app_exec(E_App *a, int launch_id)
|
|||
* the eapp file */
|
||||
inst = E_NEW(E_App_Instance, 1);
|
||||
if (!inst) return 0;
|
||||
|
||||
if (a->desktop)
|
||||
command = ecore_desktop_get_command(a->desktop, NULL, 1);
|
||||
else
|
||||
command = strdup(a->exe);
|
||||
if (!command)
|
||||
{
|
||||
free(inst);
|
||||
e_util_dialog_show(_("Run Error"),
|
||||
_("Enlightenment was unable to process a command line:<br>"
|
||||
"<br>"
|
||||
"%s %s<br>"),
|
||||
a->exe, (a->exe_params != NULL) ? a->exe_params : "" );
|
||||
return 0;
|
||||
}
|
||||
/* We want the stdout and stderr as lines for the error dialog if it exits abnormally. */
|
||||
exe = ecore_exe_pipe_run(a->exe, ECORE_EXE_PIPE_AUTO | ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_ERROR | ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR_LINE_BUFFERED, inst);
|
||||
exe = ecore_exe_pipe_run(command, ECORE_EXE_PIPE_AUTO | ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_ERROR | ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR_LINE_BUFFERED, inst);
|
||||
if (!exe)
|
||||
{
|
||||
free(command);
|
||||
free(inst);
|
||||
e_util_dialog_show(_("Run Error"),
|
||||
_("Enlightenment was unable to fork a child process:<br>"
|
||||
"<br>"
|
||||
"%s<br>"),
|
||||
a->exe);
|
||||
"%s %s<br>"),
|
||||
a->exe, (a->exe_params != NULL) ? a->exe_params : "" );
|
||||
return 0;
|
||||
}
|
||||
/* 20 lines at start and end, 20x100 limit on bytes at each end. */
|
||||
|
@ -517,6 +534,7 @@ e_app_exec(E_App *a, int launch_id)
|
|||
_e_app_change(a2, E_APP_EXEC);
|
||||
}
|
||||
_e_app_change(a, E_APP_EXEC);
|
||||
free(command);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1213,11 +1231,13 @@ e_app_fields_fill(E_App *a, const char *path)
|
|||
desktop = ecore_desktop_get(path, lang);
|
||||
if (desktop)
|
||||
{
|
||||
a->desktop = desktop;
|
||||
if (desktop->name) a->name = evas_stringshare_add(desktop->name);
|
||||
if (desktop->generic) a->generic = evas_stringshare_add(desktop->generic);
|
||||
if (desktop->comment) a->comment = evas_stringshare_add(desktop->comment);
|
||||
|
||||
if (desktop->exec) a->exe = evas_stringshare_add(desktop->exec);
|
||||
if (desktop->exec_params) a->exe = evas_stringshare_add(desktop->exec_params);
|
||||
if (desktop->icon_class) a->icon_class = evas_stringshare_add(desktop->icon_class);
|
||||
if (desktop->icon_path) a->icon_path = evas_stringshare_add(desktop->icon_path);
|
||||
if (desktop->window_class) a->win_class = evas_stringshare_add(desktop->window_class);
|
||||
|
@ -1346,6 +1366,7 @@ e_app_fields_save(E_App *a)
|
|||
desktop->comment = (char *) a->comment;
|
||||
|
||||
desktop->exec = (char *) a->exe;
|
||||
desktop->exec_params = (char *) a->exe_params;
|
||||
desktop->icon_class = (char *) a->icon_class;
|
||||
desktop->icon_path = (char *) a->icon_path;
|
||||
desktop->window_class = (char *) a->win_class;
|
||||
|
@ -1492,6 +1513,7 @@ e_app_fields_empty(E_App *a)
|
|||
if (a->generic) evas_stringshare_del(a->generic);
|
||||
if (a->comment) evas_stringshare_del(a->comment);
|
||||
if (a->exe) evas_stringshare_del(a->exe);
|
||||
if (a->exe_params) evas_stringshare_del(a->exe_params);
|
||||
if (a->icon_class) evas_stringshare_del(a->icon_class);
|
||||
if (a->icon_path) evas_stringshare_del(a->icon_path);
|
||||
if (a->win_name) evas_stringshare_del(a->win_name);
|
||||
|
@ -1502,6 +1524,7 @@ e_app_fields_empty(E_App *a)
|
|||
a->generic = NULL;
|
||||
a->comment = NULL;
|
||||
a->exe = NULL;
|
||||
a->exe_params = NULL;
|
||||
a->icon_class = NULL;
|
||||
a->icon_path = NULL;
|
||||
a->win_name = NULL;
|
||||
|
@ -2255,6 +2278,7 @@ _e_app_copy(E_App *dst, E_App *src)
|
|||
dst->generic = src->generic;
|
||||
dst->comment = src->comment;
|
||||
dst->exe = src->exe;
|
||||
dst->exe_params = src->exe_params;
|
||||
dst->path = src->path;
|
||||
dst->win_name = src->win_name;
|
||||
dst->win_class = src->win_class;
|
||||
|
|
|
@ -31,12 +31,14 @@ struct _E_App
|
|||
|
||||
E_App *parent; /* the parent e_app node */
|
||||
E_App *orig; /* if this is a copy, point to the original */
|
||||
Ecore_Desktop *desktop; /* if this came from a .desktop file. */
|
||||
|
||||
const char *name; /* app name */
|
||||
const char *generic; /* generic app name */
|
||||
const char *comment; /* a longer description */
|
||||
const char *exe; /* command to execute, NULL if directory */
|
||||
|
||||
const char *exe_params; /* command params to execute, NULL if directory */
|
||||
|
||||
const char *path; /* path to .eet containing icons etc. etc. */
|
||||
// const char *icon_path; /* path to icon file, in case it is different from path. */
|
||||
|
||||
|
|
|
@ -114,9 +114,13 @@ _e_eap_edit_free(E_App_Edit *editor)
|
|||
static void
|
||||
_e_eap_edit_fill_data(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
char *exe;
|
||||
/*- BASIC -*/
|
||||
IFDUP(cfdata->editor->eap->name, cfdata->name);
|
||||
IFDUP(cfdata->editor->eap->exe, cfdata->exe);
|
||||
exe = ecore_desktop_merge_command((char *)cfdata->editor->eap->exe, (char *)cfdata->editor->eap->exe_params);
|
||||
if (exe)
|
||||
cfdata->exe = exe;
|
||||
/*- ADVANCED -*/
|
||||
IFDUP(cfdata->editor->eap->generic, cfdata->generic);
|
||||
IFDUP(cfdata->editor->eap->comment, cfdata->comment);
|
||||
|
@ -194,10 +198,27 @@ _e_eap_edit_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data)
|
|||
|
||||
if (eap->name) evas_stringshare_del(eap->name);
|
||||
if (eap->exe) evas_stringshare_del(eap->exe);
|
||||
if (eap->exe_params) evas_stringshare_del(eap->exe_params);
|
||||
if (eap->image) evas_stringshare_del(eap->image);
|
||||
eap->name = NULL;
|
||||
eap->exe = NULL;
|
||||
eap->exe_params = NULL;
|
||||
eap->image = NULL;
|
||||
|
||||
if (data->name) eap->name = evas_stringshare_add(data->name);
|
||||
if (data->exe) eap->exe = evas_stringshare_add(data->exe);
|
||||
if (data->exe)
|
||||
{
|
||||
char *exe;
|
||||
|
||||
exe = strchr(data->exe, ' ');
|
||||
if (exe)
|
||||
{
|
||||
*exe = '\0';
|
||||
eap->exe_params = evas_stringshare_add(++exe);
|
||||
*exe = ' ';
|
||||
}
|
||||
eap->exe = evas_stringshare_add(data->exe);
|
||||
}
|
||||
if (data->image)
|
||||
{
|
||||
eap->image = evas_stringshare_add(data->image);
|
||||
|
@ -228,25 +249,7 @@ _e_eap_edit_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data
|
|||
editor = data->editor;
|
||||
eap = editor->eap;
|
||||
|
||||
if (eap->name) evas_stringshare_del(eap->name);
|
||||
if (eap->exe) evas_stringshare_del(eap->exe);
|
||||
if (eap->image) evas_stringshare_del(eap->image);
|
||||
|
||||
if (eap->generic) evas_stringshare_del(eap->generic);
|
||||
if (eap->comment) evas_stringshare_del(eap->comment);
|
||||
if (eap->win_name) evas_stringshare_del(eap->win_name);
|
||||
if (eap->win_class) evas_stringshare_del(eap->win_class);
|
||||
if (eap->win_title) evas_stringshare_del(eap->win_title);
|
||||
if (eap->win_role) evas_stringshare_del(eap->win_role);
|
||||
if (eap->icon_class) evas_stringshare_del(eap->icon_class);
|
||||
|
||||
if (data->startup_notify) eap->startup_notify = 1;
|
||||
else eap->startup_notify = 0;
|
||||
if (data->wait_exit) eap->wait_exit = 1;
|
||||
else eap->wait_exit = 0;
|
||||
|
||||
if (data->name) eap->name = evas_stringshare_add(data->name);
|
||||
if (data->exe) eap->exe = evas_stringshare_add(data->exe);
|
||||
e_app_fields_empty(eap);
|
||||
|
||||
if (data->generic) eap->generic = evas_stringshare_add(data->generic);
|
||||
if (data->comment) eap->comment = evas_stringshare_add(data->comment);
|
||||
|
@ -257,20 +260,8 @@ _e_eap_edit_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *data
|
|||
if (data->iclass) eap->icon_class = evas_stringshare_add(data->iclass);
|
||||
if (data->eap.icon_path) eap->icon_path = evas_stringshare_add(data->eap.icon_path);
|
||||
|
||||
if (data->image)
|
||||
{
|
||||
eap->image = evas_stringshare_add(data->image);
|
||||
eap->icon_class = evas_stringshare_add(""); /* Call this temporary, until I reconsider the icon search order. */
|
||||
}
|
||||
_e_eap_edit_basic_apply_data(cfd, data);
|
||||
|
||||
/* FIXME: hardcoded until the eap editor provides fields to change it */
|
||||
if (data->width) eap->width = data->width;
|
||||
else eap->width = 128;
|
||||
if (data->height) eap->height = data->height;
|
||||
else eap->height = 128;
|
||||
|
||||
if ((eap->name) && (eap->exe))
|
||||
e_app_fields_save(eap);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -499,7 +499,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
|
||||
if (!once)
|
||||
{
|
||||
mt = e_widget_button_add(evas, _("Regenerate \"All Applications\" Menu"), "enlightenment/e",
|
||||
mt = e_widget_button_add(evas, _("Regenerate \"Applications\" Menu"), "enlightenment/e",
|
||||
_cb_button_regen, cfdata, NULL);
|
||||
cfdata->gui.o_regen_button = mt;
|
||||
e_widget_framelist_object_append(of, mt);
|
||||
|
|
Loading…
Reference in New Issue