From: David Shea dshea@redhat.com
Cherry pick from David Shea's work on master for bz#1212586 in commit fc8c9a7676d1c3ffff9c70501b8cbc7713e31396.
A minimum width of 35 in the device label causes problems with smaller resolutions (800x600). Remove width_chars so that the label wraps earlier than the max width if it needs to, and change the wrap mode from word to word-char to ensure that device names with extra long words get wrapped ugly instead of causing layout issues.
Resolves: rhbz#1212615 --- pyanaconda/ui/gui/spokes/custom.glade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade index 8407dda..14371f3 100644 --- a/pyanaconda/ui/gui/spokes/custom.glade +++ b/pyanaconda/ui/gui/spokes/custom.glade @@ -524,8 +524,8 @@ <property name="valign">start</property> <property name="xalign">0</property> <property name="wrap">True</property> - <property name="width_chars">35</property> <property name="angle">0.01</property> + <property name="wrap_mode">word-char</property> <property name="max_width_chars">35</property> </object> <packing>
From: David Shea dshea@redhat.com
Cherry pick from David Shea's work for #1170275 as it appears on master in commit b4ef2f17c864987571ed1dad10724ccc6afa5aff.
This way super-long container types (LVM Thin Provisioning, translations of LVM Thin Provisioning), RAID descriptions and container names won't blow out the window size. For container names, ellipsize in the middle instead of the end so that supercrazylongcontainername-data01 is easily distinguishable from supercrazylongcontainername-data02. In all cases the full string is visible when the ComboBox is expanded.
Resolves: rhbz#1212615 --- pyanaconda/ui/gui/spokes/custom.glade | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade index 14371f3..fb326c7 100644 --- a/pyanaconda/ui/gui/spokes/custom.glade +++ b/pyanaconda/ui/gui/spokes/custom.glade @@ -108,9 +108,6 @@ <property name="margin_left">6</property> <property name="margin_right">6</property> <property name="margin_top">6</property> - <child> - <placeholder/> - </child> </object> </child> </object> @@ -645,7 +642,9 @@ <signal name="changed" handler="on_device_type_changed" swapped="no"/> <signal name="changed" handler="on_value_changed" swapped="no"/> <child> - <object class="GtkCellRendererText" id="deviceTypeRenderer"/> + <object class="GtkCellRendererText" id="deviceTypeRenderer"> + <property name="ellipsize">end</property> + </object> <attributes> <attribute name="text">0</attribute> </attributes> @@ -816,7 +815,9 @@ <property name="model">containerStore</property> <signal name="changed" handler="on_container_changed" swapped="no"/> <child> - <object class="GtkCellRendererText" id="descRenderer"/> + <object class="GtkCellRendererText" id="descRenderer"> + <property name="ellipsize">middle</property> + </object> <attributes> <attribute name="text">0</attribute> </attributes> @@ -899,7 +900,9 @@ <property name="model">raidStoreFiltered</property> <signal name="changed" handler="on_value_changed" swapped="no"/> <child> - <object class="GtkCellRendererText" id="raidLevelRenderer"/> + <object class="GtkCellRendererText" id="raidLevelRenderer"> + <property name="ellipsize">end</property> + </object> <attributes> <attribute name="markup">0</attribute> </attributes>
From: David Shea dshea@redhat.com
Hurray, noise! --- pyanaconda/ui/gui/spokes/custom.glade | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade index fb326c7..2ce6358 100644 --- a/pyanaconda/ui/gui/spokes/custom.glade +++ b/pyanaconda/ui/gui/spokes/custom.glade @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.19.0 --> <interface> <requires lib="gtk+" version="3.2"/> <requires lib="AnacondaWidgets" version="3.0"/> @@ -275,8 +275,8 @@ <object class="GtkLabel" id="selectedDeviceLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="yalign">0</property> <property name="label" translatable="yes">Selected Device</property> + <property name="yalign">0</property> <attributes> <attribute name="weight" value="bold"/> <attribute name="scale" value="1.2"/> @@ -293,8 +293,8 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">end</property> - <property name="yalign">0</property> <property name="label" translatable="yes">Device description</property> + <property name="yalign">0</property> <attributes> <attribute name="style" value="italic"/> </attributes> @@ -354,10 +354,10 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="xalign">0</property> <property name="label" translatable="yes">Mount _Point:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">mountPointEntry</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -402,10 +402,10 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="xalign">0</property> <property name="label" translatable="yes">_Desired Capacity:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">sizeEntry</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -454,10 +454,10 @@ <object class="GtkLabel" id="labelLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes">_Label:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">labelEntry</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -502,8 +502,8 @@ <property name="can_focus">False</property> <property name="halign">start</property> <property name="valign">start</property> - <property name="xalign">0</property> <property name="label" translatable="yes">Device(s):</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -519,11 +519,11 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="valign">start</property> - <property name="xalign">0</property> <property name="wrap">True</property> <property name="angle">0.01</property> <property name="wrap_mode">word-char</property> <property name="max_width_chars">35</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -564,10 +564,10 @@ <object class="GtkLabel" id="nameLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes">_Name:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">nameEntry</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -620,10 +620,10 @@ <object class="GtkLabel" id="deviceTypeLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="GUI|Custom Partitioning|Configure">Device _Type:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">deviceTypeCombo</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -705,10 +705,10 @@ <object class="GtkLabel" id="fileSystemTypeLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="GUI|Custom Partitioning|Configure">File S_ystem:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">fileSystemTypeCombo</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -794,10 +794,10 @@ <object class="GtkLabel" id="containerLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="GUI|Custom Partitioning|Configure">_Volume Group:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">containerCombo</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -879,10 +879,10 @@ <object class="GtkLabel" id="raidLevelLabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes" context="GUI|Custom Partitioning|Configure">RA_ID Level:</property> <property name="use_underline">True</property> <property name="mnemonic_widget">raidLevelCombo</property> + <property name="xalign">0</property> <attributes> <attribute name="weight" value="bold"/> </attributes> @@ -967,12 +967,12 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">end</property> - <property name="xalign">1</property> <property name="label" translatable="yes">Note: The settings you make on this screen will not be applied until you click on the main menu's 'Begin Installation' button.</property> <property name="justify">right</property> <property name="wrap">True</property> <property name="width_chars">39</property> <property name="max_width_chars">39</property> + <property name="xalign">1</property> <attributes> <attribute name="font-desc" value="Cantarell Italic 10"/> </attributes> @@ -1296,8 +1296,8 @@ <object class="GtkLabel" id="incompleteDeviceOptionsLabel"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="wrap">True</property> <property name="yalign">0.43000000715255737</property> - <property name="wrap">True</property> <attributes> <attribute name="font-desc" value="Cantarell 11"/> </attributes> @@ -1356,8 +1356,8 @@ <object class="GtkLabel" id="label1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes">AVAILABLE SPACE</property> + <property name="xalign">0</property> <attributes> <attribute name="scale" value="0.83333333333329995"/> <attribute name="foreground" value="#ffffffffffff"/> @@ -1409,8 +1409,8 @@ <object class="GtkLabel" id="label2"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="xalign">0</property> <property name="label" translatable="yes">TOTAL SPACE</property> + <property name="xalign">0</property> <attributes> <attribute name="scale" value="0.83333333333329995"/> <attribute name="foreground" value="#ffffffffffff"/>
From: David Shea dshea@redhat.com
--- pyanaconda/ui/gui/spokes/custom.glade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade index 2ce6358..7440fd8 100644 --- a/pyanaconda/ui/gui/spokes/custom.glade +++ b/pyanaconda/ui/gui/spokes/custom.glade @@ -374,7 +374,7 @@ <property name="can_focus">True</property> <property name="halign">start</property> <property name="invisible_char">●</property> - <property name="width_chars">20</property> + <property name="width_chars">10</property> <property name="completion">mountPointCompletion</property> <signal name="changed" handler="on_value_changed" swapped="no"/> </object>
From: David Shea dshea@redhat.com
Some architectures (I'm looking at you, ppc) have unusually long filesystem type names, which blows out the window when running at 800x600. Ellipsize long names in the combo box, which means the GtkComboBox text has to be downgraded to a GtkComboBox and the model and renderer handled ourselves. --- pyanaconda/ui/gui/spokes/custom.glade | 17 ++++++++++++++- pyanaconda/ui/gui/spokes/custom.py | 39 +++++++++++++++++++++++------------ 2 files changed, 42 insertions(+), 14 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade index 7440fd8..bc871c7 100644 --- a/pyanaconda/ui/gui/spokes/custom.glade +++ b/pyanaconda/ui/gui/spokes/custom.glade @@ -41,6 +41,12 @@ </row> </data> </object> + <object class="GtkListStore" id="fileSystemStore"> + <columns> + <!-- column-name fs_type --> + <column type="gchararray"/> + </columns> + </object> <object class="GtkListStore" id="mountPointStore"> <columns> <!-- column-name path --> @@ -720,11 +726,20 @@ </packing> </child> <child> - <object class="GtkComboBoxText" id="fileSystemTypeCombo"> + <object class="GtkComboBox" id="fileSystemTypeCombo"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="model">fileSystemStore</property> <signal name="changed" handler="on_fs_type_changed" swapped="no"/> <signal name="changed" handler="on_value_changed" swapped="no"/> + <child> + <object class="GtkCellRendererText" id="fileSystemRenderer"> + <property name="ellipsize">end</property> + </object> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> </object> <packing> <property name="expand">False</property> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 7c316ca..7908edf 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -126,7 +126,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): builderObjects = ["customStorageWindow", "containerStore", "deviceTypeStore", "partitionStore", "raidStoreFiltered", "raidLevelStore", "addImage", "removeImage", "settingsImage", - "mountPointCompletion", "mountPointStore"] + "mountPointCompletion", "mountPointStore", "fileSystemStore"] mainWidgetName = "customStorageWindow" uiFile = "spokes/custom.glade" helpFile = "CustomSpoke.xml" @@ -221,6 +221,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): # Detailed configuration stuff self._encryptCheckbox = self.builder.get_object("encryptCheckbox") self._fsCombo = self.builder.get_object("fileSystemTypeCombo") + self._fsStore = self.builder.get_object("fileSystemStore") self._labelEntry = self.builder.get_object("labelEntry") self._mountPointEntry = self.builder.get_object("mountPointEntry") self._nameEntry = self.builder.get_object("nameEntry") @@ -267,7 +268,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): # Populate the list of valid filesystem types from the format classes. # Unfortunately, we have to narrow them down a little bit more because # this list will include things like PVs and RAID members. - self._fsCombo.remove_all() + self._fsStore.clear()
# Connect viewport scrolling with accordion focus events self._accordion.set_focus_hadjustment(self._partitionsViewport.get_hadjustment()) @@ -288,7 +289,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): (isinstance(obj, FS) or obj.type in ["biosboot", "prepboot", "swap"])) if supported_fs: - actions.add_action(self._fsCombo.append_text, obj.name) + actions.add_action(self._fsStore.append, [obj.name]) self._fs_types.append(obj.name)
actions.fire() @@ -412,6 +413,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._current_selector.set_chosen(False) self._current_selector = None
+ def _get_fstype(self, fstypeCombo): + itr = fstypeCombo.get_active_iter() + if not itr: + return None + + model = fstypeCombo.get_model() + return model[itr][0] + def _get_autopart_type(self, autopartTypeCombo): itr = autopartTypeCombo.get_active_iter() if not itr: @@ -1269,11 +1278,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
def _setup_fstype_combo(self, device): # remove any fs types that aren't supported - remove_indices = [] + remove_iters = [] for idx, row in enumerate(self._fsCombo.get_model()): fs_type = row[0] if fs_type not in self._fs_types: - remove_indices.append(idx) + remove_iters.append(fs_type.iter) continue
if fs_type == device.format.name: @@ -1281,11 +1290,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# remove items from the combobox in reversed order so that item 3 # doesn't become item 2 by removing item 1 etc. - map(self._fsCombo.remove, reversed(remove_indices)) + map(self._fsStore.remove, reversed(remove_iters))
# if the current device has unsupported formatting, add an entry for it if device.format.name not in self._fs_types: - self._fsCombo.append_text(device.format.name) + self._fsStore.append([device.format.name]) self._fsCombo.set_active(len(self._fsCombo.get_model()) - 1)
# Give them a way to reset to original formatting. Whenever we add a @@ -1293,7 +1302,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): if device.exists and \ device.format.type != device.originalFormat.type and \ device.originalFormat.type not in self._fs_types: - self._fsCombo.append_text(device.originalFormat.name) + self._fsStore.append([device.originalFormat.name])
def _setup_device_type_combo(self, device, use_dev, device_name): # these device types should always be listed @@ -2337,7 +2346,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): if not self._initialized: return
- new_type = combo.get_active_text() + itr = combo.get_active_iter() + if not itr: + return + + new_type = self._get_fstype(combo) if new_type is None: return log.debug("fs type changed: %s", new_type) @@ -2421,12 +2434,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): def _resolve_btrfs_restrictions(self, should_be_btrfs): model = self._fsCombo.get_model() btrfs_pos = None - for idx, data in enumerate(model): + for _idx, data in enumerate(model): if data[0] == "btrfs": - btrfs_pos = idx + btrfs_pos = data.iter
active_index = self._fsCombo.get_active() - current_fstype = self._fsCombo.get_active_text() + current_fstype = self._get_fstype(self._fsCombo) if btrfs_pos and not should_be_btrfs: self._fsCombo.remove(btrfs_pos) if current_fstype == "btrfs": @@ -2435,7 +2448,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): active_index = i break elif should_be_btrfs and not btrfs_pos: - self._fsCombo.append_text("btrfs") + self._fsStore.append(["btrfs"]) active_index = len(self._fsCombo.get_model()) - 1
self._fsCombo.set_active(active_index)
On 07/06/2015 10:53 AM, Robert Marshall wrote:
GtkComboBox text has to be downgraded to a GtkComboBox and the model
I meant "GtkComboBoxText" here instead of "GtkComboBox text". Also the last three need the Resolves: lines.
On 07/06/2015 10:53 AM, Robert Marshall wrote:
@@ -1269,11 +1278,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
def _setup_fstype_combo(self, device): # remove any fs types that aren't supported
remove_indices = []
remove_iters = [] for idx, row in enumerate(self._fsCombo.get_model()): fs_type = row[0] if fs_type not in self._fs_types:
remove_indices.append(idx)
remove_iters.append(fs_type.iter) continue if fs_type == device.format.name:
fs_type.iter should be row.iter.
@@ -2337,7 +2346,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): if not self._initialized: return
new_type = combo.get_active_text()
itr = combo.get_active_iter()
if not itr:
return
The three new lines here are unnecessary, _get_fstype below handles all of that.
new_type = self._get_fstype(combo) if new_type is None: return log.debug("fs type changed: %s", new_type)
From: David Shea dshea@redhat.com
The PPC architecture has an unusually long filesystem type names, which blows out the window when running at 800x600. Ellipsize long names in the combo box, which means the GtkComboBoxtext has to be downgraded to a GtkComboBox and the model and renderer handled ourselves.
Resolves: rhbz#1212615 --- pyanaconda/ui/gui/spokes/custom.glade | 17 ++++++++++++++- pyanaconda/ui/gui/spokes/custom.py | 41 ++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 16 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade index 7440fd8..bc871c7 100644 --- a/pyanaconda/ui/gui/spokes/custom.glade +++ b/pyanaconda/ui/gui/spokes/custom.glade @@ -41,6 +41,12 @@ </row> </data> </object> + <object class="GtkListStore" id="fileSystemStore"> + <columns> + <!-- column-name fs_type --> + <column type="gchararray"/> + </columns> + </object> <object class="GtkListStore" id="mountPointStore"> <columns> <!-- column-name path --> @@ -720,11 +726,20 @@ </packing> </child> <child> - <object class="GtkComboBoxText" id="fileSystemTypeCombo"> + <object class="GtkComboBox" id="fileSystemTypeCombo"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="model">fileSystemStore</property> <signal name="changed" handler="on_fs_type_changed" swapped="no"/> <signal name="changed" handler="on_value_changed" swapped="no"/> + <child> + <object class="GtkCellRendererText" id="fileSystemRenderer"> + <property name="ellipsize">end</property> + </object> + <attributes> + <attribute name="text">0</attribute> + </attributes> + </child> </object> <packing> <property name="expand">False</property> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index d36d147..9c3b041 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -126,7 +126,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): builderObjects = ["customStorageWindow", "containerStore", "deviceTypeStore", "partitionStore", "raidStoreFiltered", "raidLevelStore", "addImage", "removeImage", "settingsImage", - "mountPointCompletion", "mountPointStore"] + "mountPointCompletion", "mountPointStore", "fileSystemStore"] mainWidgetName = "customStorageWindow" uiFile = "spokes/custom.glade" helpFile = "CustomSpoke.xml" @@ -221,6 +221,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): # Detailed configuration stuff self._encryptCheckbox = self.builder.get_object("encryptCheckbox") self._fsCombo = self.builder.get_object("fileSystemTypeCombo") + self._fsStore = self.builder.get_object("fileSystemStore") self._labelEntry = self.builder.get_object("labelEntry") self._mountPointEntry = self.builder.get_object("mountPointEntry") self._nameEntry = self.builder.get_object("nameEntry") @@ -267,7 +268,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): # Populate the list of valid filesystem types from the format classes. # Unfortunately, we have to narrow them down a little bit more because # this list will include things like PVs and RAID members. - self._fsCombo.remove_all() + self._fsStore.clear()
# Connect viewport scrolling with accordion focus events self._accordion.set_focus_hadjustment(self._partitionsViewport.get_hadjustment()) @@ -288,7 +289,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): (isinstance(obj, FS) or obj.type in ["biosboot", "prepboot", "swap"])) if supported_fs: - actions.add_action(self._fsCombo.append_text, obj.name) + actions.add_action(self._fsStore.append, [obj.name]) self._fs_types.append(obj.name)
actions.fire() @@ -412,6 +413,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._current_selector.set_chosen(False) self._current_selector = None
+ def _get_fstype(self, fstypeCombo): + itr = fstypeCombo.get_active_iter() + if not itr: + return None + + model = fstypeCombo.get_model() + return model[itr][0] + def _get_autopart_type(self, autopartTypeCombo): itr = autopartTypeCombo.get_active_iter() if not itr: @@ -1269,11 +1278,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
def _setup_fstype_combo(self, device): # remove any fs types that aren't supported - remove_indices = [] + remove_iters = [] for idx, row in enumerate(self._fsCombo.get_model()): fs_type = row[0] if fs_type not in self._fs_types: - remove_indices.append(idx) + remove_iters.append(row.iter) continue
if fs_type == device.format.name: @@ -1281,11 +1290,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# remove items from the combobox in reversed order so that item 3 # doesn't become item 2 by removing item 1 etc. - map(self._fsCombo.remove, reversed(remove_indices)) + map(self._fsStore.remove, reversed(remove_iters))
# if the current device has unsupported formatting, add an entry for it if device.format.name not in self._fs_types: - self._fsCombo.append_text(device.format.name) + self._fsStore.append([device.format.name]) self._fsCombo.set_active(len(self._fsCombo.get_model()) - 1)
# Give them a way to reset to original formatting. Whenever we add a @@ -1293,7 +1302,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): if device.exists and \ device.format.type != device.originalFormat.type and \ device.originalFormat.type not in self._fs_types: - self._fsCombo.append_text(device.originalFormat.name) + self._fsStore.append([device.originalFormat.name])
def _setup_device_type_combo(self, device, use_dev, device_name): # these device types should always be listed @@ -2339,10 +2348,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): if not self._initialized: return
- new_type = combo.get_active_text() - if new_type is None: + itr = combo.get_active_iter() + if not itr: return - log.debug("fs type changed: %s", new_type) + + new_type = self._get_fstype(combo) + fmt = getFormat(new_type) fancy_set_sensitive(self._mountPointEntry, fmt.mountable)
@@ -2430,12 +2441,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): def _resolve_btrfs_restrictions(self, should_be_btrfs): model = self._fsCombo.get_model() btrfs_pos = None - for idx, data in enumerate(model): + for _idx, data in enumerate(model): if data[0] == "btrfs": - btrfs_pos = idx + btrfs_pos = data.iter
active_index = self._fsCombo.get_active() - current_fstype = self._fsCombo.get_active_text() + current_fstype = self._get_fstype(self._fsCombo) if btrfs_pos and not should_be_btrfs: self._fsCombo.remove(btrfs_pos) if current_fstype == "btrfs": @@ -2444,7 +2455,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): active_index = i break elif should_be_btrfs and not btrfs_pos: - self._fsCombo.append_text("btrfs") + self._fsStore.append(["btrfs"]) active_index = len(self._fsCombo.get_model()) - 1
self._fsCombo.set_active(active_index)
These all look good to me.
anaconda-patches@lists.fedorahosted.org