jamulussoftware / jamulussoftware/jamulus

Refactor CClientDlgOnConnectDisconnectBut()

Open
#3,401 0 comments 0 reactions 0 assignees View on GitHub
refactoring
Dominant language
C
Stars
1.1k
Forks
248
Avg merge
2d 3h
Merged PRs (30d)
9

Description

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 https://github.com/jamulussoftware/jamulus/pull/3372#discussion_r1761635248_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the named ClientDlg handlers and their signal connections: onClickConnect, onConnectDlgConnect, onConnect, onConnectFailed, onClickDisconnect, and onDisconnect. Confirm the button lifecycle described in the issue, then verify that connection and disconnection select the appropriate click handler without consulting client state in a shared handler.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
desktop
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.