587 Commits

Author SHA1 Message Date
Jaime van Kessel
90726ecbff Fix situation where the setting visibility model could cause a crash.
Yay for crash logging
2018-11-01 15:28:08 +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
Jaime van Kessel
d086e6fa86 Fix review comments
CURA-5734
2018-10-17 10:47:34 +02:00
Ghostkeeper
b37252f124
Minor code style fixes
Contributes to issue CURA-5734.
2018-10-10 14:18:37 +02:00
Jaime van Kessel
4def636fc9 Minor codecleanup (Typing & removing unused imports)
CURA-5734
2018-10-01 14:54:08 +02:00
Jaime van Kessel
edb5de9954 Added unit test for settingvisibility presets
CURA-5734
2018-10-01 14:50:53 +02:00
Jaime van Kessel
7e7afa7c06 Ensure that the SettingVisibilityPresetsModel doesn't have duplicated settings
CURA-5734
2018-10-01 11:51:07 +02:00
Jaime van Kessel
fc9f05fc8b Moved SettingVisibilityPreset loading to it's own class
Since there was so much debate regarding the unit testing of the visiblity presets, i had another look at it.
The old version was almost untestable because all functionalities were mushed together into a single class.

CURA-5734
2018-10-01 11:32:55 +02:00
Jaime van Kessel
7310a677ce Clean up more code
This fixes some typing and moves a property to protected, as it should be
2018-09-27 16:07:18 +02:00
Ghostkeeper
c6fa9474d6
Merge branch '3.5' 2018-09-17 14:41:45 +02:00
Diego Prado Gesto
7e1a833e9c Merge branch '3.5' into CURA-5682_material_manager_leftovers 2018-09-12 17:12:40 +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
Ian Paschal
9e56d6d29f Improved expansion behavior
Contributes to CURA-5682

- Active material is now expanded by default when opening the manager

- Expanded and collapsed sections are saved to preferences

- Sections are now highlighted when collapsed and having a selected material inside

- Bug with losing focus between fields is not yet fixed
2018-09-05 17:16:06 +02:00
Lipu Fei
ab572e9de2 SettingFunction evaluation needs a stack to provide values
Note that this is still not correct. When the value gets evaluated, we
need to evaluate it with that container in the stack(s), but this case,
the stack may have other containers, so the evaluation can give
incorrect values because its context is simply not correct. This change
only prevents it from breaking because it's missing a provider.
2018-09-03 14:03:46 +02:00
Ghostkeeper
6df029971d
Don't crash if layer height is a formula
We obtain the layer height here but that might be a formula so we should evaluate that formula here.

Fixes #4005.
2018-09-03 11:02:24 +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
Ian Paschal
6be9b5e27f Consolidate models some more
Contributes to CURA-5162, CURA-5378
2018-08-23 16:58:23 +02:00
Ian Paschal
56a5f59964 Cleaner code
I was hoping to completely nix the generic materials model (since it's basically just a brand "Generic", but then in the QML it has to be have the same in terms of sub-menus or fold-outs and that looked stupid (Generic -> ABS -> ABS)). So we keep that one for now. It is cleaner though.

Contributes to CURA-5162, CURA-5378
2018-08-23 16:39:40 +02:00
Ian Paschal
8da7773600 Remove unused code
Contributes to CURA-5162, CURA-5378
2018-08-23 16:04:51 +02:00
Ian Paschal
6225fff1f8 Re-added material detail view
Contributes to CURA-5378
2018-08-22 15:58:58 +02:00
Ian Paschal
cb713eea6a Improve models
Contributes to CURA-5162, CURA-5378
2018-08-22 12:33:29 +02:00
Ian Paschal
68bccd8bf7 Improve the Favorites, Base, and Brand materials models (WIP)
Contribuetes to CURA-5378
2018-08-20 17:16:54 +02:00
Ian Paschal
e8cda90021 Add favorites to materials menu
Contributes to CURA-5162
2018-08-16 13:04:58 +02:00
Ian Paschal
8493948ba1 Add a favorite materials model
Contributes to CURA-5162
2018-08-15 14:06:07 +02:00
Lipu Fei
a303f394c8 Move VariantType to VariantType.py
Less circular dependencies for imports.
2018-08-02 16:11:55 +02:00
Lipu Fei
76417b7fb2 Hide materials belong to a to-be-removed package 2018-07-11 10:57:57 +02:00
Diego Prado Gesto
762a1b1bfd Fix code-style 2018-07-03 12:06:06 +02:00
Diego Prado Gesto
6e364f0895 CURA-5330 Fix typing and code-style in the ContainerNode and all the
related children, and QualityGroup and its children.
Also fix the related calls in the managers.
2018-06-13 10:55:57 +02:00
Diego Prado Gesto
5cd464c5de CURA-5330 Fix some typing issues in QualityProfilesDropDownMenuModel and
SettingInheritanceManager.
2018-06-12 16:35:46 +02:00
Diego Prado Gesto
2dfedf3ae4 CURA-5330 Add typing in CuraContainerRegistry and
QualityProfilesDropDownMenuModel
2018-06-08 17:02:59 +02:00
Lipu Fei
bddd32a5b6 Fix branded materials model binding
CURA-5336

When the global stack gets changed, the model should update itself
so it refers to the correct extruder stack.
2018-06-07 15:50:08 +02:00
Lipu Fei
61a3668a4f Merge remote-tracking branch 'origin/3.4' 2018-06-01 13:51:00 +02:00
Diego Prado Gesto
a4b46be2c5 CURA-5427 Force the material models to update when the machine changes and so
when the extruder stack changes.
- What happen was that when the extruder model needed to update, the
material model was not updated correctly and so when changing a material, the
node was incorrect.
2018-06-01 12:58:08 +02:00
Diego Prado Gesto
43657010ba CURA-5164 The Preferences is not a singleton class anymore since in some point
several instances need to be created.

- In the ThreeMFWorkspaceReader we need to create some temporal
instances of Preferences that makes it not singleton anymore.

- The current preferences are kept in the Application class and so all
the calls to the preferences are changed to get the preferences from
Application.

- The method getInstance in Preferences is kept as deprecated since some
external plugins.
2018-05-11 08:50:42 +02:00
Ghostkeeper
c49f912276
Merge branch '3.3' 2018-04-18 10:43:31 +02:00
Lipu Fei
1d4a70e839 Show all quality_changes on the quality management page
CURA-5218
2018-04-18 10:35:53 +02:00
Ghostkeeper
133f6f43fe
Merge branch '3.3' 2018-04-13 16:14:23 +02:00
Lipu Fei
7eba73adc5 Handle excluded_materials in getAvailableMaterials()
CURA-5223

Move the handling of excluded_materials into MaterialManager
getAvailableMaterials().
2018-04-12 16:12:07 +02:00
Jack Ha
c9dc429b2b CURA-5045 solve merge conflicts 2018-03-29 09:22:19 +02:00
Ghostkeeper
4f56221126
Remove catch of RuntimeError
The error is no longer thrown and the function has its own error message.

Contributes to issue CURA-5045.
2018-03-27 14:28:17 +02:00
Ghostkeeper
74a0da14bf
Don't crash if showing this before any machine is added
There must be no quality profiles then.

Contributes to issue CURA-5045.
2018-03-27 09:37:04 +02:00
Aleksei S
2240c38fd7 Exclude HIPS and PETG material for UM
CURA-5149
2018-03-26 17:11:38 +02:00
Ghostkeeper
6d3fed8f52
Allow getContainer() to return None
And in the rest of the locations we must then check if it's None and handle that gracefully.
Here we assume that the getContainer message shows a message to the user if necessary. For now we'll just log it.

Contributes to issue CURA-5045.
2018-03-26 15:48:03 +02:00
Jack Ha
38e15f009f CURA-5149 add possibility to exclude specific items from materials list 2018-03-26 15:20:31 +02:00
Jack Ha
2a39d81a3c Revert "Filter generic list for Ultimaker printers."
This reverts commit 767789d394c4ebd15607f01c9fad2a0e3aa81d2b.
2018-03-26 15:07:37 +02:00
Jack Ha
18e3e084a5 Revert "Check for Ultimaker printers based on manufacturer"
This reverts commit 5b36b4fb845cd1468f6539fb401b8d9782472322.
2018-03-26 15:07:35 +02:00
Jack Ha
07ac09e878 Revert "Use set for searching"
This reverts commit 80c2b3b7e8f21aac026fb01b80cc5ca23a5be462.
2018-03-26 15:07:27 +02:00