Hide power menu after clicking some of its buttons
authorEnrico Zini <enrico@enricozini.org>
Sun, 16 Aug 2009 11:12:37 +0000 (12:12 +0100)
committerEnrico Zini <enrico@enricozini.org>
Sun, 16 Aug 2009 11:12:37 +0000 (12:12 +0100)
src/app_power.vala

index 9b49356b4b3b1bbc16b75ec7f9299143f97e5779..4c37b4b1ac2467a42859fecce3cc2fd99c94093a 100644 (file)
@@ -175,6 +175,7 @@ public class ScreenLockButton : Gtk.Button
        {
                zavai.log.info("Locking screen");
                power.set_screen_lock(true);
+               power_menu.hide();
        }
 }
 
@@ -191,6 +192,7 @@ public class SuspendButton : Gtk.Button
        {
                zavai.log.info("Suspending the phone via FSO");
                power.do_suspend();
+               power_menu.hide();
        }
 }
 
@@ -207,6 +209,7 @@ public class ShutdownButton : Gtk.Button
        {
                zavai.log.info("Shutting down the phone via FSO");
                power.do_shutdown();
+               power_menu.hide();
        }
 }
 
@@ -223,6 +226,7 @@ public class RebootButton : Gtk.Button
        {
                zavai.log.info("Rebooting the phone via FSO");
                power.do_reboot();
+               power_menu.hide();
        }
 }
 
@@ -318,6 +322,11 @@ public class PowerMenu : zavai.Resource, Gtk.Window
                        present();
        }
 
+       public void hide()
+       {
+               visible = false;
+       }
+
        public void shutdown() {}
 }