-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Remember user inputs after failed registration #4982 #4983
Open
candyapplecorn
wants to merge
6
commits into
Cockatrice:master
Choose a base branch
from
candyapplecorn:remember-user-inputs-after-failed-registration
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
920fdf2
Modify dlg register to accept optional arguments for previous registr…
candyapplecorn 9d0c4be
Updated formatting
candyapplecorn ddf8487
Made DlgRegister a friend class of AbstractClient so that it can
candyapplecorn 710f0ed
changed window_main to friend of DLGRegister; pass in args for RAII
candyapplecorn 72a3c43
Merge branch 'master' into pr/4983
tooomm 853675f
simply save values in mainwindow, remove friends
ebbit1q File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
#include <QWebSocket> | ||
|
||
class QTimer; | ||
class DlgRegister; | ||
|
||
class RemoteClient : public AbstractClient | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why not instead of all this messing around with accessing the client's private fields just pass the needed information to the dialog's constructor?
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.
sure, that would work. Pretty sure I wanted to do it that way as well, cannot remember exactly why I decided to stop and try a different way. I believe we would need to modify the remote client (or the abstract client it inherits from) so that the
window_main
file could access those values.So I think in the end we would still need to modify some class to give permission to another class to access its data
A better solution still would be to keep the dialogue open and not destroy it until the user has exited out of the flow by either canceling or quitting the program or successfully registering. Somewhere, there are some signals that cause the
dialogue register
to close. There's gotta be a failure one and a success one and maybe one or two others for errors or who knows what. We would need to find all of those slots that are listening for those signals and modify them to not close the dialogueDlgRegister
if the user encounters a registration error. I also think just hitting the submit button on the registration dialogue closes the registration dialogue, so that one would need to be modified as well. This would definitely be the best approach if I could pull it off though because then we wouldn't need to modify any of the accessibility of the class attributes.Because by simply having the same dialogue stay open, it would remember what its values are, since it never would've closed in the first place.
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've been meaning to do that yet still haven't found the time to sit down and get it all sorted, it needs a lot of signals and stuff moved #4586
my comment here is just regarding the arguments in the constructor of the dialog, no changes to the header of the client will be required, just pass the values when the dialog is instantiated.
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.
Sounds like an easy change to make then @ebbit1q . RAII is good. I hope to get around to it not too long from now. Thanks for your advice
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've changed the constructor to accept arguments: https://github.com/Cockatrice/Cockatrice/pull/4983/files#diff-1b35d27e75120bfb88322ce520f3c057ab93b345875738aba24e04a8596b3285R16