diff options
author | Ales Kozumplik <akozumpl@redhat.com> | 2010-10-05 16:58:28 +0200 |
---|---|---|
committer | Ales Kozumplik <akozumpl@redhat.com> | 2010-10-12 13:27:38 +0200 |
commit | 8e0fc6270abc5e9ae1612111060edab7ffc74196 (patch) | |
tree | 92d1b92d8c3e1f5dff411b63c28ba12a0180a31a | |
parent | d18b33afb5d6180045691a10243f9417d63668d9 (diff) | |
download | anaconda-8e0fc6270abc5e9ae1612111060edab7ffc74196.tar.gz anaconda-8e0fc6270abc5e9ae1612111060edab7ffc74196.tar.xz anaconda-8e0fc6270abc5e9ae1612111060edab7ffc74196.zip |
iscsi gui: make the iSCSI wizard never return gtk constants.
This is in preparation for making the addIscsiDrive() code same for both
the GUI/TUI.
-rw-r--r-- | pyanaconda/iw/advanced_storage.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/pyanaconda/iw/advanced_storage.py b/pyanaconda/iw/advanced_storage.py index 2b811f429..55cb1247d 100644 --- a/pyanaconda/iw/advanced_storage.py +++ b/pyanaconda/iw/advanced_storage.py @@ -210,16 +210,19 @@ class iSCSIWizard(object): def _normalize_dialog_response(self, value): """ - One can not use named GTK constants in glade, but we can get them by - filtering through this method. + Maps the glade return values to a boolean. + + Returns True upon success. """ - if value == 1: - return gtk.RESPONSE_OK + if value == 1: + # gtk.RESPONSE_OK + return True elif value == -6: - return gtk.RESPONSE_CANCEL + # gtk.RESPONSE_CANCEL + return False elif value == gtk.RESPONSE_DELETE_EVENT: # escape pressed to dismiss the dialog - return gtk.RESPONSE_CANCEL + return False else: raise ValueError("Unexpected dialog box return value: %d" % value) @@ -441,7 +444,7 @@ def addIscsiDrive(anaconda): rc = wizard.display_discovery_dialog( anaconda.storage.iscsi.initiator, anaconda.storage.iscsi.initiatorSet) - if rc == gtk.RESPONSE_CANCEL: + if not rc: break anaconda.storage.iscsi.initiator = wizard.get_initiator() discovery_dict = wizard.get_discovery_dict() @@ -458,12 +461,12 @@ def addIscsiDrive(anaconda): _("No new iSCSI nodes discovered")) break (rc, selected_nodes) = wizard.display_nodes_dialog(found_nodes) - if rc == gtk.RESPONSE_CANCEL or len(selected_nodes) == 0: + if not rc or len(selected_nodes) == 0: break step = STEP_LOGIN elif step == STEP_LOGIN: rc = wizard.display_login_dialog() - if rc == gtk.RESPONSE_CANCEL: + if not rc: break login_dict = wizard.get_login_dict() log.critical("logging with %s" % login_dict) @@ -485,7 +488,7 @@ def addIscsiDrive(anaconda): rc = wizard.display_success_dialog(login_ok_nodes, login_fail_nodes, login_fail_msg) - if rc == gtk.RESPONSE_OK: + if rc: step = STEP_DONE else: # user wants to try logging into the failed nodes again |