Browse Source

Merge branch 'replace_controls_1_for_controls_2' into CURA-8685-replace_text_and_progress_bars

# Conflicts:
#	plugins/PerObjectSettingsTool/PerObjectItem.qml
#	plugins/PerObjectSettingsTool/SettingPickDialog.qml
casper 3 years ago
parent
commit
5a2e26eff6

+ 3 - 2
cura/BuildVolume.py

@@ -72,7 +72,7 @@ class BuildVolume(SceneNode):
 
         self._origin_mesh = None  # type: Optional[MeshData]
         self._origin_line_length = 20
-        self._origin_line_width = 1.5
+        self._origin_line_width = 1
         self._enabled = False
 
         self._grid_mesh = None   # type: Optional[MeshData]
@@ -601,6 +601,7 @@ class BuildVolume(SceneNode):
         if self._adhesion_type == "raft":
             self._raft_thickness = (
                 self._global_container_stack.getProperty("raft_base_thickness", "value") +
+                self._global_container_stack.getProperty("raft_interface_layers", "value") *
                 self._global_container_stack.getProperty("raft_interface_thickness", "value") +
                 self._global_container_stack.getProperty("raft_surface_layers", "value") *
                 self._global_container_stack.getProperty("raft_surface_thickness", "value") +
@@ -1214,7 +1215,7 @@ class BuildVolume(SceneNode):
 
     _machine_settings = ["machine_width", "machine_depth", "machine_height", "machine_shape", "machine_center_is_zero"]
     _skirt_settings = ["adhesion_type", "skirt_gap", "skirt_line_count", "skirt_brim_line_width", "brim_width", "brim_line_count", "raft_margin", "draft_shield_enabled", "draft_shield_dist", "initial_layer_line_width_factor"]
-    _raft_settings = ["adhesion_type", "raft_base_thickness", "raft_interface_thickness", "raft_surface_layers", "raft_surface_thickness", "raft_airgap", "layer_0_z_overlap"]
+    _raft_settings = ["adhesion_type", "raft_base_thickness", "raft_interface_layers", "raft_interface_thickness", "raft_surface_layers", "raft_surface_thickness", "raft_airgap", "layer_0_z_overlap"]
     _extra_z_settings = ["retraction_hop_enabled", "retraction_hop"]
     _prime_settings = ["extruder_prime_pos_x", "extruder_prime_pos_y", "prime_blob_enable"]
     _tower_settings = ["prime_tower_enable", "prime_tower_size", "prime_tower_position_x", "prime_tower_position_y", "prime_tower_brim_enable"]

+ 5 - 1
cura/CuraApplication.py

@@ -494,7 +494,7 @@ class CuraApplication(QtApplication):
             "CuraEngineBackend", #Cura is useless without this one since you can't slice.
             "FileLogger", #You want to be able to read the log if something goes wrong.
             "XmlMaterialProfile", #Cura crashes without this one.
-            "Toolbox", #This contains the interface to enable/disable plug-ins, so if you disable it you can't enable it back.
+            "Marketplace", #This contains the interface to enable/disable plug-ins, so if you disable it you can't enable it back.
             "PrepareStage", #Cura is useless without this one since you can't load models.
             "PreviewStage", #This shows the list of the plugin views that are installed in Cura.
             "MonitorStage", #Major part of Cura's functionality.
@@ -573,6 +573,10 @@ class CuraApplication(QtApplication):
 
         preferences.addPreference("general/accepted_user_agreement", False)
 
+        preferences.addPreference("cura/market_place_show_plugin_banner", True)
+        preferences.addPreference("cura/market_place_show_material_banner", True)
+        preferences.addPreference("cura/market_place_show_manage_packages_banner", True)
+
         for key in [
             "dialog_load_path",  # dialog_save_path is in LocalFileOutputDevicePlugin
             "dialog_profile_path",

+ 40 - 4
cura/CuraPackageManager.py

@@ -1,13 +1,15 @@
 # Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
-from typing import List, Tuple, TYPE_CHECKING, Optional
+from typing import Any, cast, Dict, List, Set, Tuple, TYPE_CHECKING, Optional
 
-from cura.CuraApplication import CuraApplication #To find some resource types.
+from cura.CuraApplication import CuraApplication  # To find some resource types.
 from cura.Settings.GlobalStack import GlobalStack
 
-from UM.PackageManager import PackageManager #The class we're extending.
-from UM.Resources import Resources #To find storage paths for some resource types.
+from UM.PackageManager import PackageManager  # The class we're extending.
+from UM.Resources import Resources  # To find storage paths for some resource types.
+from UM.i18n import i18nCatalog
+catalog = i18nCatalog("cura")
 
 if TYPE_CHECKING:
     from UM.Qt.QtApplication import QtApplication
@@ -17,6 +19,31 @@ if TYPE_CHECKING:
 class CuraPackageManager(PackageManager):
     def __init__(self, application: "QtApplication", parent: Optional["QObject"] = None) -> None:
         super().__init__(application, parent)
+        self._local_packages: Optional[List[Dict[str, Any]]] = None
+        self._local_packages_ids: Optional[Set[str]] = None
+        self.installedPackagesChanged.connect(self._updateLocalPackages)
+
+    def _updateLocalPackages(self) -> None:
+        self._local_packages = self.getAllLocalPackages()
+        self._local_packages_ids = set(pkg["package_id"] for pkg in self._local_packages)
+
+    @property
+    def local_packages(self) -> List[Dict[str, Any]]:
+        """locally installed packages, lazy execution"""
+        if self._local_packages is None:
+            self._updateLocalPackages()
+            # _updateLocalPackages always results in a list of packages, not None.
+            # It's guaranteed to be a list now.
+        return cast(List[Dict[str, Any]], self._local_packages)
+
+    @property
+    def local_packages_ids(self) -> Set[str]:
+        """locally installed packages, lazy execution"""
+        if self._local_packages_ids is None:
+            self._updateLocalPackages()
+            # _updateLocalPackages always results in a list of packages, not None.
+            # It's guaranteed to be a list now.
+        return cast(Set[str], self._local_packages_ids)
 
     def initialize(self) -> None:
         self._installation_dirs_dict["materials"] = Resources.getStoragePath(CuraApplication.ResourceTypes.MaterialInstanceContainer)
@@ -47,3 +74,12 @@ class CuraPackageManager(PackageManager):
                         machine_with_qualities.append((global_stack, str(extruder_nr), container_id))
 
         return machine_with_materials, machine_with_qualities
+
+    def getAllLocalPackages(self) -> List[Dict[str, Any]]:
+        """ Returns an unordered list of all the package_info of installed, to be installed, or bundled packages"""
+        packages: List[Dict[str, Any]] = []
+
+        for packages_to_add in self.getAllInstalledPackagesInfo().values():
+            packages.extend(packages_to_add)
+
+        return packages

+ 2 - 1
cura/Settings/ExtruderManager.py

@@ -268,7 +268,8 @@ class ExtruderManager(QObject):
             used_adhesion_extruders.add("skirt_brim_extruder_nr")  # There's a brim or prime tower brim.
         if adhesion_type == "raft":
             used_adhesion_extruders.add("raft_base_extruder_nr")
-            used_adhesion_extruders.add("raft_interface_extruder_nr")
+            if global_stack.getProperty("raft_interface_layers", "value") > 0:
+                used_adhesion_extruders.add("raft_interface_extruder_nr")
             if global_stack.getProperty("raft_surface_layers", "value") > 0:
                 used_adhesion_extruders.add("raft_surface_extruder_nr")
         for extruder_setting in used_adhesion_extruders:

+ 2 - 2
docker/build.sh

@@ -7,9 +7,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 PROJECT_DIR="$( cd "${SCRIPT_DIR}/.." && pwd )"
 
 # Make sure that environment variables are set properly
-source /opt/rh/devtoolset-8/enable
 export PATH="${CURA_BUILD_ENV_PATH}/bin:${PATH}"
 export PKG_CONFIG_PATH="${CURA_BUILD_ENV_PATH}/lib/pkgconfig:${PKG_CONFIG_PATH}"
+export LD_LIBRARY_PATH="${CURA_BUILD_ENV_PATH}/lib:${LD_LIBRARY_PATH}"
 
 cd "${PROJECT_DIR}"
 
@@ -60,7 +60,7 @@ export PYTHONPATH="${PROJECT_DIR}/Uranium:.:${PYTHONPATH}"
 
 mkdir build
 cd build
-cmake3 \
+cmake \
     -DCMAKE_BUILD_TYPE=Debug \
     -DCMAKE_PREFIX_PATH="${CURA_BUILD_ENV_PATH}" \
     -DURANIUM_DIR="${PROJECT_DIR}/Uranium" \

+ 1 - 1
docker/test.sh

@@ -1,3 +1,3 @@
 #!/usr/bin/env bash
 cd build
-ctest3 -j4 --output-on-failure -T Test
+ctest -j4 --output-on-failure -T Test

BIN
docs/resources/PerObjectStack.png


BIN
icons/cura-128.png


BIN
icons/cura-32.png


BIN
icons/cura-48.png


Some files were not shown because too many files changed in this diff