Hi,

I've added a little feature/setting to notification module. It now allows
to set timeout for all notifications (not only default). I've decided to
do this because of xchat (and maybe others). xchat's notification lasts
20s and there is no way how to change it. So there is a new checkbox in
notification module settings (default false) to enable forced timeout for
all notifications. I've also enlarged maximal timeout value (slider) from
6.0 to 15s

If you find it useful / safe, please apply it or just respond it's nonsense :-)

Thanks

regards,

Libor
Index: src/e_mod_popup.c
===================================================================
--- src/e_mod_popup.c   (revision 60939)
+++ src/e_mod_popup.c   (working copy)
@@ -93,7 +93,7 @@
 
    timeout = e_notification_timeout_get(popup->notif);
 
-   if (timeout < 0)
+   if (timeout < 0 || notification_cfg->force_timeout)
      timeout = notification_cfg->timeout;
    else
      timeout = (double)timeout / 1000.0;
Index: src/e_mod_main.c
===================================================================
--- src/e_mod_main.c    (revision 60939)
+++ src/e_mod_main.c    (working copy)
@@ -327,6 +327,7 @@
    E_CONFIG_VAL(D, T, show_critical, INT);
    E_CONFIG_VAL(D, T, corner, INT);
    E_CONFIG_VAL(D, T, timeout, FLOAT);
+   E_CONFIG_VAL(D, T, force_timeout, INT);
    E_CONFIG_LIST(D, T, items, conf_item_edd);
 
    notification_cfg = e_config_domain_load("module.notification", conf_edd);
@@ -473,6 +474,7 @@
    cfg->show_normal   = 1;
    cfg->show_critical = 1;
    cfg->timeout       = 5.0;
+   cfg->force_timeout = 0;
    cfg->corner        = CORNER_TR;
 
    return cfg;
Index: src/e_mod_config.c
===================================================================
--- src/e_mod_config.c  (revision 60939)
+++ src/e_mod_config.c  (working copy)
@@ -5,6 +5,7 @@
    int show_low;
    int show_normal;
    int show_critical;
+   int force_timeout;
    double timeout;
    int corner;
 };
@@ -66,6 +67,7 @@
    cfdata->show_critical = notification_cfg->show_critical;
    cfdata->timeout       = notification_cfg->timeout;
    cfdata->corner        = notification_cfg->corner;
+   cfdata->force_timeout = notification_cfg->force_timeout;
 }
 
 static Evas_Object *
@@ -88,7 +90,9 @@
    e_widget_list_object_append(o, of, 1, 1, 0.5);
 
    of = e_widget_framelist_add(evas, D_("Default Timeout"), 0);
-   ow = e_widget_slider_add(evas, 1, 0, D_("%.1f seconds"), 0.0, 6.0, 0.1, 0, 
+   ow = e_widget_check_add(evas, D_("Force timeout for all notifications"), 
&(cfdata->force_timeout));
+   e_widget_framelist_object_append(of,ow);
+   ow = e_widget_slider_add(evas, 1, 0, D_("%.1f seconds"), 0.0, 15.0, 0.1, 0, 
                             &(cfdata->timeout), NULL, 200);
    e_widget_framelist_object_append(of, ow);
    e_widget_list_object_append(o, of, 1, 1, 0.5);
@@ -134,6 +138,7 @@
    notification_cfg->show_critical = cfdata->show_critical;
    notification_cfg->timeout       = cfdata->timeout;
    notification_cfg->corner        = cfdata->corner;
+   notification_cfg->force_timeout = cfdata->force_timeout;
 
    e_modapi_save(notification_mod);
    return 1;
Index: src/e_mod_main.h
===================================================================
--- src/e_mod_main.h    (revision 60939)
+++ src/e_mod_main.h    (working copy)
@@ -51,6 +51,7 @@
   int show_low;
   int show_normal;
   int show_critical;
+  int force_timeout;
   float timeout;
   Popup_Corner corner;
 
------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to