-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in AuthenticationDialog #463
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, I imagine this will also affect PasswordDialog so would be useful to fix there too
self.destroy() | ||
self.deferred.callback(response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this was copied from the other dialog but we can make use of super to call the parent class cleanup steps
self.destroy() | |
self.deferred.callback(response) | |
super()._on_response(widget, response) |
@@ -316,7 +316,7 @@ def _on_connect_fail(self, reason, host_id, try_counter): | |||
|
|||
def dialog_finished(response_id): | |||
if response_id == Gtk.ResponseType.OK: | |||
self._connect(host_id, dialog.get_username(), dialog.get_password()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If AuthenticationDialog methods get_username
and get_password
are not usable then they should also be removed from the class.
@@ -23,6 +23,7 @@ Contributors (and Past Developers): | |||
* Pedro Algarvio ('s0undt3ch') <[email protected]> | |||
* Cristian Greco ('cgreco') <[email protected]> | |||
* Chase Sterling ('gazpachoKing') <[email protected]> | |||
* Justin Williams ('Jaywalker') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list is really for authors of significant contributions to Deluge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two linting issues by the way, figured I'd point them out.
https://github.com/deluge-torrent/deluge/actions/runs/10640286820/job/29631116756
@@ -316,7 +316,7 @@ def _on_connect_fail(self, reason, host_id, try_counter): | |||
|
|||
def dialog_finished(response_id): | |||
if response_id == Gtk.ResponseType.OK: | |||
self._connect(host_id, dialog.get_username(), dialog.get_password()) | |||
self._connect(host_id, dialog.account.username, dialog.account.password) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._connect(host_id, dialog.account.username, dialog.account.password) | |
self._connect( | |
host_id, dialog.account.username, dialog.account.password | |
) |
self.account = Account( | ||
self.username_entry.get_text(), | ||
self.password_entry.get_text(), | ||
"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"", | |
'', |
Specific bug is described here: https://dev.deluge-torrent.org/ticket/3643#ticket
The issue occured because the
AuthenticationDialog
wasdestroy()
'd before the calls were made to get the text from theirGTK.Entry()
's. It has been fixed by using the same method asAccountDialog
and storing the information in anAccount
object prior to thedestroy()
call.It may be worth considering giving the user an option to save/update the
hostlist.conf
file with the working credentials as well, but that would merit discussion and a separate PR. This PR simply fixes the problem and leaves existing logic flow in place.