[rhel6-branch] More partition dialogs focusing after error (#679810)

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

 



On partitioning errors the dialogs loose focus, after
the treeview is refreshed.
Before calling the present() function we need to clear
the gtk pending events, otherwise the treeview steels
the focus away.
---
 iw/partition_gui.py |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 6e4e7bf..8a0739e 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -1650,19 +1650,20 @@ class PartitionWindow(InstallWindow):
                 # FIXME: this needs to handle exceptions
                 self.storage.devicetree.registerAction(action)
 
-	    if self.refresh(justRedraw=True):
+            if self.refresh(justRedraw=True):
                 actions.reverse()
                 for action in actions:
                     self.storage.devicetree.cancelAction(action)
                     if self.refresh():
                         raise RuntimeError, ("Returning partitions to state "
                                              "prior to RAID edit failed")
-                continue
-	    else:
-		break
 
-	raideditor.destroy()		
+                gui.processEvents()
+                raideditor.dialog.present()
+            else:
+                break
 
+        raideditor.destroy()
 
     def editPartition(self, device, isNew = False, restrictfs = None):
         # p_d_g -> partition_dialog_gui
@@ -1697,11 +1698,14 @@ class PartitionWindow(InstallWindow):
                     # this worked before and doesn't now...
                     raise RuntimeError, ("Returning partitions to state "
                                          "prior to edit failed")
+
+                gui.processEvents()
+                parteditor.dialog.present()
             else:
-		break
+                break
 
-	parteditor.destroy()
-	return 1
+        parteditor.destroy()
+        return 1
 
     def editLVMVolumeGroup(self, device, isNew = False):
         # l_d_g -> lvm_dialog_gui
@@ -1715,7 +1719,7 @@ class PartitionWindow(InstallWindow):
                 # FIXME: handle exceptions
                 self.storage.devicetree.registerAction(action)
 
-	    if self.refresh(justRedraw=True):
+            if self.refresh(justRedraw=True):
                 actions.reverse()
                 for action in actions:
                     self.storage.devicetree.cancelAction(action)
@@ -1723,11 +1727,13 @@ class PartitionWindow(InstallWindow):
                 if self.refresh():
                     raise RuntimeError, ("Returning partitions to state "
                                          "prior to edit failed")
-		continue
-	    else:
-		break
 
-	vgeditor.destroy()
+                gui.processEvents()
+                vgeditor.dialog.present()
+            else:
+                break
+
+        vgeditor.destroy()
 
     def editLVMLogicalVolume (self, lv = None, vg = None):
         """Will be consistent with the state of things and use this funciton
@@ -1785,7 +1791,9 @@ class PartitionWindow(InstallWindow):
                 if self.refresh():
                     raise RuntimeError, ("Returning partitions to state "
                                          "prior to edit failed")
-                continue
+
+                gui.processEvents()
+                vgeditor.dialog.present()
             else:
                 break
 
-- 
1.7.3.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