[virt-tools-list] [PATCH virt-viewer] Always ask user about closing session

Hans de Goede hdegoede at redhat.com
Tue Jan 29 13:17:17 UTC 2013


Hi,

On 01/29/2013 02:05 PM, Marc-André Lureau wrote:
> Currently, virt-viewer doesn't ask for user confirmation when closing
> a single monitor session. Always ask before closing, as requested by
> user.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=803912

I personally don't like this, not at all. May I suggest we add a
checkbox to the dialog "[] Don't ask this again" or some such.

I believe we already have some code to store preferences, this checkbox
would then toggle and save a preference to not request confirmation,
(not ever, not even in the multi-monitor case).

Regards,

Hans


> ---
>   src/virt-viewer-app.c | 13 ++-----------
>   1 file changed, 2 insertions(+), 11 deletions(-)
>
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index ec5e403..eea77e0 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -254,12 +254,6 @@ virt_viewer_app_get_n_windows_visible(VirtViewerApp *self)
>       return n;
>   }
>
> -static guint
> -virt_viewer_app_get_n_windows(VirtViewerApp *self)
> -{
> -    return g_hash_table_size(self->priv->windows);
> -}
> -
>   gboolean
>   virt_viewer_app_window_set_visible(VirtViewerApp *self,
>                                      VirtViewerWindow *window,
> @@ -275,13 +269,13 @@ virt_viewer_app_window_set_visible(VirtViewerApp *self,
>           if (virt_viewer_app_get_n_windows_visible(self) > 1) {
>               virt_viewer_window_hide(window);
>               return FALSE;
> -        } else if (virt_viewer_app_get_n_windows(self) > 1) {
> +        } else {
>               GtkWidget *dialog =
>                   gtk_message_dialog_new (virt_viewer_window_get_window(window),
>                                           GTK_DIALOG_DESTROY_WITH_PARENT,
>                                           GTK_MESSAGE_QUESTION,
>                                           GTK_BUTTONS_OK_CANCEL,
> -                                        _("This is the last visible display. Do you want to quit?"));
> +                                        _("Do you want to close the session?"));
>               gint result = gtk_dialog_run (GTK_DIALOG (dialog));
>               gtk_widget_destroy(dialog);
>               switch (result) {
> @@ -292,9 +286,6 @@ virt_viewer_app_window_set_visible(VirtViewerApp *self,
>                   break;
>               }
>               return FALSE;
> -        } else {
> -            virt_viewer_app_quit(self);
> -            return FALSE;
>           }
>       }
>
>




More information about the virt-tools-list mailing list