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

Import all the things! #696

Merged
merged 5 commits into from Jan 16, 2023
Merged

Conversation

Ryex
Copy link
Contributor

@Ryex Ryex commented Dec 31, 2022

Based off #576

Fixes #581
Fixes #700

  • Adds processing for any number of files passed via cmdline without other flags to be imported.
  • allows the -I flag to be passed multiple times
  • files passed with the -I flag and though tacked on at the end without flags are treated the same are functionally identical
  • all paths passes are identified with the work from Identify zip file contents #576.
    • for each file a dialog asks what instance they wish to import the file to
    • if the file is not identified it attempts to import it as an instance
    • only data packs are ignored as we have no real handling of them yet.

@flowln flowln added bug Something isn't working enhancement New feature or request blocked Blocked until another PR is merged labels Dec 31, 2022
@flowln flowln added this to the 7.0 milestone Dec 31, 2022
Comment on lines 70 to 85
switch (type) {
default: {
auto res = Resource::compare(other, type);
if (res.first != 0)
return res;
}
case SortType::PACK_FORMAT: {
auto this_ver = packFormat();
auto other_ver = cast_other.packFormat();

if (this_ver > other_ver)
return { 1, type == SortType::PACK_FORMAT };
if (this_ver < other_ver)
return { -1, type == SortType::PACK_FORMAT };
}
}

Check notice

Code scanning / CodeQL

No trivial switch statements

This switch statement should either handle more cases, or be rewritten as an if statement.
@Ryex
Copy link
Contributor Author

Ryex commented Jan 2, 2023

with the latest commit this should fix #700 as well

@DioEgizio
Copy link
Member

This should be rebased

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
launcher/ui/MainWindow.cpp Fixed Show resolved Hide resolved
@flowln flowln removed the blocked Blocked until another PR is merged label Jan 7, 2023
@flowln flowln self-requested a review January 7, 2023 23:49
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.

this looks good to me, just did some nitpicks :3

launcher/minecraft/mod/tasks/LocalResourceParse.cpp Outdated Show resolved Hide resolved
launcher/ui/MainWindow.cpp Outdated Show resolved Hide resolved
launcher/ui/dialogs/ImportResourceDialog.h Outdated Show resolved Hide resolved
launcher/ui/dialogs/ImportResourceDialog.h Outdated Show resolved Hide resolved
@flowln
Copy link
Contributor

flowln commented Jan 9, 2023

btw, 47381a1 has some typos in the description :P

fixed by properly converting from a file path and converting to native seperators.
should have known naive handling of file path as a URL would come back to bite us cross platform.

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
@Ryex
Copy link
Contributor Author

Ryex commented Jan 10, 2023

fixed.
also amended 47381a1 to a4870d4

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
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.

lgtm, thanks!

launcher/Application.cpp Outdated Show resolved Hide resolved
launcher/ui/MainWindow.cpp Outdated Show resolved Hide resolved
launcher/ui/MainWindow.cpp Fixed Show resolved Hide resolved
launcher/ui/MainWindow.cpp Outdated Show resolved Hide resolved
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
@Ryex
Copy link
Contributor Author

Ryex commented Jan 13, 2023

fixed

@Ryex Ryex requested a review from Scrumplex January 16, 2023 00:40
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.

Thanks!

@Scrumplex Scrumplex merged commit 1a35fec into PrismLauncher:develop Jan 16, 2023
@Ryex Ryex deleted the import-all-the-things branch January 16, 2023 09:21
@Ryex Ryex mentioned this pull request Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows File Association Bug right click- open with- prism launcher (zip/mrpack) doesn't work on linux
4 participants