62 Commits

Author SHA1 Message Date
Remco Burema
32b52c6166
Qt5->Qt6: Rectify constant locations: UserRole, CppOwnership
part of CURA-8591
2021-12-28 14:54:56 +01:00
Remco Burema
abe7c1bf7f
Search/replace Qt5->Qt6.
part of upgrading Qt to v6.2: CURA-8591
2021-12-28 14:46:02 +01:00
Kostas Karmas
5c898b8c57 Allow the machine manager to set an empty active machine
Gracefully handle the case where the machine manager is requested to
delete the last machine in Cura. In this case, instead of deleting
everything of this machine and still keep it as an active machine,
the machine manager will set the active machine to None.

The QML files which depend on the active machine were changed to
properly handle themselves when there is no active machine.

CURA-7454
2020-06-09 15:33:22 +02:00
Ghostkeeper
b68c3b7301
Remove usage of deprecated extruders property
Initially PyCharm didn't find this because it's not typed.

Done during Turbo Testing and Tooling.
2020-05-29 18:06:02 +02:00
Nino van Hooff
89f0970a88 Remove trailing whitespace from Python files 2020-05-29 14:30:33 +02:00
Nino van Hooff
58ffc9dcae Merge remote-tracking branch 'origin/master' into doxygen_to_restructuredtext_comments
# Conflicts:
#	cura/API/__init__.py
#	cura/Settings/CuraContainerRegistry.py
#	cura/Settings/ExtruderManager.py
#	plugins/PostProcessingPlugin/scripts/PauseAtHeight.py
#	plugins/UM3NetworkPrinting/src/Cloud/CloudApiClient.py
#	plugins/UM3NetworkPrinting/src/Cloud/ToolPathUploader.py
#	plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py
2020-05-28 17:31:24 +02:00
Ghostkeeper
833a7a3804
Don't use deprecated extruders()
It has been replaced by extruderList.

Done during Turbo Testing and Tooling to reduce the number of warnings in our log.
2020-05-15 15:04:47 +02:00
Jelle Spijker
120541a8db
Updated comments in Models
Converted doxygen style comments to reStructuredText style in the files
 found in Cura/cura/Model directory recursively  using the script
dox_2_rst.py (provided in the Uranium repo). Comments were manually
 checked and changed if needed.

 Note: dox_2rst.py struggles with decorated functions.
2020-05-08 18:59:38 +02:00
Lipu Fei
045f4c51fa Fix BaseMaterialsModel's QTimer lifecycle 2020-01-07 11:37:37 +01:00
Jaime van Kessel
17b8e9930c
Add handling for case where variant could not be found
CURA-6975
2019-11-12 13:28:12 +01:00
Ghostkeeper
94eb76a844
Merge branch 'master' into CURA-6793_performance
Conflicts:
	cura/Machines/MaterialManager.py -> File was deleted in Master but I changed things for the lazy loading.
	cura/Machines/Models/BaseMaterialsModel.py -> I clarified documentation on a line above a place where a timer was added in between.

Contributes to issue CURA-6793.
2019-10-23 09:58:08 +02:00
Lipu Fei
5602c71ec7 Fix material model update and signal recursion
CURA-6904
2019-10-21 09:53:14 +02:00
Ghostkeeper
7348c70af6
Don't get whole container to just get metadata
A performance improvement, especially in the material models.

Contributes to issue CURA-6793.
2019-10-16 13:56:23 +02:00
Ghostkeeper
401390209f
Robustness against missing approximate diameter
Pretend like that material doesn't exist then.

Contributes to issue CURA-6793.
2019-10-16 10:59:58 +02:00
Ghostkeeper
ce4c5a1c93
Remove unnecessary listening to switching extruder tabs
Also fix unnecessary emitting of switching extruder tabs.

This should improve performance a lot. I tested a lot of things and am convinced that it didn't break anything. But the automated GUI tests and QA team should be the final arbiters of that...

Contributes to issue CURA-6793.
2019-10-15 15:01:45 +02:00
Lipu Fei
94e89ad4ac Fix merge conflicts with master 2019-09-24 14:26:43 +02:00
Ghostkeeper
4a68e7ec95
Fix favorite materials without material manager
We just track it via the preference value itself rather than duplicating that in any other data structure. It's simple enough.

Contributes to issue CURA-6776.
2019-09-20 09:57:36 +02:00
Jaime van Kessel
830b22e381
Fix crash when adding a machine without materials
CURA-6775
2019-09-19 15:12:29 +02:00
Ghostkeeper
5f4051ab5c
Use getApproximateMaterialDiameter instead of rounded getCompatibleMaterialDiameter
There was a function to round it for us already.

Contributes to issue CURA-6600.
2019-09-17 16:41:32 +02:00
Jaime van Kessel
0ff9d72c4c
Remove use of deprecated extruders property 2019-09-13 17:27:16 +02:00
Jaime van Kessel
b00b8c8c58 Merge branch 'feature_intent_container_tree' of github.com:Ultimaker/Cura into feature_intent_interface 2019-08-29 16:28:26 +02:00
Jaime van Kessel
f4dc93fc39 Prevent crash in model if no extruder is set
CURA-6598
2019-08-29 11:57:03 +02:00
Ghostkeeper
f5ca29c7aa
Emit materialsChanged from the variant when a material gets added
This allows the material models to update themselves.

Contributes to issue CURA-6600.
2019-08-27 18:01:35 +02:00
Remco Burema
745390e51f Fix typing.
part CURA-6600
2019-08-27 17:57:11 +02:00
Ghostkeeper
63ae6ee9ec
Fix updating materials models when materials change before first printer switch
Otherwise the _extruder_stack field would not yet be set.

Contributes to issue CURA-6600.
2019-08-27 15:47:41 +02:00
Jaime van Kessel
72ea1257d7 Prevent crash when machine isn't configured correctly yet
CURA-6600
2019-08-27 13:50:12 +02:00
Ghostkeeper
1febfde3cc
Fix switching to printers without variant
Since the 'empty_variant' nozzle is now just in the tree, this check is no longer even necessary.

Contributes to issue CURA-6600.
2019-08-23 15:38:58 +02:00
Ghostkeeper
4fb656ea7b
Don't use deprecated Preferences.getInstance()
Contributes to issue CURA-6600.
2019-08-23 14:46:42 +02:00
Ghostkeeper
8ef410e826
Update the _available_materials in the actual _update function
It's confusing that this would be updated in the _canUpdate function. Just cleanliness.

Contributes to issue CURA-6600.
2019-08-22 09:25:26 +02:00
Ghostkeeper
ea1c99b708
Update _favorite_ids in BaseMaterialsModel._update
And make all subclasses run its super _update as well to make sure that this gets updated for them. It's necessary for the _createMaterialItem functionality because it needs to add an is_favorite role.

Contributes to issue CURA-6600.
2019-08-22 09:25:26 +02:00
Ghostkeeper
5d76f96354
Fix getting available materials without material manager
It's a bit weird still that this is executed in the _canUpdate... Oh well.

Contributes to issue CURA-6600.
2019-08-22 09:25:26 +02:00
Ghostkeeper
4ad6f4f635
Update materials models when container tree updates
Instead of relying on MaterialManager to do this.

Contributes to issue CURA-6600.
2019-08-22 09:25:25 +02:00
Ghostkeeper
b7213ad020
Don't require material manager any more to find available materials
We have our container tree for that.

Contributes to issue CURA-6600.
2019-08-22 09:25:17 +02:00
Jaime van Kessel
47d082b5dc Fix updating of material models
CURA-6600
2019-08-21 09:42:49 +02:00
Ghostkeeper
46b489c3f9
getAvailableMaterialsForMachineExtruder can never return None
So no need to check for it.

Contributes to issue CURA-6600.
2019-08-19 17:32:39 +02:00
Ghostkeeper
5abb03e269
No longer update all material models when favourites change
The MaterialManager.materialsUpdated signal was only called once upon init and for the rest when a favourite was added or removed. So only the FavoriteMaterialsModel would need to listen to it.
Because the MaterialManager is being deprecated, the favourite materials model now just listens to the preferences changing instead, as it was supposed to be doing anyway.

Contributes to issue CURA-6600.
2019-08-19 17:09:16 +02:00
Jaime van Kessel
646222f2ac Fix removing of material
CURA-6600
2019-08-19 13:01:05 +02:00
Ghostkeeper
7d1f8e981b
Fix models using new MaterialNode class
The new one doesn't have getMetadata. Maybe we should allow it to have that actually.

Contributes to issue CURA-6600.
2019-08-13 17:20:58 +02:00
Jaime van Kessel
41f2a0e222 Add a property to temporarily disable the material models from updating.
This allows the QMl to stop the updating when it's not even visible
2019-02-21 20:47:38 +01:00
Jaime van Kessel
7754b8a447 Only instantiate setting menus when it's visible
This saves a bit of time on booting and prevents unneeded updates (
because it doesn't matter if a setting changes if no-one is watching!)
2019-02-21 20:20:01 +01:00
Ghostkeeper
66ed9ed201
Remove optimisation that broke updates of models upon metadata change
If the metadata changed, such as whether a material was favourite or not, then the materials models were not updating any more because the actual list of available materials was still the same.
I've removed this optimisation and tested performance locally. It seems to be slightly slower (though that might be placebo or measurement error). However most of the performance boost of cura-6016 was resulting from different changes there so the interface still seems to be quite a lot faster than what it used to be.

Contributes to issue CURA-6032.
2018-12-18 16:52:04 +01:00
Remco Burema
b413b4cdb6 Correct a typo in typing. [CURA-6016] 2018-12-11 17:21:14 +01:00
Jaime van Kessel
f67ac8d7c4 Update far less agressively for the material models
CURA-6016
2018-12-11 10:59:17 +01:00
Lipu Fei
97e6354c13 Fix material update upon extruder-compatible diameter change
CURA-5834

Material models and the material container on an extruder need to be
updated when the extruder's compatible diameter gets changes.
2018-10-19 13:48:52 +02:00
Ghostkeeper
c6fa9474d6
Merge branch '3.5' 2018-09-17 14:41:45 +02:00
Diego Prado Gesto
6d2492e5cb Remove spurious signal, it does the same as materialsUpdated.
Contributes to CURA-5682.
2018-09-12 12:59:13 +02:00
Jaime van Kessel
e7d9f0ce45 Added typing for various setting classes 2018-09-10 15:24:11 +02:00
Lipu Fei
40c4e9c5df Fix KeyError color_code in BaseMaterialsModel 2018-08-28 09:56:00 +02:00
Lipu Fei
33f495442a Remove unneeded code
CURA-5162
2018-08-27 10:44:41 +02:00
Ian Paschal
2304aeaceb Expanded states preserved when updating models
Did this so that models can be updated more often fixing bugs where when a material is set as "not favorite" in the favorites section, its updated accordingly in its "normal" section.

It's also the ground work for saving material section expansion to preferences.

Contributes to CURA-5378
2018-08-24 12:10:32 +02:00