jamulussoftware / jamulussoftware/jamulus

Refactor CClientDlgOnConnectDisconnectBut()

Ouverte
#3,401 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
refactoring
Langage dominant
C
Étoiles
1.1k
Forks
248
Merge moyen
2 j 3 h
PR mergées (30 j)
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_

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par suivre les handlers ClientDlg nommés et leurs connexions de signaux : onClickConnect, onConnectDlgConnect, onConnect, onConnectFailed, onClickDisconnect et onDisconnect. Confirmez le cycle de vie des boutons décrit dans l’issue, puis vérifiez que la connexion et la déconnexion sélectionnent le click handler approprié sans consulter l’état du client dans un handler partagé.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
c
Domaine
desktop
Type d'issue
Refactorisation
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.