config to turn off exec fail dialog

SVN revision: 45544
This commit is contained in:
Carsten Haitzler 2010-01-25 07:38:48 +00:00
parent 370822b80f
commit ca49f2dcbf
3 changed files with 65 additions and 44 deletions

View File

@ -743,6 +743,10 @@ e_config_init(void)
E_CONFIG_VAL(D, T, mode.presentation, UCHAR); E_CONFIG_VAL(D, T, mode.presentation, UCHAR);
E_CONFIG_VAL(D, T, mode.offline, UCHAR); E_CONFIG_VAL(D, T, mode.offline, UCHAR);
E_CONFIG_VAL(D, T, exec.expire_timeout, DOUBLE);
E_CONFIG_VAL(D, T, exec.show_run_dialog, UCHAR);
E_CONFIG_VAL(D, T, exec.show_exit_dialog, UCHAR);
e_config_load(); e_config_load();
e_config_save_queue(); e_config_save_queue();
@ -965,11 +969,6 @@ e_config_load(void)
COPYVAL(desklock_ask_presentation_timeout); COPYVAL(desklock_ask_presentation_timeout);
COPYVAL(screensaver_ask_presentation); COPYVAL(screensaver_ask_presentation);
COPYVAL(screensaver_ask_presentation_timeout); COPYVAL(screensaver_ask_presentation_timeout);
IFCFGELSE;
e_config->desklock_ask_presentation = 1;
e_config->desklock_ask_presentation_timeout = 30.0;
e_config->screensaver_ask_presentation = 1;
e_config->screensaver_ask_presentation_timeout = 30.0;
IFCFGEND; IFCFGEND;
IFCFG(0x0133); IFCFG(0x0133);
@ -978,6 +977,12 @@ e_config_load(void)
COPYVAL(desk_flip_pan_y_axis_factor); COPYVAL(desk_flip_pan_y_axis_factor);
IFCFGEND; IFCFGEND;
IFCFG(0x0134);
COPYVAL(exec.expire_timeout);
COPYVAL(exec.show_run_dialog);
COPYVAL(exec.show_exit_dialog);
IFCFGEND;
e_config->config_version = E_CONFIG_FILE_VERSION; e_config->config_version = E_CONFIG_FILE_VERSION;
_e_config_free(tcfg); _e_config_free(tcfg);
} }
@ -1123,6 +1128,10 @@ e_config_load(void)
E_CONFIG_LIMIT(e_config->mode.presentation, 0, 1); E_CONFIG_LIMIT(e_config->mode.presentation, 0, 1);
E_CONFIG_LIMIT(e_config->mode.offline, 0, 1); E_CONFIG_LIMIT(e_config->mode.offline, 0, 1);
E_CONFIG_LIMIT(e_config->exec.expire_timeout, 0.1, 1000);
E_CONFIG_LIMIT(e_config->exec.show_run_dialog, 0, 1);
E_CONFIG_LIMIT(e_config->exec.show_exit_dialog, 0, 1);
/* FIXME: disabled auto apply because it causes problems */ /* FIXME: disabled auto apply because it causes problems */
e_config->cfgdlg_auto_apply = 0; e_config->cfgdlg_auto_apply = 0;
/* FIXME: desklock personalized password id disabled for security reasons */ /* FIXME: desklock personalized password id disabled for security reasons */

View File

@ -35,7 +35,7 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
/* increment this whenever a new set of config values are added but the users /* increment this whenever a new set of config values are added but the users
* config doesn't need to be wiped - simply new values need to be put in * config doesn't need to be wiped - simply new values need to be put in
*/ */
#define E_CONFIG_FILE_GENERATION 0x0133 #define E_CONFIG_FILE_GENERATION 0x0134
#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION) #define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH << 16) | E_CONFIG_FILE_GENERATION)
#define E_EVAS_ENGINE_DEFAULT 0 #define E_EVAS_ENGINE_DEFAULT 0
@ -346,6 +346,12 @@ struct _E_Config
Eina_Bool presentation; Eina_Bool presentation;
Eina_Bool offline; Eina_Bool offline;
} mode; } mode;
struct {
double expire_timeout;
Eina_Bool show_run_dialog;
Eina_Bool show_exit_dialog;
} exec;
}; };
struct _E_Config_Syscon_Action struct _E_Config_Syscon_Action

View File

@ -248,7 +248,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
inst->exe = exe; inst->exe = exe;
inst->startup_id = startup_id; inst->startup_id = startup_id;
inst->launch_time = ecore_time_get(); inst->launch_time = ecore_time_get();
inst->expire_timer = ecore_timer_add(10.0, inst->expire_timer = ecore_timer_add(e_config->exec.expire_timeout,
_e_exec_cb_expire_timer, inst); _e_exec_cb_expire_timer, inst);
l = eina_hash_find(e_exec_instances, desktop->orig_path); l = eina_hash_find(e_exec_instances, desktop->orig_path);
@ -345,52 +345,58 @@ _e_exec_cb_exit(void *data, int type, void *event)
if ((ev->exited) && if ((ev->exited) &&
((ev->exit_code == 127) || (ev->exit_code == 255))) ((ev->exit_code == 127) || (ev->exit_code == 255)))
{ {
E_Dialog *dia; if (e_config->exec.show_run_dialog)
{
dia = e_dialog_new(e_container_current_get(e_manager_current_get()), E_Dialog *dia;
"E", "_e_exec_run_error_dialog");
if (dia) dia = e_dialog_new(e_container_current_get(e_manager_current_get()),
{ "E", "_e_exec_run_error_dialog");
char buf[4096]; if (dia)
{
e_dialog_title_set(dia, _("Application run error")); char buf[4096];
snprintf(buf, sizeof(buf),
_("Enlightenment was unable to run the application:<br>" e_dialog_title_set(dia, _("Application run error"));
"<br>" snprintf(buf, sizeof(buf),
"%s<br>" _("Enlightenment was unable to run the application:<br>"
"<br>" "<br>"
"The application failed to start."), "%s<br>"
ecore_exe_cmd_get(ev->exe)); "<br>"
e_dialog_text_set(dia, buf); "The application failed to start."),
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL); ecore_exe_cmd_get(ev->exe));
e_dialog_button_focus_num(dia, 1); e_dialog_text_set(dia, buf);
e_win_centered_set(dia->win, 1); e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
e_dialog_show(dia); e_dialog_button_focus_num(dia, 1);
} e_win_centered_set(dia->win, 1);
e_dialog_show(dia);
}
}
} }
/* Let's hope that everything returns this properly. */ /* Let's hope that everything returns this properly. */
else if (!((ev->exited) && (ev->exit_code == EXIT_SUCCESS))) else if (!((ev->exited) && (ev->exit_code == EXIT_SUCCESS)))
{ {
/* filter out common exits via signals - int/term/quit. not really if (e_config->exec.show_exit_dialog)
* worth popping up a dialog for */ {
if (!((ev->signalled) && /* filter out common exits via signals - int/term/quit. not really
((ev->exit_signal == SIGINT) || * worth popping up a dialog for */
(ev->exit_signal == SIGQUIT) || if (!((ev->signalled) &&
(ev->exit_signal == SIGTERM))) ((ev->exit_signal == SIGINT) ||
) (ev->exit_signal == SIGQUIT) ||
{ (ev->exit_signal == SIGTERM)))
/* Show the error dialog with details from the exe. */ )
_e_exec_error_dialog(inst->desktop, ecore_exe_cmd_get(ev->exe), ev, {
ecore_exe_event_data_get(ev->exe, ECORE_EXE_PIPE_ERROR), /* Show the error dialog with details from the exe. */
ecore_exe_event_data_get(ev->exe, ECORE_EXE_PIPE_READ)); _e_exec_error_dialog(inst->desktop, ecore_exe_cmd_get(ev->exe), ev,
} ecore_exe_event_data_get(ev->exe, ECORE_EXE_PIPE_ERROR),
ecore_exe_event_data_get(ev->exe, ECORE_EXE_PIPE_READ));
}
}
} }
/* maybe better 1 minute? it might be openoffice */ /* maybe better 1 minute? it might be openoffice */
if (ecore_time_get() - inst->launch_time < 5.0) if (ecore_time_get() - inst->launch_time < 2.0)
{ {
if (inst->expire_timer) ecore_timer_del(inst->expire_timer); if (inst->expire_timer) ecore_timer_del(inst->expire_timer);
inst->expire_timer = ecore_timer_add(30.0, _e_exec_cb_instance_finish, inst); inst->expire_timer = ecore_timer_add(e_config->exec.expire_timeout, _e_exec_cb_instance_finish, inst);
} }
else else
_e_exec_instance_free(inst); _e_exec_instance_free(inst);