summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2013-02-12 16:07:39 -0800
committerBrian C. Lane <bcl@redhat.com>2013-02-13 07:52:57 -0800
commitece25b8c1a8ec13767c22d303b77491870b3d68b (patch)
tree3ac4372439046572cb114a59fbf7782d262e77ad /pyanaconda/ui
parenta739378ce2e7f7c429475b7cc6cd590307ce49aa (diff)
downloadanaconda-ece25b8c1a8ec13767c22d303b77491870b3d68b.tar.gz
anaconda-ece25b8c1a8ec13767c22d303b77491870b3d68b.tar.xz
anaconda-ece25b8c1a8ec13767c22d303b77491870b3d68b.zip
Move the encryption checkbox to the dialog
This moves the 'Encrypt my data' checkbox from the main storage spoke into the dialog above the partition type combobox.
Diffstat (limited to 'pyanaconda/ui')
-rw-r--r--pyanaconda/ui/gui/spokes/storage.glade66
-rw-r--r--pyanaconda/ui/gui/spokes/storage.py30
2 files changed, 58 insertions, 38 deletions
diff --git a/pyanaconda/ui/gui/spokes/storage.glade b/pyanaconda/ui/gui/spokes/storage.glade
index 114d4d2f6..85c275619 100644
--- a/pyanaconda/ui/gui/spokes/storage.glade
+++ b/pyanaconda/ui/gui/spokes/storage.glade
@@ -158,6 +158,24 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="encryption1_checkbutton">
+ <property name="label" translatable="yes">_Encrypt my data. I'll set a passphrase later.</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="hexpand">True</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_encrypt_toggled" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkExpander" id="options1_expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -215,7 +233,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>
@@ -456,6 +474,24 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="encryption2_checkbutton">
+ <property name="label" translatable="yes">_Encrypt my data. I'll set a passphrase later.</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="hexpand">True</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_encrypt_toggled" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkExpander" id="options2_expander">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -513,7 +549,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
@@ -946,32 +982,6 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="encryption_checkbutton">
- <property name="label" translatable="yes">_Encrypt my data. I'll set a passphrase later.</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="halign">end</property>
- <property name="valign">end</property>
- <property name="hexpand">True</property>
- <property name="use_underline">True</property>
- <property name="xalign">1</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
<placeholder/>
</child>
</object>
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 0fc064f5a..bb267541e 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -147,11 +147,15 @@ class InstallOptions1Dialog(GUIObject):
self.window.destroy()
return rc
- def refresh(self, required_space, disk_free, fs_free, autoPartType):
+ def refresh(self, required_space, disk_free, fs_free, autoPartType, encrypted):
self.autoPartType = autoPartType
self.autoPartTypeCombo = self.builder.get_object("options1_combo")
self.autoPartTypeCombo.set_active(self.autoPartType)
+ self.encrypted = encrypted
+ self.encryptCheckbutton = self.builder.get_object("encryption1_checkbutton")
+ self.encryptCheckbutton.set_active(self.encrypted)
+
options_label = self.builder.get_object("options1_label")
options_text = _("You have <b>%(freeSpace)s</b> of free space, which is "
@@ -241,15 +245,22 @@ class InstallOptions1Dialog(GUIObject):
def on_type_changed(self, combo):
self.autoPartType = combo.get_active()
+ def on_encrypt_toggled(self, checkbox):
+ self.encrypted = checkbox.get_active()
+
class InstallOptions2Dialog(InstallOptions1Dialog):
builderObjects = ["options2_dialog"]
mainWidgetName = "options2_dialog"
- def refresh(self, required_space, disk_free, fs_free, autoPartType):
+ def refresh(self, required_space, disk_free, fs_free, autoPartType, encrypted):
self.autoPartType = autoPartType
self.autoPartTypeCombo = self.builder.get_object("options2_combo")
self.autoPartTypeCombo.set_active(self.autoPartType)
+ self.encrypted = encrypted
+ self.encryptCheckbutton = self.builder.get_object("encryption2_checkbutton")
+ self.encryptCheckbutton.set_active(self.encrypted)
+
sw_text = self._get_sw_needs_text(required_space)
label_text = _("%s\nThe disks you've selected have the following "
"amounts of free space:") % sw_text
@@ -279,7 +290,7 @@ class InstallOptions3Dialog(InstallOptions1Dialog):
builderObjects = ["options3_dialog"]
mainWidgetName = "options3_dialog"
- def refresh(self, required_space, disk_free, fs_free, autoPartType):
+ def refresh(self, required_space, disk_free, fs_free, autoPartType, encrypted):
sw_text = self._get_sw_needs_text(required_space)
label_text = (_("%s\nYou don't have enough space available to install "
"<b>%s</b>, even if you used all of the free space\n"
@@ -509,9 +520,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self._previous_autopart = self.autopart
- encrypt_checkbutton = self.builder.get_object("encryption_checkbutton")
- encrypt_checkbutton.set_active(self.encrypted)
-
# update the selections in the ui
overviews = self.local_disks_box.get_children()
for overview in overviews:
@@ -668,9 +676,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
def _check_encrypted(self):
# even if they're not doing autopart, setting autopart.encrypted
# establishes a default of encrypting new devices
- encrypt_button = self.builder.get_object("encryption_checkbutton")
- self.encrypted = encrypt_button.get_active()
-
if not self.encrypted:
return True
@@ -743,10 +748,12 @@ class StorageSpoke(NormalSpoke, StorageChecker):
else:
dialog = InstallOptions3Dialog(self.data, payload=self.payload)
- dialog.refresh(required_space, disk_free, fs_free, self.autoPartType)
+ dialog.refresh(required_space, disk_free, fs_free, self.autoPartType,
+ self.encrypted)
rc = self.run_lightbox_dialog(dialog)
if rc == dialog.RESPONSE_CONTINUE:
self.autoPartType = dialog.autoPartType
+ self.encrypted = dialog.encrypted
if not self._check_encrypted():
return
@@ -771,6 +778,8 @@ class StorageSpoke(NormalSpoke, StorageChecker):
NormalSpoke.on_back_clicked(self, button)
elif rc == dialog.RESPONSE_RECLAIM:
self.autoPartType = dialog.autoPartType
+ self.encrypted = dialog.encrypted
+
if not self._check_encrypted():
return
@@ -781,6 +790,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
elif rc == dialog.RESPONSE_CUSTOM:
self.autopart = False
self.autoPartType = dialog.autoPartType
+ self.encrypted = dialog.encrypted
self.skipTo = "CustomPartitioningSpoke"
NormalSpoke.on_back_clicked(self, button)