mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 21:18:04 +03:00
createpool: Remove 'build' checkbox
We only showed it for disk pools, and it determined whether we partition the device or not. I don't think this gets much usage and there are much better tools for that job. If users aren't sure what they are doing they can lose data. Drop the UI, which always defaults to build=False for disk pools, and expect the user to partition the device themselves. Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
c6830740f3
commit
f61bf516df
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<!-- Generated with glade 3.36.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.22"/>
|
||||
<object class="GtkWindow" id="vmm-create-pool">
|
||||
@ -9,9 +9,6 @@
|
||||
<property name="title" translatable="yes">Add a New Storage Pool</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="delete-event" handler="on_vmm_create_pool_delete_event" swapped="no"/>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
@ -99,20 +96,6 @@
|
||||
<property name="valign">start</property>
|
||||
<property name="row_spacing">4</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="pool-build-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">B_uild Pool:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">pool-build</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="pool-iqn-box">
|
||||
<property name="visible">True</property>
|
||||
@ -305,20 +288,6 @@
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="pool-build">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">9</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="pool-source-name-label">
|
||||
<property name="visible">True</property>
|
||||
@ -483,9 +452,6 @@
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@ -547,5 +513,8 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="titlebar">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
@ -123,8 +123,6 @@ class vmmCreatePool(vmmGObjectUI):
|
||||
self.widget("pool-iqn-chk").toggled()
|
||||
self.widget("pool-iqn").set_text("")
|
||||
self.widget("pool-format").set_active(0)
|
||||
self.widget("pool-build").set_sensitive(True)
|
||||
self.widget("pool-build").set_active(False)
|
||||
|
||||
uiutil.set_list_selection(self.widget("pool-type"), 0)
|
||||
self._show_options_by_pool()
|
||||
@ -176,18 +174,12 @@ class vmmCreatePool(vmmGObjectUI):
|
||||
return plist
|
||||
|
||||
def _get_build_default(self, pooltype):
|
||||
""" Return (default value, whether build option can be changed)"""
|
||||
if pooltype in [StoragePool.TYPE_DIR,
|
||||
StoragePool.TYPE_FS,
|
||||
StoragePool.TYPE_NETFS]:
|
||||
# Building for these simply entails creating a directory
|
||||
return (True, False)
|
||||
elif pooltype in [StoragePool.TYPE_DISK]:
|
||||
# This is a dangerous operation, anything (False, True)
|
||||
# should be assumed to be one.
|
||||
return (False, True)
|
||||
|
||||
return (False, False)
|
||||
return True
|
||||
return False
|
||||
|
||||
def _show_options_by_pool(self):
|
||||
def show_row(base, do_show):
|
||||
@ -202,7 +194,6 @@ class vmmCreatePool(vmmGObjectUI):
|
||||
host = pool.supports_hosts()
|
||||
fmt = pool.supports_format()
|
||||
iqn = pool.supports_iqn()
|
||||
builddef, buildsens = self._get_build_default(pool.type)
|
||||
|
||||
src_name = pool.supports_source_name()
|
||||
is_lvm = pool.type == StoragePool.TYPE_LOGICAL
|
||||
@ -219,7 +210,6 @@ class vmmCreatePool(vmmGObjectUI):
|
||||
show_row("pool-source", src)
|
||||
show_row("pool-hostname", host)
|
||||
show_row("pool-format", fmt)
|
||||
show_row("pool-build", buildsens)
|
||||
show_row("pool-iqn", iqn)
|
||||
show_row("pool-source-name", src_name)
|
||||
|
||||
@ -240,7 +230,6 @@ class vmmCreatePool(vmmGObjectUI):
|
||||
|
||||
self.widget("pool-target-button").set_sensitive(tgt_b)
|
||||
self.widget("pool-source-button").set_sensitive(src_b)
|
||||
self.widget("pool-build").set_active(builddef)
|
||||
|
||||
if src_name:
|
||||
self.widget("pool-source-name").get_child().set_text(
|
||||
@ -335,16 +324,6 @@ class vmmCreatePool(vmmGObjectUI):
|
||||
def _validate(self, pool):
|
||||
pool.validate()
|
||||
|
||||
buildval = self.widget("pool-build").get_active()
|
||||
buildsen = (self.widget("pool-build").get_sensitive() and
|
||||
self.widget("pool-build").get_visible())
|
||||
if buildsen and buildval:
|
||||
ret = self.err.yes_no(_("Building a pool of this type will "
|
||||
"format the source device. Are you "
|
||||
"sure you want to 'build' this pool?"))
|
||||
if not ret:
|
||||
return ret
|
||||
|
||||
|
||||
##################
|
||||
# Object install #
|
||||
@ -383,12 +362,12 @@ class vmmCreatePool(vmmGObjectUI):
|
||||
try:
|
||||
if self._validate(pool) is False:
|
||||
return
|
||||
build = self._get_build_default(pool.type)
|
||||
except Exception as e: # pragma: no cover
|
||||
return self.err.show_err(_("Error validating pool: %s") % e)
|
||||
|
||||
self.reset_finish_cursor()
|
||||
|
||||
build = self.widget("pool-build").get_active()
|
||||
progWin = vmmAsyncJob(self._async_pool_create, [pool, build],
|
||||
self._finish_cb, [pool],
|
||||
_("Creating storage pool..."),
|
||||
|
Loading…
Reference in New Issue
Block a user