[PATCH 1/2] Add booleans indicating queued operations on formats.

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

 



Add wantFormat, wantMigrate, and wantResize to indicate whether or
not the user actually wants a format (initialize), migrate, or resize
operation to occur for the format.  This is mainly for the UI components
because right now we base the UI elements on the properties that
indicate whether or an operation is possible, not if the user wants the
operation done.  For example, a format could be resizable, but the user
might not want that.
---
 storage/formats/__init__.py |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/storage/formats/__init__.py b/storage/formats/__init__.py
index 9ec0999..60be55e 100644
--- a/storage/formats/__init__.py
+++ b/storage/formats/__init__.py
@@ -149,6 +149,9 @@ class DeviceFormat(object):
     _minSize = 0                        # minimum size in MB
     _dump = False
     _check = False
+    _wantFormat = False
+    _wantMigrate = False
+    _wantResize = False
 
     def __init__(self, *args, **kwargs):
         """ Create a DeviceFormat instance.
@@ -294,6 +297,15 @@ class DeviceFormat(object):
                 self.device and 
                 os.path.exists(self.device))
 
+    def _getWantFormat(self):
+        return self._wantFormat
+
+    def _setWantFormat(self, want):
+        self._wantFormat = want
+
+    wantFormat = property(_getWantFormat, _setWantFormat,
+                          "Initialize this format?")
+
     @property
     def formattable(self):
         """ Can we create formats of this type? """
@@ -309,6 +321,15 @@ class DeviceFormat(object):
         """ Packages required to manage formats of this type. """
         return self._packages
 
+    def _getWantResize(self):
+        return self._wantResize
+
+    def _setWantResize(self, want):
+        self._wantResize = want
+
+    wantResize = property(_getWantResize, _setWantResize,
+                          "Resize this format?")
+
     @property
     def resizable(self):
         """ Can formats of this type be resized? """
@@ -319,6 +340,15 @@ class DeviceFormat(object):
         """ Is this format type suitable for a boot partition? """
         return self._bootable
 
+    def _getWantMigrate(self):
+        return self._wantMigrate
+
+    def _setWantMigrate(self, want):
+        self._wantMigrate = want
+
+    wantMigrate = property(_getWantMigrate, _setWantMigrate,
+                           "Migrate this format?")
+
     @property
     def migratable(self):
         """ Can formats of this type be migrated? """
-- 
1.6.2

_______________________________________________
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