Enlightenment CVS committal Author : raster Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_actions.c e_config.c e_dialog.c e_dialog.h e_int_menus.c e_test.c Log Message: exit and restart actions. are you sure exit dialog. :) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_actions.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- e_actions.c 5 Sep 2005 15:24:07 -0000 1.23 +++ e_actions.c 19 Sep 2005 10:52:45 -0000 1.24 @@ -887,6 +887,38 @@ e_gadman_mode_set(((E_Container *)obj)->gadman, E_GADMAN_MODE_NORMAL); } +/***************************************************************************/ +static void +_e_actions_cb_exit_dialog_ok(void *data, E_Dialog *dia) +{ + ecore_main_loop_quit(); +} + +ACT_FN_GO(exit) +{ + E_Dialog *dia; + + dia = e_dialog_new(e_container_current_get(e_manager_current_get())); + e_dialog_title_set(dia, _("Are you sure you want to exit?")); + e_dialog_text_set(dia, + _("You requested to exit Enlightenment.<br>" + "<br>" + "Are you sure you want to exit?" + )); + e_dialog_icon_set(dia, "enlightenment/exit", 32); + e_dialog_button_add(dia, _("Yes"), NULL, _e_actions_cb_exit_dialog_ok, NULL); + e_dialog_button_add(dia, _("No"), NULL, NULL, NULL); + e_win_centered_set(dia->win, 1); + e_dialog_show(dia); +} + +/***************************************************************************/ +ACT_FN_GO(restart) +{ + restart = 1; + ecore_main_loop_quit(); +} + /* local subsystem globals */ static Evas_Hash *actions = NULL; @@ -957,6 +989,9 @@ ACT_END(edit_mode); ACT_GO(edit_mode_toggle); + + ACT_GO(restart); + ACT_GO(exit); return 1; } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v retrieving revision 1.99 retrieving revision 1.100 diff -u -3 -r1.99 -r1.100 --- e_config.c 13 Sep 2005 05:19:25 -0000 1.99 +++ e_config.c 19 Sep 2005 10:52:45 -0000 1.100 @@ -908,15 +908,24 @@ eb->params = strdup(""); e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); - /* should do these - can't yet due to other things missing... */ - - /* need a yes/no dialog for these - to stop accidental logouts. for this - * i'd make a special case that can ask u to log out, restart or shut down - * or even reboot (if you have permissions to do so) - */ - /* CTRL+ALT Delete - logout */ - /* CTRL+ALT End - restart */ - + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("End"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("restart"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + + eb = E_NEW(E_Config_Binding_Key, 1); + eb->context = E_BINDING_CONTEXT_ANY; + eb->key = strdup("Delete"); + eb->modifiers = E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT; + eb->any_mod = 0; + eb->action = strdup("exit"); + eb->params = strdup(""); + e_config->key_bindings = evas_list_append(e_config->key_bindings, eb); + /* need to support fullscreen anyway for this - ie netwm and the border * system need to handle this as well as possibly using xrandr/xvidmode */ =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dialog.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -3 -r1.8 -r1.9 --- e_dialog.c 19 Sep 2005 07:02:35 -0000 1.8 +++ e_dialog.c 19 Sep 2005 10:52:45 -0000 1.9 @@ -129,13 +129,13 @@ } void -e_dialog_icon_set(E_Dialog *dia, char *icon) +e_dialog_icon_set(E_Dialog *dia, char *icon, Evas_Coord size) { if (icon) { dia->icon_object = edje_object_add(e_win_evas_get(dia->win)); e_util_edje_icon_set(dia->icon_object, icon); - edje_extern_object_min_size_set(dia->icon_object, 64, 64); + edje_extern_object_min_size_set(dia->icon_object, size, size); edje_object_part_swallow(dia->bg_object, "icon_swallow", dia->icon_object); evas_object_show(dia->icon_object); } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_dialog.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_dialog.h 28 Jul 2005 04:35:44 -0000 1.1 +++ e_dialog.h 19 Sep 2005 10:52:45 -0000 1.2 @@ -28,7 +28,7 @@ EAPI void e_dialog_button_add (E_Dialog *dia, char *label, char *icon, void (*func) (void *data, E_Dialog *dia), void *data); EAPI void e_dialog_title_set (E_Dialog *dia, char *title); EAPI void e_dialog_text_set (E_Dialog *dia, char *text); -EAPI void e_dialog_icon_set (E_Dialog *dia, char *icon); +EAPI void e_dialog_icon_set (E_Dialog *dia, char *icon, Evas_Coord size); EAPI void e_dialog_show (E_Dialog *dia); #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_menus.c,v retrieving revision 1.90 retrieving revision 1.91 diff -u -3 -r1.90 -r1.91 --- e_int_menus.c 14 Sep 2005 20:19:44 -0000 1.90 +++ e_int_menus.c 19 Sep 2005 10:52:45 -0000 1.91 @@ -319,7 +319,11 @@ static void _e_int_menus_quit_cb(void *data) { - ecore_main_loop_quit(); + E_Action *a; + + a = e_action_find("exit"); + if ((a) && (a->func.go)) a->func.go(NULL, NULL); + _e_int_menus_quit_job = NULL; } static void @@ -369,8 +373,10 @@ static void _e_int_menus_main_restart(void *data, E_Menu *m, E_Menu_Item *mi) { - restart = 1; - _e_int_menus_quit(); + E_Action *a; + + a = e_action_find("restart"); + if ((a) && (a->func.go)) a->func.go(NULL, NULL); } static void =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_test.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- e_test.c 19 Sep 2005 04:28:22 -0000 1.15 +++ e_test.c 19 Sep 2005 10:52:45 -0000 1.16 @@ -300,10 +300,11 @@ e_object_del_attach_func_set(E_OBJECT(dia), _e_test_dialog_del); e_dialog_title_set(dia, "A Test Dialog"); e_dialog_text_set(dia, "A Test Dialog<br>And another line<br><hilight>Hilighted Text</hilight>"); - e_dialog_icon_set(dia, "enlightenment/modules"); + e_dialog_icon_set(dia, "enlightenment/modules", 64); e_dialog_button_add(dia, "OK", NULL, NULL, NULL); e_dialog_button_add(dia, "Apply", "enlightenment/reset", NULL, NULL); e_dialog_button_add(dia, "Cancel", "enlightenment/exit", NULL, NULL); + e_win_centered_set(dia->win); e_dialog_show(dia); } #elif 0 ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs