def reset_state(self, conn=None): if conn and conn != self.conn: self.remove_conn() self.conn = conn pool_list = self.widget("pool-list") host.populate_storage_pools(pool_list, self.conn) ids = [] ids.append(self.conn.connect("pool-added", self.repopulate_storage_pools)) ids.append(self.conn.connect("pool-removed", self.repopulate_storage_pools)) ids.append(self.conn.connect("pool-started", self.refresh_storage_pool)) ids.append(self.conn.connect("pool-stopped", self.refresh_storage_pool)) self.conn_signal_ids = ids # FIXME: Need a connection specific "vol-added" function? # Won't be able to pick that change up from outside? # Manually trigger vol_selected, so buttons are in the correct state self.vol_selected() self.pool_selected() tooltip = "" is_remote = self.conn.is_remote() self.widget("browse-local").set_sensitive(not is_remote) if is_remote: tooltip = _("Cannot use local storage on remote connection.") self.widget("browse-local").set_tooltip_text(tooltip) # Set data based on browse type self.local_args["dialog_type"] = None self.local_args["browse_reason"] = self.browse_reason data = self.config.browse_reason_data.get(self.browse_reason) if data: self.topwin.set_title(data["storage_title"]) self.local_args["dialog_name"] = data["local_title"] self.local_args["dialog_type"] = data.get("dialog_type") self.local_args["choose_button"] = data.get("choose_button")
def repopulate_storage_pools(self, src_ignore, uuid_ignore): pool_list = self.widget("pool-list") host.populate_storage_pools(pool_list, self.conn)
def repopulate_storage_pools(self, src_ignore=None, uuid_ignore=None): pool_list = self.widget("pool-list") host.populate_storage_pools(pool_list, self.conn, self.current_pool())