On 08/09/2012 10:05 AM, Jakub Filak wrote:
> * if the currently process event has configured 'sending-sensitive-data'
>   report-gtk asks for permission to continue with processing of the
>   event
> 
> Signed-off-by: Jakub Filak <[email protected]>
> ---
>  src/gui-wizard-gtk/wizard.c | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
> index 861d922..26ec654 100644
> --- a/src/gui-wizard-gtk/wizard.c
> +++ b/src/gui-wizard-gtk/wizard.c
> @@ -2028,6 +2028,22 @@ static void on_page_prepare(GtkNotebook *assistant, 
> GtkWidget *page, gpointer us
>      }
>  }
>  
> +static bool get_sensitive_data_permission(const char *event_name)
> +{
> +    event_config_t *event_cfg = get_event_config(event_name);
> +
> +    if (!event_cfg || !event_cfg->ec_sending_sensitive_data)
> +        return true;
> +
> +    char *msg = xasprintf(_("Event '%s' requires permision to send possibly 
> sensitive data."

Typo. should be "permission" (two 's').

> +                            "\nDo you want to continue?"),
> +                            event_cfg->screen_name ? event_cfg->screen_name 
> : event_name);
> +    const bool response = ask_yes_no_save_result(msg, 
> "ask_send_sensitive_data");
> +    free(msg);
> +
> +    return response;
> +}
> +
>  static gint select_next_page_no(gint current_page_no, gpointer data)
>  {
>      GtkWidget *page;
> @@ -2049,6 +2065,17 @@ static gint select_next_page_no(gint current_page_no, 
> gpointer data)
>              }
>  
>              free(g_event_selected);
> +
> +            if (!get_sensitive_data_permission(event))
> +            {
> +                g_event_selected = NULL;
> +                gtk_label_set_text(g_lbl_event_log, _("Reporting was 
> interrupted. Can't continue without"
> +                                                      " permission to send 
> sensitive data. Thank you!"));

I propose to remove "thank you" (everywhere. I already see it in git in other 
places).
When people are under stress, program trying to emulate human emotions
(and inevitably getting it wrong) looks... well, misplaced.

Why "thank you"? How stupid program may know whether thanking
is appropriate?
Why "!" (shouting)?
Let's be short and to the point.

In short: I propose "Processing was cancelled". That's it.

* We do not know that the event is a "reporting" one. Thus,
  more generic "Processing".
* User does know that he just now pressed "no" to the question
 "Do you want to send sensitive data?", there is no pressing
  need to repeat that info again.


> +                terminate_event_chain();
> +                current_page_no = pages[PAGENO_EVENT_PROGRESS].page_no - 1;
> +                goto again;
> +            }
> +
>              g_event_selected = xstrdup(event);
>  
>              if (check_event_config(g_event_selected) != 0)

Reply via email to