[PATCH] Do not allow manipulating protected devices in the reclaim dialog (#882147).
Vratislav Podzimek
vpodzime at redhat.com
Mon Dec 3 20:39:35 UTC 2012
On Mon, 2012-12-03 at 15:07 -0500, Chris Lumens wrote:
> Also, add a tooltip to describe why you can't do something to a given device.
> ---
> pyanaconda/ui/gui/spokes/lib/resize.glade | 3 +++
> pyanaconda/ui/gui/spokes/lib/resize.py | 14 +++++++++++---
> 2 files changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/pyanaconda/ui/gui/spokes/lib/resize.glade b/pyanaconda/ui/gui/spokes/lib/resize.glade
> index 86e8ee1..f2cd461 100644
> --- a/pyanaconda/ui/gui/spokes/lib/resize.glade
> +++ b/pyanaconda/ui/gui/spokes/lib/resize.glade
> @@ -17,6 +17,8 @@
> <column type="gchararray"/>
> <!-- column-name diskEditable -->
> <column type="gboolean"/>
> + <!-- column-name diskTooltip -->
> + <column type="gchararray"/>
> </columns>
> </object>
> <object class="GtkDialog" id="resizeDialog">
> @@ -126,6 +128,7 @@
> <property name="model">diskStore</property>
> <property name="enable_search">False</property>
> <property name="enable_tree_lines">True</property>
> + <property name="tooltip_column">7</property>
> <signal name="row-activated" handler="on_row_clicked" swapped="no"/>
> <child internal-child="selection">
> <object class="GtkTreeSelection" id="diskView-selection">
> diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
> index 0d66c76..dcc8527 100644
> --- a/pyanaconda/ui/gui/spokes/lib/resize.py
> +++ b/pyanaconda/ui/gui/spokes/lib/resize.py
> @@ -41,6 +41,7 @@ RECLAIMABLE_COL = 3
> PERCENT_COL = 4
> ACTION_COL = 5
> EDITABLE_COL = 6
> +TOOLTIP_COL = 7
>
> PRESERVE = N_("Preserve")
> SHRINK = N_("Shrink")
> @@ -118,7 +119,7 @@ class ResizeDialog(GUIObject):
> fstype = ""
> diskReclaimableSpace = 0
> else:
> - editable = True
> + editable = not disk.protected
> percent = 100
> fstype = disk.format.type
> diskReclaimableSpace = disk.size
> @@ -129,7 +130,8 @@ class ResizeDialog(GUIObject):
> "<span foreground='grey' style='italic'>%s total</span>",
> percent,
> _(PRESERVE),
> - editable])
> + editable,
> + _("Whole disks are not editable.")])
>
> if disk.partitioned:
> # Then add all its partitions.
> @@ -144,13 +146,19 @@ class ResizeDialog(GUIObject):
> else:
> freeSize = dev.size
>
> + if dev.protected:
> + tooltip = _("This device contains the installation source.")
> + else:
> + tooltip = None
> +
> self._diskStore.append(itr, [dev.id,
> self._description(dev),
> dev.format.type,
> _("%s of %s") % (size_str(freeSize), size_str(dev.size)),
> int((freeSize/dev.size) * 100),
> _(PRESERVE),
> - True])
> + not dev.protected,
> + tooltip])
> diskReclaimableSpace += freeSize
>
> # And then go back and fill in the total reclaimable space for the
Looks good to me.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list