40 Commits

Author SHA1 Message Date
Konstantinos Karmas
5732fc2b51 Update campaign tags
CURA-8254
2021-10-04 17:05:36 +02:00
Konstantinos Karmas
ce34e16cdd Add documentation
CURA-8254
2021-10-04 16:47:48 +02:00
Konstantinos Karmas
4b7f385077 Add external link to "Learn more" action
CURA-8254
2021-10-04 16:43:17 +02:00
Konstantinos Karmas
1f5672acca Check if new materials were installed on initialization
When the MaterialManagementModel is initialized, it will check whether during this startup new materials were installed. If that's the case, then it will show the prompt message to sync those materials with the printers, which should initiate the sync materials flow.

CURA-8254
2021-10-04 15:55:06 +02:00
Ghostkeeper
43f1df1723
Show error when failing to save archive
It could be that you don't have permission to save the archive. Instead of crashing Cura, show an error to the user.

Fixes Sentry issue CURA-2VS.
2021-09-23 15:44:28 +02:00
Konstantinos Karmas
fe640d42cf Don't crash if a material fails to be written in the zip
This fixes Sentry issue CURA-2WS.
2021-09-21 09:33:30 +02:00
Ghostkeeper
a4f6e94ae0
Update the sync-storage path every time you sync
Instead of updating the storage path every time you add or remove a removable drive, we now update the storage path every time you press the button to sync. That way this detail has no impact on performance of other parts of Cura if they don't use this button. It also makes the code a bit simpler.
The only downside is that this FileDialog then contains state, instead of automatically syncing with the MaterialManagement property for its folder property. I see that as a lesser of two evils.

Contributes to issue CURA-8055.
2021-07-23 15:16:38 +02:00
Ghostkeeper
f82384d93c
Revert "Revert CURA-8055 in the 4.10 branch. This should not have been merged in there."
This reverts commit 4d29de45796dc42f76c774a216a0601bb57cf790.
Effectively this re-applies the changes for CURA-8055 / #9957.
2021-06-24 14:20:38 +02:00
Ghostkeeper
4d29de4579
Revert CURA-8055 in the 4.10 branch. This should not have been merged in there.
Revert "Change file extension to .umm"

This reverts commit 56db7f7144083df4bca77746d7ee30f2a54fda36.

Revert "Re-enable compression"

This reverts commit 62bc9be22bbc5595dbfce69893163c3a0ebc4415.

Revert "Add documentation"

This reverts commit e9031f1aff5d40f3c69ac625edf11963a3253eb8.

Revert "Fix writing bytes to string-stream"

This reverts commit 66b2825a667f9aa9618005d2a5875383a3658f4f.

Revert "Hide button entirely if no export is available"

This reverts commit ec727e1068c3ac2cab7f95fb88c5d4d101e28e17.

Revert "Basic implementation of exporting all materials in a .zip archive"

This reverts commit bdcaef134f556f455f352786123476ec40e3ae4c.

Revert "Implement default path for exporting all materials"

This reverts commit e66783664bf73dd9b1e3c6af6f01321763470d2e.

Revert "Implement a sync button and file dialogue to export all materials"

This reverts commit abba3bdd10a994a1b38bcb426a27ba379febeac7.

Revert "Add notion of whether printers support the material export archive"

This reverts commit f436cb8e7b879a8913b25f2a049413ec0721f1c5.
2021-06-24 14:15:54 +02:00
Ghostkeeper
62bc9be22b
Re-enable compression
I had disabled that in an attempt to fix the bytes-to-str conversion issue, but it turned out to not be the cause. Compression is fine.

Contributes to issue CURA-8055.
2021-06-09 17:14:46 +02:00
Ghostkeeper
e9031f1aff
Add documentation
Contributes to issue CURA-8055.
2021-06-09 17:10:31 +02:00
Ghostkeeper
66b2825a66
Fix writing bytes to string-stream
Don't open the file first. We can let the zipfile module handle that.

Contributes to issue CURA-8055.
2021-06-09 17:08:57 +02:00
Ghostkeeper
bdcaef134f
Basic implementation of exporting all materials in a .zip archive
It seems to complain about the data types though.

Contributes to issue CURA-8055.
2021-06-09 16:35:51 +02:00
Ghostkeeper
e66783664b
Implement default path for exporting all materials
It needs to be a removable drive if one is available, or else just the local file paths.

Contributes to issue CURA-8055.
2021-06-08 17:36:25 +02:00
Ghostkeeper
2f8f98fcca
Add a log entry for importing, duplicating or removing a material
We encountered an issue yesterday that we had to find in a log file when a user was importing a material. Nothing is shown in the log when importing a material, so it was impossible to find.
Now we'll log this action. It is a direct user action, so info is a good log level.
2021-06-04 02:51:13 +02:00
Nino van Hooff
89f0970a88 Remove trailing whitespace from Python files 2020-05-29 14:30:33 +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
0af8bd5e94 Fix merge conflicts 2019-10-15 15:00:03 +02:00
Nino van Hooff
845cab5573 Clarified comment for duplicating materials 2019-10-15 14:37:37 +02:00
Lipu Fei
43fa4337f9 Fix merge conflicts 2019-10-15 13:08:00 +02:00
Lipu Fei
36aab5d56b Fix removeMaterials() and optimization
CURA-6886
2019-10-15 13:04:57 +02:00
Lipu Fei
dd8f6dc10e Fix ContainerTree reacting to duplicating materials
CURA-6863
2019-10-14 12:24:05 +02:00
Lipu Fei
1aa6708677 Fix typing 2019-09-23 10:59:31 +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
0eb3c5c0d6
Refer material manager functions through to material management model
That's where the materials are duplicated now. So we only maintain one implementation of that.

Contributes to issue CURA-6600.
2019-09-17 17:50:38 +02:00
Jaime van Kessel
d548404dfd Fix typing issues 2019-08-29 16:23:10 +02:00
Ghostkeeper
9297890d78
Fix typing of approximate diameter and add typing to function for it
Seems I forgot to add typing and that's biting my bum right now.

Contributes to issue CURA-6600.
2019-08-27 17:21:22 +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
957894b614
Fix duplicating a favourite material
The duplicate must also be favourite.

Contributes to issue CURA-6600.
2019-08-27 17:21:21 +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
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
Ian Paschal
8da7773600 Remove unused code
Contributes to CURA-5162, CURA-5378
2018-08-23 16:04:51 +02:00
Ghostkeeper
bb7fccbd48
Add logging for every setting model update
You can clearly see that some models are updated 4 times or so now.

Contributes to issue CURA-4606.
2018-03-12 14:48:56 +01:00
Ghostkeeper
d8853b8a98
Sort profile models case-insensitively
Cast every sorting key to uppercase before doing this. Don't cast to lowercase or there will be problems with characters that don't have lowercase and with Turkish dotted i vs. undotted i.

Fixes #3460.
2018-03-09 11:40:33 +01:00
Lipu Fei
d6f6dbe45e Rename to available_material_dict 2018-03-01 15:12:34 +01:00
Lipu Fei
b4c3536999 Move getAvailableMaterials() into MaterialManager 2018-03-01 15:02:57 +01:00
Lipu Fei
c21174eea8 Fix the usage of protected variables in material models 2018-03-01 11:55:29 +01:00
Lipu Fei
580244a546 Split material models into separate files 2018-03-01 11:50:55 +01:00