35 Commits

Author SHA1 Message Date
Ghostkeeper
ac67dcc045
Don't cache PluginRegistry instance
Several reasons:
* It's bad style, making it harder to test with mocked PluginRegistry since all sorts of objects have copies of the un-mocked object in their fields.
* It's causing errors in this case when checkIfRestartNeeded is called before show().

Fixes Sentry issue CURA-3P6.
2022-06-22 11:52:13 +02:00
j.delarago
d5511a078c Dialog was immediately being destroyed because a reference to it was not being stored in memory. Added a missingPackageDialog variable to WorkspaceDialog to fix this.
Swapped the loading order of Marketplace extensions so SyncOrchestractor is not fetched by PluginRegistry.getInstance().getPluginObject("Marketplace") in WorkspaceDialog.

CURA-8610
2022-06-08 12:19:36 +02:00
Ghostkeeper
0f12b012cf
Create InstallMissingPackageDialog with newly-exposed function from Marketplace
This adds a new function to the API of the Marketplace plug-in.
It's not pretty, but it's going to be how it is for a while.

Done to fix a critical build issue. The 'import plugins' thing works from source but not on the build.
2022-06-08 10:19:51 +02:00
j.delarago
b015617e13 Marketplace plugin registry is None on initialization, and is loaded after running show().
This makes a check that the window is open before continuing through checkIfRestartNeeded

CURA-6990
2022-06-01 16:56:02 +02:00
Jelle Spijker
3f8907d02a
Merge branch 'master' into CURA-8640_PyQt6
# Conflicts:
#	cura/CuraApplication.py
#	resources/qml/Preferences/Materials/MaterialsSyncDialog.qml
#	resources/qml/Preferences/Materials/MaterialsView.qml
2022-03-24 11:53:44 +01:00
Ghostkeeper
25e914b1cb
Fix checkbox for automatic plug-in update checking
The checkbox was still there in the preferences page, but it didn't work at all, for two reasons:
- The preference entry didn't exist. This was causing warnings in the log (which is why I saw it).
- It wasn't checking the preference before making that API call. Could make a bunch of people pretty angry.
2022-03-11 10:25:31 +01:00
Remco Burema
99449dbc34 Get rid of some errors first.
Was using Qt5 still, even though we're dumping that. Need a bit of a level playing field for an update to the way we handle libArcus and libSavitar.

part of CURA-7924
2022-02-25 13:25:35 +01:00
Jaime van Kessel
61a7203726 Only reset marketplace page if the window isn't visible
CURA-8588
2022-01-04 13:13:31 +01:00
Jaime van Kessel
27e5905a32 Fix typing
CURA-8588
2022-01-03 11:44:05 +01:00
Jaime van Kessel
89c82964c3 Simplify restart check
CURA-8588
2022-01-03 11:14:28 +01:00
Jaime van Kessel
852076460f Remove unused imports
CURA-8588
2022-01-03 11:13:28 +01:00
Jaime van Kessel
6a39862349 Merge RestartManager into marketplace
CURA-8588
2022-01-03 11:12:52 +01:00
Jaime van Kessel
6af2677c52 Remove TabManager
Since marketplace itself already needed to be a qObject, there wasn't
really a need to have a seperate object for it
2022-01-03 11:06:19 +01:00
Jaime van Kessel
3b2be48390 Ensure that check for updates is called on startup of Cura
CURA-8588
2022-01-03 11:01:17 +01:00
Jaime van Kessel
408b649db7 Add typing to tabmanager
CURA-8588
2022-01-03 10:22:36 +01:00
Remco Burema
1cdeaffab7
Make new Marktetplace react to 'get more materials'.
part of CURA-8588
2021-12-30 11:53:42 +01:00
Jaime van Kessel
50f1afa5d9 Make plugin_registry protected
CURA-8587
2021-12-13 11:57:00 +01:00
Jelle Spijker
fd508342fe
Renamed Manager to RestartManager
Contributes to: CURA-8587
2021-12-08 14:33:22 +01:00
Jelle Spijker
6c976bc9b0
Introduced a Manager to centralize plugin/package management
Should have done this from the start.
Will move other relevant scattered functions to this type.
For now it checks if the restart banner needs to show.
Taking into account that a user can toggle between enable
and disable without an actual restart. Even with multiple
plugins.

Contributes to: CURA-8587
2021-12-08 08:06:56 +01:00
Jelle Spijker
dae92c354c
Marketplace doesn't need to inherit from QObject
Review comment

Contributes to: CURA-8587
2021-12-07 15:32:36 +01:00
Jelle Spijker
f6966c25fb
Some final tweaks and added missing documentation
Contributes to: CURA-8587
2021-12-07 09:48:48 +01:00
Jelle Spijker
0fefe85fca
Present restart banner if plugin has been en-/disabled
Contributes to: CURA-8587
2021-12-07 08:57:56 +01:00
Jelle Spijker
743ac67cdb
un-/subscribe the user to installed packages
Contributes to: CURA-8587
2021-12-03 17:08:28 +01:00
Jelle Spijker
6514fdf9f2
Check the server if a package can be updated
The server is queried using the local packages_id and version to
determine if they can be updated. The Manage button state is set
accordingly. This is done in an async way to keep the UI responsive

A.t.m I'm not sure if I might need to move this logic out, since
we also need to make this query when check periodically for updates.
when the list is not shown. But that would also entail creating
the installed packages list before the Manage Packages tab is ever
created in the Marketplace.

Contributes to: CURA-8587
2021-12-03 13:25:43 +01:00
j.spijker@ultimaker.com
edc71f12a3
Updated documentation and typing
Contributes to CURA-8558
2021-11-03 15:15:46 +01:00
Jelle Spijker
86d5d315bc
Differentiate between local and remote packages
There is a distinction between packages which are already
installed on the local machine and packages which are
available on the remote server. Even with this difference
it is important that they are handled the same and can be
reused in the same GUI elements.

In order to reduce code duplication I created a parent object
PackageList which contains the base logic and interface for
the QML and let both RemotePackageList and LocalPackageList
inherit from this.

UX specified that the gear icon (Settings.svg) should be
separate from the tabs of material and plugins. This also
ment that the current tab  item couldn't set the pageTitle
anymore. This is now defined in the Package component and
set when the loader has loaded the external QML file.

Contributes to CURA-8558
2021-11-01 17:12:18 +01:00
Ghostkeeper
476321be5c
Remove log entry for when Marketplace QML fails to load
This is already logged with a warning by the QML engine.

Contributes to issue CURA-8556.
2021-10-25 15:38:54 +02:00
Ghostkeeper
77d1bebbdb
Put PackageList in Marketplace namespace
This way it's not available to the rest of Cura, especially since PackageList is not such an uncommon name. It could give name collisions. Moreover, the rest of Cura doesn't need to have a list of packages from the Marketplace, so it's better separation.

Contributes to issue CURA-8556.
2021-10-25 15:35:28 +02:00
Jaime van Kessel
37ccf5b823 Add missing return types on init
CURA-8556
2021-10-25 10:37:02 +02:00
Ghostkeeper
3138452f94
Allow PackageList to be used as a model from QML
QML is leading here and holding the pointers for creation and destruction.

Contributes to issue CURA-8556.
2021-10-21 15:46:46 +02:00
Ghostkeeper
4337e81b77
Make request to Marketplace API when package list loads
We don't parse the response just yet, but this is part of the work.

Contributes to issue CURA-8556.
2021-10-21 15:33:37 +02:00
Ghostkeeper
ffce865c85
Add constant for API URLs
I figured this out now. Don't want to forget it. We'll need it later anyway.

Contributes to issue CURA-8556.
2021-10-19 17:47:40 +02:00
Ghostkeeper
c35b1f4135
Bring window into focus when it opens
It can be behind the Cura main window now, where the user won't see it if it was already open.

Contributes to issue CURA-8556.
2021-10-19 13:45:25 +02:00
Ghostkeeper
5897b3de38
Add function to open Marketplace window
This will now load in a QML file, cache it, and create an empty window with the title 'Marketplace'.

Contributes to issue CURA-8556.
2021-10-19 13:43:41 +02:00
Ghostkeeper
73ad2a4e08
Add Marketplace plug-in, starting a rewrite from the Toolbox
This plug-in will be a complete re-write of the previous Toolbox plug-in. It's intended to solve some of the inherent architectural problems with the Toolbox.
We're calling it Marketplace now as well.

Contributes to issue CURA-8556.
2021-10-19 13:06:04 +02:00