908926225e
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=146ca798b89e562a00f77a0bede15da3
76 lines
3.3 KiB
Diff
76 lines
3.3 KiB
Diff
# HG changeset patch
|
|
# User Cole Robinson <crobinso@redhat.com>
|
|
# Date 1252939197 14400
|
|
# Node ID 486cd6791c3926420786d30401a690884acdf653
|
|
# Parent 043ca66e19aabcdb89b8bbe76ef5ded8b0c0fc54
|
|
Fix populating text box with storage browser selection in 'New VM' (bz 517263)
|
|
|
|
We were only properly setting the 'finish' callback for the first time the
|
|
storage browser was launched. All subsequent runs would not enter anything
|
|
in the associated text box.
|
|
|
|
Index: virt-manager-0.8.0/src/virtManager/addhardware.py
|
|
===================================================================
|
|
--- virt-manager-0.8.0.orig/src/virtManager/addhardware.py
|
|
+++ virt-manager-0.8.0/src/virtManager/addhardware.py
|
|
@@ -80,7 +80,6 @@ class vmmAddHardware(gobject.GObject):
|
|
_("An unexpected error occurred"))
|
|
|
|
self.storage_browser = None
|
|
- self._browse_cb_id = None
|
|
|
|
self._dev = None
|
|
|
|
@@ -911,10 +910,8 @@ class vmmAddHardware(gobject.GObject):
|
|
conn = self.vm.get_connection()
|
|
if self.storage_browser == None:
|
|
self.storage_browser = vmmStorageBrowser(self.config, conn, False)
|
|
- if self._browse_cb_id:
|
|
- self.storage_browser.disconnect(self._browse_cb_id)
|
|
|
|
- self._browse_cb_id = self.storage_browser.connect("storage-browse-finish", set_storage_cb)
|
|
+ self.storage_browser.set_finish_cb(set_storage_cb)
|
|
self.storage_browser.local_args = { "dialog_name": dialog_name,
|
|
"confirm_func": confirm_func,
|
|
"browse_reason":
|
|
Index: virt-manager-0.8.0/src/virtManager/create.py
|
|
===================================================================
|
|
--- virt-manager-0.8.0.orig/src/virtManager/create.py
|
|
+++ virt-manager-0.8.0/src/virtManager/create.py
|
|
@@ -1644,8 +1644,9 @@ class vmmCreate(gobject.GObject):
|
|
if self.storage_browser == None:
|
|
self.storage_browser = vmmStorageBrowser(self.config, self.conn,
|
|
is_media)
|
|
- self.storage_browser.connect("storage-browse-finish",
|
|
- callback)
|
|
+
|
|
+ self.storage_browser.set_finish_cb(callback)
|
|
+
|
|
if is_media:
|
|
reason = self.config.CONFIG_DIR_MEDIA
|
|
else:
|
|
Index: virt-manager-0.8.0/src/virtManager/storagebrowse.py
|
|
===================================================================
|
|
--- virt-manager-0.8.0.orig/src/virtManager/storagebrowse.py
|
|
+++ virt-manager-0.8.0/src/virtManager/storagebrowse.py
|
|
@@ -47,6 +47,7 @@ class vmmStorageBrowser(gobject.GObject)
|
|
self.config = config
|
|
self.conn = conn
|
|
self.conn_signal_ids = []
|
|
+ self.finish_cb_id = None
|
|
|
|
self.topwin = self.window.get_widget("vmm-storage-browse")
|
|
self.err = vmmErrorDialog(self.topwin,
|
|
@@ -89,6 +90,11 @@ class vmmStorageBrowser(gobject.GObject)
|
|
self.addvol.close()
|
|
return 1
|
|
|
|
+ def set_finish_cb(self, callback):
|
|
+ if self.finish_cb_id:
|
|
+ self.disconnect(self.finish_cb_id)
|
|
+ self.finish_cb_id = self.connect("storage-browse-finish", callback)
|
|
+
|
|
def set_initial_state(self):
|
|
pool_list = self.window.get_widget("pool-list")
|
|
virtManager.host.init_pool_list(pool_list, self.pool_selected)
|