details: Always have the apply button showing.

Also, swap the order of remove and apply so remove is less likely to be
pushed by accident.
This commit is contained in:
Cole Robinson 2009-11-05 15:22:00 -05:00
parent 9fbcce7859
commit d8e8430285
2 changed files with 17 additions and 21 deletions

View File

@ -60,11 +60,9 @@ HW_LIST_TYPE_CHAR = 10
HW_LIST_TYPE_HOSTDEV = 11
HW_LIST_TYPE_VIDEO = 12
apply_pages = [ HW_LIST_TYPE_GENERAL, HW_LIST_TYPE_CPU, HW_LIST_TYPE_MEMORY,
HW_LIST_TYPE_BOOT, HW_LIST_TYPE_DISK, HW_LIST_TYPE_VIDEO]
remove_pages = [ HW_LIST_TYPE_NIC, HW_LIST_TYPE_INPUT,
HW_LIST_TYPE_GRAPHICS, HW_LIST_TYPE_SOUND, HW_LIST_TYPE_CHAR,
HW_LIST_TYPE_HOSTDEV]
HW_LIST_TYPE_HOSTDEV, HW_LIST_TYPE_DISK, HW_LIST_TYPE_VIDEO]
# Main tab pages
PAGE_CONSOLE = 0
@ -544,11 +542,9 @@ class vmmDetails(gobject.GObject):
else:
pagetype = -1
app = pagetype in apply_pages
rem = pagetype in remove_pages
if selected:
self.window.get_widget("config-apply").set_sensitive(False)
self.window.get_widget("config-apply").set_property("visible", app)
self.window.get_widget("config-remove").set_property("visible", rem)
self.window.get_widget("hw-panel").set_current_page(pagetype)

View File

@ -3723,6 +3723,22 @@ I/O:</property>
<property name="visible">True</property>
<property name="spacing">12</property>
<property name="layout_style">end</property>
<child>
<widget class="GtkButton" id="config-remove">
<property name="label">gtk-remove</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_config_remove_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="config-apply">
<property name="label">gtk-apply</property>
@ -3734,22 +3750,6 @@ I/O:</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_config_apply_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="config-remove">
<property name="label">gtk-remove</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_config_remove_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>