[gnome-boxes] Avoid warnings when going to properties view for non-running vm



commit 2bc6ca1682ad95a15cf125472d16dfdee5c2f7f2
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Oct 26 11:25:41 2012 +0200

    Avoid warnings when going to properties view for non-running vm
    
    If the vm is not running then there will be no display to
    animate and show in the sidebar.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677714

 src/machine.vala |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/machine.vala b/src/machine.vala
index 3717bce..d4d29f5 100644
--- a/src/machine.vala
+++ b/src/machine.vala
@@ -665,12 +665,16 @@ private class Boxes.MachineActor: Boxes.UI {
             break;
 
         case UIState.PROPERTIES:
-            if (previous_ui_state == UIState.WIZARD)
-                // FIXME: We should draw a CD instead as in the mockup:
-                //        https://github.com/gnome-design-team/gnome-mockups/raw/master/boxes/boxes-install5.5.png
+            var widget = App.app.display_page.remove_display ();
+            if (widget == null) {
+                if (previous_ui_state == UIState.WIZARD) {
+                    // FIXME: We should draw a CD instead as in the mockup:
+                    //        https://github.com/gnome-design-team/gnome-mockups/raw/master/boxes/boxes-install5.5.png
+                }
+
                 break;
+            }
 
-            var widget = App.app.display_page.remove_display ();
             update_display (widget);
             Clutter.ActorBox box = { 0, 0,  width, height};
             display.allocate (box, 0);



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