Re: [PATCH] Handle Esc keypress in dialogs as Cancel (#520110).

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

 



Looks good,

Regards,

Hans


On 09/15/2009 01:49 PM, Radek Vykydal wrote:
---
  gui.py                    |    8 ++++++--
  iw/autopart_type.py       |    8 ++++----
  iw/bootloader_main_gui.py |    2 +-
  iw/netconfig_dialog.py    |    2 +-
  iw/task_gui.py            |    6 +++---
  5 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/gui.py b/gui.py
index c83ff8c..f4e2bb2 100755
--- a/gui.py
+++ b/gui.py
@@ -828,6 +828,10 @@ class MessageWindow:
              elif self.rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_NO,
                               gtk.RESPONSE_CLOSE, gtk.RESPONSE_DELETE_EVENT]:
                  self.rc = 0
+        else:
+            # generated by Esc key
+            if self.rc == gtk.RESPONSE_DELETE_EVENT:
+                self.rc = 0

          if not self.debugRid is None and self.rc == self.debugRid:
              self.debugClicked(self)
@@ -1003,7 +1007,7 @@ class InstallInterface:
          ret = net.run()
          net.destroy()

-        return ret != gtk.RESPONSE_CANCEL
+        return ret not in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]

      def setPackageProgressWindow (self, ppw):
          self.ppw = ppw
@@ -1096,7 +1100,7 @@ class InstallInterface:
      def getInstallKey(self, key = ""):
          d = InstallKeyWindow(self.anaconda, key)
          rc = d.run()
-        if rc == gtk.RESPONSE_CANCEL:
+        if rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
              ret = None
          else:
              ret = d.get_key()
diff --git a/iw/autopart_type.py b/iw/autopart_type.py
index 6fa76c4..fb5e5f2 100644
--- a/iw/autopart_type.py
+++ b/iw/autopart_type.py
@@ -275,7 +275,7 @@ class PartitionTypeWindow(InstallWindow):

          while 1:
              rc = dialog.run()
-            if rc == gtk.RESPONSE_CANCEL:
+            if rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
                  break

              initiator = dxml.get_widget("iscsiInitiatorEntry").get_text()
@@ -380,7 +380,7 @@ class PartitionTypeWindow(InstallWindow):
          while 1:
              rc = dialog.run()

-            if rc == gtk.RESPONSE_CANCEL:
+            if rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
                  break

              iter = combo.get_active_iter()
@@ -455,7 +455,7 @@ class PartitionTypeWindow(InstallWindow):

          rc = dialog.run()
          dialog.hide()
-        if rc == gtk.RESPONSE_CANCEL:
+        if rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
              return
          if dxml.get_widget("iscsiRadio").get_active() and iscsi.has_iscsi():
              rc = self.addIscsiDrive()
@@ -465,7 +465,7 @@ class PartitionTypeWindow(InstallWindow):
              rc = self.addZfcpDrive()
          dialog.destroy()

-        if rc != gtk.RESPONSE_CANCEL:
+        if rc not in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
              w = self.intf.waitWindow(_("Rescanning disks"),
                                       _("Rescanning disks"))
              self.storage.reset()
diff --git a/iw/bootloader_main_gui.py b/iw/bootloader_main_gui.py
index 31068c0..9e9e8ac 100644
--- a/iw/bootloader_main_gui.py
+++ b/iw/bootloader_main_gui.py
@@ -143,7 +143,7 @@ class MainBootloaderWindow(InstallWindow):

          while 1:
              rc = dialog.run()
-            if rc == gtk.RESPONSE_CANCEL:
+            if rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
                  break

              # set the boot device based on what they chose
diff --git a/iw/netconfig_dialog.py b/iw/netconfig_dialog.py
index beb671f..cdcad5e 100644
--- a/iw/netconfig_dialog.py
+++ b/iw/netconfig_dialog.py
@@ -172,7 +172,7 @@ class NetworkConfigurator:
          self.window.show()
          while True:
              rc = self.window.run()
-            if rc == gtk.RESPONSE_CANCEL:
+            if rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
                  self._cancel()
                  break
              if self._ok():
diff --git a/iw/task_gui.py b/iw/task_gui.py
index 12e3558..b8204ed 100644
--- a/iw/task_gui.py
+++ b/iw/task_gui.py
@@ -333,7 +333,7 @@ class RepoEditor:

          while True:
              rc = self.dialog.run()
-            if rc == gtk.RESPONSE_CANCEL:
+            if rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
                  break

              reponame = self.nameEntry.get_text()
@@ -442,7 +442,7 @@ class RepoMethodstrEditor(RepoEditor):

          while True:
              rc = self.dialog.run()
-            if rc == gtk.RESPONSE_CANCEL:
+            if rc in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
                  rc = None
                  break

@@ -515,7 +515,7 @@ class TaskWindow(InstallWindow):
      def _addRepo(self, *args):
          dialog = RepoCreator(self.anaconda)
          dialog.createDialog()
-        if dialog.run() == gtk.RESPONSE_CANCEL:
+        if dialog.run() in [gtk.RESPONSE_CANCEL, gtk.RESPONSE_DELETE_EVENT]:
              return gtk.RESPONSE_CANCEL

          if dialog.repo.needsNetwork() and not network.hasActiveNetDev():

_______________________________________________
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