File fix-build.patch of Package uranium-lulzbot
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0a8db364..26294fa2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,11 +55,7 @@ CREATE_TRANSLATION_TARGETS()
if(NOT PYTHON_SITE_PACKAGES_DIR)
- if(APPLE OR WIN32)
- set(PYTHON_SITE_PACKAGES_DIR lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages CACHE STRING "Directory to install Python bindings to")
- else()
- set(PYTHON_SITE_PACKAGES_DIR lib/python${PYTHON_VERSION_MAJOR}/dist-packages CACHE STRING "Directory to install Python bindings to")
- endif()
+ set(PYTHON_SITE_PACKAGES_DIR lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages CACHE STRING "Directory to install Python bindings to")
set(URANIUM_INSTALL_MODULES_PATH ${CMAKE_INSTALL_DATADIR}/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Modules/ )
set(URANIUM_INSTALL_PLUGINS_PATH lib/uranium)
else()
diff --git a/UM/Qt/Bindings/MainWindow.py b/UM/Qt/Bindings/MainWindow.py
index e8acebcf..602f112c 100644
--- a/UM/Qt/Bindings/MainWindow.py
+++ b/UM/Qt/Bindings/MainWindow.py
@@ -248,9 +248,9 @@ class MainWindow(QQuickWindow):
elif self.windowState() == Qt.WindowMaximized:
self._preferences.setValue("general/window_state", Qt.WindowMaximized)
- def _updateViewportGeometry(self, width: int, height: int):
- view_width = width * self._viewport_rect.width()
- view_height = height * self._viewport_rect.height()
+ def _updateViewportGeometry(self, width: int, height: int) -> None:
+ view_width = round(width * self._viewport_rect.width())
+ view_height = round(height * self._viewport_rect.height())
for camera in self._app.getController().getScene().getAllCameras():
camera.setWindowSize(width, height)
diff --git a/UM/Qt/Bindings/PointingRectangle.py b/UM/Qt/Bindings/PointingRectangle.py
index 44ed4bcc..49cf8d50 100644
--- a/UM/Qt/Bindings/PointingRectangle.py
+++ b/UM/Qt/Bindings/PointingRectangle.py
@@ -102,7 +102,7 @@ class PointingRectangle(QQuickItem):
vertex_data[5].set(0, 0)
vertex_data[6].set(0, 0)
- target_offset = self._target - QPoint(self.x(), self.y())
+ target_offset = self._target - QPoint(round(self.x()), round(self.y()))
arrow_on_side = -1 # no arrow
arrow_size = 0
diff --git a/UM/Qt/qml/UM/Preferences/PreferencesDialog.qml b/UM/Qt/qml/UM/Preferences/PreferencesDialog.qml
index 7d9c3ec4..e795b347 100644
--- a/UM/Qt/qml/UM/Preferences/PreferencesDialog.qml
+++ b/UM/Qt/qml/UM/Preferences/PreferencesDialog.qml
@@ -1,4 +1,4 @@
-// Copyright (c) 2015 Ultimaker B.V.
+// Copyright (c) 2020 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
@@ -22,6 +22,10 @@ Dialog
height: minimumHeight
property int currentPage: 0;
+ onCurrentPageChanged:
+ {
+ pagesList.selection.select(currentPage);
+ }
Item
{
@@ -117,9 +121,6 @@ Dialog
function setPage(index)
{
- pagesList.selection.clear();
- pagesList.selection.select(index);
-
stackView.replace(configPagesModel.get(index).item);
base.currentPage = index
@@ -147,6 +148,6 @@ Dialog
insertPage(1, catalog.i18nc("@title:tab", "Settings"), Qt.resolvedUrl("SettingVisibilityPage.qml"));
insertPage(2, catalog.i18nc("@title:tab", "Plugins"), Qt.resolvedUrl("PluginsPage.qml"));
- setPage(0)
+ base.currentPage = 0;
}
}
diff --git a/UM/SortedList.py b/UM/SortedList.py
index 114f2b31..75247764 100644
--- a/UM/SortedList.py
+++ b/UM/SortedList.py
@@ -20,7 +20,7 @@
from bisect import bisect_left, bisect_right, insort
from itertools import chain, repeat, starmap
-from collections import Sequence, MutableSequence
+from collections.abc import Sequence, MutableSequence
import operator as op
from operator import iadd, add
from functools import wraps
diff --git a/UM/View/GL/ShaderProgram.py b/UM/View/GL/ShaderProgram.py
index 60c39025..5bd6fc0a 100644
--- a/UM/View/GL/ShaderProgram.py
+++ b/UM/View/GL/ShaderProgram.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2015 Ultimaker B.V.
+# Copyright (c) 2020 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
import configparser
@@ -201,15 +201,15 @@ class ShaderProgram:
if attribute == -1:
return
- if type is "int":
+ if type == "int":
self._shader_program.setAttributeBuffer(attribute, 0x1404, offset, 1, stride) #GL_INT
- elif type is "float":
+ elif type == "float":
self._shader_program.setAttributeBuffer(attribute, 0x1406, offset, 1, stride) #GL_FLOAT
- elif type is "vector2f":
+ elif type == "vector2f":
self._shader_program.setAttributeBuffer(attribute, 0x1406, offset, 2, stride) #GL_FLOAT
- elif type is "vector3f":
+ elif type == "vector3f":
self._shader_program.setAttributeBuffer(attribute, 0x1406, offset, 3, stride) #GL_FLOAT
- elif type is "vector4f":
+ elif type == "vector4f":
self._shader_program.setAttributeBuffer(attribute, 0x1406, offset, 4, stride) #GL_FLOAT
self._shader_program.enableAttributeArray(attribute)
@@ -322,7 +322,7 @@ class ShaderProgram:
self._shader_program.setUniformValue(uniform, self._matrixToQMatrix4x4(value))
elif type(value) is Color:
self._shader_program.setUniformValue(uniform,
- QColor(value.r * 255, value.g * 255, value.b * 255, value.a * 255))
+ QColor(round(value.r * 255), round(value.g * 255), round(value.b * 255), round(value.a * 255)))
elif type(value) is list and len(value) is 2:
self._shader_program.setUniformValue(uniform, QVector2D(value[0], value[1]))
elif type(value) is list and len(value) is 3:
diff --git a/UM/View/SelectionPass.py b/UM/View/SelectionPass.py
index fb7dce35..1b91a87f 100644
--- a/UM/View/SelectionPass.py
+++ b/UM/View/SelectionPass.py
@@ -86,8 +86,8 @@ class SelectionPass(RenderPass):
window_size = self._renderer.getWindowSize()
- px = (0.5 + x / 2.0) * window_size[0]
- py = (0.5 + y / 2.0) * window_size[1]
+ px = round((0.5 + x / 2.0) * window_size[0])
+ py = round((0.5 + y / 2.0) * window_size[1])
if px < 0 or px > (output.width() - 1) or py < 0 or py > (output.height() - 1):
return None
diff --git a/plugins/ConsoleLogger/ConsoleLogger.py b/plugins/ConsoleLogger/ConsoleLogger.py
index 2c408277..39abc0c0 100644
--- a/plugins/ConsoleLogger/ConsoleLogger.py
+++ b/plugins/ConsoleLogger/ConsoleLogger.py
@@ -23,7 +23,7 @@ class ConsoleLogger(LogOutput):
def __init__(self):
super().__init__()
self._logger = logging.getLogger(self._name) #Create python logger
- self._logger.setLevel(logging.DEBUG)
+# self._logger.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler() # Log to stream
stream_handler.setFormatter(logging_formatter)
self._logger.addHandler(stream_handler)
diff --git a/plugins/FileLogger/FileLogger.py b/plugins/FileLogger/FileLogger.py
index 065e95d3..e4739430 100644
--- a/plugins/FileLogger/FileLogger.py
+++ b/plugins/FileLogger/FileLogger.py
@@ -12,7 +12,7 @@ class FileLogger(LogOutput):
def __init__(self, file_name):
super().__init__()
self._logger = logging.getLogger(self._name) # Create python logger
- self._logger.setLevel(logging.DEBUG)
+# self._logger.setLevel(logging.DEBUG)
# Do not try to save to the app dir as it may not be writeable or may not be the right
# location to save the log file. Instead, try and save in the settings location since