[PATCH] Add support for deleting an entire root via the existing ConfirmDeleteDialog.
by Chris Lumens
You've already bought into doing something destructive, so why not have the
chance to really tear things up? Also, make the cancel button the default
action.
---
pyanaconda/ui/gui/spokes/custom.glade | 50 +++++++++++++++++++++++------------
pyanaconda/ui/gui/spokes/custom.py | 17 +++++++++---
2 files changed, 47 insertions(+), 20 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade
index c377e6a..b4ae700 100644
--- a/pyanaconda/ui/gui/spokes/custom.glade
+++ b/pyanaconda/ui/gui/spokes/custom.glade
@@ -242,6 +242,36 @@ use. Try something else?</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
+ <child>
+ <object class="GtkLabel" id="confirmLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Are you sure you want to delete all of the data on %s?</property>
+ <property name="wrap">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="removeAllCheckbox">
+ <property name="label" translatable="yes">Delete all other filesystems in the %s root as well.</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
<child internal-child="action_area">
<object class="GtkButtonBox" id="dialog-action_area2">
<property name="can_focus">False</property>
@@ -249,11 +279,11 @@ use. Try something else?</property>
<child>
<object class="GtkButton" id="deleteCancelButton">
<property name="label" translatable="yes">_Cancel</property>
- <property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
<property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_delete_cancel_clicked" swapped="no"/>
</object>
@@ -285,21 +315,7 @@ use. Try something else?</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="confirmLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Are you sure you want to delete
-all of the data on %s?</property>
- <property name="wrap">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</object>
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 3150f6d..8b780a3 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -248,16 +248,23 @@ class ConfirmDeleteDialog(GUIObject):
mainWidgetName = "confirmDeleteDialog"
uiFile = "spokes/custom.glade"
+ @property
+ def deleteAll(self):
+ return self._removeAll.get_active()
+
def on_delete_cancel_clicked(self, button, *args):
self.window.destroy()
def on_delete_confirm_clicked(self, button, *args):
self.window.destroy()
- def refresh(self, mountpoint, device):
+ def refresh(self, mountpoint, device, rootName):
GUIObject.refresh(self)
label = self.builder.get_object("confirmLabel")
+ self._removeAll = self.builder.get_object("removeAllCheckbox")
+ self._removeAll.set_label(self._removeAll.get_label() % rootName)
+
if mountpoint:
txt = "%s (%s)" % (mountpoint, device)
else:
@@ -1709,13 +1716,17 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
dialog = ConfirmDeleteDialog(self.data)
with enlightbox(self.window, dialog.window):
dialog.refresh(getattr(device.format, "mountpoint", ""),
- device.name)
+ device.name, selector._root.name)
rc = dialog.run()
if rc == 0:
return
- self._destroy_device(device)
+ if dialog.deleteAll:
+ for dev in selector._root.swaps + selector._root.mounts.values():
+ self._destroy_device(dev)
+ else:
+ self._destroy_device(device)
log.info("ui: removed device %s" % device.name)
--
1.7.11.2
11 years, 8 months
[PATCH 1/2] Remove the code for removing an entire Root all at once.
by Chris Lumens
First, it simply does not work right now. Secondly, it's not at all obvious
in the UI how you would go about doing this. Click on the expander and then
hit remove? Yes, but then the expander collapses and you still have a
mountpoint displayed on the right. Which thing are you deleting then?
We need a way to do this, but I don't think this code is it.
---
pyanaconda/ui/gui/spokes/custom.py | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 4eabdee..b47e76d 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1715,30 +1715,6 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._destroy_device(device)
log.info("ui: removed device %s" % device.name)
- elif page:
- # This is a complete installed system. Thus, we first need to confirm
- # with the user and then schedule actions to delete everything.
- page = self._accordion.currentPage()
- dialog = ConfirmDeleteDialog(self.data)
-
- # Find the root this page displays.
- root = None
- if len(page._members) > 0:
- root = page._members[0]._root
-
- if not root:
- return
-
- with enlightbox(self.window, dialog.window):
- dialog.refresh(None, page.pageTitle)
- rc = dialog.run()
-
- if rc == 0:
- return
-
- # Destroy all devices.
- for device in root.swaps + root.mounts.values():
- self._destroy_device(device)
# Now that devices have been removed from the installation root,
# refreshing the display will have the effect of making them disappear.
--
1.7.11.2
11 years, 8 months
[PATCH 1/2] Don't display "None" in the name of a root.
by Chris Lumens
It's possible to end up in a situation where the root is "None Linux None for
None" which just looks silly. This happens in my testing if you kill an
install after it's made partitions, but before fedora-release gets installed.
---
pyanaconda/storage/__init__.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 8df216e..f02230f 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -3043,9 +3043,15 @@ def findExistingInstallations(devicetree):
try:
(arch, product, version) = getReleaseString()
except ValueError:
- name = "Linux on %s" % device.name
+ name = _("Linux on %s") % device.name
else:
- name = "%s Linux %s for %s" % (product, version, arch)
+ # I'd like to make this finer grained, but it'd be very difficult
+ # to translate.
+ if not product or not version or not arch:
+ name = _("Unknown Linux")
+ else:
+ name = _("%(product)s Linux %(version)s for %(arch)s") % \
+ {"product": product, "version": version, "arch": arch}
(mounts, swaps) = parseFSTab(devicetree, chroot=ROOT_PATH)
device.teardown()
--
1.7.11.2
11 years, 8 months
[PATCH master] (take II) Fix configuration of protected wireless connections.
by Radek Vykydal
---
pyanaconda/ui/gui/spokes/network.py | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 39b320e..a2a1f96 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -280,6 +280,7 @@ class NetworkControlBox():
model = combobox.get_model()
model.set_sort_column_id(2, Gtk.SortType.ASCENDING)
combobox.connect("changed", self.on_wireless_ap_changed_cb)
+ self.selected_ssid = None
# NM Client
self.client.connect("device-added", self.on_device_added)
@@ -386,6 +387,7 @@ class NetworkControlBox():
device = self.selected_device()
ap_obj_path, ssid_target = combobox.get_model().get(iter, 0, 1)
+ self.selected_ssid = ssid_target
if ap_obj_path == "ap-other...":
return
@@ -416,14 +418,10 @@ class NetworkControlBox():
con = self.find_active_connection_for_device(device)
if not con and configuration_of_disconnected_devices_allowed:
+ ssid = None
if device.get_device_type() == NetworkManager.DeviceType.WIFI:
- combobox = self.builder.get_object("combobox_wireless_network_name")
- iter = combobox.get_active_iter()
- if not iter:
- return
- ap_obj_path, ssid = combobox.get_model().get(iter, 0, 1)
-
- con = self.find_connection_for_device(device, ssid=None)
+ ssid = self.selected_ssid
+ con = self.find_connection_for_device(device, ssid)
if con:
uuid = con.get_uuid()
@@ -693,6 +691,13 @@ class NetworkControlBox():
active = active_ap and active_ap.get_path() == ap.get_path()
self._add_ap(ap, active)
# TODO: add access point other...
+ if active_ap:
+ combobox = self.builder.get_object("combobox_wireless_network_name")
+ for i in combobox.get_model():
+ if i[1] == active_ap.get_ssid():
+ combobox.set_active_iter(i.iter)
+ self.selected_ssid = active_ap.get_ssid()
+ break
self._updating_device = False
def _refresh_speed_hwaddr(self, device):
--
1.7.4
11 years, 8 months
[master] [PATCH] Always honor the 'nokill' flag
by Vratislav Podzimek
There may be cases when we don't get exit code. Especially in those
nonstandard case we should honor the 'nokill' flag and don't reboot
the machine.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
anaconda | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/anaconda b/anaconda
index 90fad45..bc6f5c8 100755
--- a/anaconda
+++ b/anaconda
@@ -43,12 +43,12 @@ def exitHandler(rebootData, storage, exitCode=None):
if exitCode:
anaconda.intf.shutdown()
- if "nokill" in flags.cmdline:
- iutil.vtActivate(1)
- print "anaconda halting due to nokill flag."
- print "The system will be rebooted when you press Ctrl-Alt-Delete."
- while True:
- time.sleep(10000)
+ if "nokill" in flags.cmdline:
+ iutil.vtActivate(1)
+ print "anaconda halting due to nokill flag."
+ print "The system will be rebooted when you press Ctrl-Alt-Delete."
+ while True:
+ time.sleep(10000)
if image_count:
anaconda.storage.umountFilesystems(ignoreErrors=True, swapoff=False)
--
1.7.11.4
11 years, 8 months
[master] Process and store X layouts and VConsole keymaps separately
by Vratislav Podzimek
As it seems that systemd-localed is not going to have functionality for loading
X layouts as VConsole keymaps [1], we have to store and process VConsole keymaps
and X layouts separately.
PATCH 1/5 is a minor fix for our code generating xorg.conf file from ksdata.
PATCH 2/5 fixes an issue that caused X server ignoring xorg.conf file written
out by us.
PATCH 3/5 adds a thin wrapper for the systemd-localed functionality.
PATCH 4/5 contains most of the work -- processing X layouts and VConsole keymaps
separately and converting them if they are not specified.
PATCH 5/5 adds code preventing tracebacks when we are given an invalid X layout
in the kickstart.
[pykickstart] patch is necessary for the changes made in PATCH 4/5.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=837292
Vratislav Podzimek (5):
Add comment to the begining of generated xorg.conf file
Don't write XkbVariants if none are specified
Add class wrapping systemd-localed functionality
Work with VConsole keymap and X layouts separately
Check X layouts specified in kickstart for validity
anaconda | 16 +--
anaconda.spec.in | 2 +-
pyanaconda/keyboard.py | 271 +++++++++++++++++++++++++++++------
pyanaconda/kickstart.py | 3 +-
pyanaconda/ui/gui/spokes/keyboard.py | 8 +-
pyanaconda/ui/gui/spokes/welcome.py | 14 +-
6 files changed, 247 insertions(+), 67 deletions(-)
--
1.7.11.4
11 years, 8 months
[PATCH master] Fix configuration of protected wireless connections (#855526).
by Radek Vykydal
F18 Beta blocker.
With this fix, wireless secrets can be set in nm-c-e with [Configure]
button.
I am planning to use secret agent for wireless secrets (either nm-applet or our own). Currently NM requires running session for secret agent which is very hard to achieve in Anaconda. Dan Williams is working
on support for private dbus socket where session will not be required
for the agent.
---
pyanaconda/ui/gui/spokes/network.py | 22 +++++++++++++++-------
1 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 39b320e..27266ff 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -280,6 +280,7 @@ class NetworkControlBox():
model = combobox.get_model()
model.set_sort_column_id(2, Gtk.SortType.ASCENDING)
combobox.connect("changed", self.on_wireless_ap_changed_cb)
+ self.selected_ssid = None
# NM Client
self.client.connect("device-added", self.on_device_added)
@@ -386,6 +387,7 @@ class NetworkControlBox():
device = self.selected_device()
ap_obj_path, ssid_target = combobox.get_model().get(iter, 0, 1)
+ self.selected_ssid = ssid_target
if ap_obj_path == "ap-other...":
return
@@ -416,14 +418,10 @@ class NetworkControlBox():
con = self.find_active_connection_for_device(device)
if not con and configuration_of_disconnected_devices_allowed:
+ ssid = None
if device.get_device_type() == NetworkManager.DeviceType.WIFI:
- combobox = self.builder.get_object("combobox_wireless_network_name")
- iter = combobox.get_active_iter()
- if not iter:
- return
- ap_obj_path, ssid = combobox.get_model().get(iter, 0, 1)
-
- con = self.find_connection_for_device(device, ssid=None)
+ ssid = self.selected_ssid
+ con = self.find_connection_for_device(device, ssid)
if con:
uuid = con.get_uuid()
@@ -693,6 +691,16 @@ class NetworkControlBox():
active = active_ap and active_ap.get_path() == ap.get_path()
self._add_ap(ap, active)
# TODO: add access point other...
+ if active_ap:
+ combobox = self.builder.get_object("combobox_wireless_network_name")
+ store = combobox.get_model()
+ i = store.get_iter_first()
+ while i:
+ if store[i][1] == active_ap.get_ssid():
+ combobox.set_active_iter(i)
+ self.selected_ssid = active_ap.get_ssid()
+ break
+ i = store.iter_next(i)
self._updating_device = False
def _refresh_speed_hwaddr(self, device):
--
1.7.4
11 years, 8 months
[PATCH] Fix graphical kickstart with %packages data
by Jesse Keating
Without this change we were automatically selecting the first
environment from the list, and adding it to the existing package data.
This means no matter what you had in %packages you also got the GNOME
environment. Obviously this is wrong, so we don't autoselect if we're
doing an automated install and have package data.
---
pyanaconda/ui/gui/spokes/software.py | 54 ++++++++++++++++++++----------------
1 file changed, 30 insertions(+), 24 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index 080d7da..2083b53 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -32,6 +32,7 @@ from pyanaconda.ui.gui.utils import enlightbox, gdk_threaded
from pyanaconda.ui.gui.categories.software import SoftwareCategory
from .source import AdditionalReposDialog
+from pyanaconda.kickstart import packagesSeen
from pykickstart.parser import Group
import sys
@@ -67,15 +68,13 @@ class SoftwareSelectionSpoke(NormalSpoke):
from pyanaconda.threads import threadMgr, AnacondaThread
row = self._get_selected_environment()
- if not row:
- return
-
- self._selectFlag = False
- self.payload.data.packages.groupList = []
- self.payload.selectEnvironment(row[2])
- self.environment = row[2]
- for group in self.selectedGroups:
- self.payload.selectGroup(group)
+ if row:
+ self._selectFlag = False
+ self.payload.data.packages.groupList = []
+ self.payload.selectEnvironment(row[2])
+ self.environment = row[2]
+ for group in self.selectedGroups:
+ self.payload.selectGroup(group)
communication.send_not_ready(self.__class__.__name__)
threadMgr.add(AnacondaThread(name="AnaCheckSoftwareThread",
@@ -101,7 +100,6 @@ class SoftwareSelectionSpoke(NormalSpoke):
@property
def completed(self):
from pyanaconda.threads import threadMgr
- from pyanaconda.kickstart import packagesSeen
processingDone = not threadMgr.get("AnaCheckSoftwareThread") and \
not self._errorMsgs and \
@@ -130,7 +128,6 @@ class SoftwareSelectionSpoke(NormalSpoke):
@property
def status(self):
- from pyanaconda.kickstart import packagesSeen
from pyanaconda.threads import threadMgr
if self._errorMsgs:
@@ -169,19 +166,28 @@ class SoftwareSelectionSpoke(NormalSpoke):
communication.send_message(self.__class__.__name__, _("Downloading group metadata..."))
- with gdk_threaded():
- # Grabbing the list of groups could potentially take a long time the
- # first time (yum does a lot of magic property stuff, some of which
- # involves side effects like network access) so go ahead and grab
- # them once now.
- try:
- self.refresh()
- except MetadataError:
- communication.send_message(self.__class__.__name__,
- _("No installation source available"))
- return
-
- self.payload.release()
+ # we have no way to select environments with kickstart right now
+ # so don't try.
+ if flags.automatedInstall and packagesSeen:
+ # We don't want to do a full refresh, just
+ # join the metadata thread
+ mdGatherThread = threadMgr.get("AnaPayloadMDThread")
+ if mdGatherThread:
+ mdGatherThread.join()
+ else:
+ with gdk_threaded():
+ # Grabbing the list of groups could potentially take a long time the
+ # first time (yum does a lot of magic property stuff, some of which
+ # involves side effects like network access) so go ahead and grab
+ # them once now.
+ try:
+ self.refresh()
+ except MetadataError:
+ communication.send_message(self.__class__.__name__,
+ _("No installation source available"))
+ return
+
+ self.payload.release()
communication.send_ready(self.__class__.__name__)
--
1.7.11.4
11 years, 8 months