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

Allow selecting a default account to use with an instance #685

Merged
merged 11 commits into from Jan 13, 2023

Conversation

byteduck
Copy link
Contributor

@byteduck byteduck commented Dec 27, 2022

This commit adds the functionality to select a default account to use when launching an instance (#341). If no account is supplied via the accountToUse parameter of Application::launch, then the instance will launched logged into the default account for the instance (or the global default account if none is set for the instance).

The setting is found in the Miscellaneous tab of the instance settings and looks like this:
image
image

I couldn't manage to get a screenshot with the dropdown open, but it contains an option for every account configured in Prism. To revert the setting, one can simply uncheck the "Set a default account to use with this instance" box. If the account configured is removed, then the setting is reverted to showing "No default account".

@flowln flowln added the enhancement New feature or request label Dec 28, 2022
@flowln flowln added this to the 7.0 milestone Dec 28, 2022
Copy link
Contributor

@flowln flowln left a comment

Choose a reason for hiding this comment

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

seems to be working mostly fine, thanks! most the suggested changes are only about some code cleanups :)

we have a .clang-format thingy in the launcher's root directory, please use that on the code you've added, the formatting is somewhat inconsistent :p

launcher/ui/pages/instance/InstanceSettingsPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/instance/InstanceSettingsPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/instance/InstanceSettingsPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/instance/InstanceSettingsPage.cpp Outdated Show resolved Hide resolved
launcher/ui/pages/instance/InstanceSettingsPage.cpp Outdated Show resolved Hide resolved
@TheKodeToad
Copy link
Member

TheKodeToad commented Dec 29, 2022

imo the option name name is slightly longer than it should be.

@byteduck
Copy link
Contributor Author

imo the option name name is slightly longer than it should be.

As in, the text seen in the GUI or the key used for the settings store?

@byteduck
Copy link
Contributor Author

we have a .clang-format thingy in the launcher's root directory, please use that on the code you've added, the formatting is somewhat inconsistent :p

Ah yes, my apologies - I was trying to follow the style of the code I saw and didn't notice the .clang-format. Will do!

@TheKodeToad
Copy link
Member

TheKodeToad commented Jan 2, 2023

imo the option name name is slightly longer than it should be.

As in, the text seen in the GUI or the key used for the settings store?

In the GUI. "for this instance" could be seen as redundant.

byteduck and others added 7 commits January 2, 2023 11:17
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: Aaron Sonin <10217842+byteduck@users.noreply.github.com>
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: Aaron Sonin <10217842+byteduck@users.noreply.github.com>
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: Aaron Sonin <10217842+byteduck@users.noreply.github.com>
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: Aaron Sonin <10217842+byteduck@users.noreply.github.com>
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
@byteduck
Copy link
Contributor Author

byteduck commented Jan 2, 2023

imo the option name name is slightly longer than it should be.

As in, the text seen in the GUI or the key used for the settings store?

In the GUI. For this instance could be seen as redundant.

I've reworded it to "Override default account". When unchecked, the instance-specific account selector will show the current global setting for the default account.

@byteduck
Copy link
Contributor Author

byteduck commented Jan 2, 2023

Hmm, not sure why the ResourceFolderModel test failed on Windows-MSVC-Legacy only. Nothing I did should affect that, right? I did notice that Windows-MSVC-Legacy failed when I first opened this PR, and when run a second time after signing my commit, it succeeded.

@flowln
Copy link
Contributor

flowln commented Jan 2, 2023

Hmm, not sure why the ResourceFolderModel test failed on Windows-MSVC-Legacy only. Nothing I did should affect that, right? I did notice that Windows-MSVC-Legacy failed when I first opened this PR, and when run a second time after signing my commit, it succeeded.

seems to be some issue on develop, i've seen another PR with the same error earlier today, dw about that

@byteduck byteduck requested a review from flowln January 9, 2023 17:14
Copy link
Contributor

@flowln flowln left a comment

Choose a reason for hiding this comment

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

sorry, i kinda forgot i didn't already review this 😅

anyway, the code looks mostly good, there's just a little cornercase and maybe moving some logic to a helper function, otherwise it's all good! thanks!

launcher/ui/pages/instance/InstanceSettingsPage.cpp Outdated Show resolved Hide resolved
@byteduck
Copy link
Contributor Author

byteduck commented Jan 9, 2023

sorry, i kinda forgot i didn't already review this 😅

No worries! I'll get the corner case fixed soon :)

@byteduck byteduck force-pushed the instance-accounts branch 4 times, most recently from 05d6227 to 160dd09 Compare January 13, 2023 04:11
…hub.com>

I, Aaron <10217842+byteduck@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 160dd09

Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
@byteduck
Copy link
Contributor Author

Seems like some Ubuntu package mirrors are down which caused the checks to fail... I'm encountering this on my own projects too 😬

@DioEgizio
Copy link
Member

Seems like some Ubuntu package mirrors are down which caused the checks to fail... I'm encountering this on my own projects too 😬

actions/runner-images#6894

Copy link
Contributor

@flowln flowln left a comment

Choose a reason for hiding this comment

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

ideally we'd have some place in the UI to indicate that the account for a given instance is overridden. However, that'd probably mean messing with the account selector thingy, so it's probably a bit troublesome for now...

anyway, this looks good to me for the time being, so thank you! :D

Copy link
Member

@Scrumplex Scrumplex left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@flowln flowln merged commit 3de681d into PrismLauncher:develop Jan 13, 2023
@byteduck byteduck deleted the instance-accounts branch January 13, 2023 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants