82 Commits

Author SHA1 Message Date
Remco Burema
3636eed964
Instead of selecting first, return only uniques.
part of CURA-6917
2019-11-07 17:19:18 +01:00
Nino van Hooff
6e79f489e2 When multiple linked materials are found, only display the first
CURA-6917
2019-11-07 15:51:22 +01:00
Jaime van Kessel
e805c3db05
Ensure material is selected on first opening of material manager 2019-10-25 11:05:38 +02:00
Lipu Fei
38ee4bf208 Remove deprecated functions in MachineManager
CURA-6858
2019-10-22 14:11:40 +02:00
Nino van Hooff
8322a36548 Fix some QML warnings in the MaterialsPage 2019-10-16 16:59:52 +02:00
Lipu Fei
59fa73448a Fix material diameter change
CURA-6868
2019-10-15 15:03:35 +02:00
Lipu Fei
43fa4337f9 Fix merge conflicts 2019-10-15 13:08:00 +02:00
Lipu Fei
8b913f4009 Merge remote-tracking branch 'origin/master' into CURA-6863_duplicated_material_oddness 2019-10-14 12:23:49 +02:00
Remco Burema
09dc6ae44a Scouting: Try not to spam signals or errors as much.
nominally part of CURA-6863
2019-10-14 01:03:41 +02:00
Remco Burema
4277ede64f Fix 1/2 of the duplication material bug.
The material is added multiple times to the variant nodes, and overwriting it with the eventual right one was going wrong.
This does not solve it entirely (because the less specific one still ends up selected _initially_ because it gets added first, and the order can't be guaranteed.
part of CURA-6863
2019-10-14 01:01:19 +02:00
Nino van Hooff
c8d65e86f1 Truncate/elide/ellipsize the material name in Preferences
if it doesn't fit it's parent

CURA-6862
2019-10-10 15:36:14 +02:00
Jaime van Kessel
cadc145008
Prevent infinite recursion in material page if it could not be found 2019-10-08 16:49:54 +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
Ghostkeeper
21412986d3
Remove material manager from MaterialsPage
It is no longer used now that everything relevant has been moved to a separate class for this page specifically.

Contributes to issue CURA-6600.
2019-08-27 18:01:35 +02:00
Ghostkeeper
3952366798
Move createMaterial to MaterialManagementModel and simplify it a bit
We can reuse our duplicateMaterial function again but in a simpler way. Also finding the preferred material is simpler with our container tree.
However there seems to be a problem with finding the preferred material; it's not finding generic_pla for UM3 and AA0.4 anyway, and then falls back on a random material. This needs to be fixed in the variant node class.

Contributes to issue CURA-6600.
2019-08-27 17:21:22 +02:00
Ghostkeeper
1874a6453d
Move duplicateMaterial into MaterialManagementModel
To move away from the deprecated MaterialManager class.

Contributes to issue CURA-6600.
2019-08-27 17:21:21 +02:00
Ghostkeeper
8346e465f6
Turn MaterialManagementModel into a singleton
Just like MaterialManager used to be. There can be only one instance of the page then.
This prevents a crash when Qt deletes the QObject because it's no longer used in the page when you close the preferences screen. But when you open it again it doesn't construct a new one. Now there is always one instance so that's not a problem any more. Also it allows other pages to access this item.

Contributes to issue CURA-6600.
2019-08-27 15:47:41 +02:00
Ghostkeeper
3dc7c7b61c
Move removeMaterial to MaterialManagementModel
Moving away from the MaterialManager.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Ghostkeeper
99ccddefa4
Move setMaterialName to MaterialManagementModel
No longer use the material manager which is deprecated.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Ghostkeeper
5b8ed91b04
Create new MaterialManagementModel and move canMaterialBeRemoved
Just like the QualityManagementModel, this class is intended to be used as proxy for the material management page in the preferences. I'm intending to move all relevant pyqtSlots from the material manager into this one. The advantage of this switch is that the material manager had no well-bounded scope and so tended to become a big mess of all sorts of functions. This one has a clear scope: serve as a proxy for the buttons you can press in the preferences screen for materials.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Jaime van Kessel
8759aae73e Fix crash when materialManager could not be converted to QObject
No idea why this was causing issues, but this should also be a bit faster.

CURA-6600
2019-08-19 12:47:07 +02:00
Lipu Fei
2ce567ccfe Fix material current item reset
CURA-6679
2019-07-30 15:16:50 +02:00
Jaime van Kessel
914d2e98e9 Fix the disabling of the material setting fields.
This was caused by using 2 different modelsItems.
2019-07-30 11:29:49 +02:00
Ghostkeeper
18d1148c78
Don't reset selected material upon container changed
The onActiveMaterialChanged signal is triggered upon loading a material for the first time. This is hard to fix without breaking stuff, so we will revert this part.

This re-introduces a bug where if you change a material diameter such that the material disappears from the list, it is still selected and you can change its properties in the details panel.

Contributes to issue CURA-6679.
2019-07-24 17:01:37 +02:00
Ghostkeeper
be4e754984
Remove cache of material manager
It doesn't make the code much simpler because the cache is also not a local variable.

Contributes to issue CURA-6679.
2019-07-24 16:04:40 +02:00
Lipu Fei
3d410cceb9 Fix change material diameter binding
CURA-6590
2019-07-08 13:40:08 +02:00
Lipu Fei
b36d040ba9 Use rejected instead of visibility hack
CURA-6590
2019-07-08 13:01:42 +02:00
Remco Burema
fea8262656 Listen to 'material-changed' since it doesn't update immediately.
part of CURA-6590
2019-07-03 16:14:08 +02:00
Jaime van Kessel
2cd6b73d12 Ensure that the material selection gets reset when diameter is changed
CURA-6590
2019-07-02 17:59:27 +02:00
Jaime van Kessel
ff0a18603b Remove a few more usages of deprecated functions 2019-05-16 15:20:38 +02:00
Jaime van Kessel
99e6ec9509 Fix the last material qml warnings 2019-05-16 14:29:05 +02:00
Jaime van Kessel
bfe1275d46 Fix a number of QML warnings 2019-05-16 14:23:09 +02:00
Ghostkeeper
dfeb71992a
Remove custom text property in materials brand section
It was duplicating the sectionName property.

Contributes to issue CURA-6302.
2019-05-07 14:27:39 +02:00
Satish
3b4e253e98 Added ids to materials for squish tests
-Added a text property to MaterialsBrandSection
-Added ids to materials menu buttons
2019-05-07 12:37:42 +02:00
Jaime van Kessel
c3a373e2a2 Remove usages of deprecated activeMachineName 2019-05-03 13:38:06 +02:00
Jaime van Kessel
d42f446d70 Remove usages of deprecated function 2019-05-03 13:17:10 +02:00
Ghostkeeper
c79ffab9fb
Merge branch '4.0' 2019-03-18 11:24:23 +01:00
Jaime van Kessel
8b3290fb1e Prevent the deletion of materials that are still active 2019-03-14 10:50:53 +01:00
Satish
c98a73f8fd Added id's to printer button, installed plugins, material fields and profile tab for integration tests 2019-03-01 12:47:29 +01:00
Jaime van Kessel
a51289d7ce Merge branch 'not_activate_when_no_materials' of github.com:Ultimaker/Cura 2019-01-18 11:19:28 +01:00
Remco Burema
f057c9a7df Prevent spurious updates to 'onPreferenceChanged's if the preference doesn't match. 2019-01-15 17:15:12 +01:00
Ghostkeeper
b54312fb9b
Merge branch '4.0' into unify_font_types 2018-12-28 15:51:54 +01:00
Ghostkeeper
abe684c1bd
Use Item instead of rectangle without defined colour
Item should be faster to render.

Contributes to issue CURA-6056.
2018-12-27 13:36:17 +01:00
Ghostkeeper
5bf260f524
Don't break binding of is_favorite upon clicking star
We shouldn't override it here because doing that causes the binding to break. Just remove the favourite and let the model update itself, thus removing the star.

Contributes to issue CURA-6032.
2018-12-20 14:40:37 +01:00
Ghostkeeper
f3a0b44d5e
Simplify is_favorite condition
No stupid ternary operators necessary.

Contributes to issue CURA-6032.
2018-12-20 14:40:29 +01:00
Diego Prado Gesto
ef2fb53790 Merge branch '4.0' into unify_font_types 2018-12-19 11:56:22 +01:00
Ghostkeeper
c0c45519a0
Change another useless rectangle into an item
It's more efficient to render. Also changed some code style.

Contributes to issue CURA-6032.
2018-12-18 16:49:41 +01:00
Ghostkeeper
c66257bf4d
Use item instead of transparent rectangle
This is faster to render.

Contributes to issue CURA-6032.
2018-12-18 16:18:01 +01:00
Diego Prado Gesto
77ede1ae6b Unify the fonts to only have 8 instead of 13.
Contributes to CURA-6025.
2018-12-12 17:50:21 +01:00
Ghostkeeper
4d87c46423
Remove sourceSize.width: width from all RecolorImages
It is now the default in Uranium.

Contributes to issue CURA-5876.
2018-12-04 15:04:51 +01:00