host: Make sure first object selected when conn connects

Previously it was dictated by what order we received conn
signals in.
This commit is contained in:
Cole Robinson 2015-04-10 12:57:40 -04:00
parent 838baf6946
commit 49e3ea2cdf
2 changed files with 10 additions and 7 deletions

View File

@ -244,7 +244,6 @@ class vmmHost(vmmGObjectUI):
self.memory_usage_graph.show()
self.widget("performance-memory-align").add(self.memory_usage_graph)
def show(self):
logging.debug("Showing host details: %s", self.conn)
vis = self.is_visible()
@ -347,6 +346,8 @@ class vmmHost(vmmGObjectUI):
_("Libvirt connection does not support interface management."))
if conn_active:
uiutil.set_list_selection(self.widget("net-list"), 0)
uiutil.set_list_selection(self.widget("interface-list"), 0)
return
self.set_net_error_page(_("Connection not active."))

View File

@ -561,15 +561,17 @@ class vmmStorageList(vmmGObjectUI):
self.widget("pool-add").set_sensitive(conn_active and
self.conn.is_storage_capable())
if not conn_active:
self._set_storage_error_page(_("Connection not active."))
self._populate_pools()
return
if not self.conn.is_storage_capable():
if conn_active and not self.conn.is_storage_capable():
self._set_storage_error_page(
_("Libvirt connection does not support storage management."))
if conn_active:
uiutil.set_list_selection(self.widget("pool-list"), 0)
return
self._set_storage_error_page(_("Connection not active."))
self._populate_pools()
def _pool_changed(self, pool):
self._update_pool_row(pool.get_connkey())