addhw: Fix FS UI for non-qemu

This commit is contained in:
Cole Robinson 2013-09-01 20:07:46 -04:00
parent c79ba14a6a
commit 1ce02cc7d9
2 changed files with 143 additions and 145 deletions

View File

@ -2363,29 +2363,13 @@ access in the guest.</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="left_padding">24</property> <property name="left_padding">24</property>
<child> <child>
<object class="GtkTable" id="table9"> <object class="GtkGrid" id="table9">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child> <child>
<object class="GtkLabel" id="label18"> <object class="GtkHBox" id="fs-type-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-type-combo</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox11">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
@ -2416,28 +2400,13 @@ access in the guest.</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="top_attach">0</property>
<property name="y_options">GTK_FILL</property> <property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="fs-mode-title"> <object class="GtkHBox" id="fs-mode-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Mode:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-mode-combo</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox12">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
@ -2467,30 +2436,13 @@ access in the guest.</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-driver-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Driver:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-driver-combo</property>
</object>
<packing>
<property name="top_attach">2</property> <property name="top_attach">2</property>
<property name="bottom_attach">3</property> <property name="width">1</property>
<property name="x_options">GTK_FILL</property> <property name="height">1</property>
<property name="y_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkHBox" id="hbox15"> <object class="GtkHBox" id="fs-driver-box">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
@ -2521,30 +2473,13 @@ access in the guest.</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="top_attach">1</property>
<property name="top_attach">2</property> <property name="width">1</property>
<property name="bottom_attach">3</property> <property name="height">1</property>
<property name="y_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkLabel" id="fs-wrpolicy-title"> <object class="GtkHBox" id="fs-wrpolicy-box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Write Policy:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-wrpolicy-combo</property>
</object>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkHBox" id="hbox13">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<child> <child>
@ -2574,42 +2509,9 @@ access in the guest.</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property> <property name="top_attach">3</property>
<property name="bottom_attach">4</property> <property name="width">1</property>
<property name="y_options">GTK_FILL</property> <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-source-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label">src labelll:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-source</property>
</object>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label33">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Ta_rget path:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-target</property>
</object>
<packing>
<property name="top_attach">5</property>
<property name="bottom_attach">6</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -2620,10 +2522,9 @@ access in the guest.</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">5</property> <property name="top_attach">5</property>
<property name="bottom_attach">6</property> <property name="width">1</property>
<property name="y_options">GTK_FILL</property> <property name="height">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -2638,15 +2539,11 @@ access in the guest.</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">6</property> <property name="top_attach">6</property>
<property name="bottom_attach">7</property> <property name="width">1</property>
<property name="y_options">GTK_FILL</property> <property name="height">1</property>
</packing> </packing>
</child> </child>
<child>
<placeholder/>
</child>
<child> <child>
<object class="GtkHBox" id="hbox16"> <object class="GtkHBox" id="hbox16">
<property name="visible">True</property> <property name="visible">True</property>
@ -2682,10 +2579,120 @@ access in the guest.</property>
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property> <property name="top_attach">4</property>
<property name="bottom_attach">5</property> <property name="width">1</property>
<property name="y_options">GTK_FILL</property> <property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label18">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Type:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-type-combo</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="fs-mode-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Mode:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-mode-combo</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-driver-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Driver:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-driver-combo</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="fs-wrpolicy-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Write Policy:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-wrpolicy-combo</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="fs-source-title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label">src labelll:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-source</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label33">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Ta_rget path:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">fs-target</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment20">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
<property name="width">1</property>
<property name="height">1</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -1148,30 +1148,21 @@ class vmmAddHardware(vmmGObjectUI):
self.show_pair_combo("fs-wrpolicy", show_wrpolicy_combo) self.show_pair_combo("fs-wrpolicy", show_wrpolicy_combo)
def change_fs_driver(self, src): def change_fs_driver(self, src):
idx = src.get_active()
fsdriver = None fsdriver = None
modecombo = self.widget("fs-mode-combo") idx = src.get_active()
modelabel1 = self.widget("fs-mode-title")
wrpcombo = self.widget("fs-wrpolicy-combo")
wrplabel1 = self.widget("fs-wrpolicy-title")
if idx >= 0 and src.get_property("visible"): if idx >= 0 and src.get_property("visible"):
fsdriver = src.get_model()[idx][0] fsdriver = src.get_model()[idx][0]
if (fsdriver == virtinst.VirtualFilesystem.DRIVER_PATH or show_mode = bool(
fsdriver == virtinst.VirtualFilesystem.DRIVER_DEFAULT): fsdriver == virtinst.VirtualFilesystem.DRIVER_PATH or
modecombo.set_property("visible", True) fsdriver == virtinst.VirtualFilesystem.DRIVER_DEFAULT)
modelabel1.set_property("visible", True) self.widget("fs-mode-title").set_visible(show_mode)
else: self.widget("fs-mode-box").set_visible(show_mode)
modecombo.set_property("visible", False)
modelabel1.set_property("visible", False)
if (fsdriver == virtinst.VirtualFilesystem.DRIVER_DEFAULT): show_wrpol = bool(
wrpcombo.set_property("visible", False) fsdriver and fsdriver != virtinst.VirtualFilesystem.DRIVER_DEFAULT)
wrplabel1.set_property("visible", False) self.widget("fs-wrpolicy-title").set_visible(show_wrpol)
else: self.widget("fs-wrpolicy-box").set_visible(show_wrpol)
wrpcombo.set_property("visible", True)
wrplabel1.set_property("visible", True)