Enlightenment CVS committal
Author : onefang
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_apps.c e_apps.h e_eap_editor.c e_int_config_apps.c
Log Message:
Put the exe and it's parameters back together when needed.
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_apps.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -3 -r1.177 -r1.178
--- e_apps.c 6 Sep 2006 12:09:52 -0000 1.177
+++ e_apps.c 7 Sep 2006 08:53:09 -0000 1.178
@@ -473,6 +473,7 @@
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 @@
* 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_change(a2, E_APP_EXEC);
}
_e_app_change(a, E_APP_EXEC);
+ free(command);
return 1;
}
@@ -1213,11 +1231,13 @@
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 @@
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 @@
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 @@
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 @@
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;
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_apps.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- e_apps.h 5 Sep 2006 14:44:27 -0000 1.40
+++ e_apps.h 7 Sep 2006 08:53:09 -0000 1.41
@@ -31,12 +31,14 @@
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. */
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_eap_editor.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- e_eap_editor.c 6 Sep 2006 08:22:57 -0000 1.52
+++ e_eap_editor.c 7 Sep 2006 08:53:09 -0000 1.53
@@ -114,9 +114,13 @@
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 @@
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 @@
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 @@
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. */
- }
-
- /* 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;
+ _e_eap_edit_basic_apply_data(cfd, data);
- if ((eap->name) && (eap->exe))
- e_app_fields_save(eap);
return 1;
}
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_apps.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- e_int_config_apps.c 6 Sep 2006 08:44:30 -0000 1.20
+++ e_int_config_apps.c 7 Sep 2006 08:53:09 -0000 1.21
@@ -499,7 +499,7 @@
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);
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs