[PATCH 6/7] Remove some clutter from storage spoke, fix a little xml problem.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 pyanaconda/ui/gui/spokes/storage.py |   30 ++++++++++++------------------
 pyanaconda/ui/gui/spokes/storage.ui |    4 ++--
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 960a3c1..3151058 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -46,11 +46,6 @@ from pyanaconda.ui.gui.spokes import NormalSpoke
 from pyanaconda.ui.gui.categories.storage import StorageCategory
 
 from pyanaconda.storage.size import Size
-
-# these are all temporary
-from pyanaconda.storage.partitioning import getFreeRegions
-from pyanaconda.storage.partitioning import sectorsToSize
-
 from pyanaconda.product import productName
 
 import gettext
@@ -116,6 +111,8 @@ def get_free_space_info(disks, devicetree):
           % ([d.name for d in disks], disk_free, fs_free))
     return (disk_free, fs_free)
 
+def size_str(mb):
+    return str(Size(spec="%s mb" % mb)).upper()
 
 class SelectedDisksDialog(UIObject):
     builderObjects = ["selected_disks_dialog", "disk_store"]
@@ -127,9 +124,9 @@ class SelectedDisksDialog(UIObject):
             if disk.name not in self.data.ignoredisk.onlyuse:
                 continue
 
-            self._store.append(["%s-%s" % (disk.vendor, disk.model),
-                                Size(spec="%s mb" % disk.size).humanReadable().upper(),
-                                Size(spec="%s mb" % disk.format.free).humanReadable().upper(),
+            self._store.append([disk.description,
+                                size_str(disk.size),
+                                size_str(disk.format.free),
                                 str(disks.index(disk))])
         self.disks = disks[:]
         self._update_summary()
@@ -171,8 +168,8 @@ class SelectedDisksDialog(UIObject):
             free += Size(spec=self._store.get_value(itr, 2))
             itr = self._store.iter_next(itr)
 
-        size = Size(bytes=long(size)).humanReadable().upper()
-        free = Size(bytes=long(free)).humanReadable().upper()
+        size = str(Size(bytes=long(size))).upper()
+        free = str(Size(bytes=long(free))).upper()
 
         text = P_(("<b>%d disk; %s capacity; %s free space</b> "
                    "(unpartitioned and in filesystems)"),
@@ -240,14 +237,14 @@ class InstallOptions1Dialog(UIObject):
         options_label.set_markup(options_text)
 
     def _set_free_space_labels(self, disk_free, fs_free):
-        disk_free_text = Size(spec="%dmb" % disk_free).humanReadable().upper()
+        disk_free_text = size_str(disk_free)
         self.disk_free_label.set_text(disk_free_text)
 
-        fs_free_text = Size(spec="%dmb" % fs_free).humanReadable().upper()
+        fs_free_text = size_str(fs_free)
         self.fs_free_label.set_text(fs_free_text)
 
     def _get_sw_needs_text(self, required_space):
-        required_space_text = Size(spec="%dmb" % required_space).humanReadable().upper()
+        required_space_text = size_str(required_space)
         sw_text = (_("Your current <b>%s</b> software selection requires "
                       "<b>%s</b> of available space.")
                    % (productName, required_space_text))
@@ -387,7 +384,7 @@ class StorageSpoke(NormalSpoke):
             else:
                 kind = "drive-harddisk"
 
-            size = Size(spec="%dmb" % disk.size).humanReadable().upper()
+            size = size_str(disk.size)
             popup_info = "%s | %s" % (disk.name, disk.serial)
             overview = AnacondaWidgets.DiskOverview(disk.description,
                                                     kind,
@@ -432,10 +429,7 @@ class StorageSpoke(NormalSpoke):
 
         summary = (P_(("%d disk selected; %s capacity; %s free ..."),
                       ("%d disks selected; %s capacity; %s free ..."),
-                      count)
-                   % (count,
-                      Size(spec="%dmb" % capacity).humanReadable().upper(),
-                      Size(spec="%dmb" % free).humanReadable().upper()))
+                      count) % (count, size_str(capacity), size_str(free)))
         self.builder.get_object("summary_button").set_label(summary)
 
         if count == 0:
diff --git a/pyanaconda/ui/gui/spokes/storage.ui b/pyanaconda/ui/gui/spokes/storage.ui
index 4bb80b4..95e4027 100644
--- a/pyanaconda/ui/gui/spokes/storage.ui
+++ b/pyanaconda/ui/gui/spokes/storage.ui
@@ -738,7 +738,7 @@
                         <property name="can_focus">True</property>
                         <property name="model">disk_store</property>
                         <child internal-child="selection">
-                          <object class="GtkTreeSelection" id="treeview-selection1"/>
+                          <object class="GtkTreeSelection" id="disk_selection"/>
                         </child>
                         <child>
                           <object class="GtkTreeViewColumn" id="description_column">
@@ -879,7 +879,7 @@
           <object class="GtkAlignment" id="AnacondaSpokeWindow-alignment1">
             <property name="can_focus">False</property>
             <property name="yalign">0</property>
-            <property name="xscale">0.9</property>
+            <property name="xscale">0.89999997615814209</property>
             <property name="yscale">0.5</property>
             <child internal-child="action_area">
               <object class="GtkBox" id="storageWindow-action_area1">
-- 
1.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux