Hi,

i added this to the patch. Works for me, thanks for the hint.

Brian

On Tue, Mar 13, 2007 at 08:15:27AM -0400, Christopher Michael wrote:
> Brian 'morlenxus' Miculcy wrote:
> >Hi guys,
> >
> >the attached patch allows to disable confirmation dialogs.
> >For example you want to shutdown or hibernate your computer, you first
> >need to accept the warning. This patch adds an option to the config
> >panel advanced->dialogs which allows to disable that.
> >People where asking for it, since my kill dialog patch went in.
> >
> >Greets,
> >Brian 'morlenxus' Miculcy
> >
> >
> Brian,
> 
> There is a problem with this patch. You never set the e_config file 
> generation for when a new config variable gets added, nor the IFCFG block:
> 
> Example:
> 
> e_config.h:
>    #define E_CONFIG_FILE_GENERATION 0x0111
> 
> e_config.c:
>    IFCFG(0x0111);
>    e_config->clientlist_include_all_zones = 0;
>    IFCFGEND;
> 
> 
> dh
? e_int_config_dialogs.c
? e_int_config_dialogs.h
Index: Makefile.am
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/Makefile.am,v
retrieving revision 1.176
diff -u -r1.176 Makefile.am
--- Makefile.am 2 Mar 2007 17:00:20 -0000       1.176
+++ Makefile.am 16 Mar 2007 06:52:56 -0000
@@ -135,7 +135,7 @@
 e_int_config_desklock.h \
 e_int_config_exebuf.h \
 e_int_config_apps.h \
-e_int_config_cfgdialogs.h \
+e_int_config_dialogs.h \
 e_int_config_color_classes.h \
 e_int_config_mime.h \
 e_int_config_mime_edit.h \
@@ -294,7 +294,7 @@
 e_int_config_desklock.c \
 e_int_config_exebuf.c \
 e_int_config_apps.c \
-e_int_config_cfgdialogs.c \
+e_int_config_dialogs.c \
 e_int_config_intl.c \
 e_int_config_imc.c \
 e_int_config_imc_import.c \
Index: e_actions.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_actions.c,v
retrieving revision 1.92
diff -u -r1.92 e_actions.c
--- e_actions.c 4 Mar 2007 07:03:10 -0000       1.92
+++ e_actions.c 16 Mar 2007 06:52:57 -0000
@@ -257,8 +257,11 @@
    E_Object *obj;
 
    obj = data;
-   e_object_del(E_OBJECT(kill_dialog));
-   kill_dialog = NULL;
+   if (dia)
+     {
+       e_object_del(E_OBJECT(kill_dialog));
+       kill_dialog = NULL;
+     }
    if ((!((E_Border *)obj)->lock_close) && (!((E_Border *)obj)->internal)) 
      e_border_act_kill_begin((E_Border *)obj);
 }
@@ -291,6 +294,14 @@
        obj = E_OBJECT(e_border_focused_get());
        if (!obj) return;
      }
+   if (kill_dialog) e_object_del(E_OBJECT(kill_dialog));
+
+   if (e_config->cnfmdlg_disabled)
+     {
+       _e_actions_cb_kill_dialog_ok (obj, NULL);
+       return;
+     }
+
    bd = (E_Border *)obj;
    snprintf(dialog_text, sizeof(dialog_text),
            "You are about to kill %s.<br><br>"
@@ -299,7 +310,6 @@
            "Are you sure you want to kill this window?", 
            bd->client.icccm.name);
 
-   if (kill_dialog) e_object_del(E_OBJECT(kill_dialog));
    kill_dialog = 
e_dialog_new(e_container_current_get(e_manager_current_get()), 
                              "E", "_kill_dialog");
    if (!kill_dialog) return;
@@ -1558,8 +1568,11 @@
 static void
 _e_actions_cb_exit_dialog_ok(void *data, E_Dialog *dia)
 {
-   e_object_del(E_OBJECT(exit_dialog));
-   exit_dialog = NULL;
+   if (dia)
+     {
+       e_object_del(E_OBJECT(exit_dialog));
+       exit_dialog = NULL;
+     }
    e_sys_action_do(E_SYS_EXIT, NULL);
 }
 
@@ -1582,6 +1595,13 @@
 ACT_FN_GO(exit)
 {
    if (exit_dialog) e_object_del(E_OBJECT(exit_dialog));
+
+   if (e_config->cnfmdlg_disabled)
+     {
+       _e_actions_cb_exit_dialog_ok (NULL, NULL);
+       return;
+     }
+
    exit_dialog = 
e_dialog_new(e_container_current_get(e_manager_current_get()), "E", 
"_exit_dialog");
    if (!exit_dialog) return;
    e_win_delete_callback_set(exit_dialog->win, 
_e_actions_cb_exit_dialog_delete);
@@ -1619,8 +1639,11 @@
 static void
 _e_actions_cb_logout_dialog_ok(void *data, E_Dialog *dia)
 {
-   e_object_del(E_OBJECT(logout_dialog));
-   logout_dialog = NULL;
+   if (dia)
+     {
+       e_object_del(E_OBJECT(logout_dialog));
+       logout_dialog = NULL;
+     }
    e_sys_action_do(E_SYS_LOGOUT, NULL);
 }
 
@@ -1643,6 +1666,13 @@
 ACT_FN_GO(logout)
 {
    if (logout_dialog) e_object_del(E_OBJECT(logout_dialog));
+   
+   if (e_config->cnfmdlg_disabled)
+     {
+       _e_actions_cb_logout_dialog_ok (NULL, NULL);
+       return;
+     }
+
    logout_dialog = 
e_dialog_new(e_container_current_get(e_manager_current_get()), "E", 
"_logout_dialog");
    if (!logout_dialog) return;
    e_win_delete_callback_set(logout_dialog->win, 
_e_actions_cb_logout_dialog_delete);
@@ -1668,8 +1698,11 @@
 static void
 _e_actions_cb_halt_dialog_ok(void *data, E_Dialog *dia)
 {
-   e_object_del(E_OBJECT(halt_dialog));
-   halt_dialog = NULL;
+   if (dia)
+     {
+       e_object_del(E_OBJECT(halt_dialog));
+       halt_dialog = NULL;
+     }
    e_sys_action_do(E_SYS_HALT, NULL);
 }
 
@@ -1692,6 +1725,13 @@
 ACT_FN_GO(halt)
 {
    if (halt_dialog) e_object_del(E_OBJECT(halt_dialog));
+
+   if (e_config->cnfmdlg_disabled)
+     {
+       _e_actions_cb_halt_dialog_ok (NULL, NULL);
+       return;
+     }
+
    halt_dialog = 
e_dialog_new(e_container_current_get(e_manager_current_get()), "E", 
"_halt_dialog");
    if (!halt_dialog) return;
    e_win_delete_callback_set(halt_dialog->win, 
_e_actions_cb_halt_dialog_delete);
@@ -1717,8 +1757,11 @@
 static void
 _e_actions_cb_reboot_dialog_ok(void *data, E_Dialog *dia)
 {
-   e_object_del(E_OBJECT(reboot_dialog));
-   reboot_dialog = NULL;
+   if (dia)
+     {
+       e_object_del(E_OBJECT(reboot_dialog));
+       reboot_dialog = NULL;
+     }
    e_sys_action_do(E_SYS_REBOOT, NULL);
 }
 
@@ -1741,6 +1784,13 @@
 ACT_FN_GO(reboot)
 {
    if (reboot_dialog) e_object_del(E_OBJECT(reboot_dialog));
+
+   if (e_config->cnfmdlg_disabled)
+     {
+       _e_actions_cb_reboot_dialog_ok (NULL, NULL);
+       return;
+     }
+
    reboot_dialog = 
e_dialog_new(e_container_current_get(e_manager_current_get()), "E", 
"_reboot_dialog");
    if (!reboot_dialog) return;
    e_win_delete_callback_set(reboot_dialog->win, 
_e_actions_cb_reboot_dialog_delete);
@@ -1766,8 +1816,11 @@
 static void
 _e_actions_cb_suspend_dialog_ok(void *data, E_Dialog *dia)
 {
-   e_object_del(E_OBJECT(suspend_dialog));
-   suspend_dialog = NULL;
+   if (dia)
+     {
+       e_object_del(E_OBJECT(suspend_dialog));
+       suspend_dialog = NULL;
+     }
    e_sys_action_do(E_SYS_SUSPEND, NULL);
 }
 
@@ -1790,6 +1843,13 @@
 ACT_FN_GO(suspend)
 {
    if (suspend_dialog) e_object_del(E_OBJECT(suspend_dialog));
+
+   if (e_config->cnfmdlg_disabled)
+     {
+       _e_actions_cb_suspend_dialog_ok (NULL, NULL);
+       return;
+     }
+
    suspend_dialog = 
e_dialog_new(e_container_current_get(e_manager_current_get()), "E", 
"_suspend_dialog");
    if (!suspend_dialog) return;
    e_win_delete_callback_set(suspend_dialog->win, 
_e_actions_cb_suspend_dialog_delete);
@@ -1815,8 +1875,11 @@
 static void
 _e_actions_cb_hibernate_dialog_ok(void *data, E_Dialog *dia)
 {
-   e_object_del(E_OBJECT(hibernate_dialog));
-   hibernate_dialog = NULL;
+   if (dia)
+     {
+       e_object_del(E_OBJECT(hibernate_dialog));
+       hibernate_dialog = NULL;
+     }
    e_sys_action_do(E_SYS_HIBERNATE, NULL);
 }
 
@@ -1839,6 +1902,13 @@
 ACT_FN_GO(hibernate)
 {
    if (hibernate_dialog) e_object_del(E_OBJECT(hibernate_dialog));
+
+   if (e_config->cnfmdlg_disabled)
+     {
+       _e_actions_cb_hibernate_dialog_ok (NULL, NULL);
+       return;
+     }
+
    hibernate_dialog = 
e_dialog_new(e_container_current_get(e_manager_current_get()), "E", 
"_hibernate_dialog");
    if (!hibernate_dialog) return;
    e_win_delete_callback_set(hibernate_dialog->win, 
_e_actions_cb_hibernate_dialog_delete);
Index: e_config.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.229
diff -u -r1.229 e_config.c
--- e_config.c  13 Mar 2007 18:03:19 -0000      1.229
+++ e_config.c  16 Mar 2007 06:52:58 -0000
@@ -471,6 +471,7 @@
    E_CONFIG_VAL(D, T, exebuf_term_cmd, STR);
    E_CONFIG_LIST(D, T, color_classes, _e_config_color_class_edd);
    E_CONFIG_VAL(D, T, use_app_icon, INT);
+   E_CONFIG_VAL(D, T, cnfmdlg_disabled, INT); /**/
    E_CONFIG_VAL(D, T, cfgdlg_auto_apply, INT); /**/
    E_CONFIG_VAL(D, T, cfgdlg_default_mode, INT); /**/
    E_CONFIG_LIST(D, T, gadcons, _e_config_gadcon_edd);
@@ -695,6 +696,7 @@
    e_config->exebuf_term_cmd = evas_stringshare_add("xterm -hold -e");
    e_config->color_classes = NULL;
    e_config->use_app_icon = 0;
+   e_config->cnfmdlg_disabled = 0;
    e_config->cfgdlg_auto_apply = 0;
    e_config->cfgdlg_default_mode = 0;
    e_config->gadcons = NULL;
@@ -1342,6 +1344,10 @@
    e_config->clientlist_include_all_zones = 0;
    IFCFGEND;
 
+   IFCFG(0x0112);
+   e_config->cnfmdlg_disabled = 0;
+   IFCFGEND;
+
    e_config->config_version = E_CONFIG_FILE_VERSION;   
      
 #if 0 /* example of new config */
@@ -1422,6 +1428,7 @@
    E_CONFIG_LIMIT(e_config->menu_eap_generic_show, 0, 1);
    E_CONFIG_LIMIT(e_config->menu_eap_comment_show, 0, 1);
    E_CONFIG_LIMIT(e_config->use_app_icon, 0, 1);
+   E_CONFIG_LIMIT(e_config->cnfmdlg_disabled, 0, 1);
    E_CONFIG_LIMIT(e_config->cfgdlg_auto_apply, 0, 1);
    E_CONFIG_LIMIT(e_config->cfgdlg_default_mode, 0, 1);
    E_CONFIG_LIMIT(e_config->font_hinting, 0, 2);
Index: e_config.h
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.144
diff -u -r1.144 e_config.h
--- e_config.h  13 Mar 2007 18:03:19 -0000      1.144
+++ e_config.h  16 Mar 2007 06:52:58 -0000
@@ -52,7 +52,7 @@
 /* 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 0x0111
+#define E_CONFIG_FILE_GENERATION 0x0112
 #define E_CONFIG_FILE_VERSION    ((E_CONFIG_FILE_EPOCH << 16) | 
E_CONFIG_FILE_GENERATION)
 
 #define E_EVAS_ENGINE_DEFAULT      0
@@ -217,6 +217,7 @@
    const char *exebuf_term_cmd; // GUI
    Evas_List  *color_classes; // GUI
    int         use_app_icon; // GUI
+   int         cnfmdlg_disabled; // GUI
    int         cfgdlg_auto_apply; // GUI
    int         cfgdlg_default_mode; // GUI   
    Evas_List  *gadcons; // GUI
Index: e_configure.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_configure.c,v
retrieving revision 1.90
diff -u -r1.90 e_configure.c
--- e_configure.c       21 Feb 2007 00:05:27 -0000      1.90
+++ e_configure.c       16 Mar 2007 06:52:58 -0000
@@ -438,7 +438,7 @@
    _e_configure_item_add(cat, _("Input Method Settings"), "enlightenment/imc", 
e_int_config_imc);
 
    cat = _e_configure_category_add(eco, _("Advanced"), 
"enlightenment/advanced");
-   _e_configure_item_add(cat, _("Configuration Dialogs"), 
"enlightenment/configuration", e_int_config_cfgdialogs);
+   _e_configure_item_add(cat, _("Dialogs"), "enlightenment/configuration", 
e_int_config_dialogs);
    _e_configure_item_add(cat, _("Performance"), "enlightenment/performance", 
e_int_config_performance);   
    _e_configure_item_add(cat, _("Window List"), "enlightenment/winlist", 
e_int_config_winlist);
    _e_configure_item_add(cat, _("Run Command"), "enlightenment/run", 
e_int_config_exebuf);
Index: e_includes.h
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_includes.h,v
retrieving revision 1.148
diff -u -r1.148 e_includes.h
--- e_includes.h        21 Feb 2007 00:05:27 -0000      1.148
+++ e_includes.h        16 Mar 2007 06:52:59 -0000
@@ -106,7 +106,7 @@
 #include "e_int_config_dpms.h"
 #include "e_int_config_exebuf.h"
 #include "e_int_config_apps.h"
-#include "e_int_config_cfgdialogs.h"
+#include "e_int_config_dialogs.h"
 #include "e_int_config_intl.h"
 #include "e_int_config_imc.h"
 #include "e_int_config_imc_import.h"
Index: e_int_config_display.c
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_int_config_display.c,v
retrieving revision 1.33
diff -u -r1.33 e_int_config_display.c
--- e_int_config_display.c      22 Jan 2007 17:24:30 -0000      1.33
+++ e_int_config_display.c      16 Mar 2007 06:52:59 -0000
@@ -93,8 +93,7 @@
    e_config_save_queue();
    sb->cfdata->orig_size = c_size;
    sb->cfdata->orig_rate = c_rate;
-   _surebox_dialog_cb_delete(dia->win);
-
+   if (dia) _surebox_dialog_cb_delete(dia->win);
 }
 
 static void
@@ -338,7 +337,17 @@
        else
           ecore_x_randr_screen_size_set(man->root, size);
 
-       _surebox_new(cfd, cfdata);
+       if (e_config->cnfmdlg_disabled)
+         {
+            SureBox *sb;
+            
+            sb = E_NEW(SureBox, 1);
+            sb->cfd = cfd;
+            sb->cfdata = cfdata;
+            _surebox_dialog_cb_yes (sb, NULL);
+         }
+       else
+          _surebox_new(cfd, cfdata);
      }
 
    if ((cfdata->can_rotate) || (cfdata->can_flip))
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to