Store 'Show Toolbar' value in gconf.

This commit is contained in:
Cole Robinson 2008-09-05 16:34:14 -04:00
parent 333aa00df8
commit 1a01b730d8
3 changed files with 24 additions and 1 deletions

View File

@ -169,6 +169,19 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/::PACKAGE::/details/show-toolbar</key>
<applyto>/apps/::PACKAGE::/details/show-toolbar</applyto>
<owner>::PACKAGE::</owner>
<type>bool</type>
<default>1</default>
<locale name="C">
<short>Whether to show VM button toolbar in Details display</short>
<long>Whether to show toolbar containing Virtual Machine action buttons (such as Run, Pause, Shutdown) in the details display</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/::PACKAGE::/new-vm/local-sound</key>
<applyto>/apps/::PACKAGE::/new-vm/local-sound</applyto>

View File

@ -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")

View File

@ -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()