Commit Graph

891 Commits

Author SHA1 Message Date
leo78913
2b0252d4ae Fix: fix some regressions in the main window
this removes the update action from the help button
and fixes the add to path action not showing on macos

Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-28 15:09:26 -03:00
flow
c78db5459e
Merge pull request #724 from leo78913/dot-ui-mainwindow
Closes https://github.com/PrismLauncher/PrismLauncher/issues/594
Closes https://github.com/PrismLauncher/PrismLauncher/issues/69
Closes https://github.com/PrismLauncher/PrismLauncher/issues/473
2023-01-27 10:55:49 -08:00
leo78913
a27564ed70 better fix for WideBar::insertSeparator
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-27 13:48:12 -03:00
leo78913
df8df41621 Remove unused BarEntry variable
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-27 12:40:27 -03:00
leo78913
d5a0d4b452
Update launcher/ui/MainWindow.ui
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-27 12:35:53 -03:00
leo78913
357b6ee991
Update launcher/ui/MainWindow.ui
Co-authored-by: flow <flowlnlnln@gmail.com>
Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-27 12:35:41 -03:00
leo78913
4d2b5c2f42 refactor: clean up some MainWindow stuff
this makes the accounts button and menubar item share the same QMenu
and also refactors some code

Signed-off-by: leo78913 <leo3758@riseup.net>
2023-01-26 19:48:21 -03:00
flow
29f7ea752f
refactor: make shared_qobject_ptr ctor explicit
This turns issues like creating two shared ptrs from a single raw ptr
from popping up at runtime, instead making them a compile error.

Signed-off-by: flow <flowlnlnln@gmail.com>
2023-01-25 16:57:51 -03:00
Sefa Eyeoglu
6e841a3b7e
Merge branch 'develop' into remove-updater
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2023-01-24 14:40:17 +01:00
Sefa Eyeoglu
16477a8f6c
Merge pull request #675 from flowln/generalize_mod_model 2023-01-23 23:58:52 +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
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
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
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
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
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
24a4bd3a1c refactor: replace hoedown markdown parser with cmark
Signed-off-by: Joshua Goins <josh@redstrate.com>
2023-01-12 10:08:52 -05: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