Improve default widget focus for various wizards

This commit is contained in:
Cole Robinson 2009-12-14 16:26:46 -05:00
parent 3ed0625000
commit 985dd91f26
8 changed files with 19 additions and 2 deletions

View File

@ -690,6 +690,7 @@ class vmmAddHardware(gobject.GObject):
else:
notebook.set_current_page(PAGE_SUMMARY)
self.window.get_widget("create-finish").show()
self.window.get_widget("create-finish").grab_focus()
self.window.get_widget("create-forward").hide()
self.window.get_widget("create-back").set_sensitive(True)

View File

@ -110,6 +110,7 @@ class vmmCreate(gobject.GObject):
"on_create_help_clicked": self.show_help,
"on_create_pages_switch_page": self.page_changed,
"on_create_vm_name_activate": self.forward,
"on_create_conn_changed": self.conn_changed,
"on_install_url_box_changed": self.url_box_changed,
@ -1011,7 +1012,7 @@ class vmmCreate(gobject.GObject):
notebook.set_current_page(curpage - 1)
def forward(self, src):
def forward(self, ignore):
notebook = self.window.get_widget("create-pages")
curpage = notebook.get_current_page()
@ -1025,7 +1026,7 @@ class vmmCreate(gobject.GObject):
# PV or FV
self.guest_from_install_type()
self.window.get_widget("create-forward").grab_focus()
notebook.set_current_page(curpage + 1)
def page_changed(self, ignore1, ignore2, pagenum):
@ -1048,6 +1049,7 @@ class vmmCreate(gobject.GObject):
if pagenum == PAGE_FINISH:
self.window.get_widget("create-forward").hide()
self.window.get_widget("create-finish").show()
self.window.get_widget("create-finish").grab_focus()
self.populate_summary()
# Repopulate the HV list, so we can make install method relevant

View File

@ -61,6 +61,8 @@ class vmmCreateNetwork(gobject.GObject):
"on_create_back_clicked" : self.back,
"on_create_forward_clicked" : self.forward,
"on_create_finish_clicked" : self.finish,
"on_net_name_activate": self.forward,
"on_net_forward_toggled" : self.change_forward_type,
"on_net_network_changed": self.change_network,
"on_net_dhcp_enable_toggled": self.change_dhcp_enable,
@ -140,6 +142,7 @@ class vmmCreateNetwork(gobject.GObject):
if(self.validate(notebook.get_current_page()) != True):
return
self.window.get_widget("create-forward").grab_focus()
notebook.next_page()
def back(self, ignore=None):
@ -302,6 +305,7 @@ class vmmCreateNetwork(gobject.GObject):
self.window.get_widget("summary-forwarding").set_text(forward_txt)
self.window.get_widget("create-forward").hide()
self.window.get_widget("create-finish").show()
self.window.get_widget("create-finish").grab_focus()
def close(self, ignore1=None,ignore2=None):
self.topwin.hide()

View File

@ -67,6 +67,7 @@ class vmmCreatePool(gobject.GObject):
"on_pool_source_button_clicked" : self.browse_source_path,
"on_pool_target_button_clicked" : self.browse_target_path,
"on_pool_name_activate": self.forward,
"on_pool_hostname_activate" : self.hostname_changed,
"on_pool_name_focus_in_event": (self.update_doc, "name",
@ -170,6 +171,7 @@ class vmmCreatePool(gobject.GObject):
self.window.get_widget("pool-back").set_sensitive(False)
self.window.get_widget("pool-name").set_text("")
self.window.get_widget("pool-name").grab_focus()
self.window.get_widget("pool-type").set_active(0)
self.window.get_widget("pool-target-path").child.set_text("")
self.window.get_widget("pool-source-path").child.set_text("")
@ -385,6 +387,7 @@ class vmmCreatePool(gobject.GObject):
if notebook.get_current_page() == PAGE_FORMAT:
self.finish()
else:
self.window.get_widget("pool-forward").grab_focus()
notebook.next_page()
except Exception, e:
self.err.show_err(_("Uncaught error validating input: %s") % str(e),
@ -439,6 +442,7 @@ class vmmCreatePool(gobject.GObject):
self.window.get_widget("pool-back").set_sensitive(False)
self.window.get_widget("pool-finish").hide()
self.window.get_widget("pool-forward").show()
self.window.get_widget("pool-forward").grab_focus()
elif page_number == PAGE_FORMAT:
self.show_options_by_pool()
self.window.get_widget("pool-target-path").child.set_text(self._pool.target_path)
@ -447,6 +451,7 @@ class vmmCreatePool(gobject.GObject):
self.window.get_widget("pool-build").set_sensitive(buildret[1])
self.window.get_widget("pool-build").set_active(buildret[0])
self.window.get_widget("pool-finish").show()
self.window.get_widget("pool-finish").grab_focus()
self.window.get_widget("pool-forward").hide()
def get_pool_to_validate(self):

View File

@ -296,6 +296,7 @@
<accessibility>
<atkproperty name="AtkObject::accessible-name" translatable="yes">Net Name Field</atkproperty>
</accessibility>
<signal name="activate" handler="on_net_name_activate"/>
</widget>
<packing>
<property name="left_attach">1</property>
@ -1602,6 +1603,7 @@
<property name="label">gtk-go-forward</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_create_forward_clicked"/>

View File

@ -151,6 +151,7 @@
<property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property>
<signal name="focus_in_event" handler="on_pool_name_focus_in_event"/>
<signal name="activate" handler="on_pool_name_activate"/>
</widget>
<packing>
<property name="left_attach">1</property>

View File

@ -132,6 +132,7 @@
<widget class="GtkEntry" id="create-vm-name">
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="activate" handler="on_create_vm_name_activate"/>
</widget>
<packing>
<property name="left_attach">1</property>

View File

@ -121,6 +121,7 @@
<property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="on_delete_cancel_clicked"/>