Merge branch '5.0' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2022-04-22 11:01:44 +02:00
commit 5330e53ae6
5 changed files with 11 additions and 47 deletions

View file

@ -29,7 +29,7 @@ class SingleInstance:
single_instance_socket.connectToServer("ultimaker-cura")
single_instance_socket.waitForConnected(msecs = 3000) # wait for 3 seconds
if single_instance_socket.state() != QLocalSocket.ConnectedState:
if single_instance_socket.state() != QLocalSocket.LocalSocketState.ConnectedState:
return False
# We only send the files that need to be opened.
@ -37,7 +37,7 @@ class SingleInstance:
Logger.log("i", "No file need to be opened, do nothing.")
return True
if single_instance_socket.state() == QLocalSocket.ConnectedState:
if single_instance_socket.state() == QLocalSocket.LocalSocketState.ConnectedState:
Logger.log("i", "Connection has been made to the single-instance Cura socket.")
# Protocol is one line of JSON terminated with a carriage return.

View file

@ -6,7 +6,7 @@ import QtQuick.Window 2.2
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.1
import UM 1.2 as UM
import UM 1.6 as UM
import Cura 1.7 as Cura
import DigitalFactory 1.0 as DF
@ -148,29 +148,7 @@ Item
contentHeight: projectsListView.implicitHeight
anchors.fill: parent
ScrollBar.vertical: ScrollBar
{
// Vertical ScrollBar, styled similarly to the scrollBar in the settings panel
id: verticalScrollBar
visible: flickableView.contentHeight > flickableView.height
background: Rectangle
{
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: Math.round(implicitWidth / 2)
color: UM.Theme.getColor("scrollbar_background")
}
contentItem: Rectangle
{
id: scrollViewHandle
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: Math.round(implicitWidth / 2)
color: verticalScrollBar.pressed ? UM.Theme.getColor("scrollbar_handle_down") : verticalScrollBar.hovered ? UM.Theme.getColor("scrollbar_handle_hover") : UM.Theme.getColor("scrollbar_handle")
Behavior on color { ColorAnimation { duration: 50; } }
}
}
ScrollBar.vertical: UM.ScrollBar { id: verticalScrollBar }
Column
{

View file

@ -138,9 +138,10 @@ class RemotePackageList(PackageList):
:param reply: The reply with packages. This will most likely be incomplete and should be ignored.
:param error: The error status of the request.
"""
if error == QNetworkReply.NetworkError.OperationCanceledError:
if error == QNetworkReply.NetworkError.OperationCanceledError or error == QNetworkReply.NetworkError.ProtocolUnknownError:
Logger.debug("Cancelled request for packages.")
self._ongoing_requests["get_packages"] = None
self.setIsLoading(False)
return # Don't show an error about this to the user.
Logger.error("Could not reach Marketplace server.")
self.setErrorMessage(catalog.i18nc("@info:error", "Could not reach Marketplace."))

View file

@ -1,9 +1,10 @@
// Copyright (c) 2021 Ultimaker B.V.
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
import QtQuick.Controls 2.15
import UM 1.4 as UM
import UM 1.6 as UM
ListView
@ -51,23 +52,7 @@ ListView
}
}
ScrollBar.vertical: ScrollBar
{
// Vertical ScrollBar, styled similarly to the scrollBar in the settings panel
id: verticalScrollBar
visible: packages.contentHeight > packages.height
anchors.right: parent.right
background: Item {}
contentItem: Rectangle
{
id: scrollViewHandle
implicitWidth: UM.Theme.getSize("scrollbar").width
radius: Math.round(implicitWidth / 2)
color: verticalScrollBar.pressed ? UM.Theme.getColor("scrollbar_handle_down") : verticalScrollBar.hovered ? UM.Theme.getColor("scrollbar_handle_hover") : UM.Theme.getColor("scrollbar_handle")
Behavior on color { ColorAnimation { duration: 50; } }
}
}
ScrollBar.vertical: UM.ScrollBar { id: verticalScrollBar }
delegate: MouseArea
{

View file

@ -40,7 +40,7 @@ Button
contentItem: Item
{
width: machineSelectorButton.width - machineSelectorButton.leftPadding
width: machineSelectorButton.width - machineSelectorButton.leftPadding - machineSelectorButton.rightPadding
height: UM.Theme.getSize("action_button").height
UM.Label