diff --git a/virtManager/host.py b/virtManager/host.py index 5211acb6a..bee6e75d0 100644 --- a/virtManager/host.py +++ b/virtManager/host.py @@ -100,8 +100,6 @@ class vmmHost(vmmGObjectUI): if not self.is_visible(): return - self._confirm_changes() - self.topwin.hide() vmmEngine.get_instance().decrement_window_counter() @@ -189,9 +187,6 @@ class vmmHost(vmmGObjectUI): self._hostnets.close() self._storagelist.close() - def _confirm_changes(self): - return True - ################ # UI listeners # @@ -217,7 +212,6 @@ class vmmHost(vmmGObjectUI): self.conn.set_autoconnect(src.get_active()) def _page_changed_cb(self, src, child, pagenum): - self._confirm_changes() if pagenum == 1: self._hostnets.refresh_page() elif pagenum == 2: diff --git a/virtManager/hostnets.py b/virtManager/hostnets.py index ddb15f10e..224014877 100644 --- a/virtManager/hostnets.py +++ b/virtManager/hostnets.py @@ -450,9 +450,12 @@ class vmmHostNets(vmmGObjectUI): self._active_edits.add(edittype) def _confirm_changes(self): - if self._active_edits and self.err.confirm_unapplied_changes(): + if (self.is_visible() and + self._active_edits and + self.err.confirm_unapplied_changes()): self._net_apply() - self._active_edits = set() + + self._disable_net_apply() return True diff --git a/virtManager/storagelist.py b/virtManager/storagelist.py index a73ebb6a1..465b7ed90 100644 --- a/virtManager/storagelist.py +++ b/virtManager/storagelist.py @@ -485,13 +485,12 @@ class vmmStorageList(vmmGObjectUI): _("Error deleting pool '%s'") % pool.get_name()) def _pool_refresh_cb(self, src): - if not self._confirm_changes(): - return - pool = self._current_pool() if pool is None: return + self._confirm_changes() + logging.debug("Refresh pool '%s'", pool.get_name()) vmmAsyncJob.simple_async_noshow(pool.refresh, [], self, _("Error refreshing pool '%s'") % pool.get_name()) @@ -584,9 +583,12 @@ class vmmStorageList(vmmGObjectUI): self.widget("pool-apply").set_sensitive(False) def _confirm_changes(self): - if self._active_edits and self.err.confirm_unapplied_changes(): + if (self.is_visible() and + self._active_edits and + self.err.confirm_unapplied_changes()): self._pool_apply() - self._active_edits = set() + + self._disable_pool_apply() return True