mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +03:00
create-vol: Don't allow creating vol without a name entered
This commit is contained in:
parent
06623507ed
commit
5c2875aa97
@ -62,6 +62,7 @@ class vmmCreateVolume(gobject.GObject):
|
||||
"on_vmm_create_vol_delete_event" : self.close,
|
||||
"on_vol_cancel_clicked" : self.close,
|
||||
"on_vol_create_clicked" : self.finish,
|
||||
"on_vol_name_changed" : self.vol_name_changed,
|
||||
})
|
||||
|
||||
format_list = self.window.get_widget("vol-format")
|
||||
@ -99,6 +100,7 @@ class vmmCreateVolume(gobject.GObject):
|
||||
|
||||
def reset_state(self):
|
||||
self.window.get_widget("vol-name").set_text("")
|
||||
self.window.get_widget("vol-create").set_sensitive(False)
|
||||
self.populate_vol_format()
|
||||
self.populate_vol_suffix()
|
||||
|
||||
@ -138,6 +140,10 @@ class vmmCreateVolume(gobject.GObject):
|
||||
suffix = ".img"
|
||||
self.window.get_widget("vol-name-suffix").set_text(suffix)
|
||||
|
||||
def vol_name_changed(self, src):
|
||||
text = src.get_text()
|
||||
self.window.get_widget("vol-create").set_sensitive(bool(text))
|
||||
|
||||
def finish(self, src):
|
||||
# validate input
|
||||
try:
|
||||
|
@ -107,6 +107,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<signal name="changed" handler="on_vol_name_changed"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
|
Loading…
Reference in New Issue
Block a user