[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 |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/iw/partition_gui.py b/iw/partition_gui.py
index 6e4e7bf..3094bce 100644
--- a/iw/partition_gui.py
+++ b/iw/partition_gui.py
@@ -1650,19 +1650,21 @@ 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()		
+                while gtk.events_pending():
+                    gtk.main_iteration()
+                raideditor.dialog.present()
+            else:
+                break
 
+        raideditor.destroy()
 
     def editPartition(self, device, isNew = False, restrictfs = None):
         # p_d_g -> partition_dialog_gui
@@ -1697,11 +1699,15 @@ class PartitionWindow(InstallWindow):
                     # this worked before and doesn't now...
                     raise RuntimeError, ("Returning partitions to state "
                                          "prior to edit failed")
+
+                while gtk.events_pending():
+                    gtk.main_iteration()
+                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 +1721,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 +1729,14 @@ class PartitionWindow(InstallWindow):
                 if self.refresh():
                     raise RuntimeError, ("Returning partitions to state "
                                          "prior to edit failed")
-		continue
-	    else:
-		break
 
-	vgeditor.destroy()
+                while gtk.events_pending():
+                    gtk.main_iteration()
+                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 +1794,10 @@ class PartitionWindow(InstallWindow):
                 if self.refresh():
                     raise RuntimeError, ("Returning partitions to state "
                                          "prior to edit failed")
-                continue
+
+                while gtk.events_pending():
+                    gtk.main_iteration()
+                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