From 1a01b730d8d7161a9fb2f7af9258c45c36a70dd1 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 5 Sep 2008 16:34:14 -0400 Subject: [PATCH] Store 'Show Toolbar' value in gconf. --- src/virt-manager.schemas.in | 13 +++++++++++++ src/virtManager/config.py | 6 ++++++ src/virtManager/details.py | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/virt-manager.schemas.in b/src/virt-manager.schemas.in index 3fa24236e..642ea6ba9 100644 --- a/src/virt-manager.schemas.in +++ b/src/virt-manager.schemas.in @@ -169,6 +169,19 @@ + + /schemas/apps/::PACKAGE::/details/show-toolbar + /apps/::PACKAGE::/details/show-toolbar + ::PACKAGE:: + bool + 1 + + + Whether to show VM button toolbar in Details display + Whether to show toolbar containing Virtual Machine action buttons (such as Run, Pause, Shutdown) in the details display + + + /schemas/apps/::PACKAGE::/new-vm/local-sound /apps/::PACKAGE::/new-vm/local-sound diff --git a/src/virtManager/config.py b/src/virtManager/config.py index 02778354b..a2e32d482 100644 --- a/src/virtManager/config.py +++ b/src/virtManager/config.py @@ -219,6 +219,12 @@ class vmmConfig: def set_console_grab_notify(self, state): self.conf.set_bool(self.conf_dir + "/console/grab-notify", state) + def get_details_show_toolbar(self): + return self.conf.get_bool(self.conf_dir + "/details/show-toolbar") + + def set_details_show_toolbar(self, state): + self.conf.set_bool(self.conf_dir + "/details/show-toolbar", state) + def get_local_sound(self): return self.conf.get_bool(self.conf_dir + "/new-vm/local-sound") diff --git a/src/virtManager/details.py b/src/virtManager/details.py index f162f3ed9..91720ffa8 100644 --- a/src/virtManager/details.py +++ b/src/virtManager/details.py @@ -213,6 +213,7 @@ class vmmDetails(gobject.GObject): pass self.window.get_widget("console-pages").set_show_tabs(False) + self.window.get_widget("details-menu-view-toolbar").set_active(self.config.get_details_show_toolbar()) self.window.signal_autoconnect({ "on_close_details_clicked": self.close, @@ -421,7 +422,10 @@ class vmmDetails(gobject.GObject): self.window.get_widget("details-toolbar").show() def toggle_toolbar(self, src): - if src.get_active() and not self.window.get_widget("details-menu-view-fullscreen").get_active(): + active = src.get_active() + self.config.set_details_show_toolbar(active) + if active and not \ + self.window.get_widget("details-menu-view-fullscreen").get_active(): self.window.get_widget("details-toolbar").show() else: self.window.get_widget("details-toolbar").hide()