Update non-sparse file UI to match rhel5 patch

This commit is contained in:
Hugh O. Brock 2006-12-20 09:31:09 -05:00
parent 7b2cbb18ad
commit 483f3436aa
2 changed files with 25 additions and 97 deletions

View File

@ -4254,15 +4254,11 @@ For all domains</property>
</widget>
<widget class="GtkWindow" id="vmm-progress">
<property name="width_request">300</property>
<property name="height_request">100</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Saving VM Image</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="modal">False</property>
<property name="default_width">300</property>
<property name="default_height">100</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
@ -7860,89 +7856,6 @@ TB</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label348">
<property name="visible">True</property>
<property name="label" translatable="yes">File _Type:</property>
<property name="use_underline">True</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">4</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox48">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkRadioButton" id="sparse">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">sparse</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="non-sparse">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">non-sparse</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">sparse</property>
</widget>
<packing>
<property name="padding">6</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox49">
<property name="visible">True</property>
@ -7969,7 +7882,7 @@ TB</property>
<child>
<widget class="GtkLabel" id="label349">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;small&gt;&lt;b&gt;Warning:&lt;/b&gt; Creating a guest with sparse file storage is quicker, but it can lead to catastrophic failure of the guest in the event the host file system runs out of space.&lt;/small&gt;</property>
<property name="label" translatable="yes">&lt;small&gt;&lt;b&gt;Warning:&lt;/b&gt; If you do not allocate the entire disk at VM creation, space will be allocated as needed while the guest is running. If sufficient free space is not available on the host, this may result in data corruption on the guest.&lt;/small&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -7999,6 +7912,28 @@ TB</property>
<property name="x_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="non-sparse">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Allocate entire virtual disk now?</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">3</property>
<property name="right_attach">4</property>
<property name="top_attach">7</property>
<property name="bottom_attach">8</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
</widget>

View File

@ -42,7 +42,6 @@ VM_INSTALL_FROM_CD = 2
VM_STORAGE_PARTITION = 1
VM_STORAGE_FILE = 2
VM_STORAGE_FILE_SPARSE = False
DEFAULT_STORAGE_FILE_SIZE = 500
@ -187,7 +186,6 @@ class vmmCreate(gobject.GObject):
self.window.get_widget("create-memory-startup").set_value(500)
self.window.get_widget("create-vcpus").set_value(1)
self.window.get_widget("non-sparse").set_active(True)
self.window.get_widget("sparse").set_active(False)
model = self.window.get_widget("pv-media-url").get_model()
self.populate_url_model(model, self.config.get_media_urls())
model = self.window.get_widget("pv-ks-url").get_model()
@ -516,11 +514,9 @@ class vmmCreate(gobject.GObject):
file = self.get_config_disk_image()
if file != None and len(file) > 0 and not(os.path.exists(file)):
self.window.get_widget("storage-file-size").set_sensitive(True)
self.window.get_widget("sparse").set_sensitive(True)
self.window.get_widget("non-sparse").set_sensitive(True)
else:
self.window.get_widget("storage-file-size").set_sensitive(False)
self.window.get_widget("sparse").set_sensitive(False)
self.window.get_widget("non-sparse").set_sensitive(False)
if file != None and len(file) > 0 and os.path.isfile(file):
size = os.path.getsize(file)/(1024*1024)
@ -547,7 +543,6 @@ class vmmCreate(gobject.GObject):
self.window.get_widget("storage-partition-box").set_sensitive(True)
self.window.get_widget("storage-file-box").set_sensitive(False)
self.window.get_widget("storage-file-size").set_sensitive(False)
self.window.get_widget("sparse").set_sensitive(False)
self.window.get_widget("non-sparse").set_sensitive(False)
else:
self.window.get_widget("storage-partition-box").set_sensitive(False)
@ -721,10 +716,8 @@ class vmmCreate(gobject.GObject):
return "%2.2f MB" % (mem/1024.0)
def is_sparse_file(self):
if self.window.get_widget("sparse").get_active():
return True
elif self.window.get_widget("non-sparse").get_active():
if self.window.get_widget("non-sparse").get_active():
return False
else:
return None
return True