[gnome-boxes/wip/less-dialogs2: 4/14] libvirt-machine-props: Use notifications for errors



commit 8d7518ba874397296f1abce9541242d9e9e5ce82
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Nov 26 15:55:05 2014 +0000

    libvirt-machine-props: Use notifications for errors
    
    Instead of launching a dialog on failing to save troubleshooting log, use
    notifications.
    
    Known issue: The troubleshooting log is itself a dialog that hides the
    properties window at the moment so the notification is hidden unless
    user closes the dialog soon (a few seconds) after choosing the file.
    This issue will be resolved after we merge troubleshooting log UI into
    the properties window itself.

 src/libvirt-machine-properties.vala |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 357a9f0..0ce8523 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -462,14 +462,8 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
                                 file.replace_contents (log.data, null, false,
                                                        FileCreateFlags.REPLACE_DESTINATION, null);
                             } catch (GLib.Error e) {
-                                var m = new Gtk.MessageDialog (chooser,
-                                                               Gtk.DialogFlags.DESTROY_WITH_PARENT,
-                                                               Gtk.MessageType.ERROR,
-                                                               Gtk.ButtonsType.CLOSE,
-                                                               _("Error saving: %s").printf (e.message));
-                                m.modal = true;
-                                m.show_all ();
-                                m.response.connect ( () => { m.destroy (); });
+                                var message = _("Error saving: %s").printf (e.message);
+                                machine.window.notificationbar.display_error (message);
                                 return;
                             }
                             chooser.destroy ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]