Skip to content
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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Copy link
Member

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


Plugin Developers:
* Autoadd : Chase Sterling
Expand Down
2 changes: 1 addition & 1 deletion deluge/ui/gtk3/connectionmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Copy link
Member

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.

self._connect(host_id, dialog.account.username, dialog.account.password)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self._connect(host_id, dialog.account.username, dialog.account.password)
self._connect(
host_id, dialog.account.username, dialog.account.password
)


return dialog.run().addCallback(dialog_finished)

Expand Down
12 changes: 12 additions & 0 deletions deluge/ui/gtk3/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ def __init__(self, err_msg='', username=None, parent=None):
parent,
)

self.account = None

table = Gtk.Table(2, 2, False)
self.username_label = Gtk.Label()
self.username_label.set_markup('<b>' + _('Username:') + '</b>')
Expand Down Expand Up @@ -245,6 +247,16 @@ def get_password(self):
def on_password_activate(self, widget):
self.response(Gtk.ResponseType.OK)

def _on_response(self, widget, response):
if response == Gtk.ResponseType.OK:
self.account = Account(
self.username_entry.get_text(),
self.password_entry.get_text(),
"",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"",
'',

)
self.destroy()
self.deferred.callback(response)
Comment on lines +257 to +258
Copy link
Member

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

Suggested change
self.destroy()
self.deferred.callback(response)
super()._on_response(widget, response)



class AccountDialog(BaseDialog):
def __init__(
Expand Down
Loading