linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung.kim@lge.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 7/7] perf ui/gtk: Use struct perf_error_ops
Date: Mon, 30 Apr 2012 17:31:07 +0900	[thread overview]
Message-ID: <87ipghsjsk.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1204300923010.2090@tux.localdomain> (Pekka Enberg's message of "Mon, 30 Apr 2012 09:31:28 +0300 (EEST)")

Hi,

On Mon, 30 Apr 2012 09:31:28 +0300 (EEST), Pekka Enberg wrote:
> On Mon, 30 Apr 2012, Namhyung Kim wrote:
>> Define and use perf_gtk_eops to provide a GTK2 message
>> dialog for error reporting. To do that, we need global
>> main_window variable for tracking UI state.
>> 
>> Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
>> diff --git a/tools/perf/ui/gtk/util.c b/tools/perf/ui/gtk/util.c
>> index a727fe394e91..0d0ed2ed3937 100644
>> --- a/tools/perf/ui/gtk/util.c
>> +++ b/tools/perf/ui/gtk/util.c
>> @@ -2,6 +2,53 @@
>>  #include "../../util/debug.h"
>>  #include "gtk.h"
>>  
>> +#include <stdio.h>
>> +#include <string.h>
>> +#include <stdlib.h>
>> +
>> +
>> +GtkWidget *main_window;
>> +
>> +static int message_dialog(const char *title, const char *format, va_list args)
>> +{
>> +	char *msg;
>> +	GtkWidget *dialog;
>> +	GtkMessageType message_type = GTK_MESSAGE_WARNING;
>> +
>> +	if (!main_window || vasprintf(&msg, format, args) < 0) {
>> +		fprintf(stderr, "%s:\n", title);
>> +		vfprintf(stderr, format, args);
>> +		return -1;
>> +	}
>> +
>> +	if (strcmp(title, "Error") == 0)
>> +		message_type = GTK_MESSAGE_ERROR;
>> +
>> +	dialog = gtk_message_dialog_new_with_markup(GTK_WINDOW(main_window),
>> +					GTK_DIALOG_DESTROY_WITH_PARENT,
>> +					message_type,
>> +					GTK_BUTTONS_CLOSE,
>> +					"<b>%s</b>\n\n%s", title, msg);
>> +	gtk_dialog_run(GTK_DIALOG(dialog));
>> +	gtk_widget_destroy(dialog);
>> +	free(msg);
>> +	return 0;
>> +}
>
> I think this is an usability glitch waiting to happen - especially so if 
> you use it for warnings. There's no reason to require the user to react to 
> warning messages in the GUI because there's absolutely nothing they can do 
> about them.
>
> I guess we could do something like the "ui helpline" thing used by the 
> newt front-end if we really wanted to.
>
> 			Pekka

I did quick grep on ui__warning and found that most of its users are
trying to show the messages before exiting. I think some (at least) of
them can be converted to ui__error(). And as existing implementation
(TUI) already requires user input for this, I thought it's ok.

But I agreed with you that ui__warning should not be used for showing
non-critical messages and converted to helpline-style ones.

Thanks,
Namhyung

  reply	other threads:[~2012-04-30  8:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30  4:55 [PATCH 0/7] perf ui: Add basic error handling for GTK2 front-end Namhyung Kim
2012-04-30  4:55 ` [PATCH 1/7] perf ui: Make setup_browser() generic Namhyung Kim
2012-05-11  6:33   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-04-30  4:55 ` [PATCH 2/7] perf ui: Drop arg[cv] arguments from perf_gtk_setup_browser() Namhyung Kim
2012-05-11  6:34   ` [tip:perf/core] perf ui gtk: " tip-bot for Namhyung Kim
2012-04-30  4:55 ` [PATCH 3/7] perf ui/gtk: Rename functions for consistency Namhyung Kim
2012-05-11  6:35   ` [tip:perf/core] perf ui gtk: " tip-bot for Namhyung Kim
2012-04-30  4:55 ` [PATCH 4/7] perf ui: Add gtk2 support into setup_browser() Namhyung Kim
2012-05-11  6:36   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-04-30  4:55 ` [PATCH 5/7] perf ui: Change fallback policy of setup_browser() Namhyung Kim
2012-05-11  6:37   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-04-30  4:55 ` [PATCH 6/7] perf ui: Introduce struct perf_error_ops Namhyung Kim
2012-05-02 19:03   ` Arnaldo Carvalho de Melo
2012-05-03 14:35     ` Namhyung Kim
2012-04-30  4:55 ` [PATCH 7/7] perf ui/gtk: Use " Namhyung Kim
2012-04-30  6:31   ` Pekka Enberg
2012-04-30  8:31     ` Namhyung Kim [this message]
2012-05-07  8:10       ` Ingo Molnar
2012-05-07  8:26         ` Namhyung Kim
2012-05-07  8:40           ` Ingo Molnar
2012-05-29  4:22 [PATCH 0/7] perf ui: Add basic error handling for GTK2 front-end (v3) Namhyung Kim
2012-05-29  4:23 ` [PATCH 7/7] perf ui/gtk: Use struct perf_error_ops Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ipghsjsk.fsf@sejong.aot.lge.com \
    --to=namhyung.kim@lge.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=penberg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).