mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 20:35:59 +08:00
Merge branch 'master' of github.com:Ultimaker/cura
This commit is contained in:
commit
403129e2d6
@ -19,6 +19,7 @@ endif()
|
|||||||
|
|
||||||
set(CURA_VERSION "master" CACHE STRING "Version name of Cura")
|
set(CURA_VERSION "master" CACHE STRING "Version name of Cura")
|
||||||
set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
|
set(CURA_BUILDTYPE "" CACHE STRING "Build type of Cura, eg. 'PPA'")
|
||||||
|
set(CURA_PACKAGES_VERSION "" CACHE STRING "Packages version of Cura")
|
||||||
configure_file(${CMAKE_SOURCE_DIR}/cura.desktop.in ${CMAKE_BINARY_DIR}/cura.desktop @ONLY)
|
configure_file(${CMAKE_SOURCE_DIR}/cura.desktop.in ${CMAKE_BINARY_DIR}/cura.desktop @ONLY)
|
||||||
configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)
|
configure_file(cura/CuraVersion.py.in CuraVersion.py @ONLY)
|
||||||
|
|
||||||
|
@ -8,13 +8,14 @@ import shutil
|
|||||||
import zipfile
|
import zipfile
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from PyQt5.QtCore import pyqtSlot, QObject, pyqtSignal
|
from PyQt5.QtCore import pyqtSlot, QObject, pyqtSignal, QUrl
|
||||||
|
|
||||||
from UM.Application import Application
|
from UM.Application import Application
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
from UM.Resources import Resources
|
from UM.Resources import Resources
|
||||||
from UM.Version import Version
|
from UM.Version import Version
|
||||||
|
|
||||||
|
|
||||||
class CuraPackageManager(QObject):
|
class CuraPackageManager(QObject):
|
||||||
Version = 1
|
Version = 1
|
||||||
|
|
||||||
@ -184,6 +185,12 @@ class CuraPackageManager(QObject):
|
|||||||
def isPackageInstalled(self, package_id: str) -> bool:
|
def isPackageInstalled(self, package_id: str) -> bool:
|
||||||
return self.getInstalledPackageInfo(package_id) is not None
|
return self.getInstalledPackageInfo(package_id) is not None
|
||||||
|
|
||||||
|
# This is called by drag-and-dropping curapackage files.
|
||||||
|
@pyqtSlot(QUrl)
|
||||||
|
def installPackageViaDragAndDrop(self, file_url: str) -> None:
|
||||||
|
filename = QUrl(file_url).toLocalFile()
|
||||||
|
return self.installPackage(filename)
|
||||||
|
|
||||||
# Schedules the given package file to be installed upon the next start.
|
# Schedules the given package file to be installed upon the next start.
|
||||||
@pyqtSlot(str)
|
@pyqtSlot(str)
|
||||||
def installPackage(self, filename: str) -> None:
|
def installPackage(self, filename: str) -> None:
|
||||||
|
@ -4,3 +4,4 @@
|
|||||||
CuraVersion = "@CURA_VERSION@"
|
CuraVersion = "@CURA_VERSION@"
|
||||||
CuraBuildType = "@CURA_BUILDTYPE@"
|
CuraBuildType = "@CURA_BUILDTYPE@"
|
||||||
CuraDebugMode = True if "@_cura_debugmode@" == "ON" else False
|
CuraDebugMode = True if "@_cura_debugmode@" == "ON" else False
|
||||||
|
CuraPackagesVersion = "@CURA_PACKAGES_VERSION@"
|
||||||
|
@ -9,7 +9,6 @@ import UM 1.1 as UM
|
|||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
id: tile
|
id: tile
|
||||||
property bool installed: toolbox.isInstalled(model.id)
|
|
||||||
width: detailList.width - UM.Theme.getSize("wide_margin").width
|
width: detailList.width - UM.Theme.getSize("wide_margin").width
|
||||||
height: normalData.height + compatibilityChart.height + 4 * UM.Theme.getSize("default_margin").height
|
height: normalData.height + compatibilityChart.height + 4 * UM.Theme.getSize("default_margin").height
|
||||||
Item
|
Item
|
||||||
@ -46,7 +45,7 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item
|
ToolboxDetailTileActions
|
||||||
{
|
{
|
||||||
id: controls
|
id: controls
|
||||||
anchors.right: tile.right
|
anchors.right: tile.right
|
||||||
@ -54,28 +53,6 @@ Item
|
|||||||
width: childrenRect.width
|
width: childrenRect.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
|
|
||||||
ToolboxProgressButton
|
|
||||||
{
|
|
||||||
id: installButton
|
|
||||||
active: toolbox.isDownloading && toolbox.activePackage == model
|
|
||||||
complete: tile.installed
|
|
||||||
readyAction: function()
|
|
||||||
{
|
|
||||||
toolbox.activePackage = model
|
|
||||||
toolbox.startDownload(model.download_url)
|
|
||||||
}
|
|
||||||
activeAction: function()
|
|
||||||
{
|
|
||||||
toolbox.cancelDownload()
|
|
||||||
}
|
|
||||||
completeAction: function()
|
|
||||||
{
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolboxCompatibilityChart
|
ToolboxCompatibilityChart
|
||||||
@ -94,9 +71,4 @@ Item
|
|||||||
anchors.top: compatibilityChart.bottom
|
anchors.top: compatibilityChart.bottom
|
||||||
anchors.topMargin: UM.Theme.getSize("default_margin").height + UM.Theme.getSize("wide_margin").height //Normal margin for spacing after chart, wide margin between items.
|
anchors.topMargin: UM.Theme.getSize("default_margin").height + UM.Theme.getSize("wide_margin").height //Normal margin for spacing after chart, wide margin between items.
|
||||||
}
|
}
|
||||||
Connections
|
|
||||||
{
|
|
||||||
target: toolbox
|
|
||||||
onInstallChanged: installed = toolbox.isInstalled(model.id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
66
plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml
Normal file
66
plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
// Toolbox is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import UM 1.1 as UM
|
||||||
|
|
||||||
|
Column
|
||||||
|
{
|
||||||
|
property bool installed: toolbox.isInstalled(model.id)
|
||||||
|
property bool canUpdate: toolbox.canUpdate(model.id)
|
||||||
|
width: UM.Theme.getSize("toolbox_action_button").width
|
||||||
|
spacing: UM.Theme.getSize("narrow_margin").height
|
||||||
|
|
||||||
|
ToolboxProgressButton
|
||||||
|
{
|
||||||
|
id: installButton
|
||||||
|
active: toolbox.isDownloading && toolbox.activePackage == model
|
||||||
|
complete: installed
|
||||||
|
readyAction: function()
|
||||||
|
{
|
||||||
|
toolbox.activePackage = model
|
||||||
|
toolbox.startDownload(model.download_url)
|
||||||
|
}
|
||||||
|
activeAction: function()
|
||||||
|
{
|
||||||
|
toolbox.cancelDownload()
|
||||||
|
}
|
||||||
|
completeAction: function()
|
||||||
|
{
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
ToolboxProgressButton
|
||||||
|
{
|
||||||
|
id: updateButton
|
||||||
|
active: toolbox.isDownloading && toolbox.activePackage == model
|
||||||
|
readyLabel: catalog.i18nc("@action:button", "Update")
|
||||||
|
activeLabel: catalog.i18nc("@action:button", "Updating")
|
||||||
|
completeLabel: catalog.i18nc("@action:button", "Updated")
|
||||||
|
readyAction: function()
|
||||||
|
{
|
||||||
|
toolbox.activePackage = model
|
||||||
|
toolbox.update(model.id)
|
||||||
|
}
|
||||||
|
activeAction: function()
|
||||||
|
{
|
||||||
|
toolbox.cancelDownload()
|
||||||
|
}
|
||||||
|
// Don't allow installing while another download is running
|
||||||
|
enabled: !(toolbox.isDownloading && toolbox.activePackage != model)
|
||||||
|
opacity: enabled ? 1.0 : 0.5
|
||||||
|
visible: installed && canUpdate
|
||||||
|
}
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: toolbox
|
||||||
|
onInstallChanged: installed = toolbox.isInstalled(model.id)
|
||||||
|
onMetadataChanged: canUpdate = toolbox.canUpdate(model.id)
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,6 @@ Item
|
|||||||
{
|
{
|
||||||
height: UM.Theme.getSize("toolbox_installed_tile").height
|
height: UM.Theme.getSize("toolbox_installed_tile").height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
property bool canUpdate: false
|
|
||||||
property bool isEnabled: true
|
property bool isEnabled: true
|
||||||
|
|
||||||
Rectangle
|
Rectangle
|
||||||
@ -109,7 +108,6 @@ Item
|
|||||||
{
|
{
|
||||||
target: toolbox
|
target: toolbox
|
||||||
onEnabledChanged: isEnabled = toolbox.isEnabled(model.id)
|
onEnabledChanged: isEnabled = toolbox.isEnabled(model.id)
|
||||||
onMetadataChanged: canUpdate = toolbox.canUpdate(model.id)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@ import UM 1.1 as UM
|
|||||||
|
|
||||||
Column
|
Column
|
||||||
{
|
{
|
||||||
|
property bool canUpdate: false
|
||||||
|
property bool canDowngrade: false
|
||||||
width: UM.Theme.getSize("toolbox_action_button").width
|
width: UM.Theme.getSize("toolbox_action_button").width
|
||||||
spacing: UM.Theme.getSize("narrow_margin").height
|
spacing: UM.Theme.getSize("narrow_margin").height
|
||||||
|
|
||||||
@ -36,7 +38,7 @@ Column
|
|||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
id: removeButton
|
id: removeButton
|
||||||
text: catalog.i18nc("@action:button", "Uninstall")
|
text: canDowngrade ? catalog.i18nc("@action:button", "Downgrade") : catalog.i18nc("@action:button", "Uninstall")
|
||||||
visible: !model.is_bundled
|
visible: !model.is_bundled
|
||||||
enabled: !toolbox.isDownloading
|
enabled: !toolbox.isDownloading
|
||||||
style: ButtonStyle
|
style: ButtonStyle
|
||||||
@ -49,7 +51,17 @@ Column
|
|||||||
border
|
border
|
||||||
{
|
{
|
||||||
width: UM.Theme.getSize("default_lining").width
|
width: UM.Theme.getSize("default_lining").width
|
||||||
color: UM.Theme.getColor("lining")
|
color:
|
||||||
|
{
|
||||||
|
if (control.hovered)
|
||||||
|
{
|
||||||
|
return UM.Theme.getColor("primary_hover")
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return UM.Theme.getColor("lining")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
label: Label
|
label: Label
|
||||||
@ -58,8 +70,18 @@ Column
|
|||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
font: UM.Theme.getFont("default")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClicked: toolbox.uninstall(model.id)
|
onClicked: toolbox.uninstall(model.id)
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: toolbox
|
||||||
|
onMetadataChanged:
|
||||||
|
{
|
||||||
|
canUpdate = toolbox.canUpdate(model.id)
|
||||||
|
canDowngrade = toolbox.canDowngrade(model.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ Item
|
|||||||
{
|
{
|
||||||
if (base.complete)
|
if (base.complete)
|
||||||
{
|
{
|
||||||
return UM.Theme.getColor("action_button_disabled")
|
return "transparent"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -82,6 +82,31 @@ Item
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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
|
label: Label
|
||||||
{
|
{
|
||||||
@ -90,7 +115,7 @@ Item
|
|||||||
{
|
{
|
||||||
if (base.complete)
|
if (base.complete)
|
||||||
{
|
{
|
||||||
return UM.Theme.getColor("action_button_disabled_text")
|
return UM.Theme.getColor("text")
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -106,7 +131,17 @@ Item
|
|||||||
}
|
}
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
font: UM.Theme.getFont("default_bold")
|
font:
|
||||||
|
{
|
||||||
|
if (base.complete)
|
||||||
|
{
|
||||||
|
return UM.Theme.getFont("default")
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return UM.Theme.getFont("default_bold")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,6 +300,20 @@ class Toolbox(QObject, Extension):
|
|||||||
remote_version = Version(remote_package["package_version"])
|
remote_version = Version(remote_package["package_version"])
|
||||||
return remote_version > local_version
|
return remote_version > local_version
|
||||||
|
|
||||||
|
@pyqtSlot(str, result=bool)
|
||||||
|
def canDowngrade(self, package_id: str) -> bool:
|
||||||
|
local_package = self._package_manager.getInstalledPackageInfo(package_id)
|
||||||
|
if local_package is None:
|
||||||
|
return False
|
||||||
|
|
||||||
|
remote_package = self.getRemotePackage(package_id)
|
||||||
|
if remote_package is None:
|
||||||
|
return False
|
||||||
|
|
||||||
|
local_version = Version(local_package["package_version"])
|
||||||
|
remote_version = Version(remote_package["package_version"])
|
||||||
|
return remote_version < local_version
|
||||||
|
|
||||||
@pyqtSlot(str, result = bool)
|
@pyqtSlot(str, result = bool)
|
||||||
def isInstalled(self, package_id: str) -> bool:
|
def isInstalled(self, package_id: str) -> bool:
|
||||||
return self._package_manager.isPackageInstalled(package_id)
|
return self._package_manager.isPackageInstalled(package_id)
|
||||||
|
@ -45,6 +45,8 @@ class DiscoverUM3Action(MachineAction):
|
|||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def reset(self):
|
def reset(self):
|
||||||
Logger.log("d", "Reset the list of found devices.")
|
Logger.log("d", "Reset the list of found devices.")
|
||||||
|
if self._network_plugin:
|
||||||
|
self._network_plugin.resetLastManualDevice()
|
||||||
self.discoveredDevicesChanged.emit()
|
self.discoveredDevicesChanged.emit()
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
@ -131,7 +133,7 @@ class DiscoverUM3Action(MachineAction):
|
|||||||
self._network_plugin.reCheckConnections()
|
self._network_plugin.reCheckConnections()
|
||||||
|
|
||||||
@pyqtSlot(result = str)
|
@pyqtSlot(result = str)
|
||||||
def getStoredKey(self):
|
def getStoredKey(self) -> str:
|
||||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||||
if global_container_stack:
|
if global_container_stack:
|
||||||
meta_data = global_container_stack.getMetaData()
|
meta_data = global_container_stack.getMetaData()
|
||||||
@ -140,6 +142,12 @@ class DiscoverUM3Action(MachineAction):
|
|||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
@pyqtSlot(result = str)
|
||||||
|
def getLastManualEntryKey(self) -> str:
|
||||||
|
if self._network_plugin:
|
||||||
|
return self._network_plugin.getLastManualDevice()
|
||||||
|
return ""
|
||||||
|
|
||||||
@pyqtSlot(str, result = bool)
|
@pyqtSlot(str, result = bool)
|
||||||
def existsKey(self, key) -> bool:
|
def existsKey(self, key) -> bool:
|
||||||
return Application.getInstance().getMachineManager().existNetworkInstances(network_key = key)
|
return Application.getInstance().getMachineManager().existNetworkInstances(network_key = key)
|
||||||
|
@ -158,7 +158,10 @@ Cura.MachineAction
|
|||||||
model: manager.foundDevices
|
model: manager.foundDevices
|
||||||
onModelChanged:
|
onModelChanged:
|
||||||
{
|
{
|
||||||
var selectedKey = manager.getStoredKey();
|
var selectedKey = manager.getLastManualEntryKey()
|
||||||
|
// If there is no last manual entry key, then we select the stored key (if any)
|
||||||
|
if (selectedKey == "")
|
||||||
|
selectedKey = manager.getStoredKey()
|
||||||
for(var i = 0; i < model.length; i++) {
|
for(var i = 0; i < model.length; i++) {
|
||||||
if(model[i].key == selectedKey)
|
if(model[i].key == selectedKey)
|
||||||
{
|
{
|
||||||
|
@ -60,6 +60,9 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
|
|
||||||
self._manual_instances = self._preferences.getValue("um3networkprinting/manual_instances").split(",")
|
self._manual_instances = self._preferences.getValue("um3networkprinting/manual_instances").split(",")
|
||||||
|
|
||||||
|
# Store the last manual entry key
|
||||||
|
self._last_manual_entry_key = "" # type: str
|
||||||
|
|
||||||
# The zero-conf service changed requests are handled in a separate thread, so we can re-schedule the requests
|
# The zero-conf service changed requests are handled in a separate thread, so we can re-schedule the requests
|
||||||
# which fail to get detailed service info.
|
# which fail to get detailed service info.
|
||||||
# Any new or re-scheduled requests will be appended to the request queue, and the handling thread will pick
|
# Any new or re-scheduled requests will be appended to the request queue, and the handling thread will pick
|
||||||
@ -72,6 +75,12 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
def getDiscoveredDevices(self):
|
def getDiscoveredDevices(self):
|
||||||
return self._discovered_devices
|
return self._discovered_devices
|
||||||
|
|
||||||
|
def getLastManualDevice(self) -> str:
|
||||||
|
return self._last_manual_entry_key
|
||||||
|
|
||||||
|
def resetLastManualDevice(self) -> None:
|
||||||
|
self._last_manual_entry_key = ""
|
||||||
|
|
||||||
## Start looking for devices on network.
|
## Start looking for devices on network.
|
||||||
def start(self):
|
def start(self):
|
||||||
self.startDiscovery()
|
self.startDiscovery()
|
||||||
@ -93,6 +102,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
for address in self._manual_instances:
|
for address in self._manual_instances:
|
||||||
if address:
|
if address:
|
||||||
self.addManualDevice(address)
|
self.addManualDevice(address)
|
||||||
|
self.resetLastManualDevice()
|
||||||
|
|
||||||
def reCheckConnections(self):
|
def reCheckConnections(self):
|
||||||
active_machine = Application.getInstance().getGlobalContainerStack()
|
active_machine = Application.getInstance().getGlobalContainerStack()
|
||||||
@ -136,6 +146,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
if not address:
|
if not address:
|
||||||
address = self._discovered_devices[key].ipAddress
|
address = self._discovered_devices[key].ipAddress
|
||||||
self._onRemoveDevice(key)
|
self._onRemoveDevice(key)
|
||||||
|
self.resetLastManualDevice()
|
||||||
|
|
||||||
if address in self._manual_instances:
|
if address in self._manual_instances:
|
||||||
self._manual_instances.remove(address)
|
self._manual_instances.remove(address)
|
||||||
@ -157,6 +168,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
if instance_name not in self._discovered_devices:
|
if instance_name not in self._discovered_devices:
|
||||||
# Add a preliminary printer instance
|
# Add a preliminary printer instance
|
||||||
self._onAddDevice(instance_name, address, properties)
|
self._onAddDevice(instance_name, address, properties)
|
||||||
|
self._last_manual_entry_key = instance_name
|
||||||
|
|
||||||
self._checkManualDevice(address)
|
self._checkManualDevice(address)
|
||||||
|
|
||||||
|
@ -323,6 +323,21 @@ UM.MainWindow
|
|||||||
{
|
{
|
||||||
if (drop.urls.length > 0)
|
if (drop.urls.length > 0)
|
||||||
{
|
{
|
||||||
|
// As the drop area also supports plugins, first check if it's a plugin that was dropped.
|
||||||
|
if (drop.urls.length == 1)
|
||||||
|
{
|
||||||
|
var filename = drop.urls[0];
|
||||||
|
if (filename.endsWith(".curapackage"))
|
||||||
|
{
|
||||||
|
// Try to install plugin & close.
|
||||||
|
CuraApplication.getCuraPackageManager().installPackageViaDragAndDrop(filename);
|
||||||
|
packageInstallDialog.text = catalog.i18nc("@label", "This package will be installed after restarting.");
|
||||||
|
packageInstallDialog.icon = StandardIcon.Information;
|
||||||
|
packageInstallDialog.open();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
openDialog.handleOpenFileUrls(drop.urls);
|
openDialog.handleOpenFileUrls(drop.urls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -790,6 +805,14 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MessageDialog
|
||||||
|
{
|
||||||
|
id: packageInstallDialog
|
||||||
|
title: catalog.i18nc("@window:title", "Install Package");
|
||||||
|
standardButtons: StandardButton.Ok
|
||||||
|
modality: Qt.ApplicationModal
|
||||||
|
}
|
||||||
|
|
||||||
MessageDialog {
|
MessageDialog {
|
||||||
id: infoMultipleFilesWithGcodeDialog
|
id: infoMultipleFilesWithGcodeDialog
|
||||||
title: catalog.i18nc("@title:window", "Open File(s)")
|
title: catalog.i18nc("@title:window", "Open File(s)")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 Ultimaker B.V.
|
// Copyright (c) 2018 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
@ -61,32 +61,34 @@ UM.Dialog
|
|||||||
{
|
{
|
||||||
id: palette
|
id: palette
|
||||||
}
|
}
|
||||||
|
|
||||||
Column
|
|
||||||
{
|
|
||||||
anchors.fill: parent
|
|
||||||
spacing: 2 * screenScaleFactor
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: titleLabel
|
id: mainHeading
|
||||||
|
width: parent.width
|
||||||
text: catalog.i18nc("@action:title", "Summary - Cura Project")
|
text: catalog.i18nc("@action:title", "Summary - Cura Project")
|
||||||
font.pointSize: 18
|
font.pointSize: 18
|
||||||
|
anchors.top: parent.top
|
||||||
}
|
}
|
||||||
Rectangle
|
ScrollView
|
||||||
{
|
{
|
||||||
id: separator
|
id: scroll
|
||||||
color: palette.text
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 1
|
anchors
|
||||||
}
|
|
||||||
Item // Spacer
|
|
||||||
{
|
{
|
||||||
height: spacerHeight
|
top: mainHeading.bottom
|
||||||
width: height
|
topMargin: UM.Theme.getSize("default_margin").height
|
||||||
|
bottom: controls.top
|
||||||
|
bottomMargin: UM.Theme.getSize("default_margin").height
|
||||||
}
|
}
|
||||||
|
style: UM.Theme.styles.scrollview
|
||||||
|
ColumnLayout
|
||||||
|
{
|
||||||
|
spacing: UM.Theme.getSize("default_margin").height
|
||||||
|
Column
|
||||||
|
{
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
|
id: settingsHeading
|
||||||
text: catalog.i18nc("@action:label", "Printer settings")
|
text: catalog.i18nc("@action:label", "Printer settings")
|
||||||
font.bold: true
|
font.bold: true
|
||||||
}
|
}
|
||||||
@ -97,12 +99,12 @@ UM.Dialog
|
|||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "Type")
|
text: catalog.i18nc("@action:label", "Type")
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name
|
text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Row
|
Row
|
||||||
@ -112,56 +114,45 @@ UM.Dialog
|
|||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", Cura.MachineManager.activeMachineNetworkGroupName != "" ? "Printer Group" : "Name")
|
text: catalog.i18nc("@action:label", Cura.MachineManager.activeMachineNetworkGroupName != "" ? "Printer Group" : "Name")
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
|
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Column
|
|
||||||
{
|
|
||||||
width: parent.width
|
|
||||||
visible: Cura.MachineManager.hasVariantBuildplates
|
|
||||||
Item // Spacer
|
|
||||||
{
|
|
||||||
height: spacerHeight
|
|
||||||
width: height
|
|
||||||
}
|
}
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
|
visible: Cura.MachineManager.hasVariantBuildplates
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "Build plate")
|
text: catalog.i18nc("@action:label", "Build plate")
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: Cura.MachineManager.activeVariantBuildplateName
|
text: Cura.MachineManager.activeVariantBuildplateName
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Repeater
|
Repeater
|
||||||
{
|
{
|
||||||
|
width: parent.width
|
||||||
|
height: childrenRect.height
|
||||||
model: Cura.MachineManager.currentExtruderPositions
|
model: Cura.MachineManager.currentExtruderPositions
|
||||||
delegate: Column
|
delegate: Column
|
||||||
{
|
{
|
||||||
Item // Spacer
|
height: childrenRect.height
|
||||||
{
|
width: parent.width
|
||||||
height: spacerHeight
|
|
||||||
width: height
|
|
||||||
}
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "Extruder %1").arg(modelData)
|
text: catalog.i18nc("@action:label", "Extruder %1").arg(modelData)
|
||||||
|
font.bold: true
|
||||||
}
|
}
|
||||||
height: childrenRect.height
|
|
||||||
width: parent.width
|
|
||||||
Row
|
Row
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@ -169,23 +160,20 @@ UM.Dialog
|
|||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
|
text: catalog.i18nc("@action:label", "%1 & material").arg(Cura.MachineManager.activeDefinitionVariantsName)
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: Cura.MachineManager.activeVariantNames[modelData] + ", " + Cura.MachineManager.getExtruder(modelData).material.name
|
text: Cura.MachineManager.activeVariantNames[modelData] + ", " + Cura.MachineManager.getExtruder(modelData).material.name
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Column
|
||||||
Item // Spacer
|
|
||||||
{
|
{
|
||||||
height: spacerHeight
|
width: parent.width
|
||||||
width: height
|
height: childrenRect.height
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "Profile settings")
|
text: catalog.i18nc("@action:label", "Profile settings")
|
||||||
@ -197,12 +185,12 @@ UM.Dialog
|
|||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "Not in profile")
|
text: catalog.i18nc("@action:label", "Not in profile")
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
|
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
visible: Cura.MachineManager.numUserSettings
|
visible: Cura.MachineManager.numUserSettings
|
||||||
}
|
}
|
||||||
@ -213,22 +201,20 @@ UM.Dialog
|
|||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "Name")
|
text: catalog.i18nc("@action:label", "Name")
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: Cura.MachineManager.activeQualityOrQualityChangesName
|
text: Cura.MachineManager.activeQualityOrQualityChangesName
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Item // Spacer
|
Column
|
||||||
{
|
{
|
||||||
height: spacerHeight
|
width: parent.width
|
||||||
width: height
|
height: childrenRect.height
|
||||||
}
|
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "Setting visibility")
|
text: catalog.i18nc("@action:label", "Setting visibility")
|
||||||
@ -241,57 +227,54 @@ UM.Dialog
|
|||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "Visible settings:")
|
text: catalog.i18nc("@action:label", "Visible settings:")
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings)
|
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(definitionsModel.visibleCount).arg(Cura.MachineManager.totalNumberOfSettings)
|
||||||
width: (parent.width / 3) | 0
|
width: Math.floor(scroll.width / 3) | 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Item // Spacer
|
}
|
||||||
|
}
|
||||||
|
Item
|
||||||
{
|
{
|
||||||
height: spacerHeight
|
id: controls
|
||||||
width: height
|
width: parent.width
|
||||||
}
|
height: childrenRect.height
|
||||||
}
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
CheckBox
|
CheckBox
|
||||||
{
|
{
|
||||||
id: dontShowAgainCheckbox
|
id: dontShowAgainCheckbox
|
||||||
anchors.bottom: cancel_button.top
|
|
||||||
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
||||||
text: catalog.i18nc("@action:label", "Don't show project summary on save again")
|
text: catalog.i18nc("@action:label", "Don't show project summary on save again")
|
||||||
checked: dontShowAgain
|
checked: dontShowAgain
|
||||||
}
|
}
|
||||||
|
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
id: cancel_button
|
id: cancel_button
|
||||||
anchors.bottom: parent.bottom
|
anchors
|
||||||
anchors.right: ok_button.left
|
{
|
||||||
anchors.rightMargin: 2
|
right: ok_button.left
|
||||||
|
rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
}
|
||||||
text: catalog.i18nc("@action:button","Cancel");
|
text: catalog.i18nc("@action:button","Cancel");
|
||||||
enabled: true
|
enabled: true
|
||||||
onClicked: close()
|
onClicked: close()
|
||||||
}
|
}
|
||||||
|
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
id: ok_button
|
id: ok_button
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
text: catalog.i18nc("@action:button","Save");
|
text: catalog.i18nc("@action:button","Save");
|
||||||
enabled: true
|
enabled: true
|
||||||
onClicked: {
|
onClicked:
|
||||||
|
{
|
||||||
close()
|
close()
|
||||||
yes()
|
yes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user