Commit Graph

1870 Commits

Author SHA1 Message Date
Rachel Powers
085e067fc1
remove NDEBUG check per Scrumplex's orders
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-01-24 02:26:21 -07:00
Rachel Powers
c45fa016c0
fix: let jars be found from inside build dir for debug builds
debug bug builds run form inside the build dir before they are bundled can't find the jars

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-01-23 18:36:58 -07:00
Sefa Eyeoglu
16477a8f6c
Merge pull request #675 from flowln/generalize_mod_model 2023-01-23 23:58:52 +01:00
Sefa Eyeoglu
04e4900415
Merge pull request #758 from flowln/fix_process_events_backstab 2023-01-23 23:58:41 +01:00
flow
ea5020e188
fix(license): add/fix my copyright/license headers
*sobbing in messy legal stuff i know nothing about*

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-23 11:12:43 -03:00
flow
445f9e5f71
feat+fix(Version): make comparsion FlexVer-compatible
... and fixes a minor issue in the parsing.

This changes the expected behavior of Versions in one significant way:
Now, Versions like 1.2 or 1.5 evaluate to LESS THAN 1.2.0 and 1.5.0
respectively. This makes sense for sorting versions, since one expects
the versions without patch release to 'contain' the ones with, so the
ones without should be evaluated uniformily with the ones with the
patch.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-21 18:47:47 -03:00
leo78913
5a25ce8c1b Fix main window icon and stuff
i forgor 💀

Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
670cf8ee07 Fix: make the newsLabel toolbutton fullwidth again
this reverts it to how it was before the MainWindow .ui port

Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
6c5f6e8900 Fix status bar name
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
4ed4fb2314 remove useless setEnabled calls
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
f16989bea9 feat(WideBar): custom context menu actions
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
55d4064335 Fix: translate actionNoDefaultAcount text
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
3b38a4c690 Fix: translate NoAccountsAdded text
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
ada595663d fix(widebar): fix insertSeparator
WideBar::insertSeparator was adding the separator to the end of the toolbar

Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
b2de01b076 feat(WideBar): Allow disabling alt shortcuts
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
f3acf35aea refactor: Port the main window to a .ui file
some stuff still needs to be done in the c++ side because qt designer is dumb >:(

the instance toolbar icon and instance name buttons are still added manually inside MainWindow.cpp

looks almost identical, with some minor tweaks:
- the instance toolbar is now a WideBar, so you can customize what actions you want :D
- the instance toolbar buttons are now fullwidth
- the close window button is now at the end of the file menu
- the help menu has some layout changes

this also fixes some stuff:
- menus not having tooltips
- the top toolbar not connecting to the title bar in kde
- the instance toolbar separators looking weird after you move the toolbar

Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:45:43 -03:00
leo78913
3da1d6a464 feat: add Widebar::InsertWidgetBefore method
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-20 19:44:39 -03:00
Tayou
cdc9f93f71
make MainWindow cat update instantly
Signed-off-by: Tayou <tayou@gmx.net>
2023-01-20 15:16:25 +01:00
flow
bcebb1920f
refactor: clean up Section struct
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-20 11:15:26 -03:00
flow
81848e05f1
refactor: simplify Version operators
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-20 11:15:26 -03:00
Edgars Cīrulis
0199d8a74f
Version.cpp: Add new line
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-01-19 14:12:59 +02:00
Edgars Cīrulis
f49ad2ee03
Version.h: Fix comparison of null version in Version class
Co-authored-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-01-19 10:40:30 +02:00
Rachel Powers
7ed993b54e
fix: proper null padded version comparison
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-01-19 09:51:11 +02:00
Rachel Powers
9934537e19
feat: add debug printing for Version
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-01-19 09:50:45 +02:00
flow
00d42d296e
fix: call processEvents() before adding new tasks to the task queue
This allows the ongoing task to go off the stack before the next one is
started.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-18 16:23:30 -03:00
Edgars Cīrulis
730f714e97
Version.cpp: Remove unnecessary QStringList include
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-01-17 22:39:19 +02:00
Edgars Cīrulis
3bec4a80b3
Version.cpp: Decompose version strings according to flexver
Co-authored-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-01-17 22:39:12 +02:00
Edgars Cīrulis
a84e4b0e07
Version.cpp: Format parse function code using clang-format
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-01-17 07:14:49 +02:00
Edgars Cīrulis
198139feb4
Version.cpp: Simplify Version::parse by using const auto& current_char
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-01-17 07:14:37 +02:00
Edgars Cīrulis
de11017552
Version.cpp: Use anonymous function to eliminate code duplication
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-01-17 07:14:29 +02:00
Edgars Cīrulis
6fb837c529
Version.cpp: Add version string parser to split on '.' character
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-01-17 07:14:05 +02:00
Edgars Cīrulis
c0c3892064
Version.cpp: Improve version parsing to handle mixed numeric and alphabetic characters
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-01-17 07:13:24 +02:00
Sefa Eyeoglu
1a35fec134
Merge pull request #696 from Ryex/import-all-the-things
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/581
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/700
2023-01-16 10:04:09 +01:00
Sefa Eyeoglu
cd893e18d2
chore: update license headers
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-01-14 17:21:52 +01:00
flow
cf022524d1
Merge pull request #743 from flowln/fix_mods_with_wrong_modListVersion 2023-01-14 12:19:12 -03:00
flow
ebb0596c1a
fix: don't fail mod parsing when encountering invalid modListVersion
The spec (admitely a very old one) states that this entry should always
have the value "2". However, some mods do not follow this convention,
causing issues.

One notable example is the 1.6 version of Aether II for 1.7.10, that has
this value set at "5" for whatever reason.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 21:15:10 -03:00
flow
3de681d2d6
Merge pull request #685 from byteduck/instance-accounts 2023-01-13 17:21:12 -03:00
Rachel Powers
f7b0ba88da Apply suggestions from code review
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-01-13 13:15:13 -07:00
flow
c95c81d42f
fix(ModUpdater): ensure instead of require icon_url
The spec says that this can be null, and indeed some mods have it set to
null, and should still be considered as valid.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:59:37 -03:00
flow
9407596b12
fix(ModUpdater): fail mods individually when there's errors in the JSON
Prevents a single problematic mod from invalidating all the API
response.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:49:21 -03:00
flow
c294c2d1df
refactor(RD): allow setting custom folder target for downloaded resources
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:09 -03:00
flow
bd36f8e220
fix(RD): set resource strings for ReviewMessageBox too
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:09 -03:00
flow
1919069b12
fix(RD): don't assert search offset on fetchMore() in ResourceModel
This allows the standard QAbstractItemModelTester to work without
shenanigans!

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:09 -03:00
flow
ba677a8cb7
refactor: change some ResourceAPI from NetJob to Task
This makes it easier to create resource apis that aren't network-based.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:09 -03:00
flow
e62e1d9701
refactor(RD): move BaseInstance dep. to subclasses of ResourceModel
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:08 -03:00
flow
b3330cb0da
fix(RD): correctly set the strings for the specific resource names
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:08 -03:00
flow
7d128c79a3
fix: CodeQL warnings about the rule of two
shush

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:08 -03:00
flow
3cff23dae2
refactor(RD): move success callbacks from ModModel to ResourceModel
While implementing the resource pack downloader in another branch, I
noticed that most of the code in the success callback was identical in
both cases, safe for a few minute differences in strings. So, this tries
to make it easier to share this piece of code.

However, it still leaves the possibility of extending the methods in
ResourceModel to accomodate for cases where this similarity may not
hold.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:08 -03:00
flow
c3f0139f76
refactor(RD): add helper in ResourceModel to find current sorting
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:08 -03:00
flow
563fe8d515
fix(RD): separate search and versions/info tasks
This allows us to check whether a search request is already on-going, in
which case we don't need to make another one (and shouldn't).

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:08 -03:00
flow
38e20eb148
fix(RD): pass copy of IndexedPack to callbacks instead of ref.
This prevents a crash in which the pack list gets updated in a search
request meanwhile a versions / extra info request is being processed.
Previously, this situation would cause the reference in the latter
callbacks to be invalidated by an internal relocation of the pack list.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:07 -03:00
flow
36571c5e22
refactor(RD): clear up sorting methods
This refactors the sorting methods to join every bit of it into a single
list, easing maintanance. It also removes the weird index contraint on
the list of methods by adding an index field to the DS that holds the
method.

Lastly, it puts the available methods on their respective API, so other
resources on the same API can re-use them later on.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:07 -03:00
flow
c8eca4fb85
fix: build with qt5.12 on Linux and pedantic flag
Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:07 -03:00
flow
0e207aba6c
feat(RD): add roleNames and Q_PROPERTY to ResourceModel
in preparation for QML interop.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:07 -03:00
flow
45d1319891
refactor(RD): decouple ResourceModels from ResourcePages
This makes it so that we don't need a reference to the parent page in
the model. It will be useful once we change the page from a widget-based
one to a QML page.

It also makes tasks be created in the dialog instead of the page, so
that the dialog can also have the necessary information to mark versions
as selected / deselected easily. It also makes the task pointers into
smart pointers.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:07 -03:00
flow
39b7ac90d4
refactor(RD): unify download dialogs into a single file
No need for multiple files since the subclasses are so small now

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:06 -03:00
flow
ef87bdf18a
fix(RD): prevent weird behavior of progress widget
when i.e. clicking on links or just using the downloader at all, this
prevents some flickering and the widget never getting hidden in some
cases.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:06 -03:00
flow
433a802c6e
refactor: put resource downloading classes in common namespace
Puts them all inside the 'ResourceDownload' namespace, so that it's a
bit clearer from the outside that those belong to the same 'module'.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:06 -03:00
flow
6a18079953
refactor: generalize mod models and APIs to resources
Firstly, this abstract away behavior in the mod download models that can
also be applied to other types of resources into a superclass, allowing
other resource types to be implemented without so much code duplication.

For that, this also generalizes the APIs used (currently, ModrinthAPI
and FlameAPI) to be able to make requests to other types of resources.

It also does a general cleanup of both of those. In particular, this
makes use of std::optional instead of invalid values for errors and,
well, optional values :p

This is a squash of some commits that were becoming too interlaced
together to be cleanly separated.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-13 16:23:00 -03:00
flow
b937d33436
Merge pull request #714 from redstrate/cmark 2023-01-13 16:16:00 -03:00
Aaron Sonin
b2f48eaeb8
Merge branch 'PrismLauncher:develop' into instance-accounts 2023-01-12 20:11:46 -08:00
Aaron
160dd09fc2
Fix instance account selector face for offline accounts 2023-01-12 20:03:31 -08:00
Joshua Goins
807da6a035 fix: Remove extra line breaks for modrinth descriptions
Signed-off-by: Joshua Goins <josh@redstrate.com>
2023-01-12 10:08:52 -05:00
Sefa Eyeoglu
22a2b7ac46 refactor: support system and bundled cmark
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-01-12 10:08:52 -05:00
Joshua Goins
24a4bd3a1c refactor: replace hoedown markdown parser with cmark
Signed-off-by: Joshua Goins <josh@redstrate.com>
2023-01-12 10:08:52 -05:00
Sefa Eyeoglu
fff52cb247
feat: add button to import component JSONs
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-01-11 13:50:57 +01:00
Sefa Eyeoglu
219c5b323d
Merge pull request #731 from flowln/windows_server_trash 2023-01-11 09:49:20 +01:00
flow
391ef64c22
fix(FileSystem): don't attempt to trash items on Windows Server
For some reason this makes some of our CI test runs super slow, and
sometimes fail miserably.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-10 12:50:56 -03:00
Tayou
668b19d119
Add hint about Cat
Signed-off-by: Tayou <tayou@gmx.net>
2023-01-10 16:09:57 +01:00
Sefa Eyeoglu
5c48f0b458
fix: set minimum size for setup wizard
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-01-10 16:06:50 +01:00
Tayou
689fe1e2c7
CRLF -> LF
damn you visual studio for creating CRLF files everywhere...
Signed-off-by: Tayou <tayou@gmx.net>
2023-01-10 16:06:50 +01:00
Tayou
7d440402ad
Update launcher/Application.cpp with suggestion from scrumplex
Co-authored-by: Sefa Eyeoglu <contact@scrumplex.net>
Signed-off-by: Tayou <tayou@gmx.net>
2023-01-10 16:06:42 +01:00
Tayou
6daa457838
Implement Suggestions from flow & Scrumplex
Signed-off-by: Tayou <tayou@gmx.net>
2023-01-10 16:06:42 +01:00
Tayou
49d317b19a
UX tweak + formatting + added cat to wizard
Signed-off-by: Tayou <tayou@gmx.net>
2023-01-10 16:06:24 +01:00
Tayou
1b80ae0fca
add theme setup wizard
Signed-off-by: Tayou <tayou@gmx.net>
2023-01-10 16:06:01 +01:00
Sefa Eyeoglu
61144f7a21
Merge pull request #726 from TheLastRar/qt6-win-darkmode
Closes https://github.com/PrismLauncher/PrismLauncher/issues/158
2023-01-10 08:48:17 +01:00
Rachel Powers
574af2c795 chore: cleanup review suggestions
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-01-09 17:18:08 -07:00
Rachel Powers
a4870d4834 fix: fix #700
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>
2023-01-09 17:00:12 -07:00
TheLastRar
78bbcac0ea ui: Let Qt 6.4.2 handle dark mode titlebar
Signed-off-by: TheLastRar <TheLastRar@users.noreply.github.com>
2023-01-09 19:44:11 +00:00
Sefa Eyeoglu
ca9b2525c8
Merge pull request #715 from getchoo/add-teawie 2023-01-09 09:46:31 +01:00
seth
9de6927c3f
feat: add CC BY-SA 4.0 info for teawie images
Signed-off-by: seth <getchoo@tuta.io>
2023-01-07 19:18:22 -05:00
Rachel Powers
30b01ef053 fix: *sigh* no implicit QString->QFileInfo conversion in Qt6, again...
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-01-07 15:04:23 -07:00
Rachel Powers
03b75bf2a9 feat: Import all the things!
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
2023-01-07 15:04:22 -07:00
Sefa Eyeoglu
f3f628410d
Merge pull request #576 from Ryex/identify-zip-packs
fix https://github.com/PrismLauncher/PrismLauncher/issues/349
2023-01-07 17:33:34 +01:00
Sefa Eyeoglu
9901ecda49
Merge pull request #710 from byquanton/develop
Fixes https://github.com/PrismLauncher/PrismLauncher/issues/708
2023-01-07 17:18:10 +01:00
seth
f5955a4738
feat: add bday teawie
Signed-off-by: seth <getchoo@tuta.io>
2023-01-07 04:47:53 -05:00
seth
e018b30875
fix: make spooky teawie load
gimp fail

Signed-off-by: seth <getchoo@tuta.io>
2023-01-07 04:38:26 -05:00
seth
2dbd775cf3
feat: add xmas teawie
Signed-off-by: seth <getchoo@tuta.io>
2023-01-07 04:37:41 -05:00
seth
a5051327db
feat: add spooky teawie
Signed-off-by: seth <getchoo@tuta.io>
2023-01-07 03:42:53 -05:00
seth
8140f5136d
feat: add teawie
drawn by sympathytea (https://github.com/SympathyTea)

Signed-off-by: seth <getchoo@tuta.io>
2023-01-06 22:28:15 -05:00
Joshua Goins
f04703f09b Strip certain HTML tags when rendering mod pages
Some mod pages use certain tags for centering purposes, but trips up
hoedown.

Signed-off-by: Joshua Goins <josh@redstrate.com>
2023-01-06 15:05:19 -05:00
byquanton
2faf8332ee
fix: Add 1.16+ Forge library prefix in TechnicPackProcessor.cpp
Signed-off-by: byquanton <32410361+byquanton@users.noreply.github.com>
2023-01-06 02:44:10 +01:00
Aaron Sonin
e0e3d4d8fe
Merge branch 'PrismLauncher:develop' into instance-accounts 2023-01-02 11:59:29 -07:00
Aaron
ba81ad1ac3 Reword instance-specific account settings, apply clang-format
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
2023-01-02 11:17:19 -07:00
Aaron Sonin
eefb259ddf Remove unecessary delete in InstanceSettingsPage destructor
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>
2023-01-02 11:17:19 -07:00
Aaron Sonin
9b8add1961 Properly connect signal in instance settings for account selector
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>
2023-01-02 11:17:19 -07:00
Aaron Sonin
e186523878 Add null check for face in instance account settings selector
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>
2023-01-02 11:17:19 -07:00
Aaron Sonin
021e6c02d7 Replace unecessary type check with assertion in InstanceSettingsPage
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>
2023-01-02 11:17:19 -07:00
Aaron
cba3d68063 Fix conflicting layout name in InstanceSettingsPage
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
2023-01-02 11:17:19 -07:00
Aaron
7e2d78bab5 Allow selecting a default account to use with an instance
Signed-off-by: Aaron <10217842+byteduck@users.noreply.github.com>
2023-01-02 11:17:19 -07:00