119 Commits

Author SHA1 Message Date
Ghostkeeper
ebe766a7c8
Set definition by their ID
The new function for setting the definition just adds the ID to the metadata.

Contributes to issue CURA-4243.
2017-11-24 16:45:09 +01:00
Ghostkeeper
6c4c7fff4d
Use findContainersMetadata whenever possible
This ensures that we only load those containers that we actually need the data of.

Contributes to issue CURA-4243.
2017-10-20 15:09:45 +02:00
Mark
9a193ad5c5 Changing AGPLv3 to LGPLv3 2017-09-28 13:00:43 +02:00
Ghostkeeper
3316f3aa13
Add warning contexts to not translate XML tags
This went wrong a few times with previous translations. Let's hope that this prevents it from happening again.

Contributes to issue CURA-4113.
2017-08-14 14:06:20 +02:00
Lipu Fei
bb1316fc88 Check if a material is being used based on base_file
CURA-4129
2017-08-14 08:48:07 +02:00
Lipu Fei
6fd3963e8f Fix material searching in isContainerUsed()
CURA-4129

Searching for used materials should also take into account the material
container ID.
2017-08-09 09:47:36 +02:00
Lipu Fei
8c6abc85fc Rename variable in for loop
CURA-4129
2017-08-08 16:32:40 +02:00
Lipu Fei
bb1475d1fd Search for instance containers with type material
CURA-4129
2017-08-08 16:32:02 +02:00
Lipu Fei
4a34f141d1 Check if a material container is used by GUID
CURA-4129

isContainerUsed() is used to enable/disable the "Remove" button on the
Material Manager dialog. When a custom material is created, it creates
multiple containers, one for each extruder variant. In the dialog, it
only checks if the material for the currently active extruder is being
used or not. This causes a problem when 2 extruders are of different
types and one uses a custom material. Then, the "Remove" button will
not be correctly enabled/disable in the Material Manager dialog when
the other extruder is activated.
2017-08-07 13:17:47 +02:00
Ghostkeeper
034686e9fa
Don't modify list you're iterating over
It doesn't give a problem right now since we're only iterating over lists of length 1 here, but in the future this could cause weird bugs.

Contributes to issue CURA-2822.
2017-06-29 15:09:50 +02:00
Ghostkeeper
8ae49c317c
Emit metaDataChanged when changing properties
Properties is a dictionary inside the metadata dictionary. If you change one of the properties, it'll check afterwards if the dictionary is different from what it was before, but since the dictionary is passed by reference all the time, it'll think that the dictionary didn't change: The reference is still the same, so the thing it checks against is updated along.
This solution is a bit ugly but it does notice when the metadata changed inside the properties and then emits a change signal.

Contributes to issue CURA-2822.
2017-06-29 15:03:49 +02:00
Ghostkeeper
7ea1d4cc5a
Add getContainerProperty function
The opposite of setContainerProperty.

Contributes to issue CURA-2822.
2017-06-22 18:17:15 +02:00
Jaime van Kessel
7551c83612 QualityChanges are now also removed if a machine has a parentDefinition
CURA-3929
2017-06-14 11:04:22 +02:00
fieldOfView
49f2fb2cea
Fix filtering maerials after editing materials
NB: previously the "approximate_diameter" metadata was stored as a number. This caused some issues passing arguments from QML to Python. Now "approximate_diameter" is stored as a string.
2017-06-14 10:42:04 +02:00
fieldOfView
8f7471a892
Remove debug statement 2017-06-14 10:41:53 +02:00
fieldOfView
ed6f4d851c
Update documentation 2017-06-14 10:41:39 +02:00
fieldOfView
c9998ca6fe
Set properties for all containers with the same base_file metadata entry 2017-06-14 10:41:23 +02:00
fieldOfView
1f49a87acb
Update material_diameter when editing the material in MaterialView.qml 2017-06-14 10:41:02 +02:00
Jaime van Kessel
a7a2740690 No longer add material to qualityChanges
QualityChanges are never supposed to have Material.

CURA-3929
2017-06-14 09:41:33 +02:00
Lipu Fei
dd65248968 Only set metadata/material for quality_changes if material is not None
CURA-3929
2017-06-13 14:35:27 +02:00
Jaime van Kessel
ec73abecb5 Custom material now defaults to PLA.
This is not an ideal solution, but it bandaids a problem for the moment.

CURA-3911
2017-06-13 13:48:34 +02:00
Lipu Fei
82224c0ed0 Copy material into metadata if machine has specific material profiles when duplicating a quality profile
CURA-3929
2017-06-12 10:56:01 +02:00
Ghostkeeper
f65043ecc8
Add spaces around binary operators and after comma
Just a little code style thing.

Contributes to issue CURA-3828.
2017-05-17 16:17:48 +02:00
fieldOfView
7b393064aa Fix creating materials for 1.75mm machines that have machine/variant materials
Instead of cloning the 2.85 mm generic PLA material and setting its diameter, we now clone the generic PLA with the same diameter as the current machine. This will also clone all the machine-specific settings included in that base file.
2017-05-17 12:20:00 +02:00
fieldOfView
75519d754b Fix creating materials for 1.75mm machines 2017-05-17 11:49:13 +02:00
Lipu Fei
121ebd79cf Fix circular import problem caused by moving SettingVersion into CuraApplication
CURA-3756
2017-05-16 14:55:34 +02:00
Lipu Fei
40d70b5f39 Fix version upgrade for project loading
CURA-3756
2017-05-16 14:38:27 +02:00
jack
85a29e967f Merge pull request #1757 from fieldOfView/fix_material_uniqueness
Fix material uniqueness
2017-05-16 09:44:10 +02:00
Ghostkeeper
ccda155882
Add setting_version every time we create InstanceContainer
Except when we fill the instancecontainer via deserialising. Because then we want to retain the original version number.

Contributes to issue CURA-3427.
2017-05-15 10:39:53 +02:00
fieldOfView
f5347a4593 Add documentation and a spot of logging 2017-05-11 16:37:32 +02:00
fieldOfView
24159aaf66 Fix activating newly created materials 2017-05-11 14:08:15 +02:00
fieldOfView
5339055f9a Fix unlinking materials 2017-05-11 13:10:32 +02:00
fieldOfView
0d67d42300 Fix created materials being a linked to themselves 2017-05-11 12:53:53 +02:00
fieldOfView
e45f04f391 Merge branch 'master' into fix_material_uniqueness 2017-05-11 12:23:01 +02:00
fieldOfView
eba75a726e Set brand and material to "Custom" so it is less like copying Generic PLA 2017-05-09 12:58:50 +02:00
fieldOfView
f3c2df3ab4 Properly return a string when creating/duplicating a material 2017-05-08 10:22:41 +02:00
Arjen Hiemstra
d95488a940 Use the new stack properties so we can properly create quality changes
Contributes to CURA-3497
2017-05-03 13:16:57 +02:00
fieldOfView
67b8302d40 Add a notice to linked materials and allow "unlinking" a material. 2017-04-29 21:08:48 +02:00
fieldOfView
02b978272f Add "Create" button to create a new, unique material.
The new custom material is still based on generic_pla, but it gets a new GUID and uses itself as base_file so it is not conjoined to another material.
2017-04-27 11:19:46 +02:00
Lipu Fei
a3dce9f6d1 CURA-3471 importProfiles() takes QVariantList 2017-03-07 20:17:29 +01:00
Simon Edwards
807542cc1f Fixed a merge problem.
CURA-3431 Not possible to export a profile
2017-02-28 14:38:28 +01:00
Simon Edwards
18368f3ad4 Type hints and fixes for ContainerManager. 2017-02-26 21:07:08 +01:00
Jaime van Kessel
ab28cb4615 Fix import changes
These broke the importing & exporting of profiles
2017-02-22 17:06:28 +01:00
Simon Edwards
4fecf55b3b Use double quotes instead of singles. 2017-01-17 20:56:50 +01:00
Simon Edwards
fb70eb6813 Merge branch 'master' into python_type_hinting 2017-01-17 08:42:55 +01:00
Simon Edwards
a5181f157e Applied the profiler's pyqtSlot decorator to all of the code. 2017-01-10 13:35:39 +01:00
Simon Edwards
74e5798509 Lots of import fixes. Eliminated the import hacks such as those used inside UM/Settings/__init__.py.
CURA-2917
2016-12-12 16:05:35 +01:00
Simon Edwards
5884509af1 More type checking fixes after the merge.
CURA-2917
2016-11-22 11:51:18 +01:00
Simon Edwards
98a6568313 Merge branch 'master' into python_type_hinting 2016-11-22 11:15:04 +01:00
Simon Edwards
14afd9eab7 Heaps to changes to get the Cura code through the type checker (with minimal checking).
CURA-2917
2016-11-21 21:36:08 +01:00