Browse Source

Merge remote-tracking branch 'origin/master' into CURA-7180_keyring_storage

Jelle Spijker 4 years ago
parent
commit
720b356221

+ 0 - 49
.github/ISSUE_TEMPLATE/bug-report.md

@@ -1,49 +0,0 @@
----
-name: Bug report
-about: Create a report to help us fix issues.
-title: ''
-labels: 'Type: Bug'
-assignees: ''
-
----
-
-<!--
-Processing an issue will go much faster when this is filled out, and issues which do not use this template WILL BE REMOVED and no fix will be considered!
-
-Before filing, PLEASE check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment.
-
-Also, please note the application version in the title of the issue. For example: "[3.2.1] Cannot connect to 3rd-party printer". Please do NOT write things like "Request:" or "[BUG]" in the title; this is what labels are for.
-
-Thank you for using Cura!
--->
-
-**Application version**
-(The version of the application this issue occurs with.)
-
-**Platform**
-(Information about the operating system the issue occurs on. Include at least the operating system and maybe GPU.)
-
-**Printer**
-(Which printer was selected in Cura?)
-
-**Reproduction steps**
-1. (Something you did.)
-2. (Something you did next.)
-
-**Screenshot(s)**
-(Image showing the problem, perhaps before/after images.) 
-
-**Actual results**
-(What happens after the above steps have been followed.)
-
-**Expected results**
-(What should happen after the above steps have been followed.)
-
-**Project file**
-(For slicing bugs, provide a project which clearly shows the bug, by going to File->Save Project. For big files you may need to use WeTransfer or similar file sharing sites. G-code files are not project files!)
-
-**Log file**
-(See https://github.com/Ultimaker/Cura#logging-issues to find the log file to upload, or copy a relevant snippet from it.)
-
-**Additional information**
-(Extra information relevant to the issue.)

+ 68 - 0
.github/ISSUE_TEMPLATE/bugreport.yaml

@@ -0,0 +1,68 @@
+name: Bug Report
+description: Create a report to help us fix issues.
+labels: "Type: Bug"
+issue_body: true
+body:
+- type: markdown
+  attributes:
+    value: |
+      **Thank you for using Cura and wanting to report a bug.**
+      
+      Before filing, please check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment. 
+      
+      Also, please note the application version in the title of the issue "For example (3.2.1) Cannot connect to 3rd-party printer". Please do not write things like **Request** or **BUG** in the title, this is what labels are for.
+- type: input
+  attributes:
+    label: Application Version
+    description: The version of Cura this issue occurs with.
+    placeholder: 4.8.0
+  validations:
+    required: true
+- type: input
+  attributes:
+    label: Platform
+    description: Information about the operating system the issue occurs on. Include at least the operating system and maybe GPU.
+    placeholder: Windows 10
+  validations:
+    required: true
+- type: input
+  attributes:
+    label: Printer
+    description: Which printer was selected in Cura?
+    placeholder: Ultimaker S5    
+  validations:
+    required: true
+- type: textarea
+  attributes:
+    label: Reproduction steps
+    description: Tell us what you did!
+    placeholder: |
+      1. Something you did
+      2. Something you did next
+  validations:
+    required: true
+- type: textarea
+  attributes:
+    label: Actual results
+    description: What happens after the above steps have been followed.
+  validations:
+    required: true
+- type: textarea
+  attributes:
+    label: Expected results
+    description: What should happen after the above steps have been followed.
+  validations:
+    required: true
+- type: markdown
+  attributes:
+    value: |
+      ## Additional information & file uploads
+      
+      Please be sure to add the following files:
+        * For slicing issues, upload a **project file** that clearly shows the bug. 
+          To save a project file go to `File -> Save project`. Please make sure to .zip your project file. For big files you may need to use WeTransfer or similar file sharing sites. 
+          G-code files are not project files!
+        * **Screenshots** of showing the problem, perhaps before/after images.
+        * A **log file**, see [here](https://github.com/Ultimaker/Cura#logging-issues) how to find the log file. 
+      
+      You can add these files and additional information that is relevant to the issue in the comments below. 

+ 0 - 23
.github/ISSUE_TEMPLATE/feature_request.md

@@ -1,23 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: 'Type: New Feature'
-assignees: ''
-
----
-
-**Is your feature request related to a problem? Please describe.**
-(A clear and concise description of what the problem is. Ex. I'm always frustrated when [...])
-
-**Describe the solution you'd like**
-(A clear and concise description of what you want to happen. If possible, describe why you think this is a good solution.)
-
-**Describe alternatives you've considered**
-(A clear and concise description of any alternative solutions or features you've considered. Again, if possible, think about why these alternatives are not working out.)
-
-**Affected users and/or printers**
-(Who do you think will benefit from this? Is everyone going to benefit from these changes? Or specific kinds of users?)
-
-**Additional context**
-(Add any other context or screenshots about the feature request here.)

+ 46 - 0
.github/ISSUE_TEMPLATE/featurerequest.yaml

@@ -0,0 +1,46 @@
+name: Feature Request
+description: Suggest an idea for this project.
+labels: "Type: New Feature"
+issue_body: true
+body:
+- type: markdown
+  attributes:
+    value: |
+      **Thank you for using Cura and wanting to suggest a new feature.**
+      
+      Before filing, please check if the feature request already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment. 
+      
+      Please do not write things like **Request** or **BUG** in the title, this is what labels are for.
+- type: textarea
+  attributes:
+    label: Is your feature request related to a problem?
+    description: Please describe a clear and concise description of what the problem is.
+    placeholder: I'm always frustrated when...
+  validations:
+    required: true 
+- type: textarea
+  attributes:
+    label: Describe the solution you'd like
+    description: A clear and concise description of what you want to happen. If possible, describe why you think this is a good solution. 
+    placeholder: I believe this will solve...
+  validations:
+    required: true
+- type: textarea
+  attributes:
+    label: Describe alternatives you've considered
+    description: A clear and concise description of any alternative solutions or features you've considered. Again, if possible, think about why these alternatives are not working out.
+    placeholder: The alternatives I've considered are...
+  validations:
+    required: true
+- type: textarea
+  attributes:
+    label: Affected users and/or printers
+    description: Who do you think will benefit from this? Is everyone going to benefit from these changes? Or specific kinds of users?
+    placeholder: It will affect...
+  validations:
+    required: true
+- type: markdown
+  attributes:
+    value: |
+      ## Additional information & file uploads
+      You can add pictures or files to visualize your feature request in the comments below.

+ 3 - 3
CMakeLists.txt

@@ -28,7 +28,7 @@ set(CURA_CLOUD_ACCOUNT_API_ROOT "" CACHE STRING "Alternative Cura cloud account
 set(CURA_MARKETPLACE_ROOT "" CACHE STRING "Alternative Marketplace location")
 set(CURA_DIGITAL_FACTORY_URL "" CACHE STRING "Alternative Digital Factory location")
 
-configure_file(${CMAKE_SOURCE_DIR}/cura.desktop.in ${CMAKE_BINARY_DIR}/cura.desktop @ONLY)
+configure_file(${CMAKE_SOURCE_DIR}/com.ultimaker.cura.desktop.in ${CMAKE_BINARY_DIR}/com.ultimaker.cura.desktop @ONLY)
 
 configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)
 
@@ -82,11 +82,11 @@ if(NOT APPLE AND NOT WIN32)
         install(FILES ${CMAKE_BINARY_DIR}/CuraVersion.py
             DESTINATION lib${LIB_SUFFIX}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/cura)
     endif()
-    install(FILES ${CMAKE_BINARY_DIR}/cura.desktop
+    install(FILES ${CMAKE_BINARY_DIR}/com.ultimaker.cura.desktop
             DESTINATION ${CMAKE_INSTALL_DATADIR}/applications)
     install(FILES ${CMAKE_SOURCE_DIR}/resources/images/cura-icon.png
             DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/128x128/apps/)
-    install(FILES cura.appdata.xml
+    install(FILES com.ultimaker.cura.appdata.xml
             DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo)
     install(FILES cura.sharedmimeinfo
             DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages/

+ 4 - 2
cura.appdata.xml → com.ultimaker.cura.appdata.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Copyright 2016 Richard Hughes <richard@hughsie.com> -->
 <component type="desktop">
-  <id>cura.desktop</id>
+  <id>com.ultimaker.cura.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>LGPL-3.0 and CC-BY-SA-4.0</project_license>
   <name>Cura</name>
@@ -24,7 +24,9 @@
     </ul>
   </description>
   <screenshots>
-    <screenshot type="default" width="1280" height="720">http://software.ultimaker.com/Cura.png</screenshot>
+    <screenshot type="default">
+      <image>https://raw.githubusercontent.com/Ultimaker/Cura/master/screenshot.png</image>
+    </screenshot>
   </screenshots>
   <url type="homepage">https://ultimaker.com/en/products/cura-software?utm_source=cura&amp;utm_medium=software&amp;utm_campaign=resources</url>
   <translation type="gettext">Cura</translation>

+ 0 - 0
cura.desktop.in → com.ultimaker.cura.desktop.in


+ 2 - 1
cura/API/Account.py

@@ -81,7 +81,8 @@ class Account(QObject):
             CLIENT_ID="um----------------------------ultimaker_cura",
             CLIENT_SCOPES="account.user.read drive.backup.read drive.backup.write packages.download "
                           "packages.rating.read packages.rating.write connect.cluster.read connect.cluster.write "
-                          "cura.printjob.read cura.printjob.write cura.mesh.read cura.mesh.write",
+                          "library.project.read library.project.write cura.printjob.read cura.printjob.write "
+                          "cura.mesh.read cura.mesh.write",
             AUTH_DATA_PREFERENCE_KEY="general/ultimaker_auth_data",
             AUTH_SUCCESS_REDIRECT="{}/app/auth-success".format(self._oauth_root),
             AUTH_FAILED_REDIRECT="{}/app/auth-error".format(self._oauth_root)

+ 8 - 1
cura/BuildVolume.py

@@ -1068,7 +1068,14 @@ class BuildVolume(SceneNode):
         adhesion_type = adhesion_override
         if adhesion_type is None:
             adhesion_type = container_stack.getProperty("adhesion_type", "value")
-        skirt_brim_line_width = self._global_container_stack.getProperty("skirt_brim_line_width", "value")
+
+        # Skirt_brim_line_width is a bit of an odd one out. The primary bit of the skirt/brim is printed
+        # with the adhesion extruder, but it also prints one extra line by all other extruders. As such, the
+        # setting does *not* have a limit_to_extruder setting (which means that we can't ask the global extruder what
+        # the value is.
+        adhesion_extruder = self._global_container_stack.getProperty("adhesion_extruder_nr", "value")
+        skirt_brim_line_width = self._global_container_stack.extruderList[int(adhesion_extruder)].getProperty("skirt_brim_line_width", "value")
+
         initial_layer_line_width_factor = self._global_container_stack.getProperty("initial_layer_line_width_factor", "value")
         # Use brim width if brim is enabled OR the prime tower has a brim.
         if adhesion_type == "brim":

+ 32 - 11
cura/CuraApplication.py

@@ -1,8 +1,9 @@
-# Copyright (c) 2020 Ultimaker B.V.
+# Copyright (c) 2021 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 import os
 import sys
+import tempfile
 import time
 from typing import cast, TYPE_CHECKING, Optional, Callable, List, Any, Dict
 
@@ -30,6 +31,7 @@ from UM.Operations.SetTransformOperation import SetTransformOperation
 from UM.Platform import Platform
 from UM.PluginError import PluginNotFoundError
 from UM.Preferences import Preferences
+from UM.Qt.Bindings.FileProviderModel import FileProviderModel
 from UM.Qt.QtApplication import QtApplication  # The class we're inheriting from.
 from UM.Resources import Resources
 from UM.Scene.Camera import Camera
@@ -822,6 +824,9 @@ class CuraApplication(QtApplication):
         self._add_printer_pages_model_without_cancel.initialize(cancellable = False)
         self._whats_new_pages_model.initialize()
 
+        # Initialize the FileProviderModel
+        self._file_provider_model.initialize(self._onFileProviderEnabledChanged)
+
         # Detect in which mode to run and execute that mode
         if self._is_headless:
             self.runWithoutGUI()
@@ -889,14 +894,14 @@ class CuraApplication(QtApplication):
         diagonal = self.getBuildVolume().getDiagonalSize()
         if diagonal < 1: #No printer added yet. Set a default camera distance for normal-sized printers.
             diagonal = 375
-        camera.setPosition(Vector(-80, 250, 700) * diagonal / 375)
+        camera.setPosition(Vector(-80, 180, 700) * diagonal / 375)
         camera.lookAt(Vector(0, 0, 0))
         controller.getScene().setActiveCamera("3d")
 
         # Initialize camera tool
         camera_tool = controller.getTool("CameraTool")
         if camera_tool:
-            camera_tool.setOrigin(Vector(0, 100, 0))
+            camera_tool.setOrigin(Vector(0, 30, 0))
             camera_tool.setZoomRange(0.1, 2000)
 
         # Initialize camera animations
@@ -1051,6 +1056,13 @@ class CuraApplication(QtApplication):
             self._simple_mode_settings_manager = SimpleModeSettingsManager()
         return self._simple_mode_settings_manager
 
+    @pyqtSlot(result = QObject)
+    def getFileProviderModel(self) -> FileProviderModel:
+        return self._file_provider_model
+
+    def _onFileProviderEnabledChanged(self):
+        self._file_provider_model.update()
+
     def event(self, event):
         """Handle Qt events"""
 
@@ -1256,10 +1268,11 @@ class CuraApplication(QtApplication):
                 if other_bb is not None:
                     scene_bounding_box = scene_bounding_box + node.getBoundingBox()
 
-
         if print_information:
             print_information.setPreSliced(is_block_slicing_node)
 
+        self.getWorkspaceFileHandler().setEnabled(not is_block_slicing_node)
+
         if not scene_bounding_box:
             scene_bounding_box = AxisAlignedBox.Null
 
@@ -1466,7 +1479,8 @@ class CuraApplication(QtApplication):
 
         for file_name, nodes in objects_in_filename.items():
             for node in nodes:
-                job = ReadMeshJob(file_name)
+                file_path = os.path.normpath(os.path.dirname(file_name))
+                job = ReadMeshJob(file_name, add_to_recent_files = file_path != tempfile.gettempdir())  # Don't add temp files to the recent files list
                 job._node = node  # type: ignore
                 job.finished.connect(self._reloadMeshFinished)
                 if has_merged_nodes:
@@ -1720,15 +1734,17 @@ class CuraApplication(QtApplication):
     def log(self, msg):
         Logger.log("d", msg)
 
-    openProjectFile = pyqtSignal(QUrl, arguments = ["project_file"])  # Emitted when a project file is about to open.
+    openProjectFile = pyqtSignal(QUrl, bool, arguments = ["project_file", "add_to_recent_files"])  # Emitted when a project file is about to open.
 
+    @pyqtSlot(QUrl, str, bool)
     @pyqtSlot(QUrl, str)
     @pyqtSlot(QUrl)
-    def readLocalFile(self, file: QUrl, project_mode: Optional[str] = None):
+    def readLocalFile(self, file: QUrl, project_mode: Optional[str] = None, add_to_recent_files: bool = True):
         """Open a local file
 
         :param project_mode: How to handle project files. Either None(default): Follow user preference, "open_as_model"
          or "open_as_project". This parameter is only considered if the file is a project file.
+        :param add_to_recent_files: Whether or not to add the file as an option to the Recent Files list.
         """
         Logger.log("i", "Attempting to read file %s", file.toString())
         if not file.isValid():
@@ -1749,12 +1765,12 @@ class CuraApplication(QtApplication):
         if is_project_file and project_mode == "open_as_project":
             # open as project immediately without presenting a dialog
             workspace_handler = self.getWorkspaceFileHandler()
-            workspace_handler.readLocalFile(file)
+            workspace_handler.readLocalFile(file, add_to_recent_files_hint = add_to_recent_files)
             return
 
         if is_project_file and project_mode == "always_ask":
             # present a dialog asking to open as project or import models
-            self.callLater(self.openProjectFile.emit, file)
+            self.callLater(self.openProjectFile.emit, file, add_to_recent_files)
             return
 
         # Either the file is a model file or we want to load only models from project. Continue to load models.
@@ -1790,7 +1806,7 @@ class CuraApplication(QtApplication):
         if extension in self._non_sliceable_extensions:
             self.deleteAll(only_selectable = False)
 
-        job = ReadMeshJob(f)
+        job = ReadMeshJob(f, add_to_recent_files = add_to_recent_files)
         job.finished.connect(self._readMeshFinished)
         job.start()
 
@@ -1905,6 +1921,11 @@ class CuraApplication(QtApplication):
             arrange(nodes_to_arrange, self.getBuildVolume(), fixed_nodes)
         except:
             Logger.logException("e", "Failed to arrange the models")
+
+        # Ensure that we don't have any weird floaty objects (CURA-7855)
+        for node in nodes_to_arrange:
+            node.translate(Vector(0, -node.getBoundingBox().bottom, 0), SceneNode.TransformSpace.World)
+
         self.fileCompleted.emit(file_name)
 
     def addNonSliceableExtension(self, extension):
@@ -1921,7 +1942,7 @@ class CuraApplication(QtApplication):
         try:
             result = workspace_reader.preRead(file_path, show_dialog=False)
             return result == WorkspaceReader.PreReadResult.accepted
-        except Exception:
+        except:
             Logger.logException("e", "Could not check file %s", file_url)
             return False
 

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