forked from enlightenment/enlightenment
parent
370822b80f
commit
ca49f2dcbf
|
@ -743,6 +743,10 @@ e_config_init(void)
|
|||
E_CONFIG_VAL(D, T, mode.presentation, 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_save_queue();
|
||||
|
@ -965,11 +969,6 @@ e_config_load(void)
|
|||
COPYVAL(desklock_ask_presentation_timeout);
|
||||
COPYVAL(screensaver_ask_presentation);
|
||||
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;
|
||||
|
||||
IFCFG(0x0133);
|
||||
|
@ -978,6 +977,12 @@ e_config_load(void)
|
|||
COPYVAL(desk_flip_pan_y_axis_factor);
|
||||
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_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.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 */
|
||||
e_config->cfgdlg_auto_apply = 0;
|
||||
/* FIXME: desklock personalized password id disabled for security reasons */
|
||||
|
|
|
@ -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
|
||||
* 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_EVAS_ENGINE_DEFAULT 0
|
||||
|
@ -346,6 +346,12 @@ struct _E_Config
|
|||
Eina_Bool presentation;
|
||||
Eina_Bool offline;
|
||||
} mode;
|
||||
|
||||
struct {
|
||||
double expire_timeout;
|
||||
Eina_Bool show_run_dialog;
|
||||
Eina_Bool show_exit_dialog;
|
||||
} exec;
|
||||
};
|
||||
|
||||
struct _E_Config_Syscon_Action
|
||||
|
|
|
@ -248,7 +248,7 @@ _e_exec_cb_exec(void *data, Efreet_Desktop *desktop, char *exec, int remaining)
|
|||
inst->exe = exe;
|
||||
inst->startup_id = startup_id;
|
||||
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);
|
||||
|
||||
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) &&
|
||||
((ev->exit_code == 127) || (ev->exit_code == 255)))
|
||||
{
|
||||
E_Dialog *dia;
|
||||
|
||||
dia = e_dialog_new(e_container_current_get(e_manager_current_get()),
|
||||
"E", "_e_exec_run_error_dialog");
|
||||
if (dia)
|
||||
{
|
||||
char buf[4096];
|
||||
|
||||
e_dialog_title_set(dia, _("Application run error"));
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("Enlightenment was unable to run the application:<br>"
|
||||
"<br>"
|
||||
"%s<br>"
|
||||
"<br>"
|
||||
"The application failed to start."),
|
||||
ecore_exe_cmd_get(ev->exe));
|
||||
e_dialog_text_set(dia, buf);
|
||||
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
|
||||
e_dialog_button_focus_num(dia, 1);
|
||||
e_win_centered_set(dia->win, 1);
|
||||
e_dialog_show(dia);
|
||||
}
|
||||
if (e_config->exec.show_run_dialog)
|
||||
{
|
||||
E_Dialog *dia;
|
||||
|
||||
dia = e_dialog_new(e_container_current_get(e_manager_current_get()),
|
||||
"E", "_e_exec_run_error_dialog");
|
||||
if (dia)
|
||||
{
|
||||
char buf[4096];
|
||||
|
||||
e_dialog_title_set(dia, _("Application run error"));
|
||||
snprintf(buf, sizeof(buf),
|
||||
_("Enlightenment was unable to run the application:<br>"
|
||||
"<br>"
|
||||
"%s<br>"
|
||||
"<br>"
|
||||
"The application failed to start."),
|
||||
ecore_exe_cmd_get(ev->exe));
|
||||
e_dialog_text_set(dia, buf);
|
||||
e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL);
|
||||
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. */
|
||||
else if (!((ev->exited) && (ev->exit_code == EXIT_SUCCESS)))
|
||||
{
|
||||
/* filter out common exits via signals - int/term/quit. not really
|
||||
* worth popping up a dialog for */
|
||||
if (!((ev->signalled) &&
|
||||
((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),
|
||||
ecore_exe_event_data_get(ev->exe, ECORE_EXE_PIPE_READ));
|
||||
}
|
||||
if (e_config->exec.show_exit_dialog)
|
||||
{
|
||||
/* filter out common exits via signals - int/term/quit. not really
|
||||
* worth popping up a dialog for */
|
||||
if (!((ev->signalled) &&
|
||||
((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),
|
||||
ecore_exe_event_data_get(ev->exe, ECORE_EXE_PIPE_READ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 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);
|
||||
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
|
||||
_e_exec_instance_free(inst);
|
||||
|
|
Loading…
Reference in New Issue