[E-devel] [PATCH 3/3] conf_randr: Don't show blank dialog window initially.

2011-11-17 Thread Stefan Schmidt
The current logic only displays text the first time the timer callback is
called. Thats after one second. To avoid the blank dialog box for one second set
the intial text already when creating the dialog.

Signed-off-by: Stefan Schmidt 
---
 e/src/modules/conf_randr/e_int_config_randr.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/e/src/modules/conf_randr/e_int_config_randr.c 
b/e/src/modules/conf_randr/e_int_config_randr.c
index 6073229..63a808b 100644
--- a/e/src/modules/conf_randr/e_int_config_randr.c
+++ b/e/src/modules/conf_randr/e_int_config_randr.c
@@ -254,6 +254,8 @@ _e_conf_randr_confirmation_dialog_new(E_Config_Dialog *cfd)
 {
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cd = 
E_NEW(E_Config_Randr_Dialog_Confirmation_Dialog_Data, 1);
 
+   char buf[4096];
+
if (!cd) return;
 
cd->cfd = cfd;
@@ -267,6 +269,11 @@ _e_conf_randr_confirmation_dialog_new(E_Config_Dialog *cfd)
 cd->dialog->data = cd;
 e_dialog_icon_set(cd->dialog, "preferences-system-screen-resolution", 
48);
 e_win_delete_callback_set(cd->dialog->win, 
_e_conf_randr_confirmation_dialog_delete_cb);
+snprintf(buf, sizeof(buf),
+ _("Does this look OK? Click Keep if it 
does, or Restore if not."
+   "If you do not press a button, the previous settings will 
be"
+   "restored in %d seconds."), cd->countdown);
+e_dialog_text_set(cd->dialog, buf);
 e_dialog_button_add(cd->dialog, _("Keep"), NULL, 
_e_conf_randr_confirmation_dialog_keep_cb, cd);
 e_dialog_button_add(cd->dialog, _("Store Permanently"), NULL, 
_e_conf_randr_confirmation_dialog_store_cb, cd);
 e_dialog_button_add(cd->dialog, _("Restore"), NULL, 
_e_conf_randr_confirmation_dialog_discard_cb, cd);
-- 
1.7.7.3


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [PATCH 3/3] conf_randr: Don't show blank dialog window initially.

2011-11-18 Thread Mike Blumenkrantz
On Fri, 18 Nov 2011 08:55:11 +0100
Stefan Schmidt  wrote:

> The current logic only displays text the first time the timer callback is
> called. Thats after one second. To avoid the blank dialog box for one second
> set the intial text already when creating the dialog.
> 
> Signed-off-by: Stefan Schmidt 
> ---
>  e/src/modules/conf_randr/e_int_config_randr.c |7 +++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/e/src/modules/conf_randr/e_int_config_randr.c
> b/e/src/modules/conf_randr/e_int_config_randr.c index 6073229..63a808b 100644
> --- a/e/src/modules/conf_randr/e_int_config_randr.c
> +++ b/e/src/modules/conf_randr/e_int_config_randr.c
> @@ -254,6 +254,8 @@ _e_conf_randr_confirmation_dialog_new(E_Config_Dialog
> *cfd) {
> E_Config_Randr_Dialog_Confirmation_Dialog_Data *cd =
> E_NEW(E_Config_Randr_Dialog_Confirmation_Dialog_Data, 1); 
> +   char buf[4096];
> +
> if (!cd) return;
>  
> cd->cfd = cfd;
> @@ -267,6 +269,11 @@ _e_conf_randr_confirmation_dialog_new(E_Config_Dialog
> *cfd) cd->dialog->data = cd;
>  e_dialog_icon_set(cd->dialog,
> "preferences-system-screen-resolution", 48);
> e_win_delete_callback_set(cd->dialog->win,
> _e_conf_randr_confirmation_dialog_delete_cb);
> +snprintf(buf, sizeof(buf),
> + _("Does this look OK? Click Keep if it
> does, or Restore if not."
> +   "If you do not press a button, the previous settings will
> be"
> +   "restored in %d seconds."), cd->countdown);
> +e_dialog_text_set(cd->dialog, buf);
>  e_dialog_button_add(cd->dialog, _("Keep"), NULL,
> _e_conf_randr_confirmation_dialog_keep_cb, cd);
> e_dialog_button_add(cd->dialog, _("Store Permanently"), NULL,
> _e_conf_randr_confirmation_dialog_store_cb, cd);
> e_dialog_button_add(cd->dialog, _("Restore"), NULL,
> _e_conf_randr_confirmation_dialog_discard_cb, cd);
in

-- 
Mike Blumenkrantz
Zentific: Doctor recommended, mother approved.

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel