summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2009-03-10 14:14:44 -1000
committerDavid Cantrell <dcantrell@redhat.com>2009-03-10 16:15:53 -1000
commita50bfe30889e1e7d4820bcdb5cb747453d466ca1 (patch)
treeb36e031a01c4e0175ab458fd504d751ba57ca72b /iw
parentadf5421a1f5953b1848eb2cc3733a5d1f61ed294 (diff)
downloadanaconda-a50bfe30889e1e7d4820bcdb5cb747453d466ca1.tar.gz
anaconda-a50bfe30889e1e7d4820bcdb5cb747453d466ca1.tar.xz
anaconda-a50bfe30889e1e7d4820bcdb5cb747453d466ca1.zip
Hook up 'Shrink current system' dialog to new storage code.
The whichToResize() window presents the user with a list of resizable filesystems, allows the user to enter a new target size, then creates an ActionResizeFormat object and returns that to the caller. The action is registered in the Storage object.
Diffstat (limited to 'iw')
-rw-r--r--iw/autopart_type.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/iw/autopart_type.py b/iw/autopart_type.py
index 700d7da0e..b634cc964 100644
--- a/iw/autopart_type.py
+++ b/iw/autopart_type.py
@@ -32,6 +32,7 @@ from iw_gui import *
from flags import flags
import network
from storage import iscsi
+from storage.deviceaction import *
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -74,11 +75,13 @@ def whichToResize(storage, intf):
if not part.exists:
continue
- if part.resizable:
+ # Resize the following storage types:
+ # resizable filesystem (e.g., ext3 or ntfs) on resizable partition
+ if part.resizable and part.format.resizable:
i = store.append(None)
store[i] = ("%s (%s, %d MB)" %(part.name,
part.format.name,
- math.floor(part.size)),
+ math.floor(part.format.currentSize)),
part)
if part.targetSize is not None:
combo.set_active_iter(i)
@@ -106,10 +109,11 @@ def whichToResize(storage, intf):
dialog.destroy()
return rc
- req = getActive(combo)
- req.targetSize = dxml.get_widget("resizeSB").get_value_as_int()
+ request = getActive(combo)
+ newSize = dxml.get_widget("resizeSB").get_value_as_int()
+ action = ActionResizeFormat(request, newSize)
dialog.destroy()
- return rc
+ return (rc, action)
class PartitionTypeWindow(InstallWindow):
def __init__(self, ics):
@@ -130,8 +134,10 @@ class PartitionTypeWindow(InstallWindow):
self.dispatch.skipStep("bootloader", skip = 0)
else:
if val == -2:
- rc = whichToResize(self.storage, self.intf)
- if rc != gtk.RESPONSE_OK:
+ (rc, action) = whichToResize(self.storage, self.intf)
+ if rc == gtk.RESPONSE_OK:
+ self.storage.devicetree.registerAction(action)
+ else:
raise gui.StayOnScreen
# we're not going to delete any partitions in the resize case