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

Refactor CClientDlgOnConnectDisconnectBut() #3401

Open
ann0see opened this issue Oct 8, 2024 · 0 comments
Open

Refactor CClientDlgOnConnectDisconnectBut() #3401

ann0see opened this issue Oct 8, 2024 · 0 comments
Labels
refactoring Non-behavioural changes, Code cleanup

Comments

@ann0see
Copy link
Member

ann0see commented Oct 8, 2024

          This should be implemented by switching the `connect` setting for the signal handler for the button, rather than having one signal handler with an if that consults the state of the client.

Button life-cycle:

  • (public) ConnectDlg onClickConnect is connected to (private) ClientDlg onConnectDlgConnect
  • onClickConnect launches ConnectDlg if it's not already open (and nothing else)
  • onConnectDlgConnect disables the button and asks the client to connect to the provided address
  • onConnect switches the onClick handler to onClickDisconnect and enables the button
  • onConnectFailed just enables the button (keeping the onClickConnect handler) -- although, if Client is passing an error, here's where it would get displayed to the user
  • onClickDisconnect disables the button and asks the client to disconnect
  • onDisconnect (which should be handled) switches the onClick handler to onClickDisconnect and enables the button

Originally posted by @pljones in #3372 (comment)

@ann0see ann0see added the refactoring Non-behavioural changes, Code cleanup label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Non-behavioural changes, Code cleanup
Projects
None yet
Development

No branches or pull requests

1 participant