forked from enlightenment/enlightenment
And ecore_desktop is gone.
Eap Editor must still be fixed! SVN revision: 29147
This commit is contained in:
parent
dcaf8b369e
commit
13a6ad061d
|
@ -47,7 +47,6 @@ e_box.h \
|
|||
e_flowlayout.h \
|
||||
e_int_menus.h \
|
||||
e_module.h \
|
||||
e_apps.h \
|
||||
e_atoms.h \
|
||||
e_utils.h \
|
||||
e_canvas.h \
|
||||
|
@ -149,7 +148,6 @@ e_int_config_modules.h \
|
|||
e_exehist.h \
|
||||
e_color_class.h \
|
||||
e_widget_textblock.h \
|
||||
e_apps_error.h \
|
||||
e_stolen.h \
|
||||
e_gadcon.h \
|
||||
e_shelf.h \
|
||||
|
@ -212,7 +210,6 @@ e_box.c \
|
|||
e_flowlayout.c \
|
||||
e_int_menus.c \
|
||||
e_module.c \
|
||||
e_apps.c \
|
||||
e_atoms.c \
|
||||
e_utils.c \
|
||||
e_canvas.c \
|
||||
|
@ -314,7 +311,6 @@ e_int_config_modules.c \
|
|||
e_exehist.c \
|
||||
e_color_class.c \
|
||||
e_widget_textblock.c \
|
||||
e_apps_error.c \
|
||||
e_stolen.c \
|
||||
e_gadcon.c \
|
||||
e_shelf.c \
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
#include <Ecore_Job.h>
|
||||
#include <Ecore_Txt.h>
|
||||
#include <Ecore_Config.h>
|
||||
#include <Ecore_Desktop.h>
|
||||
#include <Ecore_File.h>
|
||||
#include <Ecore_X_Atoms.h>
|
||||
#include <Ecore_X_Cursor.h>
|
||||
|
|
3103
src/bin/e_apps.c
3103
src/bin/e_apps.c
File diff suppressed because it is too large
Load Diff
158
src/bin/e_apps.h
158
src/bin/e_apps.h
|
@ -1,158 +0,0 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef enum _E_App_Change
|
||||
{
|
||||
E_APP_ADD,
|
||||
E_APP_DEL,
|
||||
E_APP_CHANGE,
|
||||
E_APP_ORDER,
|
||||
E_APP_EXEC,
|
||||
E_APP_READY,
|
||||
E_APP_EXIT,
|
||||
E_APP_READY_EXPIRE
|
||||
} E_App_Change;
|
||||
|
||||
typedef enum _E_App_Icon_Type
|
||||
{
|
||||
E_APP_ICON_UNKNOWN,
|
||||
E_APP_ICON_NONE,
|
||||
E_APP_ICON_PATH,
|
||||
E_APP_ICON_CLASS,
|
||||
E_APP_ICON_GROUP,
|
||||
E_APP_ICON_FDO
|
||||
} E_App_Icon_Type;
|
||||
|
||||
|
||||
typedef struct _E_App E_App;
|
||||
typedef struct _E_App_Autopsy E_App_Autopsy;
|
||||
|
||||
#else
|
||||
#ifndef E_APPS_H
|
||||
#define E_APPS_H
|
||||
|
||||
#define E_APP_TYPE 0xE0b01001
|
||||
|
||||
struct _E_App
|
||||
{
|
||||
E_Object e_obj_inherit;
|
||||
|
||||
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 .desktop containing icons etc. etc. */
|
||||
|
||||
const char *win_name; /* window name */
|
||||
const char *win_class; /* window class */
|
||||
const char *win_title; /* window title */
|
||||
const char *win_role; /* window role */
|
||||
|
||||
const char *icon_class; /* icon_class */
|
||||
const char *icon_theme; /* FDO icon theme */
|
||||
const char *icon; /* FDO icon */
|
||||
const char *icon_path; /* icon path */
|
||||
time_t icon_time; /* For checking if the icon cache is valid. */
|
||||
E_App_Icon_Type icon_type;
|
||||
|
||||
Evas_List *subapps; /* if this a directory, a list of more E_App's */
|
||||
|
||||
Evas_List *instances; /* a list of all the exe handles for executions */
|
||||
|
||||
Evas_List *references; /* If this app is in a main repository, this would
|
||||
be a list to other eapp pointing to this */
|
||||
Ecore_File_Monitor *monitor; /* Check for changes and files */
|
||||
|
||||
unsigned char startup_notify : 1; /* disable while starting etc. */
|
||||
unsigned char wait_exit : 1; /* wait for app to exit before execing next */
|
||||
unsigned char starting : 1; /* this app is starting */
|
||||
|
||||
unsigned char scanned : 1; /* have we scanned a subdir app yet */
|
||||
|
||||
unsigned char deleted : 1; /* this app's file is deleted from disk */
|
||||
|
||||
unsigned char filled : 1; /* this app has had its data filled in */
|
||||
unsigned char dirty_icon : 1; /* this app's icon has been found, and the on disk cache needs to be updated. */
|
||||
unsigned char hard_icon : 1; /* this app's icon was hard coded into the .desktop files Icon field. */
|
||||
|
||||
unsigned char idle_fill : 1;
|
||||
unsigned char idle_icon : 1;
|
||||
|
||||
/* Actually calling this st_mtime causes compile issues, must be some strange macros at work. */
|
||||
time_t mtime; /* For checking if the cache is valid. */
|
||||
|
||||
/* used for eap edit */
|
||||
const char *image; /* used when we're saving a image into the eap */
|
||||
int width; /* used for saving eap's image width in edje */
|
||||
int height; /* used for saving eap's image height in edje */
|
||||
unsigned char tmpfile : 1;
|
||||
};
|
||||
|
||||
struct _E_App_Autopsy
|
||||
{
|
||||
E_App *app;
|
||||
|
||||
Ecore_Exe_Event_Del del;
|
||||
E_Config_Dialog *error_dialog;
|
||||
Ecore_Exe_Event_Data *error, *read;
|
||||
};
|
||||
|
||||
EAPI int e_app_init (void);
|
||||
EAPI int e_app_shutdown (void);
|
||||
|
||||
EAPI void e_app_unmonitor_all (void);
|
||||
|
||||
EAPI E_App *e_app_new (const char *path, int scan_subdirs);
|
||||
EAPI E_App *e_app_empty_new (const char *path);
|
||||
EAPI void e_app_image_size_set (E_App *a, int w, int h);
|
||||
EAPI int e_app_is_parent (E_App *parent, E_App *app);
|
||||
EAPI int e_app_equals (E_App *app1, E_App *app2);
|
||||
EAPI void e_app_subdir_scan (E_App *a, int scan_subdirs);
|
||||
EAPI int e_app_exec (E_Zone *zone, E_App *a, const char *exec, Ecore_List *files, const char *launch_method);
|
||||
EAPI int e_app_starting_get (E_App *a);
|
||||
EAPI int e_app_running_get (E_App *a);
|
||||
EAPI void e_app_list_prepend_relative (E_App *add, E_App *before);
|
||||
EAPI void e_app_list_append (E_App *add, E_App *parent);
|
||||
EAPI void e_app_files_list_prepend_relative (Evas_List *files, E_App *before);
|
||||
EAPI void e_app_files_list_append (Evas_List *files, E_App *parent);
|
||||
EAPI void e_app_prepend_relative (E_App *add, E_App *before);
|
||||
EAPI void e_app_append (E_App *add, E_App *parent);
|
||||
EAPI void e_app_files_prepend_relative (Evas_List *files, E_App *before);
|
||||
EAPI void e_app_files_append (Evas_List *files, E_App *parent);
|
||||
EAPI void e_app_remove (E_App *a);
|
||||
|
||||
EAPI void e_app_change_callback_add (void (*func) (void *data, E_App *a, E_App_Change ch), void *data);
|
||||
EAPI void e_app_change_callback_del (void (*func) (void *data, E_App *a, E_App_Change ch), void *data);
|
||||
|
||||
EAPI E_App *e_app_launch_id_pid_find (int launch_id, pid_t pid);
|
||||
EAPI E_App *e_app_border_find (E_Border *bd);
|
||||
EAPI E_App *e_app_file_find (const char *file);
|
||||
EAPI E_App *e_app_path_find (const char *path);
|
||||
EAPI E_App *e_app_name_find (const char *name);
|
||||
EAPI E_App *e_app_generic_find (const char *generic);
|
||||
EAPI E_App *e_app_exe_find (const char *exe);
|
||||
|
||||
EAPI Evas_List *e_app_name_glob_list (const char *name);
|
||||
EAPI Evas_List *e_app_generic_glob_list (const char *generic);
|
||||
EAPI Evas_List *e_app_exe_glob_list (const char *exe);
|
||||
EAPI Evas_List *e_app_comment_glob_list (const char *comment);
|
||||
EAPI Evas_List *e_app_mime_list (const char *mime);
|
||||
|
||||
EAPI void e_app_fields_fill (E_App *a, const char *path);
|
||||
EAPI void e_app_fields_save (E_App *a);
|
||||
EAPI Ecore_List *e_app_dir_file_list_get (E_App *a);
|
||||
EAPI void e_app_fields_empty (E_App *a);
|
||||
EAPI int e_app_valid_exe_get (E_App *a);
|
||||
EAPI Evas_Object *e_app_icon_add (E_App *a, Evas *evas);
|
||||
EAPI void e_app_icon_add_to_menu_item (E_App *a, E_Menu_Item *mi);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -1,435 +0,0 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#include "e.h"
|
||||
|
||||
#define MAX_OUTPUT_CHARACTERS 5000
|
||||
|
||||
struct _E_Config_Dialog_Data
|
||||
{
|
||||
char *label;
|
||||
char *exit;
|
||||
char *signal;
|
||||
};
|
||||
|
||||
/* Protos */
|
||||
static void *_create_data(E_Config_Dialog *cfd);
|
||||
static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *_dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *lines);
|
||||
static void _dialog_save_cb(void *data, void *data2);
|
||||
#if 0
|
||||
static void _dialog_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
#endif
|
||||
|
||||
EAPI void
|
||||
e_app_error_dialog(E_Container *con, E_App_Autopsy *app)
|
||||
{
|
||||
E_Config_Dialog *cfd;
|
||||
E_Config_Dialog_View *v;
|
||||
|
||||
v = E_NEW(E_Config_Dialog_View, 1);
|
||||
if (v)
|
||||
{
|
||||
v->create_cfdata = _create_data;
|
||||
v->free_cfdata = _free_data;
|
||||
v->basic.create_widgets = _basic_create_widgets;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
|
||||
/* Create The Dialog */
|
||||
cfd = e_config_dialog_new(con, _("Application Execution Error"),
|
||||
"E", "_app_exec_error_exit_dialog",
|
||||
NULL, 0, v, app);
|
||||
app->error_dialog = cfd;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_fill_data(E_App_Autopsy *app, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
char buf[4096];
|
||||
|
||||
if (!cfdata->label)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), _("%s stopped running unexpectedly."), app->app->name);
|
||||
cfdata->label = strdup(buf);
|
||||
}
|
||||
if ((app->del.exited) && (!cfdata->exit))
|
||||
{
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("An exit code of %i was returned from %s."), app->del.exit_code, app->app->exe);
|
||||
cfdata->exit = strdup(buf);
|
||||
}
|
||||
if ((app->del.signalled) && (!cfdata->signal))
|
||||
{
|
||||
if (app->del.exit_signal == SIGINT)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by an Interrupt Signal."), app->app->exe);
|
||||
else if (app->del.exit_signal == SIGQUIT)
|
||||
snprintf(buf, sizeof(buf), _("%s was interrupted by a Quit Signal."),
|
||||
app->app->exe);
|
||||
else if (app->del.exit_signal == SIGABRT)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by an Abort Signal."), app->app->exe);
|
||||
else if (app->del.exit_signal == SIGFPE)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Floating Point Error."), app->app->exe);
|
||||
else if (app->del.exit_signal == SIGKILL)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by an Uninterruptable Kill Signal."), app->app->exe);
|
||||
else if (app->del.exit_signal == SIGSEGV)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Segmentation Fault."), app->app->exe);
|
||||
else if (app->del.exit_signal == SIGPIPE)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Broken Pipe."), app->app->exe);
|
||||
else if (app->del.exit_signal == SIGTERM)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Termination Signal."), app->app->exe);
|
||||
else if (app->del.exit_signal == SIGBUS)
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by a Bus Error."), app->app->exe);
|
||||
else
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("%s was interrupted by the signal number %i."),
|
||||
app->app->exe, app->del.exit_signal);
|
||||
cfdata->signal = strdup(buf);
|
||||
/* FIXME: Add sigchld_info stuff
|
||||
* app->del.data
|
||||
* siginfo_t
|
||||
* {
|
||||
* int si_signo; Signal number
|
||||
* int si_errno; An errno value
|
||||
* int si_code; Signal code
|
||||
* pid_t si_pid; Sending process ID
|
||||
* uid_t si_uid; Real user ID of sending process
|
||||
* int si_status; Exit value or signal
|
||||
* clock_t si_utime; User time consumed
|
||||
* clock_t si_stime; System time consumed
|
||||
* sigval_t si_value; Signal value
|
||||
* int si_int; POSIX.1b signal
|
||||
* void * si_ptr; POSIX.1b signal
|
||||
* void * si_addr; Memory location which caused fault
|
||||
* int si_band; Band event
|
||||
* int si_fd; File descriptor
|
||||
* }
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
_create_data(E_Config_Dialog *cfd)
|
||||
{
|
||||
E_Config_Dialog_Data *cfdata;
|
||||
E_App_Autopsy *app;
|
||||
|
||||
app = cfd->data;
|
||||
cfdata = E_NEW(E_Config_Dialog_Data, 1);
|
||||
_fill_data(app, cfdata);
|
||||
return cfdata;
|
||||
}
|
||||
|
||||
static void
|
||||
_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
E_App_Autopsy *app;
|
||||
|
||||
app = cfd->data;
|
||||
|
||||
if (app)
|
||||
{
|
||||
app->error_dialog = NULL;
|
||||
if (app->error)
|
||||
ecore_exe_event_data_free(app->error);
|
||||
if (app->read)
|
||||
ecore_exe_event_data_free(app->read);
|
||||
free(app);
|
||||
}
|
||||
E_FREE(cfdata->signal);
|
||||
E_FREE(cfdata->exit);
|
||||
E_FREE(cfdata->label);
|
||||
|
||||
free(cfdata);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
_dialog_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Coord mw, mh, vw, vh, w, h;
|
||||
|
||||
e_scrollframe_child_viewport_size_get(obj, &vw, &vh);
|
||||
e_widget_min_size_get(data, &mw, &mh);
|
||||
evas_object_geometry_get(data, NULL, NULL, &w, &h);
|
||||
if (vw >= mw)
|
||||
{
|
||||
if (w != vw)
|
||||
evas_object_resize(data, vw, h);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static Evas_Object *
|
||||
_dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *lines)
|
||||
{
|
||||
int i;
|
||||
Evas_Object *obj, *os;
|
||||
char *text;
|
||||
char *trunc_note = _("***The remaining output has been truncated. Save the output to view.***\n");
|
||||
int tlen, max_lines;
|
||||
|
||||
os = e_widget_framelist_add(evas, _(title), 0);
|
||||
|
||||
obj = e_widget_textblock_add(evas);
|
||||
|
||||
tlen = 0;
|
||||
for (i = 0; lines[i].line != NULL; i++)
|
||||
{
|
||||
tlen += lines[i].size + 1;
|
||||
/* When the program output is extraordinarily long, it can cause
|
||||
* significant delays during text rendering. Limit to a fixed
|
||||
* number of characters. */
|
||||
if (tlen > MAX_OUTPUT_CHARACTERS)
|
||||
{
|
||||
tlen -= lines[i].size + 1;
|
||||
tlen += strlen(trunc_note);
|
||||
break;
|
||||
}
|
||||
}
|
||||
max_lines = i;
|
||||
text = alloca(tlen + 1);
|
||||
|
||||
if (text)
|
||||
{
|
||||
text[0] = 0;
|
||||
for (i = 0; i < max_lines; i++)
|
||||
{
|
||||
strcat(text, lines[i].line);
|
||||
strcat(text, "\n");
|
||||
}
|
||||
|
||||
/* Append the warning about truncated output. */
|
||||
if (lines[max_lines].line != NULL)
|
||||
strcat(text, trunc_note);
|
||||
|
||||
e_widget_textblock_plain_set(obj, text);
|
||||
}
|
||||
e_widget_min_size_set(obj, 240, 120);
|
||||
|
||||
e_widget_framelist_object_append(os, obj);
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
char buf[4096];
|
||||
int error_length = 0;
|
||||
Evas_Object *o, *ob, *os;
|
||||
E_App_Autopsy *app;
|
||||
|
||||
app = cfd->data;
|
||||
_fill_data(app, cfdata);
|
||||
|
||||
o = e_widget_list_add(evas, 0, 0);
|
||||
|
||||
ob = e_widget_label_add(evas, cfdata->label);
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
|
||||
if (app->error)
|
||||
error_length = app->error->size;
|
||||
if (error_length)
|
||||
{
|
||||
os = _dialog_scrolltext_create(evas, _("Error Logs"), app->error->lines);
|
||||
e_widget_list_object_append(o, os, 1, 1, 0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
ob = e_widget_label_add(evas, _("There was no error message."));
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
}
|
||||
|
||||
ob = e_widget_button_add(evas, _("Save This Message"), "enlightenment/run",
|
||||
_dialog_save_cb, app, cfdata);
|
||||
e_widget_list_object_append(o, ob, 0, 0, 0.5);
|
||||
|
||||
snprintf(buf, sizeof(buf), _("This error log will be saved as %s/%s.log"),
|
||||
e_user_homedir_get(), app->app->name);
|
||||
ob = e_widget_label_add(evas, buf);
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
char buf[4096];
|
||||
int read_length = 0;
|
||||
int error_length = 0;
|
||||
Evas_Object *o, *of, *ob, *ot;
|
||||
E_App_Autopsy *app;
|
||||
|
||||
app = cfd->data;
|
||||
_fill_data(app, cfdata);
|
||||
|
||||
o = e_widget_list_add(evas, 0, 0);
|
||||
ot = e_widget_table_add(evas, 0);
|
||||
|
||||
ob = e_widget_label_add(evas, cfdata->label);
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
|
||||
if (cfdata->exit)
|
||||
{
|
||||
of = e_widget_framelist_add(evas, _("Error Information"), 0);
|
||||
ob = e_widget_label_add(evas, _(cfdata->exit));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
}
|
||||
|
||||
if (cfdata->signal)
|
||||
{
|
||||
of = e_widget_framelist_add(evas, _("Error Signal Information"), 0);
|
||||
ob = e_widget_label_add(evas, _(cfdata->signal));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
}
|
||||
|
||||
if (app->read)
|
||||
read_length = app->read->size;
|
||||
|
||||
if (read_length)
|
||||
{
|
||||
of = _dialog_scrolltext_create(evas, _("Output Data"), app->read->lines);
|
||||
/* FIXME: Add stdout "start". */
|
||||
/* FIXME: Add stdout "end". */
|
||||
}
|
||||
else
|
||||
{
|
||||
of = e_widget_framelist_add(evas, _("Output Data"), 0);
|
||||
ob = e_widget_label_add(evas, _("There was no output."));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
}
|
||||
e_widget_table_object_append(ot, of, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||
|
||||
if (app->error)
|
||||
error_length = app->error->size;
|
||||
if (error_length)
|
||||
{
|
||||
of = _dialog_scrolltext_create(evas, _("Error Logs"), app->error->lines);
|
||||
/* FIXME: Add stderr "start". */
|
||||
/* FIXME: Add stderr "end". */
|
||||
}
|
||||
else
|
||||
{
|
||||
of = e_widget_framelist_add(evas, _("Error Logs"), 0);
|
||||
ob = e_widget_label_add(evas, _("There was no error message."));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
}
|
||||
e_widget_table_object_append(ot, of, 1, 0, 1, 1, 1, 1, 1, 1);
|
||||
|
||||
e_widget_list_object_append(o, ot, 1, 1, 0.5);
|
||||
|
||||
ob = e_widget_button_add(evas, _("Save This Message"), "enlightenment/run", _dialog_save_cb, app, cfdata);
|
||||
e_widget_list_object_append(o, ob, 0, 0, 0.5);
|
||||
|
||||
snprintf(buf, sizeof(buf), _("This error log will be saved as %s/%s.log"),
|
||||
e_user_homedir_get(), app->app->name);
|
||||
ob = e_widget_label_add(evas, buf);
|
||||
e_widget_list_object_append(o, ob, 1, 1, 0.5);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
static void
|
||||
_dialog_save_cb(void *data, void *data2)
|
||||
{
|
||||
E_App_Autopsy *app;
|
||||
E_Config_Dialog_Data *cfdata;
|
||||
FILE *f;
|
||||
char *text;
|
||||
char buf[1024];
|
||||
char buffer[4096];
|
||||
int read_length = 0;
|
||||
int i, tlen;
|
||||
|
||||
app = data;
|
||||
cfdata = data2;
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/%s.log", e_user_homedir_get(), app->app->name);
|
||||
f = fopen(buf, "w");
|
||||
if (!f) return;
|
||||
|
||||
if (cfdata->exit)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "Error Information:\n\t%s\n\n", cfdata->exit);
|
||||
fwrite(buffer, sizeof(char), strlen(buffer), f);
|
||||
}
|
||||
if (cfdata->signal)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "Error Signal Information:\n\t%s\n\n", cfdata->signal);
|
||||
fwrite(buffer, sizeof(char), strlen(buffer), f);
|
||||
}
|
||||
|
||||
if (app->read)
|
||||
read_length = app->read->size;
|
||||
|
||||
if (read_length)
|
||||
{
|
||||
tlen = 0;
|
||||
for (i = 0; app->read->lines[i].line != NULL; i++)
|
||||
tlen += app->read->lines[i].size + 2;
|
||||
text = alloca(tlen + 1);
|
||||
if (text)
|
||||
{
|
||||
text[0] = 0;
|
||||
for (i = 0; app->read->lines[i].line != NULL; i++)
|
||||
{
|
||||
strcat(text, "\t");
|
||||
strcat(text, app->read->lines[i].line);
|
||||
strcat(text, "\n");
|
||||
}
|
||||
snprintf(buffer, sizeof(buffer), "Output Data:\n%s\n\n", text);
|
||||
fwrite(buffer, sizeof(char), strlen(buffer), f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "Output Data:\n\tThere was no output\n\n");
|
||||
fwrite(buffer, sizeof(char), strlen(buffer), f);
|
||||
}
|
||||
|
||||
/* Reusing this var */
|
||||
read_length = 0;
|
||||
if (app->error)
|
||||
read_length = app->error->size;
|
||||
|
||||
if (read_length)
|
||||
{
|
||||
tlen = 0;
|
||||
for (i = 0; app->error->lines[i].line != NULL; i++)
|
||||
tlen += app->error->lines[i].size + 1;
|
||||
text = alloca(tlen + 1);
|
||||
if (text)
|
||||
{
|
||||
text[0] = 0;
|
||||
for (i = 0; app->error->lines[i].line != NULL; i++)
|
||||
{
|
||||
strcat(text, "\t");
|
||||
strcat(text, app->error->lines[i].line);
|
||||
strcat(text, "\n");
|
||||
}
|
||||
snprintf(buffer, sizeof(buffer), "Error Logs:\n%s\n", text);
|
||||
fwrite(buffer, sizeof(char), strlen(buffer), f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "Error Logs:\n\tThere was no error message\n");
|
||||
fwrite(buffer, sizeof(char), strlen(buffer), f);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#ifdef E_TYPEDEFS
|
||||
|
||||
#else
|
||||
#ifndef E_APPS_ERROR_H
|
||||
#define E_APPS_ERROR_H
|
||||
|
||||
EAPI void e_app_error_dialog(E_Container * con, E_App_Autopsy * app);
|
||||
|
||||
#endif
|
||||
#endif
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#if 0
|
||||
#include "e.h"
|
||||
|
||||
struct _E_Config_Dialog_Data
|
||||
|
@ -588,3 +589,4 @@ _e_eap_editor_icon_show(E_Config_Dialog_Data *cfdata)
|
|||
cfdata->eap.icon_type = E_APP_ICON_UNKNOWN;
|
||||
cfdata->editor->img = e_app_icon_add(&(cfdata->eap), cfdata->editor->evas);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
||||
*/
|
||||
#if 0
|
||||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef struct _E_App_Edit E_App_Edit;
|
||||
|
@ -31,3 +32,4 @@ EAPI E_App_Edit *e_eap_edit_show(E_Container *con, E_App *a);
|
|||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "e_init.h"
|
||||
#include "e_int_menus.h"
|
||||
#include "e_module.h"
|
||||
#include "e_apps.h"
|
||||
#include "e_atoms.h"
|
||||
#include "e_utils.h"
|
||||
#include "e_canvas.h"
|
||||
|
@ -121,7 +120,6 @@
|
|||
#include "e_exehist.h"
|
||||
#include "e_color_class.h"
|
||||
#include "e_widget_textblock.h"
|
||||
#include "e_apps_error.h"
|
||||
#include "e_stolen.h"
|
||||
#include "e_gadcon.h"
|
||||
#include "e_shelf.h"
|
||||
|
|
|
@ -35,14 +35,18 @@ struct _E_Config_Dialog_Data
|
|||
Evas_Object *o_up_button;
|
||||
Evas_Object *o_up_all_button;
|
||||
Evas_Object *o_add_button;
|
||||
#if 0
|
||||
Evas_Object *o_create_button;
|
||||
#endif
|
||||
Evas_Object *o_delete_left_button;
|
||||
Evas_Object *o_delete_right_button;
|
||||
Evas_Object *o_regen_button;
|
||||
Evas_Object *o_move_up_button;
|
||||
Evas_Object *o_move_down_button;
|
||||
} gui;
|
||||
#if 0
|
||||
E_App_Edit *editor;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct _E_Config_Once
|
||||
|
@ -311,6 +315,7 @@ _cb_files_changed(void *data, Evas_Object *obj, void *event_info)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
_cb_editor_del(void *obj)
|
||||
{
|
||||
|
@ -323,7 +328,9 @@ _cb_editor_del(void *obj)
|
|||
// e_fm2_refresh(cfdata->gui.o_fm);
|
||||
// e_fm2_refresh(cfdata->gui.o_fm_all);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static void
|
||||
_cb_button_create(void *data1, void *data2)
|
||||
{
|
||||
|
@ -401,6 +408,7 @@ _cb_files_selected_all2(void *data, Evas_Object *obj, void *event_info)
|
|||
e_object_del_attach_func_set(E_OBJECT(cfdata->editor), _cb_editor_del);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
_cb_files_selection_change_all(void *data, Evas_Object *obj, void *event_info)
|
||||
|
@ -420,6 +428,7 @@ _cb_files_changed_all(void *data, Evas_Object *obj, void *event_info)
|
|||
e_widget_disabled_set(cfdata->gui.o_add_button, 1);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
_cb_files_edited(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||
{
|
||||
|
@ -466,6 +475,7 @@ _cb_files_add_edited(void *data, Evas_Object *obj, E_Menu *m, E_Fm2_Icon_Info *i
|
|||
e_menu_item_label_set(mi, _("Edit Application"));
|
||||
e_menu_item_callback_set(mi, _cb_files_edited, cfdata);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
_cb_files_sorted_changed(void *data, Evas_Object *obj, void *event_info)
|
||||
|
@ -622,13 +632,17 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
e_fm2_icon_menu_flags_set(mt, E_FM2_MENU_NO_SHOW_HIDDEN);
|
||||
evas_object_smart_callback_add(mt, "dir_changed",
|
||||
_cb_files_dir_changed_all, cfdata);
|
||||
#if 0
|
||||
evas_object_smart_callback_add(mt, "selected",
|
||||
_cb_files_selected_all, cfdata);
|
||||
#endif
|
||||
evas_object_smart_callback_add(mt, "selection_change",
|
||||
_cb_files_selection_change_all, cfdata);
|
||||
evas_object_smart_callback_add(mt, "changed",
|
||||
_cb_files_changed_all, cfdata);
|
||||
#if 0
|
||||
e_fm2_icon_menu_start_extend_callback_set(mt, _cb_files_add_edited, cfdata);
|
||||
#endif
|
||||
e_fm2_path_set(cfdata->gui.o_fm_all, cfdata->path_all, "/");
|
||||
e_fm2_window_object_set(mt, E_OBJECT(cfd->dia->win));
|
||||
ob = e_widget_scrollframe_pan_add(evas, mt,
|
||||
|
@ -667,10 +681,12 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
e_widget_disabled_set(mt, 1);
|
||||
}
|
||||
|
||||
#if 0
|
||||
mt = e_widget_button_add(evas, _("Create a new Application"), "enlightenment/e",
|
||||
_cb_button_create, cfdata, NULL);
|
||||
cfdata->gui.o_create_button = mt;
|
||||
e_widget_framelist_object_append(of, mt);
|
||||
#endif
|
||||
|
||||
e_widget_table_object_append(ot, of, 0, 0, 2, 4, 1, 1, 1, 1);
|
||||
|
||||
|
@ -711,13 +727,17 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
e_fm2_icon_menu_flags_set(mt, E_FM2_MENU_NO_SHOW_HIDDEN);
|
||||
evas_object_smart_callback_add(mt, "dir_changed",
|
||||
_cb_files_dir_changed, cfdata);
|
||||
#if 0
|
||||
evas_object_smart_callback_add(mt, "selected",
|
||||
_cb_files_selected_all2, cfdata);
|
||||
#endif
|
||||
evas_object_smart_callback_add(mt, "selection_change",
|
||||
_cb_files_selection_change, cfdata);
|
||||
evas_object_smart_callback_add(mt, "changed",
|
||||
_cb_files_changed, cfdata);
|
||||
#if 0
|
||||
e_fm2_icon_menu_start_extend_callback_set(mt, _cb_files_add_edited, cfdata);
|
||||
#endif
|
||||
if ((once) && (once->path))
|
||||
e_fm2_path_set(cfdata->gui.o_fm, once->path, "/");
|
||||
else
|
||||
|
|
|
@ -928,32 +928,6 @@ break;
|
|||
* E_LIB_IN
|
||||
* ...
|
||||
*/
|
||||
/****************************************************************************/
|
||||
#define HDL E_IPC_EAP_EDIT_START
|
||||
#if (TYPE == E_REMOTE_OPTIONS)
|
||||
OP("-start-eap-edit", 1, "Starts the Eap editor on the eap 'OPT1'", 0, HDL)
|
||||
#elif (TYPE == E_REMOTE_OUT)
|
||||
REQ_STRING(params[0], HDL);
|
||||
#elif (TYPE == E_WM_IN)
|
||||
STRING(s, HDL);
|
||||
E_App *a;
|
||||
if (ecore_file_exists(s))
|
||||
{
|
||||
a = e_app_new(s, 0);
|
||||
if (a)
|
||||
e_eap_edit_show(e_container_current_get(e_manager_current_get()), a);
|
||||
}
|
||||
else
|
||||
{
|
||||
a = e_app_empty_new(s);
|
||||
if (a)
|
||||
e_eap_edit_show(e_container_current_get(e_manager_current_get()), a);
|
||||
}
|
||||
END_STRING(s);
|
||||
#elif (TYPE == E_REMOTE_IN)
|
||||
#endif
|
||||
#undef HDL
|
||||
|
||||
/****************************************************************************/
|
||||
#define HDL E_IPC_OP_MODULE_LOAD
|
||||
#if (TYPE == E_REMOTE_OPTIONS)
|
||||
|
|
|
@ -355,8 +355,6 @@
|
|||
#define E_IPC_OP_CACHE_FLUSH_INTERVAL_GET 331
|
||||
#define E_IPC_OP_CACHE_FLUSH_INTERVAL_GET_REPLY 332
|
||||
|
||||
#define E_IPC_EAP_EDIT_START 333
|
||||
|
||||
#define E_IPC_OP_COLOR_CLASS_COLOR_SET 334
|
||||
#define E_IPC_OP_COLOR_CLASS_COLOR2_SET 335
|
||||
#define E_IPC_OP_COLOR_CLASS_COLOR3_SET 336
|
||||
|
|
|
@ -445,26 +445,6 @@ main(int argc, char **argv)
|
|||
efreet_icon_extension_add(".edj");
|
||||
TS("efreet paths done");
|
||||
|
||||
TS("ecore_desktop");
|
||||
/* init FDO desktop */
|
||||
if (!ecore_desktop_init())
|
||||
{
|
||||
e_error_message_show(_("Enlightenment cannot initialize the FDO desktop system.\n"
|
||||
"Perhaps you are out of memory?"));
|
||||
_e_main_shutdown(-1);
|
||||
}
|
||||
_e_main_shutdown_push(ecore_desktop_shutdown);
|
||||
TS("ecore_desktop done");
|
||||
|
||||
TS("ecore_desktop paths");
|
||||
ecore_desktop_paths_extras_clear();
|
||||
ecore_desktop_paths_prepend_user(ECORE_DESKTOP_PATHS_ICONS, "~/.e/e/icons");
|
||||
snprintf(buf, sizeof(buf), "%s/data/icons", e_prefix_data_get());
|
||||
ecore_desktop_paths_append_system(ECORE_DESKTOP_PATHS_ICONS, buf);
|
||||
ecore_desktop_paths_regen();
|
||||
|
||||
TS("ecore_desktop paths done");
|
||||
|
||||
TS("ecore_evas init");
|
||||
/* init the evas wrapper */
|
||||
if (!ecore_evas_init())
|
||||
|
@ -673,14 +653,6 @@ main(int argc, char **argv)
|
|||
_e_main_shutdown(-1);
|
||||
}
|
||||
_e_main_shutdown_push(_e_main_screens_shutdown);
|
||||
TS("apps");
|
||||
/* init app system */
|
||||
if (!e_app_init())
|
||||
{
|
||||
e_error_message_show(_("Enlightenment cannot set up its app system."));
|
||||
_e_main_shutdown(-1);
|
||||
}
|
||||
_e_main_shutdown_push(e_app_shutdown);
|
||||
TS("exec");
|
||||
/* init app system */
|
||||
if (!e_exec_init())
|
||||
|
@ -904,7 +876,6 @@ main(int argc, char **argv)
|
|||
if (restart)
|
||||
{
|
||||
/* selected shutdown */
|
||||
e_app_unmonitor_all();
|
||||
e_ipc_shutdown();
|
||||
ecore_file_shutdown();
|
||||
e_util_env_set("E_RESTART_OK", "1");
|
||||
|
|
Loading…
Reference in New Issue