summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2009-03-03 15:43:56 -1000
committerDavid Cantrell <dcantrell@redhat.com>2009-03-03 19:49:08 -1000
commit4f2e923cb61a7160fc7eb9ce057981d83ff8873d (patch)
tree07b3bb31529639f513ac3fe946665485ab2ebec0 /iw
parentcb427d3cd02def70fd4d9755f0d14d63605eadf6 (diff)
downloadanaconda-4f2e923cb61a7160fc7eb9ce057981d83ff8873d.tar.gz
anaconda-4f2e923cb61a7160fc7eb9ce057981d83ff8873d.tar.xz
anaconda-4f2e923cb61a7160fc7eb9ce057981d83ff8873d.zip
Migrate FS user interface plumbing.
Hook up the migrate fs UI components with the new storage backend. Highlights: - If user selects Migrate filesystem to, the Format checkbox is disabled. Same for the reverse, selecting Format disables the Migrate options. - Mount point entry box is not disabled for migrate selections. - Wrap the return value in storage.formats.fs.FS.migratable in bool(). If the filter() operation returns a list, that's what we get in the return value rather than True. - Other minor typo and syntax fixes.
Diffstat (limited to 'iw')
-rw-r--r--iw/partition_ui_helpers_gui.py45
1 files changed, 25 insertions, 20 deletions
diff --git a/iw/partition_ui_helpers_gui.py b/iw/partition_ui_helpers_gui.py
index 723367c9a..4179ab9ec 100644
--- a/iw/partition_ui_helpers_gui.py
+++ b/iw/partition_ui_helpers_gui.py
@@ -30,7 +30,7 @@ import iutil
from constants import *
from partIntfHelpers import *
from partedUtils import *
-from storage.formats import device_formats, getFormat, get_default_filesystem_type
+from storage.formats import *
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
@@ -89,17 +89,18 @@ def createMountPointCombo(request, excludeMountPoints=[]):
if request.exists and label and label.startswith("/"):
mntptlist.append(label)
idx = 0
-
+
for p in defaultMountPoints:
- if p in excludeMountPoints:
- continue
-
- if not p in mntptlist and (p[0] == "/"):
- mntptlist.append(p)
+ if p in excludeMountPoints:
+ continue
+
+ if not p in mntptlist and (p[0] == "/"):
+ mntptlist.append(p)
map(mountCombo.append_text, mntptlist)
- if request.format.type and request.format.mountable:
+ if (request.format.type or request.format.migrate) and \
+ request.format.mountable:
mountpoint = request.format.mountpoint
mountCombo.set_sensitive(1)
if mountpoint:
@@ -248,9 +249,12 @@ def formatOptionResizeCB(widget, resizesb):
if resizesb.get_value_as_int() < lower:
resizesb.set_value(adj.lower)
-def formatOptionCB(widget, data):
- (combowidget, mntptcombo, ofstype, lukscb) = data
+def formatMigrateOptionCB(widget, data):
+ (combowidget, mntptcombo, ofstype, lukscb, othercombo, othercb) = data
combowidget.set_sensitive(widget.get_active())
+ othercb.set_sensitive(not widget.get_active())
+ othercombo.set_sensitive(not widget.get_active())
+
if lukscb is not None:
lukscb.set_data("formatstate", widget.get_active())
if not widget.get_active():
@@ -262,11 +266,11 @@ def formatOptionCB(widget, data):
# inject event for fstype menu
if widget.get_active():
- fstype = combowidget.get_active_value()
- setMntPtComboStateFromType(fstype, mntptcombo)
+ fstype = combowidget.get_active_value()
+ setMntPtComboStateFromType(fstype, mntptcombo)
combowidget.grab_focus()
else:
- setMntPtComboStateFromType(ofstype, mntptcombo)
+ setMntPtComboStateFromType(ofstype, mntptcombo)
def noformatCB(widget, data):
(combowidget, mntptcombo, ofstype) = data
@@ -274,7 +278,7 @@ def noformatCB(widget, data):
# inject event for fstype menu
if widget.get_active():
- setMntPtComboStateFromType(ofstype, mntptcombo)
+ setMntPtComboStateFromType(ofstype, mntptcombo)
""" createPreExistFSOptionSection: given inputs for a preexisting partition,
@@ -314,10 +318,6 @@ def createPreExistFSOptionSection(origrequest, maintable, row, mountCombo,
# this gets added to the table a bit later on
lukscb = gtk.CheckButton(_("_Encrypt"))
- formatcb.connect("toggled", formatOptionCB,
- (fstypeCombo, mountCombo, ofstype, lukscb))
-
-
if origrequest.format.migratable:
migratecb = gtk.CheckButton(label=_("Mi_grate filesystem to:"))
migratecb.set_active(istruefalse(origrequest.format.migrate))
@@ -333,12 +333,17 @@ def createPreExistFSOptionSection(origrequest, maintable, row, mountCombo,
row = row + 1
rc["migratecb"] = migratecb
rc["migfstypeCombo"] = migfstypeCombo
- migratecb.connect("toggled", formatOptionCB,
- (migfstypeCombo, mountCombo, ofstype, None))
+ migratecb.connect("toggled", formatMigrateOptionCB,
+ (migfstypeCombo, mountCombo, ofstype, None,
+ fstypeCombo, formatcb))
else:
migratecb = None
migfstypeCombo = None
+ formatcb.connect("toggled", formatMigrateOptionCB,
+ (fstypeCombo, mountCombo, ofstype, lukscb,
+ migfstypeCombo, migratecb))
+
if origrequest.resizable:
resizecb = gtk.CheckButton(label=_("_Resize"))
resizecb.set_active(origrequest.targetSize != origrequest.currentSize)