clone: Show destination host if on a remote connection (bz 881099)
This commit is contained in:
parent
d3bd70daca
commit
032dd0cf21
75
ui/clone.ui
75
ui/clone.ui
|
@ -91,23 +91,11 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">3</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Create a clone based on:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="clone-orig-name">
|
||||
<property name="visible">True</property>
|
||||
|
@ -116,14 +104,58 @@
|
|||
<property name="label">orig name</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Create clone based on:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label9">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">1</property>
|
||||
<property name="label" translatable="yes">Destination host:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="clone-dest-host">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label">dest host</property>
|
||||
<property name="lines">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="width">1</property>
|
||||
<property name="height">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
|
@ -139,7 +171,7 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="column_spacing">18</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<property name="row_spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox6">
|
||||
|
@ -747,9 +779,6 @@ like change passwords or static IPs, please see the virt-sysprep(1) tool.</sp
|
|||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
|
@ -26,6 +26,7 @@ from gi.repository import Gtk
|
|||
from gi.repository import Gdk
|
||||
# pylint: enable=E0611
|
||||
|
||||
from virtManager import uiutil
|
||||
from virtManager.baseclass import vmmGObjectUI
|
||||
from virtManager.asyncjob import vmmAsyncJob
|
||||
from virtManager.storagebrowse import vmmStorageBrowser
|
||||
|
@ -234,6 +235,10 @@ class vmmCloneVM(vmmGObjectUI):
|
|||
self.widget("clone-orig-name").set_text(cd.original_guest)
|
||||
self.widget("clone-new-name").set_text(cd.clone_name)
|
||||
|
||||
uiutil.set_grid_row_visible(
|
||||
self.widget("clone-dest-host"), self.conn.is_remote())
|
||||
self.widget("clone-dest-host").set_text(self.conn.get_hostname())
|
||||
|
||||
# We need to determine which disks fail (and why).
|
||||
self.storage_list, self.target_list = self.check_all_storage()
|
||||
|
||||
|
|
|
@ -308,8 +308,7 @@ class vmmConnection(vmmGObject):
|
|||
return hostname[0:offset]
|
||||
return hostname
|
||||
|
||||
def get_hostname(self, resolveLocal=False):
|
||||
ignore = resolveLocal
|
||||
def get_hostname(self):
|
||||
try:
|
||||
return self.get_qualified_hostname()
|
||||
except:
|
||||
|
|
|
@ -297,9 +297,8 @@ class VirtualConnection(object):
|
|||
return self._fake_pretty_name
|
||||
|
||||
def is_remote(self):
|
||||
if (hasattr(self, "_virtinst__fake_conn_remote") or
|
||||
self._urisplits[2]):
|
||||
return True
|
||||
return (hasattr(self, "_virtinst__fake_conn_remote") or
|
||||
self._urisplits[2])
|
||||
|
||||
def get_uri_hostname(self):
|
||||
return self._urisplits[2] or "localhost"
|
||||
|
|
Loading…
Reference in New Issue