From 8d49d5a1b10fe1f6e6f1459fb0e602df1ab66bec Mon Sep 17 00:00:00 2001 From: THeijmans Date: Mon, 12 Nov 2018 13:29:51 +0100 Subject: [PATCH 001/199] CPE and CPE+ Comb retractions In this commit I changed all CPE and CPE+ profiles to have a 50mm combing max distance without retraction. This should decrease blobs caused by combing long distances. I also reverted the CPE infill back to triangles, as we now connect this infill type as well. --- .../ultimaker_s5/um_s5_aa0.25_CPE_Normal_Quality.inst.cfg | 1 + .../quality/ultimaker_s5/um_s5_aa0.4_CPEP_Draft_Print.inst.cfg | 2 +- .../quality/ultimaker_s5/um_s5_aa0.4_CPEP_Fast_Print.inst.cfg | 2 +- .../ultimaker_s5/um_s5_aa0.4_CPEP_High_Quality.inst.cfg | 2 +- .../ultimaker_s5/um_s5_aa0.4_CPEP_Normal_Quality.inst.cfg | 2 +- .../quality/ultimaker_s5/um_s5_aa0.4_CPE_Draft_Print.inst.cfg | 3 ++- .../quality/ultimaker_s5/um_s5_aa0.4_CPE_Fast_Print.inst.cfg | 3 ++- .../quality/ultimaker_s5/um_s5_aa0.4_CPE_High_Quality.inst.cfg | 3 ++- .../ultimaker_s5/um_s5_aa0.4_CPE_Normal_Quality.inst.cfg | 3 ++- .../um_s5_aa0.4_aluminum_CPEP_Draft_Print.inst.cfg | 2 +- .../ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Fast_Print.inst.cfg | 2 +- .../um_s5_aa0.4_aluminum_CPEP_High_Quality.inst.cfg | 2 +- .../um_s5_aa0.4_aluminum_CPEP_Normal_Quality.inst.cfg | 2 +- .../ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Draft_Print.inst.cfg | 3 ++- .../ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Fast_Print.inst.cfg | 3 ++- .../um_s5_aa0.4_aluminum_CPE_High_Quality.inst.cfg | 3 ++- .../um_s5_aa0.4_aluminum_CPE_Normal_Quality.inst.cfg | 3 ++- .../quality/ultimaker_s5/um_s5_aa0.8_CPEP_Fast_Print.inst.cfg | 2 +- .../ultimaker_s5/um_s5_aa0.8_CPEP_Superdraft_Print.inst.cfg | 2 +- .../ultimaker_s5/um_s5_aa0.8_CPEP_Verydraft_Print.inst.cfg | 2 +- .../quality/ultimaker_s5/um_s5_aa0.8_CPE_Draft_Print.inst.cfg | 1 + .../ultimaker_s5/um_s5_aa0.8_CPE_Superdraft_Print.inst.cfg | 1 + .../ultimaker_s5/um_s5_aa0.8_CPE_Verydraft_Print.inst.cfg | 1 + .../ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Fast_Print.inst.cfg | 2 +- .../um_s5_aa0.8_aluminum_CPEP_Superdraft_Print.inst.cfg | 2 +- .../um_s5_aa0.8_aluminum_CPEP_Verydraft_Print.inst.cfg | 2 +- .../ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Draft_Print.inst.cfg | 1 + .../um_s5_aa0.8_aluminum_CPE_Superdraft_Print.inst.cfg | 1 + .../um_s5_aa0.8_aluminum_CPE_Verydraft_Print.inst.cfg | 1 + 29 files changed, 37 insertions(+), 22 deletions(-) diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.25_CPE_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.25_CPE_Normal_Quality.inst.cfg index 2068ed51c0..c15311d104 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.25_CPE_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.25_CPE_Normal_Quality.inst.cfg @@ -12,6 +12,7 @@ material = generic_cpe variant = AA 0.25 [values] +retraction_combing_max_distance = 50 retraction_extrusion_window = 0.5 speed_infill = =math.ceil(speed_print * 40 / 55) speed_topbottom = =math.ceil(speed_print * 30 / 55) diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Draft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Draft_Print.inst.cfg index 421fcdf095..627302e0ab 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Draft_Print.inst.cfg @@ -29,7 +29,7 @@ material_print_temperature_layer_0 = =material_print_temperature multiple_mesh_overlap = 0 prime_tower_enable = True prime_tower_wipe_enabled = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_extrusion_window = 1 retraction_hop = 0.2 retraction_hop_enabled = False diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Fast_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Fast_Print.inst.cfg index 536c6c97b8..cda8d85211 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Fast_Print.inst.cfg @@ -29,7 +29,7 @@ material_print_temperature_layer_0 = =material_print_temperature multiple_mesh_overlap = 0 prime_tower_enable = True prime_tower_wipe_enabled = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_extrusion_window = 1 retraction_hop = 0.2 retraction_hop_enabled = False diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_High_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_High_Quality.inst.cfg index 77182c21e1..3ce76bf6be 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_High_Quality.inst.cfg @@ -31,7 +31,7 @@ material_print_temperature_layer_0 = =material_print_temperature multiple_mesh_overlap = 0 prime_tower_enable = True prime_tower_wipe_enabled = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_extrusion_window = 1 retraction_hop = 0.2 retraction_hop_enabled = False diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Normal_Quality.inst.cfg index d779baf315..d402b663c6 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPEP_Normal_Quality.inst.cfg @@ -31,7 +31,7 @@ material_print_temperature_layer_0 = =material_print_temperature multiple_mesh_overlap = 0 prime_tower_enable = True prime_tower_wipe_enabled = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_extrusion_window = 1 retraction_hop = 0.2 retraction_hop_enabled = False diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Draft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Draft_Print.inst.cfg index c51e5652e1..505cd952d2 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Draft_Print.inst.cfg @@ -15,6 +15,7 @@ variant = AA 0.4 material_print_temperature = =default_material_print_temperature + 10 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 +retraction_combing_max_distance = 50 skin_overlap = 20 speed_print = 60 speed_layer_0 = =math.ceil(speed_print * 20 / 60) @@ -24,5 +25,5 @@ speed_wall_0 = =math.ceil(speed_wall * 35 / 45) wall_thickness = 1 -infill_pattern = zigzag +infill_pattern = triangles speed_infill = =math.ceil(speed_print * 50 / 60) diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Fast_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Fast_Print.inst.cfg index b80d3ccf22..cc5df0abb9 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Fast_Print.inst.cfg @@ -16,11 +16,12 @@ cool_min_speed = 7 material_print_temperature = =default_material_print_temperature + 5 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 +retraction_combing_max_distance = 50 speed_print = 60 speed_layer_0 = =math.ceil(speed_print * 20 / 60) speed_topbottom = =math.ceil(speed_print * 30 / 60) speed_wall = =math.ceil(speed_print * 40 / 60) speed_wall_0 = =math.ceil(speed_wall * 30 / 40) -infill_pattern = zigzag +infill_pattern = triangles speed_infill = =math.ceil(speed_print * 50 / 60) \ No newline at end of file diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_High_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_High_Quality.inst.cfg index c90eedaec3..c81dc0f5a7 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_High_Quality.inst.cfg @@ -18,10 +18,11 @@ machine_nozzle_heat_up_speed = 1.5 material_print_temperature = =default_material_print_temperature - 5 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 +retraction_combing_max_distance = 50 speed_print = 50 speed_layer_0 = =math.ceil(speed_print * 20 / 50) speed_topbottom = =math.ceil(speed_print * 30 / 50) speed_wall = =math.ceil(speed_print * 30 / 50) -infill_pattern = zigzag +infill_pattern = triangles speed_infill = =math.ceil(speed_print * 40 / 50) \ No newline at end of file diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Normal_Quality.inst.cfg index e098b0ffb4..7d29f8fb7c 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_CPE_Normal_Quality.inst.cfg @@ -16,10 +16,11 @@ machine_nozzle_cool_down_speed = 0.85 machine_nozzle_heat_up_speed = 1.5 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 +retraction_combing_max_distance = 50 speed_print = 55 speed_layer_0 = =math.ceil(speed_print * 20 / 55) speed_topbottom = =math.ceil(speed_print * 30 / 55) speed_wall = =math.ceil(speed_print * 30 / 55) -infill_pattern = zigzag +infill_pattern = triangles speed_infill = =math.ceil(speed_print * 45 / 55) \ No newline at end of file diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Draft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Draft_Print.inst.cfg index 46e3483a6a..4a55f5d24c 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Draft_Print.inst.cfg @@ -30,7 +30,7 @@ material_print_temperature_layer_0 = =material_print_temperature multiple_mesh_overlap = 0 prime_tower_enable = True prime_tower_wipe_enabled = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_extrusion_window = 1 retraction_hop = 0.2 retraction_hop_enabled = False diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Fast_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Fast_Print.inst.cfg index 5c235b656a..730e058212 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Fast_Print.inst.cfg @@ -30,7 +30,7 @@ material_print_temperature_layer_0 = =material_print_temperature multiple_mesh_overlap = 0 prime_tower_enable = True prime_tower_wipe_enabled = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_extrusion_window = 1 retraction_hop = 0.2 retraction_hop_enabled = False diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_High_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_High_Quality.inst.cfg index 326a730fe4..e6921e63d8 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_High_Quality.inst.cfg @@ -32,7 +32,7 @@ material_print_temperature_layer_0 = =material_print_temperature multiple_mesh_overlap = 0 prime_tower_enable = True prime_tower_wipe_enabled = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_extrusion_window = 1 retraction_hop = 0.2 retraction_hop_enabled = False diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Normal_Quality.inst.cfg index d40b2db90e..a4eec45e38 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPEP_Normal_Quality.inst.cfg @@ -32,7 +32,7 @@ material_print_temperature_layer_0 = =material_print_temperature multiple_mesh_overlap = 0 prime_tower_enable = True prime_tower_wipe_enabled = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_extrusion_window = 1 retraction_hop = 0.2 retraction_hop_enabled = False diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Draft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Draft_Print.inst.cfg index c812066e0c..4f085f10a6 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Draft_Print.inst.cfg @@ -16,6 +16,7 @@ buildplate = Aluminum material_print_temperature = =default_material_print_temperature + 10 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 +retraction_combing_max_distance = 50 skin_overlap = 20 speed_print = 60 speed_layer_0 = 20 @@ -25,7 +26,7 @@ speed_wall_0 = =math.ceil(speed_wall * 35 / 45) wall_thickness = 1 -infill_pattern = zigzag +infill_pattern = triangles speed_infill = =math.ceil(speed_print * 50 / 60) prime_tower_purge_volume = 1 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Fast_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Fast_Print.inst.cfg index ef634316da..2580bf952d 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Fast_Print.inst.cfg @@ -17,13 +17,14 @@ cool_min_speed = 7 material_print_temperature = =default_material_print_temperature + 5 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 +retraction_combing_max_distance = 50 speed_print = 60 speed_layer_0 = 20 speed_topbottom = =math.ceil(speed_print * 30 / 60) speed_wall = =math.ceil(speed_print * 40 / 60) speed_wall_0 = =math.ceil(speed_wall * 30 / 40) -infill_pattern = zigzag +infill_pattern = triangles speed_infill = =math.ceil(speed_print * 50 / 60) prime_tower_purge_volume = 1 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_High_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_High_Quality.inst.cfg index cda97e6ab3..d6f07c37a5 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_High_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_High_Quality.inst.cfg @@ -19,12 +19,13 @@ machine_nozzle_heat_up_speed = 1.5 material_print_temperature = =default_material_print_temperature - 5 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 +retraction_combing_max_distance = 50 speed_print = 50 speed_layer_0 = 20 speed_topbottom = =math.ceil(speed_print * 30 / 50) speed_wall = =math.ceil(speed_print * 30 / 50) -infill_pattern = zigzag +infill_pattern = triangles speed_infill = =math.ceil(speed_print * 40 / 50) prime_tower_purge_volume = 1 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Normal_Quality.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Normal_Quality.inst.cfg index 5a75f3b6e3..6032ff3845 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.4_aluminum_CPE_Normal_Quality.inst.cfg @@ -17,12 +17,13 @@ machine_nozzle_cool_down_speed = 0.85 machine_nozzle_heat_up_speed = 1.5 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 +retraction_combing_max_distance = 50 speed_print = 55 speed_layer_0 = 20 speed_topbottom = =math.ceil(speed_print * 30 / 55) speed_wall = =math.ceil(speed_print * 30 / 55) -infill_pattern = zigzag +infill_pattern = triangles speed_infill = =math.ceil(speed_print * 45 / 55) prime_tower_purge_volume = 1 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Fast_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Fast_Print.inst.cfg index e78006689b..b855eb2c8b 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Fast_Print.inst.cfg @@ -22,7 +22,7 @@ material_print_temperature = =default_material_print_temperature - 10 material_print_temperature_layer_0 = =material_print_temperature material_standby_temperature = 100 prime_tower_enable = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_hop = 0.1 retraction_hop_enabled = False skin_overlap = 0 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Superdraft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Superdraft_Print.inst.cfg index c6d0962157..d74711e8cf 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Superdraft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Superdraft_Print.inst.cfg @@ -22,7 +22,7 @@ material_print_temperature = =default_material_print_temperature - 5 material_print_temperature_layer_0 = =material_print_temperature material_standby_temperature = 100 prime_tower_enable = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_hop = 0.1 retraction_hop_enabled = False skin_overlap = 0 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Verydraft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Verydraft_Print.inst.cfg index b80f773594..b65a7ff93c 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Verydraft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPEP_Verydraft_Print.inst.cfg @@ -22,7 +22,7 @@ material_print_temperature = =default_material_print_temperature - 7 material_print_temperature_layer_0 = =material_print_temperature material_standby_temperature = 100 prime_tower_enable = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_hop = 0.1 retraction_hop_enabled = False skin_overlap = 0 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Draft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Draft_Print.inst.cfg index 532aacabf7..7cb69ba3eb 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Draft_Print.inst.cfg @@ -17,6 +17,7 @@ line_width = =machine_nozzle_size * 0.875 material_print_temperature = =default_material_print_temperature + 15 material_standby_temperature = 100 prime_tower_enable = True +retraction_combing_max_distance = 50 speed_print = 40 speed_topbottom = =math.ceil(speed_print * 25 / 40) speed_wall = =math.ceil(speed_print * 30 / 40) diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Superdraft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Superdraft_Print.inst.cfg index 55b9ae8315..6c323fe602 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Superdraft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Superdraft_Print.inst.cfg @@ -17,6 +17,7 @@ line_width = =machine_nozzle_size * 0.875 material_print_temperature = =default_material_print_temperature + 20 material_standby_temperature = 100 prime_tower_enable = True +retraction_combing_max_distance = 50 speed_print = 45 speed_topbottom = =math.ceil(speed_print * 30 / 45) speed_wall = =math.ceil(speed_print * 40 / 45) diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Verydraft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Verydraft_Print.inst.cfg index 01761062a4..a0380ecc0e 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Verydraft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_CPE_Verydraft_Print.inst.cfg @@ -17,6 +17,7 @@ line_width = =machine_nozzle_size * 0.875 material_print_temperature = =default_material_print_temperature + 17 material_standby_temperature = 100 prime_tower_enable = True +retraction_combing_max_distance = 50 speed_print = 40 speed_topbottom = =math.ceil(speed_print * 25 / 40) speed_wall = =math.ceil(speed_print * 30 / 40) diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Fast_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Fast_Print.inst.cfg index 3e74390840..c01f9b1ff1 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Fast_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Fast_Print.inst.cfg @@ -23,7 +23,7 @@ material_print_temperature = =default_material_print_temperature - 10 material_print_temperature_layer_0 = =material_print_temperature material_standby_temperature = 100 prime_tower_enable = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_hop = 0.1 retraction_hop_enabled = False skin_overlap = 0 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Superdraft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Superdraft_Print.inst.cfg index 4c1b807430..b9c9ef6611 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Superdraft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Superdraft_Print.inst.cfg @@ -23,7 +23,7 @@ material_print_temperature = =default_material_print_temperature - 5 material_print_temperature_layer_0 = =material_print_temperature material_standby_temperature = 100 prime_tower_enable = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_hop = 0.1 retraction_hop_enabled = False skin_overlap = 0 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Verydraft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Verydraft_Print.inst.cfg index 11aefc90cd..be2cc62b08 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Verydraft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPEP_Verydraft_Print.inst.cfg @@ -23,7 +23,7 @@ material_print_temperature = =default_material_print_temperature - 7 material_print_temperature_layer_0 = =material_print_temperature material_standby_temperature = 100 prime_tower_enable = True -retraction_combing = off +retraction_combing_max_distance = 50 retraction_hop = 0.1 retraction_hop_enabled = False skin_overlap = 0 diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Draft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Draft_Print.inst.cfg index 80c0585061..0d0ed8f8b2 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Draft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Draft_Print.inst.cfg @@ -18,6 +18,7 @@ line_width = =machine_nozzle_size * 0.875 material_print_temperature = =default_material_print_temperature + 15 material_standby_temperature = 100 prime_tower_enable = True +retraction_combing_max_distance = 50 speed_print = 40 speed_topbottom = =math.ceil(speed_print * 25 / 40) speed_wall = =math.ceil(speed_print * 30 / 40) diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Superdraft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Superdraft_Print.inst.cfg index 5dcc454173..a163e0c735 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Superdraft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Superdraft_Print.inst.cfg @@ -18,6 +18,7 @@ line_width = =machine_nozzle_size * 0.875 material_print_temperature = =default_material_print_temperature + 20 material_standby_temperature = 100 prime_tower_enable = True +retraction_combing_max_distance = 50 speed_print = 45 speed_topbottom = =math.ceil(speed_print * 30 / 45) speed_wall = =math.ceil(speed_print * 40 / 45) diff --git a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Verydraft_Print.inst.cfg b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Verydraft_Print.inst.cfg index 8423e109e8..2137cf740b 100644 --- a/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Verydraft_Print.inst.cfg +++ b/resources/quality/ultimaker_s5/um_s5_aa0.8_aluminum_CPE_Verydraft_Print.inst.cfg @@ -18,6 +18,7 @@ line_width = =machine_nozzle_size * 0.875 material_print_temperature = =default_material_print_temperature + 17 material_standby_temperature = 100 prime_tower_enable = True +retraction_combing_max_distance = 50 speed_print = 40 speed_topbottom = =math.ceil(speed_print * 25 / 40) speed_wall = =math.ceil(speed_print * 30 / 40) From fa59a6a7dba646b18ab543dbf58c4e349e6eda4e Mon Sep 17 00:00:00 2001 From: THeijmans Date: Fri, 23 Nov 2018 09:17:32 +0100 Subject: [PATCH 002/199] UM3 ABS first layer temperature Fixed the first layer temperature for ABS Fine and Extra Fine profiles on the UM3 (ST-2281). --- resources/quality/ultimaker3/um3_aa0.4_ABS_High_Quality.inst.cfg | 1 + .../quality/ultimaker3/um3_aa0.4_ABS_Normal_Quality.inst.cfg | 1 + 2 files changed, 2 insertions(+) diff --git a/resources/quality/ultimaker3/um3_aa0.4_ABS_High_Quality.inst.cfg b/resources/quality/ultimaker3/um3_aa0.4_ABS_High_Quality.inst.cfg index 9ceab110e9..4e79728945 100644 --- a/resources/quality/ultimaker3/um3_aa0.4_ABS_High_Quality.inst.cfg +++ b/resources/quality/ultimaker3/um3_aa0.4_ABS_High_Quality.inst.cfg @@ -17,6 +17,7 @@ machine_nozzle_cool_down_speed = 0.8 machine_nozzle_heat_up_speed = 1.5 material_standby_temperature = 100 material_print_temperature = =default_material_print_temperature - 5 +material_print_temperature_layer_0 = =material_print_temperature + 15 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 prime_tower_enable = False diff --git a/resources/quality/ultimaker3/um3_aa0.4_ABS_Normal_Quality.inst.cfg b/resources/quality/ultimaker3/um3_aa0.4_ABS_Normal_Quality.inst.cfg index e5b699c35f..3bded3b97c 100644 --- a/resources/quality/ultimaker3/um3_aa0.4_ABS_Normal_Quality.inst.cfg +++ b/resources/quality/ultimaker3/um3_aa0.4_ABS_Normal_Quality.inst.cfg @@ -14,6 +14,7 @@ variant = AA 0.4 [values] machine_nozzle_cool_down_speed = 0.85 machine_nozzle_heat_up_speed = 1.5 +material_print_temperature_layer_0 = =material_print_temperature + 10 material_initial_print_temperature = =material_print_temperature - 5 material_final_print_temperature = =material_print_temperature - 10 material_standby_temperature = 100 From 98ec6c66f2d486890b2d31c68bb8bd09e3bd911e Mon Sep 17 00:00:00 2001 From: THeijmans Date: Tue, 4 Dec 2018 08:25:05 +0100 Subject: [PATCH 003/199] CC06 profile fix removed line adding 10degrees to many profiles --- resources/variants/ultimaker_s5_cc06.inst.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/variants/ultimaker_s5_cc06.inst.cfg b/resources/variants/ultimaker_s5_cc06.inst.cfg index d41d08118a..7adf7ab7a0 100644 --- a/resources/variants/ultimaker_s5_cc06.inst.cfg +++ b/resources/variants/ultimaker_s5_cc06.inst.cfg @@ -13,7 +13,6 @@ brim_width = 7 machine_nozzle_cool_down_speed = 0.9 machine_nozzle_id = CC 0.6 machine_nozzle_size = 0.6 -material_print_temperature = =default_material_print_temperature + 10 raft_acceleration = =acceleration_print raft_airgap = 0.3 raft_base_thickness = =resolveOrValue('layer_height_0') * 1.2 From 700ae4bebb2218610fbf0095f57e7aabb81e52ba Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 10:48:06 +0100 Subject: [PATCH 004/199] Removed super spammy logging CURA-6006 --- plugins/Toolbox/src/Toolbox.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 562a964f01..2b78581deb 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -491,11 +491,8 @@ class Toolbox(QObject, Extension): def canUpdate(self, package_id: str) -> bool: local_package = self._package_manager.getInstalledPackageInfo(package_id) if local_package is None: - Logger.log("i", "Could not find package [%s] as installed in the package manager, fall back to check the old plugins", - package_id) local_package = self.getOldPluginPackageMetadata(package_id) if local_package is None: - Logger.log("i", "Could not find package [%s] in the old plugins", package_id) return False remote_package = self.getRemotePackage(package_id) From 978a01e4c89873b42909991ae5ecc49988beab33 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 10:51:05 +0100 Subject: [PATCH 005/199] Fix typing & codestyle CURA-6006 --- plugins/Toolbox/src/Toolbox.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 2b78581deb..1fe7c961ba 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -31,8 +31,8 @@ i18n_catalog = i18nCatalog("cura") ## The Toolbox class is responsible of communicating with the server through the API class Toolbox(QObject, Extension): - DEFAULT_CLOUD_API_ROOT = "https://api.ultimaker.com" #type: str - DEFAULT_CLOUD_API_VERSION = 1 #type: int + DEFAULT_CLOUD_API_ROOT = "https://api.ultimaker.com" # type: str + DEFAULT_CLOUD_API_VERSION = 1 # type: int def __init__(self, application: CuraApplication) -> None: super().__init__() @@ -192,9 +192,9 @@ class Toolbox(QObject, Extension): return self.DEFAULT_CLOUD_API_ROOT if not hasattr(cura.CuraVersion, "CuraCloudAPIRoot"): # type: ignore return self.DEFAULT_CLOUD_API_ROOT - if not cura.CuraVersion.CuraCloudAPIRoot: # type: ignore + if not cura.CuraVersion.CuraCloudAPIRoot: # type: ignore return self.DEFAULT_CLOUD_API_ROOT - return cura.CuraVersion.CuraCloudAPIRoot # type: ignore + return cura.CuraVersion.CuraCloudAPIRoot # type: ignore # Get the cloud API version from CuraVersion def _getCloudAPIVersion(self) -> int: @@ -202,9 +202,9 @@ class Toolbox(QObject, Extension): return self.DEFAULT_CLOUD_API_VERSION if not hasattr(cura.CuraVersion, "CuraCloudAPIVersion"): # type: ignore return self.DEFAULT_CLOUD_API_VERSION - if not cura.CuraVersion.CuraCloudAPIVersion: # type: ignore + if not cura.CuraVersion.CuraCloudAPIVersion: # type: ignore return self.DEFAULT_CLOUD_API_VERSION - return cura.CuraVersion.CuraCloudAPIVersion # type: ignore + return cura.CuraVersion.CuraCloudAPIVersion # type: ignore # Get the packages version depending on Cura version settings. def _getSDKVersion(self) -> Union[int, str]: @@ -231,12 +231,6 @@ class Toolbox(QObject, Extension): # Make remote requests: self._makeRequestByType("packages") self._makeRequestByType("authors") - # TODO: Uncomment in the future when the tag-filtered api calls work in the cloud server - # self._makeRequestByType("plugins_showcase") - # self._makeRequestByType("plugins_available") - # self._makeRequestByType("materials_showcase") - # self._makeRequestByType("materials_available") - # self._makeRequestByType("materials_generic") # Gather installed packages: self._updateInstalledModels() @@ -281,7 +275,7 @@ class Toolbox(QObject, Extension): "description": plugin_data["plugin"]["description"] } return formatted - except: + except KeyError: Logger.log("w", "Unable to convert plugin meta data %s", str(plugin_data)) return None From d9135ac72fa9aa4aa155179fb44e57cda2d1ad96 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 11:06:14 +0100 Subject: [PATCH 006/199] Fix more codestyle issues CURA-6006 --- plugins/Toolbox/src/Toolbox.py | 62 +++++++++++++++------------------- 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 1fe7c961ba..b6cfafe40c 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -559,34 +559,30 @@ class Toolbox(QObject, Extension): # Check for plugins that were installed with the old plugin browser def isOldPlugin(self, plugin_id: str) -> bool: - if plugin_id in self._old_plugin_ids: - return True - return False + return plugin_id in self._old_plugin_ids def getOldPluginPackageMetadata(self, plugin_id: str) -> Optional[Dict[str, Any]]: return self._old_plugin_metadata.get(plugin_id) - def loadingComplete(self) -> bool: + def isLoadingComplete(self) -> bool: populated = 0 - for list in self._metadata.items(): - if len(list) > 0: + for metadata_list in self._metadata.items(): + if metadata_list: populated += 1 - if populated == len(self._metadata.items()): - return True - return False + return populated == len(self._metadata.items()) # Make API Calls # -------------------------------------------------------------------------- - def _makeRequestByType(self, type: str) -> None: - Logger.log("i", "Marketplace: Requesting %s metadata from server.", type) - request = QNetworkRequest(self._request_urls[type]) + def _makeRequestByType(self, request_type: str) -> None: + Logger.log("i", "Requesting %s metadata from server.", request_type) + request = QNetworkRequest(self._request_urls[request_type]) request.setRawHeader(*self._request_header) if self._network_manager: self._network_manager.get(request) @pyqtSlot(str) def startDownload(self, url: str) -> None: - Logger.log("i", "Marketplace: Attempting to download & install package from %s.", url) + Logger.log("i", "Attempting to download & install package from %s.", url) url = QUrl(url) self._download_request = QNetworkRequest(url) if hasattr(QNetworkRequest, "FollowRedirectsAttribute"): @@ -603,7 +599,7 @@ class Toolbox(QObject, Extension): @pyqtSlot() def cancelDownload(self) -> None: - Logger.log("i", "Marketplace: User cancelled the download of a package.") + Logger.log("i", "User cancelled the download of a package.") self.resetDownload() def resetDownload(self) -> None: @@ -647,10 +643,10 @@ class Toolbox(QObject, Extension): ] if reply.operation() == QNetworkAccessManager.GetOperation: - for type, url in self._request_urls.items(): + for response_type, url in self._request_urls.items(): # HACK: Do nothing because we'll handle these from the "packages" call - if type in do_not_handle: + if response_type in do_not_handle: continue if reply.url() == url: @@ -665,38 +661,35 @@ class Toolbox(QObject, Extension): return # Create model and apply metadata: - if not self._models[type]: - Logger.log("e", "Could not find the %s model.", type) + if not self._models[response_type]: + Logger.log("e", "Could not find the %s model.", response_type) break - self._metadata[type] = json_data["data"] - self._models[type].setMetadata(self._metadata[type]) + self._metadata[response_type] = json_data["data"] + self._models[response_type].setMetadata(self._metadata[response_type]) # Do some auto filtering # TODO: Make multiple API calls in the future to handle this - if type is "packages": - self._models[type].setFilter({"type": "plugin"}) + if response_type is "packages": + self._models[response_type].setFilter({"type": "plugin"}) self.buildMaterialsModels() self.buildPluginsModels() - if type is "authors": - self._models[type].setFilter({"package_types": "material"}) - if type is "materials_generic": - self._models[type].setFilter({"tags": "generic"}) + if response_type is "authors": + self._models[response_type].setFilter({"package_types": "material"}) + if response_type is "materials_generic": + self._models[response_type].setFilter({"tags": "generic"}) self.metadataChanged.emit() - if self.loadingComplete() is True: + if self.isLoadingComplete(): self.setViewPage("overview") - return except json.decoder.JSONDecodeError: - Logger.log("w", "Marketplace: Received invalid JSON for %s.", type) + Logger.log("w", "Received invalid JSON for %s.", response_type) break else: self.setViewPage("errored") self.resetDownload() - return - else: # Ignore any operation that is not a get operation pass @@ -717,10 +710,10 @@ class Toolbox(QObject, Extension): self._onDownloadComplete(file_path) def _onDownloadComplete(self, file_path: str) -> None: - Logger.log("i", "Marketplace: Download complete.") + Logger.log("i", "Download complete.") package_info = self._package_manager.getPackageInfo(file_path) if not package_info: - Logger.log("w", "Marketplace: Package file [%s] was not a valid CuraPackage.", file_path) + Logger.log("w", "Package file [%s] was not a valid CuraPackage.", file_path) return license_content = self._package_manager.getPackageLicense(file_path) @@ -729,7 +722,6 @@ class Toolbox(QObject, Extension): return self.install(file_path) - return # Getter & Setters for Properties: # -------------------------------------------------------------------------- @@ -847,7 +839,7 @@ class Toolbox(QObject, Extension): self._metadata["materials_available"] = [] self._metadata["materials_generic"] = [] - processed_authors = [] # type: List[str] + processed_authors = [] # type: List[str] for item in self._metadata["packages"]: if item["package_type"] == "material": From abcc621cc62120a0f9f1e5f32599f8356e607dc2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 11:29:44 +0100 Subject: [PATCH 007/199] Added missing typing --- plugins/Toolbox/src/AuthorsModel.py | 43 ++++++++++++++-------------- plugins/Toolbox/src/PackagesModel.py | 2 +- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/plugins/Toolbox/src/AuthorsModel.py b/plugins/Toolbox/src/AuthorsModel.py index bea3893504..6f4b5bd280 100644 --- a/plugins/Toolbox/src/AuthorsModel.py +++ b/plugins/Toolbox/src/AuthorsModel.py @@ -2,18 +2,19 @@ # Cura is released under the terms of the LGPLv3 or higher. import re -from typing import Dict +from typing import Dict, List, Optional, Union from PyQt5.QtCore import Qt, pyqtProperty, pyqtSignal from UM.Qt.ListModel import ListModel + ## Model that holds cura packages. By setting the filter property the instances held by this model can be changed. class AuthorsModel(ListModel): - def __init__(self, parent = None): + def __init__(self, parent = None) -> None: super().__init__(parent) - self._metadata = None + self._metadata = None # type: Optional[List[Dict[str, Union[str, List[str], int]]]] self.addRoleName(Qt.UserRole + 1, "id") self.addRoleName(Qt.UserRole + 2, "name") @@ -25,39 +26,39 @@ class AuthorsModel(ListModel): self.addRoleName(Qt.UserRole + 8, "description") # List of filters for queries. The result is the union of the each list of results. - self._filter = {} # type: Dict[str,str] + self._filter = {} # type: Dict[str, str] - def setMetadata(self, data): + def setMetadata(self, data: List[Dict[str, Union[str, List[str], int]]]): self._metadata = data self._update() - def _update(self): - items = [] + def _update(self) -> None: + items = [] # type: List[Dict[str, Union[str, List[str], int, None]]] if not self._metadata: - self.setItems([]) + self.setItems(items) return for author in self._metadata: items.append({ - "id": author["author_id"], - "name": author["display_name"], - "email": author["email"] if "email" in author else None, - "website": author["website"], - "package_count": author["package_count"] if "package_count" in author else 0, - "package_types": author["package_types"] if "package_types" in author else [], - "icon_url": author["icon_url"] if "icon_url" in author else None, - "description": "Material and quality profiles from {author_name}".format(author_name = author["display_name"]) + "id": author.get("author_id"), + "name": author.get("display_name"), + "email": author.get("email"), + "website": author.get("website"), + "package_count": author.get("package_count", 0), + "package_types": author.get("package_types", []), + "icon_url": author.get("icon_url"), + "description": "Material and quality profiles from {author_name}".format(author_name = author.get("display_name", "")) }) # Filter on all the key-word arguments. for key, value in self._filter.items(): if key is "package_types": - key_filter = lambda item, value = value: value in item["package_types"] + key_filter = lambda item, value = value: value in item["package_types"] # type: ignore elif "*" in value: - key_filter = lambda item, key = key, value = value: self._matchRegExp(item, key, value) + key_filter = lambda item, key = key, value = value: self._matchRegExp(item, key, value) # type: ignore else: - key_filter = lambda item, key = key, value = value: self._matchString(item, key, value) - items = filter(key_filter, items) + key_filter = lambda item, key = key, value = value: self._matchString(item, key, value) # type: ignore + items = filter(key_filter, items) # type: ignore # Execute all filters. filtered_items = list(items) @@ -72,7 +73,7 @@ class AuthorsModel(ListModel): self._filter = filter_dict self._update() - @pyqtProperty("QVariantMap", fset = setFilter, constant = True) + @pyqtProperty("QStringMap", fset = setFilter, constant = True) def filter(self) -> Dict[str, str]: return self._filter diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py index a31facf75a..2849a29c99 100644 --- a/plugins/Toolbox/src/PackagesModel.py +++ b/plugins/Toolbox/src/PackagesModel.py @@ -33,7 +33,7 @@ class PackagesModel(ListModel): self.addRoleName(Qt.UserRole + 12, "last_updated") self.addRoleName(Qt.UserRole + 13, "is_bundled") self.addRoleName(Qt.UserRole + 14, "is_active") - self.addRoleName(Qt.UserRole + 15, "is_installed") # Scheduled pkgs are included in the model but should not be marked as actually installed + self.addRoleName(Qt.UserRole + 15, "is_installed") # Scheduled pkgs are included in the model but should not be marked as actually installed self.addRoleName(Qt.UserRole + 16, "has_configs") self.addRoleName(Qt.UserRole + 17, "supported_configs") self.addRoleName(Qt.UserRole + 18, "download_count") From b1440737e641a708683c06ea12c7874dd3fb8ab7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 13:21:17 +0100 Subject: [PATCH 008/199] Remove a whole bunch of unused code CURA-6006 --- plugins/Toolbox/src/AuthorsModel.py | 2 +- plugins/Toolbox/src/Toolbox.py | 70 +++++++++-------------------- 2 files changed, 22 insertions(+), 50 deletions(-) diff --git a/plugins/Toolbox/src/AuthorsModel.py b/plugins/Toolbox/src/AuthorsModel.py index 6f4b5bd280..8fafda54ec 100644 --- a/plugins/Toolbox/src/AuthorsModel.py +++ b/plugins/Toolbox/src/AuthorsModel.py @@ -73,7 +73,7 @@ class AuthorsModel(ListModel): self._filter = filter_dict self._update() - @pyqtProperty("QStringMap", fset = setFilter, constant = True) + @pyqtProperty("QVariantMap", fset = setFilter, constant = True) def filter(self) -> Dict[str, str]: return self._filter diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index b6cfafe40c..5db3dd934f 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -70,13 +70,6 @@ class Toolbox(QObject, Extension): self._metadata = { "authors": [], "packages": [], - "plugins_showcase": [], - "plugins_available": [], - "plugins_installed": [], - "materials_showcase": [], - "materials_available": [], - "materials_installed": [], - "materials_generic": [] } # type: Dict[str, List[Any]] # Models: @@ -178,12 +171,7 @@ class Toolbox(QObject, Extension): ) self._request_urls = { "authors": QUrl("{base_url}/authors".format(base_url = self._api_url)), - "packages": QUrl("{base_url}/packages".format(base_url = self._api_url)), - "plugins_showcase": QUrl("{base_url}/showcase".format(base_url = self._api_url)), - "plugins_available": QUrl("{base_url}/packages?package_type=plugin".format(base_url = self._api_url)), - "materials_showcase": QUrl("{base_url}/showcase".format(base_url = self._api_url)), - "materials_available": QUrl("{base_url}/packages?package_type=material".format(base_url = self._api_url)), - "materials_generic": QUrl("{base_url}/packages?package_type=material&tags=generic".format(base_url = self._api_url)) + "packages": QUrl("{base_url}/packages".format(base_url = self._api_url)) } # Get the API root for the packages API depending on Cura version settings. @@ -606,8 +594,8 @@ class Toolbox(QObject, Extension): if self._download_reply: try: self._download_reply.downloadProgress.disconnect(self._onDownloadProgress) - except TypeError: #Raised when the method is not connected to the signal yet. - pass #Don't need to disconnect. + except TypeError: # Raised when the method is not connected to the signal yet. + pass # Don't need to disconnect. self._download_reply.abort() self._download_reply = None self._download_request = None @@ -633,22 +621,8 @@ class Toolbox(QObject, Extension): self.resetDownload() return - # HACK: These request are not handled independently at this moment, but together from the "packages" call - do_not_handle = [ - "materials_available", - "materials_showcase", - "materials_generic", - "plugins_available", - "plugins_showcase", - ] - if reply.operation() == QNetworkAccessManager.GetOperation: for response_type, url in self._request_urls.items(): - - # HACK: Do nothing because we'll handle these from the "packages" call - if response_type in do_not_handle: - continue - if reply.url() == url: if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) == 200: try: @@ -672,11 +646,10 @@ class Toolbox(QObject, Extension): # TODO: Make multiple API calls in the future to handle this if response_type is "packages": self._models[response_type].setFilter({"type": "plugin"}) - self.buildMaterialsModels() + self.reBuildMaterialsModels() self.buildPluginsModels() - if response_type is "authors": + elif response_type is "authors": self._models[response_type].setFilter({"package_types": "material"}) - if response_type is "materials_generic": self._models[response_type].setFilter({"tags": "generic"}) self.metadataChanged.emit() @@ -834,10 +807,10 @@ class Toolbox(QObject, Extension): # HACK(S): # -------------------------------------------------------------------------- - def buildMaterialsModels(self) -> None: - self._metadata["materials_showcase"] = [] - self._metadata["materials_available"] = [] - self._metadata["materials_generic"] = [] + def reBuildMaterialsModels(self) -> None: + materials_showcase_metadata = [] + materials_available_metadata = [] + materials_generic_metadata = [] processed_authors = [] # type: List[str] @@ -850,30 +823,29 @@ class Toolbox(QObject, Extension): # Generic materials to be in the same section if "generic" in item["tags"]: - self._metadata["materials_generic"].append(item) + materials_generic_metadata.append(item) else: if "showcase" in item["tags"]: - self._metadata["materials_showcase"].append(author) + materials_showcase_metadata.append(author) else: - self._metadata["materials_available"].append(author) + materials_available_metadata.append(author) processed_authors.append(author["author_id"]) - self._models["materials_showcase"].setMetadata(self._metadata["materials_showcase"]) - self._models["materials_available"].setMetadata(self._metadata["materials_available"]) - self._models["materials_generic"].setMetadata(self._metadata["materials_generic"]) + self._models["materials_showcase"].setMetadata(materials_showcase_metadata) + self._models["materials_available"].setMetadata(materials_available_metadata) + self._models["materials_generic"].setMetadata(materials_generic_metadata) def buildPluginsModels(self) -> None: - self._metadata["plugins_showcase"] = [] - self._metadata["plugins_available"] = [] + plugins_showcase_metadata = [] + plugins_available_metadata = [] for item in self._metadata["packages"]: if item["package_type"] == "plugin": - if "showcase" in item["tags"]: - self._metadata["plugins_showcase"].append(item) + plugins_showcase_metadata.append(item) else: - self._metadata["plugins_available"].append(item) + plugins_available_metadata.append(item) - self._models["plugins_showcase"].setMetadata(self._metadata["plugins_showcase"]) - self._models["plugins_available"].setMetadata(self._metadata["plugins_available"]) + self._models["plugins_showcase"].setMetadata(plugins_showcase_metadata) + self._models["plugins_available"].setMetadata(plugins_available_metadata) From 07d210483c91d77c3198548a386247fdc993df2f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 13:42:13 +0100 Subject: [PATCH 009/199] Greatly decrease the bloat / complexity of the toolbox There was a lot of stuff going on that didn't need to happen, so I cut those parts out in order to improve the overview. --- plugins/Toolbox/src/AuthorsModel.py | 5 +-- plugins/Toolbox/src/PackagesModel.py | 5 +-- plugins/Toolbox/src/Toolbox.py | 54 ++++++++++++++-------------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/plugins/Toolbox/src/AuthorsModel.py b/plugins/Toolbox/src/AuthorsModel.py index 8fafda54ec..877f8256ee 100644 --- a/plugins/Toolbox/src/AuthorsModel.py +++ b/plugins/Toolbox/src/AuthorsModel.py @@ -29,8 +29,9 @@ class AuthorsModel(ListModel): self._filter = {} # type: Dict[str, str] def setMetadata(self, data: List[Dict[str, Union[str, List[str], int]]]): - self._metadata = data - self._update() + if self._metadata != data: + self._metadata = data + self._update() def _update(self) -> None: items = [] # type: List[Dict[str, Union[str, List[str], int, None]]] diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py index 2849a29c99..f941804653 100644 --- a/plugins/Toolbox/src/PackagesModel.py +++ b/plugins/Toolbox/src/PackagesModel.py @@ -45,8 +45,9 @@ class PackagesModel(ListModel): self._filter = {} # type: Dict[str, str] def setMetadata(self, data): - self._metadata = data - self._update() + if self._metadata != data: + self._metadata = data + self._update() def _update(self): items = [] diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 5db3dd934f..7b1442ff3c 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -66,8 +66,8 @@ class Toolbox(QObject, Extension): self._old_plugin_ids = set() # type: Set[str] self._old_plugin_metadata = dict() # type: Dict[str, Dict[str, Any]] - # Data: - self._metadata = { + # The responses as given by the server parsed to a list. + self._server_response_data = { "authors": [], "packages": [], } # type: Dict[str, List[Any]] @@ -301,13 +301,13 @@ class Toolbox(QObject, Extension): if plugin_id not in all_plugin_package_ids) self._old_plugin_metadata = {k: v for k, v in self._old_plugin_metadata.items() if k in self._old_plugin_ids} - self._metadata["plugins_installed"] = all_packages["plugin"] + list(self._old_plugin_metadata.values()) - self._models["plugins_installed"].setMetadata(self._metadata["plugins_installed"]) + self._server_response_data["plugins_installed"] = all_packages["plugin"] + list(self._old_plugin_metadata.values()) + self._models["plugins_installed"].setMetadata(self._server_response_data["plugins_installed"]) self.metadataChanged.emit() if "material" in all_packages: - self._metadata["materials_installed"] = all_packages["material"] + self._server_response_data["materials_installed"] = all_packages["material"] # TODO: ADD MATERIALS HERE ONCE MATERIALS PORTION OF TOOLBOX IS LIVE - self._models["materials_installed"].setMetadata(self._metadata["materials_installed"]) + self._models["materials_installed"].setMetadata(self._server_response_data["materials_installed"]) self.metadataChanged.emit() @pyqtSlot(str) @@ -461,7 +461,7 @@ class Toolbox(QObject, Extension): def getRemotePackage(self, package_id: str) -> Optional[Dict]: # TODO: make the lookup in a dict, not a loop. canUpdate is called for every item. remote_package = None - for package in self._metadata["packages"]: + for package in self._server_response_data["packages"]: if package["package_id"] == package_id: remote_package = package break @@ -524,7 +524,7 @@ class Toolbox(QObject, Extension): @pyqtSlot(str, result = int) def getNumberOfInstalledPackagesByAuthor(self, author_id: str) -> int: count = 0 - for package in self._metadata["materials_installed"]: + for package in self._server_response_data["materials_installed"]: if package["author"]["author_id"] == author_id: count += 1 return count @@ -533,7 +533,7 @@ class Toolbox(QObject, Extension): @pyqtSlot(str, result = int) def getTotalNumberOfMaterialPackagesByAuthor(self, author_id: str) -> int: count = 0 - for package in self._metadata["packages"]: + for package in self._server_response_data["packages"]: if package["package_type"] == "material": if package["author"]["author_id"] == author_id: count += 1 @@ -554,10 +554,10 @@ class Toolbox(QObject, Extension): def isLoadingComplete(self) -> bool: populated = 0 - for metadata_list in self._metadata.items(): + for metadata_list in self._server_response_data.items(): if metadata_list: populated += 1 - return populated == len(self._metadata.items()) + return populated == len(self._server_response_data.items()) # Make API Calls # -------------------------------------------------------------------------- @@ -639,15 +639,13 @@ class Toolbox(QObject, Extension): Logger.log("e", "Could not find the %s model.", response_type) break - self._metadata[response_type] = json_data["data"] - self._models[response_type].setMetadata(self._metadata[response_type]) + self._server_response_data[response_type] = json_data["data"] + self._models[response_type].setMetadata(self._server_response_data[response_type]) - # Do some auto filtering - # TODO: Make multiple API calls in the future to handle this if response_type is "packages": self._models[response_type].setFilter({"type": "plugin"}) self.reBuildMaterialsModels() - self.buildPluginsModels() + self.reBuildPluginsModels() elif response_type is "authors": self._models[response_type].setFilter({"package_types": "material"}) self._models[response_type].setFilter({"tags": "generic"}) @@ -743,39 +741,39 @@ class Toolbox(QObject, Extension): # Exposed Models: # -------------------------------------------------------------------------- - @pyqtProperty(QObject, notify = metadataChanged) + @pyqtProperty(QObject, constant=True) def authorsModel(self) -> AuthorsModel: return cast(AuthorsModel, self._models["authors"]) - @pyqtProperty(QObject, notify = metadataChanged) + @pyqtProperty(QObject, constant=True) def packagesModel(self) -> PackagesModel: return cast(PackagesModel, self._models["packages"]) - @pyqtProperty(QObject, notify = metadataChanged) + @pyqtProperty(QObject, constant=True) def pluginsShowcaseModel(self) -> PackagesModel: return cast(PackagesModel, self._models["plugins_showcase"]) - @pyqtProperty(QObject, notify = metadataChanged) + @pyqtProperty(QObject, constant=True) def pluginsAvailableModel(self) -> PackagesModel: return cast(PackagesModel, self._models["plugins_available"]) - @pyqtProperty(QObject, notify = metadataChanged) + @pyqtProperty(QObject, constant=True) def pluginsInstalledModel(self) -> PackagesModel: return cast(PackagesModel, self._models["plugins_installed"]) - @pyqtProperty(QObject, notify = metadataChanged) + @pyqtProperty(QObject, constant=True) def materialsShowcaseModel(self) -> AuthorsModel: return cast(AuthorsModel, self._models["materials_showcase"]) - @pyqtProperty(QObject, notify = metadataChanged) + @pyqtProperty(QObject, constant=True) def materialsAvailableModel(self) -> AuthorsModel: return cast(AuthorsModel, self._models["materials_available"]) - @pyqtProperty(QObject, notify = metadataChanged) + @pyqtProperty(QObject, constant=True) def materialsInstalledModel(self) -> PackagesModel: return cast(PackagesModel, self._models["materials_installed"]) - @pyqtProperty(QObject, notify=metadataChanged) + @pyqtProperty(QObject, constant=True) def materialsGenericModel(self) -> PackagesModel: return cast(PackagesModel, self._models["materials_generic"]) @@ -814,7 +812,7 @@ class Toolbox(QObject, Extension): processed_authors = [] # type: List[str] - for item in self._metadata["packages"]: + for item in self._server_response_data["packages"]: if item["package_type"] == "material": author = item["author"] @@ -836,11 +834,11 @@ class Toolbox(QObject, Extension): self._models["materials_available"].setMetadata(materials_available_metadata) self._models["materials_generic"].setMetadata(materials_generic_metadata) - def buildPluginsModels(self) -> None: + def reBuildPluginsModels(self) -> None: plugins_showcase_metadata = [] plugins_available_metadata = [] - for item in self._metadata["packages"]: + for item in self._server_response_data["packages"]: if item["package_type"] == "plugin": if "showcase" in item["tags"]: plugins_showcase_metadata.append(item) From a52f866f818324994b1a1b34f06805ffd3ed24d0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 14:03:32 +0100 Subject: [PATCH 010/199] Move most models out of dictionary CURA-6006 --- plugins/Toolbox/src/Toolbox.py | 47 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 7b1442ff3c..ada81dbc07 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -70,21 +70,25 @@ class Toolbox(QObject, Extension): self._server_response_data = { "authors": [], "packages": [], + "plugins_installed": [], + "materials_installed": [] } # type: Dict[str, List[Any]] # Models: self._models = { "authors": AuthorsModel(self), "packages": PackagesModel(self), - "plugins_showcase": PackagesModel(self), - "plugins_available": PackagesModel(self), - "plugins_installed": PackagesModel(self), - "materials_showcase": AuthorsModel(self), - "materials_available": AuthorsModel(self), - "materials_installed": PackagesModel(self), - "materials_generic": PackagesModel(self) } # type: Dict[str, ListModel] + self._plugins_showcase_model = PackagesModel(self) + self._plugins_available_model = PackagesModel(self) + self._plugins_installed_model = PackagesModel(self) + + self._materials_showcase_model = AuthorsModel(self) + self._materials_available_model = AuthorsModel(self) + self._materials_installed_model = PackagesModel(self) + self._materials_generic_model = PackagesModel(self) + # These properties are for keeping track of the UI state: # ---------------------------------------------------------------------- # View category defines which filter to use, and therefore effectively @@ -302,12 +306,11 @@ class Toolbox(QObject, Extension): self._old_plugin_metadata = {k: v for k, v in self._old_plugin_metadata.items() if k in self._old_plugin_ids} self._server_response_data["plugins_installed"] = all_packages["plugin"] + list(self._old_plugin_metadata.values()) - self._models["plugins_installed"].setMetadata(self._server_response_data["plugins_installed"]) + self._plugins_installed_model.setMetadata(self._server_response_data["plugins_installed"]) self.metadataChanged.emit() if "material" in all_packages: self._server_response_data["materials_installed"] = all_packages["material"] - # TODO: ADD MATERIALS HERE ONCE MATERIALS PORTION OF TOOLBOX IS LIVE - self._models["materials_installed"].setMetadata(self._server_response_data["materials_installed"]) + self._materials_installed_model.setMetadata(all_packages["material"]) self.metadataChanged.emit() @pyqtSlot(str) @@ -751,31 +754,31 @@ class Toolbox(QObject, Extension): @pyqtProperty(QObject, constant=True) def pluginsShowcaseModel(self) -> PackagesModel: - return cast(PackagesModel, self._models["plugins_showcase"]) + return self._plugins_showcase_model @pyqtProperty(QObject, constant=True) def pluginsAvailableModel(self) -> PackagesModel: - return cast(PackagesModel, self._models["plugins_available"]) + return self._plugins_available_model @pyqtProperty(QObject, constant=True) def pluginsInstalledModel(self) -> PackagesModel: - return cast(PackagesModel, self._models["plugins_installed"]) + return self._plugins_installed_model @pyqtProperty(QObject, constant=True) def materialsShowcaseModel(self) -> AuthorsModel: - return cast(AuthorsModel, self._models["materials_showcase"]) + return self._materials_showcase_model @pyqtProperty(QObject, constant=True) def materialsAvailableModel(self) -> AuthorsModel: - return cast(AuthorsModel, self._models["materials_available"]) + return self._materials_available_model @pyqtProperty(QObject, constant=True) def materialsInstalledModel(self) -> PackagesModel: - return cast(PackagesModel, self._models["materials_installed"]) + return self._materials_installed_model @pyqtProperty(QObject, constant=True) def materialsGenericModel(self) -> PackagesModel: - return cast(PackagesModel, self._models["materials_generic"]) + return self._materials_generic_model # Filter Models: # -------------------------------------------------------------------------- @@ -830,9 +833,9 @@ class Toolbox(QObject, Extension): processed_authors.append(author["author_id"]) - self._models["materials_showcase"].setMetadata(materials_showcase_metadata) - self._models["materials_available"].setMetadata(materials_available_metadata) - self._models["materials_generic"].setMetadata(materials_generic_metadata) + self._materials_showcase_model.setMetadata(materials_showcase_metadata) + self._materials_available_model.setMetadata(materials_available_metadata) + self._materials_generic_model.setMetadata(materials_generic_metadata) def reBuildPluginsModels(self) -> None: plugins_showcase_metadata = [] @@ -845,5 +848,5 @@ class Toolbox(QObject, Extension): else: plugins_available_metadata.append(item) - self._models["plugins_showcase"].setMetadata(plugins_showcase_metadata) - self._models["plugins_available"].setMetadata(plugins_available_metadata) + self._plugins_showcase_model.setMetadata(plugins_showcase_metadata) + self._plugins_available_model.setMetadata(plugins_available_metadata) From d6630b68815781ba92edae3510aaf62cf77b4d0d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 14:09:55 +0100 Subject: [PATCH 011/199] Removed some more cases where data was duplicated and re-used for different purposes CURA-6006 --- plugins/Toolbox/src/Toolbox.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index ada81dbc07..f70543d5d7 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -69,16 +69,14 @@ class Toolbox(QObject, Extension): # The responses as given by the server parsed to a list. self._server_response_data = { "authors": [], - "packages": [], - "plugins_installed": [], - "materials_installed": [] + "packages": [] } # type: Dict[str, List[Any]] # Models: self._models = { "authors": AuthorsModel(self), "packages": PackagesModel(self), - } # type: Dict[str, ListModel] + } # type: Dict[str, Union[AuthorsModel, PackagesModel]] self._plugins_showcase_model = PackagesModel(self) self._plugins_available_model = PackagesModel(self) @@ -305,11 +303,9 @@ class Toolbox(QObject, Extension): if plugin_id not in all_plugin_package_ids) self._old_plugin_metadata = {k: v for k, v in self._old_plugin_metadata.items() if k in self._old_plugin_ids} - self._server_response_data["plugins_installed"] = all_packages["plugin"] + list(self._old_plugin_metadata.values()) - self._plugins_installed_model.setMetadata(self._server_response_data["plugins_installed"]) + self._plugins_installed_model.setMetadata(all_packages["plugin"] + list(self._old_plugin_metadata.values())) self.metadataChanged.emit() if "material" in all_packages: - self._server_response_data["materials_installed"] = all_packages["material"] self._materials_installed_model.setMetadata(all_packages["material"]) self.metadataChanged.emit() @@ -527,8 +523,8 @@ class Toolbox(QObject, Extension): @pyqtSlot(str, result = int) def getNumberOfInstalledPackagesByAuthor(self, author_id: str) -> int: count = 0 - for package in self._server_response_data["materials_installed"]: - if package["author"]["author_id"] == author_id: + for package in self._materials_installed_model.items: + if package["author_id"] == author_id: count += 1 return count From 00e95e68eb974e19ac3f6960b86965dd9ada8fbf Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 5 Dec 2018 14:26:47 +0100 Subject: [PATCH 012/199] Removed unneeded Marketplace tag in logging The logger does that all by itself already. CURA-6006 --- plugins/Toolbox/src/Toolbox.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index f70543d5d7..cd20d26eca 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -781,7 +781,7 @@ class Toolbox(QObject, Extension): @pyqtSlot(str, str, str) def filterModelByProp(self, model_type: str, filter_type: str, parameter: str) -> None: if not self._models[model_type]: - Logger.log("w", "Marketplace: Couldn't filter %s model because it doesn't exist.", model_type) + Logger.log("w", "Couldn't filter %s model because it doesn't exist.", model_type) return self._models[model_type].setFilter({filter_type: parameter}) self.filterChanged.emit() @@ -789,7 +789,7 @@ class Toolbox(QObject, Extension): @pyqtSlot(str, "QVariantMap") def setFilters(self, model_type: str, filter_dict: dict) -> None: if not self._models[model_type]: - Logger.log("w", "Marketplace: Couldn't filter %s model because it doesn't exist.", model_type) + Logger.log("w", "Couldn't filter %s model because it doesn't exist.", model_type) return self._models[model_type].setFilter(filter_dict) self.filterChanged.emit() @@ -797,7 +797,7 @@ class Toolbox(QObject, Extension): @pyqtSlot(str) def removeFilters(self, model_type: str) -> None: if not self._models[model_type]: - Logger.log("w", "Marketplace: Couldn't remove filters on %s model because it doesn't exist.", model_type) + Logger.log("w", "Couldn't remove filters on %s model because it doesn't exist.", model_type) return self._models[model_type].setFilter({}) self.filterChanged.emit() From 838949dac74831e38e9f07fe7d628af7807320db Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 09:45:27 +0100 Subject: [PATCH 013/199] Moved qml pages of toolbox to a loader This dramatically improves the loading of the toolbox dialog CURA-6006 --- plugins/Toolbox/resources/qml/Toolbox.qml | 54 ++++++++++----------- plugins/Toolbox/src/Toolbox.py | 59 +++++++++++------------ 2 files changed, 52 insertions(+), 61 deletions(-) diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index 853cec399d..d3d980b0b3 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -44,36 +44,31 @@ Window top: header.bottom bottom: footer.top } - // TODO: This could be improved using viewFilter instead of viewCategory - ToolboxLoadingPage + + Loader { - id: viewLoading - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "loading" - } - ToolboxErrorPage - { - id: viewErrored - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "errored" - } - ToolboxDownloadsPage - { - id: viewDownloads - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "overview" - } - ToolboxDetailPage - { - id: viewDetail - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "detail" - } - ToolboxAuthorPage - { - id: viewAuthor - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "author" - } - ToolboxInstalledPage - { - id: installedPluginList - visible: toolbox.viewCategory == "installed" + anchors.fill:parent + source: + { + if(toolbox.viewCategory == "installed") + { + return "ToolboxInstalledPage.qml" + } + + switch (toolbox.viewPage) + { + case "loading": + return "ToolboxLoadingPage.qml" + case "errored": + return "ToolboxErrorPage.qml" + case "overview": + return "ToolboxDownloadsPage.qml" + case "detail": + return "ToolboxDetailPage.qml" + case "author": + return "ToolboxAuthorPage.qml" + } + } } } @@ -95,6 +90,7 @@ Window licenseDialog.show(); } } + ToolboxLicenseDialog { id: licenseDialog diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index cd20d26eca..c8349827a9 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -622,44 +622,39 @@ class Toolbox(QObject, Extension): if reply.operation() == QNetworkAccessManager.GetOperation: for response_type, url in self._request_urls.items(): - if reply.url() == url: - if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) == 200: - try: - json_data = json.loads(bytes(reply.readAll()).decode("utf-8")) + if reply.url() != url: + continue - # Check for errors: - if "errors" in json_data: - for error in json_data["errors"]: - Logger.log("e", "%s", error["title"]) - return + if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) == 200: + try: + json_data = json.loads(bytes(reply.readAll()).decode("utf-8")) + except json.decoder.JSONDecodeError: + Logger.log("w", "Received invalid JSON for %s.", response_type) + break - # Create model and apply metadata: - if not self._models[response_type]: - Logger.log("e", "Could not find the %s model.", response_type) - break - - self._server_response_data[response_type] = json_data["data"] - self._models[response_type].setMetadata(self._server_response_data[response_type]) + # Check for errors: + if "errors" in json_data: + for error in json_data["errors"]: + Logger.log("e", "%s", error["title"]) + return - if response_type is "packages": - self._models[response_type].setFilter({"type": "plugin"}) - self.reBuildMaterialsModels() - self.reBuildPluginsModels() - elif response_type is "authors": - self._models[response_type].setFilter({"package_types": "material"}) - self._models[response_type].setFilter({"tags": "generic"}) + self._server_response_data[response_type] = json_data["data"] + self._models[response_type].setMetadata(json_data["data"]) - self.metadataChanged.emit() + if response_type is "packages": + self._models["packages"].setFilter({"type": "plugin"}) + self.reBuildMaterialsModels() + self.reBuildPluginsModels() + elif response_type is "authors": + self._models["authors"].setFilter({"tags": "generic"}) - if self.isLoadingComplete(): - self.setViewPage("overview") + self.metadataChanged.emit() - except json.decoder.JSONDecodeError: - Logger.log("w", "Received invalid JSON for %s.", response_type) - break - else: - self.setViewPage("errored") - self.resetDownload() + if self.isLoadingComplete(): + self.setViewPage("overview") + else: + self.setViewPage("errored") + self.resetDownload() else: # Ignore any operation that is not a get operation pass From 6a466c99b241035a6dc6d9cbbf174f39d51aad3d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 09:54:32 +0100 Subject: [PATCH 014/199] Make the progressButton use signals instead of functions Although the naming is still a bit off, it's much cleaner to use signals instead of functions. It's also more in line with how default QML components handle these kind of situations CURA-6006 --- plugins/Toolbox/resources/qml/Toolbox.qml | 2 +- .../qml/ToolboxDetailTileActions.qml | 23 ++++++++----------- .../qml/ToolboxInstalledTileActions.qml | 8 +++---- .../resources/qml/ToolboxProgressButton.qml | 12 +++++----- 4 files changed, 19 insertions(+), 26 deletions(-) diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index d3d980b0b3..b2bab4355a 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -90,7 +90,7 @@ Window licenseDialog.show(); } } - + ToolboxLicenseDialog { id: licenseDialog diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml index cd1e4cdbda..72a9d14dcd 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml @@ -18,19 +18,15 @@ Column id: installButton active: toolbox.isDownloading && toolbox.activePackage == model complete: installed - readyAction: function() + onReadyAction: { toolbox.activePackage = model toolbox.startDownload(model.download_url) } - activeAction: function() - { - toolbox.cancelDownload() - } - completeAction: function() - { - toolbox.viewCategory = "installed" - } + onActiveAction: toolbox.cancelDownload() + + onCompleteAction: toolbox.viewCategory = "installed" + // Don't allow installing while another download is running enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model) opacity: enabled ? 1.0 : 0.5 @@ -44,20 +40,19 @@ Column readyLabel: catalog.i18nc("@action:button", "Update") activeLabel: catalog.i18nc("@action:button", "Updating") completeLabel: catalog.i18nc("@action:button", "Updated") - readyAction: function() + + onReadyAction: { toolbox.activePackage = model toolbox.update(model.id) } - activeAction: function() - { - toolbox.cancelDownload() - } + onActiveAction: toolbox.cancelDownload() // Don't allow installing while another download is running enabled: !(toolbox.isDownloading && toolbox.activePackage != model) opacity: enabled ? 1.0 : 0.5 visible: canUpdate } + Connections { target: toolbox diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml index 8fd88b1cfd..621ecd96ea 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml @@ -30,15 +30,13 @@ Column readyLabel: catalog.i18nc("@action:button", "Update") activeLabel: catalog.i18nc("@action:button", "Updating") completeLabel: catalog.i18nc("@action:button", "Updated") - readyAction: function() + onReadyAction: { toolbox.activePackage = model toolbox.update(model.id) } - activeAction: function() - { - toolbox.cancelDownload() - } + onActiveAction: toolbox.cancelDownload() + // Don't allow installing while another download is running enabled: !(toolbox.isDownloading && toolbox.activePackage != model) opacity: enabled ? 1.0 : 0.5 diff --git a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml index 2744e40ec9..00b0b985f5 100644 --- a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml +++ b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml @@ -18,9 +18,9 @@ Item property var activeLabel: catalog.i18nc("@action:button", "Cancel") property var completeLabel: catalog.i18nc("@action:button", "Installed") - property var readyAction: null // Action when button is ready and clicked (likely install) - property var activeAction: null // Action when button is active and clicked (likely cancel) - property var completeAction: null // Action when button is complete and clicked (likely go to installed) + signal readyAction() // Action when button is ready and clicked (likely install) + signal activeAction() // Action when button is active and clicked (likely cancel) + signal completeAction() // Action when button is complete and clicked (likely go to installed) width: UM.Theme.getSize("toolbox_action_button").width height: UM.Theme.getSize("toolbox_action_button").height @@ -47,15 +47,15 @@ Item { if (complete) { - return completeAction() + completeAction() } else if (active) { - return activeAction() + activeAction() } else { - return readyAction() + readyAction() } } style: ButtonStyle From 2602d5bf02287745831d3d264bbc8e3dcda37541 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 10:46:19 +0100 Subject: [PATCH 015/199] Add changed checks to prevent unneeded signals from being fired CURA-6006 --- plugins/Toolbox/src/Toolbox.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index c8349827a9..68919cf987 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -546,7 +546,7 @@ class Toolbox(QObject, Extension): # Check for plugins that were installed with the old plugin browser def isOldPlugin(self, plugin_id: str) -> bool: - return plugin_id in self._old_plugin_ids + return plugin_id in self._old_plugin_ids def getOldPluginPackageMetadata(self, plugin_id: str) -> Optional[Dict[str, Any]]: return self._old_plugin_metadata.get(plugin_id) @@ -709,8 +709,9 @@ class Toolbox(QObject, Extension): return self._is_downloading def setActivePackage(self, package: Dict[str, Any]) -> None: - self._active_package = package - self.activePackageChanged.emit() + if self._active_package != package: + self._active_package = package + self.activePackageChanged.emit() ## The active package is the package that is currently being downloaded @pyqtProperty(QObject, fset = setActivePackage, notify = activePackageChanged) @@ -718,16 +719,18 @@ class Toolbox(QObject, Extension): return self._active_package def setViewCategory(self, category: str = "plugin") -> None: - self._view_category = category - self.viewChanged.emit() + if self._view_category != category: + self._view_category = category + self.viewChanged.emit() @pyqtProperty(str, fset = setViewCategory, notify = viewChanged) def viewCategory(self) -> str: return self._view_category def setViewPage(self, page: str = "overview") -> None: - self._view_page = page - self.viewChanged.emit() + if self._view_page != page: + self._view_page = page + self.viewChanged.emit() @pyqtProperty(str, fset = setViewPage, notify = viewChanged) def viewPage(self) -> str: From 84c85439ff4db4db77eecc1657fcd78634eca16e Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Thu, 6 Dec 2018 12:00:26 +0100 Subject: [PATCH 016/199] The trigger_early_crash did not trigger early crash for testing purposes CURA-5939 --- cura/CuraApplication.py | 6 ++++-- cura_app.py | 6 ------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 47cc94f972..dfdb50515f 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -181,7 +181,6 @@ class CuraApplication(QtApplication): # Variables set from CLI self._files_to_open = [] self._use_single_instance = False - self._trigger_early_crash = False # For debug only self._single_instance = None @@ -292,7 +291,10 @@ class CuraApplication(QtApplication): sys.exit(0) self._use_single_instance = self._cli_args.single_instance - self._trigger_early_crash = self._cli_args.trigger_early_crash + # FOR TESTING ONLY + if self._cli_args.trigger_early_crash: + assert not "This crash is triggered by the trigger_early_crash command line argument." + for filename in self._cli_args.file: self._files_to_open.append(os.path.abspath(filename)) diff --git a/cura_app.py b/cura_app.py index 164e32e738..8df12d771a 100755 --- a/cura_app.py +++ b/cura_app.py @@ -17,12 +17,6 @@ parser.add_argument("--debug", default = False, help = "Turn on the debug mode by setting this option." ) -parser.add_argument("--trigger-early-crash", - dest = "trigger_early_crash", - action = "store_true", - default = False, - help = "FOR TESTING ONLY. Trigger an early crash to show the crash dialog." - ) known_args = vars(parser.parse_known_args()[0]) if not known_args["debug"]: From e8cf9e034db4bf232f29171908e144d6455f0936 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Thu, 6 Dec 2018 13:41:50 +0100 Subject: [PATCH 017/199] Catch All Exception except: SystemExit, KeyboardInterrupt, GeneratorException CURA-5939 --- cura/CrashHandler.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index 46544ca0ef..d43743bc37 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -36,18 +36,14 @@ else: except ImportError: CuraDebugMode = False # [CodeStyle: Reflecting imported value] -# List of exceptions that should be considered "fatal" and abort the program. -# These are primarily some exception types that we simply cannot really recover from -# (MemoryError and SystemError) and exceptions that indicate grave errors in the -# code that cause the Python interpreter to fail (SyntaxError, ImportError). -fatal_exception_types = [ - MemoryError, - SyntaxError, - ImportError, - SystemError, +# List of exceptions that should not be considered "fatal" and abort the program. +# These are primarily some exception types that we simply skip +skip_exception_types = [ + SystemExit, + KeyboardInterrupt, + GeneratorExit ] - class CrashHandler: crash_url = "https://stats.ultimaker.com/api/cura" @@ -70,7 +66,7 @@ class CrashHandler: # If Cura has fully started, we only show fatal errors. # If Cura has not fully started yet, we always show the early crash dialog. Otherwise, Cura will just crash # without any information. - if has_started and exception_type not in fatal_exception_types: + if has_started and exception_type in skip_exception_types: return if not has_started: @@ -387,7 +383,7 @@ class CrashHandler: Application.getInstance().callLater(self._show) def _show(self): - # When the exception is not in the fatal_exception_types list, the dialog is not created, so we don't need to show it + # When the exception is in the skip_exception_types list, the dialog is not created, so we don't need to show it if self.dialog: self.dialog.exec_() os._exit(1) From 54def4edee6d743eaf43988a8b2568bebc8fee53 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 14:12:35 +0100 Subject: [PATCH 018/199] Revert "Moved qml pages of toolbox to a loader" This reverts commit 838949dac74831e38e9f07fe7d628af7807320db. --- plugins/Toolbox/resources/qml/Toolbox.qml | 55 +++++++++++---------- plugins/Toolbox/src/Toolbox.py | 59 ++++++++++++----------- 2 files changed, 62 insertions(+), 52 deletions(-) diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index b2bab4355a..7cc5a730f2 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -44,31 +44,36 @@ Window top: header.bottom bottom: footer.top } - - Loader + // TODO: This could be improved using viewFilter instead of viewCategory + ToolboxLoadingPage { - anchors.fill:parent - source: - { - if(toolbox.viewCategory == "installed") - { - return "ToolboxInstalledPage.qml" - } - - switch (toolbox.viewPage) - { - case "loading": - return "ToolboxLoadingPage.qml" - case "errored": - return "ToolboxErrorPage.qml" - case "overview": - return "ToolboxDownloadsPage.qml" - case "detail": - return "ToolboxDetailPage.qml" - case "author": - return "ToolboxAuthorPage.qml" - } - } + id: viewLoading + visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "loading" + } + ToolboxErrorPage + { + id: viewErrored + visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "errored" + } + ToolboxDownloadsPage + { + id: viewDownloads + visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "overview" + } + ToolboxDetailPage + { + id: viewDetail + visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "detail" + } + ToolboxAuthorPage + { + id: viewAuthor + visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "author" + } + ToolboxInstalledPage + { + id: installedPluginList + visible: toolbox.viewCategory == "installed" } } @@ -90,7 +95,7 @@ Window licenseDialog.show(); } } - + ToolboxLicenseDialog { id: licenseDialog diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 68919cf987..ef67dc3c86 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -622,39 +622,44 @@ class Toolbox(QObject, Extension): if reply.operation() == QNetworkAccessManager.GetOperation: for response_type, url in self._request_urls.items(): - if reply.url() != url: - continue + if reply.url() == url: + if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) == 200: + try: + json_data = json.loads(bytes(reply.readAll()).decode("utf-8")) - if reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) == 200: - try: - json_data = json.loads(bytes(reply.readAll()).decode("utf-8")) - except json.decoder.JSONDecodeError: - Logger.log("w", "Received invalid JSON for %s.", response_type) - break + # Check for errors: + if "errors" in json_data: + for error in json_data["errors"]: + Logger.log("e", "%s", error["title"]) + return - # Check for errors: - if "errors" in json_data: - for error in json_data["errors"]: - Logger.log("e", "%s", error["title"]) - return + # Create model and apply metadata: + if not self._models[response_type]: + Logger.log("e", "Could not find the %s model.", response_type) + break + + self._server_response_data[response_type] = json_data["data"] + self._models[response_type].setMetadata(self._server_response_data[response_type]) - self._server_response_data[response_type] = json_data["data"] - self._models[response_type].setMetadata(json_data["data"]) + if response_type is "packages": + self._models[response_type].setFilter({"type": "plugin"}) + self.reBuildMaterialsModels() + self.reBuildPluginsModels() + elif response_type is "authors": + self._models[response_type].setFilter({"package_types": "material"}) + self._models[response_type].setFilter({"tags": "generic"}) - if response_type is "packages": - self._models["packages"].setFilter({"type": "plugin"}) - self.reBuildMaterialsModels() - self.reBuildPluginsModels() - elif response_type is "authors": - self._models["authors"].setFilter({"tags": "generic"}) + self.metadataChanged.emit() - self.metadataChanged.emit() + if self.isLoadingComplete(): + self.setViewPage("overview") - if self.isLoadingComplete(): - self.setViewPage("overview") - else: - self.setViewPage("errored") - self.resetDownload() + except json.decoder.JSONDecodeError: + Logger.log("w", "Received invalid JSON for %s.", response_type) + break + else: + self.setViewPage("errored") + self.resetDownload() else: # Ignore any operation that is not a get operation pass From a77ad329993ae46799376689c4908de06292c801 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 14:35:07 +0100 Subject: [PATCH 019/199] Move all the seperate tiles into loaders instead of the entire page Otherwise the details selection didn't work anymore and I didn't want to add more hacks. CURA-6006 --- .../resources/qml/ToolboxDetailList.qml | 7 ++++++- .../resources/qml/ToolboxDownloadsGrid.qml | 10 ++++++---- .../qml/ToolboxDownloadsShowcase.qml | 19 +++++++++++-------- .../resources/qml/ToolboxInstalledPage.qml | 12 ++++++++++-- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml index 2e5eae098c..1700a58ebe 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml @@ -26,10 +26,15 @@ Item } height: childrenRect.height + 2 * UM.Theme.getSize("wide_margin").height spacing: UM.Theme.getSize("default_margin").height + Repeater { model: toolbox.packagesModel - delegate: ToolboxDetailTile {} + delegate: Loader + { + asynchronous: true + source: "ToolboxDetailTile.qml" + } } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml index c586828969..3e2643938b 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml @@ -24,7 +24,7 @@ Column color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") } - GridLayout + Grid { id: grid width: parent.width - 2 * parent.padding @@ -34,10 +34,12 @@ Column Repeater { model: gridArea.model - delegate: ToolboxDownloadsGridTile + delegate: Loader { - Layout.preferredWidth: (grid.width - (grid.columns - 1) * grid.columnSpacing) / grid.columns - Layout.preferredHeight: UM.Theme.getSize("toolbox_thumbnail_small").height + asynchronous: true + width: (grid.width - (grid.columns - 1) * grid.columnSpacing) / grid.columns + height: UM.Theme.getSize("toolbox_thumbnail_small").height + source: "ToolboxDownloadsGridTile.qml" } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml index 46f5debfdd..9851128076 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml @@ -30,23 +30,26 @@ Rectangle height: childrenRect.height spacing: UM.Theme.getSize("wide_margin").width columns: 3 - anchors - { - horizontalCenter: parent.horizontalCenter - } + anchors.horizontalCenter: parent.horizontalCenter + Repeater { - model: { - if ( toolbox.viewCategory == "plugin" ) + model: + { + if (toolbox.viewCategory == "plugin") { return toolbox.pluginsShowcaseModel } - if ( toolbox.viewCategory == "material" ) + if (toolbox.viewCategory == "material") { return toolbox.materialsShowcaseModel } } - delegate: ToolboxDownloadsShowcaseTile {} + delegate: Loader + { + asynchronous: true + source: "ToolboxDownloadsShowcaseTile.qml" + } } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index e683f89823..145e544b19 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -64,7 +64,11 @@ ScrollView { id: materialList model: toolbox.pluginsInstalledModel - delegate: ToolboxInstalledTile {} + delegate: Loader + { + asynchronous: true + source: "ToolboxInstalledTile.qml" + } } } } @@ -101,7 +105,11 @@ ScrollView { id: pluginList model: toolbox.materialsInstalledModel - delegate: ToolboxInstalledTile {} + delegate: Loader + { + asynchronous: true + source: "ToolboxInstalledTile.qml" + } } } } From 62c53989335d4d955be4bcb1ac07df234bbb2896 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 14:58:28 +0100 Subject: [PATCH 020/199] Change buttons to use either secondary or primary CURA-6006 --- .../resources/qml/ToolboxInstalledPage.qml | 12 +-- .../qml/ToolboxInstalledTileActions.qml | 42 ++------- .../resources/qml/ToolboxProgressButton.qml | 93 +------------------ 3 files changed, 16 insertions(+), 131 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index 145e544b19..e683f89823 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -64,11 +64,7 @@ ScrollView { id: materialList model: toolbox.pluginsInstalledModel - delegate: Loader - { - asynchronous: true - source: "ToolboxInstalledTile.qml" - } + delegate: ToolboxInstalledTile {} } } } @@ -105,11 +101,7 @@ ScrollView { id: pluginList model: toolbox.materialsInstalledModel - delegate: Loader - { - asynchronous: true - source: "ToolboxInstalledTile.qml" - } + delegate: ToolboxInstalledTile {} } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml index 621ecd96ea..eb3a93f274 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml @@ -6,6 +6,8 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM +import Cura 1.0 as Cura + Column { property bool canUpdate: false @@ -43,44 +45,18 @@ Column visible: canUpdate } - Button + Cura.SecondaryButton { id: removeButton text: canDowngrade ? catalog.i18nc("@action:button", "Downgrade") : catalog.i18nc("@action:button", "Uninstall") visible: !model.is_bundled && model.is_installed enabled: !toolbox.isDownloading - style: ButtonStyle - { - background: Rectangle - { - implicitWidth: UM.Theme.getSize("toolbox_action_button").width - implicitHeight: UM.Theme.getSize("toolbox_action_button").height - color: "transparent" - border - { - width: UM.Theme.getSize("default_lining").width - color: - { - if (control.hovered) - { - return UM.Theme.getColor("primary_hover") - } - else - { - return UM.Theme.getColor("lining") - } - } - } - } - label: Label - { - text: control.text - color: UM.Theme.getColor("text") - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - font: UM.Theme.getFont("default") - } - } + + width: UM.Theme.getSize("toolbox_action_button").width + height: UM.Theme.getSize("toolbox_action_button").height + + fixedWidthMode: true + onClicked: toolbox.checkPackageUsageAndUninstall(model.id) Connections { diff --git a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml index 00b0b985f5..0b574e8653 100644 --- a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml +++ b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml @@ -5,7 +5,7 @@ import QtQuick 2.2 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM - +import Cura 1.0 as Cura Item { @@ -25,9 +25,12 @@ Item width: UM.Theme.getSize("toolbox_action_button").width height: UM.Theme.getSize("toolbox_action_button").height - Button + Cura.PrimaryButton { id: button + width: UM.Theme.getSize("toolbox_action_button").width + height: UM.Theme.getSize("toolbox_action_button").height + fixedWidthMode: true text: { if (complete) @@ -58,92 +61,6 @@ Item readyAction() } } - style: ButtonStyle - { - background: Rectangle - { - implicitWidth: UM.Theme.getSize("toolbox_action_button").width - implicitHeight: UM.Theme.getSize("toolbox_action_button").height - color: - { - if (base.complete) - { - return "transparent" - } - else - { - if (control.hovered) - { - return UM.Theme.getColor("primary_hover") - } - else - { - return UM.Theme.getColor("primary") - } - } - } - border - { - width: - { - if (base.complete) - { - UM.Theme.getSize("default_lining").width - } - else - { - return 0 - } - } - color: - { - if (control.hovered) - { - return UM.Theme.getColor("primary_hover") - } - else - { - return UM.Theme.getColor("lining") - } - } - } - } - label: Label - { - text: control.text - color: - { - if (base.complete) - { - return UM.Theme.getColor("text") - } - else - { - if (control.hovered) - { - return UM.Theme.getColor("button_text_hover") - } - else - { - return UM.Theme.getColor("button_text") - } - } - } - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - font: - { - if (base.complete) - { - return UM.Theme.getFont("default") - } - else - { - return UM.Theme.getFont("default_bold") - } - } - } - } } AnimatedImage From 4e2ab163ed5dffec65a7328820e494434def97e5 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 16:24:12 +0100 Subject: [PATCH 021/199] Add login fequired link to packages that have the login-required tag CURA-6006 --- .../qml/ToolboxDetailTileActions.qml | 22 ++++++++++++++++++- plugins/Toolbox/src/PackagesModel.py | 2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml index 72a9d14dcd..8a11b402d2 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml @@ -5,11 +5,14 @@ import QtQuick 2.7 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM +import Cura 1.1 as Cura Column { property bool installed: toolbox.isInstalled(model.id) property bool canUpdate: toolbox.canUpdate(model.id) + property bool loginRequired: model.login_required && !Cura.API.account.isLoggedIn + width: UM.Theme.getSize("toolbox_action_button").width spacing: UM.Theme.getSize("narrow_margin").height @@ -28,11 +31,28 @@ Column onCompleteAction: toolbox.viewCategory = "installed" // Don't allow installing while another download is running - enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model) + enabled: installed || (!(toolbox.isDownloading && toolbox.activePackage != model) && !loginRequired) opacity: enabled ? 1.0 : 0.5 visible: !updateButton.visible // Don't show when the update button is visible } + + Label + { + wrapMode: Text.WordWrap + text:"Log in is required to install" + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + linkColor: UM.Theme.getColor("text_link") + visible: loginRequired + width: installButton.width + MouseArea + { + anchors.fill: parent + onClicked:Cura.API.account.login() + } + } + ToolboxProgressButton { id: updateButton diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py index f941804653..bcc02955a2 100644 --- a/plugins/Toolbox/src/PackagesModel.py +++ b/plugins/Toolbox/src/PackagesModel.py @@ -40,6 +40,7 @@ class PackagesModel(ListModel): self.addRoleName(Qt.UserRole + 19, "tags") self.addRoleName(Qt.UserRole + 20, "links") self.addRoleName(Qt.UserRole + 21, "website") + self.addRoleName(Qt.UserRole + 22, "login_required") # List of filters for queries. The result is the union of the each list of results. self._filter = {} # type: Dict[str, str] @@ -100,6 +101,7 @@ class PackagesModel(ListModel): "tags": package["tags"] if "tags" in package else [], "links": links_dict, "website": package["website"] if "website" in package else None, + "login_required": "login-required" in package.get("tags", []) }) # Filter on all the key-word arguments. From 4b8e3c32cbd46ef2f4ff63ca6a53654d2c22b0ec Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 16:37:47 +0100 Subject: [PATCH 022/199] Also show the login required if an update is needed CURA-6006 --- plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml index 8a11b402d2..37d9bce4c5 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml @@ -40,7 +40,7 @@ Column Label { wrapMode: Text.WordWrap - text:"Log in is required to install" + text: catalog.i18nc("@label:The string between and is the highlighted link", "Log in is required to install or update") font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") @@ -49,7 +49,7 @@ Column MouseArea { anchors.fill: parent - onClicked:Cura.API.account.login() + onClicked: Cura.API.account.login() } } @@ -68,7 +68,7 @@ Column } onActiveAction: toolbox.cancelDownload() // Don't allow installing while another download is running - enabled: !(toolbox.isDownloading && toolbox.activePackage != model) + enabled: !(toolbox.isDownloading && toolbox.activePackage != model) && !loginRequired opacity: enabled ? 1.0 : 0.5 visible: canUpdate } From 717fb260c15b2364e28d2de6ab4200d2c148a697 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 16:58:01 +0100 Subject: [PATCH 023/199] Change toolbox tabs to controls2 CURA-6006 --- .../resources/qml/ToolboxTabButton.qml | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxTabButton.qml b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml index b671d779f8..fa4f75d6fe 100644 --- a/plugins/Toolbox/resources/qml/ToolboxTabButton.qml +++ b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml @@ -2,50 +2,49 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.0 import UM 1.1 as UM Button { + id: control property bool active: false - style: ButtonStyle + hoverEnabled: true + + background: Item { - background: Rectangle + implicitWidth: UM.Theme.getSize("toolbox_header_tab").width + implicitHeight: UM.Theme.getSize("toolbox_header_tab").height + Rectangle { - color: "transparent" - implicitWidth: UM.Theme.getSize("toolbox_header_tab").width - implicitHeight: UM.Theme.getSize("toolbox_header_tab").height - Rectangle - { - visible: control.active - color: UM.Theme.getColor("toolbox_header_highlight_hover") - anchors.bottom: parent.bottom - width: parent.width - height: UM.Theme.getSize("toolbox_header_highlight").height - } - } - label: Label - { - text: control.text - color: - { - if(control.hovered) - { - return UM.Theme.getColor("toolbox_header_button_text_hovered"); - } - if(control.active) - { - return UM.Theme.getColor("toolbox_header_button_text_active"); - } - else - { - return UM.Theme.getColor("toolbox_header_button_text_inactive"); - } - } - font: control.enabled ? (control.active ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium")) : UM.Theme.getFont("default_italic") - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter + visible: control.active + color: UM.Theme.getColor("primary") + anchors.bottom: parent.bottom + width: parent.width + height: UM.Theme.getSize("toolbox_header_highlight").height } } -} + contentItem: Label + { + id: label + text: control.text + color: + { + if(control.hovered) + { + return UM.Theme.getColor("toolbox_header_button_text_hovered"); + } + if(control.active) + { + return UM.Theme.getColor("toolbox_header_button_text_active"); + } + else + { + return UM.Theme.getColor("toolbox_header_button_text_inactive"); + } + } + font: control.enabled ? (control.active ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium")) : UM.Theme.getFont("default_italic") + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } +} \ No newline at end of file From 2c9c9d8c962607311488a9a14526fb286de543a9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 17:23:02 +0100 Subject: [PATCH 024/199] Handle non-happy path for downloading CURA-6006 --- plugins/Toolbox/src/Toolbox.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index ef67dc3c86..ab975548ce 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -671,6 +671,11 @@ class Toolbox(QObject, Extension): if bytes_sent == bytes_total: self.setIsDownloading(False) cast(QNetworkReply, self._download_reply).downloadProgress.disconnect(self._onDownloadProgress) + + # Check if the download was sucessfull + if self._download_reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) != 200: + Logger.log("w", "Failed to download package. The following error was returned: %s", json.loads(bytes(self._download_reply.readAll()).decode("utf-8"))) + return # Must not delete the temporary file on Windows self._temp_plugin_file = tempfile.NamedTemporaryFile(mode = "w+b", suffix = ".curapackage", delete = False) file_path = self._temp_plugin_file.name From d4a255c9e5779c8131ebb9743a5adf472530f99f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 17:35:58 +0100 Subject: [PATCH 025/199] Also add the login required label at the installed plugin list CURA-6006 --- .../qml/ToolboxDetailTileActions.qml | 1 - .../qml/ToolboxInstalledTileActions.qml | 21 +++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml index 37d9bce4c5..cc32ff032d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml @@ -36,7 +36,6 @@ Column visible: !updateButton.visible // Don't show when the update button is visible } - Label { wrapMode: Text.WordWrap diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml index eb3a93f274..39528f6437 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml @@ -6,12 +6,13 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM -import Cura 1.0 as Cura +import Cura 1.1 as Cura Column { property bool canUpdate: false property bool canDowngrade: false + property bool loginRequired: model.login_required && !Cura.API.account.isLoggedIn width: UM.Theme.getSize("toolbox_action_button").width spacing: UM.Theme.getSize("narrow_margin").height @@ -40,11 +41,27 @@ Column onActiveAction: toolbox.cancelDownload() // Don't allow installing while another download is running - enabled: !(toolbox.isDownloading && toolbox.activePackage != model) + enabled: !(toolbox.isDownloading && toolbox.activePackage != model) && !loginRequired opacity: enabled ? 1.0 : 0.5 visible: canUpdate } + Label + { + wrapMode: Text.WordWrap + text: catalog.i18nc("@label:The string between and is the highlighted link", "Log in is required to update") + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + linkColor: UM.Theme.getColor("text_link") + visible: loginRequired + width: updateButton.width + MouseArea + { + anchors.fill: parent + onClicked: Cura.API.account.login() + } + } + Cura.SecondaryButton { id: removeButton From eddf4e7f3d96296576e8124fcfd3a86e01adf7e3 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 6 Dec 2018 19:38:12 +0100 Subject: [PATCH 026/199] Simplify QML --- .../resources/qml/ToolboxInstalledPage.qml | 33 +++++++------------ 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index e683f89823..738cdde323 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -21,44 +21,39 @@ ScrollView Column { spacing: UM.Theme.getSize("default_margin").height + visible: toolbox.pluginsInstalledModel.items.length > 0 + height: childrenRect.height + 4 * UM.Theme.getSize("default_margin").height + anchors { right: parent.right left: parent.left - leftMargin: UM.Theme.getSize("wide_margin").width - topMargin: UM.Theme.getSize("wide_margin").height - bottomMargin: UM.Theme.getSize("wide_margin").height + margins: UM.Theme.getSize("default_margin").width top: parent.top } - height: childrenRect.height + 4 * UM.Theme.getSize("default_margin").height + Label { - visible: toolbox.pluginsInstalledModel.items.length > 0 - width: parent.width + width: page.width text: catalog.i18nc("@title:tab", "Plugins") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") } Rectangle { - visible: toolbox.pluginsInstalledModel.items.length > 0 color: "transparent" width: parent.width - height: childrenRect.height + 1 * UM.Theme.getSize("default_lining").width + height: childrenRect.height + UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width Column { - height: childrenRect.height anchors { top: parent.top right: parent.right left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width - rightMargin: UM.Theme.getSize("default_margin").width - topMargin: UM.Theme.getSize("default_lining").width - bottomMargin: UM.Theme.getSize("default_lining").width + margins: UM.Theme.getSize("default_margin").width } Repeater { @@ -70,32 +65,26 @@ ScrollView } Label { - visible: toolbox.materialsInstalledModel.items.length > 0 - width: page.width text: catalog.i18nc("@title:tab", "Materials") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") } + Rectangle { - visible: toolbox.materialsInstalledModel.items.length > 0 color: "transparent" width: parent.width - height: childrenRect.height + 1 * UM.Theme.getSize("default_lining").width + height: childrenRect.height + UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width Column { - height: Math.max( UM.Theme.getSize("wide_margin").height, childrenRect.height) anchors { top: parent.top right: parent.right left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width - rightMargin: UM.Theme.getSize("default_margin").width - topMargin: UM.Theme.getSize("default_lining").width - bottomMargin: UM.Theme.getSize("default_lining").width + margins: UM.Theme.getSize("default_margin").width } Repeater { From b33ce7a50f891165fe71e964815804e2a9427f6a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 09:35:08 +0100 Subject: [PATCH 027/199] Fix alignment of download grid tile CURA-6006 --- plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 887140bbfa..d6eedbcde5 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -63,6 +63,8 @@ Item { width: parent.width - thumbnail.width - parent.spacing spacing: Math.floor(UM.Theme.getSize("narrow_margin").width) + anchors.top: parent.top + anchors.topMargin: UM.Theme.getSize("default_margin").height Label { id: name From 2a0954f24683066f28698b03b261721fc02847b0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 09:35:53 +0100 Subject: [PATCH 028/199] Gracefully handle the conectionError when logging in --- cura/OAuth2/AuthorizationHelpers.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cura/OAuth2/AuthorizationHelpers.py b/cura/OAuth2/AuthorizationHelpers.py index f75ad9c9f9..762d0db069 100644 --- a/cura/OAuth2/AuthorizationHelpers.py +++ b/cura/OAuth2/AuthorizationHelpers.py @@ -81,9 +81,14 @@ class AuthorizationHelpers: # \param access_token: The encoded JWT token. # \return: Dict containing some profile data. def parseJWT(self, access_token: str) -> Optional["UserProfile"]: - token_request = requests.get("{}/check-token".format(self._settings.OAUTH_SERVER_URL), headers = { - "Authorization": "Bearer {}".format(access_token) - }) + try: + token_request = requests.get("{}/check-token".format(self._settings.OAUTH_SERVER_URL), headers = { + "Authorization": "Bearer {}".format(access_token) + }) + except ConnectionError: + # Connection was suddenly dropped. Nothing we can do about that. + Logger.logException("e", "Something failed while attempting to parse the JWT token") + return None if token_request.status_code not in (200, 201): Logger.log("w", "Could not retrieve token data from auth server: %s", token_request.text) return None From 9eb09132d66d989120d7002b212bbcd4f5816fa3 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 09:38:02 +0100 Subject: [PATCH 029/199] Fix minor layout issue installed page CURA-6006 --- plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index 738cdde323..3d5cd1c8d4 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -43,7 +43,7 @@ ScrollView { color: "transparent" width: parent.width - height: childrenRect.height + UM.Theme.getSize("default_lining").width + height: childrenRect.height + UM.Theme.getSize("default_margin").width border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width Column @@ -74,7 +74,7 @@ ScrollView { color: "transparent" width: parent.width - height: childrenRect.height + UM.Theme.getSize("default_lining").width + height: childrenRect.height + UM.Theme.getSize("default_margin").width border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width Column From eaf413997d0c5ca4b317a0d65b5aef5c44131627 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 09:44:09 +0100 Subject: [PATCH 030/199] Changed the installed button to be a secondary button CURA-6006 --- .../qml/ToolboxDetailTileActions.qml | 40 ++++++++++++------- .../resources/qml/ToolboxProgressButton.qml | 1 + 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml index cc32ff032d..848acfbf4f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml @@ -16,24 +16,36 @@ Column width: UM.Theme.getSize("toolbox_action_button").width spacing: UM.Theme.getSize("narrow_margin").height - ToolboxProgressButton + Item { - id: installButton - active: toolbox.isDownloading && toolbox.activePackage == model - complete: installed - onReadyAction: + width: installButton.width + height: installButton.height + ToolboxProgressButton { - toolbox.activePackage = model - toolbox.startDownload(model.download_url) + id: installButton + active: toolbox.isDownloading && toolbox.activePackage == model + onReadyAction: + { + toolbox.activePackage = model + toolbox.startDownload(model.download_url) + } + onActiveAction: toolbox.cancelDownload() + + // Don't allow installing while another download is running + enabled: installed || (!(toolbox.isDownloading && toolbox.activePackage != model) && !loginRequired) + opacity: enabled ? 1.0 : 0.5 + visible: !updateButton.visible && !installed// Don't show when the update button is visible } - onActiveAction: toolbox.cancelDownload() - onCompleteAction: toolbox.viewCategory = "installed" - - // Don't allow installing while another download is running - enabled: installed || (!(toolbox.isDownloading && toolbox.activePackage != model) && !loginRequired) - opacity: enabled ? 1.0 : 0.5 - visible: !updateButton.visible // Don't show when the update button is visible + Cura.SecondaryButton + { + visible: installed + onClicked: toolbox.viewCategory = "installed" + text: catalog.i18nc("@action:button", "Installed") + fixedWidthMode: true + width: installButton.width + height: installButton.height + } } Label diff --git a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml index 0b574e8653..3ca18a52ed 100644 --- a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml +++ b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml @@ -7,6 +7,7 @@ import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM import Cura 1.0 as Cura +// TODO; This is in quite some need for refactoring. Item { id: base From 43a06fdc3d85e618534297d967c560cdc9783c08 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Dec 2018 13:49:17 +0100 Subject: [PATCH 031/199] Add more margin above printer type labels A bit of Gestalt. Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/ConfigurationListView.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index e7936b69d2..53969a0370 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -64,11 +64,12 @@ Column section.criteria: ViewSection.FullString section.delegate: Item { - height: printerTypeLabel.height + UM.Theme.getSize("default_margin").height + height: printerTypeLabel.height + UM.Theme.getSize("default_margin").height * 2 //Causes a default margin above the label and a default margin below the label. Cura.PrinterTypeLabel { id: printerTypeLabel text: Cura.MachineManager.getAbbreviatedMachineName(section) + anchors.verticalCenter: parent.verticalCenter //One default margin above and one below. } } From c44b74454f927714f891c254024e95679982ef20 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Dec 2018 14:22:39 +0100 Subject: [PATCH 032/199] Revert "No longer make BuildVolume set max bounds." This reverts commit 1467e703ae121c3f2fa02ee7258bdeba63f80c5c. This variable was actually used... In Uranium, by the scale tiny models feature. --- cura/BuildVolume.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 1589f16afc..f837f5cef7 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -479,6 +479,8 @@ class BuildVolume(SceneNode): maximum = Vector(max_w - bed_adhesion_size - 1, max_h - self._raft_thickness - self._extra_z_clearance, max_d - disallowed_area_size + bed_adhesion_size - 1) ) + self._application.getController().getScene()._maximum_bounds = scale_to_max_bounds + self.updateNodeBoundaryCheck() def getBoundingBox(self) -> AxisAlignedBox: From 8e2c130416ecdf1adf21bc8d5388588442f6f6c7 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Dec 2018 14:31:06 +0100 Subject: [PATCH 033/199] Use default lining style as separator for buildplate Normal colour, normal thickness. Contributes to issue CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 6ac1e6a2ad..05cac16e29 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -72,8 +72,8 @@ Button right: parent.right rightMargin: parent.padding } - height: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0 - color: UM.Theme.getColor("text") + height: visible ? Math.round(UM.Theme.getSize("default_lining").height / 2) : 0 + color: UM.Theme.getColor("lining") } Item From c663681e66a42b63b1e831a1dbf967e6043f563b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Dec 2018 14:39:43 +0100 Subject: [PATCH 034/199] Simplify buildplate icon Removed all unnecessary crap added by Sketch. Contributes to issue CURA-5876. --- .../themes/cura-light/icons/buildplate.svg | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/resources/themes/cura-light/icons/buildplate.svg b/resources/themes/cura-light/icons/buildplate.svg index 9e61296958..d844b91a28 100644 --- a/resources/themes/cura-light/icons/buildplate.svg +++ b/resources/themes/cura-light/icons/buildplate.svg @@ -1,17 +1,9 @@ - - - icn_buildplate - Created with Sketch. - - - - - - - - - - + + + + + + \ No newline at end of file From 78df27369f1cc423fc3e369d22da6115fba43560 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Dec 2018 14:41:30 +0100 Subject: [PATCH 035/199] Fill buildplate icon This is according to our newest designs. Contributes to issue CURA-5876. --- resources/themes/cura-light/icons/buildplate.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/icons/buildplate.svg b/resources/themes/cura-light/icons/buildplate.svg index d844b91a28..7505c8204e 100644 --- a/resources/themes/cura-light/icons/buildplate.svg +++ b/resources/themes/cura-light/icons/buildplate.svg @@ -4,6 +4,6 @@ - + \ No newline at end of file From ffcac04f9e1bb595bc30a33ba0d9aeb327b7c45d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Dec 2018 15:21:53 +0100 Subject: [PATCH 036/199] Add printer type selector if connected to cluster If there are 2 or more printer types in your connected cluster, you can switch the printer type here. Contributes to issue CURA-5876. --- .../ConfigurationMenu/CustomConfiguration.qml | 49 ++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 78f6864c97..8429e2c093 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -36,10 +36,57 @@ Item } } + //Printer type selector. + Item + { + id: printerTypeSelectorRow + visible: + { + return Cura.MachineManager.printerOutputDevices.length >= 1 //If connected... + && Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount != null //...and we have configuration information... + && Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount.length > 1; //...and there is more than one type of printer in the configuration list. + } + height: visible ? childrenRect.height : 0 + + anchors + { + left: parent.left + leftMargin: UM.Theme.getSize("default_margin").width + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width + top: header.bottom + topMargin: visible ? UM.Theme.getSize("default_margin").height : 0 + } + + Label + { + text: catalog.i18nc("@label", "Printer") + width: Math.round(parent.width * 0.3) - UM.Theme.getSize("default_margin").width + height: contentHeight + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + anchors.verticalCenter: printerTypeSelector.verticalCenter + anchors.left: parent.left + } + + OldControls.ToolButton + { + id: printerTypeSelector + text: Cura.MachineManager.activeMachineDefinitionName + tooltip: Cura.MachineManager.activeMachineDefinitionName + height: UM.Theme.getSize("setting_control").height + width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width + anchors.right: parent.right + style: UM.Theme.styles.print_setup_header_button + + menu: Cura.PrinterTypeMenu { } + } + } + UM.TabRow { id: tabBar - anchors.top: header.bottom + anchors.top: printerTypeSelectorRow.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height visible: extrudersModel.count > 1 From 6a7bbe5bdb46c3f6db301097d30e472f3b45702e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Dec 2018 15:31:12 +0100 Subject: [PATCH 037/199] Fix hiding materials if material is empty Because the loaded material profile has the name 'Empty' then. Contributes to issue CURA-5876. --- .../qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml index 885f02d740..a344e31d4f 100644 --- a/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/PrintCoreConfiguration.qml @@ -20,7 +20,7 @@ Row { materialColor: printCoreConfiguration.material.color anchors.verticalCenter: parent.verticalCenter - extruderEnabled: printCoreConfiguration.material.name !== "" && printCoreConfiguration.hotendID !== "" + extruderEnabled: printCoreConfiguration.material.brand !== "" && printCoreConfiguration.hotendID !== "" } Column @@ -36,7 +36,7 @@ Row } Label { - text: printCoreConfiguration.material.name ? printCoreConfiguration.material.name : " " //Use space so that the height is still correct. + text: printCoreConfiguration.material.brand ? printCoreConfiguration.material.name : " " //Use space so that the height is still correct. renderType: Text.NativeRendering elide: Text.ElideRight font: UM.Theme.getFont("default") From f4220da550ff4f5c65787b54f413415ac4dce73e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 15:31:33 +0100 Subject: [PATCH 038/199] Adds rough first version of rating stars It's not fully polished just yet CURA-6013 --- cura/API/Account.py | 2 +- .../Toolbox/resources/qml/RatingWidget.qml | 101 ++++++++++++++++++ .../qml/ToolboxDownloadsGridTile.qml | 10 ++ plugins/Toolbox/src/PackagesModel.py | 8 +- plugins/Toolbox/src/Toolbox.py | 53 ++++++--- .../themes/cura-light/icons/star_empty.svg | 11 ++ .../themes/cura-light/icons/star_filled.svg | 11 ++ resources/themes/cura-light/theme.json | 1 + 8 files changed, 180 insertions(+), 17 deletions(-) create mode 100644 plugins/Toolbox/resources/qml/RatingWidget.qml create mode 100644 resources/themes/cura-light/icons/star_empty.svg create mode 100644 resources/themes/cura-light/icons/star_filled.svg diff --git a/cura/API/Account.py b/cura/API/Account.py index 397e220478..be77a6307b 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -44,7 +44,7 @@ class Account(QObject): OAUTH_SERVER_URL= self._oauth_root, CALLBACK_PORT=self._callback_port, CALLBACK_URL="http://localhost:{}/callback".format(self._callback_port), - CLIENT_ID="um---------------ultimaker_cura_drive_plugin", + CLIENT_ID="um----------------------------ultimaker_cura", CLIENT_SCOPES="account.user.read drive.backup.read drive.backup.write packages.download packages.rating.read packages.rating.write", AUTH_DATA_PREFERENCE_KEY="general/ultimaker_auth_data", AUTH_SUCCESS_REDIRECT="{}/app/auth-success".format(self._oauth_root), diff --git a/plugins/Toolbox/resources/qml/RatingWidget.qml b/plugins/Toolbox/resources/qml/RatingWidget.qml new file mode 100644 index 0000000000..424f6c91c4 --- /dev/null +++ b/plugins/Toolbox/resources/qml/RatingWidget.qml @@ -0,0 +1,101 @@ +import QtQuick 2.2 +import QtQuick.Controls 2.0 +import UM 1.0 as UM + +Item +{ + id: ratingWidget + + property real rating: 0 + property int indexHovered: -1 + property string packageId: "" + property int numRatings: 0 + property int userRating: 0 + width: contentRow.width + height: contentRow.height + MouseArea + { + id: mouseArea + anchors.fill: parent + hoverEnabled: ratingWidget.enabled + acceptedButtons: Qt.NoButton + onExited: + { + ratingWidget.indexHovered = -1 + } + + Row + { + id: contentRow + height: childrenRect.height + Repeater + { + model: 5 // We need to get 5 stars + Button + { + id: control + hoverEnabled: true + onHoveredChanged: + { + if(hovered) + { + indexHovered = index + } + } + + property bool isStarFilled: + { + // If the entire widget is hovered, override the actual rating. + if(ratingWidget.indexHovered >= 0) + { + return indexHovered >= index + } + + if(ratingWidget.userRating > 0) + { + return userRating >= index +1 + } + + return rating >= index + 1 + } + + contentItem: Item {} + height: UM.Theme.getSize("rating_star").height + width: UM.Theme.getSize("rating_star").width + background: UM.RecolorImage + { + source: UM.Theme.getIcon(control.isStarFilled ? "star_filled" : "star_empty") + + // Unfilled stars should always have the default color. Only filled stars should change on hover + color: + { + if(!enabled) + { + return "#5a5a5a" + } + if((ratingWidget.indexHovered >= 0 || ratingWidget.userRating > 0) && isStarFilled) + { + return UM.Theme.getColor("primary") + } + return "#5a5a5a" + } + } + onClicked: + { + if(userRating == 0) + { + //User didn't vote yet, locally fake it + numRatings += 1 + } + userRating = index + 1 // Fake local data + toolbox.ratePackage(ratingWidget.packageId, index + 1) + } + } + } + Label + { + text: "(" + numRatings + ")" + } + } + } +} \ No newline at end of file diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index cee3f0fd20..a72411ef4b 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -84,6 +84,16 @@ Item color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("default") } + + RatingWidget + { + visible: model.type == "plugin" + packageId: model.id + rating: model.average_rating != undefined ? model.average_rating : 0 + numRatings: model.num_ratings != undefined ? model.num_ratings : 0 + userRating: model.user_rating + enabled: installedPackages != 0 + } } } MouseArea diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py index bcc02955a2..b3c388bc7c 100644 --- a/plugins/Toolbox/src/PackagesModel.py +++ b/plugins/Toolbox/src/PackagesModel.py @@ -41,6 +41,9 @@ class PackagesModel(ListModel): self.addRoleName(Qt.UserRole + 20, "links") self.addRoleName(Qt.UserRole + 21, "website") self.addRoleName(Qt.UserRole + 22, "login_required") + self.addRoleName(Qt.UserRole + 23, "average_rating") + self.addRoleName(Qt.UserRole + 24, "num_ratings") + self.addRoleName(Qt.UserRole + 25, "user_rating") # List of filters for queries. The result is the union of the each list of results. self._filter = {} # type: Dict[str, str] @@ -101,7 +104,10 @@ class PackagesModel(ListModel): "tags": package["tags"] if "tags" in package else [], "links": links_dict, "website": package["website"] if "website" in package else None, - "login_required": "login-required" in package.get("tags", []) + "login_required": "login-required" in package.get("tags", []), + "average_rating": package.get("rating", {}).get("average", 0), + "num_ratings": package.get("rating", {}).get("count", 0), + "user_rating": package.get("rating", {}).get("user", 0) }) # Filter on all the key-word arguments. diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index ab975548ce..7e35f5d1f4 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -22,7 +22,8 @@ from cura.CuraApplication import CuraApplication from .AuthorsModel import AuthorsModel from .PackagesModel import PackagesModel - +from cura.CuraVersion import CuraVersion +from cura.API import CuraAPI if TYPE_CHECKING: from cura.Settings.GlobalStack import GlobalStack @@ -50,17 +51,10 @@ class Toolbox(QObject, Extension): self._download_progress = 0 # type: float self._is_downloading = False # type: bool self._network_manager = None # type: Optional[QNetworkAccessManager] - self._request_header = [ - b"User-Agent", - str.encode( - "%s/%s (%s %s)" % ( - self._application.getApplicationName(), - self._application.getVersion(), - platform.system(), - platform.machine(), - ) - ) - ] + self._request_headers = [] # type: List[Tuple(bytes, bytes)] + self._updateRequestHeader() + + self._request_urls = {} # type: Dict[str, QUrl] self._to_update = [] # type: List[str] # Package_ids that are waiting to be updated self._old_plugin_ids = set() # type: Set[str] @@ -115,6 +109,7 @@ class Toolbox(QObject, Extension): self._restart_dialog_message = "" # type: str self._application.initializationFinished.connect(self._onAppInitialized) + self._application.getCuraAPI().account.loginStateChanged.connect(self._updateRequestHeader) # Signals: # -------------------------------------------------------------------------- @@ -134,12 +129,38 @@ class Toolbox(QObject, Extension): showLicenseDialog = pyqtSignal() uninstallVariablesChanged = pyqtSignal() + def _updateRequestHeader(self): + self._request_headers = [ + (b"User-Agent", + str.encode( + "%s/%s (%s %s)" % ( + self._application.getApplicationName(), + self._application.getVersion(), + platform.system(), + platform.machine(), + ) + )) + ] + access_token = self._application.getCuraAPI().account.accessToken + if access_token: + self._request_headers.append((b"Authorization", "Bearer {}".format(access_token).encode())) + def _resetUninstallVariables(self) -> None: self._package_id_to_uninstall = None # type: Optional[str] self._package_name_to_uninstall = "" self._package_used_materials = [] # type: List[Tuple[GlobalStack, str, str]] self._package_used_qualities = [] # type: List[Tuple[GlobalStack, str, str]] + @pyqtSlot(str, int) + def ratePackage(self, package_id: str, rating: int) -> None: + url = QUrl("{base_url}/packages/{package_id}/ratings".format(base_url=self._api_url, package_id = package_id)) + + self._rate_request = QNetworkRequest(url) + for header_name, header_value in self._request_headers: + cast(QNetworkRequest, self._rate_request).setRawHeader(header_name, header_value) + data = "{\"data\": {\"cura_version\": \"%s\", \"rating\": %i}}" % (Version(CuraVersion), rating) + self._rate_reply = cast(QNetworkAccessManager, self._network_manager).put(self._rate_request, data.encode()) + @pyqtSlot(result = str) def getLicenseDialogPluginName(self) -> str: return self._license_dialog_plugin_name @@ -563,7 +584,8 @@ class Toolbox(QObject, Extension): def _makeRequestByType(self, request_type: str) -> None: Logger.log("i", "Requesting %s metadata from server.", request_type) request = QNetworkRequest(self._request_urls[request_type]) - request.setRawHeader(*self._request_header) + for header_name, header_value in self._request_headers: + request.setRawHeader(header_name, header_value) if self._network_manager: self._network_manager.get(request) @@ -578,7 +600,8 @@ class Toolbox(QObject, Extension): if hasattr(QNetworkRequest, "RedirectPolicyAttribute"): # Patch for Qt 5.9+ cast(QNetworkRequest, self._download_request).setAttribute(QNetworkRequest.RedirectPolicyAttribute, True) - cast(QNetworkRequest, self._download_request).setRawHeader(*self._request_header) + for header_name, header_value in self._request_headers: + cast(QNetworkRequest, self._download_request).setRawHeader(header_name, header_value) self._download_reply = cast(QNetworkAccessManager, self._network_manager).get(self._download_request) self.setDownloadProgress(0) self.setIsDownloading(True) @@ -660,7 +683,7 @@ class Toolbox(QObject, Extension): else: self.setViewPage("errored") self.resetDownload() - else: + elif reply.operation() == QNetworkAccessManager.PutOperation: # Ignore any operation that is not a get operation pass diff --git a/resources/themes/cura-light/icons/star_empty.svg b/resources/themes/cura-light/icons/star_empty.svg new file mode 100644 index 0000000000..39b5791e91 --- /dev/null +++ b/resources/themes/cura-light/icons/star_empty.svg @@ -0,0 +1,11 @@ + + + + Star Copy 8 + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/resources/themes/cura-light/icons/star_filled.svg b/resources/themes/cura-light/icons/star_filled.svg new file mode 100644 index 0000000000..d4e161f6c6 --- /dev/null +++ b/resources/themes/cura-light/icons/star_filled.svg @@ -0,0 +1,11 @@ + + + + Star Copy 7 + Created with Sketch. + + + + + + \ No newline at end of file diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 2d7e92be4d..8d8f5dd718 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -394,6 +394,7 @@ "section": [0.0, 2.2], "section_icon": [1.6, 1.6], "section_icon_column": [2.8, 0.0], + "rating_star": [1.0, 1.0], "setting": [25.0, 1.8], "setting_control": [10.0, 2.0], From 8b25e6946adb3ea763fc25f22c3226e557d4c8bd Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 15:33:44 +0100 Subject: [PATCH 039/199] Prevent attempting to rate when not logged in CURA-6013 --- plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index a72411ef4b..283d9bc0aa 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -6,6 +6,7 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 import UM 1.1 as UM +import Cura 1.1 as Cura Item { @@ -92,7 +93,7 @@ Item rating: model.average_rating != undefined ? model.average_rating : 0 numRatings: model.num_ratings != undefined ? model.num_ratings : 0 userRating: model.user_rating - enabled: installedPackages != 0 + enabled: installedPackages != 0 && Cura.API.account.isLoggedIn } } } From b565b111c873dd3804f2ce50193c5836850c7fe9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Dec 2018 15:38:08 +0100 Subject: [PATCH 040/199] Adjust disabled extruder colour This also introduces a more global 'disabled' colour as defined by the style guide. I hope that we can gradually transition to this one, but we'll have to adjust some colours here and there. Contributes to issue CURA-5876. --- resources/qml/ExtruderIcon.qml | 2 +- resources/themes/cura-dark/theme.json | 1 + resources/themes/cura-light/theme.json | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index 49ad73a32e..bb0b347b7e 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -23,7 +23,7 @@ Item anchors.fill: parent source: UM.Theme.getIcon("extruder_button") - color: extruderEnabled ? materialColor: "gray" + color: extruderEnabled ? materialColor: UM.Theme.getColor("disabled") } Rectangle diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index d9ef74ebb9..8540abf61a 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -35,6 +35,7 @@ "text_scene_hover": [255, 255, 255, 204], "error": [212, 31, 53, 255], + "disabled": [32, 32, 32, 255], "button": [39, 44, 48, 255], "button_hover": [39, 44, 48, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 16d13b9652..d4fb59b7a1 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -129,6 +129,7 @@ "error": [255, 140, 0, 255], "warning": [245, 166, 35, 255], + "disabled": [229, 229, 229, 255], "toolbar_button_text": [8, 7, 63, 255], "toolbar_button_hover": [232, 242, 252, 255], From fed9e2b623fcc2085a8343c479946cc4edc43c2c Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 15:42:46 +0100 Subject: [PATCH 041/199] Move the click area of the download tile to just the icon CURA-6013 --- .../qml/ToolboxDownloadsGridTile.qml | 81 +++++++++---------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 283d9bc0aa..472f273817 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -58,13 +58,49 @@ Item color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") source: "../images/installed_check.svg" } + + MouseArea + { + anchors.fill: thumbnail + hoverEnabled: true + onEntered: thumbnail.border.color = UM.Theme.getColor("primary") + onExited: thumbnail.border.color = UM.Theme.getColor("lining") + onClicked: + { + base.selection = model + switch(toolbox.viewCategory) + { + case "material": + + // If model has a type, it must be a package + if (model.type !== undefined) + { + toolbox.viewPage = "detail" + toolbox.filterModelByProp("packages", "id", model.id) + } + else + { + toolbox.viewPage = "author" + toolbox.setFilters("packages", { + "author_id": model.id, + "type": "material" + }) + } + break + default: + toolbox.viewPage = "detail" + toolbox.filterModelByProp("packages", "id", model.id) + break + } + } + } } Column { width: parent.width - thumbnail.width - parent.spacing spacing: Math.floor(UM.Theme.getSize("narrow_margin").width) anchors.top: parent.top - anchors.topMargin: UM.Theme.getSize("default_margin").height + //anchors.topMargin: UM.Theme.getSize("default_margin").height Label { id: name @@ -97,47 +133,4 @@ Item } } } - MouseArea - { - anchors.fill: parent - hoverEnabled: true - onEntered: - { - thumbnail.border.color = UM.Theme.getColor("primary") - highlight.opacity = 0.1 - } - onExited: - { - thumbnail.border.color = UM.Theme.getColor("lining") - highlight.opacity = 0.0 - } - onClicked: - { - base.selection = model - switch(toolbox.viewCategory) - { - case "material": - - // If model has a type, it must be a package - if (model.type !== undefined) - { - toolbox.viewPage = "detail" - toolbox.filterModelByProp("packages", "id", model.id) - } - else - { - toolbox.viewPage = "author" - toolbox.setFilters("packages", { - "author_id": model.id, - "type": "material" - }) - } - break - default: - toolbox.viewPage = "detail" - toolbox.filterModelByProp("packages", "id", model.id) - break - } - } - } } From 4742db6fec2a82aa5e8d5bc95c764d0ce9d69e0b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 15:57:52 +0100 Subject: [PATCH 042/199] Cleanup gridTile CURA-6013 --- .../qml/ToolboxDownloadsGridTile.qml | 209 +++++++++--------- 1 file changed, 104 insertions(+), 105 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 472f273817..7ced23aee9 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -13,124 +13,123 @@ Item id: toolboxDownloadsGridTile property int packageCount: (toolbox.viewCategory == "material" && model.type === undefined) ? toolbox.getTotalNumberOfMaterialPackagesByAuthor(model.id) : 1 property int installedPackages: (toolbox.viewCategory == "material" && model.type === undefined) ? toolbox.getNumberOfInstalledPackagesByAuthor(model.id) : (toolbox.isInstalled(model.id) ? 1 : 0) - height: childrenRect.height + height: UM.Theme.getSize("toolbox_thumbnail_small").height Layout.alignment: Qt.AlignTop | Qt.AlignLeft + Rectangle { - id: highlight - anchors.fill: parent - opacity: 0.0 - color: UM.Theme.getColor("primary") - } - Row - { - width: parent.width - height: childrenRect.height - spacing: Math.floor(UM.Theme.getSize("narrow_margin").width) - Rectangle + id: thumbnail + width: UM.Theme.getSize("toolbox_thumbnail_small").width + height: UM.Theme.getSize("toolbox_thumbnail_small").height + color: "white" + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("lining") + + Image { - id: thumbnail - width: UM.Theme.getSize("toolbox_thumbnail_small").width - height: UM.Theme.getSize("toolbox_thumbnail_small").height - color: "white" - border.width: UM.Theme.getSize("default_lining").width - border.color: UM.Theme.getColor("lining") - Image - { - anchors.centerIn: parent - width: UM.Theme.getSize("toolbox_thumbnail_small").width - UM.Theme.getSize("wide_margin").width - height: UM.Theme.getSize("toolbox_thumbnail_small").height - UM.Theme.getSize("wide_margin").width - fillMode: Image.PreserveAspectFit - source: model.icon_url || "../images/logobot.svg" - mipmap: true - } - UM.RecolorImage - { - width: (parent.width * 0.4) | 0 - height: (parent.height * 0.4) | 0 - anchors - { - bottom: parent.bottom - right: parent.right - } - sourceSize.height: height - visible: installedPackages != 0 - color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") - source: "../images/installed_check.svg" - } + anchors.centerIn: parent + width: UM.Theme.getSize("toolbox_thumbnail_small").width - UM.Theme.getSize("wide_margin").width + height: UM.Theme.getSize("toolbox_thumbnail_small").height - UM.Theme.getSize("wide_margin").width + fillMode: Image.PreserveAspectFit + source: model.icon_url || "../images/logobot.svg" + mipmap: true - MouseArea - { - anchors.fill: thumbnail - hoverEnabled: true - onEntered: thumbnail.border.color = UM.Theme.getColor("primary") - onExited: thumbnail.border.color = UM.Theme.getColor("lining") - onClicked: - { - base.selection = model - switch(toolbox.viewCategory) - { - case "material": - // If model has a type, it must be a package - if (model.type !== undefined) - { - toolbox.viewPage = "detail" - toolbox.filterModelByProp("packages", "id", model.id) - } - else - { - toolbox.viewPage = "author" - toolbox.setFilters("packages", { - "author_id": model.id, - "type": "material" - }) - } - break - default: + } + UM.RecolorImage + { + width: (parent.width * 0.4) | 0 + height: (parent.height * 0.4) | 0 + anchors + { + bottom: parent.bottom + right: parent.right + } + sourceSize.height: height + visible: installedPackages != 0 + color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") + source: "../images/installed_check.svg" + } + + MouseArea + { + anchors.fill: thumbnail + hoverEnabled: true + onEntered: thumbnail.border.color = UM.Theme.getColor("primary") + onExited: thumbnail.border.color = UM.Theme.getColor("lining") + onClicked: + { + base.selection = model + switch(toolbox.viewCategory) + { + case "material": + + // If model has a type, it must be a package + if (model.type !== undefined) + { toolbox.viewPage = "detail" toolbox.filterModelByProp("packages", "id", model.id) - break - } + } + else + { + toolbox.viewPage = "author" + toolbox.setFilters("packages", { + "author_id": model.id, + "type": "material" + }) + } + break + default: + toolbox.viewPage = "detail" + toolbox.filterModelByProp("packages", "id", model.id) + break } } } - Column + } + Item + { + anchors { - width: parent.width - thumbnail.width - parent.spacing - spacing: Math.floor(UM.Theme.getSize("narrow_margin").width) - anchors.top: parent.top - //anchors.topMargin: UM.Theme.getSize("default_margin").height - Label - { - id: name - text: model.name - width: parent.width - wrapMode: Text.WordWrap - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("default_bold") - } - Label - { - id: info - text: model.description - maximumLineCount: 2 - elide: Text.ElideRight - width: parent.width - wrapMode: Text.WordWrap - color: UM.Theme.getColor("text_medium") - font: UM.Theme.getFont("default") - } + left: thumbnail.right + leftMargin: Math.floor(UM.Theme.getSize("narrow_margin").width) + right: parent.right + top: parent.top + bottom: parent.bottom + } - RatingWidget - { - visible: model.type == "plugin" - packageId: model.id - rating: model.average_rating != undefined ? model.average_rating : 0 - numRatings: model.num_ratings != undefined ? model.num_ratings : 0 - userRating: model.user_rating - enabled: installedPackages != 0 && Cura.API.account.isLoggedIn - } + Label + { + id: name + text: model.name + width: parent.width + elide: Text.ElideRight + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("default_bold") + } + Label + { + id: info + text: model.description + elide: Text.ElideRight + width: parent.width + wrapMode: Text.WordWrap + color: UM.Theme.getColor("text_medium") + font: UM.Theme.getFont("default") + anchors.top: name.bottom + anchors.bottom: rating.top + verticalAlignment: Text.AlignVCenter + } + RatingWidget + { + id: rating + visible: model.type == "plugin" + packageId: model.id + rating: model.average_rating != undefined ? model.average_rating : 0 + numRatings: model.num_ratings != undefined ? model.num_ratings : 0 + userRating: model.user_rating + enabled: installedPackages != 0 && Cura.API.account.isLoggedIn + anchors.bottom: parent.bottom } } } From 50099ab7530da3d307426c4b069ef621fd9654b6 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 16:02:21 +0100 Subject: [PATCH 043/199] Make a few missed items themeable as well CURA-6013 --- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 2 +- plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 9e2e178b71..4e0bf67544 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -37,7 +37,7 @@ Item leftMargin: UM.Theme.getSize("wide_margin").width topMargin: UM.Theme.getSize("wide_margin").height } - color: "white" //Always a white background for image (regardless of theme). + color: UM.Theme.getColor("main_background") Image { anchors.fill: parent diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 7ced23aee9..70edee7449 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -21,7 +21,7 @@ Item id: thumbnail width: UM.Theme.getSize("toolbox_thumbnail_small").width height: UM.Theme.getSize("toolbox_thumbnail_small").height - color: "white" + color: UM.Theme.getColor("main_background") border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") From e92bd01fb28d460facdd5f0e7883267a25379aeb Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 7 Dec 2018 17:28:42 +0100 Subject: [PATCH 044/199] Removed the rating from the download grid It felt a bit weird to already have it in the grid layout CURA-6013 --- .../qml/ToolboxDownloadsGridTile.qml | 112 +++++++++++------- plugins/Toolbox/src/PackagesModel.py | 2 +- 2 files changed, 67 insertions(+), 47 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 70edee7449..677e532827 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -16,6 +16,42 @@ Item height: UM.Theme.getSize("toolbox_thumbnail_small").height Layout.alignment: Qt.AlignTop | Qt.AlignLeft + MouseArea + { + anchors.fill: parent + hoverEnabled: true + onEntered: thumbnail.border.color = UM.Theme.getColor("primary") + onExited: thumbnail.border.color = UM.Theme.getColor("lining") + onClicked: + { + base.selection = model + switch(toolbox.viewCategory) + { + case "material": + + // If model has a type, it must be a package + if (model.type !== undefined) + { + toolbox.viewPage = "detail" + toolbox.filterModelByProp("packages", "id", model.id) + } + else + { + toolbox.viewPage = "author" + toolbox.setFilters("packages", { + "author_id": model.id, + "type": "material" + }) + } + break + default: + toolbox.viewPage = "detail" + toolbox.filterModelByProp("packages", "id", model.id) + break + } + } + } + Rectangle { id: thumbnail @@ -33,8 +69,6 @@ Item fillMode: Image.PreserveAspectFit source: model.icon_url || "../images/logobot.svg" mipmap: true - - } UM.RecolorImage { @@ -50,42 +84,6 @@ Item color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") source: "../images/installed_check.svg" } - - MouseArea - { - anchors.fill: thumbnail - hoverEnabled: true - onEntered: thumbnail.border.color = UM.Theme.getColor("primary") - onExited: thumbnail.border.color = UM.Theme.getColor("lining") - onClicked: - { - base.selection = model - switch(toolbox.viewCategory) - { - case "material": - - // If model has a type, it must be a package - if (model.type !== undefined) - { - toolbox.viewPage = "detail" - toolbox.filterModelByProp("packages", "id", model.id) - } - else - { - toolbox.viewPage = "author" - toolbox.setFilters("packages", { - "author_id": model.id, - "type": "material" - }) - } - break - default: - toolbox.viewPage = "detail" - toolbox.filterModelByProp("packages", "id", model.id) - break - } - } - } } Item { @@ -119,17 +117,39 @@ Item anchors.top: name.bottom anchors.bottom: rating.top verticalAlignment: Text.AlignVCenter + maximumLineCount: 2 } - RatingWidget + Row { id: rating - visible: model.type == "plugin" - packageId: model.id - rating: model.average_rating != undefined ? model.average_rating : 0 - numRatings: model.num_ratings != undefined ? model.num_ratings : 0 - userRating: model.user_rating - enabled: installedPackages != 0 && Cura.API.account.isLoggedIn - anchors.bottom: parent.bottom + height: UM.Theme.getSize("rating_star").height + visible: model.average_rating > 0 //Has a rating at all. + spacing: UM.Theme.getSize("thick_lining").width + anchors + { + bottom: parent.bottom + left: parent.left + right: parent.right + } + + UM.RecolorImage + { + id: starIcon + source: UM.Theme.getIcon("star_filled") + color: "#5a5a5a" + height: UM.Theme.getSize("rating_star").height + width: UM.Theme.getSize("rating_star").width + } + + Label + { + text: model.average_rating.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")" + verticalAlignment: Text.AlignVCenter + height: starIcon.height + anchors.verticalCenter: starIcon.verticalCenter + color: starIcon.color + font: UM.Theme.getFont("small") + } } } } diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py index b3c388bc7c..3f5be3bc37 100644 --- a/plugins/Toolbox/src/PackagesModel.py +++ b/plugins/Toolbox/src/PackagesModel.py @@ -105,7 +105,7 @@ class PackagesModel(ListModel): "links": links_dict, "website": package["website"] if "website" in package else None, "login_required": "login-required" in package.get("tags", []), - "average_rating": package.get("rating", {}).get("average", 0), + "average_rating": float(package.get("rating", {}).get("average", 0)), "num_ratings": package.get("rating", {}).get("count", 0), "user_rating": package.get("rating", {}).get("user", 0) }) From 9dc8450db0aa3ba21b969f787a29a6fe775058f2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Dec 2018 17:37:10 +0100 Subject: [PATCH 045/199] Fix typo --- .../Recommended/RecommendedQualityProfileSelector.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml index 4963f10792..15d40f545a 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml @@ -350,7 +350,7 @@ Item enabled: !Cura.SimpleModeSettingsManager.isProfileUserCreated onEntered: { - var tooltipContent = catalog.i18nc("@tooltip", "This quality profile is not available for you current material and nozzle configuration. Please change these to enable this quality profile") + var tooltipContent = catalog.i18nc("@tooltip", "This quality profile is not available for your current material and nozzle configuration. Please change these to enable this quality profile") base.showTooltip(qualityRow, Qt.point(-UM.Theme.getSize("thick_margin").width, customisedSettings.height), tooltipContent) } onExited: base.hideTooltip() From 9e7a52e28bd783876ae8255fc3648f4dbb7fcc4e Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 09:43:50 +0100 Subject: [PATCH 046/199] Update the background color for the expandable component when using the close button. Contributes to CURA-5941. --- resources/qml/ExpandableComponent.qml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 3a03740251..4170a0942e 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -71,7 +71,15 @@ Item function toggleContent() { - content.visible = !content.visible + content.visible = !expanded + } + + // Add this binding since the background color is not updated otherwise + Binding + { + target: background + property: "color" + value: expanded ? headerActiveColor : headerBackgroundColor } implicitHeight: 100 * screenScaleFactor @@ -82,7 +90,7 @@ Item id: background property real padding: UM.Theme.getSize("default_margin").width - color: headerBackgroundColor + color: expanded ? headerActiveColor : headerBackgroundColor anchors.fill: parent Loader From 04f3601c2711426ac5b363ad51e03d468492506f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Dec 2018 09:54:26 +0100 Subject: [PATCH 047/199] Ensure that local votes are displayed right away So even before an update is received, ensure that the data is updated CURA-6013 --- .../Toolbox/resources/qml/RatingWidget.qml | 29 +++++++++++++------ .../resources/qml/ToolboxDetailPage.qml | 18 ++++++++++++ 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/plugins/Toolbox/resources/qml/RatingWidget.qml b/plugins/Toolbox/resources/qml/RatingWidget.qml index 424f6c91c4..b7d07835e8 100644 --- a/plugins/Toolbox/resources/qml/RatingWidget.qml +++ b/plugins/Toolbox/resources/qml/RatingWidget.qml @@ -9,8 +9,16 @@ Item property real rating: 0 property int indexHovered: -1 property string packageId: "" + property int numRatings: 0 + + // If the widget was used to vote, but the vote isn't sent to remote yet, we do want to fake some things. + property int _numRatings: _localRating != 0 ? numRatings + 1 : numRatings + property int _localRating: 0 + onVisibleChanged: _localRating = 0 // Reset the _localRating + property int userRating: 0 + width: contentRow.width height: contentRow.height MouseArea @@ -50,7 +58,10 @@ Item { return indexHovered >= index } - + if(ratingWidget._localRating > 0) + { + return _localRating >= index +1 + } if(ratingWidget.userRating > 0) { return userRating >= index +1 @@ -73,7 +84,7 @@ Item { return "#5a5a5a" } - if((ratingWidget.indexHovered >= 0 || ratingWidget.userRating > 0) && isStarFilled) + if((ratingWidget.indexHovered >= 0 || ratingWidget.userRating > 0 || ratingWidget._localRating > 0) && isStarFilled) { return UM.Theme.getColor("primary") } @@ -82,19 +93,19 @@ Item } onClicked: { - if(userRating == 0) - { - //User didn't vote yet, locally fake it - numRatings += 1 - } - userRating = index + 1 // Fake local data + // Ensure that the local rating is updated (even though it's not on the server just yet) + _localRating = index + 1 toolbox.ratePackage(ratingWidget.packageId, index + 1) } } } Label { - text: "(" + numRatings + ")" + text: "(" + _numRatings + ")" + verticalAlignment: Text.AlignVCenter + height: parent.height + color: "#5a5a5a" + font: UM.Theme.getFont("small") } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 4e0bf67544..dd3f0a6c84 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -6,6 +6,8 @@ import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM +import Cura 1.1 as Cura + Item { id: page @@ -103,6 +105,12 @@ Item font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") } + Label + { + text: catalog.i18nc("@label", "Rating") + ":" + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text_medium") + } } Column { @@ -160,6 +168,16 @@ Item font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") } + RatingWidget + { + id: rating + visible: details.type == "plugin" + packageId: details.id + rating: details.average_rating + numRatings: details.num_ratings + userRating: details.user_rating + enabled: toolbox.isInstalled(details.id) && Cura.API.account.isLoggedIn + } } Rectangle { From 8cfb9350bc2931224d4be597c3650c0b808e4e2c Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 10:36:55 +0100 Subject: [PATCH 048/199] Add a mouse area to gather the scroll events in the settings panel Contributes to CURA-5941. --- resources/qml/Settings/SettingView.qml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 3f84296307..9904770281 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -168,8 +168,10 @@ Item style: ButtonStyle { - background: Item { - UM.RecolorImage { + background: Item + { + UM.RecolorImage + { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter width: UM.Theme.getSize("standard_arrow").width @@ -180,8 +182,9 @@ Item source: UM.Theme.getIcon("menu") } } - label: Label{} + label: Label {} } + menu: SettingVisibilityPresetsMenu { onShowAllSettings: @@ -192,6 +195,14 @@ Item } } + // Mouse area that gathers the scroll events to not propagate it to the main view. + MouseArea + { + anchors.fill: scrollView + acceptedButtons: Qt.AllButtons + onWheel: wheel.accepted = true + } + ScrollView { id: scrollView From 098adc45ff6464f14e6ba8c2be2deec2df17bb75 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Dec 2018 10:40:54 +0100 Subject: [PATCH 049/199] Move the rating logic outside of the rating widget That way it's easier to re-use the component if that's ever required. CURA-6013 --- plugins/Toolbox/resources/qml/RatingWidget.qml | 7 +++++-- .../Toolbox/resources/qml/ToolboxDetailPage.qml | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/RatingWidget.qml b/plugins/Toolbox/resources/qml/RatingWidget.qml index b7d07835e8..f1499b61a7 100644 --- a/plugins/Toolbox/resources/qml/RatingWidget.qml +++ b/plugins/Toolbox/resources/qml/RatingWidget.qml @@ -19,6 +19,8 @@ Item property int userRating: 0 + signal rated(int rating) + width: contentRow.width height: contentRow.height MouseArea @@ -94,8 +96,9 @@ Item onClicked: { // Ensure that the local rating is updated (even though it's not on the server just yet) - _localRating = index + 1 - toolbox.ratePackage(ratingWidget.packageId, index + 1) + //_localRating = index + 1 + rated(index + 1) + } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index dd3f0a6c84..a503a9d519 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -177,6 +177,21 @@ Item numRatings: details.num_ratings userRating: details.user_rating enabled: toolbox.isInstalled(details.id) && Cura.API.account.isLoggedIn + + onRated: + { + toolbox.ratePackage(details.id, rating) + var index = toolbox.packagesModel.find("id", details.id) + if(index != -1) + { + // Found the package + toolbox.packagesModel.setProperty(index, "user_rating", rating) + toolbox.packagesModel.setProperty(index, "num_ratings", details.num_ratings + 1) + + // Hack; This is because the current selection is an outdated copy, so we need to re-copy it. + base.selection = toolbox.packagesModel.getItem(index) + } + } } } Rectangle From 99f0e9613144ceebb30159cc8fc73c6bff25f0e3 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Dec 2018 11:01:55 +0100 Subject: [PATCH 050/199] Ensure that the local model is updated correctly on local vote CURA-6013 --- .../Toolbox/resources/qml/RatingWidget.qml | 22 +++----------- .../resources/qml/ToolboxDetailPage.qml | 29 +++++++++++++++---- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/plugins/Toolbox/resources/qml/RatingWidget.qml b/plugins/Toolbox/resources/qml/RatingWidget.qml index f1499b61a7..fbe782b2e2 100644 --- a/plugins/Toolbox/resources/qml/RatingWidget.qml +++ b/plugins/Toolbox/resources/qml/RatingWidget.qml @@ -12,11 +12,6 @@ Item property int numRatings: 0 - // If the widget was used to vote, but the vote isn't sent to remote yet, we do want to fake some things. - property int _numRatings: _localRating != 0 ? numRatings + 1 : numRatings - property int _localRating: 0 - onVisibleChanged: _localRating = 0 // Reset the _localRating - property int userRating: 0 signal rated(int rating) @@ -60,10 +55,7 @@ Item { return indexHovered >= index } - if(ratingWidget._localRating > 0) - { - return _localRating >= index +1 - } + if(ratingWidget.userRating > 0) { return userRating >= index +1 @@ -86,25 +78,19 @@ Item { return "#5a5a5a" } - if((ratingWidget.indexHovered >= 0 || ratingWidget.userRating > 0 || ratingWidget._localRating > 0) && isStarFilled) + if((ratingWidget.indexHovered >= 0 || ratingWidget.userRating > 0) && isStarFilled) { return UM.Theme.getColor("primary") } return "#5a5a5a" } } - onClicked: - { - // Ensure that the local rating is updated (even though it's not on the server just yet) - //_localRating = index + 1 - rated(index + 1) - - } + onClicked: rated(index + 1) // Notify anyone who cares about this. } } Label { - text: "(" + _numRatings + ")" + text: "(" + numRatings + ")" verticalAlignment: Text.AlignVCenter height: parent.height color: "#5a5a5a" diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index a503a9d519..51bb218293 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -181,15 +181,34 @@ Item onRated: { toolbox.ratePackage(details.id, rating) - var index = toolbox.packagesModel.find("id", details.id) + // HACK: This is a far from optimal solution, but without major refactoring, this is the best we can + // do. Since a rework of this is scheduled, it shouldn't live that long... + var index = toolbox.pluginsAvailableModel.find("id", details.id) if(index != -1) { - // Found the package - toolbox.packagesModel.setProperty(index, "user_rating", rating) - toolbox.packagesModel.setProperty(index, "num_ratings", details.num_ratings + 1) + if(details.user_rating == 0) // User never rated before. + { + toolbox.pluginsAvailableModel.setProperty(index, "num_ratings", details.num_ratings + 1) + } + + toolbox.pluginsAvailableModel.setProperty(index, "user_rating", rating) + // Hack; This is because the current selection is an outdated copy, so we need to re-copy it. - base.selection = toolbox.packagesModel.getItem(index) + base.selection = toolbox.pluginsAvailableModel.getItem(index) + return + } + index = toolbox.pluginsShowcaseModel.find("id", details.id) + if(index != -1) + { + if(details.user_rating == 0) // User never rated before. + { + toolbox.pluginsShowcaseModel.setProperty(index, "user_rating", rating) + } + toolbox.pluginsShowcaseModel.setProperty(index, "num_ratings", details.num_ratings + 1) + + // Hack; This is because the current selection is an outdated copy, so we need to re-copy it. + base.selection = toolbox.pluginsShowcaseModel.getItem(index) } } } From 82322d857554b3685394dbee40485c59a973cf02 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Dec 2018 11:12:25 +0100 Subject: [PATCH 051/199] Show that a downloaded plugin has a user rating or not CURA-6013 --- plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 677e532827..f34d982cfb 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -136,14 +136,16 @@ Item { id: starIcon source: UM.Theme.getIcon("star_filled") - color: "#5a5a5a" + color: model.user_rating == 0 ? "#5a5a5a" : UM.Theme.getColor("primary") height: UM.Theme.getSize("rating_star").height width: UM.Theme.getSize("rating_star").width } Label { - text: model.average_rating.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")" + // If the user voted, show that value. Otherwsie show the average rating. + property real ratingtoUse: model.user_rating == 0 ? model.average_rating: model.user_rating + text: ratingtoUse.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")" verticalAlignment: Text.AlignVCenter height: starIcon.height anchors.verticalCenter: starIcon.verticalCenter From 12522c929372c06ec55731ec381fed3f84bd2f8d Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 11:19:44 +0100 Subject: [PATCH 052/199] Change hover colors of the small buttons. Contributes to CURA-5941 --- .../PrintSetupSelectorContents.qml | 4 ++-- resources/qml/Settings/SettingView.qml | 2 +- resources/qml/ViewOrientationButton.qml | 1 - resources/themes/cura-light/theme.json | 14 +++++++------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml index 47d25edd54..7cd03ff74a 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml @@ -74,6 +74,7 @@ Item id: closeButton width: UM.Theme.getSize("message_close").width height: UM.Theme.getSize("message_close").height + hoverEnabled: true anchors { @@ -86,8 +87,7 @@ Item { anchors.fill: parent sourceSize.width: width - sourceSize.height: width - color: UM.Theme.getColor("message_text") + color: closeButton.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") source: UM.Theme.getIcon("cross1") } diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 9904770281..c1b4b28d1d 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -178,7 +178,7 @@ Item height: UM.Theme.getSize("standard_arrow").height sourceSize.width: width sourceSize.height: height - color: control.enabled ? UM.Theme.getColor("setting_category_text") : UM.Theme.getColor("setting_category_disabled_text") + color: control.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") source: UM.Theme.getIcon("menu") } } diff --git a/resources/qml/ViewOrientationButton.qml b/resources/qml/ViewOrientationButton.qml index 682fd71b4e..5371f8549b 100644 --- a/resources/qml/ViewOrientationButton.qml +++ b/resources/qml/ViewOrientationButton.qml @@ -9,7 +9,6 @@ UM.SimpleButton { width: UM.Theme.getSize("small_button").width height: UM.Theme.getSize("small_button").height - hoverBackgroundColor: UM.Theme.getColor("small_button_hover") hoverColor: UM.Theme.getColor("small_button_text_hover") color: UM.Theme.getColor("small_button_text") iconMargin: 0.5 * UM.Theme.getSize("wide_lining").width diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index d4fb59b7a1..0ef6c24bfb 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -80,7 +80,7 @@ "primary_hover": [48, 182, 231, 255], "primary_text": [255, 255, 255, 255], "border": [127, 127, 127, 255], - "secondary": [245, 245, 245, 255], + "secondary": [240, 240, 240, 255], "secondary_shadow": [216, 216, 216, 255], "primary_button": [38, 113, 231, 255], @@ -150,7 +150,7 @@ "small_button_active": [10, 8, 80, 255], "small_button_active_hover": [10, 8, 80, 255], "small_button_text": [102, 102, 102, 255], - "small_button_text_hover": [255, 255, 255, 255], + "small_button_text_hover": [8, 7, 63, 255], "small_button_text_active": [255, 255, 255, 255], "small_button_text_active_hover": [255, 255, 255, 255], @@ -183,18 +183,18 @@ "scrollbar_handle_hover": [50, 130, 255, 255], "scrollbar_handle_down": [50, 130, 255, 255], - "setting_category": [245, 245, 245, 255], + "setting_category": [240, 240, 240, 255], "setting_category_disabled": [255, 255, 255, 255], "setting_category_hover": [232, 242, 252, 255], - "setting_category_active": [245, 245, 245, 255], + "setting_category_active": [240, 240, 240, 255], "setting_category_active_hover": [232, 242, 252, 255], "setting_category_text": [35, 35, 35, 255], "setting_category_disabled_text": [24, 41, 77, 101], "setting_category_hover_text": [35, 35, 35, 255], "setting_category_active_text": [35, 35, 35, 255], "setting_category_active_hover_text": [35, 35, 35, 255], - "setting_category_border": [245, 245, 245, 255], - "setting_category_disabled_border": [245, 245, 245, 255], + "setting_category_border": [240, 240, 240, 255], + "setting_category_disabled_border": [240, 240, 240, 255], "setting_category_hover_border": [50, 130, 255, 255], "setting_category_active_border": [50, 130, 255, 255], "setting_category_active_hover_border": [50, 130, 255, 255], @@ -274,7 +274,7 @@ "z_axis": [0, 255, 0, 255], "all_axis": [255, 255, 255, 255], - "viewport_background": [245, 245, 245, 255], + "viewport_background": [250, 250, 250, 255], "volume_outline": [50, 130, 255, 255], "buildplate": [244, 244, 244, 255], "buildplate_grid": [129, 131, 134, 255], From 021c44862752905999fdd0aaf9fac3130cb3e5b2 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 11:31:18 +0100 Subject: [PATCH 053/199] Remove depreciated monitor tab stuff Contributes to CL-1152 --- .../resources/qml/PrintCoreConfiguration.qml | 121 ----- .../resources/qml/PrintJobInfoBlock.qml | 505 ------------------ .../resources/qml/PrintJobPreview.qml | 75 --- .../resources/qml/PrintJobTitle.qml | 59 -- .../resources/qml/PrinterCard.qml | 241 --------- .../resources/qml/PrinterCardDetails.qml | 75 --- .../resources/qml/PrinterCardProgressBar.qml | 108 ---- .../resources/qml/PrinterFamilyPill.qml | 32 -- .../resources/qml/PrinterInfoBlock.qml | 83 --- 9 files changed, 1299 deletions(-) delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/PrintCoreConfiguration.qml delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/PrintJobPreview.qml delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/PrintJobTitle.qml delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/PrinterCard.qml delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/PrinterCardDetails.qml delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/PrinterCardProgressBar.qml delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/PrinterFamilyPill.qml delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/PrinterInfoBlock.qml diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintCoreConfiguration.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintCoreConfiguration.qml deleted file mode 100644 index 7bcd9ce6e4..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintCoreConfiguration.qml +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 -import UM 1.2 as UM - -Item { - id: extruderInfo; - property var printCoreConfiguration: null; - height: childrenRect.height; - width: Math.round(parent.width / 2); - - // Extruder circle - Item { - id: extruderCircle; - height: UM.Theme.getSize("monitor_extruder_circle").height; - width: UM.Theme.getSize("monitor_extruder_circle").width; - - // Loading skeleton - Rectangle { - anchors.fill: parent; - color: UM.Theme.getColor("monitor_skeleton_fill"); - radius: Math.round(width / 2); - visible: !printCoreConfiguration; - } - - // Actual content - Rectangle { - anchors.fill: parent; - border.width: UM.Theme.getSize("monitor_thick_lining").width; - border.color: UM.Theme.getColor("monitor_lining_heavy"); - color: "transparent"; - opacity: { - if (printCoreConfiguration == null || printCoreConfiguration.activeMaterial == null || printCoreConfiguration.hotendID == null) { - return 0.5; - } - return 1; - } - radius: Math.round(width / 2); - visible: printCoreConfiguration; - - Label { - anchors.centerIn: parent; - color: UM.Theme.getColor("text"); - font: UM.Theme.getFont("default_bold"); - text: printCoreConfiguration ? printCoreConfiguration.position + 1 : 0; - } - } - } - - // Print core and material labels - Item { - id: materialLabel - anchors { - left: extruderCircle.right; - leftMargin: UM.Theme.getSize("default_margin").width; - right: parent.right; - top: parent.top; - } - height: UM.Theme.getSize("monitor_text_line").height; - - // Loading skeleton - Rectangle { - anchors.fill: parent; - color: UM.Theme.getColor("monitor_skeleton_fill"); - visible: !extruderInfo.printCoreConfiguration; - } - - // Actual content - Label { - anchors.fill: parent; - elide: Text.ElideRight; - color: UM.Theme.getColor("text"); - font: UM.Theme.getFont("default"); - text: { - if (printCoreConfiguration && printCoreConfiguration.activeMaterial != undefined) { - return printCoreConfiguration.activeMaterial.name; - } - return ""; - } - visible: extruderInfo.printCoreConfiguration; - } - } - - Item { - id: printCoreLabel; - anchors { - left: extruderCircle.right; - leftMargin: UM.Theme.getSize("default_margin").width; - right: parent.right; - top: materialLabel.bottom; - topMargin: Math.floor(UM.Theme.getSize("default_margin").height/4); - } - height: UM.Theme.getSize("monitor_text_line").height; - - // Loading skeleton - Rectangle { - color: UM.Theme.getColor("monitor_skeleton_fill"); - height: parent.height; - visible: !extruderInfo.printCoreConfiguration; - width: Math.round(parent.width / 3); - } - - // Actual content - Label { - color: UM.Theme.getColor("text"); - elide: Text.ElideRight; - font: UM.Theme.getFont("default"); - opacity: 0.6; - text: { - if (printCoreConfiguration != undefined && printCoreConfiguration.hotendID != undefined) { - return printCoreConfiguration.hotendID; - } - return ""; - } - visible: extruderInfo.printCoreConfiguration; - } - } -} diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml deleted file mode 100644 index a611cb4ff6..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintJobInfoBlock.qml +++ /dev/null @@ -1,505 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.2 -import QtQuick.Dialogs 1.1 -import QtQuick.Controls 2.0 -import QtQuick.Controls.Styles 1.4 -import QtGraphicalEffects 1.0 -import QtQuick.Layouts 1.1 -import QtQuick.Dialogs 1.1 -import UM 1.3 as UM - -Item { - id: root; - property var shadowRadius: UM.Theme.getSize("monitor_shadow_radius").width; - property var shadowOffset: 2 * screenScaleFactor; - property var debug: false; - property var printJob: null; - width: parent.width; // Bubbles downward - height: childrenRect.height + shadowRadius * 2; // Bubbles upward - - UM.I18nCatalog { - id: catalog; - name: "cura"; - } - - // The actual card (white block) - Rectangle { - // 5px margin, but shifted 2px vertically because of the shadow - anchors { - bottomMargin: root.shadowRadius + root.shadowOffset; - leftMargin: root.shadowRadius; - rightMargin: root.shadowRadius; - topMargin: root.shadowRadius - root.shadowOffset; - } - color: UM.Theme.getColor("monitor_card_background"); - height: childrenRect.height; - layer.enabled: true - layer.effect: DropShadow { - radius: root.shadowRadius - verticalOffset: 2 * screenScaleFactor - color: "#3F000000" // 25% shadow - } - width: parent.width - shadowRadius * 2; - - Column { - height: childrenRect.height; - width: parent.width; - - // Main content - Item { - id: mainContent; - height: 200 * screenScaleFactor; // TODO: Theme! - width: parent.width; - - // Left content - Item { - anchors { - bottom: parent.bottom; - left: parent.left; - margins: UM.Theme.getSize("wide_margin").width; - right: parent.horizontalCenter; - top: parent.top; - } - - Item { - id: printJobName; - width: parent.width; - height: UM.Theme.getSize("monitor_text_line").height; - - Rectangle { - color: UM.Theme.getColor("monitor_skeleton_fill"); - height: parent.height; - visible: !printJob; - width: Math.round(parent.width / 3); - } - Label { - anchors.fill: parent; - color: UM.Theme.getColor("text"); - elide: Text.ElideRight; - font: UM.Theme.getFont("default_bold"); - text: printJob && printJob.name ? printJob.name : ""; // Supress QML warnings - visible: printJob; - } - } - - Item { - id: printJobOwnerName; - anchors { - top: printJobName.bottom; - topMargin: Math.floor(UM.Theme.getSize("default_margin").height / 2); - } - height: UM.Theme.getSize("monitor_text_line").height; - width: parent.width; - - Rectangle { - color: UM.Theme.getColor("monitor_skeleton_fill"); - height: parent.height; - visible: !printJob; - width: Math.round(parent.width / 2); - } - Label { - anchors.fill: parent; - color: UM.Theme.getColor("text"); - elide: Text.ElideRight; - font: UM.Theme.getFont("default"); - text: printJob ? printJob.owner : ""; // Supress QML warnings - visible: printJob; - } - } - - Item { - id: printJobPreview; - property var useUltibot: false; - anchors { - bottom: parent.bottom; - horizontalCenter: parent.horizontalCenter; - top: printJobOwnerName.bottom; - topMargin: UM.Theme.getSize("default_margin").height; - } - width: height; - - // Skeleton - Rectangle { - anchors.fill: parent; - color: UM.Theme.getColor("monitor_skeleton_fill"); - radius: UM.Theme.getSize("default_margin").width; - visible: !printJob; - } - - // Actual content - Image { - id: previewImage; - anchors.fill: parent; - opacity: printJob && printJob.state == "error" ? 0.5 : 1.0; - source: printJob ? printJob.previewImageUrl : ""; - visible: printJob; - } - - UM.RecolorImage { - id: ultiBotImage; - - anchors.centerIn: printJobPreview; - color: UM.Theme.getColor("monitor_placeholder_image"); - height: printJobPreview.height; - source: "../svg/ultibot.svg"; - sourceSize { - height: height; - width: width; - } - /* Since print jobs ALWAYS have an image url, we have to check if that image URL errors or - not in order to determine if we show the placeholder (ultibot) image instead. */ - visible: printJob && previewImage.status == Image.Error; - width: printJobPreview.width; - } - - UM.RecolorImage { - id: statusImage; - anchors.centerIn: printJobPreview; - color: UM.Theme.getColor("monitor_image_overlay"); - height: 0.5 * printJobPreview.height; - source: printJob && printJob.state == "error" ? "../svg/aborted-icon.svg" : ""; - sourceSize { - height: height; - width: width; - } - visible: source != ""; - width: 0.5 * printJobPreview.width; - } - } - - Label { - id: totalTimeLabel; - anchors { - bottom: parent.bottom; - right: parent.right; - } - color: UM.Theme.getColor("text"); - elide: Text.ElideRight; - font: UM.Theme.getFont("default"); - text: printJob ? OutputDevice.formatDuration(printJob.timeTotal) : ""; - } - } - - // Divider - Rectangle { - anchors { - horizontalCenter: parent.horizontalCenter; - verticalCenter: parent.verticalCenter; - } - color: !printJob ? UM.Theme.getColor("monitor_skeleton_fill") : UM.Theme.getColor("monitor_lining_light"); - height: parent.height - 2 * UM.Theme.getSize("default_margin").height; - width: UM.Theme.getSize("default_lining").width; - } - - // Right content - Item { - anchors { - bottom: parent.bottom; - left: parent.horizontalCenter; - margins: UM.Theme.getSize("wide_margin").width; - right: parent.right; - top: parent.top; - } - - Item { - id: targetPrinterLabel; - height: UM.Theme.getSize("monitor_text_line").height; - width: parent.width; - - Rectangle { - visible: !printJob; - color: UM.Theme.getColor("monitor_skeleton_fill"); - anchors.fill: parent; - } - - Label { - color: UM.Theme.getColor("text"); - elide: Text.ElideRight; - font: UM.Theme.getFont("default_bold"); - text: { - if (printJob !== null) { - if (printJob.assignedPrinter == null) { - if (printJob.state == "error") { - return catalog.i18nc("@label", "Waiting for: Unavailable printer"); - } - return catalog.i18nc("@label", "Waiting for: First available"); - } else { - return catalog.i18nc("@label", "Waiting for: ") + printJob.assignedPrinter.name; - } - } - return ""; - } - visible: printJob; - } - } - - PrinterInfoBlock { - anchors.bottom: parent.bottom; - printer: root.printJon && root.printJob.assignedPrinter; - printJob: root.printJob; - } - } - - PrintJobContextMenu { - id: contextButton; - anchors { - right: mainContent.right; - rightMargin: UM.Theme.getSize("default_margin").width * 3 + root.shadowRadius; - top: mainContent.top; - topMargin: UM.Theme.getSize("default_margin").height; - } - printJob: root.printJob; - visible: root.printJob; - } - } - - Item { - id: configChangesBox; - height: childrenRect.height; - visible: printJob && printJob.configurationChanges.length !== 0; - width: parent.width; - - // Config change toggle - Rectangle { - id: configChangeToggle; - color: { - if (configChangeToggleArea.containsMouse) { - return UM.Theme.getColor("viewport_background"); // TODO: Theme! - } else { - return "transparent"; - } - } - width: parent.width; - height: UM.Theme.getSize("default_margin").height * 4; // TODO: Theme! - anchors { - left: parent.left; - right: parent.right; - top: parent.top; - } - - Rectangle { - color: !printJob ? UM.Theme.getColor("monitor_skeleton_fill") : UM.Theme.getColor("monitor_lining_light"); - height: UM.Theme.getSize("default_lining").height; - width: parent.width; - } - - UM.RecolorImage { - anchors { - right: configChangeToggleLabel.left; - rightMargin: UM.Theme.getSize("default_margin").width; - verticalCenter: parent.verticalCenter; - } - color: UM.Theme.getColor("text"); - height: 23 * screenScaleFactor; // TODO: Theme! - source: "../svg/warning-icon.svg"; - sourceSize { - height: height; - width: width; - } - width: 23 * screenScaleFactor; // TODO: Theme! - } - - Label { - id: configChangeToggleLabel; - anchors { - horizontalCenter: parent.horizontalCenter; - verticalCenter: parent.verticalCenter; - } - color: UM.Theme.getColor("text"); - font: UM.Theme.getFont("default"); - text: catalog.i18nc("@label", "Configuration change"); - } - - UM.RecolorImage { - anchors { - left: configChangeToggleLabel.right; - leftMargin: UM.Theme.getSize("default_margin").width; - verticalCenter: parent.verticalCenter; - } - color: UM.Theme.getColor("text"); - height: 15 * screenScaleFactor; // TODO: Theme! - source: { - if (configChangeDetails.visible) { - return UM.Theme.getIcon("arrow_top"); - } else { - return UM.Theme.getIcon("arrow_bottom"); - } - } - sourceSize { - width: width; - height: height; - } - width: 15 * screenScaleFactor; // TODO: Theme! - } - - MouseArea { - id: configChangeToggleArea; - anchors.fill: parent; - hoverEnabled: true; - onClicked: { - configChangeDetails.visible = !configChangeDetails.visible; - } - } - } - - // Config change details - Item { - id: configChangeDetails; - anchors.top: configChangeToggle.bottom; - Behavior on height { NumberAnimation { duration: 100 } } - // In case of really massive multi-line configuration changes - height: visible ? Math.max(UM.Theme.getSize("monitor_config_override_box").height, childrenRect.height) : 0; - visible: false; - width: parent.width; - - Item { - anchors { - bottomMargin: UM.Theme.getSize("wide_margin").height; - fill: parent; - leftMargin: UM.Theme.getSize("wide_margin").height * 4; - rightMargin: UM.Theme.getSize("wide_margin").height * 4; - topMargin: UM.Theme.getSize("wide_margin").height; - } - clip: true; - - Label { - anchors.fill: parent; - elide: Text.ElideRight; - color: UM.Theme.getColor("text"); - font: UM.Theme.getFont("default"); - text: { - if (!printJob || printJob.configurationChanges.length === 0) { - return ""; - } - var topLine; - if (materialsAreKnown(printJob)) { - topLine = catalog.i18nc("@label", "The assigned printer, %1, requires the following configuration change(s):").arg(printJob.assignedPrinter.name); - } else { - topLine = catalog.i18nc("@label", "The printer %1 is assigned, but the job contains an unknown material configuration.").arg(printJob.assignedPrinter.name); - } - var result = "

" + topLine +"

"; - for (var i = 0; i < printJob.configurationChanges.length; i++) { - var change = printJob.configurationChanges[i]; - var text; - switch (change.typeOfChange) { - case "material_change": - text = catalog.i18nc("@label", "Change material %1 from %2 to %3.").arg(change.index + 1).arg(change.originName).arg(change.targetName); - break; - case "material_insert": - text = catalog.i18nc("@label", "Load %3 as material %1 (This cannot be overridden).").arg(change.index + 1).arg(change.targetName); - break; - case "print_core_change": - text = catalog.i18nc("@label", "Change print core %1 from %2 to %3.").arg(change.index + 1).arg(change.originName).arg(change.targetName); - break; - case "buildplate_change": - text = catalog.i18nc("@label", "Change build plate to %1 (This cannot be overridden).").arg(formatBuildPlateType(change.target_name)); - break; - default: - text = ""; - } - result += "

" + text + "

"; - } - return result; - } - wrapMode: Text.WordWrap; - } - - Button { - anchors { - bottom: parent.bottom; - left: parent.left; - } - background: Rectangle { - border { - color: UM.Theme.getColor("monitor_lining_heavy"); - width: UM.Theme.getSize("default_lining").width; - } - color: parent.hovered ? UM.Theme.getColor("monitor_card_background_inactive") : UM.Theme.getColor("monitor_card_background"); - implicitHeight: UM.Theme.getSize("default_margin").height * 3; - implicitWidth: UM.Theme.getSize("default_margin").height * 8; - } - contentItem: Label { - color: UM.Theme.getColor("text"); - font: UM.Theme.getFont("medium"); - horizontalAlignment: Text.AlignHCenter; - text: parent.text; - verticalAlignment: Text.AlignVCenter; - } - onClicked: { - overrideConfirmationDialog.visible = true; - } - text: catalog.i18nc("@label", "Override"); - visible: { - if (printJob && printJob.configurationChanges) { - var length = printJob.configurationChanges.length; - for (var i = 0; i < length; i++) { - var typeOfChange = printJob.configurationChanges[i].typeOfChange; - if (typeOfChange === "material_insert" || typeOfChange === "buildplate_change") { - return false; - } - } - } - return true; - } - } - } - } - - MessageDialog { - id: overrideConfirmationDialog; - Component.onCompleted: visible = false; - icon: StandardIcon.Warning; - onYes: OutputDevice.forceSendJob(printJob.key); - standardButtons: StandardButton.Yes | StandardButton.No; - text: { - if (!printJob) { - return ""; - } - var printJobName = formatPrintJobName(printJob.name); - var confirmText = catalog.i18nc("@label", "Starting a print job with an incompatible configuration could damage your 3D printer. Are you sure you want to override the configuration and print %1?").arg(printJobName); - return confirmText; - } - title: catalog.i18nc("@window:title", "Override configuration configuration and start print"); - } - } - } - } - // Utils - function formatPrintJobName(name) { - var extensions = [ ".gz", ".gcode", ".ufp" ]; - for (var i = 0; i < extensions.length; i++) { - var extension = extensions[i]; - if (name.slice(-extension.length) === extension) { - name = name.substring(0, name.length - extension.length); - } - } - return name; - } - function materialsAreKnown(job) { - var conf0 = job.configuration[0]; - if (conf0 && !conf0.material.material) { - return false; - } - var conf1 = job.configuration[1]; - if (conf1 && !conf1.material.material) { - return false; - } - return true; - } - function formatBuildPlateType(buildPlateType) { - var translationText = ""; - switch (buildPlateType) { - case "glass": - translationText = catalog.i18nc("@label", "Glass"); - break; - case "aluminum": - translationText = catalog.i18nc("@label", "Aluminum"); - break; - default: - translationText = null; - } - return translationText; - } -} diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintJobPreview.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintJobPreview.qml deleted file mode 100644 index b1a73255f4..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintJobPreview.qml +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.3 -import QtQuick.Dialogs 1.1 -import QtQuick.Controls 2.0 -import QtQuick.Controls.Styles 1.3 -import QtGraphicalEffects 1.0 -import QtQuick.Controls 1.4 as LegacyControls -import UM 1.3 as UM - -// Includes print job name, owner, and preview - -Item { - property var job: null; - property var useUltibot: false; - height: 100 * screenScaleFactor; - width: height; - - // Skeleton - Rectangle { - anchors.fill: parent; - color: UM.Theme.getColor("monitor_skeleton_fill"); - radius: UM.Theme.getSize("default_margin").width; - visible: !job; - } - - // Actual content - Image { - id: previewImage; - visible: job; - source: job ? job.previewImageUrl : ""; - opacity: { - if (job == null) { - return 1.0; - } - var states = ["wait_cleanup", "wait_user_action", "error", "paused"]; - if (states.indexOf(job.state) !== -1) { - return 0.5; - } - return 1.0; - } - anchors.fill: parent; - } - - UM.RecolorImage { - id: ultibotImage; - anchors.centerIn: parent; - color: UM.Theme.getColor("monitor_placeholder_image"); // TODO: Theme! - height: parent.height; - source: "../svg/ultibot.svg"; - sourceSize { - height: height; - width: width; - } - /* Since print jobs ALWAYS have an image url, we have to check if that image URL errors or - not in order to determine if we show the placeholder (ultibot) image instead. */ - visible: job && previewImage.status == Image.Error; - width: parent.width; - } - - UM.RecolorImage { - id: statusImage; - anchors.centerIn: parent; - color: "black"; // TODO: Theme! - height: Math.round(0.5 * parent.height); - source: job && job.state == "error" ? "../svg/aborted-icon.svg" : ""; - sourceSize { - height: height; - width: width; - } - visible: source != ""; - width: Math.round(0.5 * parent.width); - } -} \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintJobTitle.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintJobTitle.qml deleted file mode 100644 index f9f7b5ae87..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintJobTitle.qml +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.3 -import QtQuick.Controls 2.0 -import UM 1.3 as UM - -Column { - property var job: null; - height: childrenRect.height; - spacing: Math.floor( UM.Theme.getSize("default_margin").height / 2); // TODO: Use explicit theme size - width: parent.width; - - Item { - id: jobName; - height: UM.Theme.getSize("monitor_text_line").height; - width: parent.width; - - // Skeleton loading - Rectangle { - color: UM.Theme.getColor("monitor_skeleton_fill"); - height: parent.height; - visible: !job; - width: Math.round(parent.width / 3); - } - - Label { - anchors.fill: parent; - color: UM.Theme.getColor("text"); - elide: Text.ElideRight; - font: UM.Theme.getFont("default_bold"); - text: job && job.name ? job.name : ""; - visible: job; - } - } - - Item { - id: ownerName; - height: UM.Theme.getSize("monitor_text_line").height; - width: parent.width; - - // Skeleton loading - Rectangle { - color: UM.Theme.getColor("monitor_skeleton_fill"); - height: parent.height; - visible: !job; - width: Math.round(parent.width / 2); - } - - Label { - anchors.fill: parent; - color: UM.Theme.getColor("text") - elide: Text.ElideRight; - font: UM.Theme.getFont("default"); - text: job ? job.owner : ""; - visible: job; - } - } -} \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/PrinterCard.qml deleted file mode 100644 index 24beaf70fe..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/PrinterCard.qml +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.3 -import QtQuick.Dialogs 1.1 -import QtQuick.Controls 2.0 -import QtQuick.Controls.Styles 1.3 -import QtGraphicalEffects 1.0 -import UM 1.3 as UM - -Item { - id: root; - property var shadowRadius: UM.Theme.getSize("monitor_shadow_radius").width; - property var shadowOffset: UM.Theme.getSize("monitor_shadow_offset").width; - property var printer: null; - property var collapsed: true; - height: childrenRect.height + shadowRadius * 2; // Bubbles upward - width: parent.width; // Bubbles downward - - // The actual card (white block) - Rectangle { - // 5px margin, but shifted 2px vertically because of the shadow - anchors { - bottomMargin: root.shadowRadius + root.shadowOffset; - leftMargin: root.shadowRadius; - rightMargin: root.shadowRadius; - topMargin: root.shadowRadius - root.shadowOffset; - } - color: { - if (!printer) { - return UM.Theme.getColor("monitor_card_background_inactive"); - } - if (printer.state == "disabled") { - return UM.Theme.getColor("monitor_card_background_inactive"); - } else { - return UM.Theme.getColor("monitor_card_background"); - } - } - height: childrenRect.height; - layer.effect: DropShadow { - radius: root.shadowRadius; - verticalOffset: root.shadowOffset; - color: "#3F000000"; // 25% shadow - } - layer.enabled: true - width: parent.width - 2 * shadowRadius; - - Column { - id: cardContents; - height: childrenRect.height; - width: parent.width; - - // Main card - Item { - id: mainCard; - anchors { - left: parent.left; - leftMargin: UM.Theme.getSize("default_margin").width; - right: parent.right; - rightMargin: UM.Theme.getSize("default_margin").width; - } - height: 60 * screenScaleFactor + 2 * UM.Theme.getSize("default_margin").height; - width: parent.width; - - // Machine icon - Item { - id: machineIcon; - anchors.verticalCenter: parent.verticalCenter; - height: parent.height - 2 * UM.Theme.getSize("default_margin").width; - width: height; - - // Skeleton - Rectangle { - anchors.fill: parent; - color: UM.Theme.getColor("monitor_skeleton_fill_dark"); - radius: UM.Theme.getSize("default_margin").width; - visible: !printer; - } - - // Content - UM.RecolorImage { - anchors.centerIn: parent; - color: { - if (printer && printer.activePrintJob != undefined) { - return UM.Theme.getColor("monitor_printer_icon"); - } - return UM.Theme.getColor("monitor_printer_icon_inactive"); - } - height: sourceSize.height; - source: { - if (!printer) { - return ""; - } - switch(printer.type) { - case "Ultimaker 3": - return "../svg/UM3-icon.svg"; - case "Ultimaker 3 Extended": - return "../svg/UM3x-icon.svg"; - case "Ultimaker S5": - return "../svg/UMs5-icon.svg"; - } - } - visible: printer; - width: sourceSize.width; - } - } - - // Printer info - Item { - id: printerInfo; - anchors { - left: machineIcon.right; - leftMargin: UM.Theme.getSize("wide_margin").width; - right: collapseIcon.left; - verticalCenter: machineIcon.verticalCenter; - } - height: childrenRect.height; - - // Machine name - Item { - id: machineNameLabel; - height: UM.Theme.getSize("monitor_text_line").height; - width: { - var percent = printer ? 0.75 : 0.3; - return Math.round(parent.width * percent); - } - - // Skeleton - Rectangle { - anchors.fill: parent; - color: UM.Theme.getColor("monitor_skeleton_fill_dark"); - visible: !printer; - } - - // Actual content - Label { - anchors.fill: parent; - color: UM.Theme.getColor("text"); - elide: Text.ElideRight; - font: UM.Theme.getFont("default_bold"); - text: printer ? printer.name : ""; - visible: printer; - width: parent.width; - } - } - - // Job name - Item { - id: activeJobLabel; - anchors { - top: machineNameLabel.bottom; - topMargin: Math.round(UM.Theme.getSize("default_margin").height / 2); - } - height: UM.Theme.getSize("monitor_text_line").height; - width: Math.round(parent.width * 0.75); - - // Skeleton - Rectangle { - anchors.fill: parent; - color: UM.Theme.getColor("monitor_skeleton_fill_dark"); - visible: !printer; - } - - // Actual content - Label { - anchors.fill: parent; - color: UM.Theme.getColor("monitor_text_inactive"); - elide: Text.ElideRight; - font: UM.Theme.getFont("default"); - text: { - if (!printer) { - return ""; - } - if (printer.state == "disabled") { - return catalog.i18nc("@label", "Not available"); - } else if (printer.state == "unreachable") { - return catalog.i18nc("@label", "Unreachable"); - } - if (printer.activePrintJob != null && printer.activePrintJob.name) { - return printer.activePrintJob.name; - } - return catalog.i18nc("@label", "Available"); - } - visible: printer; - } - } - } - - // Collapse icon - UM.RecolorImage { - id: collapseIcon; - anchors { - right: parent.right; - rightMargin: UM.Theme.getSize("default_margin").width; - verticalCenter: parent.verticalCenter; - } - color: UM.Theme.getColor("text"); - height: 15 * screenScaleFactor; // TODO: Theme! - source: root.collapsed ? UM.Theme.getIcon("arrow_left") : UM.Theme.getIcon("arrow_bottom"); - sourceSize { - height: height; - width: width; - } - visible: printer; - width: 15 * screenScaleFactor; // TODO: Theme! - } - - MouseArea { - anchors.fill: parent; - enabled: printer; - onClicked: { - if (model && root.collapsed) { - printerList.currentIndex = model.index; - } else { - printerList.currentIndex = -1; - } - } - } - - Connections { - target: printerList; - onCurrentIndexChanged: { - root.collapsed = printerList.currentIndex != model.index; - } - } - } - // Detailed card - PrinterCardDetails { - collapsed: root.collapsed; - printer: root.printer; - visible: root.printer; - } - - // Progress bar - PrinterCardProgressBar { - visible: printer && printer.activePrintJob != null; - width: parent.width; - } - } - } -} diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrinterCardDetails.qml b/plugins/UM3NetworkPrinting/resources/qml/PrinterCardDetails.qml deleted file mode 100644 index 31da388b00..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/PrinterCardDetails.qml +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.3 -import QtQuick.Dialogs 1.1 -import QtQuick.Controls 2.0 -import QtQuick.Controls.Styles 1.3 -import QtGraphicalEffects 1.0 -import QtQuick.Controls 1.4 as LegacyControls -import UM 1.3 as UM - -Item { - id: root; - property var printer: null; - property var printJob: printer ? printer.activePrintJob : null; - property var collapsed: true; - Behavior on height { NumberAnimation { duration: 100 } } - Behavior on opacity { NumberAnimation { duration: 100 } } - height: collapsed ? 0 : childrenRect.height; - opacity: collapsed ? 0 : 1; - width: parent.width; - - Column { - id: contentColumn; - anchors { - left: parent.left; - leftMargin: UM.Theme.getSize("default_margin").width; - right: parent.right; - rightMargin: UM.Theme.getSize("default_margin").width; - } - height: childrenRect.height + UM.Theme.getSize("default_margin").height; - spacing: UM.Theme.getSize("default_margin").height; - width: parent.width; - - HorizontalLine {} - - PrinterInfoBlock { - printer: root.printer; - printJob: root.printer ? root.printer.activePrintJob : null; - } - - HorizontalLine {} - - Row { - height: childrenRect.height; - visible: root.printJob; - width: parent.width; - - PrintJobTitle { - job: root.printer ? root.printer.activePrintJob : null; - } - PrintJobContextMenu { - id: contextButton; - anchors { - right: parent.right; - rightMargin: UM.Theme.getSize("wide_margin").width; - } - printJob: root.printer ? root.printer.activePrintJob : null; - visible: printJob; - } - } - - PrintJobPreview { - anchors.horizontalCenter: parent.horizontalCenter; - job: root.printer && root.printer.activePrintJob ? root.printer.activePrintJob : null; - visible: root.printJob; - } - - CameraButton { - id: showCameraButton; - iconSource: "../svg/camera-icon.svg"; - visible: root.printer; - } - } -} diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrinterCardProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/PrinterCardProgressBar.qml deleted file mode 100644 index e86c959b8c..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/PrinterCardProgressBar.qml +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.3 -import QtQuick.Controls.Styles 1.3 -import QtQuick.Controls 1.4 -import UM 1.3 as UM - -ProgressBar { - property var progress: { - if (!printer || printer.activePrintJob == null) { - return 0; - } - var result = printer.activePrintJob.timeElapsed / printer.activePrintJob.timeTotal; - if (result > 1.0) { - result = 1.0; - } - return result; - } - style: ProgressBarStyle { - property var remainingTime: { - if (!printer || printer.activePrintJob == null) { - return 0; - } - /* Sometimes total minus elapsed is less than 0. Use Math.max() to prevent remaining - time from ever being less than 0. Negative durations cause strange behavior such - as displaying "-1h -1m". */ - return Math.max(printer.activePrintJob.timeTotal - printer.activePrintJob.timeElapsed, 0); - } - property var progressText: { - if (printer === null ) { - return ""; - } - switch (printer.activePrintJob.state) { - case "wait_cleanup": - if (printer.activePrintJob.timeTotal > printer.activePrintJob.timeElapsed) { - return catalog.i18nc("@label:status", "Aborted"); - } - return catalog.i18nc("@label:status", "Finished"); - case "pre_print": - case "sent_to_printer": - return catalog.i18nc("@label:status", "Preparing"); - case "aborted": - return catalog.i18nc("@label:status", "Aborted"); - case "wait_user_action": - return catalog.i18nc("@label:status", "Aborted"); - case "pausing": - return catalog.i18nc("@label:status", "Pausing"); - case "paused": - return OutputDevice.formatDuration( remainingTime ); - case "resuming": - return catalog.i18nc("@label:status", "Resuming"); - case "queued": - return catalog.i18nc("@label:status", "Action required"); - default: - return OutputDevice.formatDuration( remainingTime ); - } - } - background: Rectangle { - color: UM.Theme.getColor("monitor_progress_background"); - implicitHeight: visible ? 24 : 0; - implicitWidth: 100; - } - progress: Rectangle { - id: progressItem; - color: { - if (! printer || !printer.activePrintJob) { - return "black"; - } - var state = printer.activePrintJob.state - var inactiveStates = [ - "pausing", - "paused", - "resuming", - "wait_cleanup" - ]; - if (inactiveStates.indexOf(state) > -1 && remainingTime > 0) { - return UM.Theme.getColor("monitor_progress_fill_inactive"); - } else { - return UM.Theme.getColor("monitor_progress_fill"); - } - } - - Label { - id: progressLabel; - anchors { - left: parent.left; - leftMargin: getTextOffset(); - } - text: progressText; - anchors.verticalCenter: parent.verticalCenter; - color: progressItem.width + progressLabel.width < control.width ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_progress_fill_text"); - width: contentWidth; - font: UM.Theme.getFont("default"); - } - - function getTextOffset() { - if (progressItem.width + progressLabel.width + 16 < control.width) { - return progressItem.width + UM.Theme.getSize("default_margin").width; - } else { - return progressItem.width - progressLabel.width - UM.Theme.getSize("default_margin").width; - } - } - } - } - value: progress; - width: parent.width; -} \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrinterFamilyPill.qml b/plugins/UM3NetworkPrinting/resources/qml/PrinterFamilyPill.qml deleted file mode 100644 index 0a88b053a8..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/PrinterFamilyPill.qml +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.2 -import QtQuick.Controls 1.4 -import UM 1.2 as UM - -Item { - property alias text: familyNameLabel.text; - property var padding: 3 * screenScaleFactor; // TODO: Theme! - implicitHeight: familyNameLabel.contentHeight + 2 * padding; // Apply the padding to top and bottom. - implicitWidth: Math.max(48 * screenScaleFactor, familyNameLabel.contentWidth + implicitHeight); // The extra height is added to ensure the radius doesn't cut something off. - - Rectangle { - id: background; - anchors { - horizontalCenter: parent.horizontalCenter; - right: parent.right; - } - color: familyNameLabel.text.length < 1 ? UM.Theme.getColor("monitor_skeleton_fill") : UM.Theme.getColor("monitor_pill_background"); - height: parent.height; - radius: 0.5 * height; - width: parent.width; - } - - Label { - id: familyNameLabel; - anchors.centerIn: parent; - color: UM.Theme.getColor("text"); - text: ""; - } -} \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrinterInfoBlock.qml b/plugins/UM3NetworkPrinting/resources/qml/PrinterInfoBlock.qml deleted file mode 100644 index 92a8f1dcb3..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/PrinterInfoBlock.qml +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.3 -import QtQuick.Dialogs 1.1 -import QtQuick.Controls 2.0 -import QtQuick.Controls.Styles 1.3 -import QtGraphicalEffects 1.0 -import QtQuick.Controls 1.4 as LegacyControls -import UM 1.3 as UM - -// Includes printer type pill and extuder configurations - -Item { - id: root; - property var printer: null; - property var printJob: null; - width: parent.width; - height: childrenRect.height; - - // Printer family pills - Row { - id: printerFamilyPills; - anchors { - left: parent.left; - right: parent.right; - } - height: childrenRect.height; - spacing: Math.round(0.5 * UM.Theme.getSize("default_margin").width); - width: parent.width; - - Repeater { - id: compatiblePills; - delegate: PrinterFamilyPill { - text: modelData; - } - model: printJob ? printJob.compatibleMachineFamilies : []; - visible: printJob; - - } - - PrinterFamilyPill { - text: printer ? printer.type : ""; - visible: !compatiblePills.visible && printer; - } - } - - // Extruder info - Row { - id: extrudersInfo; - anchors { - left: parent.left; - right: parent.right; - rightMargin: UM.Theme.getSize("default_margin").width; - top: printerFamilyPills.bottom; - topMargin: UM.Theme.getSize("default_margin").height; - } - height: childrenRect.height; - spacing: UM.Theme.getSize("default_margin").width; - width: parent.width; - - PrintCoreConfiguration { - width: Math.round(parent.width / 2) * screenScaleFactor; - printCoreConfiguration: getExtruderConfig(0); - } - - PrintCoreConfiguration { - width: Math.round(parent.width / 2) * screenScaleFactor; - printCoreConfiguration: getExtruderConfig(1); - } - } - - function getExtruderConfig( i ) { - if (root.printJob) { - // Use more-specific print job if possible - return root.printJob.configuration.extruderConfigurations[i]; - } - if (root.printer) { - return root.printer.printerConfiguration.extruderConfigurations[i]; - } - return null; - } -} \ No newline at end of file From 0d55d023a193c651a28e69cae667d5daa0ae2548 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 11:36:03 +0100 Subject: [PATCH 054/199] Align the message colors with the ones in the designs. Contributes to CURA-6018. --- resources/themes/cura-light/theme.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 0ef6c24bfb..738f3e5c3f 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -248,11 +248,13 @@ "message_background": [255, 255, 255, 255], "message_shadow": [0, 0, 0, 120], - "message_border": [127, 127, 127, 255], + "message_border": [192, 193, 194, 255], "message_text": [0, 0, 0, 255], - "message_button": [50, 130, 255, 255], - "message_button_hover": [50, 130, 255, 255], - "message_button_active": [50, 130, 255, 255], + "message_close": [102, 102, 102, 255], + "message_close_hover": [8, 7, 63, 255], + "message_button": [38, 113, 231, 255], + "message_button_hover": [81, 145, 247, 255], + "message_button_active": [38, 113, 231, 255], "message_button_text": [255, 255, 255, 255], "message_button_text_hover": [255, 255, 255, 255], "message_button_text_active": [255, 255, 255, 255], @@ -478,6 +480,8 @@ "message_shadow": [0, 0], "message_margin": [0, 1.0], "message_inner_margin": [1.5, 1.5], + "message_radius": [0.25, 0.25], + "message_button_radius": [0.15, 0.15], "infill_button_margin": [0.5, 0.5], From ad7dcf6fc0700ebfdb424644fbeb8569a2f9f446 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 11:36:12 +0100 Subject: [PATCH 055/199] Delete ClusterControlItem.qml Contributes to CL-1152 --- .../resources/qml/ClusterControlItem.qml | 110 ------------------ 1 file changed, 110 deletions(-) delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/ClusterControlItem.qml diff --git a/plugins/UM3NetworkPrinting/resources/qml/ClusterControlItem.qml b/plugins/UM3NetworkPrinting/resources/qml/ClusterControlItem.qml deleted file mode 100644 index 94e75a6de0..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/ClusterControlItem.qml +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.3 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.3 -import UM 1.3 as UM -import Cura 1.0 as Cura - -Component { - Rectangle { - id: base; - property var shadowRadius: UM.Theme.getSize("monitor_shadow_radius").width; - property var cornerRadius: UM.Theme.getSize("monitor_corner_radius").width; - anchors.fill: parent; - color: UM.Theme.getColor("main_background"); - visible: OutputDevice != null; - - UM.I18nCatalog { - id: catalog; - name: "cura"; - } - - Label { - id: printingLabel; - anchors { - left: parent.left; - leftMargin: 4 * UM.Theme.getSize("default_margin").width; - margins: 2 * UM.Theme.getSize("default_margin").width; - right: parent.right; - top: parent.top; - } - color: UM.Theme.getColor("text"); - elide: Text.ElideRight; - font: UM.Theme.getFont("large"); - text: catalog.i18nc("@label", "Printing"); - } - - Label { - id: managePrintersLabel; - anchors { - bottom: printingLabel.bottom; - right: printerScrollView.right; - rightMargin: 4 * UM.Theme.getSize("default_margin").width; - } - color: UM.Theme.getColor("primary"); // "Cura Blue" - font: UM.Theme.getFont("default"); - linkColor: UM.Theme.getColor("primary"); // "Cura Blue" - text: catalog.i18nc("@label link to connect manager", "Manage printers"); - } - - MouseArea { - anchors.fill: managePrintersLabel; - hoverEnabled: true; - onClicked: Cura.MachineManager.printerOutputDevices[0].openPrinterControlPanel(); - onEntered: managePrintersLabel.font.underline = true; - onExited: managePrintersLabel.font.underline = false; - } - - // Skeleton loading - Column { - id: skeletonLoader; - anchors { - left: parent.left; - leftMargin: UM.Theme.getSize("wide_margin").width; - right: parent.right; - rightMargin: UM.Theme.getSize("wide_margin").width; - top: printingLabel.bottom; - topMargin: UM.Theme.getSize("default_margin").height; - } - spacing: UM.Theme.getSize("default_margin").height - 10; - visible: printerList.count === 0; - - PrinterCard { - printer: null; - } - PrinterCard { - printer: null; - } - } - - // Actual content - ScrollView { - id: printerScrollView; - anchors { - bottom: parent.bottom; - left: parent.left; - right: parent.right; - top: printingLabel.bottom; - topMargin: UM.Theme.getSize("default_margin").height; - } - style: UM.Theme.styles.scrollview; - - ListView { - id: printerList; - property var currentIndex: -1; - anchors { - fill: parent; - leftMargin: UM.Theme.getSize("wide_margin").width; - rightMargin: UM.Theme.getSize("wide_margin").width; - } - delegate: PrinterCard { - printer: modelData; - } - model: OutputDevice.printers; - spacing: UM.Theme.getSize("default_margin").height - 10; - } - } - } -} From 8a856f13d26c44668cb086729b22534b438d9a2b Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 11:36:51 +0100 Subject: [PATCH 056/199] Re-add config changes in monitor tab Contributes to CL-1152 --- .../resources/qml/ClusterMonitorItem.qml | 2 +- .../resources/qml/DiscoverUM3Action.qml | 2 +- .../resources/qml/HorizontalLine.qml | 12 -- .../qml/MonitorConfigOverrideDialog.qml | 131 ++++++++++++++++++ .../resources/qml/MonitorPrintJobCard.qml | 1 + .../resources/qml/MonitorPrintJobPreview.qml | 7 +- .../qml/MonitorPrintJobProgressBar.qml | 2 + .../resources/qml/MonitorPrinterCard.qml | 75 +++++++++- .../src/ClusterUM3OutputDevice.py | 10 -- 9 files changed, 210 insertions(+), 32 deletions(-) delete mode 100644 plugins/UM3NetworkPrinting/resources/qml/HorizontalLine.qml create mode 100644 plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml diff --git a/plugins/UM3NetworkPrinting/resources/qml/ClusterMonitorItem.qml b/plugins/UM3NetworkPrinting/resources/qml/ClusterMonitorItem.qml index adf5ea5e1c..31b3f4d4f5 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/ClusterMonitorItem.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/ClusterMonitorItem.qml @@ -130,7 +130,7 @@ Component verticalCenter: externalLinkIcon.verticalCenter } color: UM.Theme.getColor("primary") - font: UM.Theme.getFont("default") + font: UM.Theme.getFont("default") // 12pt, regular linkColor: UM.Theme.getColor("primary") text: catalog.i18nc("@label link to connect manager", "Manage queue in Cura Connect") } diff --git a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml index bb710127fc..e5f668c70d 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/DiscoverUM3Action.qml @@ -57,7 +57,7 @@ Cura.MachineAction spacing: UM.Theme.getSize("default_margin").height SystemPalette { id: palette } - UM.I18nCatalog { id: catalog; name: "cura" } + UM.I18nCatalog { id: catalog; name:"cura" } Label { id: pageTitle diff --git a/plugins/UM3NetworkPrinting/resources/qml/HorizontalLine.qml b/plugins/UM3NetworkPrinting/resources/qml/HorizontalLine.qml deleted file mode 100644 index aeb92697ad..0000000000 --- a/plugins/UM3NetworkPrinting/resources/qml/HorizontalLine.qml +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.3 -import QtQuick.Controls 2.0 -import UM 1.3 as UM - -Rectangle { - color: UM.Theme.getColor("monitor_lining_light"); // TODO: Maybe theme separately? Maybe not. - height: UM.Theme.getSize("default_lining").height; - width: parent.width; -} \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml new file mode 100644 index 0000000000..aa62afa083 --- /dev/null +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -0,0 +1,131 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.3 +import QtQuick.Controls 1.4 +import QtQuick.Layouts 1.3 +import QtQuick.Dialogs 1.2 +import UM 1.3 as UM + +UM.Dialog +{ + id: overrideConfirmationDialog + + property var printer: null + + minimumWidth: screenScaleFactor * 640; + minimumHeight: screenScaleFactor * 320; + width: minimumWidth + height: minimumHeight + title: catalog.i18nc("@title:window", "Configuration Changes") + rightButtons: + [ + Button + { + id: overrideButton + anchors.margins: UM.Theme.getSize("default_margin").width + text: catalog.i18nc("@action:button", "Override") + onClicked: + { + OutputDevice.forceSendJob(printer.activePrintJob.key) + overrideConfirmationDialog.close() + } + }, + Button + { + id: cancelButton + anchors.margins: UM.Theme.getSize("default_margin").width + text: catalog.i18nc("@action:button", "Cancel") + onClicked: + { + overrideConfirmationDialog.reject() + } + } + ] + + Label + { + anchors + { + fill: parent + leftMargin: 60 + rightMargin: 60 + topMargin: 18 + bottomMargin: 56 + } + wrapMode: Text.WordWrap + text: + { + var topLine + if (materialsAreKnown(printer.activePrintJob)) + { + topLine = catalog.i18nc("@label", "The assigned printer, %1, requires the following configuration change(s):").arg(printer.name) + } + else + { + topLine = catalog.i18nc("@label", "The printer %1 is assigned, but the job contains an unknown material configuration.").arg(printer.name) + } + var result = "

" + topLine +"

" + for (var i = 0; i < printer.activePrintJob.configurationChanges.length; i++) + { + var change = printer.activePrintJob.configurationChanges[i] + var text + switch (change.typeOfChange) + { + case "material_change": + text = catalog.i18nc("@label", "Change material %1 from %2 to %3.").arg(change.index + 1).arg(change.originName).arg(change.targetName) + break + case "material_insert": + text = catalog.i18nc("@label", "Load %3 as material %1 (This cannot be overridden).").arg(change.index + 1).arg(change.targetName) + break + case "print_core_change": + text = catalog.i18nc("@label", "Change print core %1 from %2 to %3.").arg(change.index + 1).arg(change.originName).arg(change.targetName) + break + case "buildplate_change": + text = catalog.i18nc("@label", "Change build plate to %1 (This cannot be overridden).").arg(formatBuildPlateType(change.target_name)) + break + default: + text = "unknown" + } + result += "

" + text + "

" + } + return result + } + } + // Utils + function formatPrintJobName(name) { + var extensions = [ ".gz", ".gcode", ".ufp" ]; + for (var i = 0; i < extensions.length; i++) { + var extension = extensions[i]; + if (name.slice(-extension.length) === extension) { + name = name.substring(0, name.length - extension.length); + } + } + return name; + } + function materialsAreKnown(job) { + var conf0 = job.configuration[0]; + if (conf0 && !conf0.material.material) { + return false; + } + var conf1 = job.configuration[1]; + if (conf1 && !conf1.material.material) { + return false; + } + return true; + } + function formatBuildPlateType(buildPlateType) { + var translationText = ""; + switch (buildPlateType) { + case "glass": + translationText = catalog.i18nc("@label", "Glass"); + break; + case "aluminum": + translationText = catalog.i18nc("@label", "Aluminum"); + break; + default: + translationText = null; + } + return translationText; + } +} \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml index 8231870c21..5eaeff2e84 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml @@ -26,6 +26,7 @@ Item ExpandableCard { + borderColor: printJob.configurationChanges.length !== 0 ? "#f5a623" : "#EAEAEC" // TODO: Theme! headerItem: Row { height: 48 * screenScaleFactor // TODO: Theme! diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml index ec26bbe568..5acd350abb 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml @@ -23,7 +23,7 @@ Item anchors.fill: parent opacity: { - if (printJob && (printJob.state == "error" || !printJob.isActive)) + if (printJob && (printJob.state == "error" || printJob.configurationChanges.length > 0 || !printJob.isActive)) { return 0.5 } @@ -60,6 +60,10 @@ Item height: 0.5 * printJobPreview.height source: { + if (printJob.configurationChanges.length > 0) + { + return "../svg/warning-icon.svg" + } switch(printJob.state) { case "error": @@ -75,6 +79,7 @@ Item default: return "" } + return "" } sourceSize { diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml index 88418516ed..e646172a6c 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml @@ -88,6 +88,8 @@ Item return catalog.i18nc("@label:status", "Aborted") } return catalog.i18nc("@label:status", "Finished") + case "finished": + return catalog.i18nc("@label:status", "Finished") case "sent_to_printer": return catalog.i18nc("@label:status", "Preparing...") case "pre_print": diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index 567fff8489..1676c51edf 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -3,6 +3,7 @@ import QtQuick 2.3 import QtQuick.Controls 2.0 +import QtQuick.Dialogs 1.1 import UM 1.3 as UM /** @@ -66,7 +67,7 @@ Item { verticalCenter: parent.verticalCenter } - width: 216 * screenScaleFactor // TODO: Theme! + width: 180 * screenScaleFactor // TODO: Theme! height: printerNameLabel.height + printerFamilyPill.height + 6 * screenScaleFactor // TODO: Theme! Label @@ -150,7 +151,7 @@ Item } border { - color: "#EAEAEC" // TODO: Theme! + color: printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 ? "#f5a623" : "#EAEAEC" // TODO: Theme! width: borderSize // TODO: Remove once themed } color: "white" // TODO: Theme! @@ -185,14 +186,15 @@ Item } if (printer && printer.state == "unreachable") { - return catalog.i18nc("@label:status", "Unreachable") + return catalog.i18nc("@label:status", "Unavailable") } - if (printer && printer.state == "idle") + if (printer && !printer.activePrintJob && printer.state == "idle") { return catalog.i18nc("@label:status", "Idle") } return "" } + visible: text !== "" } Item @@ -218,7 +220,7 @@ Item { verticalCenter: parent.verticalCenter } - width: 216 * screenScaleFactor // TODO: Theme! + width: 180 * screenScaleFactor // TODO: Theme! height: printerNameLabel.height + printerFamilyPill.height + 6 * screenScaleFactor // TODO: Theme! visible: printer.activePrintJob @@ -247,7 +249,7 @@ Item } color: printer.activePrintJob && printer.activePrintJob.isActive ? "#53657d" : "#babac1" // TODO: Theme! elide: Text.ElideRight - font: UM.Theme.getFont("very_small") // 12pt, regular + font: UM.Theme.getFont("default") // 12pt, regular text: printer.activePrintJob ? printer.activePrintJob.owner : "Anonymous" // TODO: I18N width: parent.width @@ -264,8 +266,67 @@ Item verticalCenter: parent.verticalCenter } printJob: printer.activePrintJob - visible: printer.activePrintJob + visible: printer.activePrintJob && printer.activePrintJob.configurationChanges.length === 0 + } + + Label + { + anchors + { + verticalCenter: parent.verticalCenter + } + font: UM.Theme.getFont("default") + text: "Requires configuration changes" + visible: printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 + + // FIXED-LINE-HEIGHT: + height: 18 * screenScaleFactor // TODO: Theme! + verticalAlignment: Text.AlignVCenter } } + + Button + { + id: detailsButton + anchors + { + verticalCenter: parent.verticalCenter + right: parent.right + rightMargin: 18 * screenScaleFactor // TODO: Theme! + } + background: Rectangle + { + color: "#d8d8d8" // TODO: Theme! + radius: 2 * screenScaleFactor // Todo: Theme! + Rectangle + { + anchors.fill: parent + anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme! + color: detailsButton.hovered ? "#e4e4e4" : "#f0f0f0" // TODO: Theme! + radius: 2 * screenScaleFactor // Todo: Theme! + } + } + contentItem: Label + { + anchors.fill: parent + anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme! + color: "#1e66d7" // TODO: Theme! + font: UM.Theme.getFont("medium") // 14pt, regular + text: "Details" // TODO: I18NC! + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + height: 18 * screenScaleFactor // TODO: Theme! + } + implicitHeight: 32 * screenScaleFactor // TODO: Theme! + implicitWidth: 96 * screenScaleFactor // TODO: Theme! + visible: printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 + onClicked: overrideConfirmationDialog.open() + } + } + + MonitorConfigOverrideDialog + { + id: overrideConfirmationDialog + printer: base.printer } } \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index e31229680c..292011929d 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -608,16 +608,6 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): def _createMaterialOutputModel(self, material_data: Dict[str, Any]) -> "MaterialOutputModel": material_manager = CuraApplication.getInstance().getMaterialManager() material_group_list = material_manager.getMaterialGroupListByGUID(material_data["guid"]) - # This can happen if the connected machine has no material in one or more extruders (if GUID is empty), or the - # material is unknown to Cura, so we should return an "empty" or "unknown" material model. - if material_group_list is None: - material_name = "Empty" if len(material_data["guid"]) == 0 else "Unknown" - return MaterialOutputModel(guid = material_data["guid"], - type = material_data.get("type", ""), - color = material_data.get("color", ""), - brand = material_data.get("brand", ""), - name = material_data.get("name", material_name) - ) # Sort the material groups by "is_read_only = True" first, and then the name alphabetically. read_only_material_group_list = list(filter(lambda x: x.is_read_only, material_group_list)) From dff364ee30870822158de7beaeb1faf7722f3d37 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 12:03:29 +0100 Subject: [PATCH 057/199] Change the panel to have also rounded rectangle in the top part Contributes to CURA-5941. --- resources/qml/ExpandableComponent.qml | 2 +- .../qml/PrintSetupSelector/PrintSetupSelectorContents.qml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 4170a0942e..04793653fe 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -162,7 +162,7 @@ Item background: Cura.RoundedRectangle { - cornerSide: Cura.RoundedRectangle.Direction.Down + cornerSide: Cura.RoundedRectangle.Direction.All color: contentBackgroundColor border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml index 7cd03ff74a..313bf0830c 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml @@ -38,11 +38,13 @@ Item // Header of the popup - Rectangle + Cura.RoundedRectangle { id: header height: UM.Theme.getSize("print_setup_widget_header").height color: UM.Theme.getColor("secondary") + cornerSide: Cura.RoundedRectangle.Direction.Up + radius: UM.Theme.getSize("default_radius").width anchors { From df4e5c40df403f76dfede9b74d358a075ff951c0 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 12:19:52 +0100 Subject: [PATCH 058/199] Rename ClusterMonitorItem Contributes to CL-1152 --- .../resources/qml/{ClusterMonitorItem.qml => MonitorStage.qml} | 1 + plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename plugins/UM3NetworkPrinting/resources/qml/{ClusterMonitorItem.qml => MonitorStage.qml} (99%) diff --git a/plugins/UM3NetworkPrinting/resources/qml/ClusterMonitorItem.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml similarity index 99% rename from plugins/UM3NetworkPrinting/resources/qml/ClusterMonitorItem.qml rename to plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index 31b3f4d4f5..4d59e0eb6b 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/ClusterMonitorItem.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -8,6 +8,7 @@ import UM 1.3 as UM import Cura 1.0 as Cura import QtGraphicalEffects 1.0 +// Root component for the monitor tab (stage) Component { Item diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index 292011929d..08592df603 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -64,7 +64,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): self._print_jobs = [] # type: List[UM3PrintJobOutputModel] self._received_print_jobs = False # type: bool - self._monitor_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../resources/qml/ClusterMonitorItem.qml") + self._monitor_view_qml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../resources/qml/MonitorStage.qml") # See comments about this hack with the clusterPrintersChanged signal self.printersChanged.connect(self.clusterPrintersChanged) From 70b9a44ae42de5ae7a796285338f7abad673f984 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Dec 2018 13:04:02 +0100 Subject: [PATCH 059/199] Removed import of CuraVersion CURA-6013 --- plugins/Toolbox/src/Toolbox.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 7e35f5d1f4..b88e1aa973 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -13,7 +13,6 @@ from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkRepl from UM.Logger import Logger from UM.PluginRegistry import PluginRegistry from UM.Extension import Extension -from UM.Qt.ListModel import ListModel from UM.i18n import i18nCatalog from UM.Version import Version @@ -22,8 +21,7 @@ from cura.CuraApplication import CuraApplication from .AuthorsModel import AuthorsModel from .PackagesModel import PackagesModel -from cura.CuraVersion import CuraVersion -from cura.API import CuraAPI + if TYPE_CHECKING: from cura.Settings.GlobalStack import GlobalStack @@ -158,7 +156,7 @@ class Toolbox(QObject, Extension): self._rate_request = QNetworkRequest(url) for header_name, header_value in self._request_headers: cast(QNetworkRequest, self._rate_request).setRawHeader(header_name, header_value) - data = "{\"data\": {\"cura_version\": \"%s\", \"rating\": %i}}" % (Version(CuraVersion), rating) + data = "{\"data\": {\"cura_version\": \"%s\", \"rating\": %i}}" % (Version(self._application.getVersion()), rating) self._rate_reply = cast(QNetworkAccessManager, self._network_manager).put(self._rate_request, data.encode()) @pyqtSlot(result = str) From 1487af167b616a190e320e6d05c94fad3a3ff95b Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 10 Dec 2018 13:20:36 +0100 Subject: [PATCH 060/199] Disable async loading for ToolboxDetailTile CURA-6006 --- plugins/Toolbox/resources/qml/ToolboxDetailList.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml index 1700a58ebe..4e44ea7d0b 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml @@ -32,7 +32,11 @@ Item model: toolbox.packagesModel delegate: Loader { - asynchronous: true + // FIXME: When using asynchronous loading, on Mac and Windows, the tile may fail to load complete, + // leaving an empty space below the title part. We turn it off for now to make it work on Mac and + // Windows. + // Can be related to this QT bug: https://bugreports.qt.io/browse/QTBUG-50992 + asynchronous: false source: "ToolboxDetailTile.qml" } } From b745755a7d1a0b7b482add455cb20535bc265247 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 10 Dec 2018 13:22:28 +0100 Subject: [PATCH 061/199] Remove TODO in ToolboxProgressButton CURA-6006 This file has been refactored. --- plugins/Toolbox/resources/qml/ToolboxProgressButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml index 3ca18a52ed..933e3a5900 100644 --- a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml +++ b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml @@ -7,7 +7,7 @@ import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM import Cura 1.0 as Cura -// TODO; This is in quite some need for refactoring. + Item { id: base From 9d1701aacbef8273f3225f26c158ceb2d6b6b8f3 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Dec 2018 13:29:58 +0100 Subject: [PATCH 062/199] Removed hardcoded color CURA-6013 --- plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index 8a2fdc8bc8..ceaadc110d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -20,7 +20,7 @@ Rectangle Rectangle { id: thumbnail - color: "white" + color: UM.Theme.getColor("main_background") width: UM.Theme.getSize("toolbox_thumbnail_large").width height: UM.Theme.getSize("toolbox_thumbnail_large").height anchors From af37f51cf8aa9acd121d02d4b891d72444556350 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 13:36:06 +0100 Subject: [PATCH 063/199] Make the expandable content header to be a common header for every expandable component. Contributes to CURA-5941. --- .../SimulationViewMenuComponent.qml | 1 + resources/qml/ExpandableComponent.qml | 68 +++++++++++----- resources/qml/ExpandablePopup.qml | 3 + .../PrintSetupSelector/PrintSetupSelector.qml | 10 +-- .../PrintSetupSelectorContents.qml | 77 +------------------ .../PrintSetupSelectorHeader.qml | 3 + resources/themes/cura-light/theme.json | 3 +- 7 files changed, 64 insertions(+), 101 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 76875a035d..58b2bfe520 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -16,6 +16,7 @@ Cura.ExpandableComponent id: base width: UM.Theme.getSize("layerview_menu_size").width + contentHeaderTitle: catalog.i18nc("@label", "Color scheme") Connections { diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 04793653fe..3c898caeb8 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -1,3 +1,6 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + import QtQuick 2.7 import QtQuick.Controls 2.3 @@ -40,6 +43,9 @@ Item // How much spacing is needed around the contentItem property alias contentPadding: content.padding + // Adds a title to the content item + property alias contentHeaderTitle: contentHeader.headerTitle + // How much spacing is needed for the contentItem by Y coordinate property var contentSpacingY: UM.Theme.getSize("narrow_margin").width @@ -55,7 +61,7 @@ Item property alias iconSize: collapseButton.height // Is the "drawer" open? - readonly property alias expanded: content.visible + readonly property alias expanded: contentContainer.visible // What should the radius of the header be. This is also influenced by the headerCornerSide property alias headerRadius: background.radius @@ -71,7 +77,7 @@ Item function toggleContent() { - content.visible = !expanded + contentContainer.visible = !expanded } // Add this binding since the background color is not updated otherwise @@ -147,10 +153,13 @@ Item z: background.z - 1 } - Control + Cura.RoundedRectangle { - id: content + id: contentContainer + visible: false + width: childrenRect.width + height: childrenRect.height // Ensure that the content is located directly below the headerItem y: background.height + base.shadowOffset + base.contentSpacingY @@ -158,25 +167,42 @@ Item // Make the content aligned with the rest, using the property contentAlignment to decide whether is right or left. // In case of right alignment, the 3x padding is due to left, right and padding between the button & text. x: contentAlignment == ExpandableComponent.ContentAlignment.AlignRight ? -width + collapseButton.width + headerItemLoader.width + 3 * background.padding : 0 - padding: UM.Theme.getSize("default_margin").width - background: Cura.RoundedRectangle + cornerSide: Cura.RoundedRectangle.Direction.All + color: contentBackgroundColor + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("lining") + radius: UM.Theme.getSize("default_radius").width + + ExpandableComponentHeader { - cornerSide: Cura.RoundedRectangle.Direction.All - color: contentBackgroundColor - border.width: UM.Theme.getSize("default_lining").width - border.color: UM.Theme.getColor("lining") - radius: UM.Theme.getSize("default_radius").width + id: contentHeader + headerTitle: "" + anchors + { + top: parent.top + right: parent.right + left: parent.left + } + } - contentItem: Item {} - - onContentItemChanged: + Control { - // Since we want the size of the content to be set by the size of the content, - // we need to do it like this. - content.width = contentItem.width + 2 * content.padding - content.height = contentItem.height + 2 * content.padding + id: content + + anchors.top: contentHeader.bottom + padding: UM.Theme.getSize("default_margin").width + + contentItem: Item {} + + onContentItemChanged: + { + // Since we want the size of the content to be set by the size of the content, + // we need to do it like this. + content.width = contentItem.width + 2 * content.padding + content.height = contentItem.height + 2 * content.padding + } } } @@ -187,6 +213,10 @@ Item // Since it could be that the content is dynamically populated, we should also take these changes into account. target: content.contentItem onWidthChanged: content.width = content.contentItem.width + 2 * content.padding - onHeightChanged: content.height = content.contentItem.height + 2 * content.padding + onHeightChanged: + { + content.height = content.contentItem.height + 2 * content.padding + contentContainer.height = contentHeader.height + content.height + } } } diff --git a/resources/qml/ExpandablePopup.qml b/resources/qml/ExpandablePopup.qml index c15310f803..475f7f9f59 100644 --- a/resources/qml/ExpandablePopup.qml +++ b/resources/qml/ExpandablePopup.qml @@ -1,3 +1,6 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + import QtQuick 2.7 import QtQuick.Controls 2.3 diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml index 19c8067683..01886a5ea5 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml @@ -11,10 +11,11 @@ Cura.ExpandableComponent { id: printSetupSelector - property string enabledText: catalog.i18nc("@label:Should be short", "On") - property string disabledText: catalog.i18nc("@label:Should be short", "Off") + property bool preSlicedData: PrintInformation.preSliced contentPadding: UM.Theme.getSize("default_lining").width + contentHeaderTitle: catalog.i18nc("@label", "Print settings") + enabled: !preSlicedData UM.I18nCatalog { @@ -22,10 +23,7 @@ Cura.ExpandableComponent name: "cura" } - headerItem: PrintSetupSelectorHeader - { - anchors.fill: parent - } + headerItem: PrintSetupSelectorHeader {} Cura.ExtrudersModel { diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml index 313bf0830c..6c678f7ce5 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelectorContents.qml @@ -12,7 +12,7 @@ import "Custom" Item { - id: popup + id: content width: UM.Theme.getSize("print_setup_widget").width - 2 * UM.Theme.getSize("default_margin").width height: childrenRect.height @@ -36,79 +36,6 @@ Item } onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex) - - // Header of the popup - Cura.RoundedRectangle - { - id: header - height: UM.Theme.getSize("print_setup_widget_header").height - color: UM.Theme.getColor("secondary") - cornerSide: Cura.RoundedRectangle.Direction.Up - radius: UM.Theme.getSize("default_radius").width - - anchors - { - top: parent.top - right: parent.right - left: parent.left - } - - Label - { - id: headerLabel - text: catalog.i18nc("@label", "Print settings") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter - color: UM.Theme.getColor("text") - height: parent.height - - anchors - { - topMargin: UM.Theme.getSize("default_margin").height - left: parent.left - leftMargin: UM.Theme.getSize("default_margin").height - } - } - - Button - { - id: closeButton - width: UM.Theme.getSize("message_close").width - height: UM.Theme.getSize("message_close").height - hoverEnabled: true - - anchors - { - right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width - verticalCenter: parent.verticalCenter - } - - contentItem: UM.RecolorImage - { - anchors.fill: parent - sourceSize.width: width - color: closeButton.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") - source: UM.Theme.getIcon("cross1") - } - - background: Item {} - - onClicked: toggleContent() // Will hide the popup item - } - } - - Rectangle - { - id: topSeparator - - anchors.bottom: header.bottom - width: parent.width - height: UM.Theme.getSize("default_lining").height - color: UM.Theme.getColor("lining") - } - Item { id: contents @@ -118,7 +45,7 @@ Item anchors { - top: header.bottom + top: parent.top left: parent.left right: parent.right } diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml b/resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml index d4287045b8..94da5bdd6f 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml @@ -10,6 +10,9 @@ import Cura 1.0 as Cura RowLayout { + property string enabledText: catalog.i18nc("@label:Should be short", "On") + property string disabledText: catalog.i18nc("@label:Should be short", "Off") + Cura.IconWithText { source: UM.Theme.getIcon("category_layer_height") diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 0ef6c24bfb..54b41fe348 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -362,13 +362,14 @@ "print_setup_mode_toggle": [0.0, 2.0], "print_setup_item": [0.0, 2.0], "print_setup_extruder_box": [0.0, 6.0], - "print_setup_widget_header": [0.0, 3.0], "print_setup_slider_groove": [0.16, 0.16], "print_setup_slider_handle": [1.0, 1.0], "print_setup_slider_tickmarks": [0.32, 0.32], "print_setup_big_item": [28, 2.5], "print_setup_icon": [1.2, 1.2], + "expandable_component_content_header": [0.0, 3.0], + "configuration_selector_mode_tabs": [0.0, 3.0], "action_panel_widget": [25.0, 0.0], From 154c6c1ff226a820e7737dc09952043701f42069 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 13:42:33 +0100 Subject: [PATCH 064/199] Change the color of the setting control button to be the same as for the small buttons Contributes to CURA-5941. --- resources/themes/cura-light/theme.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 54b41fe348..5bad1cf7ae 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -205,9 +205,8 @@ "setting_control_border": [199, 199, 199, 255], "setting_control_border_highlight": [50, 130, 255, 255], "setting_control_text": [35, 35, 35, 255], - "setting_control_depth_line": [199, 199, 199, 255], - "setting_control_button": [199, 199, 199, 255], - "setting_control_button_hover": [70, 84, 113, 255], + "setting_control_button": [102, 102, 102, 255], + "setting_control_button_hover": [8, 7, 63, 255], "setting_control_disabled": [245, 245, 245, 255], "setting_control_disabled_text": [127, 127, 127, 255], "setting_control_disabled_border": [127, 127, 127, 255], From 90f822f6835471890a753dff0b5e4614d2d6e06b Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 13:44:50 +0100 Subject: [PATCH 065/199] Add the component header that I miss in a previous commit Contributes to CURA-5941. --- resources/qml/ExpandableComponentHeader.qml | 68 +++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 resources/qml/ExpandableComponentHeader.qml diff --git a/resources/qml/ExpandableComponentHeader.qml b/resources/qml/ExpandableComponentHeader.qml new file mode 100644 index 0000000000..b1fd49cd1b --- /dev/null +++ b/resources/qml/ExpandableComponentHeader.qml @@ -0,0 +1,68 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.3 + +import UM 1.2 as UM +import Cura 1.0 as Cura + +// Header of the popup +Cura.RoundedRectangle +{ + id: header + + property alias headerTitle: headerLabel.text + + height: UM.Theme.getSize("expandable_component_content_header").height + color: UM.Theme.getColor("secondary") + cornerSide: Cura.RoundedRectangle.Direction.Up + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("lining") + radius: UM.Theme.getSize("default_radius").width + + Label + { + id: headerLabel + text: "Title" + font: UM.Theme.getFont("default") + renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter + color: UM.Theme.getColor("small_button_text") + height: parent.height + + anchors + { + topMargin: UM.Theme.getSize("default_margin").height + left: parent.left + leftMargin: UM.Theme.getSize("default_margin").height + } + } + + Button + { + id: closeButton + width: UM.Theme.getSize("message_close").width + height: UM.Theme.getSize("message_close").height + hoverEnabled: true + + anchors + { + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width + verticalCenter: parent.verticalCenter + } + + contentItem: UM.RecolorImage + { + anchors.fill: parent + sourceSize.width: width + color: closeButton.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text") + source: UM.Theme.getIcon("cross1") + } + + background: Item {} + + onClicked: toggleContent() // Will hide the popup item + } +} \ No newline at end of file From 3f97f83c473dd015353e7ca82003042cd2d11308 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 14:17:56 +0100 Subject: [PATCH 066/199] Add a disabled state to the expandable components In this case, when the component is disabled, there is an optional message that will show. It works for instance when loading a gcode and the print setup panel has to be disabled. Contributes to CURA-5941. --- resources/qml/ExpandableComponent.qml | 70 +++++++++----- resources/qml/ExpandablePopup.qml | 96 ++++++++++++------- .../PrintSetupSelector/PrintSetupSelector.qml | 1 + 3 files changed, 110 insertions(+), 57 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 3c898caeb8..55271d99c3 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -37,6 +37,9 @@ Item property alias enabled: mouseArea.enabled + // Text to show when this component is disabled + property alias disabledText: disabledLabel.text + // Defines the alignment of the content with respect of the headerItem, by default to the right property int contentAlignment: ExpandableComponent.ContentAlignment.AlignRight @@ -85,7 +88,7 @@ Item { target: background property: "color" - value: expanded ? headerActiveColor : headerBackgroundColor + value: enabled ? (expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled") } implicitHeight: 100 * screenScaleFactor @@ -96,36 +99,55 @@ Item id: background property real padding: UM.Theme.getSize("default_margin").width - color: expanded ? headerActiveColor : headerBackgroundColor + color: base.enabled ? (base.expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled") anchors.fill: parent - Loader + Label { - id: headerItemLoader - anchors - { - left: parent.left - right: collapseButton.visible ? collapseButton.left : parent.right - top: parent.top - bottom: parent.bottom - margins: background.padding - } + id: disabledLabel + visible: !base.enabled + leftPadding: background.padding + text: "This component is disabled" + font: UM.Theme.getFont("default") + renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter + color: UM.Theme.getColor("text") + height: parent.height } - UM.RecolorImage + Item { - id: collapseButton - anchors + anchors.fill: parent + visible: base.enabled + + Loader { - right: parent.right - verticalCenter: parent.verticalCenter - margins: background.padding + id: headerItemLoader + anchors + { + left: parent.left + right: collapseButton.visible ? collapseButton.left : parent.right + top: parent.top + bottom: parent.bottom + margins: background.padding + } + } + + UM.RecolorImage + { + id: collapseButton + anchors + { + right: parent.right + verticalCenter: parent.verticalCenter + margins: background.padding + } + source: UM.Theme.getIcon("pencil") + visible: source != "" + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + color: UM.Theme.getColor("small_button_text") } - source: UM.Theme.getIcon("pencil") - visible: source != "" && base.enabled - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - color: UM.Theme.getColor("small_button_text") } MouseArea @@ -135,7 +157,7 @@ Item onClicked: toggleContent() hoverEnabled: true onEntered: background.color = headerHoverColor - onExited: background.color = expanded ? headerActiveColor : headerBackgroundColor + onExited: background.color = base.enabled ? (base.expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled") } } diff --git a/resources/qml/ExpandablePopup.qml b/resources/qml/ExpandablePopup.qml index 475f7f9f59..75f718abf5 100644 --- a/resources/qml/ExpandablePopup.qml +++ b/resources/qml/ExpandablePopup.qml @@ -37,6 +37,9 @@ Item property alias enabled: mouseArea.enabled + // Text to show when this component is disabled + property alias disabledText: disabledLabel.text + // Defines the alignment of the content with respect of the headerItem, by default to the right property int contentAlignment: ExpandablePopup.ContentAlignment.AlignRight @@ -86,6 +89,14 @@ Item } } + // Add this binding since the background color is not updated otherwise + Binding + { + target: background + property: "color" + value: enabled ? headerBackgroundColor : UM.Theme.getColor("disabled") + } + implicitHeight: 100 * screenScaleFactor implicitWidth: 400 * screenScaleFactor @@ -94,47 +105,66 @@ Item id: background property real padding: UM.Theme.getSize("default_margin").width - color: headerBackgroundColor + color: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled") anchors.fill: parent - Loader + Label { - id: headerItemLoader - anchors - { - left: parent.left - right: collapseButton.visible ? collapseButton.left : parent.right - top: parent.top - bottom: parent.bottom - margins: background.padding - } + id: disabledLabel + visible: !base.enabled + leftPadding: background.padding + text: "This component is disabled" + font: UM.Theme.getFont("default") + renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter + color: UM.Theme.getColor("text") + height: parent.height } - // A highlight that is shown when the content is expanded - Rectangle + Item { - id: expandedHighlight - width: parent.width - height: UM.Theme.getSize("thick_lining").height - color: UM.Theme.getColor("primary") - visible: expanded - anchors.bottom: parent.bottom - } + anchors.fill: parent + visible: base.enabled - UM.RecolorImage - { - id: collapseButton - anchors + Loader { - right: parent.right - verticalCenter: parent.verticalCenter - margins: background.padding + id: headerItemLoader + anchors + { + left: parent.left + right: collapseButton.visible ? collapseButton.left : parent.right + top: parent.top + bottom: parent.bottom + margins: background.padding + } + } + + // A highlight that is shown when the content is expanded + Rectangle + { + id: expandedHighlight + width: parent.width + height: UM.Theme.getSize("thick_lining").height + color: UM.Theme.getColor("primary") + visible: expanded + anchors.bottom: parent.bottom + } + + UM.RecolorImage + { + id: collapseButton + anchors + { + right: parent.right + verticalCenter: parent.verticalCenter + margins: background.padding + } + source: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") + visible: source != "" + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + color: UM.Theme.getColor("small_button_text") } - source: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") - visible: source != "" && base.enabled - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - color: UM.Theme.getColor("small_button_text") } MouseArea @@ -144,7 +174,7 @@ Item onClicked: toggleContent() hoverEnabled: true onEntered: background.color = headerHoverColor - onExited: background.color = headerBackgroundColor + onExited: background.color = base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled") } } diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml index 01886a5ea5..fe642bd3c1 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml @@ -16,6 +16,7 @@ Cura.ExpandableComponent contentPadding: UM.Theme.getSize("default_lining").width contentHeaderTitle: catalog.i18nc("@label", "Print settings") enabled: !preSlicedData + disabledText: catalog.i18nc("@label shown when we load a Gcode file", "Print setup disabled. G code file can not be modified." UM.I18nCatalog { From 437ba3848db12db4f024911c1bc6b761134f0bb0 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 14:26:20 +0100 Subject: [PATCH 067/199] Fix typo. Missing parenthesis Contributes to CURA-5941. --- resources/qml/PrintSetupSelector/PrintSetupSelector.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml index fe642bd3c1..599eac957e 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml @@ -16,7 +16,7 @@ Cura.ExpandableComponent contentPadding: UM.Theme.getSize("default_lining").width contentHeaderTitle: catalog.i18nc("@label", "Print settings") enabled: !preSlicedData - disabledText: catalog.i18nc("@label shown when we load a Gcode file", "Print setup disabled. G code file can not be modified." + disabledText: catalog.i18nc("@label shown when we load a Gcode file", "Print setup disabled. G code file can not be modified.") UM.I18nCatalog { From 315bcf50c746ee6a25aed8ae95c6245d898b7525 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 14:31:49 +0100 Subject: [PATCH 068/199] Get some personal space up in this personal space Contributes to CL-1152 --- .../resources/qml/MonitorConfigOverrideDialog.qml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index aa62afa083..14bdd07313 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -48,10 +48,7 @@ UM.Dialog anchors { fill: parent - leftMargin: 60 - rightMargin: 60 - topMargin: 18 - bottomMargin: 56 + margins: 60 * screenScaleFactor // TODO: Theme! } wrapMode: Text.WordWrap text: From 861deaa9f74f4e3bc32db5f6c8e0628406c5e2e1 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 10 Dec 2018 14:20:19 +0100 Subject: [PATCH 069/199] Add renderType native for toolbox QML Labels CURA-6006 --- plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml | 8 +++++++- plugins/Toolbox/resources/qml/ToolboxBackColumn.qml | 3 ++- .../resources/qml/ToolboxCompatibilityChart.qml | 8 +++++++- .../qml/ToolboxConfirmUninstallResetDialog.qml | 3 ++- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 11 ++++++++++- plugins/Toolbox/resources/qml/ToolboxDetailTile.qml | 4 +++- .../resources/qml/ToolboxDetailTileActions.qml | 4 +++- .../Toolbox/resources/qml/ToolboxDownloadsGrid.qml | 3 ++- .../resources/qml/ToolboxDownloadsGridTile.qml | 4 +++- .../resources/qml/ToolboxDownloadsShowcase.qml | 3 ++- .../resources/qml/ToolboxDownloadsShowcaseTile.qml | 3 ++- plugins/Toolbox/resources/qml/ToolboxErrorPage.qml | 3 ++- plugins/Toolbox/resources/qml/ToolboxFooter.qml | 5 +++-- .../Toolbox/resources/qml/ToolboxInstalledPage.qml | 4 +++- .../Toolbox/resources/qml/ToolboxInstalledTile.qml | 6 +++++- .../resources/qml/ToolboxInstalledTileActions.qml | 5 ++++- .../Toolbox/resources/qml/ToolboxLicenseDialog.qml | 3 ++- plugins/Toolbox/resources/qml/ToolboxLoadingPage.qml | 3 ++- plugins/Toolbox/resources/qml/ToolboxTabButton.qml | 5 +++-- 19 files changed, 67 insertions(+), 21 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 9c1df0c49e..7b026566c3 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.3 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -59,6 +59,7 @@ Item wrapMode: Text.WordWrap width: parent.width height: UM.Theme.getSize("toolbox_property_label").height + renderType: Text.NativeRendering } Label { @@ -70,6 +71,7 @@ Item left: title.left topMargin: UM.Theme.getSize("default_margin").height } + renderType: Text.NativeRendering } Column { @@ -88,12 +90,14 @@ Item text: catalog.i18nc("@label", "Website") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") + renderType: Text.NativeRendering } Label { text: catalog.i18nc("@label", "Email") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") + renderType: Text.NativeRendering } } Column @@ -122,6 +126,7 @@ Item color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) + renderType: Text.NativeRendering } Label @@ -138,6 +143,7 @@ Item color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) + renderType: Text.NativeRendering } } Rectangle diff --git a/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml b/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml index 8524b7d1e5..edb1967fee 100644 --- a/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml +++ b/plugins/Toolbox/resources/qml/ToolboxBackColumn.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -64,6 +64,7 @@ Item font: UM.Theme.getFont("default_bold") horizontalAlignment: Text.AlignRight width: control.width + renderType: Text.NativeRendering } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml index d4c0ae14eb..db4e8c628f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -67,6 +67,7 @@ Item wrapMode: Text.WordWrap color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering } TableView @@ -99,6 +100,7 @@ Item text: styleData.value || "" color: UM.Theme.getColor("text") font: UM.Theme.getFont("default_bold") + renderType: Text.NativeRendering } Rectangle { @@ -118,6 +120,7 @@ Item text: styleData.value || "" color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("default") + renderType: Text.NativeRendering } } itemDelegate: Item @@ -130,6 +133,7 @@ Item text: styleData.value || "" color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("default") + renderType: Text.NativeRendering } } @@ -144,6 +148,7 @@ Item elide: Text.ElideRight color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("default") + renderType: Text.NativeRendering } } @@ -232,5 +237,6 @@ Item color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) + renderType: Text.NativeRendering } } diff --git a/plugins/Toolbox/resources/qml/ToolboxConfirmUninstallResetDialog.qml b/plugins/Toolbox/resources/qml/ToolboxConfirmUninstallResetDialog.qml index 2c5d08aa72..e238132680 100644 --- a/plugins/Toolbox/resources/qml/ToolboxConfirmUninstallResetDialog.qml +++ b/plugins/Toolbox/resources/qml/ToolboxConfirmUninstallResetDialog.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.10 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 import QtQuick.Layouts 1.1 @@ -66,6 +66,7 @@ UM.Dialog anchors.right: parent.right font: UM.Theme.getFont("default") wrapMode: Text.WordWrap + renderType: Text.NativeRendering } // Buttons diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 9e2e178b71..7983be8aef 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.3 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -65,6 +65,7 @@ Item wrapMode: Text.WordWrap width: parent.width height: UM.Theme.getSize("toolbox_property_label").height + renderType: Text.NativeRendering } Column @@ -84,24 +85,28 @@ Item text: catalog.i18nc("@label", "Version") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") + renderType: Text.NativeRendering } Label { text: catalog.i18nc("@label", "Last updated") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") + renderType: Text.NativeRendering } Label { text: catalog.i18nc("@label", "Author") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") + renderType: Text.NativeRendering } Label { text: catalog.i18nc("@label", "Downloads") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") + renderType: Text.NativeRendering } } Column @@ -121,6 +126,7 @@ Item text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") + renderType: Text.NativeRendering } Label { @@ -135,6 +141,7 @@ Item } font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") + renderType: Text.NativeRendering } Label { @@ -153,12 +160,14 @@ Item color: UM.Theme.getColor("text") linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) + renderType: Text.NativeRendering } Label { text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown")) font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") + renderType: Text.NativeRendering } } Rectangle diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index 1d701543ce..43f97baf3f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -31,6 +31,7 @@ Item wrapMode: Text.WordWrap color: UM.Theme.getColor("text") font: UM.Theme.getFont("medium_bold") + renderType: Text.NativeRendering } Label { @@ -42,6 +43,7 @@ Item wrapMode: Text.WordWrap color: UM.Theme.getColor("text") font: UM.Theme.getFont("default") + renderType: Text.NativeRendering } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml index 848acfbf4f..7160dafa2d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -57,6 +57,8 @@ Column linkColor: UM.Theme.getColor("text_link") visible: loginRequired width: installButton.width + renderType: Text.NativeRendering + MouseArea { anchors.fill: parent diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml index 3e2643938b..8e15882ae1 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 @@ -23,6 +23,7 @@ Column width: parent.width color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering } Grid { diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index cee3f0fd20..357e9e9a72 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.3 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 @@ -72,6 +72,7 @@ Item wrapMode: Text.WordWrap color: UM.Theme.getColor("text") font: UM.Theme.getFont("default_bold") + renderType: Text.NativeRendering } Label { @@ -83,6 +84,7 @@ Item wrapMode: Text.WordWrap color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("default") + renderType: Text.NativeRendering } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml index 9851128076..820b74554a 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcase.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -24,6 +24,7 @@ Rectangle width: parent.width color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering } Grid { diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index 8a2fdc8bc8..d1130cf63f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtGraphicalEffects 1.0 @@ -79,6 +79,7 @@ Rectangle wrapMode: Text.WordWrap color: UM.Theme.getColor("button_text") font: UM.Theme.getFont("medium_bold") + renderType: Text.NativeRendering } } MouseArea diff --git a/plugins/Toolbox/resources/qml/ToolboxErrorPage.qml b/plugins/Toolbox/resources/qml/ToolboxErrorPage.qml index 600ae2b39f..e57e63dbb9 100644 --- a/plugins/Toolbox/resources/qml/ToolboxErrorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxErrorPage.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 @@ -18,5 +18,6 @@ Rectangle { centerIn: parent } + renderType: Text.NativeRendering } } diff --git a/plugins/Toolbox/resources/qml/ToolboxFooter.qml b/plugins/Toolbox/resources/qml/ToolboxFooter.qml index 5c2a6577ad..2d42ca7269 100644 --- a/plugins/Toolbox/resources/qml/ToolboxFooter.qml +++ b/plugins/Toolbox/resources/qml/ToolboxFooter.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -26,7 +26,7 @@ Item right: restartButton.right rightMargin: UM.Theme.getSize("default_margin").width } - + renderType: Text.NativeRendering } Button { @@ -56,6 +56,7 @@ Item text: control.text verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter + renderType: Text.NativeRendering } } } diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index 3d5cd1c8d4..e1d01db59a 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 @@ -38,6 +38,7 @@ ScrollView text: catalog.i18nc("@title:tab", "Plugins") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering } Rectangle { @@ -68,6 +69,7 @@ ScrollView text: catalog.i18nc("@title:tab", "Materials") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering } Rectangle diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index b16564fdd2..593e024309 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -51,6 +51,7 @@ Item wrapMode: Text.WordWrap font: UM.Theme.getFont("default_bold") color: pluginInfo.color + renderType: Text.NativeRendering } Label { @@ -60,6 +61,7 @@ Item width: parent.width wrapMode: Text.WordWrap color: pluginInfo.color + renderType: Text.NativeRendering } } Column @@ -88,6 +90,7 @@ Item onLinkActivated: Qt.openUrlExternally("mailto:" + model.author_email + "?Subject=Cura: " + model.name + " Plugin") color: model.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("lining") linkColor: UM.Theme.getColor("text_link") + renderType: Text.NativeRendering } Label @@ -98,6 +101,7 @@ Item color: UM.Theme.getColor("text") verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignLeft + renderType: Text.NativeRendering } } ToolboxInstalledTileActions diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml index 39528f6437..61af84fbe5 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTileActions.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -24,6 +24,7 @@ Column font: UM.Theme.getFont("default") wrapMode: Text.WordWrap width: parent.width + renderType: Text.NativeRendering } ToolboxProgressButton @@ -55,6 +56,8 @@ Column linkColor: UM.Theme.getColor("text_link") visible: loginRequired width: updateButton.width + renderType: Text.NativeRendering + MouseArea { anchors.fill: parent diff --git a/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml b/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml index b8baf7bc83..40b22c268d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml +++ b/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.10 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.2 import QtQuick.Controls 1.4 @@ -32,6 +32,7 @@ UM.Dialog anchors.right: parent.right text: licenseDialog.pluginName + catalog.i18nc("@label", "This plugin contains a license.\nYou need to accept this license to install this plugin.\nDo you agree with the terms below?") wrapMode: Text.Wrap + renderType: Text.NativeRendering } TextArea { diff --git a/plugins/Toolbox/resources/qml/ToolboxLoadingPage.qml b/plugins/Toolbox/resources/qml/ToolboxLoadingPage.qml index 1ba271dcab..025239bd43 100644 --- a/plugins/Toolbox/resources/qml/ToolboxLoadingPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxLoadingPage.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 +import QtQuick 2.10 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 @@ -18,5 +18,6 @@ Rectangle { centerIn: parent } + renderType: Text.NativeRendering } } diff --git a/plugins/Toolbox/resources/qml/ToolboxTabButton.qml b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml index fa4f75d6fe..5e1aeaa636 100644 --- a/plugins/Toolbox/resources/qml/ToolboxTabButton.qml +++ b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml @@ -1,8 +1,8 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 2.0 +import QtQuick 2.10 +import QtQuick.Controls 2.3 import UM 1.1 as UM Button @@ -46,5 +46,6 @@ Button font: control.enabled ? (control.active ? UM.Theme.getFont("medium_bold") : UM.Theme.getFont("medium")) : UM.Theme.getFont("default_italic") verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter + renderType: Text.NativeRendering } } \ No newline at end of file From 69744282e6208ef959035c7237a9685d9d85b819 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 10 Dec 2018 14:37:44 +0100 Subject: [PATCH 070/199] Fix rounding issue in toolbox QML widget size CURA-6006 --- plugins/Toolbox/resources/qml/Toolbox.qml | 4 ++-- plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index 7cc5a730f2..9ede2a6bda 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -14,8 +14,8 @@ Window modality: Qt.ApplicationModal flags: Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint - width: 720 * screenScaleFactor - height: 640 * screenScaleFactor + width: Math.floor(720 * screenScaleFactor) + height: Math.floor(640 * screenScaleFactor) minimumWidth: width maximumWidth: minimumWidth minimumHeight: height diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml index 8e15882ae1..85f0ff8be4 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml @@ -38,7 +38,7 @@ Column delegate: Loader { asynchronous: true - width: (grid.width - (grid.columns - 1) * grid.columnSpacing) / grid.columns + width: Math.round((grid.width - (grid.columns - 1) * grid.columnSpacing) / grid.columns) height: UM.Theme.getSize("toolbox_thumbnail_small").height source: "ToolboxDownloadsGridTile.qml" } From df0ae20ddedf42040dee95243a5a236a0a65afea Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 14:39:15 +0100 Subject: [PATCH 071/199] Let's just get stepped up in here and get some personal space Contributes to CL-1152 --- .../resources/qml/MonitorConfigOverrideDialog.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index 14bdd07313..a283824bcf 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -48,7 +48,8 @@ UM.Dialog anchors { fill: parent - margins: 60 * screenScaleFactor // TODO: Theme! + margins: 36 * screenScaleFactor // TODO: Theme! + bottomMargin: 56 * screenScaleFactor // TODO: Theme! } wrapMode: Text.WordWrap text: @@ -62,7 +63,7 @@ UM.Dialog { topLine = catalog.i18nc("@label", "The printer %1 is assigned, but the job contains an unknown material configuration.").arg(printer.name) } - var result = "

" + topLine +"

" + var result = "

" + topLine +"

\n\n" for (var i = 0; i < printer.activePrintJob.configurationChanges.length; i++) { var change = printer.activePrintJob.configurationChanges[i] From 590e8f5eb19cff433d1d5e1926dd4bcb89f4ea76 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 14:41:15 +0100 Subject: [PATCH 072/199] Wrap the disabled text in case it's too long. Contributes to CURA-5941. --- resources/qml/ExpandableComponent.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 55271d99c3..74adec5bc6 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -106,13 +106,15 @@ Item { id: disabledLabel visible: !base.enabled + anchors.fill: parent leftPadding: background.padding + rightPadding: background.padding text: "This component is disabled" font: UM.Theme.getFont("default") renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter color: UM.Theme.getColor("text") - height: parent.height + wrapMode: Text.WordWrap } Item From aa376e60da409e87f49150900570cb957dbfd610 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 14:45:11 +0100 Subject: [PATCH 073/199] Make the disabled text translatable Contributes to CURA-5941. --- resources/qml/ExpandableComponent.qml | 2 +- resources/qml/ExpandableComponentHeader.qml | 2 +- resources/qml/ExpandablePopup.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 74adec5bc6..c2b9d715d5 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -109,7 +109,7 @@ Item anchors.fill: parent leftPadding: background.padding rightPadding: background.padding - text: "This component is disabled" + text: catalog.i18nc("@label default disabled text", "This component is disabled") font: UM.Theme.getFont("default") renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter diff --git a/resources/qml/ExpandableComponentHeader.qml b/resources/qml/ExpandableComponentHeader.qml index b1fd49cd1b..09ea262c82 100644 --- a/resources/qml/ExpandableComponentHeader.qml +++ b/resources/qml/ExpandableComponentHeader.qml @@ -24,7 +24,7 @@ Cura.RoundedRectangle Label { id: headerLabel - text: "Title" + text: "" font: UM.Theme.getFont("default") renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter diff --git a/resources/qml/ExpandablePopup.qml b/resources/qml/ExpandablePopup.qml index 75f718abf5..2d34b134e0 100644 --- a/resources/qml/ExpandablePopup.qml +++ b/resources/qml/ExpandablePopup.qml @@ -113,7 +113,7 @@ Item id: disabledLabel visible: !base.enabled leftPadding: background.padding - text: "This component is disabled" + text: catalog.i18nc("@label default disabled text", "This component is disabled") font: UM.Theme.getFont("default") renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter From 2db5d2b23128be682e97ff34f5bbcf67aef1ccca Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 14:54:45 +0100 Subject: [PATCH 074/199] Add support for translation plurals Contributes to CL-1152 --- .../resources/qml/MonitorConfigOverrideDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index a283824bcf..127078d460 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -57,7 +57,7 @@ UM.Dialog var topLine if (materialsAreKnown(printer.activePrintJob)) { - topLine = catalog.i18nc("@label", "The assigned printer, %1, requires the following configuration change(s):").arg(printer.name) + topLine = catalog.i18ncp("@label", "The assigned printer, %1, requires the following configuration change:", "The assigned printer, %1, requires the following configuration changes:").arg(printer.name) } else { From 32f2b7ec1f293c4dde0b6575aa469e3d1c40aa8c Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 15:05:01 +0100 Subject: [PATCH 075/199] Fix some warnings Contributes to CL-1152 --- .../resources/qml/MonitorConfigOverrideDialog.qml | 4 ++++ .../resources/qml/MonitorPrintJobPreview.qml | 4 ++++ .../resources/qml/MonitorPrintJobProgressBar.qml | 2 +- .../UM3NetworkPrinting/resources/qml/PrintJobContextMenu.qml | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index 127078d460..cf8326a504 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -54,6 +54,10 @@ UM.Dialog wrapMode: Text.WordWrap text: { + if (!printer.activePrintJob) + { + return "" + } var topLine if (materialsAreKnown(printer.activePrintJob)) { diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml index 5acd350abb..2f17db0c65 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobPreview.qml @@ -60,6 +60,10 @@ Item height: 0.5 * printJobPreview.height source: { + if (!printJob) + { + return "" + } if (printJob.configurationChanges.length > 0) { return "../svg/warning-icon.svg" diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml index e646172a6c..cfb7aba84d 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobProgressBar.qml @@ -55,7 +55,7 @@ Item left: progressBar.right leftMargin: 18 * screenScaleFactor // TODO: Theme! } - text: Math.round(printJob.progress * 100) + "%" + text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%" color: printJob && printJob.isActive ? "#374355" : "#babac1" // TODO: Theme! width: contentWidth font: UM.Theme.getFont("medium") // 14pt, regular diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenu.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenu.qml index 02a8e7ae69..1edbf9f6a2 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenu.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenu.qml @@ -182,7 +182,7 @@ Item { abortConfirmationDialog.visible = true; popup.close(); } - text: printJob.state == "aborting" ? catalog.i18nc("@label", "Aborting...") : catalog.i18nc("@label", "Abort"); + text: printJob && printJob.state == "aborting" ? catalog.i18nc("@label", "Aborting...") : catalog.i18nc("@label", "Abort"); visible: { if (!printJob) { return false; From 028d993babdff046b9404a84271b07b00e426fef Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 15:27:51 +0100 Subject: [PATCH 076/199] Format .gcode.gz files too Contributes to CL-1152 --- .../resources/qml/MonitorConfigOverrideDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index cf8326a504..df3c99e0a1 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -96,7 +96,7 @@ UM.Dialog } // Utils function formatPrintJobName(name) { - var extensions = [ ".gz", ".gcode", ".ufp" ]; + var extensions = [ ".gz", ".gcode", ".gcode.gz", ".ufp" ]; for (var i = 0; i < extensions.length; i++) { var extension = extensions[i]; if (name.slice(-extension.length) === extension) { From d495ec18bb7ab42de07bfb3617c00e7598a20e9e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Dec 2018 15:28:20 +0100 Subject: [PATCH 077/199] Filter a bit more intelligently on when to check for errors CURA-6016 --- cura/Machines/MachineErrorChecker.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cura/Machines/MachineErrorChecker.py b/cura/Machines/MachineErrorChecker.py index 06f064315b..fb11123af6 100644 --- a/cura/Machines/MachineErrorChecker.py +++ b/cura/Machines/MachineErrorChecker.py @@ -64,21 +64,21 @@ class MachineErrorChecker(QObject): def _onMachineChanged(self) -> None: if self._global_stack: - self._global_stack.propertyChanged.disconnect(self.startErrorCheck) + self._global_stack.propertyChanged.disconnect(self.startErrorCheckPropertyChanged) self._global_stack.containersChanged.disconnect(self.startErrorCheck) for extruder in self._global_stack.extruders.values(): - extruder.propertyChanged.disconnect(self.startErrorCheck) + extruder.propertyChanged.disconnect(self.startErrorCheckPropertyChanged) extruder.containersChanged.disconnect(self.startErrorCheck) self._global_stack = self._machine_manager.activeMachine if self._global_stack: - self._global_stack.propertyChanged.connect(self.startErrorCheck) + self._global_stack.propertyChanged.connect(self.startErrorCheckPropertyChanged) self._global_stack.containersChanged.connect(self.startErrorCheck) for extruder in self._global_stack.extruders.values(): - extruder.propertyChanged.connect(self.startErrorCheck) + extruder.propertyChanged.connect(self.startErrorCheckPropertyChanged) extruder.containersChanged.connect(self.startErrorCheck) hasErrorUpdated = pyqtSignal() @@ -93,6 +93,13 @@ class MachineErrorChecker(QObject): def needToWaitForResult(self) -> bool: return self._need_to_check or self._check_in_progress + # Start the error check for property changed + # this is seperate from the startErrorCheck because it ignores a number property types + def startErrorCheckPropertyChanged(self, key, property_name): + if property_name != "value": + return + self.startErrorCheck() + # Starts the error check timer to schedule a new error check. def startErrorCheck(self, *args) -> None: if not self._check_in_progress: From 04af8fbd5018d7bfdf488ddd98b1d4ccabab1bfb Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 15:33:16 +0100 Subject: [PATCH 078/199] Update MonitorConfigOverrideDialog.qml Contributes to CL-1152 --- .../resources/qml/MonitorConfigOverrideDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index df3c99e0a1..7f7dc24350 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -96,7 +96,7 @@ UM.Dialog } // Utils function formatPrintJobName(name) { - var extensions = [ ".gz", ".gcode", ".gcode.gz", ".ufp" ]; + var extensions = [ ".gcode.gz", ".gz", ".gcode", ".ufp" ]; for (var i = 0; i < extensions.length; i++) { var extension = extensions[i]; if (name.slice(-extension.length) === extension) { From 1cd0d26db420af72d92c5b2538caa93a44495dcb Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 15:34:48 +0100 Subject: [PATCH 079/199] Change margins Instead of using multiplications and divisions, just use the corresponding margins. Contributes to CURA-5876. --- resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml | 2 +- .../qml/Menus/ConfigurationMenu/ConfigurationListView.qml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 05cac16e29..728a0cbe9a 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -29,7 +29,7 @@ Button id: contentColumn width: parent.width padding: UM.Theme.getSize("wide_margin").width - spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) + spacing: UM.Theme.getSize("narrow_margin").height Row { diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 53969a0370..3cc0754284 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -12,7 +12,7 @@ Column id: base property var outputDevice: null height: childrenRect.height + 2 * padding - spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) + spacing: UM.Theme.getSize("narrow_margin").height function forceModelUpdate() { @@ -55,7 +55,7 @@ Column ListView { id: configurationList - spacing: Math.round(UM.Theme.getSize("default_margin").height / 2) + spacing: UM.Theme.getSize("narrow_margin").height width: container.width - ((height > container.maximumHeight) ? container.ScrollBar.vertical.background.width : 0) //Make room for scroll bar if there is any. contentHeight: childrenRect.height height: childrenRect.height @@ -64,7 +64,7 @@ Column section.criteria: ViewSection.FullString section.delegate: Item { - height: printerTypeLabel.height + UM.Theme.getSize("default_margin").height * 2 //Causes a default margin above the label and a default margin below the label. + height: printerTypeLabel.height + UM.Theme.getSize("wide_margin").height //Causes a default margin above the label and a default margin below the label. Cura.PrinterTypeLabel { id: printerTypeLabel From 11d8831d7a9a15e3e916d5d9762bfe1f755042e5 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 15:40:18 +0100 Subject: [PATCH 080/199] Use the capitalized version of the buildplate name --- cura/PrinterOutput/ConfigurationModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PrinterOutput/ConfigurationModel.py b/cura/PrinterOutput/ConfigurationModel.py index 89e609c913..6f55aa3b1f 100644 --- a/cura/PrinterOutput/ConfigurationModel.py +++ b/cura/PrinterOutput/ConfigurationModel.py @@ -44,7 +44,7 @@ class ConfigurationModel(QObject): @pyqtProperty(str, fset = setBuildplateConfiguration, notify = configurationChanged) def buildplateConfiguration(self) -> str: - return self._buildplate_configuration + return self._buildplate_configuration.capitalize() ## This method is intended to indicate whether the configuration is valid or not. # The method checks if the mandatory fields are or not set From 0e19fa731f8bc391c3b17ab33db0197410633ef0 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 10 Dec 2018 15:47:45 +0100 Subject: [PATCH 081/199] Codestyle Contributes to CL-1152 --- .../qml/MonitorConfigOverrideDialog.qml | 51 +++++++++++-------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index 7f7dc24350..1b9a03ea99 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -95,39 +95,46 @@ UM.Dialog } } // Utils - function formatPrintJobName(name) { - var extensions = [ ".gcode.gz", ".gz", ".gcode", ".ufp" ]; - for (var i = 0; i < extensions.length; i++) { - var extension = extensions[i]; - if (name.slice(-extension.length) === extension) { - name = name.substring(0, name.length - extension.length); + function formatPrintJobName(name) + { + var extensions = [ ".gcode.gz", ".gz", ".gcode", ".ufp" ] + for (var i = 0; i < extensions.length; i++) + { + var extension = extensions[i] + if (name.slice(-extension.length) === extension) + { + name = name.substring(0, name.length - extension.length) } } return name; } - function materialsAreKnown(job) { - var conf0 = job.configuration[0]; - if (conf0 && !conf0.material.material) { - return false; + function materialsAreKnown(job) + { + var conf0 = job.configuration[0] + if (conf0 && !conf0.material.material) + { + return false } - var conf1 = job.configuration[1]; - if (conf1 && !conf1.material.material) { - return false; + var conf1 = job.configuration[1] + if (conf1 && !conf1.material.material) + { + return false } - return true; + return true } - function formatBuildPlateType(buildPlateType) { - var translationText = ""; + function formatBuildPlateType(buildPlateType) + { + var translationText = "" switch (buildPlateType) { case "glass": - translationText = catalog.i18nc("@label", "Glass"); - break; + translationText = catalog.i18nc("@label", "Glass") + break case "aluminum": - translationText = catalog.i18nc("@label", "Aluminum"); - break; + translationText = catalog.i18nc("@label", "Aluminum") + break default: - translationText = null; + translationText = null } - return translationText; + return translationText } } \ No newline at end of file From 4fc4aecf17e33da689463c0d899f36a564fe2f83 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 15:48:59 +0100 Subject: [PATCH 082/199] Avoid the overlapping of text when the name is too long Normally I happens in other languages other than English. --- resources/qml/ViewsSelector.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index ed0b694aed..f2906f9d4c 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -60,6 +60,7 @@ Cura.ExpandablePopup { left: title.right leftMargin: UM.Theme.getSize("default_margin").width + right: parent.right } height: parent.height elide: Text.ElideRight From 1436301d780572e976ed0c62edbebee42a404729 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Dec 2018 16:20:00 +0100 Subject: [PATCH 083/199] Ensure setActiveExtruderIndex only gets called once when switching machines CURA-6016 --- cura/Settings/ExtruderManager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cura/Settings/ExtruderManager.py b/cura/Settings/ExtruderManager.py index b0bcf3b100..8fa0172305 100755 --- a/cura/Settings/ExtruderManager.py +++ b/cura/Settings/ExtruderManager.py @@ -83,8 +83,9 @@ class ExtruderManager(QObject): # \param index The index of the new active extruder. @pyqtSlot(int) def setActiveExtruderIndex(self, index: int) -> None: - self._active_extruder_index = index - self.activeExtruderChanged.emit() + if self._active_extruder_index != index: + self._active_extruder_index = index + self.activeExtruderChanged.emit() @pyqtProperty(int, notify = activeExtruderChanged) def activeExtruderIndex(self) -> int: @@ -344,6 +345,7 @@ class ExtruderManager(QObject): if extruders_changed: self.extrudersChanged.emit(global_stack_id) self.setActiveExtruderIndex(0) + self.activeExtruderChanged.emit() # After 3.4, all single-extrusion machines have their own extruder definition files instead of reusing # "fdmextruder". We need to check a machine here so its extruder definition is correct according to this. From 3132b1f689ad6f83479db5bd19a071e6d47bf74e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 10 Dec 2018 16:56:44 +0100 Subject: [PATCH 084/199] Update the extruder Model a whole lot less CURA-6016 --- cura/Settings/ExtrudersModel.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cura/Settings/ExtrudersModel.py b/cura/Settings/ExtrudersModel.py index 5f10ac99d4..e19617c8ef 100644 --- a/cura/Settings/ExtrudersModel.py +++ b/cura/Settings/ExtrudersModel.py @@ -224,6 +224,6 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): "definition": "" } items.append(item) - - self.setItems(items) - self.modelChanged.emit() + if self._items != items: + self.setItems(items) + self.modelChanged.emit() From 716fedc7820c6a406d3ba431d99284e264cc5541 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 10 Dec 2018 17:06:51 +0100 Subject: [PATCH 085/199] Use no text by default for the disabled state of the panels Contributes to CURA-5941. --- resources/qml/ExpandableComponent.qml | 2 +- resources/qml/ExpandablePopup.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index c2b9d715d5..2b07aa7d37 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -109,7 +109,7 @@ Item anchors.fill: parent leftPadding: background.padding rightPadding: background.padding - text: catalog.i18nc("@label default disabled text", "This component is disabled") + text: "" font: UM.Theme.getFont("default") renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter diff --git a/resources/qml/ExpandablePopup.qml b/resources/qml/ExpandablePopup.qml index 2d34b134e0..4bf1684f18 100644 --- a/resources/qml/ExpandablePopup.qml +++ b/resources/qml/ExpandablePopup.qml @@ -113,7 +113,7 @@ Item id: disabledLabel visible: !base.enabled leftPadding: background.padding - text: catalog.i18nc("@label default disabled text", "This component is disabled") + text: "" font: UM.Theme.getFont("default") renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter From 909f36d28ede29c0c9fc5f69db7f8941fc5a8429 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Dec 2018 09:24:22 +0100 Subject: [PATCH 086/199] Let the settingsMenu use the extruders of the active machine instead of the extruderModel The extruder model gets updated way to much (for all material changes) but we only need the number and names of the extruders, since the other menu's do this by themselves --- cura/Settings/GlobalStack.py | 16 +++++++++++++--- resources/qml/Menus/SettingsMenu.qml | 5 +++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index da1ec61254..44ceee9511 100755 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -3,8 +3,8 @@ from collections import defaultdict import threading -from typing import Any, Dict, Optional, Set, TYPE_CHECKING -from PyQt5.QtCore import pyqtProperty, pyqtSlot +from typing import Any, Dict, Optional, Set, TYPE_CHECKING, List +from PyQt5.QtCore import pyqtProperty, pyqtSlot, pyqtSignal from UM.Decorators import override from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase @@ -42,13 +42,23 @@ class GlobalStack(CuraContainerStack): # Per thread we have our own resolving_settings, or strange things sometimes occur. self._resolving_settings = defaultdict(set) #type: Dict[str, Set[str]] # keys are thread names + extrudersChanged = pyqtSignal() + ## Get the list of extruders of this stack. # # \return The extruders registered with this stack. - @pyqtProperty("QVariantMap") + @pyqtProperty("QVariantMap", notify = extrudersChanged) def extruders(self) -> Dict[str, "ExtruderStack"]: return self._extruders + @pyqtProperty("QVariantList", notify = extrudersChanged) + def extruderList(self) -> List["ExtruderStack"]: + result_tuple_list = sorted(list(self.extruders.items()), key=lambda x: int(x[0])) + result_list = [item[1] for item in result_tuple_list] + + machine_extruder_count = self.getProperty("machine_extruder_count", "value") + return result_list[:machine_extruder_count] + @classmethod def getLoadingPriority(cls) -> int: return 2 diff --git a/resources/qml/Menus/SettingsMenu.qml b/resources/qml/Menus/SettingsMenu.qml index 79f8c5b7bf..4ea3a4d71a 100644 --- a/resources/qml/Menus/SettingsMenu.qml +++ b/resources/qml/Menus/SettingsMenu.qml @@ -16,10 +16,11 @@ Menu Instantiator { - model: Cura.ExtrudersModel { simpleNames: true } + model: Cura.MachineManager.activeMachine.extruderList + Menu { - title: model.name + title: modelData.name NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.hasVariants; extruderIndex: index } MaterialMenu { title: catalog.i18nc("@title:menu", "&Material"); visible: Cura.MachineManager.hasMaterials; extruderIndex: index } From bb1950525a5e67ae9ee0e7163d720e0d14b72f16 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Dec 2018 09:42:34 +0100 Subject: [PATCH 087/199] Limit the amount of times the buildplate rebuild is done CURA-6016 --- cura/BuildVolume.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index f837f5cef7..aa1f170707 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -83,7 +83,14 @@ class BuildVolume(SceneNode): " with printed models."), title = catalog.i18nc("@info:title", "Build Volume")) self._global_container_stack = None + + self._stack_change_timer = QTimer() + self._stack_change_timer.setInterval(100) + self._stack_change_timer.setSingleShot(True) + self._stack_change_timer.timeout.connect(self._onStackChangeTimerFinished) + self._application.globalContainerStackChanged.connect(self._onStackChanged) + self._onStackChanged() self._engine_ready = False @@ -105,6 +112,8 @@ class BuildVolume(SceneNode): self._setting_change_timer.setSingleShot(True) self._setting_change_timer.timeout.connect(self._onSettingChangeTimerFinished) + + # Must be after setting _build_volume_message, apparently that is used in getMachineManager. # activeQualityChanged is always emitted after setActiveVariant, setActiveMaterial and setActiveQuality. # Therefore this works. @@ -526,8 +535,11 @@ class BuildVolume(SceneNode): if extra_z != self._extra_z_clearance: self._extra_z_clearance = extra_z - ## Update the build volume visualization def _onStackChanged(self): + self._stack_change_timer.start() + + ## Update the build volume visualization + def _onStackChangeTimerFinished(self): if self._global_container_stack: self._global_container_stack.propertyChanged.disconnect(self._onSettingPropertyChanged) extruders = ExtruderManager.getInstance().getActiveExtruderStacks() From 77703e1fb8f2a0c60a56126b9ccc90d5aba8f8a3 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 09:58:23 +0100 Subject: [PATCH 088/199] Catch an exception from numpy that happens when loading some models --- cura/Scene/ConvexHullDecorator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py index 0c03ae615b..661106dec7 100644 --- a/cura/Scene/ConvexHullDecorator.py +++ b/cura/Scene/ConvexHullDecorator.py @@ -187,7 +187,10 @@ class ConvexHullDecorator(SceneNodeDecorator): for child in self._node.getChildren(): child_hull = child.callDecoration("_compute2DConvexHull") if child_hull: - points = numpy.append(points, child_hull.getPoints(), axis = 0) + try: + points = numpy.append(points, child_hull.getPoints(), axis = 0) + except ValueError: + pass if points.size < 3: return None From 4dab33d41babdb0d961d3d1bcb54479b5e8c3691 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 10:44:30 +0100 Subject: [PATCH 089/199] Remove the fancy snowflakes pattern --- resources/qml/Cura.qml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 3e019cdcd5..a4faa27b67 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -123,17 +123,6 @@ UM.MainWindow } } } - - // This is the new fancy pattern - Image - { - id: backgroundPattern - anchors.fill: parent - fillMode: Image.Tile - source: UM.Theme.getImage("header_pattern") - horizontalAlignment: Image.AlignLeft - verticalAlignment: Image.AlignTop - } } MainWindowHeader From 0f357e1078b6a30a5b3ddda88bbc9fcd736f0bb4 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 11 Dec 2018 10:51:05 +0100 Subject: [PATCH 090/199] Replace fix for 'None' materials This was fixed in 4.0 and accidentally got reverted when merging another branch in. Contributes to CL-1160 --- .../UM3NetworkPrinting/src/ClusterUM3OutputDevice.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index 08592df603..60474156a8 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -609,6 +609,17 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): material_manager = CuraApplication.getInstance().getMaterialManager() material_group_list = material_manager.getMaterialGroupListByGUID(material_data["guid"]) + # This can happen if the connected machine has no material in one or more extruders (if GUID is empty), or the + # material is unknown to Cura, so we should return an "empty" or "unknown" material model. + if material_group_list is None: + material_name = "Empty" if len(material_data["guid"]) == 0 else "Unknown" + return MaterialOutputModel(guid = material_data["guid"], + type = material_data.get("type", ""), + color = material_data.get("color", ""), + brand = material_data.get("brand", ""), + name = material_data.get("name", material_name) + ) + # Sort the material groups by "is_read_only = True" first, and then the name alphabetically. read_only_material_group_list = list(filter(lambda x: x.is_read_only, material_group_list)) non_read_only_material_group_list = list(filter(lambda x: not x.is_read_only, material_group_list)) From f67ac8d7c4f937a323f8b1a520abfaecad5b438a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Dec 2018 10:59:17 +0100 Subject: [PATCH 091/199] Update far less agressively for the material models CURA-6016 --- cura/Machines/Models/BaseMaterialsModel.py | 14 ++++++++++---- cura/Machines/Models/FavoriteMaterialsModel.py | 5 +---- cura/Machines/Models/GenericMaterialsModel.py | 3 --- cura/Machines/Models/MaterialBrandsModel.py | 4 ---- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/cura/Machines/Models/BaseMaterialsModel.py b/cura/Machines/Models/BaseMaterialsModel.py index ef2e760330..3cd92bb6b4 100644 --- a/cura/Machines/Models/BaseMaterialsModel.py +++ b/cura/Machines/Models/BaseMaterialsModel.py @@ -1,5 +1,6 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from typing import Optional, Dict, Set from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty from UM.Qt.ListModel import ListModel @@ -9,6 +10,9 @@ from UM.Qt.ListModel import ListModel # Those 2 models are used by the material drop down menu to show generic materials and branded materials separately. # The extruder position defined here is being used to bound a menu to the correct extruder. This is used in the top # bar menu "Settings" -> "Extruder nr" -> "Material" -> this menu +from cura.Machines.MaterialNode import MaterialNode + + class BaseMaterialsModel(ListModel): extruderPositionChanged = pyqtSignal() @@ -54,8 +58,8 @@ class BaseMaterialsModel(ListModel): self._extruder_position = 0 self._extruder_stack = None - self._available_materials = None - self._favorite_ids = None + self._available_materials = None # type: Optional[Dict[str, MaterialNode]] + self._favorite_ids = set() # type: Set(str) def _updateExtruderStack(self): global_stack = self._machine_manager.activeMachine @@ -102,8 +106,10 @@ class BaseMaterialsModel(ListModel): return False extruder_stack = global_stack.extruders[extruder_position] - - self._available_materials = self._material_manager.getAvailableMaterialsForMachineExtruder(global_stack, extruder_stack) + available_materials = self._material_manager.getAvailableMaterialsForMachineExtruder(global_stack, extruder_stack) + if available_materials == self._available_materials: + return False + self._available_materials = available_materials if self._available_materials is None: return False diff --git a/cura/Machines/Models/FavoriteMaterialsModel.py b/cura/Machines/Models/FavoriteMaterialsModel.py index 18fe310c44..cc273e55ce 100644 --- a/cura/Machines/Models/FavoriteMaterialsModel.py +++ b/cura/Machines/Models/FavoriteMaterialsModel.py @@ -4,17 +4,14 @@ from UM.Logger import Logger from cura.Machines.Models.BaseMaterialsModel import BaseMaterialsModel -class FavoriteMaterialsModel(BaseMaterialsModel): +class FavoriteMaterialsModel(BaseMaterialsModel): def __init__(self, parent = None): super().__init__(parent) self._update() def _update(self): - - # Perform standard check and reset if the check fails if not self._canUpdate(): - self.setItems([]) return # Get updated list of favorites diff --git a/cura/Machines/Models/GenericMaterialsModel.py b/cura/Machines/Models/GenericMaterialsModel.py index c276b865bf..8f41dd6a70 100644 --- a/cura/Machines/Models/GenericMaterialsModel.py +++ b/cura/Machines/Models/GenericMaterialsModel.py @@ -11,10 +11,7 @@ class GenericMaterialsModel(BaseMaterialsModel): self._update() def _update(self): - - # Perform standard check and reset if the check fails if not self._canUpdate(): - self.setItems([]) return # Get updated list of favorites diff --git a/cura/Machines/Models/MaterialBrandsModel.py b/cura/Machines/Models/MaterialBrandsModel.py index 458e4d9b47..ac82cf6670 100644 --- a/cura/Machines/Models/MaterialBrandsModel.py +++ b/cura/Machines/Models/MaterialBrandsModel.py @@ -28,12 +28,8 @@ class MaterialBrandsModel(BaseMaterialsModel): self._update() def _update(self): - - # Perform standard check and reset if the check fails if not self._canUpdate(): - self.setItems([]) return - # Get updated list of favorites self._favorite_ids = self._material_manager.getFavorites() From 4b6f4af44eeef9b0d39c3161d7e577d66d57388c Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 11:10:45 +0100 Subject: [PATCH 092/199] Close the expandable panel when it becomes disabled It happens when it's open and the user loads a GCode. Contributes to CURA-5941 --- resources/qml/ExpandableComponent.qml | 18 +++++++++++++++++- resources/qml/ExpandablePopup.qml | 15 ++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index 2b07aa7d37..afe15bcb1d 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -88,7 +88,23 @@ Item { target: background property: "color" - value: enabled ? (expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled") + value: + { + return base.enabled ? (expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled") + } + } + + // The panel needs to close when it becomes disabled + Connections + { + target: base + onEnabledChanged: + { + if (!base.enabled && expanded) + { + toggleContent() + } + } } implicitHeight: 100 * screenScaleFactor diff --git a/resources/qml/ExpandablePopup.qml b/resources/qml/ExpandablePopup.qml index 4bf1684f18..2d2665373e 100644 --- a/resources/qml/ExpandablePopup.qml +++ b/resources/qml/ExpandablePopup.qml @@ -94,7 +94,20 @@ Item { target: background property: "color" - value: enabled ? headerBackgroundColor : UM.Theme.getColor("disabled") + value: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled") + } + + // The panel needs to close when it becomes disabled + Connections + { + target: base + onEnabledChanged: + { + if (!base.enabled && expanded) + { + toggleContent() + } + } } implicitHeight: 100 * screenScaleFactor From 2b2e8ebb31ffaacdcd6cac3851585de94af556c4 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 11:37:01 +0100 Subject: [PATCH 093/199] Add some safety checks when checking for the guid of the material Don't crash if the guid doesn't exist. Contributes to CL-1160. --- .../UM3NetworkPrinting/src/ClusterUM3OutputDevice.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index 60474156a8..d39cf6e41c 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -607,13 +607,18 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): def _createMaterialOutputModel(self, material_data: Dict[str, Any]) -> "MaterialOutputModel": material_manager = CuraApplication.getInstance().getMaterialManager() - material_group_list = material_manager.getMaterialGroupListByGUID(material_data["guid"]) + material_group_list = None + + # Avoid crashing if there is no "guid" field in the metadata + material_guid = material_data.get("guid") + if material_guid: + material_group_list = material_manager.getMaterialGroupListByGUID(material_guid) # This can happen if the connected machine has no material in one or more extruders (if GUID is empty), or the # material is unknown to Cura, so we should return an "empty" or "unknown" material model. if material_group_list is None: - material_name = "Empty" if len(material_data["guid"]) == 0 else "Unknown" - return MaterialOutputModel(guid = material_data["guid"], + material_name = "Empty" if len(material_data.get("guid", "") == 0 else "Unknown" + return MaterialOutputModel(guid = material_data.get("guid", ""), type = material_data.get("type", ""), color = material_data.get("color", ""), brand = material_data.get("brand", ""), From 1c373b720541691f4bd8d9e20a93b5596de04c32 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 11 Dec 2018 11:51:13 +0100 Subject: [PATCH 094/199] Improve config override text Contributes to CL-1152 --- .../resources/qml/MonitorConfigOverrideDialog.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml index 1b9a03ea99..6a32310dd5 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorConfigOverrideDialog.qml @@ -61,7 +61,7 @@ UM.Dialog var topLine if (materialsAreKnown(printer.activePrintJob)) { - topLine = catalog.i18ncp("@label", "The assigned printer, %1, requires the following configuration change:", "The assigned printer, %1, requires the following configuration changes:").arg(printer.name) + topLine = catalog.i18ncp("@label", "The assigned printer, %1, requires the following configuration change:", "The assigned printer, %1, requires the following configuration changes:", printer.activePrintJob.configurationChanges.length).arg(printer.name) } else { @@ -89,8 +89,10 @@ UM.Dialog default: text = "unknown" } - result += "

" + text + "

" + result += "

" + text + "

\n\n" } + var bottomLine = catalog.i18nc("@label", "Override will use the specified settings with the existing printer configuration. This may result in a failed print.") + result += "

" + bottomLine + "

\n\n" return result } } From 70b0d16fa4827f74632e8b57e3c01db0ed3aabdf Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 11:53:26 +0100 Subject: [PATCH 095/199] Fix typo Missing parenthesis. Contributes to CL-1160. --- plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index d39cf6e41c..275087447e 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -617,7 +617,7 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): # This can happen if the connected machine has no material in one or more extruders (if GUID is empty), or the # material is unknown to Cura, so we should return an "empty" or "unknown" material model. if material_group_list is None: - material_name = "Empty" if len(material_data.get("guid", "") == 0 else "Unknown" + material_name = "Empty" if len(material_data.get("guid", "")) == 0 else "Unknown" return MaterialOutputModel(guid = material_data.get("guid", ""), type = material_data.get("type", ""), color = material_data.get("color", ""), From 4949f39c34e6ffee888fb9eed49181879c02b9d1 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 12:10:32 +0100 Subject: [PATCH 096/199] Add translatable strings to empty and unknown material Contributes to CL-1160. --- .../UM3NetworkPrinting/src/ClusterUM3OutputDevice.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py index 275087447e..ef890fc4ed 100644 --- a/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/ClusterUM3OutputDevice.py @@ -617,7 +617,8 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): # This can happen if the connected machine has no material in one or more extruders (if GUID is empty), or the # material is unknown to Cura, so we should return an "empty" or "unknown" material model. if material_group_list is None: - material_name = "Empty" if len(material_data.get("guid", "")) == 0 else "Unknown" + material_name = i18n_catalog.i18nc("@label:material", "Empty") if len(material_data.get("guid", "")) == 0 \ + else i18n_catalog.i18nc("@label:material", "Unknown") return MaterialOutputModel(guid = material_data.get("guid", ""), type = material_data.get("type", ""), color = material_data.get("color", ""), @@ -649,9 +650,10 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): color = material_data["color"] brand = material_data["brand"] material_type = material_data["material"] - name = "Empty" if material_data["material"] == "empty" else "Unknown" - return MaterialOutputModel(guid=material_data["guid"], type=material_type, - brand=brand, color=color, name=name) + name = i18n_catalog.i18nc("@label:material", "Empty") if material_data["material"] == "empty" \ + else i18n_catalog.i18nc("@label:material", "Unknown") + return MaterialOutputModel(guid = material_data["guid"], type = material_type, + brand = brand, color = color, name = name) def _updatePrinter(self, printer: PrinterOutputModel, data: Dict[str, Any]) -> None: # For some unknown reason the cluster wants UUID for everything, except for sending a job directly to a printer. From 6c70543d11bdc37ab658e53686882bcd5a6e4452 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Dec 2018 12:46:11 +0100 Subject: [PATCH 097/199] Only set the containerID when the dialog is visible This prevents unneeded updates CURA-6016 --- resources/qml/Dialogs/WorkspaceSummaryDialog.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 1b3a7aac55..35630bd19b 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -11,6 +11,7 @@ import Cura 1.0 as Cura UM.Dialog { + id: base title: catalog.i18nc("@title:window", "Save Project") minimumWidth: 500 * screenScaleFactor @@ -49,7 +50,7 @@ UM.Dialog UM.SettingDefinitionsModel { id: definitionsModel - containerId: Cura.MachineManager.activeDefinitionId + containerId: base.visible ? Cura.MachineManager.activeDefinitionId: "" showAll: true exclude: ["command_line_settings"] showAncestors: true From 75ff03f3c8e55c2d2a651da0f36b3d0ee6c0fb8f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Dec 2018 13:13:20 +0100 Subject: [PATCH 098/199] Use setState instead of emitting the backend state CURA-6016 --- .../CuraEngineBackend/CuraEngineBackend.py | 38 +++++++++---------- plugins/CuraEngineBackend/StartSliceJob.py | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 58bc74f3f1..7ede6b6736 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -203,7 +203,7 @@ class CuraEngineBackend(QObject, Backend): @pyqtSlot() def stopSlicing(self) -> None: - self.backendStateChange.emit(BackendState.NotStarted) + self.setState(BackendState.NotStarted) if self._slicing: # We were already slicing. Stop the old job. self._terminate() self._createSocket() @@ -322,7 +322,7 @@ class CuraEngineBackend(QObject, Backend): self._start_slice_job = None if job.isCancelled() or job.getError() or job.getResult() == StartJobResult.Error: - self.backendStateChange.emit(BackendState.Error) + self.setState(BackendState.Error) self.backendError.emit(job) return @@ -331,10 +331,10 @@ class CuraEngineBackend(QObject, Backend): self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice with the current material as it is incompatible with the selected machine or configuration."), title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() - self.backendStateChange.emit(BackendState.Error) + self.setState(BackendState.Error) self.backendError.emit(job) else: - self.backendStateChange.emit(BackendState.NotStarted) + self.setState(BackendState.NotStarted) return if job.getResult() == StartJobResult.SettingError: @@ -362,10 +362,10 @@ class CuraEngineBackend(QObject, Backend): self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice with the current settings. The following settings have errors: {0}").format(", ".join(error_labels)), title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() - self.backendStateChange.emit(BackendState.Error) + self.setState(BackendState.Error) self.backendError.emit(job) else: - self.backendStateChange.emit(BackendState.NotStarted) + self.setState(BackendState.NotStarted) return elif job.getResult() == StartJobResult.ObjectSettingError: @@ -386,7 +386,7 @@ class CuraEngineBackend(QObject, Backend): self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice due to some per-model settings. The following settings have errors on one or more models: {error_labels}").format(error_labels = ", ".join(errors.values())), title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() - self.backendStateChange.emit(BackendState.Error) + self.setState(BackendState.Error) self.backendError.emit(job) return @@ -395,16 +395,16 @@ class CuraEngineBackend(QObject, Backend): self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice because the prime tower or prime position(s) are invalid."), title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() - self.backendStateChange.emit(BackendState.Error) + self.setState(BackendState.Error) self.backendError.emit(job) else: - self.backendStateChange.emit(BackendState.NotStarted) + self.setState(BackendState.NotStarted) if job.getResult() == StartJobResult.ObjectsWithDisabledExtruder: self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice because there are objects associated with disabled Extruder %s." % job.getMessage()), title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() - self.backendStateChange.emit(BackendState.Error) + self.setState(BackendState.Error) self.backendError.emit(job) return @@ -413,10 +413,10 @@ class CuraEngineBackend(QObject, Backend): self._error_message = Message(catalog.i18nc("@info:status", "Nothing to slice because none of the models fit the build volume. Please scale or rotate models to fit."), title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() - self.backendStateChange.emit(BackendState.Error) + self.setState(BackendState.Error) self.backendError.emit(job) else: - self.backendStateChange.emit(BackendState.NotStarted) + self.setState(BackendState.NotStarted) self._invokeSlice() return @@ -424,7 +424,7 @@ class CuraEngineBackend(QObject, Backend): self._socket.sendMessage(job.getSliceMessage()) # Notify the user that it's now up to the backend to do it's job - self.backendStateChange.emit(BackendState.Processing) + self.setState(BackendState.Processing) if self._slice_start_time: Logger.log("d", "Sending slice message took %s seconds", time() - self._slice_start_time ) @@ -442,7 +442,7 @@ class CuraEngineBackend(QObject, Backend): for node in DepthFirstIterator(self._scene.getRoot()): #type: ignore #Ignore type error because iter() should get called automatically by Python syntax. if node.callDecoration("isBlockSlicing"): enable_timer = False - self.backendStateChange.emit(BackendState.Disabled) + self.setState(BackendState.Disabled) self._is_disabled = True gcode_list = node.callDecoration("getGCodeList") if gcode_list is not None: @@ -451,7 +451,7 @@ class CuraEngineBackend(QObject, Backend): if self._use_timer == enable_timer: return self._use_timer if enable_timer: - self.backendStateChange.emit(BackendState.NotStarted) + self.setState(BackendState.NotStarted) self.enableTimer() return True else: @@ -518,7 +518,7 @@ class CuraEngineBackend(QObject, Backend): self._build_plates_to_be_sliced.append(build_plate_number) self.printDurationMessage.emit(source_build_plate_number, {}, []) self.processingProgress.emit(0.0) - self.backendStateChange.emit(BackendState.NotStarted) + self.setState(BackendState.NotStarted) # if not self._use_timer: # With manually having to slice, we want to clear the old invalid layer data. self._clearLayerData(build_plate_changed) @@ -567,7 +567,7 @@ class CuraEngineBackend(QObject, Backend): self.stopSlicing() self.markSliceAll() self.processingProgress.emit(0.0) - self.backendStateChange.emit(BackendState.NotStarted) + self.setState(BackendState.NotStarted) if not self._use_timer: # With manually having to slice, we want to clear the old invalid layer data. self._clearLayerData() @@ -613,7 +613,7 @@ class CuraEngineBackend(QObject, Backend): # \param message The protobuf message containing the slicing progress. def _onProgressMessage(self, message: Arcus.PythonMessage) -> None: self.processingProgress.emit(message.amount) - self.backendStateChange.emit(BackendState.Processing) + self.setState(BackendState.Processing) def _invokeSlice(self) -> None: if self._use_timer: @@ -632,7 +632,7 @@ class CuraEngineBackend(QObject, Backend): # # \param message The protobuf message signalling that slicing is finished. def _onSlicingFinishedMessage(self, message: Arcus.PythonMessage) -> None: - self.backendStateChange.emit(BackendState.Done) + self.setState(BackendState.Done) self.processingProgress.emit(1.0) gcode_list = self._scene.gcode_dict[self._start_slice_job_build_plate] #type: ignore #Because we generate this attribute dynamically. diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index 9679360ad5..d3882a1209 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -323,7 +323,7 @@ class StartSliceJob(Job): value = stack.getProperty(key, "value") result[key] = value Job.yieldThread() - + result["print_bed_temperature"] = result["material_bed_temperature"] # Renamed settings. result["print_temperature"] = result["material_print_temperature"] result["time"] = time.strftime("%H:%M:%S") #Some extra settings. From 4baf0d1bdb8c9aeab709cde37f400ae7db304543 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Dec 2018 13:49:20 +0100 Subject: [PATCH 099/199] Always show average rating CURA-6013 --- plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index f34d982cfb..f217d901b8 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -143,9 +143,7 @@ Item Label { - // If the user voted, show that value. Otherwsie show the average rating. - property real ratingtoUse: model.user_rating == 0 ? model.average_rating: model.user_rating - text: ratingtoUse.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")" + text: model.average_rating.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")" verticalAlignment: Text.AlignVCenter height: starIcon.height anchors.verticalCenter: starIcon.verticalCenter From 30057e2fcd4c1b6370178d24db903d84e83b0619 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Dec 2018 13:49:45 +0100 Subject: [PATCH 100/199] Use user_rating instead of user In the end it was implemented as user_rating (and not as user) CURA-6013 --- plugins/Toolbox/src/PackagesModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/src/PackagesModel.py b/plugins/Toolbox/src/PackagesModel.py index 3f5be3bc37..d94fdf6bb7 100644 --- a/plugins/Toolbox/src/PackagesModel.py +++ b/plugins/Toolbox/src/PackagesModel.py @@ -107,7 +107,7 @@ class PackagesModel(ListModel): "login_required": "login-required" in package.get("tags", []), "average_rating": float(package.get("rating", {}).get("average", 0)), "num_ratings": package.get("rating", {}).get("count", 0), - "user_rating": package.get("rating", {}).get("user", 0) + "user_rating": package.get("rating", {}).get("user_rating", 0) }) # Filter on all the key-word arguments. From faa3f42acc6f88a63b26443b6edd500061689e93 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 13:53:05 +0100 Subject: [PATCH 101/199] Modify the header in the simulation view menu component This is needed to align with the designs. --- .../SimulationViewMenuComponent.qml | 40 ++++++++++++++----- resources/qml/ViewsSelector.qml | 2 +- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 58b2bfe520..ed615bf4f6 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -35,14 +35,36 @@ Cura.ExpandableComponent } } - headerItem: Label + headerItem: Item { - id: layerViewTypesLabel - text: catalog.i18nc("@label", "Color scheme") - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("setting_control_text") - height: base.height - verticalAlignment: Text.AlignVCenter + Label + { + id: colorSchemeLabel + text: catalog.i18nc("@label", "Color scheme") + verticalAlignment: Text.AlignVCenter + height: parent.height + elide: Text.ElideRight + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text_medium") + renderType: Text.NativeRendering + } + + Label + { + text: layerTypeCombobox.currentText + verticalAlignment: Text.AlignVCenter + anchors + { + left: colorSchemeLabel.right + leftMargin: UM.Theme.getSize("default_margin").width + right: parent.right + } + height: parent.height + elide: Text.ElideRight + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + renderType: Text.NativeRendering + } } contentItem: Column @@ -125,7 +147,7 @@ Cura.ExpandableComponent Label { id: compatibilityModeLabel - text: catalog.i18nc("@label","Compatibility Mode") + text: catalog.i18nc("@label", "Compatibility Mode") font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") visible: UM.SimulationView.compatibilityMode @@ -136,7 +158,7 @@ Cura.ExpandableComponent Item // Spacer { - height: Math.round(UM.Theme.getSize("default_margin").width / 2) + height: UM.Theme.getSize("narrow_margin").width width: width } diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index f2906f9d4c..0e2598a0d8 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -43,7 +43,7 @@ Cura.ExpandablePopup Label { id: title - text: catalog.i18nc("@button", "View types") + text: catalog.i18nc("@label", "View types") verticalAlignment: Text.AlignVCenter height: parent.height elide: Text.ElideRight From db56aa028ca24e92ce8366063066f4fef466b6a6 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 13:59:36 +0100 Subject: [PATCH 102/199] Change the swatch from a circle to the extruder icon --- plugins/SimulationView/SimulationViewMenuComponent.qml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index ed615bf4f6..c2e9b0d6fa 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -183,17 +183,16 @@ Cura.ExpandableComponent style: UM.Theme.styles.checkbox - Rectangle + + UM.RecolorImage { + id: swatch anchors.verticalCenter: parent.verticalCenter anchors.right: extrudersModelCheckBox.right width: UM.Theme.getSize("layerview_legend_size").width height: UM.Theme.getSize("layerview_legend_size").height + source: UM.Theme.getIcon("extruder_button") color: model.color - radius: Math.round(width / 2) - border.width: UM.Theme.getSize("default_lining").width - border.color: UM.Theme.getColor("lining") - visible: !viewSettings.show_legend && !viewSettings.show_gradient } Label From 7a5701b00121e3a481e6f7dbd496c3250a299018 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Dec 2018 14:12:34 +0100 Subject: [PATCH 103/199] Made smallrating widget re-usable Also added it to the details page CURA-6013 --- .../resources/qml/SmallRatingWidget.qml | 33 +++++ .../resources/qml/ToolboxDetailPage.qml | 114 +++++++++--------- .../qml/ToolboxDownloadsGridTile.qml | 24 +--- 3 files changed, 94 insertions(+), 77 deletions(-) create mode 100644 plugins/Toolbox/resources/qml/SmallRatingWidget.qml diff --git a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml new file mode 100644 index 0000000000..f69e9349cf --- /dev/null +++ b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml @@ -0,0 +1,33 @@ +import QtQuick 2.3 +import QtQuick.Controls 1.4 +import UM 1.1 as UM +import Cura 1.1 as Cura + + + +Row +{ + id: rating + height: UM.Theme.getSize("rating_star").height + visible: model.average_rating > 0 //Has a rating at all. + spacing: UM.Theme.getSize("thick_lining").width + + UM.RecolorImage + { + id: starIcon + source: UM.Theme.getIcon("star_filled") + color: model.user_rating == 0 ? "#5a5a5a" : UM.Theme.getColor("primary") + height: UM.Theme.getSize("rating_star").height + width: UM.Theme.getSize("rating_star").width + } + + Label + { + text: model.average_rating.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")" + verticalAlignment: Text.AlignVCenter + height: starIcon.height + anchors.verticalCenter: starIcon.verticalCenter + color: starIcon.color + font: UM.Theme.getFont("small") + } +} \ No newline at end of file diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 51bb218293..4adbaa2435 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -57,16 +57,22 @@ Item top: thumbnail.top left: thumbnail.right leftMargin: UM.Theme.getSize("default_margin").width - right: parent.right - rightMargin: UM.Theme.getSize("wide_margin").width bottomMargin: UM.Theme.getSize("default_margin").height } text: details === null ? "" : (details.name || "") font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") wrapMode: Text.WordWrap - width: parent.width - height: UM.Theme.getSize("toolbox_property_label").height + width: properties.width + values.width + height: contentHeight + } + + SmallRatingWidget + { + anchors.left: title.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.verticalCenter: title.verticalCenter + property var model: details } Column @@ -82,6 +88,12 @@ Item width: childrenRect.width height: childrenRect.height Label + { + text: catalog.i18nc("@label", "Rating") + ":" + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text_medium") + } + Label { text: catalog.i18nc("@label", "Version") + ":" font: UM.Theme.getFont("default") @@ -105,12 +117,6 @@ Item font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") } - Label - { - text: catalog.i18nc("@label", "Rating") + ":" - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text_medium") - } } Column { @@ -124,50 +130,6 @@ Item } spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) height: childrenRect.height - Label - { - text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - } - Label - { - text: - { - if (details === null) - { - return "" - } - var date = new Date(details.last_updated) - return date.toLocaleString(UM.Preferences.getValue("general/language")) - } - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - } - Label - { - text: - { - if (details === null) - { - return "" - } - else - { - return "" + details.author_name + "" - } - } - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - linkColor: UM.Theme.getColor("text_link") - onLinkActivated: Qt.openUrlExternally(link) - } - Label - { - text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown")) - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - } RatingWidget { id: rating @@ -212,6 +174,50 @@ Item } } } + Label + { + text: details === null ? "" : (details.version || catalog.i18nc("@label", "Unknown")) + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + } + Label + { + text: + { + if (details === null) + { + return "" + } + var date = new Date(details.last_updated) + return date.toLocaleString(UM.Preferences.getValue("general/language")) + } + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + } + Label + { + text: + { + if (details === null) + { + return "" + } + else + { + return "" + details.author_name + "" + } + } + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + linkColor: UM.Theme.getColor("text_link") + onLinkActivated: Qt.openUrlExternally(link) + } + Label + { + text: details === null ? "" : (details.download_count || catalog.i18nc("@label", "Unknown")) + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("text") + } } Rectangle { diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index f217d901b8..8cd8f2ffef 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -119,37 +119,15 @@ Item verticalAlignment: Text.AlignVCenter maximumLineCount: 2 } - Row + SmallRatingWidget { id: rating - height: UM.Theme.getSize("rating_star").height - visible: model.average_rating > 0 //Has a rating at all. - spacing: UM.Theme.getSize("thick_lining").width anchors { bottom: parent.bottom left: parent.left right: parent.right } - - UM.RecolorImage - { - id: starIcon - source: UM.Theme.getIcon("star_filled") - color: model.user_rating == 0 ? "#5a5a5a" : UM.Theme.getColor("primary") - height: UM.Theme.getSize("rating_star").height - width: UM.Theme.getSize("rating_star").width - } - - Label - { - text: model.average_rating.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")" - verticalAlignment: Text.AlignVCenter - height: starIcon.height - anchors.verticalCenter: starIcon.verticalCenter - color: starIcon.color - font: UM.Theme.getFont("small") - } } } } From 742fc34e75305cbefdb339ef6fa08f239c538f61 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 14:31:12 +0100 Subject: [PATCH 104/199] Change labels in the layer view legend --- plugins/SimulationView/SimulationViewMenuComponent.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index c2e9b0d6fa..95d7d20006 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -222,25 +222,25 @@ Cura.ExpandableComponent Component.onCompleted: { typesLegendModel.append({ - label: catalog.i18nc("@label", "Show Travels"), + label: catalog.i18nc("@label", "Travels"), initialValue: viewSettings.show_travel_moves, preference: "layerview/show_travel_moves", colorId: "layerview_move_combing" }); typesLegendModel.append({ - label: catalog.i18nc("@label", "Show Helpers"), + label: catalog.i18nc("@label", "Helpers"), initialValue: viewSettings.show_helpers, preference: "layerview/show_helpers", colorId: "layerview_support" }); typesLegendModel.append({ - label: catalog.i18nc("@label", "Show Shell"), + label: catalog.i18nc("@label", "Shell"), initialValue: viewSettings.show_skin, preference: "layerview/show_skin", colorId: "layerview_inset_0" }); typesLegendModel.append({ - label: catalog.i18nc("@label", "Show Infill"), + label: catalog.i18nc("@label", "Infill"), initialValue: viewSettings.show_infill, preference: "layerview/show_infill", colorId: "layerview_infill" From fcaa23ed0ae2c168ff405ce7d9a66acf1ae19351 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 11 Dec 2018 15:16:21 +0100 Subject: [PATCH 105/199] Added smallRating widget to featured plugins CURA-6013 --- .../resources/qml/SmallRatingWidget.qml | 4 +- .../qml/ToolboxDownloadsShowcaseTile.qml | 103 +++++++----------- 2 files changed, 43 insertions(+), 64 deletions(-) diff --git a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml index f69e9349cf..0b93131cfd 100644 --- a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml +++ b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml @@ -11,7 +11,7 @@ Row height: UM.Theme.getSize("rating_star").height visible: model.average_rating > 0 //Has a rating at all. spacing: UM.Theme.getSize("thick_lining").width - + width: starIcon.width + spacing + numRatingsLabel.width UM.RecolorImage { id: starIcon @@ -23,9 +23,11 @@ Row Label { + id: numRatingsLabel text: model.average_rating.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")" verticalAlignment: Text.AlignVCenter height: starIcon.height + width: contentWidth anchors.verticalCenter: starIcon.verticalCenter color: starIcon.color font: UM.Theme.getFont("small") diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index ceaadc110d..3e09654173 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -13,90 +13,67 @@ Rectangle property int installedPackages: toolbox.viewCategory == "material" ? toolbox.getNumberOfInstalledPackagesByAuthor(model.id) : (toolbox.isInstalled(model.id) ? 1 : 0) id: tileBase width: UM.Theme.getSize("toolbox_thumbnail_large").width + (2 * UM.Theme.getSize("default_lining").width) - height: thumbnail.height + packageNameBackground.height + (2 * UM.Theme.getSize("default_lining").width) + height: thumbnail.height + packageName.height + rating.height + UM.Theme.getSize("default_margin").width border.width: UM.Theme.getSize("default_lining").width border.color: UM.Theme.getColor("lining") - color: "transparent" - Rectangle + color: UM.Theme.getColor("main_background") + Image { id: thumbnail - color: UM.Theme.getColor("main_background") - width: UM.Theme.getSize("toolbox_thumbnail_large").width - height: UM.Theme.getSize("toolbox_thumbnail_large").height + height: UM.Theme.getSize("toolbox_thumbnail_large").height - 4 * UM.Theme.getSize("default_margin").height + width: UM.Theme.getSize("toolbox_thumbnail_large").height - 4 * UM.Theme.getSize("default_margin").height + fillMode: Image.PreserveAspectFit + source: model.icon_url || "../images/logobot.svg" + mipmap: true anchors { top: parent.top + topMargin: UM.Theme.getSize("default_margin").height horizontalCenter: parent.horizontalCenter - topMargin: UM.Theme.getSize("default_lining").width - } - Image - { - anchors.centerIn: parent - width: UM.Theme.getSize("toolbox_thumbnail_large").width - 2 * UM.Theme.getSize("default_margin").width - height: UM.Theme.getSize("toolbox_thumbnail_large").height - 2 * UM.Theme.getSize("default_margin").height - fillMode: Image.PreserveAspectFit - source: model.icon_url || "../images/logobot.svg" - mipmap: true - } - UM.RecolorImage - { - width: (parent.width * 0.3) | 0 - height: (parent.height * 0.3) | 0 - anchors - { - bottom: parent.bottom - right: parent.right - bottomMargin: UM.Theme.getSize("default_lining").width - } - visible: installedPackages != 0 - color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") - source: "../images/installed_check.svg" } } - Rectangle + Label { - id: packageNameBackground - color: UM.Theme.getColor("primary") + id: packageName + text: model.name anchors { - top: thumbnail.bottom horizontalCenter: parent.horizontalCenter + top: thumbnail.bottom } + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter height: UM.Theme.getSize("toolbox_heading_label").height width: parent.width - Label - { - id: packageName - text: model.name - anchors - { - horizontalCenter: parent.horizontalCenter - } - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - height: UM.Theme.getSize("toolbox_heading_label").height - width: parent.width - wrapMode: Text.WordWrap - color: UM.Theme.getColor("button_text") - font: UM.Theme.getFont("medium_bold") - } + wrapMode: Text.WordWrap + font: UM.Theme.getFont("medium_bold") } + UM.RecolorImage + { + width: (parent.width * 0.20) | 0 + height: (parent.height * 0.20) | 0 + anchors + { + bottom: parent.bottom + right: parent.right + bottomMargin: UM.Theme.getSize("default_lining").width + } + visible: installedPackages != 0 + color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") + source: "../images/installed_check.svg" + } + + SmallRatingWidget + { + id: rating + anchors.bottom: parent.bottom + anchors.bottomMargin: UM.Theme.getSize("narrow_margin").height + anchors.horizontalCenter: parent.horizontalCenter + } + MouseArea { anchors.fill: parent - hoverEnabled: true - onEntered: - { - packageName.color = UM.Theme.getColor("button_text_hover") - packageNameBackground.color = UM.Theme.getColor("primary_hover") - tileBase.border.color = UM.Theme.getColor("primary_hover") - } - onExited: - { - packageName.color = UM.Theme.getColor("button_text") - packageNameBackground.color = UM.Theme.getColor("primary") - tileBase.border.color = UM.Theme.getColor("lining") - } onClicked: { base.selection = model From c804610fa6ab8cad1b52b34666200c2026ef3732 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 15:19:40 +0100 Subject: [PATCH 106/199] Make the stage menu in the preview using 85 percent of the total width in order to prevent the print setup panel to be in the middle --- plugins/PreviewStage/PreviewMenu.qml | 92 +++++++++++-------- .../SimulationViewMenuComponent.qml | 1 - resources/themes/cura-light/theme.json | 4 +- 3 files changed, 54 insertions(+), 43 deletions(-) diff --git a/plugins/PreviewStage/PreviewMenu.qml b/plugins/PreviewStage/PreviewMenu.qml index 1543536160..4e1fbac837 100644 --- a/plugins/PreviewStage/PreviewMenu.qml +++ b/plugins/PreviewStage/PreviewMenu.qml @@ -2,6 +2,7 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 +import QtQuick.Layouts 1.1 import QtQuick.Controls 2.3 import UM 1.3 as UM @@ -19,56 +20,67 @@ Item name: "cura" } - - Row + // Item to ensure that all of the buttons are nicely centered. + Item { - id: stageMenuRow - anchors.centerIn: parent + anchors.horizontalCenter: parent.horizontalCenter + width: stageMenuRow.width height: parent.height - Cura.ViewsSelector + RowLayout { - id: viewsSelector + id: stageMenuRow + width: Math.round(0.85 * previewMenu.width) height: parent.height - width: UM.Theme.getSize("views_selector").width - headerCornerSide: Cura.RoundedRectangle.Direction.Left - } + spacing: 0 - // Separator line - Rectangle - { - height: parent.height - // If there is no viewPanel, we only need a single spacer, so hide this one. - visible: viewPanel.source != "" - width: visible ? UM.Theme.getSize("default_lining").width : 0 + Cura.ViewsSelector + { + id: viewsSelector + headerCornerSide: Cura.RoundedRectangle.Direction.Left + Layout.minimumWidth: UM.Theme.getSize("views_selector").width + Layout.maximumWidth: UM.Theme.getSize("views_selector").width + Layout.fillWidth: true + Layout.fillHeight: true + } - color: UM.Theme.getColor("lining") - } + // Separator line + Rectangle + { + height: parent.height + // If there is no viewPanel, we only need a single spacer, so hide this one. + visible: viewPanel.source != "" + width: UM.Theme.getSize("default_lining").width - Loader - { - id: viewPanel - height: parent.height - width: childrenRect.width - source: UM.Controller.activeView != null && UM.Controller.activeView.stageMenuComponent != null ? UM.Controller.activeView.stageMenuComponent : "" - } + color: UM.Theme.getColor("lining") + } - // Separator line - Rectangle - { - height: parent.height - width: UM.Theme.getSize("default_lining").width - color: UM.Theme.getColor("lining") - } + Loader + { + id: viewPanel + Layout.fillHeight: true + Layout.fillWidth: true + Layout.preferredWidth: stageMenuRow.width - viewsSelector.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width + source: UM.Controller.activeView != null && UM.Controller.activeView.stageMenuComponent != null ? UM.Controller.activeView.stageMenuComponent : "" + } - Item - { - id: printSetupSelectorItem - // This is a work around to prevent the printSetupSelector from having to be re-loaded every time - // a stage switch is done. - children: [printSetupSelector] - height: childrenRect.height - width: childrenRect.width + // Separator line + Rectangle + { + height: parent.height + width: UM.Theme.getSize("default_lining").width + color: UM.Theme.getColor("lining") + } + + Item + { + id: printSetupSelectorItem + // This is a work around to prevent the printSetupSelector from having to be re-loaded every time + // a stage switch is done. + children: [printSetupSelector] + height: childrenRect.height + width: childrenRect.width + } } } } diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 95d7d20006..9f43252126 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -15,7 +15,6 @@ Cura.ExpandableComponent { id: base - width: UM.Theme.getSize("layerview_menu_size").width contentHeaderTitle: catalog.i18nc("@label", "Color scheme") Connections diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 3dc216ad70..0c17a34e9a 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -380,7 +380,7 @@ "machine_selector_widget_content": [25.0, 32.0], "machine_selector_icon": [2.66, 2.66], - "views_selector": [16.0, 4.5], + "views_selector": [23.0, 4.0], "printer_type_label": [3.5, 1.5], @@ -450,7 +450,7 @@ "slider_handle": [1.5, 1.5], "slider_layerview_size": [1.0, 26.0], - "layerview_menu_size": [15, 20], + "layerview_menu_size": [16.0, 4.0], "layerview_legend_size": [1.0, 1.0], "layerview_row": [11.0, 1.5], "layerview_row_spacing": [0.0, 0.5], From daeb86bdb1ec55400b86edc14ec76c66cba4dfbd Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 11 Dec 2018 15:55:03 +0100 Subject: [PATCH 107/199] Use short printer family tags Contributes to CL-1173 --- .../resources/qml/MonitorPrintJobCard.qml | 1 + .../resources/qml/MonitorPrinterPill.qml | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml index 5eaeff2e84..d8c5d1ec28 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml @@ -97,6 +97,7 @@ Item return "" } visible: printJob + width: 120 * screenScaleFactor // TODO: Theme! // FIXED-LINE-HEIGHT: height: 18 * screenScaleFactor // TODO: Theme! diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml index cd78f1b11f..94d9c7e7d0 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml @@ -12,7 +12,19 @@ import UM 1.2 as UM Item { // The printer name - property alias text: printerNameLabel.text; + property var text: "" + property var tagText: { + switch(text) { + case "Ultimaker 3": + return "UM 3" + case "Ultimaker 3 Extended": + return "UM 3 EXT" + case "Ultimaker S5": + return "UM S5" + default: + return "" + } + } implicitHeight: 18 * screenScaleFactor // TODO: Theme! implicitWidth: printerNameLabel.contentWidth + 12 // TODO: Theme! @@ -28,7 +40,7 @@ Item id: printerNameLabel anchors.centerIn: parent color: "#535369" // TODO: Theme! - text: "" + text: tagText font.pointSize: 10 } } \ No newline at end of file From b993a7b0d92c8d1d357d639716aab280bb8f0da0 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 16:05:24 +0100 Subject: [PATCH 108/199] Change the header color and font in the configuration popup Also fix some alignments with the printer type selector. Contributes to CURA-5876. --- resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml | 5 ++--- .../qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml index 68c56c7c4b..2e8be05fef 100644 --- a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml @@ -16,8 +16,8 @@ Item { id: header text: catalog.i18nc("@header", "Configurations") - font: UM.Theme.getFont("large") - color: UM.Theme.getColor("text") + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("small_button_text") height: contentHeight renderType: Text.NativeRendering @@ -31,7 +31,6 @@ Item ConfigurationListView { anchors.top: header.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").width width: parent.width outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 8429e2c093..cbe4263e33 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -23,8 +23,8 @@ Item { id: header text: catalog.i18nc("@header", "Custom") - font: UM.Theme.getFont("large") - color: UM.Theme.getColor("text") + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("small_button_text") height: contentHeight renderType: Text.NativeRendering @@ -51,9 +51,7 @@ Item anchors { left: parent.left - leftMargin: UM.Theme.getSize("default_margin").width right: parent.right - rightMargin: UM.Theme.getSize("default_margin").width top: header.bottom topMargin: visible ? UM.Theme.getSize("default_margin").height : 0 } From f99c788eb63bef4035ce7694c3a94b77277e40ad Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 16:35:59 +0100 Subject: [PATCH 109/199] Change some colors for the arrows in some setting selectors Contributes to CURA-5876. --- resources/qml/ActionButton.qml | 2 +- .../ConfigurationMenu/ConfigurationItem.qml | 4 ++-- .../ConfigurationMenu/CustomConfiguration.qml | 12 +++++----- resources/qml/PrinterOutput/ExtruderBox.qml | 2 +- resources/qml/PrinterOutput/HeatedBedBox.qml | 2 +- .../qml/PrinterOutput/MonitorSection.qml | 2 +- .../PrinterSelector/MachineSelectorButton.qml | 2 +- resources/qml/Settings/SettingCategory.qml | 23 ++----------------- resources/qml/Settings/SettingComboBox.qml | 2 +- resources/qml/Settings/SettingExtruder.qml | 2 +- .../qml/Settings/SettingOptionalExtruder.qml | 2 +- resources/qml/ViewsSelector.qml | 2 +- resources/themes/cura-light/styles.qml | 10 ++++---- resources/themes/cura-light/theme.json | 15 ------------ 14 files changed, 24 insertions(+), 58 deletions(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 7177120f35..c3d39e8251 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -62,7 +62,7 @@ Button id: buttonText text: button.text color: button.enabled ? (button.hovered ? button.textHoverColor : button.textColor): button.textDisabledColor - font: UM.Theme.getFont("action_button") + font: UM.Theme.getFont("medium") visible: text != "" renderType: Text.NativeRendering anchors.verticalCenter: parent.verticalCenter diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 728a0cbe9a..9dae075b48 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -20,8 +20,8 @@ Button { height: childrenRect.height color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") - border.color: (parent.checked || parent.hovered) ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") - border.width: parent.checked ? UM.Theme.getSize("thick_lining").width : UM.Theme.getSize("default_lining").width + border.color: parent.checked ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") + border.width: UM.Theme.getSize("default_lining").width radius: UM.Theme.getSize("default_radius").width Column diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index cbe4263e33..7181f841d1 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -60,7 +60,7 @@ Item { text: catalog.i18nc("@label", "Printer") width: Math.round(parent.width * 0.3) - UM.Theme.getSize("default_margin").width - height: contentHeight +// height: contentHeight font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") anchors.verticalCenter: printerTypeSelector.verticalCenter @@ -72,7 +72,7 @@ Item id: printerTypeSelector text: Cura.MachineManager.activeMachineDefinitionName tooltip: Cura.MachineManager.activeMachineDefinitionName - height: UM.Theme.getSize("setting_control").height + height: UM.Theme.getSize("print_setup_big_item").height width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width anchors.right: parent.right style: UM.Theme.styles.print_setup_header_button @@ -222,7 +222,7 @@ Item Row { - height: UM.Theme.getSize("print_setup_item").height + height: UM.Theme.getSize("print_setup_big_item").height visible: Cura.MachineManager.hasMaterials Label @@ -246,7 +246,7 @@ Item text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.material.name : "" tooltip: text - height: UM.Theme.getSize("setting_control").height + height: UM.Theme.getSize("print_setup_big_item").height width: selectors.controlWidth style: UM.Theme.styles.print_setup_header_button @@ -260,7 +260,7 @@ Item Row { - height: UM.Theme.getSize("print_setup_item").height + height: UM.Theme.getSize("print_setup_big_item").height visible: Cura.MachineManager.hasVariants Label @@ -280,7 +280,7 @@ Item text: Cura.MachineManager.activeVariantName tooltip: Cura.MachineManager.activeVariantName - height: UM.Theme.getSize("setting_control").height + height: UM.Theme.getSize("print_setup_big_item").height width: selectors.controlWidth style: UM.Theme.styles.print_setup_header_button activeFocusOnPress: true; diff --git a/resources/qml/PrinterOutput/ExtruderBox.qml b/resources/qml/PrinterOutput/ExtruderBox.qml index 247bb3a27d..9ba78f778f 100644 --- a/resources/qml/PrinterOutput/ExtruderBox.qml +++ b/resources/qml/PrinterOutput/ExtruderBox.qml @@ -326,7 +326,7 @@ Item return UM.Theme.getColor("action_button_text"); } } - font: UM.Theme.getFont("action_button") + font: UM.Theme.getFont("medium") text: { if(extruderModel == null) diff --git a/resources/qml/PrinterOutput/HeatedBedBox.qml b/resources/qml/PrinterOutput/HeatedBedBox.qml index 33cf5cd1e2..ac541f707c 100644 --- a/resources/qml/PrinterOutput/HeatedBedBox.qml +++ b/resources/qml/PrinterOutput/HeatedBedBox.qml @@ -320,7 +320,7 @@ Item return UM.Theme.getColor("action_button_text"); } } - font: UM.Theme.getFont("action_button") + font: UM.Theme.getFont("medium") text: { if(printerModel == null) diff --git a/resources/qml/PrinterOutput/MonitorSection.qml b/resources/qml/PrinterOutput/MonitorSection.qml index 7ef89dabf7..1d9df777b6 100644 --- a/resources/qml/PrinterOutput/MonitorSection.qml +++ b/resources/qml/PrinterOutput/MonitorSection.qml @@ -27,7 +27,7 @@ Item anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width text: label - font: UM.Theme.getFont("setting_category") + font: UM.Theme.getFont("default") color: UM.Theme.getColor("setting_category_text") } } diff --git a/resources/qml/PrinterSelector/MachineSelectorButton.qml b/resources/qml/PrinterSelector/MachineSelectorButton.qml index b88af35f82..39e63d27c3 100644 --- a/resources/qml/PrinterSelector/MachineSelectorButton.qml +++ b/resources/qml/PrinterSelector/MachineSelectorButton.qml @@ -42,7 +42,7 @@ Button } text: machineSelectorButton.text color: UM.Theme.getColor("text") - font: UM.Theme.getFont("action_button") + font: UM.Theme.getFont("medium") visible: text != "" renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter diff --git a/resources/qml/Settings/SettingCategory.qml b/resources/qml/Settings/SettingCategory.qml index 5676bcedf9..da731bcd55 100644 --- a/resources/qml/Settings/SettingCategory.qml +++ b/resources/qml/Settings/SettingCategory.qml @@ -73,7 +73,7 @@ Button text: definition.label textFormat: Text.PlainText renderType: Text.NativeRendering - font: UM.Theme.getFont("setting_category") + font: UM.Theme.getFont("default") color: { if (!base.enabled) @@ -106,26 +106,7 @@ Button width: UM.Theme.getSize("standard_arrow").width height: UM.Theme.getSize("standard_arrow").height sourceSize.height: width - color: - { - if (!base.enabled) - { - return UM.Theme.getColor("setting_category_disabled_text") - } - else if ((base.hovered || base.activeFocus) && base.checkable && base.checked) - { - return UM.Theme.getColor("setting_category_active_hover_text") - } - else if (base.pressed || (base.checkable && base.checked)) - { - return UM.Theme.getColor("setting_category_active_text") - } - else if (base.hovered || base.activeFocus) - { - return UM.Theme.getColor("setting_category_hover_text") - } - return UM.Theme.getColor("setting_category_text") - } + color: UM.Theme.getColor("setting_control_button") source: base.checked ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") } } diff --git a/resources/qml/Settings/SettingComboBox.qml b/resources/qml/Settings/SettingComboBox.qml index 13d2a0eb8f..a287e0c3ce 100644 --- a/resources/qml/Settings/SettingComboBox.qml +++ b/resources/qml/Settings/SettingComboBox.qml @@ -63,7 +63,7 @@ SettingItem sourceSize.width: width + 5 * screenScaleFactor sourceSize.height: width + 5 * screenScaleFactor - color: UM.Theme.getColor("setting_control_text") + color: UM.Theme.getColor("setting_control_button") } contentItem: Label diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index e1fedd9274..a6c1beb3e5 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -105,7 +105,7 @@ SettingItem sourceSize.width: width + 5 * screenScaleFactor sourceSize.height: width + 5 * screenScaleFactor - color: UM.Theme.getColor("setting_control_text"); + color: UM.Theme.getColor("setting_control_button"); } background: Rectangle diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 200a3f64f1..aa843e2719 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -102,7 +102,7 @@ SettingItem sourceSize.width: width + 5 * screenScaleFactor sourceSize.height: width + 5 * screenScaleFactor - color: UM.Theme.getColor("setting_control_text"); + color: UM.Theme.getColor("setting_control_button"); } background: Rectangle diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index f2906f9d4c..58749c09f2 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -105,7 +105,7 @@ Cura.ExpandablePopup id: buttonText text: viewsSelectorButton.text color: UM.Theme.getColor("text") - font: UM.Theme.getFont("action_button") + font: UM.Theme.getFont("medium") renderType: Text.NativeRendering verticalAlignment: Text.AlignVCenter elide: Text.ElideRight diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index bcc754f4ca..42b63e84f7 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -75,7 +75,7 @@ QtObject width: Theme.getSize("standard_arrow").width height: Theme.getSize("standard_arrow").height sourceSize.height: width - color: control.enabled ? Theme.getColor("setting_category_text") : Theme.getColor("setting_category_disabled_text") + color: control.enabled ? Theme.getColor("setting_control_button") : Theme.getColor("setting_category_disabled_text") source: Theme.getIcon("arrow_bottom") } Label @@ -208,7 +208,7 @@ QtObject anchors.verticalCenter: parent.verticalCenter; text: control.text; - font: Theme.getFont("button_tooltip"); + font: Theme.getFont("default"); color: Theme.getColor("tooltip_text"); } } @@ -446,7 +446,7 @@ QtObject sourceSize.width: width + 5 * screenScaleFactor sourceSize.height: width + 5 * screenScaleFactor - color: Theme.getColor("setting_control_text"); + color: Theme.getColor("setting_control_button"); } } } @@ -513,7 +513,7 @@ QtObject sourceSize.width: width + 5 * screenScaleFactor sourceSize.height: width + 5 * screenScaleFactor - color: UM.Theme.getColor("setting_control_text") + color: UM.Theme.getColor("setting_control_button") } } } @@ -716,7 +716,7 @@ QtObject return UM.Theme.getColor("action_button_text"); } } - font: UM.Theme.getFont("action_button") + font: UM.Theme.getFont("medium") text: control.text } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 3dc216ad70..f812d4245f 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -49,21 +49,6 @@ "size": 0.7, "weight": 50, "family": "Noto Sans" - }, - "button_tooltip": { - "size": 1.0, - "weight": 50, - "family": "Noto Sans" - }, - "setting_category": { - "size": 1.15, - "weight": 63, - "family": "Noto Sans" - }, - "action_button": { - "size": 1.15, - "weight": 50, - "family": "Noto Sans" } }, From 1ababf38ad1cd50946ebca15a72e971e949223a7 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 11 Dec 2018 16:42:44 +0100 Subject: [PATCH 110/199] Use full printer name if no tag is known Contributes to CL-1173 --- plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml index 94d9c7e7d0..80a089cc2a 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterPill.qml @@ -22,7 +22,7 @@ Item case "Ultimaker S5": return "UM S5" default: - return "" + return text } } From ed8292c47243c0329c3b2bed04a49acc15b79852 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 11 Dec 2018 17:00:02 +0100 Subject: [PATCH 111/199] Adjust size and margins of the icon in the action button Contributes to CURA-5876. --- resources/qml/ActionButton.qml | 5 +++-- .../qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 2 +- resources/themes/cura-light/theme.json | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index c3d39e8251..3a9552cd9c 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -43,12 +43,13 @@ Button contentItem: Row { + spacing: UM.Theme.getSize("narrow_margin").width //Left side icon. Only displayed if !isIconOnRightSide. UM.RecolorImage { id: buttonIconLeft source: "" - height: buttonText.height + height: UM.Theme.getSize("action_button_icon").height width: visible ? height : 0 sourceSize.width: width sourceSize.height: height @@ -76,7 +77,7 @@ Button { id: buttonIconRight source: buttonIconLeft.source - height: buttonText.height + height: UM.Theme.getSize("action_button_icon").height width: visible ? height : 0 sourceSize.width: width sourceSize.height: height diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 7181f841d1..4d6d80c1b4 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -60,7 +60,7 @@ Item { text: catalog.i18nc("@label", "Printer") width: Math.round(parent.width * 0.3) - UM.Theme.getSize("default_margin").width -// height: contentHeight + height: contentHeight font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") anchors.verticalCenter: printerTypeSelector.verticalCenter diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index f812d4245f..b4d0ab7092 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -407,6 +407,7 @@ "button_lining": [0, 0], "action_button": [15.0, 3.0], + "action_button_icon": [1.0, 1.0], "action_button_radius": [0.15, 0.15], "small_button": [2, 2], From b413b4cdb69fd3f6c46f93c3797c92bd9abc53b8 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 11 Dec 2018 17:21:14 +0100 Subject: [PATCH 112/199] Correct a typo in typing. [CURA-6016] --- cura/Machines/Models/BaseMaterialsModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Machines/Models/BaseMaterialsModel.py b/cura/Machines/Models/BaseMaterialsModel.py index 3cd92bb6b4..629e5c2b48 100644 --- a/cura/Machines/Models/BaseMaterialsModel.py +++ b/cura/Machines/Models/BaseMaterialsModel.py @@ -59,7 +59,7 @@ class BaseMaterialsModel(ListModel): self._extruder_stack = None self._available_materials = None # type: Optional[Dict[str, MaterialNode]] - self._favorite_ids = set() # type: Set(str) + self._favorite_ids = set() # type: Set[str] def _updateExtruderStack(self): global_stack = self._machine_manager.activeMachine From 0b6841e5d9ba0af192866c1dbe0cec21c14debe1 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 12 Dec 2018 09:19:43 +0100 Subject: [PATCH 113/199] Revert "Use the capitalized version of the buildplate name" This reverts commit 11d8831d7a9a15e3e916d5d9762bfe1f755042e5. Contributes to CURA-6021. --- cura/PrinterOutput/ConfigurationModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PrinterOutput/ConfigurationModel.py b/cura/PrinterOutput/ConfigurationModel.py index 6f55aa3b1f..89e609c913 100644 --- a/cura/PrinterOutput/ConfigurationModel.py +++ b/cura/PrinterOutput/ConfigurationModel.py @@ -44,7 +44,7 @@ class ConfigurationModel(QObject): @pyqtProperty(str, fset = setBuildplateConfiguration, notify = configurationChanged) def buildplateConfiguration(self) -> str: - return self._buildplate_configuration.capitalize() + return self._buildplate_configuration ## This method is intended to indicate whether the configuration is valid or not. # The method checks if the mandatory fields are or not set From 4d57aa8ea42096dde3ef1db3f370e672ebd89b2b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 12 Dec 2018 09:28:15 +0100 Subject: [PATCH 114/199] Simplify the rating widget CURA-6013 --- plugins/Toolbox/resources/qml/RatingWidget.qml | 10 ---------- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 2 -- 2 files changed, 12 deletions(-) diff --git a/plugins/Toolbox/resources/qml/RatingWidget.qml b/plugins/Toolbox/resources/qml/RatingWidget.qml index fbe782b2e2..355b99c0c4 100644 --- a/plugins/Toolbox/resources/qml/RatingWidget.qml +++ b/plugins/Toolbox/resources/qml/RatingWidget.qml @@ -10,8 +10,6 @@ Item property int indexHovered: -1 property string packageId: "" - property int numRatings: 0 - property int userRating: 0 signal rated(int rating) @@ -88,14 +86,6 @@ Item onClicked: rated(index + 1) // Notify anyone who cares about this. } } - Label - { - text: "(" + numRatings + ")" - verticalAlignment: Text.AlignVCenter - height: parent.height - color: "#5a5a5a" - font: UM.Theme.getFont("small") - } } } } \ No newline at end of file diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 4adbaa2435..52af1d6ddf 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -135,8 +135,6 @@ Item id: rating visible: details.type == "plugin" packageId: details.id - rating: details.average_rating - numRatings: details.num_ratings userRating: details.user_rating enabled: toolbox.isInstalled(details.id) && Cura.API.account.isLoggedIn From a6dbba709088c93b110abd874b82785eb612f4f7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 12 Dec 2018 09:41:35 +0100 Subject: [PATCH 115/199] Minor UI tweaks CURA-6013 --- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 52af1d6ddf..1d977883f9 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -26,7 +26,7 @@ Item right: parent.right rightMargin: UM.Theme.getSize("wide_margin").width } - height: UM.Theme.getSize("toolbox_detail_header").height + height: childrenRect.height + 3 * UM.Theme.getSize("default_margin").width Rectangle { id: thumbnail @@ -62,8 +62,7 @@ Item text: details === null ? "" : (details.name || "") font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") - wrapMode: Text.WordWrap - width: properties.width + values.width + width: contentWidth height: contentHeight } From 95f70a75d8629663dd42b2fdac148407cc993ed9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 12 Dec 2018 10:39:56 +0100 Subject: [PATCH 116/199] Ensure that package name has margins in showcase tile CURA-6013 --- plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index 3e09654173..ca0226b39d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -44,7 +44,7 @@ Rectangle verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter height: UM.Theme.getSize("toolbox_heading_label").height - width: parent.width + width: parent.width - UM.Theme.getSize("default_margin").width wrapMode: Text.WordWrap font: UM.Theme.getFont("medium_bold") } From 31331e36d2fa6468973f1f1d26ae7df3d8c0d6a9 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 12 Dec 2018 09:19:43 +0100 Subject: [PATCH 117/199] Revert "Use the capitalized version of the buildplate name" This reverts commit 11d8831d7a9a15e3e916d5d9762bfe1f755042e5. Contributes to CURA-6021. --- cura/PrinterOutput/ConfigurationModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PrinterOutput/ConfigurationModel.py b/cura/PrinterOutput/ConfigurationModel.py index 6f55aa3b1f..89e609c913 100644 --- a/cura/PrinterOutput/ConfigurationModel.py +++ b/cura/PrinterOutput/ConfigurationModel.py @@ -44,7 +44,7 @@ class ConfigurationModel(QObject): @pyqtProperty(str, fset = setBuildplateConfiguration, notify = configurationChanged) def buildplateConfiguration(self) -> str: - return self._buildplate_configuration.capitalize() + return self._buildplate_configuration ## This method is intended to indicate whether the configuration is valid or not. # The method checks if the mandatory fields are or not set From f302a76d3aedf38e051e692f59246d406a1295d9 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 12 Dec 2018 10:47:15 +0100 Subject: [PATCH 118/199] Fix typing issue in Toolbox CURA-6006 --- plugins/Toolbox/src/Toolbox.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index ab975548ce..d957b7aae1 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -670,7 +670,8 @@ class Toolbox(QObject, Extension): self.setDownloadProgress(new_progress) if bytes_sent == bytes_total: self.setIsDownloading(False) - cast(QNetworkReply, self._download_reply).downloadProgress.disconnect(self._onDownloadProgress) + self._download_reply = cast(QNetworkReply, self._download_reply) + self._download_reply.downloadProgress.disconnect(self._onDownloadProgress) # Check if the download was sucessfull if self._download_reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) != 200: From 5fd0f2b5f69e8f0597b4550a828a88da16eb8621 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 12 Dec 2018 11:09:58 +0100 Subject: [PATCH 119/199] Add tooltip to rating if the rating is disabled This makes it clearer what the user needs to do in order to rate (install package or login) CURA-6013 --- plugins/Toolbox/resources/qml/RatingWidget.qml | 16 ++++++++++------ .../Toolbox/resources/qml/ToolboxDetailPage.qml | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/plugins/Toolbox/resources/qml/RatingWidget.qml b/plugins/Toolbox/resources/qml/RatingWidget.qml index 355b99c0c4..9d9eb8bca8 100644 --- a/plugins/Toolbox/resources/qml/RatingWidget.qml +++ b/plugins/Toolbox/resources/qml/RatingWidget.qml @@ -1,7 +1,7 @@ -import QtQuick 2.2 -import QtQuick.Controls 2.0 +import QtQuick 2.7 +import QtQuick.Controls 2.1 import UM 1.0 as UM - +import Cura 1.1 as Cura Item { id: ratingWidget @@ -11,6 +11,7 @@ Item property string packageId: "" property int userRating: 0 + property bool canRate: false signal rated(int rating) @@ -20,7 +21,7 @@ Item { id: mouseArea anchors.fill: parent - hoverEnabled: ratingWidget.enabled + hoverEnabled: ratingWidget.canRate acceptedButtons: Qt.NoButton onExited: { @@ -40,12 +41,15 @@ Item hoverEnabled: true onHoveredChanged: { - if(hovered) + if(hovered && ratingWidget.canRate) { indexHovered = index } } + ToolTip.visible: control.hovered && !ratingWidget.canRate + ToolTip.text: !Cura.API.account.isLoggedIn ? catalog.i18nc("@label", "You need to login first before you can rate"): catalog.i18nc("@label", "You need to install the package before you can rate") + property bool isStarFilled: { // If the entire widget is hovered, override the actual rating. @@ -72,7 +76,7 @@ Item // Unfilled stars should always have the default color. Only filled stars should change on hover color: { - if(!enabled) + if(!ratingWidget.canRate) { return "#5a5a5a" } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 1d977883f9..d0608be4de 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -135,7 +135,7 @@ Item visible: details.type == "plugin" packageId: details.id userRating: details.user_rating - enabled: toolbox.isInstalled(details.id) && Cura.API.account.isLoggedIn + canRate: toolbox.isInstalled(details.id) && Cura.API.account.isLoggedIn onRated: { From a6a16a682dd6995c7b84e597710765c3e21cd0a1 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 12 Dec 2018 11:17:44 +0100 Subject: [PATCH 120/199] Fix some alignments Also modify a bit the code in the ConfigurationItem, trying to get rid of a binding loop, but I couldn't (so weird) Contributes to CURA-5876. --- .../ConfigurationMenu/AutoConfiguration.qml | 1 + .../ConfigurationMenu/ConfigurationItem.qml | 167 +++++++++--------- .../ConfigurationListView.qml | 3 +- .../ConfigurationMenu/ConfigurationMenu.qml | 25 +-- resources/themes/cura-light/theme.json | 1 + 5 files changed, 98 insertions(+), 99 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml index 2e8be05fef..a3ed5040b7 100644 --- a/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/AutoConfiguration.qml @@ -31,6 +31,7 @@ Item ConfigurationListView { anchors.top: header.bottom + anchors.topMargin: UM.Theme.getSize("default_margin").width width: parent.width outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index 9dae075b48..a73cd3b46c 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -14,120 +14,115 @@ Button property var configuration: null hoverEnabled: true - height: background.height - background: Rectangle { - height: childrenRect.height color: parent.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") border.color: parent.checked ? UM.Theme.getColor("primary") : UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width radius: UM.Theme.getSize("default_radius").width + } - Column + contentItem: Column + { + id: contentColumn + width: parent.width + padding: UM.Theme.getSize("default_margin").width + spacing: UM.Theme.getSize("narrow_margin").height + + Row { - id: contentColumn - width: parent.width - padding: UM.Theme.getSize("wide_margin").width - spacing: UM.Theme.getSize("narrow_margin").height + id: extruderRow - Row + anchors { - id: extruderRow - - anchors - { - left: parent.left - leftMargin: parent.padding - right: parent.right - rightMargin: parent.padding - } - height: childrenRect.height - - spacing: UM.Theme.getSize("default_margin").width - - Repeater - { - id: repeater - height: childrenRect.height - model: configuration.extruderConfigurations - delegate: PrintCoreConfiguration - { - width: Math.round(parent.width / 2) - printCoreConfiguration: modelData - } - } + left: parent.left + leftMargin: 2 * parent.padding + right: parent.right + rightMargin: 2 * parent.padding } - //Buildplate row separator - Rectangle + spacing: UM.Theme.getSize("default_margin").width + + Repeater { - id: separator - - visible: buildplateInformation.visible - anchors + id: repeater + model: configuration.extruderConfigurations + delegate: PrintCoreConfiguration { - left: parent.left - leftMargin: parent.padding - right: parent.right - rightMargin: parent.padding - } - height: visible ? Math.round(UM.Theme.getSize("default_lining").height / 2) : 0 - color: UM.Theme.getColor("lining") - } - - Item - { - id: buildplateInformation - - anchors - { - left: parent.left - leftMargin: parent.padding - right: parent.right - rightMargin: parent.padding - } - height: childrenRect.height - visible: configuration.buildplateConfiguration != "" - - UM.RecolorImage - { - id: buildplateIcon - anchors.left: parent.left - width: UM.Theme.getSize("main_window_header_button_icon").width - height: UM.Theme.getSize("main_window_header_button_icon").height - source: UM.Theme.getIcon("buildplate") - color: UM.Theme.getColor("text") - } - - Label - { - id: buildplateLabel - anchors.left: buildplateIcon.right - anchors.verticalCenter: buildplateIcon.verticalCenter - anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2) - text: configuration.buildplateConfiguration - renderType: Text.NativeRendering - color: UM.Theme.getColor("text") + width: Math.round(parent.width / 2) + printCoreConfiguration: modelData } } } - Connections + //Buildplate row separator + Rectangle { - target: Cura.MachineManager - onCurrentConfigurationChanged: + id: separator + + visible: buildplateInformation.visible + anchors { - configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration) + left: parent.left + leftMargin: 2 * parent.padding + right: parent.right + rightMargin: 2 * parent.padding } + height: visible ? Math.round(UM.Theme.getSize("default_lining").height / 2) : 0 + color: UM.Theme.getColor("lining") } - Component.onCompleted: + Item + { + id: buildplateInformation + + anchors + { + left: parent.left + leftMargin: 2 * parent.padding + right: parent.right + rightMargin: 2 * parent.padding + } + height: childrenRect.height + visible: configuration.buildplateConfiguration != "" + + UM.RecolorImage + { + id: buildplateIcon + anchors.left: parent.left + width: UM.Theme.getSize("main_window_header_button_icon").width + height: UM.Theme.getSize("main_window_header_button_icon").height + source: UM.Theme.getIcon("buildplate") + color: UM.Theme.getColor("text") + } + + Label + { + id: buildplateLabel + anchors.left: buildplateIcon.right + anchors.verticalCenter: buildplateIcon.verticalCenter + anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2) + text: configuration.buildplateConfiguration + renderType: Text.NativeRendering + color: UM.Theme.getColor("text") + } + } + } + + Connections + { + target: Cura.MachineManager + onCurrentConfigurationChanged: { configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration) } } + Component.onCompleted: + { + configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration) + } + onClicked: { Cura.MachineManager.applyRemoteConfiguration(configuration) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 3cc0754284..d7ffa0d8ff 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -11,7 +11,7 @@ Column { id: base property var outputDevice: null - height: childrenRect.height + 2 * padding + height: childrenRect.height + padding spacing: UM.Theme.getSize("narrow_margin").height function forceModelUpdate() @@ -57,7 +57,6 @@ Column id: configurationList spacing: UM.Theme.getSize("narrow_margin").height width: container.width - ((height > container.maximumHeight) ? container.ScrollBar.vertical.background.width : 0) //Make room for scroll bar if there is any. - contentHeight: childrenRect.height height: childrenRect.height section.property: "modelData.printerType" diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 33a317b42b..2165f001f9 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -34,6 +34,8 @@ Cura.ExpandablePopup Custom } + contentPadding: UM.Theme.getSize("default_lining").width + contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft enabled: Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants || Cura.MachineManager.hasVariantBuildplates; //Only let it drop down if there is any configuration that you could change. headerItem: Item @@ -127,8 +129,9 @@ Cura.ExpandablePopup contentItem: Column { id: popupItem - width: base.width - 2 * UM.Theme.getSize("default_margin").width + width: UM.Theme.getSize("configuration_selector").width height: implicitHeight //Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up. + padding: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height property bool is_connected: false //If current machine is connected to a printer. Only evaluated upon making popup visible. @@ -141,19 +144,19 @@ Cura.ExpandablePopup Item { - width: parent.width + width: parent.width - 2 * parent.padding height: { - var height = 0; - if(autoConfiguration.visible) + var height = 0 + if (autoConfiguration.visible) { - height += autoConfiguration.height; + height += autoConfiguration.height } - if(customConfiguration.visible) + if (customConfiguration.visible) { - height += customConfiguration.height; + height += customConfiguration.height } - return height; + return height } AutoConfiguration { @@ -172,9 +175,9 @@ Cura.ExpandablePopup { id: separator visible: buttonBar.visible - x: -contentPadding + x: -parent.padding - width: base.width + width: parent.width height: UM.Theme.getSize("default_lining").height color: UM.Theme.getColor("lining") @@ -186,7 +189,7 @@ Cura.ExpandablePopup id: buttonBar visible: popupItem.is_connected //Switching only makes sense if the "auto" part is possible. - width: parent.width + width: parent.width - 2 * parent.padding height: childrenRect.height Cura.SecondaryButton diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index b4d0ab7092..201703c6be 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -356,6 +356,7 @@ "expandable_component_content_header": [0.0, 3.0], + "configuration_selector": [38.0, 4.0], "configuration_selector_mode_tabs": [0.0, 3.0], "action_panel_widget": [25.0, 0.0], From b1244b6bde57b158dc0629dcd66f32644582487e Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 12 Dec 2018 11:22:35 +0100 Subject: [PATCH 121/199] Remove file MonitorSidebar It's not used anymore. Contributes to CURA-5876. --- resources/qml/MonitorSidebar.qml | 212 ------------------------------- 1 file changed, 212 deletions(-) delete mode 100644 resources/qml/MonitorSidebar.qml diff --git a/resources/qml/MonitorSidebar.qml b/resources/qml/MonitorSidebar.qml deleted file mode 100644 index 669bdbfb8f..0000000000 --- a/resources/qml/MonitorSidebar.qml +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.10 -import QtQuick.Controls 2.0 -import QtQuick.Layouts 1.3 - -import UM 1.2 as UM -import Cura 1.0 as Cura - -import "Menus" -import "Menus/ConfigurationMenu" - - -Rectangle -{ - id: base - - property int currentModeIndex - property bool hideSettings: PrintInformation.preSliced - property bool hideView: Cura.MachineManager.activeMachineName == "" - - // Is there an output device for this printer? - property bool isNetworkPrinter: Cura.MachineManager.activeMachineNetworkKey != "" - property bool printerConnected: Cura.MachineManager.printerConnected - property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands - property var connectedPrinter: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null - - property variant printDuration: PrintInformation.currentPrintTime - property variant printMaterialLengths: PrintInformation.materialLengths - property variant printMaterialWeights: PrintInformation.materialWeights - property variant printMaterialCosts: PrintInformation.materialCosts - property variant printMaterialNames: PrintInformation.materialNames - - color: UM.Theme.getColor("main_background") - UM.I18nCatalog { id: catalog; name: "cura"} - - Timer { - id: tooltipDelayTimer - interval: 500 - repeat: false - property var item - property string text - - onTriggered: - { - base.showTooltip(base, {x: 0, y: item.y}, text); - } - } - - function showTooltip(item, position, text) - { - tooltip.text = text; - position = item.mapToItem(base, position.x - UM.Theme.getSize("default_arrow").width, position.y); - tooltip.show(position); - } - - function hideTooltip() - { - tooltip.hide(); - } - - function strPadLeft(string, pad, length) { - return (new Array(length + 1).join(pad) + string).slice(-length); - } - - function getPrettyTime(time) - { - var hours = Math.floor(time / 3600) - time -= hours * 3600 - var minutes = Math.floor(time / 60); - time -= minutes * 60 - var seconds = Math.floor(time); - - var finalTime = strPadLeft(hours, "0", 2) + ":" + strPadLeft(minutes, "0", 2) + ":" + strPadLeft(seconds, "0", 2); - return finalTime; - } - - MouseArea - { - anchors.fill: parent - acceptedButtons: Qt.AllButtons - - onWheel: - { - wheel.accepted = true; - } - } - - MachineSelector - { - id: machineSelection - width: base.width - configSelection.width - separator.width - height: UM.Theme.getSize("stage_menu").height - anchors.top: base.top - anchors.left: parent.left - } - - Rectangle - { - id: separator - visible: configSelection.visible - width: visible ? Math.round(UM.Theme.getSize("thick_lining").height / 2) : 0 - height: UM.Theme.getSize("stage_menu").height - color: UM.Theme.getColor("thick_lining") - anchors.left: machineSelection.right - } - - CustomConfigurationSelector - { - id: configSelection - visible: isNetworkPrinter && printerConnected - width: visible ? Math.round(base.width * 0.15) : 0 - height: UM.Theme.getSize("stage_menu").height - anchors.top: base.top - anchors.right: parent.right - } - - Loader - { - id: controlItem - anchors.bottom: footerSeparator.top - anchors.top: machineSelection.bottom - anchors.left: base.left - anchors.right: base.right - sourceComponent: - { - if(connectedPrinter != null) - { - if(connectedPrinter.controlItem != null) - { - return connectedPrinter.controlItem - } - } - return null - } - } - - Loader - { - anchors.bottom: footerSeparator.top - anchors.top: machineSelection.bottom - anchors.left: base.left - anchors.right: base.right - source: - { - if(controlItem.sourceComponent == null) - { - return "PrintMonitor.qml" - } - else - { - return "" - } - } - } - - Rectangle - { - id: footerSeparator - width: parent.width - height: UM.Theme.getSize("wide_lining").height - color: UM.Theme.getColor("wide_lining") - anchors.bottom: monitorButton.top - anchors.bottomMargin: UM.Theme.getSize("thick_margin").height - } - - // MonitorButton is actually the bottom footer panel. - MonitorButton - { - id: monitorButton - implicitWidth: base.width - anchors.bottom: parent.bottom - } - - PrintSetupTooltip - { - id: tooltip - } - - UM.SettingPropertyProvider - { - id: machineExtruderCount - - containerStack: Cura.MachineManager.activeMachine - key: "machine_extruder_count" - watchedProperties: [ "value" ] - storeIndex: 0 - } - - UM.SettingPropertyProvider - { - id: machineHeatedBed - - containerStack: Cura.MachineManager.activeMachine - key: "machine_heated_bed" - watchedProperties: [ "value" ] - storeIndex: 0 - } - - // Make the ConfigurationSelector react when the global container changes, otherwise if Cura is not connected to the printer, - // switching printers make no reaction - Connections - { - target: Cura.MachineManager - onGlobalContainerChanged: - { - base.isNetworkPrinter = Cura.MachineManager.activeMachineNetworkKey != "" - base.printerConnected = Cura.MachineManager.printerOutputDevices.length != 0 - } - } -} From dbf91fca7f42e34111134d5e794267c1f917ee09 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 12 Dec 2018 11:40:51 +0100 Subject: [PATCH 122/199] Re-added hover on showcase tiles CURA-6013 --- .../qml/ToolboxDownloadsShowcaseTile.qml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index ca0226b39d..73d3acc76f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -51,12 +51,11 @@ Rectangle UM.RecolorImage { width: (parent.width * 0.20) | 0 - height: (parent.height * 0.20) | 0 + height: width anchors { - bottom: parent.bottom + bottom: bottomBorder.top right: parent.right - bottomMargin: UM.Theme.getSize("default_lining").width } visible: installedPackages != 0 color: (installedPackages == packageCount) ? UM.Theme.getColor("primary") : UM.Theme.getColor("border") @@ -70,10 +69,21 @@ Rectangle anchors.bottomMargin: UM.Theme.getSize("narrow_margin").height anchors.horizontalCenter: parent.horizontalCenter } + Rectangle + { + id: bottomBorder + color: UM.Theme.getColor("primary") + anchors.bottom: parent.bottom + width: parent.width + height: UM.Theme.getSize("toolbox_header_highlight").height + } MouseArea { anchors.fill: parent + hoverEnabled: true + onEntered: tileBase.border.color = UM.Theme.getColor("primary") + onExited: tileBase.border.color = UM.Theme.getColor("lining") onClicked: { base.selection = model From 901c19e270e3c3258e734b14c1f2433135f99695 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 12 Dec 2018 11:52:04 +0100 Subject: [PATCH 123/199] Prevent QML warning CURA-6013 --- plugins/Toolbox/resources/qml/SmallRatingWidget.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml index 0b93131cfd..439a7baec0 100644 --- a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml +++ b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml @@ -3,8 +3,6 @@ import QtQuick.Controls 1.4 import UM 1.1 as UM import Cura 1.1 as Cura - - Row { id: rating @@ -24,7 +22,7 @@ Row Label { id: numRatingsLabel - text: model.average_rating.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")" + text: model.average_rating != undefined ? model.average_rating.toFixed(1) + " (" + model.num_ratings + " " + catalog.i18nc("@label", "ratings") + ")": "" verticalAlignment: Text.AlignVCenter height: starIcon.height width: contentWidth From 4ba448077e59791e655a497196ef65aaaae5e3c1 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 12 Dec 2018 13:33:46 +0100 Subject: [PATCH 124/199] Add an empty state, when there are no configurations, showing a label indicating that the list is empty Contributes to CURA-5876. --- .../ConfigurationListView.qml | 18 ++++++++++++++---- .../ConfigurationMenu/ConfigurationMenu.qml | 12 ++++++------ resources/themes/cura-light/theme.json | 2 +- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index d7ffa0d8ff..7943bba81d 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -7,16 +7,15 @@ import QtQuick.Controls 2.3 import UM 1.2 as UM import Cura 1.0 as Cura -Column +Item { id: base property var outputDevice: null - height: childrenRect.height + padding - spacing: UM.Theme.getSize("narrow_margin").height + height: childrenRect.height function forceModelUpdate() { - // FIXME For now the model should be removed and then created again, otherwise changes in the printer don't automatically update the UI + // FIXME For now the model has to be removed and then created again, otherwise changes in the printer don't automatically update the UI configurationList.model = [] if (outputDevice) { @@ -24,6 +23,17 @@ Column } } + // This component will appear when there is no configurations (e.g. when loosing connection) + Label + { + width: parent.width + visible: configurationList.model.length == 0 + text: "Configuration list empty. Probably because of lost connection" // TODO change this to a proper component + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + renderType: Text.NativeRendering + } + ScrollView { id: container diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 2165f001f9..e04c04f83b 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -35,7 +35,6 @@ Cura.ExpandablePopup } contentPadding: UM.Theme.getSize("default_lining").width - contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft enabled: Cura.MachineManager.hasMaterials || Cura.MachineManager.hasVariants || Cura.MachineManager.hasVariantBuildplates; //Only let it drop down if there is any configuration that you could change. headerItem: Item @@ -130,18 +129,19 @@ Cura.ExpandablePopup { id: popupItem width: UM.Theme.getSize("configuration_selector").width - height: implicitHeight //Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up. + height: implicitHeight // Required because ExpandableComponent will try to use this to determine the size of the background of the pop-up. padding: UM.Theme.getSize("default_margin").height spacing: UM.Theme.getSize("default_margin").height - property bool is_connected: false //If current machine is connected to a printer. Only evaluated upon making popup visible. + property bool is_connected: false // If current machine is connected to a printer. Only evaluated upon making popup visible. + property int configuration_method: ConfigurationMenu.ConfigurationMethod.Custom // Type of configuration being used. Only evaluated upon making popup visible. + onVisibleChanged: { - is_connected = Cura.MachineManager.activeMachineNetworkKey !== "" && Cura.MachineManager.printerConnected //Re-evaluate. + is_connected = Cura.MachineManager.activeMachineNetworkKey !== "" && Cura.MachineManager.printerConnected // Re-evaluate. + configuration_method = is_connected ? ConfigurationMenu.ConfigurationMethod.Auto : ConfigurationMenu.ConfigurationMethod.Custom // Auto if connected to a printer at start-up, or Custom if not. } - property int configuration_method: is_connected ? ConfigurationMenu.ConfigurationMethod.Auto : ConfigurationMenu.ConfigurationMethod.Custom //Auto if connected to a printer at start-up, or Custom if not. - Item { width: parent.width - 2 * parent.padding diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 201703c6be..413d547d5d 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -356,7 +356,7 @@ "expandable_component_content_header": [0.0, 3.0], - "configuration_selector": [38.0, 4.0], + "configuration_selector": [35.0, 4.0], "configuration_selector_mode_tabs": [0.0, 3.0], "action_panel_widget": [25.0, 0.0], From 1d3da3244f593a978693e9bb8030bc01177032bb Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 12 Dec 2018 14:09:15 +0100 Subject: [PATCH 125/199] Remember the previous selected method in the configuration The current behavior now is to open the configuration panel in the previous state, in case it was manually selected. That means that after selecting a printer, the manual state is reset so it will open the auto configuration if it is a connected printer. It will open the custom state in case it's not connected or the printer has no connection. Contributes to CURA-5876. --- .../ConfigurationMenu/ConfigurationMenu.qml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index e04c04f83b..6aea5b9009 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -135,11 +135,15 @@ Cura.ExpandablePopup property bool is_connected: false // If current machine is connected to a printer. Only evaluated upon making popup visible. property int configuration_method: ConfigurationMenu.ConfigurationMethod.Custom // Type of configuration being used. Only evaluated upon making popup visible. + property int manual_selected_method: -1 // It stores the configuration method selected by the user. By default the selected method is onVisibleChanged: { is_connected = Cura.MachineManager.activeMachineNetworkKey !== "" && Cura.MachineManager.printerConnected // Re-evaluate. - configuration_method = is_connected ? ConfigurationMenu.ConfigurationMethod.Auto : ConfigurationMenu.ConfigurationMethod.Custom // Auto if connected to a printer at start-up, or Custom if not. + + // If the printer is not connected, we switch always to the custom mode. If is connected instead, the auto mode + // or the previous state is selected + configuration_method = is_connected ? (manual_selected_method == -1 ? ConfigurationMenu.ConfigurationMethod.Auto : manual_selected_method) : ConfigurationMenu.ConfigurationMethod.Custom } Item @@ -158,6 +162,7 @@ Cura.ExpandablePopup } return height } + AutoConfiguration { id: autoConfiguration @@ -203,7 +208,11 @@ Cura.ExpandablePopup iconSource: UM.Theme.getIcon("arrow_right") isIconOnRightSide: true - onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.Custom + onClicked: + { + popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.Custom + popupItem.manual_selected_method = popupItem.configuration_method + } } Cura.SecondaryButton @@ -214,8 +223,18 @@ Cura.ExpandablePopup iconSource: UM.Theme.getIcon("arrow_left") - onClicked: popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.Auto + onClicked: + { + popupItem.configuration_method = ConfigurationMenu.ConfigurationMethod.Auto + popupItem.manual_selected_method = popupItem.configuration_method + } } } } + + Connections + { + target: Cura.MachineManager + onGlobalContainerChanged: popupItem.manual_selected_method = -1 // When switching printers, reset the value of the manual selected method + } } From 17173aba0637b1a2ea22692ff3935801bb62c1a2 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 12 Dec 2018 17:04:17 +0100 Subject: [PATCH 126/199] Add a component to show when no configurations are available because lack of connection. Contributes to CURA-5876. --- .../qml/ActionPanel/OutputProcessWidget.qml | 2 - .../qml/ActionPanel/SliceProcessWidget.qml | 2 +- resources/qml/IconWithText.qml | 3 +- .../ConfigurationListView.qml | 37 ++++++++++++--- .../qml/PrinterSelector/MachineSelector.qml | 47 +++++-------------- resources/themes/cura-light/icons/warning.svg | 13 +++-- resources/themes/cura-light/theme.json | 2 +- 7 files changed, 56 insertions(+), 50 deletions(-) diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index 3f53abf28f..5ac777e2ad 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -119,8 +119,6 @@ Column } height: UM.Theme.getSize("action_button").height - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width text: catalog.i18nc("@button", "Preview") onClicked: UM.Controller.setActiveStage("PreviewStage") diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 18caeafb40..3756d0d452 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -60,7 +60,7 @@ Column text: catalog.i18nc("@label:PrintjobStatus", "Unable to Slice") source: UM.Theme.getIcon("warning") - color: UM.Theme.getColor("warning") + iconColor: UM.Theme.getColor("warning") } // Progress bar, only visible when the backend is in the process of slice the printjob diff --git a/resources/qml/IconWithText.qml b/resources/qml/IconWithText.qml index 5530740040..9fd527b27e 100644 --- a/resources/qml/IconWithText.qml +++ b/resources/qml/IconWithText.qml @@ -15,6 +15,7 @@ Item { property alias source: icon.source property alias iconSize: icon.width + property alias iconColor: icon.color property alias color: label.color property alias text: label.text property alias font: label.font @@ -37,7 +38,7 @@ Item { id: icon width: UM.Theme.getSize("section_icon").width - height: UM.Theme.getSize("section_icon").height + height: width color: label.color diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 7943bba81d..3ddbb49fe8 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -23,15 +23,40 @@ Item } } - // This component will appear when there is no configurations (e.g. when loosing connection) - Label + // This component will appear when there is no configurations (e.g. when losing connection) + Item { width: parent.width visible: configurationList.model.length == 0 - text: "Configuration list empty. Probably because of lost connection" // TODO change this to a proper component - horizontalAlignment: Text.AlignHCenter - wrapMode: Text.WordWrap - renderType: Text.NativeRendering + height: label.height + 2 * UM.Theme.getSize("default_margin").height + anchors.top: parent.top + anchors.topMargin: UM.Theme.getSize("default_margin").height + + UM.RecolorImage + { + id: icon + + anchors.left: parent.left + anchors.verticalCenter: label.verticalCenter + + source: UM.Theme.getIcon("warning") + color: UM.Theme.getColor("warning") + width: UM.Theme.getSize("section_icon").width + height: width + } + + Label + { + id: label + anchors.left: icon.right + anchors.right: parent.right + anchors.leftMargin: UM.Theme.getSize("default_margin").width + text: catalog.i18nc("@label", "The configurations are not available because the printer is disconnected.") + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("default") + renderType: Text.NativeRendering + wrapMode: Text.WordWrap + } } ScrollView diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 7cda4f1d2e..db9c38b9f1 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -24,49 +24,24 @@ Cura.ExpandablePopup name: "cura" } - headerItem: Item + headerItem: Cura.IconWithText { - implicitHeight: icon.height - - UM.RecolorImage + text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName + source: { - id: icon - - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - - source: + if (isNetworkPrinter) { - if (isNetworkPrinter) + if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1) { - if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1) - { - return UM.Theme.getIcon("printer_group") - } - return UM.Theme.getIcon("printer_single") + return UM.Theme.getIcon("printer_group") } - return "" + return UM.Theme.getIcon("printer_single") } - width: UM.Theme.getSize("machine_selector_icon").width - height: width - - color: UM.Theme.getColor("machine_selector_printer_icon") - visible: source != "" - } - - Label - { - id: label - anchors.left: icon.visible ? icon.right : parent.left - anchors.right: parent.right - anchors.leftMargin: UM.Theme.getSize("thin_margin").width - anchors.verticalCenter: icon.verticalCenter - text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName - elide: Text.ElideRight - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("medium") - renderType: Text.NativeRendering + return "" } + font: UM.Theme.getFont("medium") + iconColor: UM.Theme.getColor("machine_selector_printer_icon") + iconSize: UM.Theme.getSize("machine_selector_icon").width UM.RecolorImage { diff --git a/resources/themes/cura-light/icons/warning.svg b/resources/themes/cura-light/icons/warning.svg index ae8a7a6430..14b7d797d0 100644 --- a/resources/themes/cura-light/icons/warning.svg +++ b/resources/themes/cura-light/icons/warning.svg @@ -1,4 +1,11 @@ - - - + + + + Icon/warning-s + Created with Sketch. + + + + + \ No newline at end of file diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 413d547d5d..1a9dec5deb 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -101,7 +101,7 @@ "printer_type_label_background": [228, 228, 242, 255], - "text": [0, 0, 0, 255], + "text": [25, 25, 25, 255], "text_detail": [174, 174, 174, 128], "text_link": [50, 130, 255, 255], "text_inactive": [174, 174, 174, 255], From a1d7fa893da138f241fd1cc74895ec8e5d928eb6 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 12 Dec 2018 17:26:13 +0100 Subject: [PATCH 127/199] Change the style for the toolbuttons that appear in the popup panel of some tools Contributes to CURA-6024 --- resources/themes/cura-light/styles.qml | 94 ++++++-------------------- resources/themes/cura-light/theme.json | 2 - 2 files changed, 20 insertions(+), 76 deletions(-) diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index bcc754f4ca..c940052668 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -177,8 +177,8 @@ QtObject { background: Item { - implicitWidth: Theme.getSize("button").width; - implicitHeight: Theme.getSize("button").height; + implicitWidth: Theme.getSize("button").width + implicitHeight: Theme.getSize("button").height UM.PointingRectangle { @@ -205,20 +205,20 @@ QtObject id: button_tip anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter; + anchors.verticalCenter: parent.verticalCenter text: control.text; - font: Theme.getFont("button_tooltip"); - color: Theme.getColor("tooltip_text"); + font: Theme.getFont("button_tooltip") + color: Theme.getColor("tooltip_text") } } Rectangle { - id: buttonFace; + id: buttonFace - anchors.fill: parent; - property bool down: control.pressed || (control.checkable && control.checked); + anchors.fill: parent + property bool down: control.pressed || (control.checkable && control.checked) color: { @@ -228,58 +228,22 @@ QtObject } else if(control.checkable && control.checked && control.hovered) { - return Theme.getColor("button_active_hover"); + return Theme.getColor("toolbar_button_active_hover") } else if(control.pressed || (control.checkable && control.checked)) { - return Theme.getColor("button_active"); + return Theme.getColor("toolbar_button_active") } else if(control.hovered) { - return Theme.getColor("button_hover"); - } - else - { - return Theme.getColor("button"); + return Theme.getColor("toolbar_button_hover") } + return Theme.getColor("toolbar_background") } Behavior on color { ColorAnimation { duration: 50; } } - border.width: (control.hasOwnProperty("needBorder") && control.needBorder) ? 2 * screenScaleFactor : 0 - border.color: Theme.getColor("tool_button_border") - - UM.RecolorImage - { - id: tool_button_arrow - anchors.right: parent.right; - anchors.rightMargin: Theme.getSize("button").width - Math.round(Theme.getSize("button_icon").width / 4) - anchors.bottom: parent.bottom; - anchors.bottomMargin: Theme.getSize("button").height - Math.round(Theme.getSize("button_icon").height / 4) - width: Theme.getSize("standard_arrow").width - height: Theme.getSize("standard_arrow").height - sourceSize.height: width - visible: control.menu != null; - color: - { - if(control.checkable && control.checked && control.hovered) - { - return Theme.getColor("button_text_active_hover"); - } - else if(control.pressed || (control.checkable && control.checked)) - { - return Theme.getColor("button_text_active"); - } - else if(control.hovered) - { - return Theme.getColor("button_text_hover"); - } - else - { - return Theme.getColor("button_text"); - } - } - source: Theme.getIcon("arrow_bottom") - } + border.width: (control.hasOwnProperty("needBorder") && control.needBorder) ? Theme.getSize("default_lining").width : 0 + border.color: Theme.getColor("lining") } } @@ -287,30 +251,12 @@ QtObject { UM.RecolorImage { - anchors.centerIn: parent; - opacity: !control.enabled ? 0.2 : 1.0 - source: control.iconSource; - width: Theme.getSize("button_icon").width; - height: Theme.getSize("button_icon").height; - color: - { - if(control.checkable && control.checked && control.hovered) - { - return Theme.getColor("button_text_active_hover"); - } - else if(control.pressed || (control.checkable && control.checked)) - { - return Theme.getColor("button_text_active"); - } - else if(control.hovered) - { - return Theme.getColor("button_text_hover"); - } - else - { - return Theme.getColor("button_text"); - } - } + anchors.centerIn: parent + opacity: control.enabled ? 1.0 : 0.2 + source: control.iconSource + width: Theme.getSize("button_icon").width + height: Theme.getSize("button_icon").height + color: Theme.getColor("toolbar_button_text") sourceSize: Theme.getSize("button_icon") } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 3dc216ad70..59596e9a3f 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -243,8 +243,6 @@ "tooltip": [68, 192, 255, 255], "tooltip_text": [255, 255, 255, 255], - "tool_button_border": [255, 255, 255, 0], - "message_background": [255, 255, 255, 255], "message_shadow": [0, 0, 0, 120], "message_border": [192, 193, 194, 255], From e7fe7571aafdb89f24af2a687ca13e067b07d425 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 13 Dec 2018 09:02:14 +0100 Subject: [PATCH 128/199] Change the behaviour of the output device selector Now the behavior is the following: - The active output device is the one that shows up in the button (same as before) - The list of the output devices don't show the active device - When clicking in one item of the list, it becomes the active output and automatically it performs the action. Contributes to CURA-6026. --- .../qml/ActionPanel/OutputDevicesActionButton.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/resources/qml/ActionPanel/OutputDevicesActionButton.qml b/resources/qml/ActionPanel/OutputDevicesActionButton.qml index 9a6c97bcff..b56f50b9a9 100644 --- a/resources/qml/ActionPanel/OutputDevicesActionButton.qml +++ b/resources/qml/ActionPanel/OutputDevicesActionButton.qml @@ -12,6 +12,12 @@ Item { id: widget + function requestWriteToDevice() + { + UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice, PrintInformation.jobName, + { "filter_by_machine": true, "preferred_mimetypes": Cura.MachineManager.activeMachine.preferred_output_file_formats }); + } + Cura.PrimaryButton { id: saveToButton @@ -32,9 +38,8 @@ Item onClicked: { - forceActiveFocus(); - UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice, PrintInformation.jobName, - { "filter_by_machine": true, "preferred_mimetypes": Cura.MachineManager.activeMachine.preferred_output_file_formats }); + forceActiveFocus() + widget.requestWriteToDevice() } } @@ -81,6 +86,7 @@ Item delegate: Cura.ActionButton { text: model.description + visible: model.id != UM.OutputDeviceManager.activeDevice // Don't show the active device in the list color: "transparent" cornerRadius: 0 hoverColor: UM.Theme.getColor("primary") @@ -88,6 +94,7 @@ Item onClicked: { UM.OutputDeviceManager.setActiveDevice(model.id) + widget.requestWriteToDevice() popup.close() } } From 121af7ad6085096bb9c8bbae4643516de342eb93 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 13 Dec 2018 09:41:07 +0100 Subject: [PATCH 129/199] Reuse the primary button in the toolbox for the "Quit Cura" button --- .../Toolbox/resources/qml/ToolboxFooter.qml | 36 ++++++------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxFooter.qml b/plugins/Toolbox/resources/qml/ToolboxFooter.qml index 2d42ca7269..6f46e939ff 100644 --- a/plugins/Toolbox/resources/qml/ToolboxFooter.qml +++ b/plugins/Toolbox/resources/qml/ToolboxFooter.qml @@ -2,21 +2,23 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.3 + import UM 1.1 as UM +import Cura 1.0 as Cura Item { id: footer width: parent.width anchors.bottom: parent.bottom - height: visible ? Math.floor(UM.Theme.getSize("toolbox_footer").height) : 0 + height: visible ? UM.Theme.getSize("toolbox_footer").height : 0 + Label { text: catalog.i18nc("@info", "You will need to restart Cura before changes in packages have effect.") color: UM.Theme.getColor("text") - height: Math.floor(UM.Theme.getSize("toolbox_footer_button").height) + height: UM.Theme.getSize("toolbox_footer_button").height verticalAlignment: Text.AlignVCenter anchors { @@ -28,10 +30,10 @@ Item } renderType: Text.NativeRendering } - Button + + Cura.PrimaryButton { id: restartButton - text: catalog.i18nc("@info:button", "Quit Cura") anchors { top: parent.top @@ -39,27 +41,11 @@ Item right: parent.right rightMargin: UM.Theme.getSize("wide_margin").width } - iconName: "dialog-restart" + height: UM.Theme.getSize("toolbox_footer_button").height + text: catalog.i18nc("@info:button", "Quit Cura") onClicked: toolbox.restart() - style: ButtonStyle - { - background: Rectangle - { - implicitWidth: UM.Theme.getSize("toolbox_footer_button").width - implicitHeight: Math.floor(UM.Theme.getSize("toolbox_footer_button").height) - color: control.hovered ? UM.Theme.getColor("primary_hover") : UM.Theme.getColor("primary") - } - label: Label - { - color: UM.Theme.getColor("button_text") - font: UM.Theme.getFont("default_bold") - text: control.text - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - renderType: Text.NativeRendering - } - } } + ToolboxShadow { visible: footer.visible From 0a6c1a7c14e2d67ec8879ec2dc24e2acbade0c1d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Dec 2018 13:12:57 +0100 Subject: [PATCH 130/199] Fix CLIENT_ID (again) It got messed up in a merge again. Ugh. --- cura/API/Account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/API/Account.py b/cura/API/Account.py index 397e220478..be77a6307b 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -44,7 +44,7 @@ class Account(QObject): OAUTH_SERVER_URL= self._oauth_root, CALLBACK_PORT=self._callback_port, CALLBACK_URL="http://localhost:{}/callback".format(self._callback_port), - CLIENT_ID="um---------------ultimaker_cura_drive_plugin", + CLIENT_ID="um----------------------------ultimaker_cura", CLIENT_SCOPES="account.user.read drive.backup.read drive.backup.write packages.download packages.rating.read packages.rating.write", AUTH_DATA_PREFERENCE_KEY="general/ultimaker_auth_data", AUTH_SUCCESS_REDIRECT="{}/app/auth-success".format(self._oauth_root), From 2cf80b457820595cee714f012f3e9b46ef1c6348 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 12 Dec 2018 09:57:25 +0100 Subject: [PATCH 131/199] Remove unused simpleNames flag CURA-6015 --- cura/Settings/ExtrudersModel.py | 17 ----------------- .../resources/qml/UM3InfoComponents.qml | 4 +--- resources/qml/PrintMonitor.qml | 1 - 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/cura/Settings/ExtrudersModel.py b/cura/Settings/ExtrudersModel.py index e19617c8ef..84d40cea6e 100644 --- a/cura/Settings/ExtrudersModel.py +++ b/cura/Settings/ExtrudersModel.py @@ -78,8 +78,6 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): self._update_extruder_timer.setSingleShot(True) self._update_extruder_timer.timeout.connect(self.__updateExtruders) - self._simple_names = False - self._active_machine_extruders = [] # type: Iterable[ExtruderStack] self._add_optional_extruder = False @@ -101,21 +99,6 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): def addOptionalExtruder(self): return self._add_optional_extruder - ## Set the simpleNames property. - def setSimpleNames(self, simple_names): - if simple_names != self._simple_names: - self._simple_names = simple_names - self.simpleNamesChanged.emit() - self._updateExtruders() - - ## Emitted when the simpleNames property changes. - simpleNamesChanged = pyqtSignal() - - ## Whether or not the model should show all definitions regardless of visibility. - @pyqtProperty(bool, fset = setSimpleNames, notify = simpleNamesChanged) - def simpleNames(self): - return self._simple_names - ## Links to the stack-changed signal of the new extruders when an extruder # is swapped out or added in the current machine. # diff --git a/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml b/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml index 643c8164a7..0ee8880c36 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml @@ -83,9 +83,7 @@ Item { Column { Repeater { - model: Cura.ExtrudersModel { - simpleNames: true; - } + model: Cura.ExtrudersModel { } Label { text: model.name; diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 4ed8daa55c..316dcad653 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -63,7 +63,6 @@ Rectangle Cura.ExtrudersModel { id: extrudersModel - simpleNames: true } OutputDeviceHeader From 620790ae3de03113f23eafc0e1374fad7d222eb7 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 12 Dec 2018 11:08:33 +0100 Subject: [PATCH 132/199] Reduce the creations of ExtrudersModels CURA-6015 --- cura/CuraApplication.py | 15 +++++++++++++++ .../MachineSettingsAction.qml | 2 +- .../SimulationViewMenuComponent.qml | 2 +- plugins/SolidView/SolidView.py | 6 ++++-- .../resources/qml/UM3InfoComponents.qml | 2 +- .../Menus/ConfigurationMenu/ConfigurationMenu.qml | 5 +---- resources/qml/Menus/ContextMenu.qml | 2 +- resources/qml/Preferences/ProfilesPage.qml | 2 +- resources/qml/PrintMonitor.qml | 5 +---- .../Custom/CustomPrintSetup.qml | 5 +---- .../qml/PrintSetupSelector/PrintSetupSelector.qml | 5 +---- .../Recommended/RecommendedSupportSelector.qml | 5 +++-- resources/qml/Settings/SettingExtruder.qml | 9 +++++++-- .../qml/Settings/SettingOptionalExtruder.qml | 8 +++++--- resources/qml/Toolbar.qml | 5 +---- 15 files changed, 44 insertions(+), 34 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 7e11fd4d59..55e37617d5 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -205,6 +205,8 @@ class CuraApplication(QtApplication): self._container_manager = None self._object_manager = None + self._extruders_model = None + self._extruders_model_with_optional = None self._build_plate_model = None self._multi_build_plate_model = None self._setting_visibility_presets_model = None @@ -862,6 +864,19 @@ class CuraApplication(QtApplication): self._object_manager = ObjectsModel.createObjectsModel() return self._object_manager + @pyqtSlot(result = QObject) + def getExtrudersModel(self, *args) -> "ExtrudersModel": + if self._extruders_model is None: + self._extruders_model = ExtrudersModel(self) + return self._extruders_model + + @pyqtSlot(result = QObject) + def getExtrudersModelWithOptional(self, *args) -> "ExtrudersModel": + if self._extruders_model_with_optional is None: + self._extruders_model_with_optional = ExtrudersModel(self) + self._extruders_model_with_optional.setAddOptionalExtruder(True) + return self._extruders_model_with_optional + @pyqtSlot(result = QObject) def getMultiBuildPlateModel(self, *args) -> MultiBuildPlateModel: if self._multi_build_plate_model is None: diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index c88a721a84..d8efe6f8b8 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.qml @@ -13,7 +13,7 @@ import Cura 1.0 as Cura Cura.MachineAction { id: base - property var extrudersModel: Cura.ExtrudersModel{} + property var extrudersModel: CuraApplication.getExtrudersModel() property int extruderTabsCount: 0 property var activeMachineId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.id : "" diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 9f43252126..eec254c0dd 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -163,7 +163,7 @@ Cura.ExpandableComponent Repeater { - model: Cura.ExtrudersModel{} + model: CuraApplication.getExtrudersModel() CheckBox { diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index b9ad5c8829..797d6dabec 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -12,7 +12,6 @@ from UM.Math.Color import Color from UM.View.GL.OpenGL import OpenGL from cura.Settings.ExtruderManager import ExtruderManager -from cura.Settings.ExtrudersModel import ExtrudersModel import math @@ -29,13 +28,16 @@ class SolidView(View): self._non_printing_shader = None self._support_mesh_shader = None - self._extruders_model = ExtrudersModel() + self._extruders_model = None self._theme = None def beginRendering(self): scene = self.getController().getScene() renderer = self.getRenderer() + if not self._extruders_model: + self._extruders_model = Application.getInstance().getExtrudersModel() + if not self._theme: self._theme = Application.getInstance().getTheme() diff --git a/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml b/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml index 0ee8880c36..42e3b7d160 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml @@ -83,7 +83,7 @@ Item { Column { Repeater { - model: Cura.ExtrudersModel { } + model: CuraApplication.getExtrudersModel() Label { text: model.name; diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index 33a317b42b..d95dd9ebfa 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -17,10 +17,7 @@ Cura.ExpandablePopup { id: base - Cura.ExtrudersModel - { - id: extrudersModel - } + property var extrudersModel: CuraApplication.getExtrudersModel() UM.I18nCatalog { diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index 1ea402d815..cb10d50ce8 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -27,7 +27,7 @@ Menu MenuItem { id: extruderHeader; text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount); enabled: false; visible: base.shouldShowExtruders } Instantiator { - model: Cura.ExtrudersModel { id: extrudersModel } + model: CuraApplication.getExtrudersModel() MenuItem { text: "%1: %2 - %3".arg(model.name).arg(model.material).arg(model.variant) visible: base.shouldShowExtruders diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index d7ffbb3152..7fb17b7aa1 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -16,7 +16,7 @@ Item property QtObject qualityManager: CuraApplication.getQualityManager() property var resetEnabled: false // Keep PreferencesDialog happy - property var extrudersModel: Cura.ExtrudersModel {} + property var extrudersModel: CuraApplication.getExtrudersModel() UM.I18nCatalog { id: catalog; name: "cura"; } diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 316dcad653..6d8edf0deb 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -60,10 +60,7 @@ Rectangle anchors.fill: parent - Cura.ExtrudersModel - { - id: extrudersModel - } + property var extrudersModel: CuraApplication.getExtrudersModel() OutputDeviceHeader { diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml index b28c9ceb46..27de8df835 100644 --- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml @@ -16,10 +16,7 @@ Item property real padding: UM.Theme.getSize("default_margin").width property bool multipleExtruders: extrudersModel.count > 1 - Cura.ExtrudersModel - { - id: extrudersModel - } + property var extrudersModel: CuraApplication.getExtrudersModel() // Profile selector row GlobalProfileSelector diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml index 599eac957e..2d4d7f6cf1 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml @@ -26,10 +26,7 @@ Cura.ExpandableComponent headerItem: PrintSetupSelectorHeader {} - Cura.ExtrudersModel - { - id: extrudersModel - } + property var extrudersModel: CuraApplication.getExtrudersModel() contentItem: PrintSetupSelectorContents {} } \ No newline at end of file diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 57e0c8ce6b..87fb664713 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -156,9 +156,10 @@ Item } //: Model used to populate the extrudelModel - Cura.ExtrudersModel + property var extruders: CuraApplication.getExtrudersModel() + Connections { - id: extruders + target: extruders onModelChanged: populateExtruderModel() } diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index e1fedd9274..024eb17639 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -17,11 +17,16 @@ SettingItem id: control anchors.fill: parent - model: Cura.ExtrudersModel + property var extrudersModel: CuraApplication.getExtrudersModel() + + model: extrudersModel + + Connections { + target: extrudersModel onModelChanged: { - control.color = getItem(control.currentIndex).color + control.color = extrudersModel.getItem(control.currentIndex).color } } diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 200a3f64f1..d9ec1f07c4 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -17,10 +17,12 @@ SettingItem id: control anchors.fill: parent - model: Cura.ExtrudersModel + model: CuraApplication.getExtrudersModelWithOptional() + + Connections { - onModelChanged: control.color = getItem(control.currentIndex).color - addOptionalExtruder: true + target: model + onModelChanged: control.color = model.getItem(control.currentIndex).color } textRole: "name" diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 1e335472d4..1df516a315 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -144,10 +144,7 @@ Item } } - Cura.ExtrudersModel - { - id: extrudersModel - } + property var extrudersModel: CuraApplication.getExtrudersModel() UM.PointingRectangle { From 935f7a2512e14e361903155acbfc7198fa881512 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 12 Dec 2018 11:09:22 +0100 Subject: [PATCH 133/199] Remove unused imports CURA-6015 --- cura/Settings/ExtrudersModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/ExtrudersModel.py b/cura/Settings/ExtrudersModel.py index 84d40cea6e..b7fa659554 100644 --- a/cura/Settings/ExtrudersModel.py +++ b/cura/Settings/ExtrudersModel.py @@ -1,7 +1,7 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot, pyqtProperty, QTimer +from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty, QTimer from typing import Iterable from UM.i18n import i18nCatalog From df0b1c6c7735757e73317881fdc1f3b461cdabbd Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 12 Dec 2018 11:10:22 +0100 Subject: [PATCH 134/199] Fix ExtruderManager creation in MachineManager CURA-6015 --- cura/Settings/MachineManager.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index c375ce01d1..e26b82e487 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -88,12 +88,14 @@ class MachineManager(QObject): self._onGlobalContainerChanged() - ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderStackChanged) + extruder_manager = self._application.getExtruderManager() + + extruder_manager.activeExtruderChanged.connect(self._onActiveExtruderStackChanged) self._onActiveExtruderStackChanged() - ExtruderManager.getInstance().activeExtruderChanged.connect(self.activeMaterialChanged) - ExtruderManager.getInstance().activeExtruderChanged.connect(self.activeVariantChanged) - ExtruderManager.getInstance().activeExtruderChanged.connect(self.activeQualityChanged) + extruder_manager.activeExtruderChanged.connect(self.activeMaterialChanged) + extruder_manager.activeExtruderChanged.connect(self.activeVariantChanged) + extruder_manager.activeExtruderChanged.connect(self.activeQualityChanged) self.globalContainerChanged.connect(self.activeStackChanged) self.globalValueChanged.connect(self.activeStackValueChanged) From d879cab91ae2030a2aeb7a32c772dce7cfaf28e8 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 13 Dec 2018 13:49:06 +0100 Subject: [PATCH 135/199] Add all fields for optional extruder in ExtruderModel CURA-6015 --- cura/Settings/ExtrudersModel.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cura/Settings/ExtrudersModel.py b/cura/Settings/ExtrudersModel.py index b7fa659554..076cebf60d 100644 --- a/cura/Settings/ExtrudersModel.py +++ b/cura/Settings/ExtrudersModel.py @@ -204,7 +204,12 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel): "enabled": True, "color": "#ffffff", "index": -1, - "definition": "" + "definition": "", + "material": "", + "variant": "", + "stack": None, + "material_brand": "", + "color_name": "", } items.append(item) if self._items != items: From 8021c8e44900aa89ae4254b09e17be2179165b18 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 13 Dec 2018 13:49:45 +0100 Subject: [PATCH 136/199] Fix errors in SettingOptionalExtruder.qml CURA-6015 --- resources/qml/Settings/SettingOptionalExtruder.qml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index d9ec1f07c4..aabf808d83 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -12,17 +12,24 @@ SettingItem id: base property var focusItem: control + // Somehow if we directory set control.model to CuraApplication.getExtrudersModelWithOptional() + // and in the Connections.onModelChanged use control.model as a reference, it will complain about + // non-existing properties such as "onModelChanged" and "getItem". I guess if we access the model + // via "control.model", it gives back a generic/abstract model instance. To avoid this, we add + // this extra property to keep the ExtrudersModel and use this in the rest of the code. + property var extrudersWithOptionalModel: CuraApplication.getExtrudersModelWithOptional() + contents: ComboBox { id: control anchors.fill: parent - model: CuraApplication.getExtrudersModelWithOptional() + model: base.extrudersWithOptionalModel Connections { - target: model - onModelChanged: control.color = model.getItem(control.currentIndex).color + target: base.extrudersWithOptionalModel + onModelChanged: control.color = base.extrudersWithOptionalModel.getItem(control.currentIndex).color } textRole: "name" From a1a9b058f5e874f0ab41871afc94a7ac712badd0 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Dec 2018 14:28:32 +0100 Subject: [PATCH 137/199] Let header listen to activeStageId instead of the model CURA-6028 --- resources/qml/MainWindow/MainWindowHeader.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index ae1c13d9c3..6cb7370ec2 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -54,7 +54,8 @@ Item { text: model.name.toUpperCase() checkable: true - checked: model.active + checked: model.id == UM.Controller.activeStage.stageId + anchors.verticalCenter: parent.verticalCenter exclusiveGroup: mainWindowHeaderMenuGroup style: UM.Theme.styles.main_window_header_tab From c4700b27522dafa6d2164ea08b2215e1f738e013 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Dec 2018 14:30:00 +0100 Subject: [PATCH 138/199] Also update the model if the data changed CURA-6028 --- .../Recommended/RecommendedQualityProfileSelector.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml index 15d40f545a..349c6dbb57 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml @@ -39,6 +39,7 @@ Item { target: Cura.QualityProfilesDropDownMenuModel onItemsChanged: qualityModel.update() + onDataChanged: qualityModel.update() } Connections { From 17f0c12858ae2a3cf6466e8e5bc900338d22f444 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 13 Dec 2018 14:31:34 +0100 Subject: [PATCH 139/199] Make the middle component to have zero width if there is no component to fill the gap. Contributes to CURA-6020. --- plugins/PreviewStage/PreviewMenu.qml | 95 +++++++++++++--------------- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/plugins/PreviewStage/PreviewMenu.qml b/plugins/PreviewStage/PreviewMenu.qml index 4e1fbac837..62f814aac9 100644 --- a/plugins/PreviewStage/PreviewMenu.qml +++ b/plugins/PreviewStage/PreviewMenu.qml @@ -20,67 +20,60 @@ Item name: "cura" } - // Item to ensure that all of the buttons are nicely centered. - Item + Row { - anchors.horizontalCenter: parent.horizontalCenter - width: stageMenuRow.width + id: stageMenuRow + anchors.centerIn: parent height: parent.height + width: childrenRect.width - RowLayout + // We want this row to have a preferred with equals to the 85% of the parent + property int preferredWidth: Math.round(0.85 * previewMenu.width) + + Cura.ViewsSelector { - id: stageMenuRow - width: Math.round(0.85 * previewMenu.width) + id: viewsSelector height: parent.height - spacing: 0 + width: UM.Theme.getSize("views_selector").width + headerCornerSide: Cura.RoundedRectangle.Direction.Left + } - Cura.ViewsSelector - { - id: viewsSelector - headerCornerSide: Cura.RoundedRectangle.Direction.Left - Layout.minimumWidth: UM.Theme.getSize("views_selector").width - Layout.maximumWidth: UM.Theme.getSize("views_selector").width - Layout.fillWidth: true - Layout.fillHeight: true - } + // Separator line + Rectangle + { + height: parent.height + // If there is no viewPanel, we only need a single spacer, so hide this one. + visible: viewPanel.source != "" + width: visible ? UM.Theme.getSize("default_lining").width : 0 - // Separator line - Rectangle - { - height: parent.height - // If there is no viewPanel, we only need a single spacer, so hide this one. - visible: viewPanel.source != "" - width: UM.Theme.getSize("default_lining").width + color: UM.Theme.getColor("lining") + } - color: UM.Theme.getColor("lining") - } + // This component will grow freely up to complete the preferredWidth of the row. + Loader + { + id: viewPanel + height: parent.height + width: source != "" ? (stageMenuRow.preferredWidth - viewsSelector.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width) : 0 + source: UM.Controller.activeView != null && UM.Controller.activeView.stageMenuComponent != null ? UM.Controller.activeView.stageMenuComponent : "" + } - Loader - { - id: viewPanel - Layout.fillHeight: true - Layout.fillWidth: true - Layout.preferredWidth: stageMenuRow.width - viewsSelector.width - printSetupSelectorItem.width - 2 * UM.Theme.getSize("default_lining").width - source: UM.Controller.activeView != null && UM.Controller.activeView.stageMenuComponent != null ? UM.Controller.activeView.stageMenuComponent : "" - } + // Separator line + Rectangle + { + height: parent.height + width: UM.Theme.getSize("default_lining").width + color: UM.Theme.getColor("lining") + } - // Separator line - Rectangle - { - height: parent.height - width: UM.Theme.getSize("default_lining").width - color: UM.Theme.getColor("lining") - } - - Item - { - id: printSetupSelectorItem - // This is a work around to prevent the printSetupSelector from having to be re-loaded every time - // a stage switch is done. - children: [printSetupSelector] - height: childrenRect.height - width: childrenRect.width - } + Item + { + id: printSetupSelectorItem + // This is a work around to prevent the printSetupSelector from having to be re-loaded every time + // a stage switch is done. + children: [printSetupSelector] + height: childrenRect.height + width: childrenRect.width } } } From 8091b2810c2feb04af81c8deef362688ed26eea4 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Dec 2018 14:36:58 +0100 Subject: [PATCH 140/199] Apply suggestions from code review Change some margins for the corresponding absolute values instead of adding formulas. Contributes to CURA-5876. Co-Authored-By: diegopradogesto --- .../ConfigurationMenu/ConfigurationItem.qml | 16 ++++++++-------- .../ConfigurationMenu/ConfigurationListView.qml | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml index a73cd3b46c..862e1475a9 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationItem.qml @@ -36,9 +36,9 @@ Button anchors { left: parent.left - leftMargin: 2 * parent.padding + leftMargin: UM.Theme.getSize("wide_margin").width right: parent.right - rightMargin: 2 * parent.padding + rightMargin: UM.Theme.getSize("wide_margin").width } spacing: UM.Theme.getSize("default_margin").width @@ -64,9 +64,9 @@ Button anchors { left: parent.left - leftMargin: 2 * parent.padding + leftMargin: UM.Theme.getSize("wide_margin").width right: parent.right - rightMargin: 2 * parent.padding + rightMargin: UM.Theme.getSize("wide_margin").width } height: visible ? Math.round(UM.Theme.getSize("default_lining").height / 2) : 0 color: UM.Theme.getColor("lining") @@ -79,9 +79,9 @@ Button anchors { left: parent.left - leftMargin: 2 * parent.padding + leftMargin: UM.Theme.getSize("wide_margin").width right: parent.right - rightMargin: 2 * parent.padding + rightMargin: UM.Theme.getSize("wide_margin").width } height: childrenRect.height visible: configuration.buildplateConfiguration != "" @@ -101,7 +101,7 @@ Button id: buildplateLabel anchors.left: buildplateIcon.right anchors.verticalCenter: buildplateIcon.verticalCenter - anchors.leftMargin: Math.round(UM.Theme.getSize("default_margin").height / 2) + anchors.leftMargin: UM.Theme.getSize("narrow_margin").height text: configuration.buildplateConfiguration renderType: Text.NativeRendering color: UM.Theme.getColor("text") @@ -127,4 +127,4 @@ Button { Cura.MachineManager.applyRemoteConfiguration(configuration) } -} \ No newline at end of file +} diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml index 3ddbb49fe8..684e575bfd 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationListView.qml @@ -28,7 +28,7 @@ Item { width: parent.width visible: configurationList.model.length == 0 - height: label.height + 2 * UM.Theme.getSize("default_margin").height + height: label.height + UM.Theme.getSize("wide_margin").height anchors.top: parent.top anchors.topMargin: UM.Theme.getSize("default_margin").height @@ -134,4 +134,4 @@ Item forceModelUpdate() } } -} \ No newline at end of file +} From b48eedfb805fd8ed6aa3accb4658622dcd57ef43 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 13 Dec 2018 15:15:22 +0100 Subject: [PATCH 141/199] Modify color for the progress bar in the messages. --- resources/themes/cura-light/theme.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 1a7d377fa7..6d76004739 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -255,8 +255,8 @@ "message_button_text": [255, 255, 255, 255], "message_button_text_hover": [255, 255, 255, 255], "message_button_text_active": [255, 255, 255, 255], - "message_progressbar_background": [200, 200, 200, 255], - "message_progressbar_control": [77, 182, 226, 255], + "message_progressbar_background": [245, 245, 245, 255], + "message_progressbar_control": [50, 130, 255, 255], "tool_panel_background": [255, 255, 255, 255], From 3225512851f61f0ac9f18ae6322f8eeb2c3bfd79 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 13 Dec 2018 15:48:03 +0100 Subject: [PATCH 142/199] Fix typing CURA-6013 --- plugins/Toolbox/src/Toolbox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index 715c105bad..05669e55d8 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -49,7 +49,7 @@ class Toolbox(QObject, Extension): self._download_progress = 0 # type: float self._is_downloading = False # type: bool self._network_manager = None # type: Optional[QNetworkAccessManager] - self._request_headers = [] # type: List[Tuple(bytes, bytes)] + self._request_headers = [] # type: List[Tuple[bytes, bytes]] self._updateRequestHeader() From 1b3cb323344cd6c75ec160ca936a1aff379ad64f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Dec 2018 15:59:15 +0100 Subject: [PATCH 143/199] Fix the simulation view not being selected as default CURA-6028 --- resources/qml/ViewsSelector.qml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index 0e2598a0d8..d91412cad0 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -14,24 +14,31 @@ Cura.ExpandablePopup contentPadding: UM.Theme.getSize("default_lining").width contentAlignment: Cura.ExpandablePopup.ContentAlignment.AlignLeft - property var viewModel: UM.ViewModel { } - - property var activeView: + property var viewModel: UM.ViewModel { - for (var i = 0; i < viewModel.count; i++) + onDataChanged: updateActiveView() + } + + + property var activeView: null + + function updateActiveView() + { + for (var index in viewModel.items) { - if (viewModel.items[i].active) + + if (viewModel.items[index].active) { - return viewModel.items[i] + activeView = viewModel.items[index] + return } } - return null + activeView = null } Component.onCompleted: { - // Nothing was active, so just return the first one (the list is sorted by priority, so the most - // important one should be returned) + updateActiveView() if (activeView == null) { UM.Controller.setActiveView(viewModel.getItem(0).id) From d48e89e22432ae9146c404a745d785af9491da37 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Dec 2018 16:32:48 +0100 Subject: [PATCH 144/199] Prevent the parent of printSetupSelector from being set to null If it's parent gets set to null it will break the focus, which we need for the binding updates. CURA-5941 --- resources/qml/Cura.qml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index a4faa27b67..cf6f36a492 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -278,6 +278,14 @@ UM.MainWindow height: UM.Theme.getSize("stage_menu").height source: UM.Controller.activeStage != null ? UM.Controller.activeStage.stageMenuComponent : "" + + // HACK: This is to ensure that the parent never gets set to null, as this wreaks havoc on the focus. + function onParentDestroyed() + { + printSetupSelector.parent = stageMenu + printSetupSelector.visible = false + } + // The printSetupSelector is defined here so that the setting list doesn't need to get re-instantiated // Every time the stage is changed. property var printSetupSelector: Cura.PrintSetupSelector @@ -285,6 +293,11 @@ UM.MainWindow width: UM.Theme.getSize("print_setup_widget").width height: UM.Theme.getSize("stage_menu").height headerCornerSide: RoundedRectangle.Direction.Right + onParentChanged: + { + visible = parent != stageMenu + parent.Component.destruction.connect(stageMenu.onParentDestroyed) + } } } From 3f3cd5e33443ebe1f01671f5c08e3397c85fd962 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 13 Dec 2018 16:32:27 +0100 Subject: [PATCH 145/199] Remove broken load of PrepareSidebar.qml This file no longer exists. Loading it gives a warning. --- cura/Stages/CuraStage.py | 4 ---- plugins/PrepareStage/PrepareStage.py | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/cura/Stages/CuraStage.py b/cura/Stages/CuraStage.py index e8537fb6b9..844b0d0768 100644 --- a/cura/Stages/CuraStage.py +++ b/cura/Stages/CuraStage.py @@ -24,10 +24,6 @@ class CuraStage(Stage): def mainComponent(self) -> QUrl: return self.getDisplayComponent("main") - @pyqtProperty(QUrl, constant = True) - def sidebarComponent(self) -> QUrl: - return self.getDisplayComponent("sidebar") - @pyqtProperty(QUrl, constant = True) def stageMenuComponent(self) -> QUrl: return self.getDisplayComponent("menu") \ No newline at end of file diff --git a/plugins/PrepareStage/PrepareStage.py b/plugins/PrepareStage/PrepareStage.py index b22f3385b8..b0f862dc48 100644 --- a/plugins/PrepareStage/PrepareStage.py +++ b/plugins/PrepareStage/PrepareStage.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Ultimaker B.V. +# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import os.path from UM.Application import Application @@ -15,9 +15,5 @@ class PrepareStage(CuraStage): Application.getInstance().engineCreatedSignal.connect(self._engineCreated) def _engineCreated(self): - sidebar_component_path = os.path.join(Resources.getPath(Application.getInstance().ResourceTypes.QmlFiles), - "PrepareSidebar.qml") - menu_component_path = os.path.join(PluginRegistry.getInstance().getPluginPath("PrepareStage"), "PrepareMenu.qml") self.addDisplayComponent("menu", menu_component_path) - self.addDisplayComponent("sidebar", sidebar_component_path) From 012ee0c02a66ef4e1bbbc5dde6aee8d8fec9988a Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 13 Dec 2018 16:44:49 +0100 Subject: [PATCH 146/199] Use the MouseArea trick to assure that the binding still works for the checked property of the button. Contributes to CURA-6028. --- resources/qml/MainWindow/MainWindowHeader.qml | 8 +++++++- resources/qml/ViewsSelector.qml | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 6cb7370ec2..793df42da0 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -60,11 +60,17 @@ Item exclusiveGroup: mainWindowHeaderMenuGroup style: UM.Theme.styles.main_window_header_tab height: UM.Theme.getSize("main_window_header_button").height - onClicked: UM.Controller.setActiveStage(model.id) iconSource: model.stage.iconSource property color overlayColor: "transparent" property string overlayIconSource: "" + + // This is a trick to assure the activeStage is correctly changed. It doesn't work propertly if done in the onClicked (see CURA-6028) + MouseArea + { + anchors.fill: parent + onClicked: UM.Controller.setActiveStage(model.id) + } } } diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index d91412cad0..06d2e662b5 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -19,14 +19,12 @@ Cura.ExpandablePopup onDataChanged: updateActiveView() } - property var activeView: null function updateActiveView() { for (var index in viewModel.items) { - if (viewModel.items[index].active) { activeView = viewModel.items[index] @@ -38,7 +36,6 @@ Cura.ExpandablePopup Component.onCompleted: { - updateActiveView() if (activeView == null) { UM.Controller.setActiveView(viewModel.getItem(0).id) From 3d4da94b36593505a4e86f41e46999f9660337f1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 13 Dec 2018 16:49:27 +0100 Subject: [PATCH 147/199] Remove obsolete description detail about old Cura versions This setting had a detail in the description about how the setting used to behave in old Cura versions. Let's remove it since it is not relevant any more. Fixes #4536. --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index c015ab8ccb..f39e267354 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -3385,7 +3385,7 @@ "retraction_combing": { "label": "Combing Mode", - "description": "Combing keeps the nozzle within already printed areas when traveling. This results in slightly longer travel moves but reduces the need for retractions. If combing is off, the material will retract and the nozzle moves in a straight line to the next point. It is also possible to avoid combing over top/bottom skin areas and also to only comb within the infill. Note that the 'Within Infill' option behaves exactly like the 'Not in Skin' option in earlier Cura releases.", + "description": "Combing keeps the nozzle within already printed areas when traveling. This results in slightly longer travel moves but reduces the need for retractions. If combing is off, the material will retract and the nozzle moves in a straight line to the next point. It is also possible to avoid combing over top/bottom skin areas or to only comb within the infill.", "type": "enum", "options": { From 473160a102c902bd4161d3b7d4027414a71c144a Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 13 Dec 2018 17:02:13 +0100 Subject: [PATCH 148/199] Add a check for null to avoid warnings in the logs. --- resources/qml/MainWindow/MainWindowHeader.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 793df42da0..8f6957d9cd 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -54,7 +54,7 @@ Item { text: model.name.toUpperCase() checkable: true - checked: model.id == UM.Controller.activeStage.stageId + checked: UM.Controller.activeStage != null ? model.id == UM.Controller.activeStage.stageId : false anchors.verticalCenter: parent.verticalCenter exclusiveGroup: mainWindowHeaderMenuGroup From 856c1dcb20d42a624bfc367ca135042d7404953f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 13 Dec 2018 17:21:07 +0100 Subject: [PATCH 149/199] Also disconnect the signal for the old parent of printSetupSelector --- resources/qml/Cura.qml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index cf6f36a492..ff5a603fda 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -278,29 +278,33 @@ UM.MainWindow height: UM.Theme.getSize("stage_menu").height source: UM.Controller.activeStage != null ? UM.Controller.activeStage.stageMenuComponent : "" - // HACK: This is to ensure that the parent never gets set to null, as this wreaks havoc on the focus. function onParentDestroyed() { printSetupSelector.parent = stageMenu printSetupSelector.visible = false } + property item oldParent: null // The printSetupSelector is defined here so that the setting list doesn't need to get re-instantiated // Every time the stage is changed. property var printSetupSelector: Cura.PrintSetupSelector { - width: UM.Theme.getSize("print_setup_widget").width - height: UM.Theme.getSize("stage_menu").height - headerCornerSide: RoundedRectangle.Direction.Right - onParentChanged: - { - visible = parent != stageMenu - parent.Component.destruction.connect(stageMenu.onParentDestroyed) - } + width: UM.Theme.getSize("print_setup_widget").width + height: UM.Theme.getSize("stage_menu").height + headerCornerSide: RoundedRectangle.Direction.Right + onParentChanged: + { + if(stageMenu.oldParent !=null) + { + stageMenu.oldParent.Component.destruction.disconnect(stageMenu.onParentDestroyed) + } + stageMenu.oldParent = parent + visible = parent != stageMenu + parent.Component.destruction.connect(stageMenu.onParentDestroyed) + } } } - UM.MessageStack { anchors From 8dc2a41fb7af876a2f4c041fd68482f131b4385c Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Thu, 13 Dec 2018 17:27:16 +0100 Subject: [PATCH 150/199] Typo, wrong item type, "item" CURA-5941 --- resources/qml/Cura.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index ff5a603fda..2b6f989e0b 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -284,7 +284,7 @@ UM.MainWindow printSetupSelector.parent = stageMenu printSetupSelector.visible = false } - property item oldParent: null + property Item oldParent: null // The printSetupSelector is defined here so that the setting list doesn't need to get re-instantiated // Every time the stage is changed. From bb1bf14a0182710ebb5c08fcbc8248e8d67c711e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 10:46:31 +0100 Subject: [PATCH 151/199] Prevent rating when user is not logged in CURA-6013 --- plugins/Toolbox/resources/qml/RatingWidget.qml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/RatingWidget.qml b/plugins/Toolbox/resources/qml/RatingWidget.qml index 9d9eb8bca8..2623d13c0e 100644 --- a/plugins/Toolbox/resources/qml/RatingWidget.qml +++ b/plugins/Toolbox/resources/qml/RatingWidget.qml @@ -25,7 +25,10 @@ Item acceptedButtons: Qt.NoButton onExited: { - ratingWidget.indexHovered = -1 + if(ratingWidget.canRate) + { + ratingWidget.indexHovered = -1 + } } Row @@ -87,7 +90,13 @@ Item return "#5a5a5a" } } - onClicked: rated(index + 1) // Notify anyone who cares about this. + onClicked: + { + if(ratingWidget.canRate) + { + rated(index + 1) // Notify anyone who cares about this. + } + } } } } From 450f301c8c1211684db866eee9e1d8573a4d8665 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 10:56:13 +0100 Subject: [PATCH 152/199] Fix binding loop CURA-6013 --- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 0e183c2860..95c3a20e1e 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -57,7 +57,6 @@ Item top: thumbnail.top left: thumbnail.right leftMargin: UM.Theme.getSize("default_margin").width - bottomMargin: UM.Theme.getSize("default_margin").height } text: details === null ? "" : (details.name || "") font: UM.Theme.getFont("large") @@ -226,13 +225,6 @@ Item renderType: Text.NativeRendering } } - Rectangle - { - color: UM.Theme.getColor("lining") - width: parent.width - height: UM.Theme.getSize("default_lining").height - anchors.bottom: parent.bottom - } } ToolboxDetailList { From 7616f9c97db92a7b213bd45232bb419e51581436 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 10:59:59 +0100 Subject: [PATCH 153/199] Make hardcoded color themeable CURA-6013 --- plugins/Toolbox/resources/qml/RatingWidget.qml | 4 ++-- plugins/Toolbox/resources/qml/SmallRatingWidget.qml | 2 +- resources/themes/cura-light/theme.json | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/RatingWidget.qml b/plugins/Toolbox/resources/qml/RatingWidget.qml index 2623d13c0e..3dcae6d602 100644 --- a/plugins/Toolbox/resources/qml/RatingWidget.qml +++ b/plugins/Toolbox/resources/qml/RatingWidget.qml @@ -81,13 +81,13 @@ Item { if(!ratingWidget.canRate) { - return "#5a5a5a" + return UM.Theme.getColor("rating_star") } if((ratingWidget.indexHovered >= 0 || ratingWidget.userRating > 0) && isStarFilled) { return UM.Theme.getColor("primary") } - return "#5a5a5a" + return UM.Theme.getColor("rating_star") } } onClicked: diff --git a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml index 439a7baec0..bab219d294 100644 --- a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml +++ b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml @@ -14,7 +14,7 @@ Row { id: starIcon source: UM.Theme.getIcon("star_filled") - color: model.user_rating == 0 ? "#5a5a5a" : UM.Theme.getColor("primary") + color: model.user_rating == 0 ? UM.Theme.getColor("rating_star") : UM.Theme.getColor("primary") height: UM.Theme.getSize("rating_star").height width: UM.Theme.getSize("rating_star").width } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 969f5666a6..16f885c0b5 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -160,6 +160,8 @@ "extruder_button_material_border": [255, 255, 255, 255], + "rating_star": [90, 90, 90, 255], + "sync_button_text": [120, 120, 120, 255], "sync_button_text_hovered": [0, 0, 0, 255], From edd4f6e1faa7062299d832ceac2e412a3aec23b6 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 11:02:10 +0100 Subject: [PATCH 154/199] Fix some minor QML warnings CURA-6013 --- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 95c3a20e1e..92b9fb1198 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -138,8 +138,8 @@ Item { id: rating visible: details.type == "plugin" - packageId: details.id - userRating: details.user_rating + packageId: details.id != undefined ? details.id: "" + userRating: details.user_rating != undefined ? details.user_rating: 0 canRate: toolbox.isInstalled(details.id) && Cura.API.account.isLoggedIn onRated: From 5e4e52e6fc8fc912e9c43492f418cb77a6c12655 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 11:09:48 +0100 Subject: [PATCH 155/199] Fix blue square being shown in selector if no icon is set CURA-5876 --- resources/qml/PrinterSelector/MachineSelector.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index db9c38b9f1..fb8f0a58e1 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -41,7 +41,7 @@ Cura.ExpandablePopup } font: UM.Theme.getFont("medium") iconColor: UM.Theme.getColor("machine_selector_printer_icon") - iconSize: UM.Theme.getSize("machine_selector_icon").width + iconSize: source != "" ? UM.Theme.getSize("machine_selector_icon").width: 0 UM.RecolorImage { From 15cd2a926975403ad0e225ffa0b2e63beadcab1b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 11:36:40 +0100 Subject: [PATCH 156/199] Changed textColor of recommended infill slider text to be themed. This is required to make the dark theme work correctly --- .../Recommended/RecommendedInfillDensitySelector.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml index 2971415948..0da53cc1c1 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedInfillDensitySelector.qml @@ -144,6 +144,7 @@ Item anchors.horizontalCenter: parent.horizontalCenter y: UM.Theme.getSize("thin_margin").height renderType: Text.NativeRendering + color: UM.Theme.getColor("quality_slider_available") } } } From 6a3ac9955162885c81859354d366d82cad40e42f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 11:59:22 +0100 Subject: [PATCH 157/199] Ensure that all icons use the same color from theme. Also added some fixes for the dark theme --- plugins/PrepareStage/PrepareMenu.qml | 2 +- resources/qml/ActionPanel/PrintInformationWidget.qml | 2 +- resources/qml/IconWithText.qml | 4 ++-- resources/qml/Toolbar.qml | 2 +- resources/themes/cura-dark/theme.json | 6 ++++++ resources/themes/cura-light/theme.json | 2 ++ 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index b7980bc30b..b62d65254d 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -100,7 +100,7 @@ Item source: UM.Theme.getIcon("load") width: UM.Theme.getSize("button_icon").width height: UM.Theme.getSize("button_icon").height - color: UM.Theme.getColor("toolbar_button_text") + color: UM.Theme.getColor("icon") sourceSize.height: height } diff --git a/resources/qml/ActionPanel/PrintInformationWidget.qml b/resources/qml/ActionPanel/PrintInformationWidget.qml index 554273a818..0826e2c715 100644 --- a/resources/qml/ActionPanel/PrintInformationWidget.qml +++ b/resources/qml/ActionPanel/PrintInformationWidget.qml @@ -15,7 +15,7 @@ UM.RecolorImage width: UM.Theme.getSize("section_icon").width height: UM.Theme.getSize("section_icon").height - color: popup.opened ? UM.Theme.getColor("primary") : UM.Theme.getColor("text_medium") + color: UM.Theme.getColor("icon") MouseArea { diff --git a/resources/qml/IconWithText.qml b/resources/qml/IconWithText.qml index 5530740040..f9220380f2 100644 --- a/resources/qml/IconWithText.qml +++ b/resources/qml/IconWithText.qml @@ -18,7 +18,7 @@ Item property alias color: label.color property alias text: label.text property alias font: label.font - + property alias iconColor: icon.color property real margin: UM.Theme.getSize("narrow_margin").width // These properties can be used in combination with layouts. @@ -39,7 +39,7 @@ Item width: UM.Theme.getSize("section_icon").width height: UM.Theme.getSize("section_icon").height - color: label.color + color: UM.Theme.getColor("icon") anchors { diff --git a/resources/qml/Toolbar.qml b/resources/qml/Toolbar.qml index 1e335472d4..c3c4c1cd6d 100644 --- a/resources/qml/Toolbar.qml +++ b/resources/qml/Toolbar.qml @@ -67,7 +67,7 @@ Item toolItem: UM.RecolorImage { source: UM.Theme.getIcon(model.icon) != "" ? UM.Theme.getIcon(model.icon) : "file:///" + model.location + "/" + model.icon - color: UM.Theme.getColor("toolbar_button_text") + color: UM.Theme.getColor("icon") sourceSize: UM.Theme.getSize("button_icon") } diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 8540abf61a..2fa96c8897 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -17,6 +17,12 @@ "border": [127, 127, 127, 255], "secondary": [95, 95, 95, 255], + "icon": [204, 204, 204, 255], + "toolbar_background": [39, 44, 48, 255], + "toolbar_button_active": [95, 95, 95, 255], + "toolbar_button_hover": [95, 95, 95, 255], + "toolbar_button_active_hover": [95, 95, 95, 255], + "main_window_header_button_text_inactive": [128, 128, 128, 255], "main_window_header_button_text_hovered": [255, 255, 255, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 6d76004739..b64190dd23 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -83,6 +83,8 @@ "secondary": [240, 240, 240, 255], "secondary_shadow": [216, 216, 216, 255], + "icon": [8, 7, 63, 255], + "primary_button": [38, 113, 231, 255], "primary_button_shadow": [27, 95, 202, 255], "primary_button_hover": [81, 145, 247, 255], From c3aca8907cdfe83439b863912dcf3291142980dc Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 12:02:52 +0100 Subject: [PATCH 158/199] Fix extruder number not being visible in dark theme --- resources/qml/ExtruderIcon.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index bb0b347b7e..c44b6e0fa3 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -49,6 +49,7 @@ Item anchors.centerIn: parent text: index + 1 font: UM.Theme.getFont("very_small") + color: UM.Theme.getColor("text") width: contentWidth height: contentHeight visible: extruderEnabled From a02bccf74d587793796c1737de455e74856cdff8 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 14 Dec 2018 13:00:03 +0100 Subject: [PATCH 159/199] Fix NozzleModel to work with new ListModel data update CURA-6015 ListModels should not modify items directly. All ListModels should use setItems() and the insertions/removals/modifications will be done in setItems() itself. --- cura/Machines/Models/NozzleModel.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/cura/Machines/Models/NozzleModel.py b/cura/Machines/Models/NozzleModel.py index 9d97106d6b..785ff5b9b9 100644 --- a/cura/Machines/Models/NozzleModel.py +++ b/cura/Machines/Models/NozzleModel.py @@ -33,8 +33,6 @@ class NozzleModel(ListModel): def _update(self): Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__)) - self.items.clear() - global_stack = self._machine_manager.activeMachine if global_stack is None: self.setItems([]) From 8a4a1c9d49ab684a8bfdadfd87166fb494463277 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 14 Dec 2018 13:18:00 +0100 Subject: [PATCH 160/199] Don't let print info take space if invisible This way there is a little bit more space for the text 'No time estimation available', which was previously abbreviated to 'No time estimation availa...'. --- resources/qml/ActionPanel/OutputProcessWidget.qml | 2 +- resources/qml/ActionPanel/PrintInformationWidget.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index 3f53abf28f..ad5a708898 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -41,7 +41,7 @@ Column { left: parent.left right: printInformationPanel.left - rightMargin: UM.Theme.getSize("thin_margin").height + rightMargin: printInformationPanel.visible ? UM.Theme.getSize("thin_margin").width : 0 } Cura.IconWithText diff --git a/resources/qml/ActionPanel/PrintInformationWidget.qml b/resources/qml/ActionPanel/PrintInformationWidget.qml index 0826e2c715..2e108b05d7 100644 --- a/resources/qml/ActionPanel/PrintInformationWidget.qml +++ b/resources/qml/ActionPanel/PrintInformationWidget.qml @@ -12,7 +12,7 @@ UM.RecolorImage id: widget source: UM.Theme.getIcon("info") - width: UM.Theme.getSize("section_icon").width + width: visible ? UM.Theme.getSize("section_icon").width : 0 height: UM.Theme.getSize("section_icon").height color: UM.Theme.getColor("icon") From a010823a4e39902d0bfadb807edeb180e649b108 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 14 Dec 2018 13:20:43 +0100 Subject: [PATCH 161/199] Fix warning when active stage is not yet instantiated Edit: Originally this was more or less the same fix as what Diego just did at the same time, which caused a merge conflict, but I think my solution is more elegant than the ternary operator that was originally there so I'm keeping mine. --- resources/qml/MainWindow/MainWindowHeader.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 8f6957d9cd..eecf2a1e73 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -54,7 +54,7 @@ Item { text: model.name.toUpperCase() checkable: true - checked: UM.Controller.activeStage != null ? model.id == UM.Controller.activeStage.stageId : false + checked: UM.Controller.activeStage !== null && model.id == UM.Controller.activeStage.stageId anchors.verticalCenter: parent.verticalCenter exclusiveGroup: mainWindowHeaderMenuGroup From d379f9477508ad1c248ba308d551e5f3bb97909b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 13:23:28 +0100 Subject: [PATCH 162/199] Make the dark theme a bit more readable --- resources/qml/ExtruderIcon.qml | 2 +- .../qml/PrintSetupSelector/Custom/CustomPrintSetup.qml | 2 ++ resources/themes/cura-dark/theme.json | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/qml/ExtruderIcon.qml b/resources/qml/ExtruderIcon.qml index c44b6e0fa3..fcc49c9040 100644 --- a/resources/qml/ExtruderIcon.qml +++ b/resources/qml/ExtruderIcon.qml @@ -49,7 +49,7 @@ Item anchors.centerIn: parent text: index + 1 font: UM.Theme.getFont("very_small") - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("text") width: contentWidth height: contentHeight visible: extruderEnabled diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml index b28c9ceb46..26ca4deec6 100644 --- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml @@ -113,9 +113,11 @@ Item } z: tabBar.z - 1 // Don't show the border when only one extruder + border.color: tabBar.visible ? UM.Theme.getColor("lining") : "transparent" border.width: UM.Theme.getSize("default_lining").width + color: UM.Theme.getColor("main_background") Cura.SettingView { anchors diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 2fa96c8897..cade342488 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -99,11 +99,11 @@ "scrollbar_handle_hover": [255, 255, 255, 255], "scrollbar_handle_down": [255, 255, 255, 255], - "setting_category": [39, 44, 48, 255], - "setting_category_disabled": [39, 44, 48, 255], - "setting_category_hover": [39, 44, 48, 255], - "setting_category_active": [39, 44, 48, 255], - "setting_category_active_hover": [39, 44, 48, 255], + "setting_category": [75, 80, 83, 255], + "setting_category_disabled": [75, 80, 83, 255], + "setting_category_hover": [75, 80, 83, 255], + "setting_category_active": [75, 80, 83, 255], + "setting_category_active_hover": [75, 80, 83, 255], "setting_category_text": [255, 255, 255, 152], "setting_category_disabled_text": [255, 255, 255, 101], "setting_category_hover_text": [255, 255, 255, 204], From 475b008310376d0e26fe7649aef870baa0a366e1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 14 Dec 2018 13:27:26 +0100 Subject: [PATCH 163/199] Reduce minimum window size slightly This way it just fits on the screen of a 13 inch MacBook Air. --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index b64190dd23..965fe63179 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -349,7 +349,7 @@ }, "sizes": { - "window_minimum_size": [106, 66], + "window_minimum_size": [100, 60], "main_window_header": [0.0, 4.0], "main_window_header_button": [8, 2.35], From 7fc5742b7f328b0a46b1708526eaf8bf3f5aba33 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 15:01:40 +0100 Subject: [PATCH 164/199] Add monitor carousel Contributes to CL-1151 --- .../resources/qml/MonitorCarousel.qml | 231 ++++++++++++++++++ .../resources/qml/MonitorPrinterCard.qml | 2 +- .../resources/qml/MonitorStage.qml | 21 +- 3 files changed, 235 insertions(+), 19 deletions(-) create mode 100644 plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml new file mode 100644 index 0000000000..7d56b2f294 --- /dev/null +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml @@ -0,0 +1,231 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.3 +import QtQuick.Controls 2.0 +import QtGraphicalEffects 1.0 +import UM 1.3 as UM + +Item +{ + id: base + + property var currentIndex: 0 + property var tileWidth: 834 * screenScaleFactor // TODO: Theme! + property var tileHeight: 216 * screenScaleFactor // TODO: Theme! + property var tileSpacing: 60 * screenScaleFactor // TODO: Theme! + property var maxOffset: (OutputDevice.printers.length - 1) * (tileWidth + tileSpacing) + + height: centerSection.height + width: maximumWidth + + Item + { + id: leftHint + anchors + { + right: leftButton.left + rightMargin: 12 * screenScaleFactor + left: parent.left + } + height: parent.height + z: 10 + LinearGradient + { + anchors.fill: parent + start: Qt.point(0, 0) + end: Qt.point(leftHint.width, 0) + gradient: Gradient + { + GradientStop + { + position: 0.0 + color: "#fff6f6f6" + } + GradientStop + { + position: 1.0 + color: "#00f6f6f6" + } + } + } + } + + Button + { + id: leftButton + anchors + { + verticalCenter: parent.verticalCenter + right: centerSection.left + rightMargin: 12 * screenScaleFactor + } + width: 36 * screenScaleFactor // TODO: Theme! + height: 72 * screenScaleFactor // TODO: Theme! + visible: currentIndex > 0 + z: 10 + onClicked: navigateTo(currentIndex - 1) + background: Rectangle + { + color: "#ffffff" // TODO: Theme! + border.width: 1 * screenScaleFactor // TODO: Theme! + border.color: "#cccccc" // TODO: Theme! + radius: 2 * screenScaleFactor // TODO: Theme! + } + contentItem: Item + { + anchors.fill: parent + UM.RecolorImage + { + anchors.centerIn: parent + width: 18 + height: 18 + sourceSize.width: 18 + sourceSize.height: 18 + color: "#666666" // TODO: Theme! + source: UM.Theme.getIcon("arrow_left") + } + } + } + + Item + { + id: centerSection + anchors + { + verticalCenter: parent.verticalCenter + horizontalCenter: parent.horizontalCenter + } + width: tileWidth + height: tiles.height + z: 1 + + Row + { + id: tiles + height: childrenRect.height + width: 5 * tileWidth + 4 * tileSpacing + x: 0 + z: 0 + Behavior on x { NumberAnimation { duration: 100 } } + spacing: 60 * screenScaleFactor // TODO: Theme! + + Repeater + { + model: OutputDevice.printers + MonitorPrinterCard + { + printer: modelData + } + } + } + } + + Button + { + id: rightButton + anchors + { + verticalCenter: parent.verticalCenter + left: centerSection.right + leftMargin: 12 * screenScaleFactor + } + width: 36 * screenScaleFactor // TODO: Theme! + height: 72 * screenScaleFactor // TODO: Theme! + z: 10 + visible: currentIndex < OutputDevice.printers.length - 1 + onClicked: navigateTo(currentIndex + 1) + background: Rectangle + { + color: "#ffffff" // TODO: Theme! + border.width: 1 * screenScaleFactor // TODO: Theme! + border.color: "#cccccc" // TODO: Theme! + radius: 2 * screenScaleFactor // TODO: Theme! + } + contentItem: Item + { + anchors.fill: parent + UM.RecolorImage + { + anchors.centerIn: parent + width: 18 + height: 18 + sourceSize.width: 18 + sourceSize.height: 18 + color: "#666666" // TODO: Theme! + source: UM.Theme.getIcon("arrow_right") + } + } + } + + Item + { + id: rightHint + anchors + { + left: rightButton.right + leftMargin: 12 * screenScaleFactor + right: parent.right + } + height: centerSection.height + z: 10 + + LinearGradient + { + anchors.fill: parent + start: Qt.point(0, 0) + end: Qt.point(rightHint.width, 0) + gradient: Gradient + { + GradientStop + { + position: 0.0 + color: "#00f6f6f6" + } + GradientStop + { + position: 1.0 + color: "#fff6f6f6" + } + } + } + } + + Item + { + id: navigationDots + anchors + { + horizontalCenter: centerSection.horizontalCenter + top: centerSection.bottom + topMargin: 36 * screenScaleFactor // TODO: Theme! + } + Row + { + spacing: 8 * screenScaleFactor // TODO: Theme! + Repeater + { + model: OutputDevice.printers + Button + { + background: Rectangle + { + color: model.index == currentIndex ? "#777777" : "#d8d8d8" // TODO: Theme! + radius: Math.floor(width / 2) + width: 12 * screenScaleFactor // TODO: Theme! + height: width + } + onClicked: navigateTo(model.index) + } + } + } + } + + function navigateTo( i ) { + if (i >= 0 && i < OutputDevice.printers.length) + { + tiles.x = -1 * i * (tileWidth + tileSpacing) + currentIndex = i + } + } +} \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index 1676c51edf..cfeb77cc89 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -26,7 +26,7 @@ Item property var borderSize: 1 * screenScaleFactor // TODO: Theme, and remove from here width: 834 * screenScaleFactor // TODO: Theme! - height: 216 * screenScaleFactor // TODO: Theme! + height: childrenRect.height // Printer portion Rectangle diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index 4d59e0eb6b..f77cfee1ef 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -48,32 +48,17 @@ Component } } - ScrollView + Item { id: printers anchors { - left: queue.left - right: queue.right top: parent.top topMargin: 48 * screenScaleFactor // TODO: Theme! } + width: parent.width height: 264 * screenScaleFactor // TODO: Theme! - - Row - { - spacing: 60 * screenScaleFactor // TODO: Theme! - - Repeater - { - model: OutputDevice.printers - - MonitorPrinterCard - { - printer: modelData - } - } - } + MonitorCarousel {} } Item From 3a74511d231d573e7ed910fb8d51080265740ac4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 14 Dec 2018 15:01:56 +0100 Subject: [PATCH 165/199] Remove padding from views selector This padding made it break the height of the item for some reason. I guess that is a Qt bug. In any case, the padding shouldn't be there either since the lining is on the inside of the child buttons so the padding only causes a gap to appear on the left and right sides, which looks weird. Contributes to issue CURA-6029. --- resources/qml/ViewsSelector.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index 06d2e662b5..acde7d1f71 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -78,8 +78,6 @@ Cura.ExpandablePopup { id: viewSelectorPopup width: viewSelector.width - 2 * viewSelector.contentPadding - leftPadding: UM.Theme.getSize("default_lining").width - rightPadding: UM.Theme.getSize("default_lining").width // For some reason the height/width of the column gets set to 0 if this is not set... Component.onCompleted: From 5d0da580b9a65c76b9bf21c4d7bcf4470133c1dd Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 15:04:22 +0100 Subject: [PATCH 166/199] Fix border colors --- plugins/UM3NetworkPrinting/resources/qml/ExpandableCard.qml | 2 +- .../UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml | 2 +- .../UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/ExpandableCard.qml b/plugins/UM3NetworkPrinting/resources/qml/ExpandableCard.qml index 0877a15f00..7778c4e1a2 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/ExpandableCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/ExpandableCard.qml @@ -16,7 +16,7 @@ Item property bool expanded: false property var borderWidth: 1 - property color borderColor: "#EAEAEC" + property color borderColor: "#CCCCCC" property color headerBackgroundColor: "white" property color headerHoverColor: "#f5f5f5" property color drawerBackgroundColor: "white" diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml index d8c5d1ec28..f431ef1c52 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrintJobCard.qml @@ -26,7 +26,7 @@ Item ExpandableCard { - borderColor: printJob.configurationChanges.length !== 0 ? "#f5a623" : "#EAEAEC" // TODO: Theme! + borderColor: printJob.configurationChanges.length !== 0 ? "#f5a623" : "#CCCCCC" // TODO: Theme! headerItem: Row { height: 48 * screenScaleFactor // TODO: Theme! diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index cfeb77cc89..038f0535f0 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -34,7 +34,7 @@ Item id: printerInfo border { - color: "#EAEAEC" // TODO: Theme! + color: "#CCCCCC" // TODO: Theme! width: borderSize // TODO: Remove once themed } color: "white" // TODO: Theme! @@ -151,7 +151,7 @@ Item } border { - color: printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 ? "#f5a623" : "#EAEAEC" // TODO: Theme! + color: printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 ? "#f5a623" : "#CCCCCC" // TODO: Theme! width: borderSize // TODO: Remove once themed } color: "white" // TODO: Theme! From b2ea597543f58db9e447167f38389e58425237f9 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 15:10:34 +0100 Subject: [PATCH 167/199] Fix button color Contributes to CL-1151 --- plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml index 7d56b2f294..49d35f794f 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml @@ -82,7 +82,7 @@ Item height: 18 sourceSize.width: 18 sourceSize.height: 18 - color: "#666666" // TODO: Theme! + color: "#152950" // TODO: Theme! source: UM.Theme.getIcon("arrow_left") } } @@ -152,7 +152,7 @@ Item height: 18 sourceSize.width: 18 sourceSize.height: 18 - color: "#666666" // TODO: Theme! + color: "#152950" // TODO: Theme! source: UM.Theme.getIcon("arrow_right") } } From ae695b77e6ad8e9ea882c2b20e6ec4922fa6603a Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Fri, 14 Dec 2018 15:23:56 +0100 Subject: [PATCH 168/199] Add native rendering for QML Label CURA-6013 --- plugins/Toolbox/resources/qml/SmallRatingWidget.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml index bab219d294..686058f4e8 100644 --- a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml +++ b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml @@ -29,5 +29,6 @@ Row anchors.verticalCenter: starIcon.verticalCenter color: starIcon.color font: UM.Theme.getFont("small") + renderType: Text.NativeRendering } } \ No newline at end of file From 2f6a274c0e2b78064fb9ae8a3c6f7766f8623e1a Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 15:27:55 +0100 Subject: [PATCH 169/199] Small style improvements Contributes to CL-1151 --- .../resources/qml/ExpandableCard.qml | 2 +- .../resources/qml/MonitorCarousel.qml | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/ExpandableCard.qml b/plugins/UM3NetworkPrinting/resources/qml/ExpandableCard.qml index 7778c4e1a2..f86135ae62 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/ExpandableCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/ExpandableCard.qml @@ -18,7 +18,7 @@ Item property var borderWidth: 1 property color borderColor: "#CCCCCC" property color headerBackgroundColor: "white" - property color headerHoverColor: "#f5f5f5" + property color headerHoverColor: "#e8f2fc" property color drawerBackgroundColor: "white" property alias headerItem: header.children property alias drawerItem: drawer.children diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml index 49d35f794f..cd7c6f177f 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml @@ -63,11 +63,12 @@ Item width: 36 * screenScaleFactor // TODO: Theme! height: 72 * screenScaleFactor // TODO: Theme! visible: currentIndex > 0 + hoverEnabled: true z: 10 onClicked: navigateTo(currentIndex - 1) background: Rectangle { - color: "#ffffff" // TODO: Theme! + color: leftButton.hovered ? "#e8f2fc" : "#ffffff" // TODO: Theme! border.width: 1 * screenScaleFactor // TODO: Theme! border.color: "#cccccc" // TODO: Theme! radius: 2 * screenScaleFactor // TODO: Theme! @@ -79,9 +80,9 @@ Item { anchors.centerIn: parent width: 18 - height: 18 - sourceSize.width: 18 - sourceSize.height: 18 + height: width + sourceSize.width: width + sourceSize.height: width color: "#152950" // TODO: Theme! source: UM.Theme.getIcon("arrow_left") } @@ -135,9 +136,10 @@ Item z: 10 visible: currentIndex < OutputDevice.printers.length - 1 onClicked: navigateTo(currentIndex + 1) + hoverEnabled: true background: Rectangle { - color: "#ffffff" // TODO: Theme! + color: rightButton.hovered ? "#e8f2fc" : "#ffffff" // TODO: Theme! border.width: 1 * screenScaleFactor // TODO: Theme! border.color: "#cccccc" // TODO: Theme! radius: 2 * screenScaleFactor // TODO: Theme! @@ -149,9 +151,9 @@ Item { anchors.centerIn: parent width: 18 - height: 18 - sourceSize.width: 18 - sourceSize.height: 18 + height: width + sourceSize.width: width + sourceSize.height: width color: "#152950" // TODO: Theme! source: UM.Theme.getIcon("arrow_right") } From 3bd5d141ab74b9e41f85510add3168604c13f5a8 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 15:39:17 +0100 Subject: [PATCH 170/199] Add easing and make animation less snappy and awesome Contributes to CL-1151 --- .../UM3NetworkPrinting/resources/qml/MonitorCarousel.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml index cd7c6f177f..988008dc31 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml @@ -108,7 +108,14 @@ Item width: 5 * tileWidth + 4 * tileSpacing x: 0 z: 0 - Behavior on x { NumberAnimation { duration: 100 } } + Behavior on x + { + NumberAnimation + { + duration: 200 + easing.type: Easing.InOutCubic + } + } spacing: 60 * screenScaleFactor // TODO: Theme! Repeater From 30168103b726fb2d49d7d4cc1d563b9a302757a6 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 15:47:36 +0100 Subject: [PATCH 171/199] Update MonitorStage.qml --- plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index f77cfee1ef..22badfc8ac 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -15,9 +15,6 @@ Component { id: monitorFrame - property var emphasisColor: UM.Theme.getColor("setting_control_border_highlight") - property var cornerRadius: UM.Theme.getSize("monitor_corner_radius").width - height: maximumHeight onVisibleChanged: { @@ -39,11 +36,11 @@ Component gradient: Gradient { GradientStop { position: 0.0 - color: "#f6f6f6" + color: "#f6f6f6" // TODO: Theme! } GradientStop { position: 1.0 - color: "#ffffff" + color: "#ffffff" // TODO: Theme! } } } From 3766effa81dc111d70c0d7ff4563936ec92fc5c4 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 16:04:31 +0100 Subject: [PATCH 172/199] Quick fix to prevent monitor stage from overlapping header --- plugins/MonitorStage/MonitorMain.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/MonitorStage/MonitorMain.qml b/plugins/MonitorStage/MonitorMain.qml index 1f287fc0fa..1f52ceea51 100644 --- a/plugins/MonitorStage/MonitorMain.qml +++ b/plugins/MonitorStage/MonitorMain.qml @@ -16,6 +16,7 @@ Item color: UM.Theme.getColor("viewport_overlay") anchors.fill: parent + anchors.topMargin: Math.round(stageMenu.height / 2) MouseArea { anchors.fill: parent @@ -29,8 +30,7 @@ Item id: monitorViewComponent anchors.fill: parent - - height: parent.height + anchors.topMargin: Math.round(stageMenu.height / 2) property real maximumWidth: parent.width property real maximumHeight: parent.height From 2789a0fdc43a2eb4c32f2c434ac23b22a83eef1f Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 16:13:35 +0100 Subject: [PATCH 173/199] Revert "Quick fix to prevent monitor stage from overlapping header" This reverts commit 3766effa81dc111d70c0d7ff4563936ec92fc5c4. --- plugins/MonitorStage/MonitorMain.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/MonitorStage/MonitorMain.qml b/plugins/MonitorStage/MonitorMain.qml index 1f52ceea51..1f287fc0fa 100644 --- a/plugins/MonitorStage/MonitorMain.qml +++ b/plugins/MonitorStage/MonitorMain.qml @@ -16,7 +16,6 @@ Item color: UM.Theme.getColor("viewport_overlay") anchors.fill: parent - anchors.topMargin: Math.round(stageMenu.height / 2) MouseArea { anchors.fill: parent @@ -30,7 +29,8 @@ Item id: monitorViewComponent anchors.fill: parent - anchors.topMargin: Math.round(stageMenu.height / 2) + + height: parent.height property real maximumWidth: parent.width property real maximumHeight: parent.height From ffccbcea2fbe91bef2becc71a90b5d09bf840203 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 16:13:49 +0100 Subject: [PATCH 174/199] Anchor to bottom of header background --- resources/qml/Cura.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 2b6f989e0b..573d75e5fa 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -252,7 +252,7 @@ UM.MainWindow anchors { // Align to the top of the stageMenu since the stageMenu may not exist - top: parent.top + top: headerBackground.top left: parent.left right: parent.right bottom: parent.bottom From 9146a775a4c3ae4b83cd7f62d2bf0d945e9caab1 Mon Sep 17 00:00:00 2001 From: Aleksei S Date: Fri, 14 Dec 2018 16:17:05 +0100 Subject: [PATCH 175/199] After resetting the custom settings the quality slider did not update selected value CURA-6028 --- cura/Settings/SimpleModeSettingsManager.py | 11 ++++++----- .../RecommendedQualityProfileSelector.qml | 12 +++++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/cura/Settings/SimpleModeSettingsManager.py b/cura/Settings/SimpleModeSettingsManager.py index fce43243bd..210a5794d4 100644 --- a/cura/Settings/SimpleModeSettingsManager.py +++ b/cura/Settings/SimpleModeSettingsManager.py @@ -1,7 +1,7 @@ # Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. -from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty +from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty, pyqtSlot from UM.Application import Application @@ -16,12 +16,12 @@ class SimpleModeSettingsManager(QObject): self._is_profile_user_created = False # True when profile was custom created by user self._machine_manager.activeStackValueChanged.connect(self._updateIsProfileCustomized) - self._machine_manager.activeQualityGroupChanged.connect(self._updateIsProfileUserCreated) - self._machine_manager.activeQualityChangesGroupChanged.connect(self._updateIsProfileUserCreated) + self._machine_manager.activeQualityGroupChanged.connect(self.updateIsProfileUserCreated) + self._machine_manager.activeQualityChangesGroupChanged.connect(self.updateIsProfileUserCreated) # update on create as the activeQualityChanged signal is emitted before this manager is created when Cura starts self._updateIsProfileCustomized() - self._updateIsProfileUserCreated() + self.updateIsProfileUserCreated() isProfileCustomizedChanged = pyqtSignal() isProfileUserCreatedChanged = pyqtSignal() @@ -61,7 +61,8 @@ class SimpleModeSettingsManager(QObject): def isProfileUserCreated(self): return self._is_profile_user_created - def _updateIsProfileUserCreated(self): + @pyqtSlot() + def updateIsProfileUserCreated(self) -> None: quality_changes_keys = set() if not self._machine_manager.activeMachine: diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml index 349c6dbb57..e6b3f1b9eb 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml @@ -39,7 +39,17 @@ Item { target: Cura.QualityProfilesDropDownMenuModel onItemsChanged: qualityModel.update() - onDataChanged: qualityModel.update() + onDataChanged: + { + // If a custom profile is selected and then a user decides to change any of setting the slider should show + // the reset button. After clicking the reset button the QualityProfilesDropDownMenuModel(ListModel) is + // updated before the property isProfileCustomized is called to update. + if (Cura.SimpleModeSettingsManager.isProfileCustomized) + { + Cura.SimpleModeSettingsManager.updateIsProfileUserCreated() + } + qualityModel.update() + } } Connections { From 74af11d609f7e927f14de92af619a06121cc35ed Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 16:20:08 +0100 Subject: [PATCH 176/199] Anchor loader to stage menu vertical center --- resources/qml/Cura.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 573d75e5fa..8ab943b93b 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -252,7 +252,7 @@ UM.MainWindow anchors { // Align to the top of the stageMenu since the stageMenu may not exist - top: headerBackground.top + top: stageMenu.source ? stageMenu.verticalCenter : parent.top left: parent.left right: parent.right bottom: parent.bottom From ef6f666c3e07b0b9c5fd4ab85023d2a9d29433c2 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 14 Dec 2018 16:41:07 +0100 Subject: [PATCH 177/199] Remove duplicate alias definition Yay. Merges. --- resources/qml/IconWithText.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/IconWithText.qml b/resources/qml/IconWithText.qml index dd522031c1..24b6dc7fe2 100644 --- a/resources/qml/IconWithText.qml +++ b/resources/qml/IconWithText.qml @@ -19,7 +19,6 @@ Item property alias color: label.color property alias text: label.text property alias font: label.font - property alias iconColor: icon.color property real margin: UM.Theme.getSize("narrow_margin").width // These properties can be used in combination with layouts. From e877b47e22cb95b2534a7121db73914d4a321d93 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 16:55:48 +0100 Subject: [PATCH 178/199] Disable printer cards which are not in focus Contributes to CL-1151 --- .../resources/qml/CameraButton.qml | 18 +++++++++++++----- .../resources/qml/MonitorCarousel.qml | 1 + .../resources/qml/MonitorPrinterCard.qml | 9 ++++++++- .../resources/qml/PrintJobContextMenu.qml | 5 +++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml b/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml index 618dbed81c..6f054f9c19 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/CameraButton.qml @@ -8,11 +8,13 @@ import UM 1.3 as UM import Cura 1.0 as Cura Rectangle { + id: base property var iconSource: null; color: "#0a0850" // TODO: Theme! height: width; radius: Math.round(0.5 * width); width: 24 * screenScaleFactor; + property var enabled: true UM.RecolorImage { id: icon; @@ -29,12 +31,18 @@ Rectangle { MouseArea { id: clickArea; anchors.fill: parent; - hoverEnabled: true; + hoverEnabled: base.enabled onClicked: { - if (OutputDevice.activeCameraUrl != "") { - OutputDevice.setActiveCameraUrl(""); - } else { - OutputDevice.setActiveCameraUrl(modelData.cameraUrl); + if (base.enabled) + { + if (OutputDevice.activeCameraUrl != "") + { + OutputDevice.setActiveCameraUrl("") + } + else + { + OutputDevice.setActiveCameraUrl(modelData.cameraUrl) + } } } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml index 988008dc31..952ec1e162 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml @@ -124,6 +124,7 @@ Item MonitorPrinterCard { printer: modelData + enabled: model.index == currentIndex } } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml index 038f0535f0..2ca37a7e13 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorPrinterCard.qml @@ -25,6 +25,11 @@ Item property var borderSize: 1 * screenScaleFactor // TODO: Theme, and remove from here + // If the printer card's controls are enabled. This is used by the carousel + // to prevent opening the context menu or camera while the printer card is not + // "in focus" + property var enabled: true + width: 834 * screenScaleFactor // TODO: Theme! height: childrenRect.height @@ -124,6 +129,7 @@ Item printJob: printer.activePrintJob width: 36 * screenScaleFactor // TODO: Theme! height: 36 * screenScaleFactor // TODO: Theme! + enabled: base.enabled } CameraButton { @@ -136,6 +142,7 @@ Item bottomMargin: 20 * screenScaleFactor // TODO: Theme! } iconSource: "../svg/icons/camera.svg" + enabled: base.enabled } } @@ -320,7 +327,7 @@ Item implicitHeight: 32 * screenScaleFactor // TODO: Theme! implicitWidth: 96 * screenScaleFactor // TODO: Theme! visible: printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 - onClicked: overrideConfirmationDialog.open() + onClicked: base.enabled ? overrideConfirmationDialog.open() : {} } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenu.qml b/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenu.qml index 1edbf9f6a2..5c5c892dad 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenu.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/PrintJobContextMenu.qml @@ -13,6 +13,7 @@ Item { property var printJob: null; property var started: isStarted(printJob); property var assigned: isAssigned(printJob); + property var enabled: true Button { id: button; @@ -31,8 +32,8 @@ Item { verticalAlignment: Text.AlignVCenter; } height: width; - hoverEnabled: true; - onClicked: parent.switchPopupState(); + hoverEnabled: base.enabled + onClicked: base.enabled ? parent.switchPopupState() : {} text: "\u22EE"; //Unicode; Three stacked points. visible: { if (!printJob) { From 331cd730f11c4b5a486fe7a5e1474c54b0d054fd Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 14 Dec 2018 16:56:20 +0100 Subject: [PATCH 179/199] Improve visual hint that side cards are not in focus Contributes to CL-1151 --- plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml index 952ec1e162..ea1449ac8d 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml @@ -45,7 +45,7 @@ Item GradientStop { position: 1.0 - color: "#00f6f6f6" + color: "#66f6f6f6" } } } @@ -190,7 +190,7 @@ Item GradientStop { position: 0.0 - color: "#00f6f6f6" + color: "#66f6f6f6" } GradientStop { From c235f339ae9e59b2c54a9054028a456658c306f1 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 14 Dec 2018 17:29:02 +0100 Subject: [PATCH 180/199] Increment API version to 6 All plug-ins now have to re-check whether they are still compatible with the current version of Cura. Contributes to issue CURA-6019. --- cura/CuraApplication.py | 2 +- plugins/3MFReader/plugin.json | 2 +- plugins/3MFWriter/plugin.json | 2 +- plugins/ChangeLogPlugin/plugin.json | 2 +- plugins/CuraEngineBackend/plugin.json | 2 +- plugins/CuraProfileReader/plugin.json | 2 +- plugins/CuraProfileWriter/plugin.json | 2 +- plugins/FirmwareUpdateChecker/plugin.json | 2 +- plugins/FirmwareUpdater/plugin.json | 2 +- plugins/GCodeGzReader/plugin.json | 2 +- plugins/GCodeGzWriter/plugin.json | 2 +- plugins/GCodeProfileReader/plugin.json | 2 +- plugins/GCodeReader/plugin.json | 4 ++-- plugins/GCodeWriter/plugin.json | 2 +- plugins/ImageReader/plugin.json | 2 +- plugins/LegacyProfileReader/plugin.json | 2 +- plugins/MachineSettingsAction/plugin.json | 2 +- plugins/ModelChecker/plugin.json | 2 +- plugins/MonitorStage/plugin.json | 2 +- plugins/PerObjectSettingsTool/plugin.json | 2 +- plugins/PostProcessingPlugin/plugin.json | 2 +- plugins/PrepareStage/plugin.json | 2 +- plugins/PreviewStage/plugin.json | 2 +- plugins/RemovableDriveOutputDevice/plugin.json | 2 +- plugins/SimulationView/plugin.json | 2 +- plugins/SliceInfoPlugin/plugin.json | 2 +- plugins/SolidView/plugin.json | 2 +- plugins/SupportEraser/plugin.json | 2 +- plugins/Toolbox/plugin.json | 2 +- plugins/UFPWriter/plugin.json | 2 +- plugins/UM3NetworkPrinting/plugin.json | 2 +- plugins/USBPrinting/plugin.json | 2 +- plugins/UltimakerMachineActions/plugin.json | 2 +- plugins/UserAgreement/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json | 2 +- plugins/X3DReader/plugin.json | 2 +- plugins/XRayView/plugin.json | 2 +- plugins/XmlMaterialProfile/plugin.json | 2 +- 46 files changed, 47 insertions(+), 47 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 55e37617d5..726197de10 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -134,7 +134,7 @@ except ImportError: CuraVersion = "master" # [CodeStyle: Reflecting imported value] CuraBuildType = "" CuraDebugMode = False - CuraSDKVersion = "5.0.0" + CuraSDKVersion = "6.0.0" class CuraApplication(QtApplication): diff --git a/plugins/3MFReader/plugin.json b/plugins/3MFReader/plugin.json index 5e41975752..d7160e166a 100644 --- a/plugins/3MFReader/plugin.json +++ b/plugins/3MFReader/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides support for reading 3MF files.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/3MFWriter/plugin.json b/plugins/3MFWriter/plugin.json index 9ec4fb0c20..865c3bf026 100644 --- a/plugins/3MFWriter/plugin.json +++ b/plugins/3MFWriter/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides support for writing 3MF files.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/ChangeLogPlugin/plugin.json b/plugins/ChangeLogPlugin/plugin.json index e09a08564a..04d5ce7c51 100644 --- a/plugins/ChangeLogPlugin/plugin.json +++ b/plugins/ChangeLogPlugin/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Shows changes since latest checked version.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/CuraEngineBackend/plugin.json b/plugins/CuraEngineBackend/plugin.json index 111698d8d1..25db9abefd 100644 --- a/plugins/CuraEngineBackend/plugin.json +++ b/plugins/CuraEngineBackend/plugin.json @@ -2,7 +2,7 @@ "name": "CuraEngine Backend", "author": "Ultimaker B.V.", "description": "Provides the link to the CuraEngine slicing backend.", - "api": 5, + "api": "6.0", "version": "1.0.0", "i18n-catalog": "cura" } diff --git a/plugins/CuraProfileReader/plugin.json b/plugins/CuraProfileReader/plugin.json index 66a2a6a56b..adbf376b72 100644 --- a/plugins/CuraProfileReader/plugin.json +++ b/plugins/CuraProfileReader/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides support for importing Cura profiles.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/CuraProfileWriter/plugin.json b/plugins/CuraProfileWriter/plugin.json index 16c8c34152..d576f517de 100644 --- a/plugins/CuraProfileWriter/plugin.json +++ b/plugins/CuraProfileWriter/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides support for exporting Cura profiles.", - "api": 5, + "api": "6.0", "i18n-catalog":"cura" } diff --git a/plugins/FirmwareUpdateChecker/plugin.json b/plugins/FirmwareUpdateChecker/plugin.json index cbbd41e420..4b77a53a62 100644 --- a/plugins/FirmwareUpdateChecker/plugin.json +++ b/plugins/FirmwareUpdateChecker/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Checks for firmware updates.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/FirmwareUpdater/plugin.json b/plugins/FirmwareUpdater/plugin.json index 3e09eab2b5..4098759630 100644 --- a/plugins/FirmwareUpdater/plugin.json +++ b/plugins/FirmwareUpdater/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides a machine actions for updating firmware.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/GCodeGzReader/plugin.json b/plugins/GCodeGzReader/plugin.json index 3bd6a4097d..cea1d0f55c 100644 --- a/plugins/GCodeGzReader/plugin.json +++ b/plugins/GCodeGzReader/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Reads g-code from a compressed archive.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/GCodeGzWriter/plugin.json b/plugins/GCodeGzWriter/plugin.json index 4c6497317b..d725b2649d 100644 --- a/plugins/GCodeGzWriter/plugin.json +++ b/plugins/GCodeGzWriter/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Writes g-code to a compressed archive.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/GCodeProfileReader/plugin.json b/plugins/GCodeProfileReader/plugin.json index 9677628c85..12d8a276da 100644 --- a/plugins/GCodeProfileReader/plugin.json +++ b/plugins/GCodeProfileReader/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides support for importing profiles from g-code files.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/GCodeReader/plugin.json b/plugins/GCodeReader/plugin.json index 75b4d0cd4f..351d6cbc31 100644 --- a/plugins/GCodeReader/plugin.json +++ b/plugins/GCodeReader/plugin.json @@ -1,8 +1,8 @@ { "name": "G-code Reader", - "author": "Victor Larchenko", + "author": "Victor Larchenko, Ultimaker", "version": "1.0.0", "description": "Allows loading and displaying G-code files.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/GCodeWriter/plugin.json b/plugins/GCodeWriter/plugin.json index 3bbbab8b95..78b63a582f 100644 --- a/plugins/GCodeWriter/plugin.json +++ b/plugins/GCodeWriter/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Writes g-code to a file.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/ImageReader/plugin.json b/plugins/ImageReader/plugin.json index 08195863e8..001da0822b 100644 --- a/plugins/ImageReader/plugin.json +++ b/plugins/ImageReader/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Enables ability to generate printable geometry from 2D image files.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/LegacyProfileReader/plugin.json b/plugins/LegacyProfileReader/plugin.json index 179f5444e0..2cd1e9ca2c 100644 --- a/plugins/LegacyProfileReader/plugin.json +++ b/plugins/LegacyProfileReader/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides support for importing profiles from legacy Cura versions.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/MachineSettingsAction/plugin.json b/plugins/MachineSettingsAction/plugin.json index 571658e40a..4587729a9a 100644 --- a/plugins/MachineSettingsAction/plugin.json +++ b/plugins/MachineSettingsAction/plugin.json @@ -3,6 +3,6 @@ "author": "fieldOfView", "version": "1.0.0", "description": "Provides a way to change machine settings (such as build volume, nozzle size, etc.).", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/ModelChecker/plugin.json b/plugins/ModelChecker/plugin.json index 3753c0cc88..a210c3bf9f 100644 --- a/plugins/ModelChecker/plugin.json +++ b/plugins/ModelChecker/plugin.json @@ -2,7 +2,7 @@ "name": "Model Checker", "author": "Ultimaker B.V.", "version": "0.1", - "api": 5, + "api": "6.0", "description": "Checks models and print configuration for possible printing issues and give suggestions.", "i18n-catalog": "cura" } diff --git a/plugins/MonitorStage/plugin.json b/plugins/MonitorStage/plugin.json index 88b53840e0..71fc10c5ce 100644 --- a/plugins/MonitorStage/plugin.json +++ b/plugins/MonitorStage/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides a monitor stage in Cura.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } \ No newline at end of file diff --git a/plugins/PerObjectSettingsTool/plugin.json b/plugins/PerObjectSettingsTool/plugin.json index 15fde63387..e5bdc5d3da 100644 --- a/plugins/PerObjectSettingsTool/plugin.json +++ b/plugins/PerObjectSettingsTool/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides the Per Model Settings.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/PostProcessingPlugin/plugin.json b/plugins/PostProcessingPlugin/plugin.json index fea061e93b..ad60312af0 100644 --- a/plugins/PostProcessingPlugin/plugin.json +++ b/plugins/PostProcessingPlugin/plugin.json @@ -2,7 +2,7 @@ "name": "Post Processing", "author": "Ultimaker", "version": "2.2", - "api": 5, + "api": "6.0", "description": "Extension that allows for user created scripts for post processing", "catalog": "cura" } \ No newline at end of file diff --git a/plugins/PrepareStage/plugin.json b/plugins/PrepareStage/plugin.json index f0464313c7..e948b96f6f 100644 --- a/plugins/PrepareStage/plugin.json +++ b/plugins/PrepareStage/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides a prepare stage in Cura.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } \ No newline at end of file diff --git a/plugins/PreviewStage/plugin.json b/plugins/PreviewStage/plugin.json index 9349da2b0e..c9c13fe341 100644 --- a/plugins/PreviewStage/plugin.json +++ b/plugins/PreviewStage/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides a preview stage in Cura.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } \ No newline at end of file diff --git a/plugins/RemovableDriveOutputDevice/plugin.json b/plugins/RemovableDriveOutputDevice/plugin.json index 36bb9ae186..48cd60596c 100644 --- a/plugins/RemovableDriveOutputDevice/plugin.json +++ b/plugins/RemovableDriveOutputDevice/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "description": "Provides removable drive hotplugging and writing support.", "version": "1.0.0", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/SimulationView/plugin.json b/plugins/SimulationView/plugin.json index 93df98068f..dcfbeb305e 100644 --- a/plugins/SimulationView/plugin.json +++ b/plugins/SimulationView/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides the Simulation view.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/SliceInfoPlugin/plugin.json b/plugins/SliceInfoPlugin/plugin.json index 939e5ff235..c2d78e8d78 100644 --- a/plugins/SliceInfoPlugin/plugin.json +++ b/plugins/SliceInfoPlugin/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Submits anonymous slice info. Can be disabled through preferences.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/SolidView/plugin.json b/plugins/SolidView/plugin.json index e70ec224dd..c66e41a7aa 100644 --- a/plugins/SolidView/plugin.json +++ b/plugins/SolidView/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides a normal solid mesh view.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } \ No newline at end of file diff --git a/plugins/SupportEraser/plugin.json b/plugins/SupportEraser/plugin.json index 7af35e0fb5..dc624ecd77 100644 --- a/plugins/SupportEraser/plugin.json +++ b/plugins/SupportEraser/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Creates an eraser mesh to block the printing of support in certain places", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/Toolbox/plugin.json b/plugins/Toolbox/plugin.json index 2557185524..91e9561327 100644 --- a/plugins/Toolbox/plugin.json +++ b/plugins/Toolbox/plugin.json @@ -2,6 +2,6 @@ "name": "Toolbox", "author": "Ultimaker B.V.", "version": "1.0.0", - "api": 5, + "api": "6.0", "description": "Find, manage and install new Cura packages." } diff --git a/plugins/UFPWriter/plugin.json b/plugins/UFPWriter/plugin.json index ab590353e0..b4e05d9346 100644 --- a/plugins/UFPWriter/plugin.json +++ b/plugins/UFPWriter/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides support for writing Ultimaker Format Packages.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/plugin.json b/plugins/UM3NetworkPrinting/plugin.json index d415338374..def02562db 100644 --- a/plugins/UM3NetworkPrinting/plugin.json +++ b/plugins/UM3NetworkPrinting/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "description": "Manages network connections to Ultimaker 3 printers.", "version": "1.0.0", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/USBPrinting/plugin.json b/plugins/USBPrinting/plugin.json index 5d3cba8415..3a58abe7e7 100644 --- a/plugins/USBPrinting/plugin.json +++ b/plugins/USBPrinting/plugin.json @@ -2,7 +2,7 @@ "name": "USB printing", "author": "Ultimaker B.V.", "version": "1.0.1", - "api": 5, + "api": "6.0", "description": "Accepts G-Code and sends them to a printer. Plugin can also update firmware.", "i18n-catalog": "cura" } diff --git a/plugins/UltimakerMachineActions/plugin.json b/plugins/UltimakerMachineActions/plugin.json index b60c7df88e..fc1eb242fe 100644 --- a/plugins/UltimakerMachineActions/plugin.json +++ b/plugins/UltimakerMachineActions/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides machine actions for Ultimaker machines (such as bed leveling wizard, selecting upgrades, etc.).", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/UserAgreement/plugin.json b/plugins/UserAgreement/plugin.json index 50a2aa0441..7781e383d6 100644 --- a/plugins/UserAgreement/plugin.json +++ b/plugins/UserAgreement/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Ask the user once if he/she agrees with our license.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json b/plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json index 463fcdc941..e732c43813 100644 --- a/plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Upgrades configurations from Cura 2.1 to Cura 2.2.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json b/plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json index e7a0b1c559..2b344ce5d3 100644 --- a/plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Upgrades configurations from Cura 2.2 to Cura 2.4.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json b/plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json index 3029539887..8691ebfc67 100644 --- a/plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Upgrades configurations from Cura 2.5 to Cura 2.6.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json b/plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json index 225da67235..c7124eada6 100644 --- a/plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Upgrades configurations from Cura 2.6 to Cura 2.7.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json b/plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json index 9a139851ec..ce8f4a6d44 100644 --- a/plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Upgrades configurations from Cura 2.7 to Cura 3.0.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json b/plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json index cf42b3f6cd..f94f3dfe30 100644 --- a/plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Upgrades configurations from Cura 3.0 to Cura 3.1.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json b/plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json index f9cc968dae..0bbc237436 100644 --- a/plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Upgrades configurations from Cura 3.2 to Cura 3.3.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json b/plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json index f5ba7235d1..5f83695245 100644 --- a/plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Upgrades configurations from Cura 3.3 to Cura 3.4.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json b/plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json index b73001b683..f95cb7be87 100644 --- a/plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Upgrades configurations from Cura 3.4 to Cura 3.5.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/X3DReader/plugin.json b/plugins/X3DReader/plugin.json index 9ee09e43df..4052ac6605 100644 --- a/plugins/X3DReader/plugin.json +++ b/plugins/X3DReader/plugin.json @@ -3,6 +3,6 @@ "author": "Seva Alekseyev", "version": "0.5.0", "description": "Provides support for reading X3D files.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/XRayView/plugin.json b/plugins/XRayView/plugin.json index 576dec4656..4d8e42bae3 100644 --- a/plugins/XRayView/plugin.json +++ b/plugins/XRayView/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides the X-Ray view.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/XmlMaterialProfile/plugin.json b/plugins/XmlMaterialProfile/plugin.json index 4b2901c375..d172d49f87 100644 --- a/plugins/XmlMaterialProfile/plugin.json +++ b/plugins/XmlMaterialProfile/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "version": "1.0.0", "description": "Provides capabilities to read and write XML-based material profiles.", - "api": 5, + "api": "6.0", "i18n-catalog": "cura" } From 77deabf6d4d2f6ceee9bb536c53b8516acb08f7c Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 17 Dec 2018 09:43:24 +0100 Subject: [PATCH 181/199] Code style --- .../resources/qml/MonitorStage.qml | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index 4d59e0eb6b..150bc49254 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -34,14 +34,18 @@ Component name: "cura" } - LinearGradient { + LinearGradient + { anchors.fill: parent - gradient: Gradient { - GradientStop { + gradient: Gradient + { + GradientStop + { position: 0.0 color: "#f6f6f6" } - GradientStop { + GradientStop + { position: 1.0 color: "#ffffff" } @@ -81,7 +85,8 @@ Component id: queue width: Math.min(834 * screenScaleFactor, maximumWidth) - anchors { + anchors + { bottom: parent.bottom horizontalCenter: parent.horizontalCenter top: printers.bottom @@ -210,7 +215,8 @@ Component ScrollView { id: queuedPrintJobs - anchors { + anchors + { bottom: parent.bottom horizontalCenter: parent.horizontalCenter top: printJobQueueHeadings.bottom @@ -239,7 +245,8 @@ Component } } - PrinterVideoStream { + PrinterVideoStream + { anchors.fill: parent cameraUrl: OutputDevice.activeCameraUrl visible: OutputDevice.activeCameraUrl != "" From 8d6a281070e1fb222324edaa2a99230c347aa540 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 17 Dec 2018 09:58:38 +0100 Subject: [PATCH 182/199] Increment SDK version in bundled packages file And increment the version number of every package. Contributes to issue CURA-6019. --- resources/bundled_packages/cura.json | 364 +++++++++++++-------------- 1 file changed, 182 insertions(+), 182 deletions(-) diff --git a/resources/bundled_packages/cura.json b/resources/bundled_packages/cura.json index 384b7d0412..c32b94af3f 100644 --- a/resources/bundled_packages/cura.json +++ b/resources/bundled_packages/cura.json @@ -5,8 +5,8 @@ "package_type": "plugin", "display_name": "3MF Reader", "description": "Provides support for reading 3MF files.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -22,8 +22,8 @@ "package_type": "plugin", "display_name": "3MF Writer", "description": "Provides support for writing 3MF files.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -39,8 +39,8 @@ "package_type": "plugin", "display_name": "Change Log", "description": "Shows changes since latest checked version.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -56,8 +56,8 @@ "package_type": "plugin", "display_name": "CuraEngine Backend", "description": "Provides the link to the CuraEngine slicing backend.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -73,8 +73,8 @@ "package_type": "plugin", "display_name": "Cura Profile Reader", "description": "Provides support for importing Cura profiles.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -90,8 +90,8 @@ "package_type": "plugin", "display_name": "Cura Profile Writer", "description": "Provides support for exporting Cura profiles.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -107,8 +107,8 @@ "package_type": "plugin", "display_name": "Firmware Update Checker", "description": "Checks for firmware updates.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -124,8 +124,8 @@ "package_type": "plugin", "display_name": "Firmware Updater", "description": "Provides a machine actions for updating firmware.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -141,8 +141,8 @@ "package_type": "plugin", "display_name": "Compressed G-code Reader", "description": "Reads g-code from a compressed archive.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -158,8 +158,8 @@ "package_type": "plugin", "display_name": "Compressed G-code Writer", "description": "Writes g-code to a compressed archive.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -175,8 +175,8 @@ "package_type": "plugin", "display_name": "G-Code Profile Reader", "description": "Provides support for importing profiles from g-code files.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -192,8 +192,8 @@ "package_type": "plugin", "display_name": "G-Code Reader", "description": "Allows loading and displaying G-code files.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "VictorLarchenko", @@ -209,8 +209,8 @@ "package_type": "plugin", "display_name": "G-Code Writer", "description": "Writes g-code to a file.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -226,8 +226,8 @@ "package_type": "plugin", "display_name": "Image Reader", "description": "Enables ability to generate printable geometry from 2D image files.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -243,8 +243,8 @@ "package_type": "plugin", "display_name": "Legacy Cura Profile Reader", "description": "Provides support for importing profiles from legacy Cura versions.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -260,8 +260,8 @@ "package_type": "plugin", "display_name": "Machine Settings Action", "description": "Provides a way to change machine settings (such as build volume, nozzle size, etc.).", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "fieldOfView", @@ -277,8 +277,8 @@ "package_type": "plugin", "display_name": "Model Checker", "description": "Checks models and print configuration for possible printing issues and give suggestions.", - "package_version": "0.1.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -294,8 +294,8 @@ "package_type": "plugin", "display_name": "Monitor Stage", "description": "Provides a monitor stage in Cura.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -311,8 +311,8 @@ "package_type": "plugin", "display_name": "Per-Object Settings Tool", "description": "Provides the per-model settings.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -328,8 +328,8 @@ "package_type": "plugin", "display_name": "Post Processing", "description": "Extension that allows for user created scripts for post processing.", - "package_version": "2.2.0", - "sdk_version": 5, + "package_version": "2.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -345,8 +345,8 @@ "package_type": "plugin", "display_name": "Prepare Stage", "description": "Provides a prepare stage in Cura.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -362,8 +362,8 @@ "package_type": "plugin", "display_name": "Preview Stage", "description": "Provides a preview stage in Cura.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -379,8 +379,8 @@ "package_type": "plugin", "display_name": "Removable Drive Output Device", "description": "Provides removable drive hotplugging and writing support.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -396,8 +396,8 @@ "package_type": "plugin", "display_name": "Simulation View", "description": "Provides the Simulation view.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -413,8 +413,8 @@ "package_type": "plugin", "display_name": "Slice Info", "description": "Submits anonymous slice info. Can be disabled through preferences.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -430,8 +430,8 @@ "package_type": "plugin", "display_name": "Solid View", "description": "Provides a normal solid mesh view.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -447,8 +447,8 @@ "package_type": "plugin", "display_name": "Support Eraser Tool", "description": "Creates an eraser mesh to block the printing of support in certain places.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -464,8 +464,8 @@ "package_type": "plugin", "display_name": "Toolbox", "description": "Find, manage and install new Cura packages.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -481,8 +481,8 @@ "package_type": "plugin", "display_name": "UFP Writer", "description": "Provides support for writing Ultimaker Format Packages.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -498,8 +498,8 @@ "package_type": "plugin", "display_name": "Ultimaker Machine Actions", "description": "Provides machine actions for Ultimaker machines (such as bed leveling wizard, selecting upgrades, etc.).", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -515,8 +515,8 @@ "package_type": "plugin", "display_name": "UM3 Network Printing", "description": "Manages network connections to Ultimaker 3 printers.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -532,8 +532,8 @@ "package_type": "plugin", "display_name": "USB Printing", "description": "Accepts G-Code and sends them to a printer. Plugin can also update firmware.", - "package_version": "1.0.1", - "sdk_version": 5, + "package_version": "1.0.2", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -549,8 +549,8 @@ "package_type": "plugin", "display_name": "User Agreement", "description": "Ask the user once if he/she agrees with our license.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -566,8 +566,8 @@ "package_type": "plugin", "display_name": "Version Upgrade 2.1 to 2.2", "description": "Upgrades configurations from Cura 2.1 to Cura 2.2.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -583,8 +583,8 @@ "package_type": "plugin", "display_name": "Version Upgrade 2.2 to 2.4", "description": "Upgrades configurations from Cura 2.2 to Cura 2.4.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -600,8 +600,8 @@ "package_type": "plugin", "display_name": "Version Upgrade 2.5 to 2.6", "description": "Upgrades configurations from Cura 2.5 to Cura 2.6.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -617,8 +617,8 @@ "package_type": "plugin", "display_name": "Version Upgrade 2.6 to 2.7", "description": "Upgrades configurations from Cura 2.6 to Cura 2.7.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -634,8 +634,8 @@ "package_type": "plugin", "display_name": "Version Upgrade 2.7 to 3.0", "description": "Upgrades configurations from Cura 2.7 to Cura 3.0.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -651,8 +651,8 @@ "package_type": "plugin", "display_name": "Version Upgrade 3.0 to 3.1", "description": "Upgrades configurations from Cura 3.0 to Cura 3.1.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -668,8 +668,8 @@ "package_type": "plugin", "display_name": "Version Upgrade 3.2 to 3.3", "description": "Upgrades configurations from Cura 3.2 to Cura 3.3.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -685,8 +685,8 @@ "package_type": "plugin", "display_name": "Version Upgrade 3.3 to 3.4", "description": "Upgrades configurations from Cura 3.3 to Cura 3.4.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -702,8 +702,8 @@ "package_type": "plugin", "display_name": "Version Upgrade 3.4 to 3.5", "description": "Upgrades configurations from Cura 3.4 to Cura 3.5.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -719,8 +719,8 @@ "package_type": "plugin", "display_name": "X3D Reader", "description": "Provides support for reading X3D files.", - "package_version": "0.5.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "SevaAlekseyev", @@ -736,8 +736,8 @@ "package_type": "plugin", "display_name": "XML Material Profiles", "description": "Provides capabilities to read and write XML-based material profiles.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -753,8 +753,8 @@ "package_type": "plugin", "display_name": "X-Ray View", "description": "Provides the X-Ray view.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://ultimaker.com", "author": { "author_id": "UltimakerPackages", @@ -770,8 +770,8 @@ "package_type": "material", "display_name": "Generic ABS", "description": "The generic ABS profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -788,8 +788,8 @@ "package_type": "material", "display_name": "Generic BAM", "description": "The generic BAM profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -806,8 +806,8 @@ "package_type": "material", "display_name": "Generic CFF CPE", "description": "The generic CFF CPE profile which other profiles can be based upon.", - "package_version": "1.1.0", - "sdk_version": 5, + "package_version": "1.1.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -824,8 +824,8 @@ "package_type": "material", "display_name": "Generic CFF PA", "description": "The generic CFF PA profile which other profiles can be based upon.", - "package_version": "1.1.0", - "sdk_version": 5, + "package_version": "1.1.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -842,8 +842,8 @@ "package_type": "material", "display_name": "Generic CPE", "description": "The generic CPE profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -860,8 +860,8 @@ "package_type": "material", "display_name": "Generic CPE+", "description": "The generic CPE+ profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -878,8 +878,8 @@ "package_type": "material", "display_name": "Generic GFF CPE", "description": "The generic GFF CPE profile which other profiles can be based upon.", - "package_version": "1.1.0", - "sdk_version": 5, + "package_version": "1.1.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -896,8 +896,8 @@ "package_type": "material", "display_name": "Generic GFF PA", "description": "The generic GFF PA profile which other profiles can be based upon.", - "package_version": "1.1.0", - "sdk_version": 5, + "package_version": "1.1.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -914,8 +914,8 @@ "package_type": "material", "display_name": "Generic HIPS", "description": "The generic HIPS profile which other profiles can be based upon.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -932,8 +932,8 @@ "package_type": "material", "display_name": "Generic Nylon", "description": "The generic Nylon profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -950,8 +950,8 @@ "package_type": "material", "display_name": "Generic PC", "description": "The generic PC profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -968,8 +968,8 @@ "package_type": "material", "display_name": "Generic PETG", "description": "The generic PETG profile which other profiles can be based upon.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -986,8 +986,8 @@ "package_type": "material", "display_name": "Generic PLA", "description": "The generic PLA profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -1004,8 +1004,8 @@ "package_type": "material", "display_name": "Generic PP", "description": "The generic PP profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -1022,8 +1022,8 @@ "package_type": "material", "display_name": "Generic PVA", "description": "The generic PVA profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -1040,8 +1040,8 @@ "package_type": "material", "display_name": "Generic Tough PLA", "description": "The generic Tough PLA profile which other profiles can be based upon.", - "package_version": "1.0.1", - "sdk_version": 5, + "package_version": "1.0.2", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -1058,8 +1058,8 @@ "package_type": "material", "display_name": "Generic TPU", "description": "The generic TPU profile which other profiles can be based upon.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://github.com/Ultimaker/fdm_materials", "author": { "author_id": "Generic", @@ -1076,8 +1076,8 @@ "package_type": "material", "display_name": "Dagoma Chromatik PLA", "description": "Filament testé et approuvé pour les imprimantes 3D Dagoma. Chromatik est l'idéal pour débuter et suivre les tutoriels premiers pas. Il vous offre qualité et résistance pour chacune de vos impressions.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://dagoma.fr/boutique/filaments.html", "author": { "author_id": "Dagoma", @@ -1093,8 +1093,8 @@ "package_type": "material", "display_name": "FABtotum ABS", "description": "This material is easy to be extruded but it is not the simplest to use. It is one of the most used in 3D printing to get very well finished objects. It is not sustainable and its smoke can be dangerous if inhaled. The reason to prefer this filament to PLA is mainly because of its precision and mechanical specs. ABS (for plastic) stands for Acrylonitrile Butadiene Styrene and it is a thermoplastic which is widely used in everyday objects. It can be printed with any FFF 3D printer which can get to high temperatures as it must be extruded in a range between 220° and 245°, so it’s compatible with all versions of the FABtotum Personal fabricator.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://store.fabtotum.com/eu/products/filaments.html?filament_type=40", "author": { "author_id": "FABtotum", @@ -1110,8 +1110,8 @@ "package_type": "material", "display_name": "FABtotum Nylon", "description": "When 3D printing started this material was not listed among the extrudable filaments. It is flexible as well as resistant to tractions. It is well known for its uses in textile but also in industries which require a strong and flexible material. There are different kinds of Nylon: 3D printing mostly uses Nylon 6 and Nylon 6.6, which are the most common. It requires higher temperatures to be printed, so a 3D printer must be able to reach them (around 240°C): the FABtotum, of course, can.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://store.fabtotum.com/eu/products/filaments.html?filament_type=53", "author": { "author_id": "FABtotum", @@ -1127,8 +1127,8 @@ "package_type": "material", "display_name": "FABtotum PLA", "description": "It is the most common filament used for 3D printing. It is studied to be bio-degradable as it comes from corn starch’s sugar mainly. It is completely made of renewable sources and has no footprint on polluting. PLA stands for PolyLactic Acid and it is a thermoplastic that today is still considered the easiest material to be 3D printed. It can be extruded at lower temperatures: the standard range of FABtotum’s one is between 185° and 195°.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://store.fabtotum.com/eu/products/filaments.html?filament_type=39", "author": { "author_id": "FABtotum", @@ -1144,8 +1144,8 @@ "package_type": "material", "display_name": "FABtotum TPU Shore 98A", "description": "", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://store.fabtotum.com/eu/products/filaments.html?filament_type=66", "author": { "author_id": "FABtotum", @@ -1161,8 +1161,8 @@ "package_type": "material", "display_name": "Fiberlogy HD PLA", "description": "With our HD PLA you have many more options. You can use this material in two ways. Choose the one you like best. You can use it as a normal PLA and get prints characterized by a very good adhesion between the layers and high precision. You can also make your prints acquire similar properties to that of ABS – better impact resistance and high temperature resistance. All you need is an oven. Yes, an oven! By annealing our HD PLA in an oven, in accordance with the manual, you will avoid all the inconveniences of printing with ABS, such as unpleasant odour or hazardous fumes.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "http://fiberlogy.com/en/fiberlogy-filaments/filament-hd-pla/", "author": { "author_id": "Fiberlogy", @@ -1178,8 +1178,8 @@ "package_type": "material", "display_name": "Filo3D PLA", "description": "Fast, safe and reliable printing. PLA is ideal for the fast and reliable printing of parts and prototypes with a great surface quality.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://dagoma.fr", "author": { "author_id": "Dagoma", @@ -1195,8 +1195,8 @@ "package_type": "material", "display_name": "IMADE3D JellyBOX PETG", "description": "", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "http://shop.imade3d.com/filament.html", "author": { "author_id": "IMADE3D", @@ -1212,8 +1212,8 @@ "package_type": "material", "display_name": "IMADE3D JellyBOX PLA", "description": "", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "http://shop.imade3d.com/filament.html", "author": { "author_id": "IMADE3D", @@ -1229,8 +1229,8 @@ "package_type": "material", "display_name": "Octofiber PLA", "description": "PLA material from Octofiber.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://nl.octofiber.com/3d-printing-filament/pla.html", "author": { "author_id": "Octofiber", @@ -1246,8 +1246,8 @@ "package_type": "material", "display_name": "PolyFlex™ PLA", "description": "PolyFlex™ is a highly flexible yet easy to print 3D printing material. Featuring good elasticity and a large strain-to- failure, PolyFlex™ opens up a completely new realm of applications.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "http://www.polymaker.com/shop/polyflex/", "author": { "author_id": "Polymaker", @@ -1263,8 +1263,8 @@ "package_type": "material", "display_name": "PolyMax™ PLA", "description": "PolyMax™ PLA is a 3D printing material with excellent mechanical properties and printing quality. PolyMax™ PLA has an impact resistance of up to nine times that of regular PLA, and better overall mechanical properties than ABS.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "http://www.polymaker.com/shop/polymax/", "author": { "author_id": "Polymaker", @@ -1280,8 +1280,8 @@ "package_type": "material", "display_name": "PolyPlus™ PLA True Colour", "description": "PolyPlus™ PLA is a premium PLA designed for all desktop FDM/FFF 3D printers. It is produced with our patented Jam-Free™ technology that ensures consistent extrusion and prevents jams.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "http://www.polymaker.com/shop/polyplus-true-colour/", "author": { "author_id": "Polymaker", @@ -1297,8 +1297,8 @@ "package_type": "material", "display_name": "PolyWood™ PLA", "description": "PolyWood™ is a wood mimic printing material that contains no actual wood ensuring a clean Jam-Free™ printing experience.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "http://www.polymaker.com/shop/polywood/", "author": { "author_id": "Polymaker", @@ -1314,8 +1314,8 @@ "package_type": "material", "display_name": "Ultimaker ABS", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/abs", "author": { "author_id": "UltimakerPackages", @@ -1333,8 +1333,8 @@ "package_type": "material", "display_name": "Ultimaker Breakaway", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/breakaway", "author": { "author_id": "UltimakerPackages", @@ -1352,8 +1352,8 @@ "package_type": "material", "display_name": "Ultimaker CPE", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/abs", "author": { "author_id": "UltimakerPackages", @@ -1371,8 +1371,8 @@ "package_type": "material", "display_name": "Ultimaker CPE+", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/cpe", "author": { "author_id": "UltimakerPackages", @@ -1390,8 +1390,8 @@ "package_type": "material", "display_name": "Ultimaker Nylon", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/abs", "author": { "author_id": "UltimakerPackages", @@ -1409,8 +1409,8 @@ "package_type": "material", "display_name": "Ultimaker PC", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/pc", "author": { "author_id": "UltimakerPackages", @@ -1428,8 +1428,8 @@ "package_type": "material", "display_name": "Ultimaker PLA", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/abs", "author": { "author_id": "UltimakerPackages", @@ -1447,8 +1447,8 @@ "package_type": "material", "display_name": "Ultimaker PP", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/pp", "author": { "author_id": "UltimakerPackages", @@ -1466,8 +1466,8 @@ "package_type": "material", "display_name": "Ultimaker PVA", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/abs", "author": { "author_id": "UltimakerPackages", @@ -1485,8 +1485,8 @@ "package_type": "material", "display_name": "Ultimaker TPU 95A", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.2.0", - "sdk_version": 5, + "package_version": "1.2.1", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/tpu-95a", "author": { "author_id": "UltimakerPackages", @@ -1504,8 +1504,8 @@ "package_type": "material", "display_name": "Ultimaker Tough PLA", "description": "Example package for material and quality profiles for Ultimaker materials.", - "package_version": "1.0.2", - "sdk_version": 5, + "package_version": "1.0.3", + "sdk_version": "6.0", "website": "https://ultimaker.com/products/materials/tough-pla", "author": { "author_id": "UltimakerPackages", @@ -1523,8 +1523,8 @@ "package_type": "material", "display_name": "Vertex Delta ABS", "description": "ABS material and quality files for the Delta Vertex K8800.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://vertex3dprinter.eu", "author": { "author_id": "Velleman", @@ -1540,8 +1540,8 @@ "package_type": "material", "display_name": "Vertex Delta PET", "description": "ABS material and quality files for the Delta Vertex K8800.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://vertex3dprinter.eu", "author": { "author_id": "Velleman", @@ -1557,8 +1557,8 @@ "package_type": "material", "display_name": "Vertex Delta PLA", "description": "ABS material and quality files for the Delta Vertex K8800.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://vertex3dprinter.eu", "author": { "author_id": "Velleman", @@ -1574,8 +1574,8 @@ "package_type": "material", "display_name": "Vertex Delta TPU", "description": "ABS material and quality files for the Delta Vertex K8800.", - "package_version": "1.0.0", - "sdk_version": 5, + "package_version": "1.0.1", + "sdk_version": "6.0", "website": "https://vertex3dprinter.eu", "author": { "author_id": "Velleman", From ff1a0e30f6f9dbebad72e90079df1ee23c42c437 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 17 Dec 2018 10:42:41 +0100 Subject: [PATCH 183/199] Code style & comments --- plugins/MonitorStage/MonitorMain.qml | 2 +- plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/MonitorStage/MonitorMain.qml b/plugins/MonitorStage/MonitorMain.qml index 1f287fc0fa..8f113735ee 100644 --- a/plugins/MonitorStage/MonitorMain.qml +++ b/plugins/MonitorStage/MonitorMain.qml @@ -35,6 +35,6 @@ Item property real maximumWidth: parent.width property real maximumHeight: parent.height - sourceComponent: Cura.MachineManager.printerOutputDevices.length > 0 ? Cura.MachineManager.printerOutputDevices[0].monitorItem: null + sourceComponent: Cura.MachineManager.printerOutputDevices.length > 0 ? Cura.MachineManager.printerOutputDevices[0].monitorItem : null } } diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index 150bc49254..98ca715108 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -42,12 +42,12 @@ Component GradientStop { position: 0.0 - color: "#f6f6f6" + color: "#f6f6f6" // TODO: Theme! } GradientStop { position: 1.0 - color: "#ffffff" + color: "#ffffff" // TODO: Theme! } } } From cbd8e72bd5061547573bad6c847110268b5ec64a Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 17 Dec 2018 10:42:52 +0100 Subject: [PATCH 184/199] Add fixed width to the preview button Doing that, the elide will work. Also increase the size of the panel a bit so it will fit better in other languages. Adding also the tooltip in case the text is too long in other languages. --- resources/qml/ActionPanel/OutputProcessWidget.qml | 2 ++ resources/themes/cura-light/theme.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index b6aa9289f5..eb6dc5b417 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -120,6 +120,8 @@ Column height: UM.Theme.getSize("action_button").height text: catalog.i18nc("@button", "Preview") + tooltip: text + fixedWidthMode: true onClicked: UM.Controller.setActiveStage("PreviewStage") visible: UM.Controller.activeStage != null && UM.Controller.activeStage.stageId != "PreviewStage" diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 2ff014bd31..ea6c92b479 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -361,7 +361,7 @@ "configuration_selector": [35.0, 4.0], "configuration_selector_mode_tabs": [0.0, 3.0], - "action_panel_widget": [25.0, 0.0], + "action_panel_widget": [26.0, 0.0], "action_panel_information_widget": [20.0, 0.0], "machine_selector_widget": [20.0, 4.0], From ed4d339deec699098ac70971edbd44d3d56a269d Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 17 Dec 2018 11:00:49 +0100 Subject: [PATCH 185/199] Change the margin in the view orientation buttons to aling the pixels correctly --- resources/qml/ViewOrientationButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/ViewOrientationButton.qml b/resources/qml/ViewOrientationButton.qml index 5371f8549b..5d72de9a8d 100644 --- a/resources/qml/ViewOrientationButton.qml +++ b/resources/qml/ViewOrientationButton.qml @@ -11,5 +11,5 @@ UM.SimpleButton height: UM.Theme.getSize("small_button").height hoverColor: UM.Theme.getColor("small_button_text_hover") color: UM.Theme.getColor("small_button_text") - iconMargin: 0.5 * UM.Theme.getSize("wide_lining").width + iconMargin: UM.Theme.getSize("thick_lining").width } \ No newline at end of file From 6178f9ddf62e193865558f7ac8e4e2975c57a316 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 17 Dec 2018 11:49:09 +0100 Subject: [PATCH 186/199] Improve code style and line lengths --- .../resources/qml/UM3InfoComponents.qml | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml b/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml index 42e3b7d160..320201e165 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/UM3InfoComponents.qml @@ -13,8 +13,40 @@ Item { property string activeQualityDefinitionId: Cura.MachineManager.activeQualityDefinitionId; property bool isUM3: activeQualityDefinitionId == "ultimaker3" || activeQualityDefinitionId.match("ultimaker_") != null; property bool printerConnected: Cura.MachineManager.printerConnected; - property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands; - property bool authenticationRequested: printerConnected && (Cura.MachineManager.printerOutputDevices[0].authenticationState == 2 || Cura.MachineManager.printerOutputDevices[0].authenticationState == 5); // AuthState.AuthenticationRequested or AuthenticationReceived. + property bool printerAcceptsCommands: + { + if (printerConnected && Cura.MachineManager.printerOutputDevices[0]) + { + return Cura.MachineManager.printerOutputDevices[0].acceptsCommands + } + return false + } + property bool authenticationRequested: + { + if (printerConnected && Cura.MachineManager.printerOutputDevices[0]) + { + var device = Cura.MachineManager.printerOutputDevices[0] + // AuthState.AuthenticationRequested or AuthState.AuthenticationReceived + return device.authenticationState == 2 || device.authenticationState == 5 + } + return false + } + property var materialNames: + { + if (printerConnected && Cura.MachineManager.printerOutputDevices[0]) + { + return Cura.MachineManager.printerOutputDevices[0].materialNames + } + return null + } + property var hotendIds: + { + if (printerConnected && Cura.MachineManager.printerOutputDevices[0]) + { + return Cura.MachineManager.printerOutputDevices[0].hotendIds + } + return null + } UM.I18nCatalog { id: catalog; @@ -94,7 +126,7 @@ Item { Column { Repeater { id: nozzleColumn; - model: printerConnected ? Cura.MachineManager.printerOutputDevices[0].hotendIds : null; + model: hotendIds Label { text: nozzleColumn.model[index]; @@ -105,7 +137,7 @@ Item { Column { Repeater { id: materialColumn; - model: printerConnected ? Cura.MachineManager.printerOutputDevices[0].materialNames : null; + model: materialNames Label { text: materialColumn.model[index]; From ab83af3a0353bc308a5d417ebbaa7d0bc24b446a Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 17 Dec 2018 12:20:30 +0100 Subject: [PATCH 187/199] Fix code-style --- cura/Settings/SimpleModeSettingsManager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cura/Settings/SimpleModeSettingsManager.py b/cura/Settings/SimpleModeSettingsManager.py index 210a5794d4..b22aea15ea 100644 --- a/cura/Settings/SimpleModeSettingsManager.py +++ b/cura/Settings/SimpleModeSettingsManager.py @@ -1,5 +1,6 @@ # Copyright (c) 2017 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from typing import Set from PyQt5.QtCore import QObject, pyqtSignal, pyqtProperty, pyqtSlot @@ -63,10 +64,10 @@ class SimpleModeSettingsManager(QObject): @pyqtSlot() def updateIsProfileUserCreated(self) -> None: - quality_changes_keys = set() + quality_changes_keys = set() # type: Set[str] if not self._machine_manager.activeMachine: - return False + return global_stack = self._machine_manager.activeMachine From 6992fd299159dd7775a3406c5c798f5e00bbda62 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 17 Dec 2018 13:03:17 +0100 Subject: [PATCH 188/199] Update plugin versions to match package versions CURA-6019 --- plugins/3MFReader/plugin.json | 2 +- plugins/3MFWriter/plugin.json | 2 +- plugins/ChangeLogPlugin/plugin.json | 2 +- plugins/CuraEngineBackend/plugin.json | 2 +- plugins/CuraProfileReader/plugin.json | 2 +- plugins/CuraProfileWriter/plugin.json | 2 +- plugins/FirmwareUpdateChecker/plugin.json | 2 +- plugins/FirmwareUpdater/plugin.json | 2 +- plugins/GCodeGzReader/plugin.json | 2 +- plugins/GCodeGzWriter/plugin.json | 2 +- plugins/GCodeProfileReader/plugin.json | 2 +- plugins/GCodeReader/plugin.json | 2 +- plugins/GCodeWriter/plugin.json | 2 +- plugins/ImageReader/plugin.json | 2 +- plugins/LegacyProfileReader/plugin.json | 2 +- plugins/MachineSettingsAction/plugin.json | 2 +- plugins/ModelChecker/plugin.json | 2 +- plugins/MonitorStage/plugin.json | 2 +- plugins/PerObjectSettingsTool/plugin.json | 2 +- plugins/PostProcessingPlugin/plugin.json | 2 +- plugins/PrepareStage/plugin.json | 2 +- plugins/PreviewStage/plugin.json | 2 +- plugins/RemovableDriveOutputDevice/plugin.json | 2 +- plugins/SimulationView/plugin.json | 2 +- plugins/SliceInfoPlugin/plugin.json | 2 +- plugins/SolidView/plugin.json | 2 +- plugins/SupportEraser/plugin.json | 2 +- plugins/Toolbox/plugin.json | 2 +- plugins/UFPWriter/plugin.json | 2 +- plugins/UM3NetworkPrinting/plugin.json | 2 +- plugins/USBPrinting/plugin.json | 2 +- plugins/UltimakerMachineActions/plugin.json | 2 +- plugins/UserAgreement/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json | 2 +- plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json | 2 +- plugins/X3DReader/plugin.json | 2 +- plugins/XRayView/plugin.json | 2 +- plugins/XmlMaterialProfile/plugin.json | 2 +- 45 files changed, 45 insertions(+), 45 deletions(-) diff --git a/plugins/3MFReader/plugin.json b/plugins/3MFReader/plugin.json index d7160e166a..5af21a7033 100644 --- a/plugins/3MFReader/plugin.json +++ b/plugins/3MFReader/plugin.json @@ -1,7 +1,7 @@ { "name": "3MF Reader", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides support for reading 3MF files.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/3MFWriter/plugin.json b/plugins/3MFWriter/plugin.json index 865c3bf026..3820ebd2e7 100644 --- a/plugins/3MFWriter/plugin.json +++ b/plugins/3MFWriter/plugin.json @@ -1,7 +1,7 @@ { "name": "3MF Writer", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides support for writing 3MF files.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/ChangeLogPlugin/plugin.json b/plugins/ChangeLogPlugin/plugin.json index 04d5ce7c51..92041d1543 100644 --- a/plugins/ChangeLogPlugin/plugin.json +++ b/plugins/ChangeLogPlugin/plugin.json @@ -1,7 +1,7 @@ { "name": "Changelog", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Shows changes since latest checked version.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/CuraEngineBackend/plugin.json b/plugins/CuraEngineBackend/plugin.json index 25db9abefd..28f0e294e7 100644 --- a/plugins/CuraEngineBackend/plugin.json +++ b/plugins/CuraEngineBackend/plugin.json @@ -3,6 +3,6 @@ "author": "Ultimaker B.V.", "description": "Provides the link to the CuraEngine slicing backend.", "api": "6.0", - "version": "1.0.0", + "version": "1.0.1", "i18n-catalog": "cura" } diff --git a/plugins/CuraProfileReader/plugin.json b/plugins/CuraProfileReader/plugin.json index adbf376b72..169fb43360 100644 --- a/plugins/CuraProfileReader/plugin.json +++ b/plugins/CuraProfileReader/plugin.json @@ -1,7 +1,7 @@ { "name": "Cura Profile Reader", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides support for importing Cura profiles.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/CuraProfileWriter/plugin.json b/plugins/CuraProfileWriter/plugin.json index d576f517de..9627c754d7 100644 --- a/plugins/CuraProfileWriter/plugin.json +++ b/plugins/CuraProfileWriter/plugin.json @@ -1,7 +1,7 @@ { "name": "Cura Profile Writer", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides support for exporting Cura profiles.", "api": "6.0", "i18n-catalog":"cura" diff --git a/plugins/FirmwareUpdateChecker/plugin.json b/plugins/FirmwareUpdateChecker/plugin.json index 4b77a53a62..6c55d77fd8 100644 --- a/plugins/FirmwareUpdateChecker/plugin.json +++ b/plugins/FirmwareUpdateChecker/plugin.json @@ -1,7 +1,7 @@ { "name": "Firmware Update Checker", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Checks for firmware updates.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/FirmwareUpdater/plugin.json b/plugins/FirmwareUpdater/plugin.json index 4098759630..c1034e5e42 100644 --- a/plugins/FirmwareUpdater/plugin.json +++ b/plugins/FirmwareUpdater/plugin.json @@ -1,7 +1,7 @@ { "name": "Firmware Updater", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides a machine actions for updating firmware.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/GCodeGzReader/plugin.json b/plugins/GCodeGzReader/plugin.json index cea1d0f55c..d4f281682f 100644 --- a/plugins/GCodeGzReader/plugin.json +++ b/plugins/GCodeGzReader/plugin.json @@ -1,7 +1,7 @@ { "name": "Compressed G-code Reader", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Reads g-code from a compressed archive.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/GCodeGzWriter/plugin.json b/plugins/GCodeGzWriter/plugin.json index d725b2649d..b0e6f8d605 100644 --- a/plugins/GCodeGzWriter/plugin.json +++ b/plugins/GCodeGzWriter/plugin.json @@ -1,7 +1,7 @@ { "name": "Compressed G-code Writer", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Writes g-code to a compressed archive.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/GCodeProfileReader/plugin.json b/plugins/GCodeProfileReader/plugin.json index 12d8a276da..af1c2d1827 100644 --- a/plugins/GCodeProfileReader/plugin.json +++ b/plugins/GCodeProfileReader/plugin.json @@ -1,7 +1,7 @@ { "name": "G-code Profile Reader", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides support for importing profiles from g-code files.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/GCodeReader/plugin.json b/plugins/GCodeReader/plugin.json index 351d6cbc31..bbc94fa917 100644 --- a/plugins/GCodeReader/plugin.json +++ b/plugins/GCodeReader/plugin.json @@ -1,7 +1,7 @@ { "name": "G-code Reader", "author": "Victor Larchenko, Ultimaker", - "version": "1.0.0", + "version": "1.0.1", "description": "Allows loading and displaying G-code files.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/GCodeWriter/plugin.json b/plugins/GCodeWriter/plugin.json index 78b63a582f..f3a95ddb78 100644 --- a/plugins/GCodeWriter/plugin.json +++ b/plugins/GCodeWriter/plugin.json @@ -1,7 +1,7 @@ { "name": "G-code Writer", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Writes g-code to a file.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/ImageReader/plugin.json b/plugins/ImageReader/plugin.json index 001da0822b..d966537d99 100644 --- a/plugins/ImageReader/plugin.json +++ b/plugins/ImageReader/plugin.json @@ -1,7 +1,7 @@ { "name": "Image Reader", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Enables ability to generate printable geometry from 2D image files.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/LegacyProfileReader/plugin.json b/plugins/LegacyProfileReader/plugin.json index 2cd1e9ca2c..2f5264ad37 100644 --- a/plugins/LegacyProfileReader/plugin.json +++ b/plugins/LegacyProfileReader/plugin.json @@ -1,7 +1,7 @@ { "name": "Legacy Cura Profile Reader", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides support for importing profiles from legacy Cura versions.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/MachineSettingsAction/plugin.json b/plugins/MachineSettingsAction/plugin.json index 4587729a9a..d734c1adf5 100644 --- a/plugins/MachineSettingsAction/plugin.json +++ b/plugins/MachineSettingsAction/plugin.json @@ -1,7 +1,7 @@ { "name": "Machine Settings action", "author": "fieldOfView", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides a way to change machine settings (such as build volume, nozzle size, etc.).", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/ModelChecker/plugin.json b/plugins/ModelChecker/plugin.json index a210c3bf9f..59be5bbf0a 100644 --- a/plugins/ModelChecker/plugin.json +++ b/plugins/ModelChecker/plugin.json @@ -1,7 +1,7 @@ { "name": "Model Checker", "author": "Ultimaker B.V.", - "version": "0.1", + "version": "1.0.1", "api": "6.0", "description": "Checks models and print configuration for possible printing issues and give suggestions.", "i18n-catalog": "cura" diff --git a/plugins/MonitorStage/plugin.json b/plugins/MonitorStage/plugin.json index 71fc10c5ce..95e4b86f36 100644 --- a/plugins/MonitorStage/plugin.json +++ b/plugins/MonitorStage/plugin.json @@ -1,7 +1,7 @@ { "name": "Monitor Stage", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides a monitor stage in Cura.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/PerObjectSettingsTool/plugin.json b/plugins/PerObjectSettingsTool/plugin.json index e5bdc5d3da..f272abf06a 100644 --- a/plugins/PerObjectSettingsTool/plugin.json +++ b/plugins/PerObjectSettingsTool/plugin.json @@ -1,7 +1,7 @@ { "name": "Per Model Settings Tool", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides the Per Model Settings.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/PostProcessingPlugin/plugin.json b/plugins/PostProcessingPlugin/plugin.json index ad60312af0..1e73133c53 100644 --- a/plugins/PostProcessingPlugin/plugin.json +++ b/plugins/PostProcessingPlugin/plugin.json @@ -1,7 +1,7 @@ { "name": "Post Processing", "author": "Ultimaker", - "version": "2.2", + "version": "2.2.1", "api": "6.0", "description": "Extension that allows for user created scripts for post processing", "catalog": "cura" diff --git a/plugins/PrepareStage/plugin.json b/plugins/PrepareStage/plugin.json index e948b96f6f..dc5c68ce16 100644 --- a/plugins/PrepareStage/plugin.json +++ b/plugins/PrepareStage/plugin.json @@ -1,7 +1,7 @@ { "name": "Prepare Stage", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides a prepare stage in Cura.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/PreviewStage/plugin.json b/plugins/PreviewStage/plugin.json index c9c13fe341..e1e4288bae 100644 --- a/plugins/PreviewStage/plugin.json +++ b/plugins/PreviewStage/plugin.json @@ -1,7 +1,7 @@ { "name": "Preview Stage", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides a preview stage in Cura.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/RemovableDriveOutputDevice/plugin.json b/plugins/RemovableDriveOutputDevice/plugin.json index 48cd60596c..5523d6b1c1 100644 --- a/plugins/RemovableDriveOutputDevice/plugin.json +++ b/plugins/RemovableDriveOutputDevice/plugin.json @@ -2,7 +2,7 @@ "name": "Removable Drive Output Device Plugin", "author": "Ultimaker B.V.", "description": "Provides removable drive hotplugging and writing support.", - "version": "1.0.0", + "version": "1.0.1", "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/SimulationView/plugin.json b/plugins/SimulationView/plugin.json index dcfbeb305e..3ccf91b9e6 100644 --- a/plugins/SimulationView/plugin.json +++ b/plugins/SimulationView/plugin.json @@ -1,7 +1,7 @@ { "name": "Simulation View", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides the Simulation view.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/SliceInfoPlugin/plugin.json b/plugins/SliceInfoPlugin/plugin.json index c2d78e8d78..8ff0e194fb 100644 --- a/plugins/SliceInfoPlugin/plugin.json +++ b/plugins/SliceInfoPlugin/plugin.json @@ -1,7 +1,7 @@ { "name": "Slice info", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Submits anonymous slice info. Can be disabled through preferences.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/SolidView/plugin.json b/plugins/SolidView/plugin.json index c66e41a7aa..b3f62221c5 100644 --- a/plugins/SolidView/plugin.json +++ b/plugins/SolidView/plugin.json @@ -1,7 +1,7 @@ { "name": "Solid View", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides a normal solid mesh view.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/SupportEraser/plugin.json b/plugins/SupportEraser/plugin.json index dc624ecd77..fa6d6d230e 100644 --- a/plugins/SupportEraser/plugin.json +++ b/plugins/SupportEraser/plugin.json @@ -1,7 +1,7 @@ { "name": "Support Eraser", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Creates an eraser mesh to block the printing of support in certain places", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/Toolbox/plugin.json b/plugins/Toolbox/plugin.json index 91e9561327..61dc0429f5 100644 --- a/plugins/Toolbox/plugin.json +++ b/plugins/Toolbox/plugin.json @@ -1,7 +1,7 @@ { "name": "Toolbox", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "api": "6.0", "description": "Find, manage and install new Cura packages." } diff --git a/plugins/UFPWriter/plugin.json b/plugins/UFPWriter/plugin.json index b4e05d9346..288d6acf77 100644 --- a/plugins/UFPWriter/plugin.json +++ b/plugins/UFPWriter/plugin.json @@ -1,7 +1,7 @@ { "name": "UFP Writer", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides support for writing Ultimaker Format Packages.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/UM3NetworkPrinting/plugin.json b/plugins/UM3NetworkPrinting/plugin.json index def02562db..088b4dae6a 100644 --- a/plugins/UM3NetworkPrinting/plugin.json +++ b/plugins/UM3NetworkPrinting/plugin.json @@ -2,7 +2,7 @@ "name": "UM3 Network Connection", "author": "Ultimaker B.V.", "description": "Manages network connections to Ultimaker 3 printers.", - "version": "1.0.0", + "version": "1.0.1", "api": "6.0", "i18n-catalog": "cura" } diff --git a/plugins/USBPrinting/plugin.json b/plugins/USBPrinting/plugin.json index 3a58abe7e7..45971d858b 100644 --- a/plugins/USBPrinting/plugin.json +++ b/plugins/USBPrinting/plugin.json @@ -1,7 +1,7 @@ { "name": "USB printing", "author": "Ultimaker B.V.", - "version": "1.0.1", + "version": "1.0.2", "api": "6.0", "description": "Accepts G-Code and sends them to a printer. Plugin can also update firmware.", "i18n-catalog": "cura" diff --git a/plugins/UltimakerMachineActions/plugin.json b/plugins/UltimakerMachineActions/plugin.json index fc1eb242fe..3e3e0af9b0 100644 --- a/plugins/UltimakerMachineActions/plugin.json +++ b/plugins/UltimakerMachineActions/plugin.json @@ -1,7 +1,7 @@ { "name": "Ultimaker machine actions", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides machine actions for Ultimaker machines (such as bed leveling wizard, selecting upgrades, etc.).", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/UserAgreement/plugin.json b/plugins/UserAgreement/plugin.json index 7781e383d6..b172d1f9a2 100644 --- a/plugins/UserAgreement/plugin.json +++ b/plugins/UserAgreement/plugin.json @@ -1,7 +1,7 @@ { "name": "UserAgreement", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Ask the user once if he/she agrees with our license.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json b/plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json index e732c43813..cad94c2eb5 100644 --- a/plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade21to22/plugin.json @@ -1,7 +1,7 @@ { "name": "Version Upgrade 2.1 to 2.2", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Upgrades configurations from Cura 2.1 to Cura 2.2.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json b/plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json index 2b344ce5d3..7da1e7a56d 100644 --- a/plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade22to24/plugin.json @@ -1,7 +1,7 @@ { "name": "Version Upgrade 2.2 to 2.4", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Upgrades configurations from Cura 2.2 to Cura 2.4.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json b/plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json index 8691ebfc67..e1f0a47685 100644 --- a/plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade25to26/plugin.json @@ -1,7 +1,7 @@ { "name": "Version Upgrade 2.5 to 2.6", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Upgrades configurations from Cura 2.5 to Cura 2.6.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json b/plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json index c7124eada6..6cdbd64cbb 100644 --- a/plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade26to27/plugin.json @@ -1,7 +1,7 @@ { "name": "Version Upgrade 2.6 to 2.7", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Upgrades configurations from Cura 2.6 to Cura 2.7.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json b/plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json index ce8f4a6d44..885d741a8c 100644 --- a/plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade27to30/plugin.json @@ -1,7 +1,7 @@ { "name": "Version Upgrade 2.7 to 3.0", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Upgrades configurations from Cura 2.7 to Cura 3.0.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json b/plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json index f94f3dfe30..d5f22649c1 100644 --- a/plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade30to31/plugin.json @@ -1,7 +1,7 @@ { "name": "Version Upgrade 3.0 to 3.1", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Upgrades configurations from Cura 3.0 to Cura 3.1.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json b/plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json index 0bbc237436..eb489169e0 100644 --- a/plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade32to33/plugin.json @@ -1,7 +1,7 @@ { "name": "Version Upgrade 3.2 to 3.3", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Upgrades configurations from Cura 3.2 to Cura 3.3.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json b/plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json index 5f83695245..9649010643 100644 --- a/plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade33to34/plugin.json @@ -1,7 +1,7 @@ { "name": "Version Upgrade 3.3 to 3.4", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Upgrades configurations from Cura 3.3 to Cura 3.4.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json b/plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json index f95cb7be87..02635ec606 100644 --- a/plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json +++ b/plugins/VersionUpgrade/VersionUpgrade34to35/plugin.json @@ -1,7 +1,7 @@ { "name": "Version Upgrade 3.4 to 3.5", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Upgrades configurations from Cura 3.4 to Cura 3.5.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/X3DReader/plugin.json b/plugins/X3DReader/plugin.json index 4052ac6605..1fc14104ed 100644 --- a/plugins/X3DReader/plugin.json +++ b/plugins/X3DReader/plugin.json @@ -1,7 +1,7 @@ { "name": "X3D Reader", "author": "Seva Alekseyev", - "version": "0.5.0", + "version": "1.0.1", "description": "Provides support for reading X3D files.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/XRayView/plugin.json b/plugins/XRayView/plugin.json index 4d8e42bae3..71cc165b6c 100644 --- a/plugins/XRayView/plugin.json +++ b/plugins/XRayView/plugin.json @@ -1,7 +1,7 @@ { "name": "X-Ray View", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides the X-Ray view.", "api": "6.0", "i18n-catalog": "cura" diff --git a/plugins/XmlMaterialProfile/plugin.json b/plugins/XmlMaterialProfile/plugin.json index d172d49f87..bb1db82fa4 100644 --- a/plugins/XmlMaterialProfile/plugin.json +++ b/plugins/XmlMaterialProfile/plugin.json @@ -1,7 +1,7 @@ { "name": "Material Profiles", "author": "Ultimaker B.V.", - "version": "1.0.0", + "version": "1.0.1", "description": "Provides capabilities to read and write XML-based material profiles.", "api": "6.0", "i18n-catalog": "cura" From cb6e4ff2d1a0f26ed8849c45cd97b0f15d8dab36 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 17 Dec 2018 14:05:28 +0100 Subject: [PATCH 189/199] Organize MonitorStage.qml better --- .../resources/qml/MonitorQueue.qml | 167 ++++++++++++++++++ .../resources/qml/MonitorStage.qml | 159 +---------------- 2 files changed, 169 insertions(+), 157 deletions(-) create mode 100644 plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml new file mode 100644 index 0000000000..884dbabc2f --- /dev/null +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorQueue.qml @@ -0,0 +1,167 @@ +// Copyright (c) 2018 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.2 +import QtQuick.Controls 1.4 +import QtQuick.Controls.Styles 1.4 +import UM 1.3 as UM +import Cura 1.0 as Cura + +/** + * This component contains the print job queue, extracted from the primary + * MonitorStage.qml file not for reusability but simply to keep it lean and more + * readable. + */ +Item +{ + Label + { + id: queuedLabel + anchors + { + left: queuedPrintJobs.left + top: parent.top + } + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("large_nonbold") + text: catalog.i18nc("@label", "Queued") + } + + Item + { + id: manageQueueLabel + anchors + { + right: queuedPrintJobs.right + verticalCenter: queuedLabel.verticalCenter + } + height: 18 * screenScaleFactor // TODO: Theme! + width: childrenRect.width + + UM.RecolorImage + { + id: externalLinkIcon + anchors.verticalCenter: manageQueueLabel.verticalCenter + color: UM.Theme.getColor("primary") + source: "../svg/icons/external_link.svg" + width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) + height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) + } + Label + { + id: manageQueueText + anchors + { + left: externalLinkIcon.right + leftMargin: 6 * screenScaleFactor // TODO: Theme! + verticalCenter: externalLinkIcon.verticalCenter + } + color: UM.Theme.getColor("primary") + font: UM.Theme.getFont("default") // 12pt, regular + linkColor: UM.Theme.getColor("primary") + text: catalog.i18nc("@label link to connect manager", "Manage queue in Cura Connect") + } + } + + MouseArea + { + anchors.fill: manageQueueLabel + hoverEnabled: true + onClicked: Cura.MachineManager.printerOutputDevices[0].openPrintJobControlPanel() + onEntered: + { + manageQueueText.font.underline = true + } + onExited: + { + manageQueueText.font.underline = false + } + } + + Row + { + id: printJobQueueHeadings + anchors + { + left: queuedPrintJobs.left + leftMargin: 6 * screenScaleFactor // TODO: Theme! + top: queuedLabel.bottom + topMargin: 24 * screenScaleFactor // TODO: Theme! + } + spacing: 18 * screenScaleFactor // TODO: Theme! + + Label + { + text: catalog.i18nc("@label", "Print jobs") + color: "#666666" + elide: Text.ElideRight + font: UM.Theme.getFont("medium") // 14pt, regular + anchors.verticalCenter: parent.verticalCenter + width: 284 * screenScaleFactor // TODO: Theme! (Should match column size) + + // FIXED-LINE-HEIGHT: + height: 18 * screenScaleFactor // TODO: Theme! + verticalAlignment: Text.AlignVCenter + } + + Label + { + text: catalog.i18nc("@label", "Total print time") + color: "#666666" + elide: Text.ElideRight + font: UM.Theme.getFont("medium") // 14pt, regular + anchors.verticalCenter: parent.verticalCenter + width: 216 * screenScaleFactor // TODO: Theme! (Should match column size) + + // FIXED-LINE-HEIGHT: + height: 18 * screenScaleFactor // TODO: Theme! + verticalAlignment: Text.AlignVCenter + } + + Label + { + text: catalog.i18nc("@label", "Waiting for") + color: "#666666" + elide: Text.ElideRight + font: UM.Theme.getFont("medium") // 14pt, regular + anchors.verticalCenter: parent.verticalCenter + width: 216 * screenScaleFactor // TODO: Theme! (Should match column size) + + // FIXED-LINE-HEIGHT: + height: 18 * screenScaleFactor // TODO: Theme! + verticalAlignment: Text.AlignVCenter + } + } + + ScrollView + { + id: queuedPrintJobs + anchors + { + bottom: parent.bottom + horizontalCenter: parent.horizontalCenter + top: printJobQueueHeadings.bottom + topMargin: 12 * screenScaleFactor // TODO: Theme! + } + style: UM.Theme.styles.scrollview + visible: OutputDevice.receivedPrintJobs + width: parent.width + + ListView + { + id: printJobList + anchors.fill: parent + delegate: MonitorPrintJobCard + { + anchors + { + left: parent.left + right: parent.right + } + printJob: modelData + } + model: OutputDevice.queuedPrintJobs + spacing: 6 // TODO: Theme! + } + } +} \ No newline at end of file diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml index 98ca715108..0333e1447c 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorStage.qml @@ -8,16 +8,13 @@ import UM 1.3 as UM import Cura 1.0 as Cura import QtGraphicalEffects 1.0 -// Root component for the monitor tab (stage) +// This is the root component for the monitor stage. Component { Item { id: monitorFrame - property var emphasisColor: UM.Theme.getColor("setting_control_border_highlight") - property var cornerRadius: UM.Theme.getSize("monitor_corner_radius").width - height: maximumHeight onVisibleChanged: { @@ -80,11 +77,10 @@ Component } } - Item + MonitorQueue { id: queue width: Math.min(834 * screenScaleFactor, maximumWidth) - anchors { bottom: parent.bottom @@ -92,157 +88,6 @@ Component top: printers.bottom topMargin: 48 * screenScaleFactor // TODO: Theme! } - - Label - { - id: queuedLabel - anchors - { - left: queuedPrintJobs.left - top: parent.top - } - color: UM.Theme.getColor("text") - font: UM.Theme.getFont("large_nonbold") - text: catalog.i18nc("@label", "Queued") - } - - Item - { - id: manageQueueLabel - anchors - { - right: queuedPrintJobs.right - verticalCenter: queuedLabel.verticalCenter - } - height: 18 * screenScaleFactor // TODO: Theme! - width: childrenRect.width - - UM.RecolorImage - { - id: externalLinkIcon - anchors.verticalCenter: manageQueueLabel.verticalCenter - color: UM.Theme.getColor("primary") - source: "../svg/icons/external_link.svg" - width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) - height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!) - } - Label - { - id: manageQueueText - anchors - { - left: externalLinkIcon.right - leftMargin: 6 * screenScaleFactor // TODO: Theme! - verticalCenter: externalLinkIcon.verticalCenter - } - color: UM.Theme.getColor("primary") - font: UM.Theme.getFont("default") // 12pt, regular - linkColor: UM.Theme.getColor("primary") - text: catalog.i18nc("@label link to connect manager", "Manage queue in Cura Connect") - } - } - - MouseArea - { - anchors.fill: manageQueueLabel - hoverEnabled: true - onClicked: Cura.MachineManager.printerOutputDevices[0].openPrintJobControlPanel() - onEntered: - { - manageQueueText.font.underline = true - } - onExited: - { - manageQueueText.font.underline = false - } - } - - Row - { - id: printJobQueueHeadings - anchors - { - left: queuedPrintJobs.left - leftMargin: 6 * screenScaleFactor // TODO: Theme! - top: queuedLabel.bottom - topMargin: 24 * screenScaleFactor // TODO: Theme! - } - spacing: 18 * screenScaleFactor // TODO: Theme! - - Label - { - text: catalog.i18nc("@label", "Print jobs") - color: "#666666" - elide: Text.ElideRight - font: UM.Theme.getFont("medium") // 14pt, regular - anchors.verticalCenter: parent.verticalCenter - width: 284 * screenScaleFactor // TODO: Theme! (Should match column size) - - // FIXED-LINE-HEIGHT: - height: 18 * screenScaleFactor // TODO: Theme! - verticalAlignment: Text.AlignVCenter - } - - Label - { - text: catalog.i18nc("@label", "Total print time") - color: "#666666" - elide: Text.ElideRight - font: UM.Theme.getFont("medium") // 14pt, regular - anchors.verticalCenter: parent.verticalCenter - width: 216 * screenScaleFactor // TODO: Theme! (Should match column size) - - // FIXED-LINE-HEIGHT: - height: 18 * screenScaleFactor // TODO: Theme! - verticalAlignment: Text.AlignVCenter - } - - Label - { - text: catalog.i18nc("@label", "Waiting for") - color: "#666666" - elide: Text.ElideRight - font: UM.Theme.getFont("medium") // 14pt, regular - anchors.verticalCenter: parent.verticalCenter - width: 216 * screenScaleFactor // TODO: Theme! (Should match column size) - - // FIXED-LINE-HEIGHT: - height: 18 * screenScaleFactor // TODO: Theme! - verticalAlignment: Text.AlignVCenter - } - } - - ScrollView - { - id: queuedPrintJobs - anchors - { - bottom: parent.bottom - horizontalCenter: parent.horizontalCenter - top: printJobQueueHeadings.bottom - topMargin: 12 * screenScaleFactor // TODO: Theme! - } - style: UM.Theme.styles.scrollview - visible: OutputDevice.receivedPrintJobs - width: parent.width - - ListView - { - id: printJobList - anchors.fill: parent - delegate: MonitorPrintJobCard - { - anchors - { - left: parent.left - right: parent.right - } - printJob: modelData - } - model: OutputDevice.queuedPrintJobs - spacing: 6 - } - } } PrinterVideoStream From 53da111617d9363784e3363659653496ebd4c734 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 17 Dec 2018 15:21:48 +0100 Subject: [PATCH 190/199] Change "Rating" to "Your rating" --- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 92b9fb1198..b9b36cd878 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -88,7 +88,7 @@ Item height: childrenRect.height Label { - text: catalog.i18nc("@label", "Rating") + ":" + text: catalog.i18nc("@label", "Your rating") + ":" font: UM.Theme.getFont("default") color: UM.Theme.getColor("text_medium") renderType: Text.NativeRendering From 135219365423e588303c5bf30e6e94c851bfd4cd Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 17 Dec 2018 15:26:10 +0100 Subject: [PATCH 191/199] Ensure that the sourceSize is set correctly --- plugins/Toolbox/resources/qml/RatingWidget.qml | 2 ++ plugins/Toolbox/resources/qml/SmallRatingWidget.qml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/Toolbox/resources/qml/RatingWidget.qml b/plugins/Toolbox/resources/qml/RatingWidget.qml index 3dcae6d602..441cf238f7 100644 --- a/plugins/Toolbox/resources/qml/RatingWidget.qml +++ b/plugins/Toolbox/resources/qml/RatingWidget.qml @@ -75,6 +75,8 @@ Item background: UM.RecolorImage { source: UM.Theme.getIcon(control.isStarFilled ? "star_filled" : "star_empty") + sourceSize.width: width + sourceSize.height: height // Unfilled stars should always have the default color. Only filled stars should change on hover color: diff --git a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml index 686058f4e8..4950ea9242 100644 --- a/plugins/Toolbox/resources/qml/SmallRatingWidget.qml +++ b/plugins/Toolbox/resources/qml/SmallRatingWidget.qml @@ -17,6 +17,8 @@ Row color: model.user_rating == 0 ? UM.Theme.getColor("rating_star") : UM.Theme.getColor("primary") height: UM.Theme.getSize("rating_star").height width: UM.Theme.getSize("rating_star").width + sourceSize.height: height + sourceSize.width: width } Label From 5c697ab5bed61ad4169db31ac676cdd2f056d9c8 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 17 Dec 2018 16:58:51 +0100 Subject: [PATCH 192/199] Make hints clickable Contributes to CL-1151 --- .../resources/qml/MonitorCarousel.qml | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml index ea1449ac8d..476e3c2aa1 100644 --- a/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml +++ b/plugins/UM3NetworkPrinting/resources/qml/MonitorCarousel.qml @@ -25,7 +25,7 @@ Item anchors { right: leftButton.left - rightMargin: 12 * screenScaleFactor + rightMargin: 12 * screenScaleFactor // TODO: Theme! left: parent.left } height: parent.height @@ -40,15 +40,20 @@ Item GradientStop { position: 0.0 - color: "#fff6f6f6" + color: "#fff6f6f6" // TODO: Theme! } GradientStop { position: 1.0 - color: "#66f6f6f6" + color: "#66f6f6f6" // TODO: Theme! } } } + MouseArea + { + anchors.fill: parent + onClicked: navigateTo(currentIndex - 1) + } } Button @@ -58,7 +63,7 @@ Item { verticalCenter: parent.verticalCenter right: centerSection.left - rightMargin: 12 * screenScaleFactor + rightMargin: 12 * screenScaleFactor // TODO: Theme! } width: 36 * screenScaleFactor // TODO: Theme! height: 72 * screenScaleFactor // TODO: Theme! @@ -79,10 +84,10 @@ Item UM.RecolorImage { anchors.centerIn: parent - width: 18 - height: width - sourceSize.width: width - sourceSize.height: width + width: 18 // TODO: Theme! + height: width // TODO: Theme! + sourceSize.width: width // TODO: Theme! + sourceSize.height: width // TODO: Theme! color: "#152950" // TODO: Theme! source: UM.Theme.getIcon("arrow_left") } @@ -105,7 +110,7 @@ Item { id: tiles height: childrenRect.height - width: 5 * tileWidth + 4 * tileSpacing + width: 5 * tileWidth + 4 * tileSpacing // TODO: Theme! x: 0 z: 0 Behavior on x @@ -137,7 +142,7 @@ Item { verticalCenter: parent.verticalCenter left: centerSection.right - leftMargin: 12 * screenScaleFactor + leftMargin: 12 * screenScaleFactor // TODO: Theme! } width: 36 * screenScaleFactor // TODO: Theme! height: 72 * screenScaleFactor // TODO: Theme! @@ -158,10 +163,10 @@ Item UM.RecolorImage { anchors.centerIn: parent - width: 18 - height: width - sourceSize.width: width - sourceSize.height: width + width: 18 // TODO: Theme! + height: width // TODO: Theme! + sourceSize.width: width // TODO: Theme! + sourceSize.height: width // TODO: Theme! color: "#152950" // TODO: Theme! source: UM.Theme.getIcon("arrow_right") } @@ -174,7 +179,7 @@ Item anchors { left: rightButton.right - leftMargin: 12 * screenScaleFactor + leftMargin: 12 * screenScaleFactor // TODO: Theme! right: parent.right } height: centerSection.height @@ -190,15 +195,20 @@ Item GradientStop { position: 0.0 - color: "#66f6f6f6" + color: "#66f6f6f6" // TODO: Theme! } GradientStop { position: 1.0 - color: "#fff6f6f6" + color: "#fff6f6f6" // TODO: Theme! } } } + MouseArea + { + anchors.fill: parent + onClicked: navigateTo(currentIndex + 1) + } } Item @@ -223,7 +233,7 @@ Item color: model.index == currentIndex ? "#777777" : "#d8d8d8" // TODO: Theme! radius: Math.floor(width / 2) width: 12 * screenScaleFactor // TODO: Theme! - height: width + height: width // TODO: Theme! } onClicked: navigateTo(model.index) } From d6212d5a398d19bf72d9a718b316270629dcef52 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 17 Dec 2018 17:29:24 +0100 Subject: [PATCH 193/199] Add elide in the showcase title and reduce the height a bit so there are only 2 lines for the title. --- plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml | 1 + resources/themes/cura-light/theme.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index bb4f34163d..c8c1e56c82 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -47,6 +47,7 @@ Rectangle height: UM.Theme.getSize("toolbox_heading_label").height width: parent.width - UM.Theme.getSize("default_margin").width wrapMode: Text.WordWrap + elide: Text.ElideRight font: UM.Theme.getFont("medium_bold") } UM.RecolorImage diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index ea6c92b479..83a51e5431 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -495,7 +495,7 @@ "toolbox_back_button": [4.0, 2.0], "toolbox_installed_tile": [1.0, 8.0], "toolbox_property_label": [1.0, 2.0], - "toolbox_heading_label": [1.0, 4.0], + "toolbox_heading_label": [1.0, 3.8], "toolbox_header": [1.0, 4.0], "toolbox_header_highlight": [0.25, 0.25], "toolbox_progress_bar": [8.0, 0.5], From 0e294481ff9e2ffa4e2dbe24dda5b527a74a0fcc Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 17 Dec 2018 17:32:11 +0100 Subject: [PATCH 194/199] Improve readability of printer_type_label for dark theme --- resources/themes/cura-dark/theme.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index cade342488..537fccbc5c 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -40,6 +40,8 @@ "text_scene": [255, 255, 255, 162], "text_scene_hover": [255, 255, 255, 204], + "printer_type_label_background": [95, 95, 95, 255], + "error": [212, 31, 53, 255], "disabled": [32, 32, 32, 255], From 3f7c9227340a57f1d031910a34ff6e23221c9fb8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 17 Dec 2018 17:37:12 +0100 Subject: [PATCH 195/199] Add missing type for g-code reader --- plugins/GCodeReader/FlavorParser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/GCodeReader/FlavorParser.py b/plugins/GCodeReader/FlavorParser.py index 6fe2cb5260..baf21d47ce 100644 --- a/plugins/GCodeReader/FlavorParser.py +++ b/plugins/GCodeReader/FlavorParser.py @@ -364,6 +364,8 @@ class FlavorParser: self._layer_type = LayerPolygon.SupportType elif type == "FILL": self._layer_type = LayerPolygon.InfillType + elif type == "SUPPORT-INTERFACE": + self._layer_type = LayerPolygon.SupportInterfaceType else: Logger.log("w", "Encountered a unknown type (%s) while parsing g-code.", type) From d395c38436712979639747c202741f788dbd388d Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 17 Dec 2018 17:47:33 +0100 Subject: [PATCH 196/199] Removed collapse / expand all I don't think it ever worked. --- resources/qml/Settings/SettingView.qml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index c1b4b28d1d..972cbcdbb1 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -558,17 +558,6 @@ Item onTriggered: Cura.Actions.configureSettingVisibility.trigger(contextMenu); } - MenuSeparator {} - MenuItem - { - text: catalog.i18nc("@action:inmenu", "Collapse All") - onTriggered: definitionsModel.collapseAll() - } - MenuItem - { - text: catalog.i18nc("@action:inmenu", "Expand All") - onTriggered: definitionsModel.expandRecursive() - } } UM.SettingPropertyProvider From 62d20ac773b617e1ed0fe0a43ce05913ca59b789 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Mon, 17 Dec 2018 17:55:40 +0100 Subject: [PATCH 197/199] Change the base color of the tooltips to align with the designs Contributes to CURA-6004. --- resources/themes/cura-light/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 83a51e5431..2b9ce3d218 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -229,7 +229,7 @@ "checkbox_disabled": [223, 223, 223, 255], "checkbox_text": [35, 35, 35, 255], - "tooltip": [68, 192, 255, 255], + "tooltip": [25, 25, 25, 255], "tooltip_text": [255, 255, 255, 255], "message_background": [255, 255, 255, 255], From 6017c2b4d2cd52110856e3cb835638a40458a6b6 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 18 Dec 2018 08:55:55 +0100 Subject: [PATCH 198/199] Replace isProfileUserCreated with hasCustomQuality CURA-6028 --- cura/Settings/MachineManager.py | 4 +++ cura/Settings/SimpleModeSettingsManager.py | 32 ------------------- .../RecommendedQualityProfileSelector.qml | 23 ++++--------- 3 files changed, 10 insertions(+), 49 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index e26b82e487..5e0bbea1ee 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -1529,6 +1529,10 @@ class MachineManager(QObject): def activeQualityChangesGroup(self) -> Optional["QualityChangesGroup"]: return self._current_quality_changes_group + @pyqtProperty(bool, notify = activeQualityChangesGroupChanged) + def hasCustomQuality(self) -> bool: + return self._current_quality_changes_group is not None + @pyqtProperty(str, notify = activeQualityGroupChanged) def activeQualityOrQualityChangesName(self) -> str: name = empty_quality_container.getName() diff --git a/cura/Settings/SimpleModeSettingsManager.py b/cura/Settings/SimpleModeSettingsManager.py index b22aea15ea..b1896a9205 100644 --- a/cura/Settings/SimpleModeSettingsManager.py +++ b/cura/Settings/SimpleModeSettingsManager.py @@ -17,15 +17,11 @@ class SimpleModeSettingsManager(QObject): self._is_profile_user_created = False # True when profile was custom created by user self._machine_manager.activeStackValueChanged.connect(self._updateIsProfileCustomized) - self._machine_manager.activeQualityGroupChanged.connect(self.updateIsProfileUserCreated) - self._machine_manager.activeQualityChangesGroupChanged.connect(self.updateIsProfileUserCreated) # update on create as the activeQualityChanged signal is emitted before this manager is created when Cura starts self._updateIsProfileCustomized() - self.updateIsProfileUserCreated() isProfileCustomizedChanged = pyqtSignal() - isProfileUserCreatedChanged = pyqtSignal() @pyqtProperty(bool, notify = isProfileCustomizedChanged) def isProfileCustomized(self): @@ -58,34 +54,6 @@ class SimpleModeSettingsManager(QObject): self._is_profile_customized = has_customized_user_settings self.isProfileCustomizedChanged.emit() - @pyqtProperty(bool, notify = isProfileUserCreatedChanged) - def isProfileUserCreated(self): - return self._is_profile_user_created - - @pyqtSlot() - def updateIsProfileUserCreated(self) -> None: - quality_changes_keys = set() # type: Set[str] - - if not self._machine_manager.activeMachine: - return - - global_stack = self._machine_manager.activeMachine - - # check quality changes settings in the global stack - quality_changes_keys.update(global_stack.qualityChanges.getAllKeys()) - - # check quality changes settings in the extruder stacks - if global_stack.extruders: - for extruder_stack in global_stack.extruders.values(): - quality_changes_keys.update(extruder_stack.qualityChanges.getAllKeys()) - - # check if the qualityChanges container is not empty (meaning it is a user created profile) - has_quality_changes = len(quality_changes_keys) > 0 - - if has_quality_changes != self._is_profile_user_created: - self._is_profile_user_created = has_quality_changes - self.isProfileUserCreatedChanged.emit() - # These are the settings included in the Simple ("Recommended") Mode, so only when the other settings have been # changed, we consider it as a user customized profile in the Simple ("Recommended") Mode. __ignored_custom_setting_keys = ["support_enable", diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml index e6b3f1b9eb..1e71134404 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml @@ -39,17 +39,6 @@ Item { target: Cura.QualityProfilesDropDownMenuModel onItemsChanged: qualityModel.update() - onDataChanged: - { - // If a custom profile is selected and then a user decides to change any of setting the slider should show - // the reset button. After clicking the reset button the QualityProfilesDropDownMenuModel(ListModel) is - // updated before the property isProfileCustomized is called to update. - if (Cura.SimpleModeSettingsManager.isProfileCustomized) - { - Cura.SimpleModeSettingsManager.updateIsProfileUserCreated() - } - qualityModel.update() - } } Connections { @@ -97,7 +86,7 @@ Item if (Cura.MachineManager.activeQualityType == qualityItem.quality_type) { // set to -1 when switching to user created profile so all ticks are clickable - if (Cura.SimpleModeSettingsManager.isProfileUserCreated) + if (Cura.MachineManager.hasCustomQuality) { qualityModel.qualitySliderActiveIndex = -1 } @@ -192,7 +181,7 @@ Item { id: customisedSettings - visible: Cura.SimpleModeSettingsManager.isProfileCustomized || Cura.SimpleModeSettingsManager.isProfileUserCreated + visible: Cura.SimpleModeSettingsManager.isProfileCustomized || Cura.MachineManager.hasCustomQuality height: visible ? UM.Theme.getSize("print_setup_icon").height : 0 width: height anchors @@ -358,7 +347,7 @@ Item { anchors.fill: parent hoverEnabled: true - enabled: !Cura.SimpleModeSettingsManager.isProfileUserCreated + enabled: !Cura.MachineManager.hasCustomQuality onEntered: { var tooltipContent = catalog.i18nc("@tooltip", "This quality profile is not available for your current material and nozzle configuration. Please change these to enable this quality profile") @@ -417,7 +406,7 @@ Item implicitWidth: UM.Theme.getSize("print_setup_slider_handle").width implicitHeight: implicitWidth radius: Math.round(implicitWidth / 2) - visible: !Cura.SimpleModeSettingsManager.isProfileCustomized && !Cura.SimpleModeSettingsManager.isProfileUserCreated && qualityModel.existingQualityProfile + visible: !Cura.SimpleModeSettingsManager.isProfileCustomized && !Cura.MachineManager.hasCustomQuality && qualityModel.existingQualityProfile } } @@ -441,7 +430,7 @@ Item anchors.fill: parent hoverEnabled: true acceptedButtons: Qt.NoButton - enabled: !Cura.SimpleModeSettingsManager.isProfileUserCreated + enabled: !Cura.MachineManager.hasCustomQuality } } @@ -451,7 +440,7 @@ Item { anchors.fill: parent hoverEnabled: true - visible: Cura.SimpleModeSettingsManager.isProfileUserCreated + visible: Cura.MachineManager.hasCustomQuality onEntered: { From cc462ef3a609be1df9ee0fb9d94ce4a541db2183 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 18 Dec 2018 10:29:44 +0100 Subject: [PATCH 199/199] Add a placeholder for a pattern in the header, if the theme wants to add one. --- resources/qml/Cura.qml | 11 + .../cura-light/images/header_pattern.svg | 1901 ----------------- 2 files changed, 11 insertions(+), 1901 deletions(-) delete mode 100644 resources/themes/cura-light/images/header_pattern.svg diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 8ab943b93b..8a34c7e219 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -123,6 +123,17 @@ UM.MainWindow } } } + + // This is a placehoder for adding a pattern in the header + Image + { + id: backgroundPattern + anchors.fill: parent + fillMode: Image.Tile + source: UM.Theme.getImage("header_pattern") + horizontalAlignment: Image.AlignLeft + verticalAlignment: Image.AlignTop + } } MainWindowHeader diff --git a/resources/themes/cura-light/images/header_pattern.svg b/resources/themes/cura-light/images/header_pattern.svg deleted file mode 100644 index eff5f01cfa..0000000000 --- a/resources/themes/cura-light/images/header_pattern.svg +++ /dev/null @@ -1,1901 +0,0 @@ - - - - Desktop HD - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file