7559 Commits

Author SHA1 Message Date
Ghostkeeper
4dfc86d5bb
Remove unused import
Contributes to issue CURA-3497.
2017-04-07 14:59:04 +02:00
Ghostkeeper
e71af663c3
Make getEmptyInstanceContainer return a container with ID 'empty'
This is checked in the test. Otherwise it would return magic mocks.

Contributes to issue CURA-3497.
2017-04-07 14:41:29 +02:00
Ghostkeeper
7ce89f5d80
Simplify defaults for container IDs in fixtures
Contributes to issue CURA-3497.
2017-04-07 14:02:39 +02:00
Ghostkeeper
46f3b5bd97
Use yield_fixture for fixtures with teardown
Otherwise it'll complain that it can't use yield.

Contributes to issue CURA-3497.
2017-04-07 13:13:12 +02:00
Ghostkeeper
0fe1b54588
Merge branch 'cura_containerstack' of github.com:Ultimaker/Cura into cura_containerstack 2017-04-07 09:31:17 +02:00
Arjen Hiemstra
e1537d4dea Fix quality selection menu to highlight the active entry
Since we changed the "empty_quality_changes" to a proper empty
container.
2017-04-06 17:51:38 +02:00
Arjen Hiemstra
df25fa9345 Do not try to handle resolve manually in StartSliceJob
Since the container stacks should now take care of it
2017-04-06 17:50:43 +02:00
Arjen Hiemstra
6827849220 Un-deprecate activeMachine{Name,Id}
Since it provides too much noise and I do not want to change the code
that uses it right now.
2017-04-06 17:50:05 +02:00
Arjen Hiemstra
433537a2f0 Add type metadata to Extruder/Global stack
For backward compatibility with old code that still checks for "type".
2017-04-06 17:49:22 +02:00
Ghostkeeper
8506c21099
Replace DefinitionContainer with MagicMock in test_addExtruder
Because the code checks for the type of DefinitionContainer.

Contributes to issue CURA-3497.
2017-04-06 16:30:04 +02:00
Arjen Hiemstra
608e62e081 Do not try to get resolve when extruder count == 1 or for nonexistant properties 2017-04-06 02:22:45 +02:00
Arjen Hiemstra
1c75a82779 Fix the hacked "getResolveOrValue" to return value always instead of resolve 2017-04-06 02:21:39 +02:00
Arjen Hiemstra
4da2de532b Fix saving of Global/Extruder stack
Since we now have proper types for them, we can simplify the save code
2017-04-06 02:21:03 +02:00
Arjen Hiemstra
d3d2bdfaeb getResolveOrValue has become obsolete now that stack.getProperty can return a resolve 2017-04-04 17:41:43 +02:00
Arjen Hiemstra
a16b5d73b6 Partial fix for infinite recursion when trying to call getProperty 2017-04-04 17:41:21 +02:00
Arjen Hiemstra
82333a244b Add some initial code to use the new classes to create new machines 2017-04-04 17:40:58 +02:00
Arjen Hiemstra
cbc19b13eb Deprecate the activeMachineName/Id properties in favour of activeMachine 2017-04-04 17:40:34 +02:00
Arjen Hiemstra
7eb5441ebc Add an "activeMachine" property to MachineManager
Directly exposes the global container stack to QML.
2017-04-04 17:39:57 +02:00
Arjen Hiemstra
47a388fd2c Introduce a CuraStackBuilder class
It contains factory functions for creating new stacks with certain
quality/material/variant combinations.
2017-04-04 17:38:49 +02:00
Arjen Hiemstra
e6adca7dd3 Fix type metadata of some of the test container stacks 2017-03-30 08:58:46 +02:00
Arjen Hiemstra
1f0f8cd6ea Make GlobalStack a subclass of CuraContainerStack 2017-03-30 08:58:21 +02:00
Arjen Hiemstra
202f19a081 Make ExtruderStack a subclass of CuraContainerStack 2017-03-30 08:58:05 +02:00
Arjen Hiemstra
d4400b8674 Introduce a CuraContainerStack that has all the code shared between global and extruder
Since there is actually quite a lot of it
2017-03-30 08:57:37 +02:00
Arjen Hiemstra
d7984c888b Use a proper container mock for test user/quality changes 2017-03-28 18:20:13 +02:00
Arjen Hiemstra
30fd1ded45 Fix setPropertyOtherContainers test
Now uses writable stack and makes sure to compare the right values
2017-03-28 18:19:30 +02:00
Arjen Hiemstra
3c1cbd5aa9 Do not compare string to actual type
As far as we know, Global or Container stack should not take care of
string -> value conversion
2017-03-28 18:18:29 +02:00
Arjen Hiemstra
3620ce4c0a Fix setPropertyUser test with the right container and parameter order of setProperty 2017-03-28 18:17:12 +02:00
Arjen Hiemstra
87ce6246d8 Introduce a "writable global stack" fixture
This one has MockContainers set for all containers that allow calling
setProperty
2017-03-28 18:16:00 +02:00
Arjen Hiemstra
317576e983 Set container entry to empty if it was not found in the original container 2017-03-28 18:14:16 +02:00
Arjen Hiemstra
dc84141714 Implement set/getProperty for MockContainer
Otherwise setProperty/getProperty tests will never work
2017-03-28 17:51:46 +02:00
Arjen Hiemstra
7175ac0d20 Do not try to perform a setProperty on a definition
That is never going to work
2017-03-28 17:50:37 +02:00
Arjen Hiemstra
2a2df31c5b Set the User container to a writable container in testSetProperty
Since empty container (the default) will not allow writes
2017-03-28 17:50:09 +02:00
Arjen Hiemstra
3f1f4a172d Fix constrainContainerTypes test
We do not allow random containers to be assigned to specific properties,
only the containers that specify they are of a certain type.
2017-03-28 17:48:55 +02:00
Arjen Hiemstra
593c6c0c8f Set and clear ContainerStack's _containerRegistry property 2017-03-28 17:47:10 +02:00
Arjen Hiemstra
75931192f6 Allow setting Definition and setting Definition by ID
To match the other properties
2017-03-28 17:46:28 +02:00
Arjen Hiemstra
123c8bae45 Allow setting userChanges container
Since that makes it possible to create an external factory method for
creating stacks and makes the properties more consistent.
2017-03-28 17:46:00 +02:00
Arjen Hiemstra
2f6936c961 Fix type checking in GlobalStack 2017-03-28 17:45:15 +02:00
Arjen Hiemstra
4cea1b6d33 Fix error case in addExtruder
Error out when the new size is going to be more than extruderCount
instead of whether it currently is more than extruderCount.
2017-03-28 17:44:29 +02:00
Arjen Hiemstra
4005f5082b Allow setting of properties on GlobalStack 2017-03-28 17:43:11 +02:00
Arjen Hiemstra
8f36e76588 Make sure to use the right metadata type entry for mock containers 2017-03-27 17:57:07 +02:00
Arjen Hiemstra
60ee1a3f75 We also raise InvalidContainer when setting variant 2017-03-27 17:56:46 +02:00
Arjen Hiemstra
5892f13349 Fix naming of definitionChanges property in test 2017-03-27 17:55:44 +02:00
Arjen Hiemstra
da751fa0ea We raise InvalidContainerError, not KeyError when a container was not found 2017-03-27 17:55:24 +02:00
Arjen Hiemstra
270cdd08cb Don't modify ContainerStack._containerRegistry property
We do not use it in GlobalStack
2017-03-27 17:54:44 +02:00
Arjen Hiemstra
385d8ac5b5 Properly mock Container and ContainerRegistry objects in Global stack test 2017-03-27 17:53:30 +02:00
Arjen Hiemstra
b6fafb06ed Ensure we initialize the list of containers for GlobalStack 2017-03-27 17:52:38 +02:00
Arjen Hiemstra
39803cf7dd Add missing imports to Extruder/GlobalStack 2017-03-27 17:52:16 +02:00
Arjen Hiemstra
5196ea695c Add a notify signal to all container properties in GlobalStack
Contributes to CURA-3497
2017-03-27 01:35:34 +02:00
Arjen Hiemstra
dd8ea6175c Add properties for user changes etc. to ExtruderStack 2017-03-27 01:32:36 +02:00
Ghostkeeper
ccd22ef36d
Add tests for setting property on other parts of extruder stack
It then asks the property back and sees if it was changed.

Contributes to issue CURA-3497.
2017-03-24 17:55:21 +01:00