mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 07:19:05 +08:00
Merge pull request #10788 from Ultimaker/replace_controls_1_for_controls_2
Convert QtQuick.Controls 1 to QtQuick.Controls 2
This commit is contained in:
commit
fcdc43fc71
@ -679,22 +679,6 @@ class CuraApplication(QtApplication):
|
||||
self._setLoadingHint(self._i18n_catalog.i18nc("@info:progress", "Initializing Active Machine..."))
|
||||
super().setGlobalContainerStack(stack)
|
||||
|
||||
showMessageBox = pyqtSignal(str,str, str, str, int, int,
|
||||
arguments = ["title", "text", "informativeText", "detailedText","buttons", "icon"])
|
||||
"""A reusable dialogbox"""
|
||||
|
||||
def messageBox(self, title, text,
|
||||
informativeText = "",
|
||||
detailedText = "",
|
||||
buttons = QMessageBox.Ok,
|
||||
icon = QMessageBox.NoIcon,
|
||||
callback = None,
|
||||
callback_arguments = []
|
||||
):
|
||||
self._message_box_callback = callback
|
||||
self._message_box_callback_arguments = callback_arguments
|
||||
self.showMessageBox.emit(title, text, informativeText, detailedText, buttons, icon)
|
||||
|
||||
showDiscardOrKeepProfileChanges = pyqtSignal()
|
||||
|
||||
def discardOrKeepProfileChanges(self) -> bool:
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2020 Ultimaker B.V.
|
||||
# Copyright (c) 2022 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from PyQt5.QtCore import pyqtProperty, pyqtSignal, Qt
|
||||
@ -9,6 +9,7 @@ from UM import i18nCatalog
|
||||
from UM.Logger import Logger
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.SettingFunction import SettingFunction # To format setting functions differently.
|
||||
|
||||
import os
|
||||
|
||||
@ -173,12 +174,22 @@ class QualitySettingsModel(ListModel):
|
||||
label = definition.label
|
||||
if self._i18n_catalog:
|
||||
label = self._i18n_catalog.i18nc(definition.key + " label", label)
|
||||
if profile_value_source == "quality_changes":
|
||||
label = f"<i>{label}</i>" # Make setting name italic if it's derived from the quality-changes profile.
|
||||
|
||||
if isinstance(profile_value, SettingFunction):
|
||||
if self._i18n_catalog:
|
||||
profile_value_display = self._i18n_catalog.i18nc("@info:status", "Calculated")
|
||||
else:
|
||||
profile_value_display = "Calculated"
|
||||
else:
|
||||
profile_value_display = "" if profile_value is None else str(profile_value)
|
||||
|
||||
items.append({
|
||||
"key": definition.key,
|
||||
"label": label,
|
||||
"unit": definition.unit,
|
||||
"profile_value": "" if profile_value is None else str(profile_value), # it is for display only
|
||||
"profile_value": profile_value_display,
|
||||
"profile_value_source": profile_value_source,
|
||||
"user_value": "" if user_value is None else str(user_value),
|
||||
"category": current_category
|
||||
|
@ -6,7 +6,7 @@ import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
UM.Dialog
|
||||
@ -19,9 +19,7 @@ UM.Dialog
|
||||
width: minimumWidth
|
||||
height: Math.max(dialogSummaryItem.height + 2 * buttonsItem.height, minimumHeight) // 2 * button height to also have some extra space around the button relative to the button size
|
||||
|
||||
property int comboboxHeight: 15 * screenScaleFactor
|
||||
property int spacerHeight: 10 * screenScaleFactor
|
||||
property int doubleSpacerHeight: 20 * screenScaleFactor
|
||||
property int comboboxHeight: UM.Theme.getSize("default_margin").height
|
||||
|
||||
onClosing: manager.notifyClosed()
|
||||
onVisibleChanged:
|
||||
@ -46,10 +44,6 @@ UM.Dialog
|
||||
id: catalog
|
||||
name: "cura"
|
||||
}
|
||||
SystemPalette
|
||||
{
|
||||
id: palette
|
||||
}
|
||||
|
||||
ListModel
|
||||
{
|
||||
@ -68,45 +62,39 @@ UM.Dialog
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
spacing: 2 * screenScaleFactor
|
||||
Label
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Column
|
||||
{
|
||||
id: titleLabel
|
||||
text: catalog.i18nc("@action:title", "Summary - Cura Project")
|
||||
font.pointSize: 18
|
||||
}
|
||||
Rectangle
|
||||
{
|
||||
id: separator
|
||||
color: palette.text
|
||||
width: parent.width
|
||||
height: 1
|
||||
}
|
||||
Item // Spacer
|
||||
{
|
||||
height: doubleSpacerHeight
|
||||
width: height
|
||||
height: cildrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: titleLabel
|
||||
text: catalog.i18nc("@action:title", "Summary - Cura Project")
|
||||
font: UM.Theme.getFont("large")
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: separator
|
||||
color: UM.Theme.getColor("text")
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("default_lining").height
|
||||
}
|
||||
}
|
||||
|
||||
Row
|
||||
Item
|
||||
{
|
||||
height: childrenRect.height
|
||||
width: parent.width
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Printer settings")
|
||||
font.bold: true
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Item
|
||||
{
|
||||
// spacer
|
||||
height: spacerHeight
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
height: childrenRect.height
|
||||
|
||||
UM.TooltipArea
|
||||
{
|
||||
id: machineResolveStrategyTooltip
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
width: (parent.width / 3) | 0
|
||||
height: visible ? comboboxHeight : 0
|
||||
visible: base.visible && machineResolveComboBox.model.count > 1
|
||||
@ -157,64 +145,65 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
|
||||
Column
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Type")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: manager.machineType
|
||||
width: (parent.width / 3) | 0
|
||||
width: parent.width
|
||||
height: cildrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: printer_settings_label
|
||||
text: catalog.i18nc("@action:label", "Printer settings")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Type")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: manager.machineType
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: manager.machineName
|
||||
width: (parent.width / 3) | 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row
|
||||
Item
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", manager.isPrinterGroup ? "Printer Group" : "Printer Name")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: manager.machineName
|
||||
width: (parent.width / 3) | 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
Item // Spacer
|
||||
{
|
||||
height: doubleSpacerHeight
|
||||
width: height
|
||||
}
|
||||
Row
|
||||
{
|
||||
height: childrenRect.height
|
||||
width: parent.width
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Profile settings")
|
||||
font.bold: true
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Item
|
||||
{
|
||||
// spacer
|
||||
height: spacerHeight
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
UM.TooltipArea
|
||||
{
|
||||
id: qualityChangesResolveTooltip
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
width: (parent.width / 3) | 0
|
||||
height: visible ? comboboxHeight : 0
|
||||
visible: manager.qualityChangesConflict
|
||||
@ -232,96 +221,105 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
width: parent.width
|
||||
height: cildrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Profile settings")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Name")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: manager.qualityName
|
||||
width: (parent.width / 3) | 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Intent")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: manager.intentName
|
||||
width: (parent.width / 3) | 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Not in profile")
|
||||
visible: manager.numUserSettings != 0
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
|
||||
visible: manager.numUserSettings != 0
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Derivative from")
|
||||
visible: manager.numSettingsOverridenByQualityChanges != 0
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
|
||||
width: (parent.width / 3) | 0
|
||||
visible: manager.numSettingsOverridenByQualityChanges != 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Row
|
||||
|
||||
Item
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Name")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: manager.qualityName
|
||||
width: (parent.width / 3) | 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Intent")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: manager.intentName
|
||||
width: (parent.width / 3) | 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: manager.numUserSettings != 0 ? childrenRect.height : 0
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Not in profile")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", manager.numUserSettings).arg(manager.numUserSettings)
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
visible: manager.numUserSettings != 0
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: manager.numSettingsOverridenByQualityChanges != 0 ? childrenRect.height : 0
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Derivative from")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18ncp("@action:label", "%1, %2 override", "%1, %2 overrides", manager.numSettingsOverridenByQualityChanges).arg(manager.qualityType).arg(manager.numSettingsOverridenByQualityChanges)
|
||||
width: (parent.width / 3) | 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
visible: manager.numSettingsOverridenByQualityChanges != 0
|
||||
}
|
||||
Item // Spacer
|
||||
{
|
||||
height: doubleSpacerHeight
|
||||
width: height
|
||||
}
|
||||
Row
|
||||
{
|
||||
height: childrenRect.height
|
||||
width: parent.width
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Material settings")
|
||||
font.bold: true
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Item
|
||||
{
|
||||
// spacer
|
||||
height: spacerHeight
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
|
||||
UM.TooltipArea
|
||||
{
|
||||
id: materialResolveTooltip
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
width: (parent.width / 3) | 0
|
||||
height: visible ? comboboxHeight : 0
|
||||
visible: manager.materialConflict
|
||||
@ -339,76 +337,91 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
width: parent.width
|
||||
height: cildrenRect.height
|
||||
Row
|
||||
{
|
||||
height: childrenRect.height
|
||||
width: parent.width
|
||||
spacing: UM.Theme.getSize("narrow_margin").width
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Material settings")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
}
|
||||
|
||||
Repeater
|
||||
{
|
||||
model: manager.materialLabels
|
||||
delegate: Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Name")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: modelData
|
||||
width: (parent.width / 3) | 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Repeater
|
||||
Column
|
||||
{
|
||||
model: manager.materialLabels
|
||||
delegate: Row
|
||||
width: parent.width
|
||||
height: cildrenRect.height
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Setting visibility")
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Name")
|
||||
text: catalog.i18nc("@action:label", "Mode")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: modelData
|
||||
text: manager.activeMode
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
visible: manager.hasVisibleSettingsField
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Visible settings:")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings)
|
||||
width: (parent.width / 3) | 0
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item // Spacer
|
||||
{
|
||||
height: doubleSpacerHeight
|
||||
width: height
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Setting visibility")
|
||||
font.bold: true
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Mode")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: manager.activeMode
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
visible: manager.hasVisibleSettingsField
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Visible settings:")
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "%1 out of %2" ).arg(manager.numVisibleSettings).arg(manager.totalNumberOfSettings)
|
||||
width: (parent.width / 3) | 0
|
||||
}
|
||||
}
|
||||
Item // Spacer
|
||||
{
|
||||
height: spacerHeight
|
||||
width: height
|
||||
}
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
@ -418,12 +431,10 @@ UM.Dialog
|
||||
{
|
||||
width: warningLabel.height
|
||||
height: width
|
||||
|
||||
source: UM.Theme.getIcon("Information")
|
||||
color: palette.text
|
||||
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: warningLabel
|
||||
text: catalog.i18nc("@action:warning", "Loading a project will clear all models on the build plate.")
|
||||
@ -432,44 +443,22 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
Item
|
||||
{
|
||||
id: buttonsItem
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
Button
|
||||
|
||||
buttonSpacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
rightButtons: [
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
id: cancel_button
|
||||
text: catalog.i18nc("@action:button","Cancel");
|
||||
onClicked: { manager.onCancelButtonClicked() }
|
||||
enabled: true
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: ok_button.left
|
||||
anchors.rightMargin: 2 * screenScaleFactor
|
||||
}
|
||||
Button
|
||||
text: catalog.i18nc("@action:button", "Cancel")
|
||||
onClicked: reject()
|
||||
},
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
id: ok_button
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
text: catalog.i18nc("@action:button","Open");
|
||||
onClicked: { manager.closeBackend(); manager.onOkButtonClicked() }
|
||||
text: catalog.i18nc("@action:button", "Open")
|
||||
onClicked: accept()
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
function accept() {
|
||||
manager.closeBackend();
|
||||
manager.onOkButtonClicked();
|
||||
base.visible = false;
|
||||
base.accept();
|
||||
}
|
||||
|
||||
function reject() {
|
||||
manager.onCancelButtonClicked();
|
||||
base.visible = false;
|
||||
base.rejected();
|
||||
}
|
||||
onRejected: manager.onCancelButtonClicked()
|
||||
onAccepted: manager.onOkButtonClicked()
|
||||
}
|
||||
|
@ -1,39 +1,34 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
ScrollView
|
||||
ListView
|
||||
{
|
||||
property alias model: backupList.model
|
||||
width: parent.width
|
||||
clip: true
|
||||
ListView
|
||||
ScrollBar.vertical: UM.ScrollBar {}
|
||||
|
||||
delegate: Item
|
||||
{
|
||||
id: backupList
|
||||
width: parent.width
|
||||
delegate: Item
|
||||
// Add a margin, otherwise the scrollbar is on top of the right most component
|
||||
width: parent.width - UM.Theme.getSize("scrollbar").width
|
||||
height: childrenRect.height
|
||||
|
||||
BackupListItem
|
||||
{
|
||||
// Add a margin, otherwise the scrollbar is on top of the right most component
|
||||
width: parent.width - UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
id: backupListItem
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
BackupListItem
|
||||
{
|
||||
id: backupListItem
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: divider
|
||||
color: UM.Theme.getColor("lining")
|
||||
height: UM.Theme.getSize("default_lining").height
|
||||
}
|
||||
Rectangle
|
||||
{
|
||||
id: divider
|
||||
color: UM.Theme.getColor("lining")
|
||||
height: UM.Theme.getSize("default_lining").height
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,11 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Dialogs 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
@ -42,28 +41,22 @@ Item
|
||||
onClicked: backupListItem.showDetails = !backupListItem.showDetails
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: new Date(modelData.generated_time).toLocaleString(UM.Preferences.getValue("general/language"))
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 100 * screenScaleFactor
|
||||
Layout.maximumWidth: 500 * screenScaleFactor
|
||||
Layout.fillWidth: true
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: modelData.metadata.description
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 100 * screenScaleFactor
|
||||
Layout.maximumWidth: 500 * screenScaleFactor
|
||||
Layout.fillWidth: true
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Cura.SecondaryButton
|
||||
@ -94,21 +87,21 @@ Item
|
||||
anchors.top: dataRow.bottom
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: confirmDeleteDialog
|
||||
title: catalog.i18nc("@dialog:title", "Delete Backup")
|
||||
text: catalog.i18nc("@dialog:info", "Are you sure you want to delete this backup? This cannot be undone.")
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
onYes: CuraDrive.deleteBackup(modelData.backup_id)
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
onAccepted: CuraDrive.deleteBackup(modelData.backup_id)
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: confirmRestoreDialog
|
||||
title: catalog.i18nc("@dialog:title", "Restore Backup")
|
||||
text: catalog.i18nc("@dialog:info", "You will need to restart Cura before your backup is restored. Do you want to close Cura now?")
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
onYes: CuraDrive.restoreBackup(modelData.backup_id)
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
onAccepted: CuraDrive.restoreBackup(modelData.backup_id)
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import QtQuick 2.7
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
RowLayout
|
||||
{
|
||||
@ -26,27 +26,21 @@ RowLayout
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: detailName
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 50 * screenScaleFactor
|
||||
Layout.maximumWidth: 100 * screenScaleFactor
|
||||
Layout.fillWidth: true
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: detailValue
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 50 * screenScaleFactor
|
||||
Layout.maximumWidth: 100 * screenScaleFactor
|
||||
Layout.fillWidth: true
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import QtQuick 2.7
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
import "../components"
|
||||
@ -28,18 +28,14 @@ Column
|
||||
width: Math.round(parent.width / 4)
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: welcomeTextLabel
|
||||
text: catalog.i18nc("@description", "Backup and synchronize your Cura settings.")
|
||||
width: Math.round(parent.width / 2)
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
wrapMode: Label.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Cura.PrimaryButton
|
||||
|
@ -1,10 +1,9 @@
|
||||
// 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.10
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.6 as Cura
|
||||
|
@ -1,10 +1,9 @@
|
||||
// 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.10
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.6 as Cura
|
||||
|
@ -1,10 +1,9 @@
|
||||
// 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.10
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.6 as Cura
|
||||
|
@ -1,10 +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.10
|
||||
import Qt.labs.qmlmodels 1.0
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.6 as Cura
|
||||
@ -57,52 +57,32 @@ Item
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
|
||||
|
||||
Cura.TableView
|
||||
//We can't use Cura's TableView here, since in Cura >= 5.0 this uses QtQuick.TableView, while in Cura < 5.0 this uses QtControls1.TableView.
|
||||
//So we have to define our own. Once support for 4.13 and earlier is dropped, we can switch to Cura.TableView.
|
||||
Table
|
||||
{
|
||||
id: filesTableView
|
||||
anchors.fill: parent
|
||||
model: manager.digitalFactoryFileModel
|
||||
visible: model.count != 0 && manager.retrievingFileStatus != DF.RetrievalStatus.InProgress
|
||||
selectionMode: OldControls.SelectionMode.SingleSelection
|
||||
onDoubleClicked:
|
||||
anchors.margins: parent.border.width
|
||||
|
||||
columnHeaders: ["Name", "Uploaded by", "Uploaded at"]
|
||||
model: TableModel
|
||||
{
|
||||
TableModelColumn { display: "fileName" }
|
||||
TableModelColumn { display: "username" }
|
||||
TableModelColumn { display: "uploadedAt" }
|
||||
rows: manager.digitalFactoryFileModel.items
|
||||
}
|
||||
|
||||
onCurrentRowChanged:
|
||||
{
|
||||
manager.setSelectedFileIndices([currentRow]);
|
||||
}
|
||||
onDoubleClicked: function(row)
|
||||
{
|
||||
manager.setSelectedFileIndices([row]);
|
||||
openFilesButton.clicked();
|
||||
}
|
||||
|
||||
OldControls.TableViewColumn
|
||||
{
|
||||
id: fileNameColumn
|
||||
role: "fileName"
|
||||
title: "Name"
|
||||
width: Math.round(filesTableView.width / 3)
|
||||
}
|
||||
|
||||
OldControls.TableViewColumn
|
||||
{
|
||||
id: usernameColumn
|
||||
role: "username"
|
||||
title: "Uploaded by"
|
||||
width: Math.round(filesTableView.width / 3)
|
||||
}
|
||||
|
||||
OldControls.TableViewColumn
|
||||
{
|
||||
role: "uploadedAt"
|
||||
title: "Uploaded at"
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: filesTableView.selection
|
||||
function onSelectionChanged()
|
||||
{
|
||||
let newSelection = [];
|
||||
filesTableView.selection.forEach(function(rowIndex) { newSelection.push(rowIndex); });
|
||||
manager.setSelectedFileIndices(newSelection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
@ -161,7 +141,6 @@ Item
|
||||
{
|
||||
// Make sure no files are selected when the file model changes
|
||||
filesTableView.currentRow = -1
|
||||
filesTableView.selection.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -187,7 +166,7 @@ Item
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
text: "Open"
|
||||
enabled: filesTableView.selection.count > 0
|
||||
enabled: filesTableView.currentRow >= 0
|
||||
onClicked:
|
||||
{
|
||||
manager.openSelectedFiles()
|
||||
|
@ -1,10 +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 Qt.labs.qmlmodels 1.0
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.6 as Cura
|
||||
@ -86,35 +86,22 @@ Item
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
|
||||
|
||||
Cura.TableView
|
||||
//We can't use Cura's TableView here, since in Cura >= 5.0 this uses QtQuick.TableView, while in Cura < 5.0 this uses QtControls1.TableView.
|
||||
//So we have to define our own. Once support for 4.13 and earlier is dropped, we can switch to Cura.TableView.
|
||||
Table
|
||||
{
|
||||
id: filesTableView
|
||||
anchors.fill: parent
|
||||
model: manager.digitalFactoryFileModel
|
||||
visible: model.count != 0 && manager.retrievingFileStatus != DF.RetrievalStatus.InProgress
|
||||
selectionMode: OldControls.SelectionMode.NoSelection
|
||||
anchors.margins: parent.border.width
|
||||
|
||||
OldControls.TableViewColumn
|
||||
allowSelection: false
|
||||
columnHeaders: ["Name", "Uploaded by", "Uploaded at"]
|
||||
model: TableModel
|
||||
{
|
||||
id: fileNameColumn
|
||||
role: "fileName"
|
||||
title: "@tableViewColumn:title", "Name"
|
||||
width: Math.round(filesTableView.width / 3)
|
||||
}
|
||||
|
||||
OldControls.TableViewColumn
|
||||
{
|
||||
id: usernameColumn
|
||||
role: "username"
|
||||
title: "Uploaded by"
|
||||
width: Math.round(filesTableView.width / 3)
|
||||
}
|
||||
|
||||
OldControls.TableViewColumn
|
||||
{
|
||||
role: "uploadedAt"
|
||||
title: "Uploaded at"
|
||||
TableModelColumn { display: "fileName" }
|
||||
TableModelColumn { display: "username" }
|
||||
TableModelColumn { display: "uploadedAt" }
|
||||
rows: manager.digitalFactoryFileModel.items
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,8 +160,7 @@ Item
|
||||
function onItemsChanged()
|
||||
{
|
||||
// Make sure no files are selected when the file model changes
|
||||
filesTableView.currentRow = -1
|
||||
filesTableView.selection.clear()
|
||||
filesTableView.currentRow = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,9 @@
|
||||
// Copyright (C) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
//Copyright (C) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
@ -224,4 +222,4 @@ Item
|
||||
x: Math.round((parent.width - width) / 2)
|
||||
y: Math.round((parent.height - height) / 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
203
plugins/DigitalLibrary/resources/qml/Table.qml
Normal file
203
plugins/DigitalLibrary/resources/qml/Table.qml
Normal file
@ -0,0 +1,203 @@
|
||||
//Copyright (C) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import Qt.labs.qmlmodels 1.0
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import UM 1.2 as UM
|
||||
|
||||
/*
|
||||
* A re-sizeable table of data.
|
||||
*
|
||||
* This table combines a list of headers with a TableView to show certain roles in a table.
|
||||
* The columns of the table can be resized.
|
||||
* When the table becomes too big, you can scroll through the table. When a column becomes too small, the contents of
|
||||
* the table are elided.
|
||||
* The table gets Cura's themeing.
|
||||
*/
|
||||
Item
|
||||
{
|
||||
id: tableBase
|
||||
|
||||
required property var columnHeaders //The text to show in the headers of each column.
|
||||
property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items"
|
||||
property int currentRow: -1 //The selected row index.
|
||||
property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on.
|
||||
property bool allowSelection: true //Whether to allow the user to select items.
|
||||
|
||||
Row
|
||||
{
|
||||
id: headerBar
|
||||
Repeater
|
||||
{
|
||||
id: headerRepeater
|
||||
model: columnHeaders
|
||||
Rectangle
|
||||
{
|
||||
//minimumWidth: Math.max(1, Math.round(tableBase.width / headerRepeater.count))
|
||||
width: 300
|
||||
height: UM.Theme.getSize("section").height
|
||||
|
||||
color: UM.Theme.getColor("secondary")
|
||||
|
||||
Label
|
||||
{
|
||||
id: contentText
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("narrow_margin").width
|
||||
|
||||
text: modelData
|
||||
font: UM.Theme.getFont("medium_bold")
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Rectangle //Resize handle.
|
||||
{
|
||||
anchors
|
||||
{
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
}
|
||||
width: UM.Theme.getSize("thick_lining").width
|
||||
|
||||
color: UM.Theme.getColor("thick_lining")
|
||||
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
||||
cursorShape: Qt.SizeHorCursor
|
||||
drag
|
||||
{
|
||||
target: parent
|
||||
axis: Drag.XAxis
|
||||
}
|
||||
onMouseXChanged:
|
||||
{
|
||||
if(drag.active)
|
||||
{
|
||||
let new_width = parent.parent.width + mouseX;
|
||||
let sum_widths = mouseX;
|
||||
for(let i = 0; i < headerBar.children.length; ++i)
|
||||
{
|
||||
sum_widths += headerBar.children[i].width;
|
||||
}
|
||||
if(sum_widths > tableBase.width)
|
||||
{
|
||||
new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view.
|
||||
}
|
||||
let width_fraction = new_width / tableBase.width; //Scale with the same fraction along with the total width, if the table is resized.
|
||||
parent.parent.width = Qt.binding(function() { return Math.max(10, Math.round(tableBase.width * width_fraction)) });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onWidthChanged:
|
||||
{
|
||||
tableView.forceLayout(); //Rescale table cells underneath as well.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TableView
|
||||
{
|
||||
id: tableView
|
||||
anchors
|
||||
{
|
||||
top: headerBar.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
|
||||
flickableDirection: Flickable.AutoFlickIfNeeded
|
||||
clip: true
|
||||
ScrollBar.vertical: ScrollBar
|
||||
{
|
||||
// Vertical ScrollBar, styled similarly to the scrollBar in the settings panel
|
||||
id: verticalScrollBar
|
||||
visible: tableView.contentHeight > tableView.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; } }
|
||||
}
|
||||
}
|
||||
columnWidthProvider: function(column)
|
||||
{
|
||||
return headerBar.children[column].width; //Cells get the same width as their column header.
|
||||
}
|
||||
|
||||
delegate: Rectangle
|
||||
{
|
||||
implicitHeight: Math.max(1, cellContent.height)
|
||||
|
||||
color: UM.Theme.getColor((tableBase.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background"))
|
||||
|
||||
Label
|
||||
{
|
||||
id: cellContent
|
||||
width: parent.width
|
||||
|
||||
text: display
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
TextMetrics
|
||||
{
|
||||
id: cellTextMetrics
|
||||
text: cellContent.text
|
||||
font: cellContent.font
|
||||
elide: cellContent.elide
|
||||
elideWidth: cellContent.width
|
||||
}
|
||||
UM.TooltipArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
||||
acceptedButtons: Qt.LeftButton
|
||||
text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided.
|
||||
onClicked:
|
||||
{
|
||||
if(tableBase.allowSelection)
|
||||
{
|
||||
tableBase.currentRow = row; //Select this row.
|
||||
}
|
||||
}
|
||||
onDoubleClicked:
|
||||
{
|
||||
tableBase.onDoubleClicked(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: model
|
||||
function onRowCountChanged()
|
||||
{
|
||||
tableView.contentY = 0; //When the number of rows is reduced, make sure to scroll back to the start.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,19 +1,19 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Dialogs 1.2 // For filedialog
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
||||
Cura.MachineAction
|
||||
{
|
||||
anchors.fill: parent;
|
||||
anchors.fill: parent
|
||||
property bool printerConnected: Cura.MachineManager.printerConnected
|
||||
property var activeOutputDevice: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||
property bool canUpdateFirmware: activeOutputDevice ? activeOutputDevice.activePrinter.canUpdateFirmware : false
|
||||
@ -25,25 +25,22 @@ Cura.MachineAction
|
||||
UM.I18nCatalog { id: catalog; name: "cura"}
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: parent.width
|
||||
text: catalog.i18nc("@title", "Update Firmware")
|
||||
wrapMode: Text.WordWrap
|
||||
font.pointSize: 18
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
text: catalog.i18nc("@label", "Firmware is the piece of software running directly on your 3D printer. This firmware controls the step motors, regulates the temperature and ultimately makes your printer work.")
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
text: catalog.i18nc("@label", "The firmware shipping with new printers works, but new versions tend to have more features and improvements.");
|
||||
text: catalog.i18nc("@label", "The firmware shipping with new printers works, but new versions tend to have more features and improvements.")
|
||||
}
|
||||
|
||||
Row
|
||||
@ -52,10 +49,10 @@ Cura.MachineAction
|
||||
width: childrenRect.width
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
property string firmwareName: Cura.MachineManager.activeMachine.getDefaultFirmwareName()
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: autoUpgradeButton
|
||||
text: catalog.i18nc("@action:button", "Automatically upgrade Firmware");
|
||||
text: catalog.i18nc("@action:button", "Automatically upgrade Firmware")
|
||||
enabled: parent.firmwareName != "" && canUpdateFirmware
|
||||
onClicked:
|
||||
{
|
||||
@ -63,10 +60,10 @@ Cura.MachineAction
|
||||
activeOutputDevice.updateFirmware(parent.firmwareName);
|
||||
}
|
||||
}
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: manualUpgradeButton
|
||||
text: catalog.i18nc("@action:button", "Upload custom Firmware");
|
||||
text: catalog.i18nc("@action:button", "Upload custom Firmware")
|
||||
enabled: canUpdateFirmware
|
||||
onClicked:
|
||||
{
|
||||
@ -75,20 +72,18 @@ Cura.MachineAction
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
visible: !printerConnected && !updateProgressDialog.visible
|
||||
text: catalog.i18nc("@label", "Firmware can not be updated because there is no connection with the printer.");
|
||||
text: catalog.i18nc("@label", "Firmware can not be updated because there is no connection with the printer.")
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
visible: printerConnected && !canUpdateFirmware
|
||||
text: catalog.i18nc("@label", "Firmware can not be updated because the connection with the printer does not support upgrading firmware.");
|
||||
text: catalog.i18nc("@label", "Firmware can not be updated because the connection with the printer does not support upgrading firmware.")
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +117,7 @@ Cura.MachineAction
|
||||
{
|
||||
anchors.fill: parent
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
anchors
|
||||
{
|
||||
@ -157,12 +152,10 @@ Cura.MachineAction
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
ProgressBar
|
||||
UM.ProgressBar
|
||||
{
|
||||
id: prog
|
||||
value: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareProgress : 0
|
||||
minimumValue: 0
|
||||
maximumValue: 100
|
||||
value: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareProgress / 100 : 0
|
||||
indeterminate:
|
||||
{
|
||||
if(manager.firmwareUpdater == null)
|
||||
@ -173,18 +166,18 @@ Cura.MachineAction
|
||||
}
|
||||
anchors
|
||||
{
|
||||
left: parent.left;
|
||||
right: parent.right;
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button","Close");
|
||||
enabled: (manager.firmwareUpdater != null) ? manager.firmwareUpdater.firmwareUpdateState != 1 : true;
|
||||
onClicked: updateProgressDialog.visible = false;
|
||||
text: catalog.i18nc("@action:button", "Close")
|
||||
enabled: manager.firmwareUpdater != null ? manager.firmwareUpdater.firmwareUpdateState != 1 : true
|
||||
onClicked: updateProgressDialog.visible = false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,239 +1,333 @@
|
||||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
UM.Dialog
|
||||
{
|
||||
width: minimumWidth;
|
||||
minimumWidth: 350 * screenScaleFactor;
|
||||
title: catalog.i18nc("@title:window", "Convert Image")
|
||||
|
||||
height: minimumHeight;
|
||||
minimumHeight: 250 * screenScaleFactor;
|
||||
|
||||
title: catalog.i18nc("@title:window", "Convert Image...")
|
||||
minimumWidth: grid.width + 2 * UM.Theme.getSize("default_margin").height
|
||||
minimumHeight: UM.Theme.getSize("modal_window_minimum").height
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
GridLayout
|
||||
{
|
||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
anchors.fill: parent;
|
||||
Layout.fillWidth: true
|
||||
columnSpacing: 16 * screenScaleFactor
|
||||
rowSpacing: 4 * screenScaleFactor
|
||||
columns: 1
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
id: grid
|
||||
columnSpacing: UM.Theme.getSize("narrow_margin").width
|
||||
rowSpacing: UM.Theme.getSize("narrow_margin").height
|
||||
columns: 2
|
||||
|
||||
UM.TooltipArea {
|
||||
Layout.fillWidth:true
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","The maximum distance of each pixel from \"Base.\"")
|
||||
Row {
|
||||
width: parent.width
|
||||
UM.Label
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
text: catalog.i18nc("@action:label", "Height (mm)")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
Label {
|
||||
text: catalog.i18nc("@action:label", "Height (mm)")
|
||||
width: 150 * screenScaleFactor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: peak_height
|
||||
objectName: "Peak_Height"
|
||||
validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/}
|
||||
width: 180 * screenScaleFactor
|
||||
onTextChanged: { manager.onPeakHeightChanged(text) }
|
||||
}
|
||||
MouseArea {
|
||||
id: peak_height_label
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea {
|
||||
Layout.fillWidth:true
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","The base height from the build plate in millimeters.")
|
||||
Row {
|
||||
width: parent.width
|
||||
Cura.TextField
|
||||
{
|
||||
id: peak_height
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
selectByMouse: true
|
||||
objectName: "Peak_Height"
|
||||
validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ }
|
||||
onTextChanged: manager.onPeakHeightChanged(text)
|
||||
}
|
||||
|
||||
Label {
|
||||
text: catalog.i18nc("@action:label", "Base (mm)")
|
||||
width: 150 * screenScaleFactor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
Cura.ToolTip
|
||||
{
|
||||
text: catalog.i18nc("@info:tooltip", "The maximum distance of each pixel from \"Base.\"")
|
||||
visible: peak_height.hovered || peak_height_label.containsMouse
|
||||
targetPoint: Qt.point(peak_height.x + Math.round(peak_height.width / 2), 0)
|
||||
y: peak_height.y + peak_height.height + UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: base_height
|
||||
objectName: "Base_Height"
|
||||
validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/}
|
||||
width: 180 * screenScaleFactor
|
||||
onTextChanged: { manager.onBaseHeightChanged(text) }
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
text: catalog.i18nc("@action:label", "Base (mm)")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: base_height_label
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea {
|
||||
Layout.fillWidth:true
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","The width in millimeters on the build plate.")
|
||||
Row {
|
||||
width: parent.width
|
||||
Cura.TextField
|
||||
{
|
||||
id: base_height
|
||||
selectByMouse: true
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
objectName: "Base_Height"
|
||||
validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ }
|
||||
onTextChanged: manager.onBaseHeightChanged(text)
|
||||
}
|
||||
|
||||
Label {
|
||||
text: catalog.i18nc("@action:label", "Width (mm)")
|
||||
width: 150 * screenScaleFactor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
Cura.ToolTip
|
||||
{
|
||||
text: catalog.i18nc("@info:tooltip", "The base height from the build plate in millimeters.")
|
||||
visible: base_height.hovered || base_height_label.containsMouse
|
||||
targetPoint: Qt.point(base_height.x + Math.round(base_height.width / 2), 0)
|
||||
y: base_height.y + base_height.height + UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: width
|
||||
objectName: "Width"
|
||||
focus: true
|
||||
validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
|
||||
width: 180 * screenScaleFactor
|
||||
onTextChanged: { manager.onWidthChanged(text) }
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
text: catalog.i18nc("@action:label", "Width (mm)")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
MouseArea {
|
||||
id: width_label
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea {
|
||||
Layout.fillWidth:true
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","The depth in millimeters on the build plate")
|
||||
Row {
|
||||
width: parent.width
|
||||
Cura.TextField
|
||||
{
|
||||
id: width
|
||||
selectByMouse: true
|
||||
objectName: "Width"
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
focus: true
|
||||
validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ }
|
||||
onTextChanged: manager.onWidthChanged(text)
|
||||
}
|
||||
|
||||
Label {
|
||||
text: catalog.i18nc("@action:label", "Depth (mm)")
|
||||
width: 150 * screenScaleFactor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
TextField {
|
||||
id: depth
|
||||
objectName: "Depth"
|
||||
focus: true
|
||||
validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
|
||||
width: 180 * screenScaleFactor
|
||||
onTextChanged: { manager.onDepthChanged(text) }
|
||||
}
|
||||
Cura.ToolTip
|
||||
{
|
||||
text: catalog.i18nc("@info:tooltip", "The width in millimeters on the build plate")
|
||||
visible: width.hovered || width_label.containsMouse
|
||||
targetPoint: Qt.point(width.x + Math.round(width.width / 2), 0)
|
||||
y: width.y + width.height + UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
text: catalog.i18nc("@action:label", "Depth (mm)")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
MouseArea {
|
||||
id: depth_label
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea {
|
||||
Layout.fillWidth:true
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.")
|
||||
Row {
|
||||
width: parent.width
|
||||
Cura.TextField
|
||||
{
|
||||
id: depth
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
selectByMouse: true
|
||||
objectName: "Depth"
|
||||
focus: true
|
||||
validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ }
|
||||
onTextChanged: manager.onDepthChanged(text)
|
||||
}
|
||||
|
||||
//Empty label so 2 column layout works.
|
||||
Label {
|
||||
text: ""
|
||||
width: 150 * screenScaleFactor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
ComboBox {
|
||||
id: lighter_is_higher
|
||||
objectName: "Lighter_Is_Higher"
|
||||
model: [ catalog.i18nc("@item:inlistbox","Darker is higher"), catalog.i18nc("@item:inlistbox","Lighter is higher") ]
|
||||
width: 180 * screenScaleFactor
|
||||
onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) }
|
||||
}
|
||||
Cura.ToolTip
|
||||
{
|
||||
text: catalog.i18nc("@info:tooltip", "The depth in millimeters on the build plate")
|
||||
visible: depth.hovered || depth_label.containsMouse
|
||||
targetPoint: Qt.point(depth.x + Math.round(depth.width / 2), 0)
|
||||
y: depth.y + depth.height + UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
text: ""
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
MouseArea {
|
||||
id: lighter_is_higher_label
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea {
|
||||
Layout.fillWidth:true
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.")
|
||||
Row {
|
||||
width: parent.width
|
||||
Cura.ComboBox
|
||||
{
|
||||
id: lighter_is_higher
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
Layout.preferredHeight: UM.Theme.getSize("setting_control").height
|
||||
objectName: "Lighter_Is_Higher"
|
||||
textRole: "text"
|
||||
model: [
|
||||
{ text: catalog.i18nc("@item:inlistbox", "Darker is higher") },
|
||||
{ text: catalog.i18nc("@item:inlistbox", "Lighter is higher") }
|
||||
]
|
||||
onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) }
|
||||
}
|
||||
|
||||
Label {
|
||||
text: "Color Model"
|
||||
width: 150 * screenScaleFactor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
ComboBox {
|
||||
id: color_model
|
||||
objectName: "ColorModel"
|
||||
model: [ catalog.i18nc("@item:inlistbox","Linear"), catalog.i18nc("@item:inlistbox","Translucency") ]
|
||||
width: 180 * screenScaleFactor
|
||||
onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) }
|
||||
}
|
||||
Cura.ToolTip
|
||||
{
|
||||
text: catalog.i18nc("@info:tooltip", "For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.")
|
||||
visible: lighter_is_higher.hovered || lighter_is_higher_label.containsMouse
|
||||
targetPoint: Qt.point(lighter_is_higher.x + Math.round(lighter_is_higher.width / 2), 0)
|
||||
y: lighter_is_higher.y + lighter_is_higher.height + UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
text: catalog.i18nc("@action:label", "Color Model")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
MouseArea {
|
||||
id: color_model_label
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea {
|
||||
Layout.fillWidth:true
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.")
|
||||
visible: color_model.currentText == catalog.i18nc("@item:inlistbox","Translucency")
|
||||
Row {
|
||||
width: parent.width
|
||||
Cura.ComboBox
|
||||
{
|
||||
id: color_model
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
Layout.preferredHeight: UM.Theme.getSize("setting_control").height
|
||||
objectName: "ColorModel"
|
||||
textRole: "text"
|
||||
model: [
|
||||
{ text: catalog.i18nc("@item:inlistbox", "Linear") },
|
||||
{ text: catalog.i18nc("@item:inlistbox", "Translucency") }
|
||||
]
|
||||
onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) }
|
||||
}
|
||||
|
||||
Label {
|
||||
text: catalog.i18nc("@action:label", "1mm Transmittance (%)")
|
||||
width: 150 * screenScaleFactor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
TextField {
|
||||
id: transmittance
|
||||
objectName: "Transmittance"
|
||||
focus: true
|
||||
validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/}
|
||||
width: 180 * screenScaleFactor
|
||||
onTextChanged: { manager.onTransmittanceChanged(text) }
|
||||
}
|
||||
Cura.ToolTip
|
||||
{
|
||||
text: catalog.i18nc("@info:tooltip", "For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.")
|
||||
visible: color_model.hovered || color_model_label.containsMouse
|
||||
targetPoint: Qt.point(color_model.x + Math.round(color_model.width / 2), 0)
|
||||
y: color_model.y + color_model.height + UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
text: catalog.i18nc("@action:label", "1mm Transmittance (%)")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
MouseArea {
|
||||
id: transmittance_label
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea {
|
||||
Layout.fillWidth:true
|
||||
height: childrenRect.height
|
||||
text: catalog.i18nc("@info:tooltip","The amount of smoothing to apply to the image.")
|
||||
Row {
|
||||
width: parent.width
|
||||
Cura.TextField
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
selectByMouse: true
|
||||
objectName: "Transmittance"
|
||||
validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ }
|
||||
onTextChanged: manager.onTransmittanceChanged(text)
|
||||
|
||||
Label {
|
||||
text: catalog.i18nc("@action:label", "Smoothing")
|
||||
width: 150 * screenScaleFactor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Item {
|
||||
width: 180 * screenScaleFactor
|
||||
height: 20 * screenScaleFactor
|
||||
Layout.fillWidth: true
|
||||
|
||||
Slider {
|
||||
id: smoothing
|
||||
objectName: "Smoothing"
|
||||
maximumValue: 100.0
|
||||
stepSize: 1.0
|
||||
width: 180
|
||||
onValueChanged: { manager.onSmoothingChanged(value) }
|
||||
}
|
||||
}
|
||||
Cura.ToolTip
|
||||
{
|
||||
text: catalog.i18nc("@info:tooltip", "The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.")
|
||||
visible: parent.hovered || transmittance_label.containsMouse
|
||||
targetPoint: Qt.point(parent.x + Math.round(parent.width / 2), 0)
|
||||
y: parent.y + parent.height + UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
text: catalog.i18nc("@action:label", "Smoothing")
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: smoothing_label
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
|
||||
Cura.SpinBox
|
||||
{
|
||||
id: smoothing
|
||||
Layout.fillWidth: true
|
||||
Layout.minimumWidth: UM.Theme.getSize("setting_control").width
|
||||
objectName: "Smoothing"
|
||||
to: 100.0
|
||||
stepSize: 1.0
|
||||
onValueChanged: manager.onSmoothingChanged(value)
|
||||
}
|
||||
|
||||
Cura.ToolTip
|
||||
{
|
||||
text: catalog.i18nc("@info:tooltip", "The amount of smoothing to apply to the image.")
|
||||
visible: smoothing.hovered || smoothing_label.containsMouse
|
||||
targetPoint: Qt.point(smoothing.x + Math.round(smoothing.width / 2), 0)
|
||||
y: smoothing.y + smoothing.height + UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
ButtonGroup
|
||||
{
|
||||
buttons: [ok_button, cancel_button]
|
||||
checkedButton: ok_button
|
||||
}
|
||||
}
|
||||
|
||||
onAccepted: manager.onOkButtonClicked()
|
||||
onRejected: manager.onCancelButtonClicked()
|
||||
|
||||
buttonSpacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
rightButtons: [
|
||||
Button
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
id:ok_button
|
||||
text: catalog.i18nc("@action:button","OK");
|
||||
onClicked: { manager.onOkButtonClicked() }
|
||||
enabled: true
|
||||
id: cancel_button
|
||||
text: catalog.i18nc("@action:button", "Cancel")
|
||||
onClicked: manager.onCancelButtonClicked()
|
||||
},
|
||||
Button
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
id:cancel_button
|
||||
text: catalog.i18nc("@action:button","Cancel");
|
||||
onClicked: { manager.onCancelButtonClicked() }
|
||||
enabled: true
|
||||
id: ok_button
|
||||
text: catalog.i18nc("@action:button", "OK")
|
||||
onClicked: manager.onOkButtonClicked()
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
//Copyright (c) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ Cura.MachineAction
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: machineNameLabel
|
||||
anchors.top: parent.top
|
||||
@ -97,7 +97,6 @@ Cura.MachineAction
|
||||
text: Cura.MachineManager.activeMachine.name
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
UM.TabRow
|
||||
@ -111,6 +110,7 @@ Cura.MachineAction
|
||||
model: tabNameModel
|
||||
delegate: UM.TabRowButton
|
||||
{
|
||||
checked: model.index == 0
|
||||
text: model.name
|
||||
}
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ UM.Dialog
|
||||
{
|
||||
id: licenseDialog
|
||||
title: catalog.i18nc("@button", "Plugin license agreement")
|
||||
minimumWidth: UM.Theme.getSize("license_window_minimum").width
|
||||
minimumHeight: UM.Theme.getSize("license_window_minimum").height
|
||||
minimumWidth: UM.Theme.getSize("modal_window_minimum").width
|
||||
minimumHeight: UM.Theme.getSize("modal_window_minimum").height
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
backgroundColor: UM.Theme.getColor("main_background")
|
||||
|
@ -64,8 +64,8 @@ Window
|
||||
// Page title.
|
||||
Item
|
||||
{
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
|
||||
Layout.preferredWidth: parent.width
|
||||
Layout.preferredHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
|
||||
|
||||
Label
|
||||
{
|
||||
|
@ -2,43 +2,20 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
|
||||
|
||||
Button
|
||||
UM.SimpleButton
|
||||
{
|
||||
id: modelCheckerButton
|
||||
|
||||
UM.I18nCatalog
|
||||
{
|
||||
id: catalog
|
||||
name: "cura"
|
||||
}
|
||||
|
||||
visible: manager.hasWarnings
|
||||
tooltip: catalog.i18nc("@info:tooltip", "Some things could be problematic in this print. Click to see tips for adjustment.")
|
||||
onClicked: manager.showWarnings()
|
||||
|
||||
width: UM.Theme.getSize("save_button_specs_icons").width
|
||||
height: UM.Theme.getSize("save_button_specs_icons").height
|
||||
|
||||
iconSource: "model_checker.svg"
|
||||
anchors.verticalCenter: parent ? parent.verticalCenter : undefined
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Item
|
||||
{
|
||||
UM.RecolorImage
|
||||
{
|
||||
width: UM.Theme.getSize("save_button_specs_icons").width;
|
||||
height: UM.Theme.getSize("save_button_specs_icons").height;
|
||||
sourceSize.height: width;
|
||||
color: control.hovered ? UM.Theme.getColor("text_scene_hover") : UM.Theme.getColor("text_scene");
|
||||
source: "model_checker.svg"
|
||||
}
|
||||
}
|
||||
}
|
||||
color: UM.Theme.getColor("text_scene")
|
||||
hoverColor: UM.Theme.getColor("text_scene_hover")
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.0
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
// We show a nice overlay on the 3D viewer when the current output device has no monitor view
|
||||
@ -90,7 +90,7 @@ Rectangle
|
||||
visible: monitorViewComponent.sourceComponent == null
|
||||
|
||||
// CASE 2: CAN MONITOR & NOT CONNECTED
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
anchors
|
||||
{
|
||||
@ -99,14 +99,10 @@ Rectangle
|
||||
visible: isNetworkConfigured && !isConnected
|
||||
text: catalog.i18nc("@info", "Please make sure your printer has a connection:\n- Check if the printer is turned on.\n- Check if the printer is connected to the network.\n- Check if you are signed in to discover cloud-connected printers.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("text")
|
||||
wrapMode: Text.WordWrap
|
||||
lineHeight: UM.Theme.getSize("monitor_text_line_large").height
|
||||
lineHeightMode: Text.FixedHeight
|
||||
width: contentWidth
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: noNetworkLabel
|
||||
anchors
|
||||
@ -116,11 +112,7 @@ Rectangle
|
||||
visible: !isNetworkConfigured && isNetworkConfigurable
|
||||
text: catalog.i18nc("@info", "Please connect your printer to the network.")
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("text")
|
||||
wrapMode: Text.WordWrap
|
||||
width: contentWidth
|
||||
lineHeight: UM.Theme.getSize("monitor_text_line_large").height
|
||||
lineHeightMode: Text.FixedHeight
|
||||
}
|
||||
Item
|
||||
{
|
||||
@ -129,7 +121,6 @@ Rectangle
|
||||
left: noNetworkLabel.left
|
||||
}
|
||||
visible: !isNetworkConfigured && isNetworkConfigurable
|
||||
height: UM.Theme.getSize("monitor_text_line").height
|
||||
width: childrenRect.width
|
||||
|
||||
UM.RecolorImage
|
||||
@ -138,8 +129,8 @@ Rectangle
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: UM.Theme.getColor("text_link")
|
||||
source: UM.Theme.getIcon("LinkExternal")
|
||||
width: UM.Theme.getSize("monitor_external_link_icon").width
|
||||
height: UM.Theme.getSize("monitor_external_link_icon").height
|
||||
width: UM.Theme.getSize("icon_indicator").width
|
||||
height: UM.Theme.getSize("icon_indicator").height
|
||||
}
|
||||
Label
|
||||
{
|
||||
|
@ -1,59 +1,62 @@
|
||||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import ".."
|
||||
|
||||
Button {
|
||||
id: base;
|
||||
|
||||
style: ButtonStyle {
|
||||
background: Item { }
|
||||
label: Row
|
||||
background: Rectangle {
|
||||
color: UM.Theme.getColor("category_background")
|
||||
}
|
||||
|
||||
contentItem: Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_lining").width
|
||||
|
||||
Item //Wrapper to give space before icon with fixed width. This allows aligning checkbox with category icon.
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_lining").width
|
||||
height: label.height
|
||||
width: height
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: (label.height / 2) | 0
|
||||
width: height
|
||||
source: control.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight");
|
||||
color: control.hovered ? palette.highlight : palette.buttonText
|
||||
source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight")
|
||||
color: base.hovered ? UM.Theme.getColor("primary_button_hover"): UM.Theme.getColor("text")
|
||||
}
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: label.height
|
||||
width: height
|
||||
source: control.iconSource
|
||||
color: control.hovered ? palette.highlight : palette.buttonText
|
||||
}
|
||||
Label
|
||||
{
|
||||
id: label
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: control.text
|
||||
color: control.hovered ? palette.highlight : palette.buttonText
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
SystemPalette { id: palette }
|
||||
}
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: label.height
|
||||
width: height
|
||||
source: UM.Theme.getIcon(definition.icon)
|
||||
color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text")
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
id: label
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: base.text
|
||||
color: base.hovered ? UM.Theme.getColor("primary_button_hover") : UM.Theme.getColor("text")
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
|
||||
signal showTooltip(string text);
|
||||
signal hideTooltip();
|
||||
signal showTooltip(string text)
|
||||
signal hideTooltip()
|
||||
signal contextMenuRequested()
|
||||
|
||||
text: definition.label
|
||||
iconSource: UM.Theme.getIcon(definition.icon)
|
||||
|
||||
checkable: true
|
||||
checked: definition.expanded
|
||||
|
@ -3,25 +3,32 @@
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.5 as UM
|
||||
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
UM.TooltipArea
|
||||
{
|
||||
x: model.depth * UM.Theme.getSize("default_margin").width;
|
||||
text: model.description;
|
||||
x: model.depth * UM.Theme.getSize("default_margin").width
|
||||
text: model.description
|
||||
|
||||
width: childrenRect.width;
|
||||
height: childrenRect.height;
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
|
||||
Item
|
||||
{
|
||||
id: spacer
|
||||
// Align checkbox with PerObjectCategory icon
|
||||
width: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
UM.CheckBox
|
||||
{
|
||||
id: check
|
||||
|
||||
anchors.left: spacer.right
|
||||
|
||||
text: definition.label
|
||||
checked: addedSettingsModel.getVisible(model.key)
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
// Copyright (c) 2021 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the LGPLv3 or higher.
|
||||
//Copyright (c) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Controls.Styles 1.2
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import ".."
|
||||
|
||||
@ -76,63 +75,72 @@ Item
|
||||
id: meshTypeButtons
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Button
|
||||
Cura.ToolbarButton
|
||||
{
|
||||
id: normalButton
|
||||
text: catalog.i18nc("@label", "Normal model")
|
||||
iconSource: UM.Theme.getIcon("Infill0");
|
||||
toolItem: UM.RecolorImage
|
||||
{
|
||||
source: UM.Theme.getIcon("Infill0")
|
||||
color: UM.Theme.getColor("icon")
|
||||
}
|
||||
property bool needBorder: true
|
||||
checkable: true
|
||||
onClicked: setMeshType(normalMeshType);
|
||||
style: UM.Theme.styles.tool_button;
|
||||
z: 4
|
||||
}
|
||||
|
||||
Button
|
||||
Cura.ToolbarButton
|
||||
{
|
||||
id: supportMeshButton
|
||||
text: catalog.i18nc("@label", "Print as support")
|
||||
iconSource: UM.Theme.getIcon("MeshTypeSupport");
|
||||
toolItem: UM.RecolorImage
|
||||
{
|
||||
source: UM.Theme.getIcon("MeshTypeSupport")
|
||||
color: UM.Theme.getColor("icon")
|
||||
}
|
||||
property bool needBorder: true
|
||||
checkable:true
|
||||
onClicked: setMeshType(supportMeshType)
|
||||
style: UM.Theme.styles.tool_button;
|
||||
z: 3
|
||||
}
|
||||
|
||||
Button
|
||||
Cura.ToolbarButton
|
||||
{
|
||||
id: overlapMeshButton
|
||||
text: catalog.i18nc("@label", "Modify settings for overlaps")
|
||||
iconSource: UM.Theme.getIcon("MeshTypeIntersect");
|
||||
toolItem: UM.RecolorImage
|
||||
{
|
||||
source: UM.Theme.getIcon("MeshTypeIntersect")
|
||||
color: UM.Theme.getColor("icon")
|
||||
}
|
||||
property bool needBorder: true
|
||||
checkable:true
|
||||
onClicked: setMeshType(infillMeshType)
|
||||
style: UM.Theme.styles.tool_button;
|
||||
z: 2
|
||||
}
|
||||
|
||||
Button
|
||||
Cura.ToolbarButton
|
||||
{
|
||||
id: antiOverhangMeshButton
|
||||
text: catalog.i18nc("@label", "Don't support overlaps")
|
||||
iconSource: UM.Theme.getIcon("BlockSupportOverlaps");
|
||||
toolItem: UM.RecolorImage
|
||||
{
|
||||
source: UM.Theme.getIcon("BlockSupportOverlaps")
|
||||
color: UM.Theme.getColor("icon")
|
||||
}
|
||||
property bool needBorder: true
|
||||
checkable: true
|
||||
onClicked: setMeshType(antiOverhangMeshType)
|
||||
style: UM.Theme.styles.tool_button;
|
||||
z: 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: meshTypeLabel
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
height: UM.Theme.getSize("setting").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
|
||||
@ -182,189 +190,184 @@ Item
|
||||
height: Math.min(contents.count * (UM.Theme.getSize("section").height + UM.Theme.getSize("default_lining").height), maximumHeight)
|
||||
visible: currentMeshType != "anti_overhang_mesh"
|
||||
|
||||
ScrollView
|
||||
ListView
|
||||
{
|
||||
id: contents
|
||||
height: parent.height
|
||||
width: UM.Theme.getSize("setting").width + UM.Theme.getSize("default_margin").width
|
||||
style: UM.Theme.styles.scrollview
|
||||
|
||||
ListView
|
||||
ScrollBar.vertical: UM.ScrollBar {}
|
||||
clip: true
|
||||
spacing: UM.Theme.getSize("default_lining").height
|
||||
|
||||
model: UM.SettingDefinitionsModel
|
||||
{
|
||||
id: contents
|
||||
spacing: UM.Theme.getSize("default_lining").height
|
||||
|
||||
model: UM.SettingDefinitionsModel
|
||||
id: addedSettingsModel
|
||||
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
||||
expanded: [ "*" ]
|
||||
filter:
|
||||
{
|
||||
id: addedSettingsModel
|
||||
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
||||
expanded: [ "*" ]
|
||||
filter:
|
||||
if (printSequencePropertyProvider.properties.value == "one_at_a_time")
|
||||
{
|
||||
if (printSequencePropertyProvider.properties.value == "one_at_a_time")
|
||||
return {"settable_per_meshgroup": true}
|
||||
}
|
||||
return {"settable_per_mesh": true}
|
||||
}
|
||||
exclude:
|
||||
{
|
||||
var excluded_settings = [ "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
|
||||
|
||||
if (currentMeshType == "support_mesh")
|
||||
{
|
||||
excluded_settings = excluded_settings.concat(base.allCategoriesExceptSupport)
|
||||
}
|
||||
return excluded_settings
|
||||
}
|
||||
|
||||
visibilityHandler: Cura.PerObjectSettingVisibilityHandler
|
||||
{
|
||||
id: visibility_handler
|
||||
selectedObjectId: UM.ActiveTool.properties.getValue("SelectedObjectId")
|
||||
}
|
||||
|
||||
// For some reason the model object is updated after removing him from the memory and
|
||||
// it happens only on Windows. For this reason, set the destroyed value manually.
|
||||
Component.onDestruction:
|
||||
{
|
||||
setDestroyed(true)
|
||||
}
|
||||
}
|
||||
|
||||
delegate: Row
|
||||
{
|
||||
spacing: - UM.Theme.getSize("default_margin").width
|
||||
Loader
|
||||
{
|
||||
id: settingLoader
|
||||
width: UM.Theme.getSize("setting").width
|
||||
height: UM.Theme.getSize("section").height
|
||||
enabled: provider.properties.enabled === "True"
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: addedSettingsModel
|
||||
property var propertyProvider: provider
|
||||
property var globalPropertyProvider: inheritStackProvider
|
||||
property var externalResetHandler: false
|
||||
|
||||
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
|
||||
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
|
||||
//causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
|
||||
asynchronous: model.type != "enum" && model.type != "extruder"
|
||||
|
||||
onLoaded:
|
||||
{
|
||||
settingLoader.item.showRevertButton = false
|
||||
settingLoader.item.showInheritButton = false
|
||||
settingLoader.item.showLinkedSettingIcon = false
|
||||
settingLoader.item.doDepthIndentation = false
|
||||
settingLoader.item.doQualityUserSettingEmphasis = false
|
||||
}
|
||||
|
||||
sourceComponent:
|
||||
{
|
||||
switch(model.type)
|
||||
{
|
||||
return {"settable_per_meshgroup": true}
|
||||
case "int":
|
||||
return settingTextField
|
||||
case "[int]":
|
||||
return settingTextField
|
||||
case "float":
|
||||
return settingTextField
|
||||
case "enum":
|
||||
return settingComboBox
|
||||
case "extruder":
|
||||
return settingExtruder
|
||||
case "optional_extruder":
|
||||
return settingOptionalExtruder
|
||||
case "bool":
|
||||
return settingCheckBox
|
||||
case "str":
|
||||
return settingTextField
|
||||
case "category":
|
||||
return settingCategory
|
||||
default:
|
||||
return settingUnknown
|
||||
}
|
||||
return {"settable_per_mesh": true}
|
||||
}
|
||||
exclude:
|
||||
{
|
||||
var excluded_settings = [ "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
|
||||
|
||||
if (currentMeshType == "support_mesh")
|
||||
{
|
||||
excluded_settings = excluded_settings.concat(base.allCategoriesExceptSupport)
|
||||
}
|
||||
return excluded_settings
|
||||
}
|
||||
|
||||
visibilityHandler: Cura.PerObjectSettingVisibilityHandler
|
||||
{
|
||||
id: visibility_handler
|
||||
selectedObjectId: UM.ActiveTool.properties.getValue("SelectedObjectId")
|
||||
}
|
||||
|
||||
// For some reason the model object is updated after removing him from the memory and
|
||||
// it happens only on Windows. For this reason, set the destroyed value manually.
|
||||
Component.onDestruction:
|
||||
{
|
||||
setDestroyed(true)
|
||||
}
|
||||
}
|
||||
|
||||
delegate: Row
|
||||
Button
|
||||
{
|
||||
spacing: - UM.Theme.getSize("default_margin").width
|
||||
Loader
|
||||
width: Math.round(UM.Theme.getSize("setting").height / 2)
|
||||
height: UM.Theme.getSize("setting").height
|
||||
|
||||
onClicked: addedSettingsModel.setVisible(model.key, false)
|
||||
|
||||
background: Item
|
||||
{
|
||||
id: settingLoader
|
||||
width: UM.Theme.getSize("setting").width
|
||||
height: UM.Theme.getSize("section").height
|
||||
enabled: provider.properties.enabled === "True"
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: addedSettingsModel
|
||||
property var propertyProvider: provider
|
||||
property var globalPropertyProvider: inheritStackProvider
|
||||
property var externalResetHandler: false
|
||||
|
||||
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
|
||||
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
|
||||
//causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
|
||||
asynchronous: model.type != "enum" && model.type != "extruder"
|
||||
|
||||
onLoaded:
|
||||
UM.RecolorImage
|
||||
{
|
||||
settingLoader.item.showRevertButton = false
|
||||
settingLoader.item.showInheritButton = false
|
||||
settingLoader.item.showLinkedSettingIcon = false
|
||||
settingLoader.item.doDepthIndentation = false
|
||||
settingLoader.item.doQualityUserSettingEmphasis = false
|
||||
}
|
||||
|
||||
sourceComponent:
|
||||
{
|
||||
switch(model.type)
|
||||
{
|
||||
case "int":
|
||||
return settingTextField
|
||||
case "[int]":
|
||||
return settingTextField
|
||||
case "float":
|
||||
return settingTextField
|
||||
case "enum":
|
||||
return settingComboBox
|
||||
case "extruder":
|
||||
return settingExtruder
|
||||
case "optional_extruder":
|
||||
return settingOptionalExtruder
|
||||
case "bool":
|
||||
return settingCheckBox
|
||||
case "str":
|
||||
return settingTextField
|
||||
case "category":
|
||||
return settingCategory
|
||||
default:
|
||||
return settingUnknown
|
||||
}
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width
|
||||
height: width
|
||||
sourceSize.height: width
|
||||
color: parent.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
|
||||
source: UM.Theme.getIcon("Minus")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
// Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
|
||||
// so we bypass that to make a dedicated provider).
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: provider
|
||||
|
||||
containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
|
||||
key: model.key
|
||||
watchedProperties: [ "value", "enabled", "validationState" ]
|
||||
storeIndex: 0
|
||||
removeUnusedValue: false
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: inheritStackProvider
|
||||
containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
|
||||
key: model.key
|
||||
watchedProperties: [ "limit_to_extruder" ]
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: inheritStackProvider
|
||||
function onPropertiesChanged() { provider.forcePropertiesChanged() }
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: UM.ActiveTool
|
||||
function onPropertiesChanged()
|
||||
{
|
||||
width: Math.round(UM.Theme.getSize("setting").height / 2)
|
||||
height: UM.Theme.getSize("setting").height
|
||||
|
||||
onClicked: addedSettingsModel.setVisible(model.key, false)
|
||||
|
||||
style: ButtonStyle
|
||||
// the values cannot be bound with UM.ActiveTool.properties.getValue() calls,
|
||||
// so here we connect to the signal and update the those values.
|
||||
if (typeof UM.ActiveTool.properties.getValue("SelectedObjectId") !== "undefined")
|
||||
{
|
||||
background: Item
|
||||
const selectedObjectId = UM.ActiveTool.properties.getValue("SelectedObjectId")
|
||||
if (addedSettingsModel.visibilityHandler.selectedObjectId != selectedObjectId)
|
||||
{
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width
|
||||
height: width
|
||||
sourceSize.height: width
|
||||
color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
|
||||
source: UM.Theme.getIcon("Minus")
|
||||
}
|
||||
addedSettingsModel.visibilityHandler.selectedObjectId = selectedObjectId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
|
||||
// so we bypass that to make a dedicated provider).
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: provider
|
||||
|
||||
containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
|
||||
key: model.key
|
||||
watchedProperties: [ "value", "enabled", "validationState" ]
|
||||
storeIndex: 0
|
||||
removeUnusedValue: false
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: inheritStackProvider
|
||||
containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
|
||||
key: model.key
|
||||
watchedProperties: [ "limit_to_extruder" ]
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: inheritStackProvider
|
||||
function onPropertiesChanged() { provider.forcePropertiesChanged() }
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: UM.ActiveTool
|
||||
function onPropertiesChanged()
|
||||
if (typeof UM.ActiveTool.properties.getValue("ContainerID") !== "undefined")
|
||||
{
|
||||
// the values cannot be bound with UM.ActiveTool.properties.getValue() calls,
|
||||
// so here we connect to the signal and update the those values.
|
||||
if (typeof UM.ActiveTool.properties.getValue("SelectedObjectId") !== "undefined")
|
||||
const containerId = UM.ActiveTool.properties.getValue("ContainerID")
|
||||
if (provider.containerStackId != containerId)
|
||||
{
|
||||
const selectedObjectId = UM.ActiveTool.properties.getValue("SelectedObjectId")
|
||||
if (addedSettingsModel.visibilityHandler.selectedObjectId != selectedObjectId)
|
||||
{
|
||||
addedSettingsModel.visibilityHandler.selectedObjectId = selectedObjectId
|
||||
}
|
||||
provider.containerStackId = containerId
|
||||
}
|
||||
if (typeof UM.ActiveTool.properties.getValue("ContainerID") !== "undefined")
|
||||
if (inheritStackProvider.containerStackId != containerId)
|
||||
{
|
||||
const containerId = UM.ActiveTool.properties.getValue("ContainerID")
|
||||
if (provider.containerStackId != containerId)
|
||||
{
|
||||
provider.containerStackId = containerId
|
||||
}
|
||||
if (inheritStackProvider.containerStackId != containerId)
|
||||
{
|
||||
inheritStackProvider.containerStackId = containerId
|
||||
}
|
||||
inheritStackProvider.containerStackId = containerId
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -422,8 +425,6 @@ Item
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
SystemPalette { id: palette }
|
||||
|
||||
Component
|
||||
{
|
||||
id: settingTextField
|
||||
|
@ -1,6 +1,8 @@
|
||||
//Copyright (c) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Controls.Styles 1.2
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
@ -11,7 +13,8 @@ UM.Dialog
|
||||
id: settingPickDialog
|
||||
|
||||
title: catalog.i18nc("@title:window", "Select Settings to Customize for this model")
|
||||
width: screenScaleFactor * 360
|
||||
width: UM.Theme.getSize("small_popup_dialog").width
|
||||
backgroundColor: UM.Theme.getColor("background_1")
|
||||
|
||||
property var additional_excluded_settings
|
||||
|
||||
@ -40,9 +43,10 @@ UM.Dialog
|
||||
listview.model.filter = new_filter
|
||||
}
|
||||
|
||||
TextField
|
||||
Cura.TextField
|
||||
{
|
||||
id: filterInput
|
||||
selectByMouse: true
|
||||
|
||||
anchors
|
||||
{
|
||||
@ -69,65 +73,65 @@ UM.Dialog
|
||||
text: catalog.i18nc("@label:checkbox", "Show all")
|
||||
}
|
||||
|
||||
ScrollView
|
||||
ListView
|
||||
{
|
||||
id: scrollView
|
||||
|
||||
id: listview
|
||||
anchors
|
||||
{
|
||||
top: filterInput.bottom
|
||||
topMargin: UM.Theme.getSize("default_margin").height
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
ListView
|
||||
|
||||
ScrollBar.vertical: UM.ScrollBar { id: scrollBar }
|
||||
clip: true
|
||||
|
||||
model: UM.SettingDefinitionsModel
|
||||
{
|
||||
id: listview
|
||||
model: UM.SettingDefinitionsModel
|
||||
id: definitionsModel
|
||||
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
||||
visibilityHandler: UM.SettingPreferenceVisibilityHandler {}
|
||||
expanded: [ "*" ]
|
||||
exclude:
|
||||
{
|
||||
id: definitionsModel
|
||||
containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
|
||||
visibilityHandler: UM.SettingPreferenceVisibilityHandler {}
|
||||
expanded: [ "*" ]
|
||||
exclude:
|
||||
{
|
||||
var excluded_settings = [ "machine_settings", "command_line_settings", "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
|
||||
excluded_settings = excluded_settings.concat(settingPickDialog.additional_excluded_settings)
|
||||
return excluded_settings
|
||||
}
|
||||
showAll: toggleShowAll.checked || filterInput.text !== ""
|
||||
var excluded_settings = [ "machine_settings", "command_line_settings", "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
|
||||
excluded_settings = excluded_settings.concat(settingPickDialog.additional_excluded_settings)
|
||||
return excluded_settings
|
||||
}
|
||||
delegate: Loader
|
||||
{
|
||||
id: loader
|
||||
|
||||
width: listview.width
|
||||
height: model.type != undefined ? UM.Theme.getSize("section").height : 0
|
||||
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: definitionsModel
|
||||
|
||||
asynchronous: true
|
||||
source:
|
||||
{
|
||||
switch(model.type)
|
||||
{
|
||||
case "category":
|
||||
return "PerObjectCategory.qml"
|
||||
default:
|
||||
return "PerObjectItem.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: settingPickDialog.updateFilter()
|
||||
showAll: toggleShowAll.checked || filterInput.text !== ""
|
||||
}
|
||||
delegate: Loader
|
||||
{
|
||||
id: loader
|
||||
|
||||
width: listview.width - scrollBar.width
|
||||
height: model.type != undefined ? UM.Theme.getSize("section").height : 0
|
||||
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: definitionsModel
|
||||
|
||||
asynchronous: true
|
||||
source:
|
||||
{
|
||||
switch(model.type)
|
||||
{
|
||||
case "category":
|
||||
return "PerObjectCategory.qml"
|
||||
default:
|
||||
return "PerObjectItem.qml"
|
||||
}
|
||||
}
|
||||
}
|
||||
Component.onCompleted: settingPickDialog.updateFilter()
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
Button
|
||||
Cura.TertiaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Close")
|
||||
onClicked: settingPickDialog.visible = false
|
||||
onClicked: reject()
|
||||
}
|
||||
]
|
||||
}
|
@ -1,16 +1,13 @@
|
||||
// Copyright (c) 2015 Jaime van Kessel, Ultimaker B.V.
|
||||
// Copyright (c) 2022 Jaime van Kessel, Ultimaker B.V.
|
||||
// The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.15 as QQC2
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQml.Models 2.15 as Models
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
UM.Dialog
|
||||
@ -18,14 +15,15 @@ UM.Dialog
|
||||
id: dialog
|
||||
|
||||
title: catalog.i18nc("@title:window", "Post Processing Plugin")
|
||||
width: 700 * screenScaleFactor;
|
||||
height: 500 * screenScaleFactor;
|
||||
minimumWidth: 400 * screenScaleFactor;
|
||||
minimumHeight: 250 * screenScaleFactor;
|
||||
width: 700 * screenScaleFactor
|
||||
height: 500 * screenScaleFactor
|
||||
minimumWidth: 400 * screenScaleFactor
|
||||
minimumHeight: 250 * screenScaleFactor
|
||||
|
||||
onVisibleChanged:
|
||||
{
|
||||
if(!visible) //Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack.
|
||||
// Whenever the window is closed (either via the "Close" button or the X on the window frame), we want to update it in the stack.
|
||||
if (!visible)
|
||||
{
|
||||
manager.writeScriptsToStack()
|
||||
}
|
||||
@ -36,234 +34,211 @@ UM.Dialog
|
||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
id: base
|
||||
property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width)
|
||||
property int textMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
|
||||
property int textMargin: UM.Theme.getSize("narrow_margin").width
|
||||
property string activeScriptName
|
||||
SystemPalette{ id: palette }
|
||||
SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled }
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
ExclusiveGroup
|
||||
ButtonGroup
|
||||
{
|
||||
id: selectedScriptGroup
|
||||
}
|
||||
Item
|
||||
Column
|
||||
{
|
||||
id: activeScripts
|
||||
anchors.left: parent.left
|
||||
width: base.columnWidth
|
||||
height: parent.height
|
||||
|
||||
Label
|
||||
spacing: base.textMargin
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: activeScriptsHeader
|
||||
text: catalog.i18nc("@label", "Post Processing Scripts")
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: base.textMargin
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: base.textMargin
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: base.textMargin
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
ListView
|
||||
{
|
||||
id: activeScriptsList
|
||||
|
||||
anchors
|
||||
{
|
||||
top: activeScriptsHeader.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
rightMargin: base.textMargin
|
||||
topMargin: base.textMargin
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
height: Math.min(contentHeight, parent.height - parent.spacing * 2 - activeScriptsHeader.height - addButton.height) //At the window height, start scrolling this one.
|
||||
|
||||
height: childrenRect.height
|
||||
model: manager.scriptList
|
||||
delegate: Item
|
||||
clip: true
|
||||
ScrollBar.vertical: UM.ScrollBar
|
||||
{
|
||||
width: parent.width
|
||||
height: activeScriptButton.height
|
||||
Button
|
||||
{
|
||||
id: activeScriptButton
|
||||
text: manager.getScriptLabelByKey(modelData.toString())
|
||||
exclusiveGroup: selectedScriptGroup
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("setting").height
|
||||
checkable: true
|
||||
id: activeScriptsScrollBar
|
||||
}
|
||||
model: manager.scriptList
|
||||
|
||||
checked:
|
||||
delegate: Button
|
||||
{
|
||||
id: activeScriptButton
|
||||
|
||||
width: parent.width - activeScriptsScrollBar.width
|
||||
height: UM.Theme.getSize("standard_list_lineheight").height
|
||||
|
||||
ButtonGroup.group: selectedScriptGroup
|
||||
checkable: true
|
||||
|
||||
checked:
|
||||
{
|
||||
if (manager.selectedScriptIndex == index)
|
||||
{
|
||||
if (manager.selectedScriptIndex == index)
|
||||
{
|
||||
base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
|
||||
return true
|
||||
}
|
||||
else
|
||||
{
|
||||
return false
|
||||
}
|
||||
}
|
||||
onClicked:
|
||||
{
|
||||
forceActiveFocus()
|
||||
manager.setSelectedScriptIndex(index)
|
||||
base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
|
||||
return true
|
||||
}
|
||||
|
||||
style: ButtonStyle
|
||||
else
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
color: activeScriptButton.checked ? palette.highlight : "transparent"
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
}
|
||||
label: Label
|
||||
{
|
||||
wrapMode: Text.Wrap
|
||||
text: control.text
|
||||
elide: Text.ElideRight
|
||||
color: activeScriptButton.checked ? palette.highlightedText : palette.text
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
background: Rectangle
|
||||
{
|
||||
id: removeButton
|
||||
text: "x"
|
||||
width: 20 * screenScaleFactor
|
||||
height: 20 * screenScaleFactor
|
||||
anchors.right:parent.right
|
||||
anchors.rightMargin: base.textMargin
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: manager.removeScriptByIndex(index)
|
||||
style: ButtonStyle
|
||||
{
|
||||
label: Item
|
||||
{
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(control.width / 2.7)
|
||||
height: Math.round(control.height / 2.7)
|
||||
sourceSize.height: width
|
||||
color: palette.text
|
||||
source: UM.Theme.getIcon("Cancel")
|
||||
}
|
||||
}
|
||||
}
|
||||
color: activeScriptButton.checked ? UM.Theme.getColor("background_3") : "transparent"
|
||||
}
|
||||
Button
|
||||
|
||||
onClicked:
|
||||
{
|
||||
id: downButton
|
||||
text: ""
|
||||
anchors.right: removeButton.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
enabled: index != manager.scriptList.length - 1
|
||||
width: 20 * screenScaleFactor
|
||||
height: 20 * screenScaleFactor
|
||||
onClicked:
|
||||
{
|
||||
if (manager.selectedScriptIndex == index)
|
||||
{
|
||||
manager.setSelectedScriptIndex(index + 1)
|
||||
}
|
||||
return manager.moveScript(index, index + 1)
|
||||
}
|
||||
style: ButtonStyle
|
||||
{
|
||||
label: Item
|
||||
{
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(control.width / 2.5)
|
||||
height: Math.round(control.height / 2.5)
|
||||
sourceSize.height: width
|
||||
color: control.enabled ? palette.text : disabledPalette.text
|
||||
source: UM.Theme.getIcon("ChevronSingleDown")
|
||||
}
|
||||
}
|
||||
}
|
||||
forceActiveFocus()
|
||||
manager.setSelectedScriptIndex(index)
|
||||
base.activeScriptName = manager.getScriptLabelByKey(modelData.toString())
|
||||
}
|
||||
Button
|
||||
|
||||
RowLayout
|
||||
{
|
||||
id: upButton
|
||||
text: ""
|
||||
enabled: index != 0
|
||||
width: 20 * screenScaleFactor
|
||||
height: 20 * screenScaleFactor
|
||||
anchors.right: downButton.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked:
|
||||
anchors.fill: parent
|
||||
|
||||
UM.Label
|
||||
{
|
||||
if (manager.selectedScriptIndex == index)
|
||||
{
|
||||
manager.setSelectedScriptIndex(index - 1)
|
||||
}
|
||||
return manager.moveScript(index, index - 1)
|
||||
Layout.fillWidth: true
|
||||
text: manager.getScriptLabelByKey(modelData.toString())
|
||||
}
|
||||
style: ButtonStyle
|
||||
|
||||
Item
|
||||
{
|
||||
label: Item
|
||||
{
|
||||
UM.RecolorImage
|
||||
id: downButton
|
||||
Layout.preferredWidth: height
|
||||
Layout.fillHeight: true
|
||||
enabled: index != manager.scriptList.length - 1
|
||||
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
onClicked:
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: Math.round(control.width / 2.5)
|
||||
height: Math.round(control.height / 2.5)
|
||||
sourceSize.height: width
|
||||
color: control.enabled ? palette.text : disabledPalette.text
|
||||
source: UM.Theme.getIcon("ChevronSingleUp")
|
||||
if (manager.selectedScriptIndex == index)
|
||||
{
|
||||
manager.setSelectedScriptIndex(index + 1)
|
||||
}
|
||||
return manager.moveScript(index, index + 1)
|
||||
}
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: parent.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
|
||||
source: UM.Theme.getIcon("ChevronSingleDown")
|
||||
}
|
||||
}
|
||||
Item
|
||||
{
|
||||
id: upButton
|
||||
Layout.preferredWidth: height
|
||||
Layout.fillHeight: true
|
||||
enabled: index != 0
|
||||
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
onClicked:
|
||||
{
|
||||
if (manager.selectedScriptIndex == index)
|
||||
{
|
||||
manager.setSelectedScriptIndex(index - 1)
|
||||
}
|
||||
return manager.moveScript(index, index - 1)
|
||||
}
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: upButton.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("text_disabled")
|
||||
source: UM.Theme.getIcon("ChevronSingleUp")
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
id: removeButton
|
||||
Layout.preferredWidth: height
|
||||
Layout.fillHeight: true
|
||||
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
onClicked: manager.removeScriptByIndex(index)
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
color: UM.Theme.getColor("text")
|
||||
source: UM.Theme.getIcon("Cancel")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: addButton
|
||||
text: catalog.i18nc("@action", "Add a script")
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: base.textMargin
|
||||
anchors.top: activeScriptsList.bottom
|
||||
anchors.topMargin: base.textMargin
|
||||
onClicked: scriptsMenu.open()
|
||||
style: ButtonStyle
|
||||
{
|
||||
label: Label
|
||||
{
|
||||
text: control.text
|
||||
}
|
||||
}
|
||||
}
|
||||
QQC2.Menu
|
||||
}
|
||||
|
||||
Cura.Menu
|
||||
{
|
||||
id: scriptsMenu
|
||||
|
||||
Models.Instantiator
|
||||
{
|
||||
id: scriptsMenu
|
||||
width: parent.width
|
||||
model: manager.loadedScriptList
|
||||
|
||||
Models.Instantiator
|
||||
Cura.MenuItem
|
||||
{
|
||||
model: manager.loadedScriptList
|
||||
|
||||
QQC2.MenuItem
|
||||
{
|
||||
text: manager.getScriptLabelByKey(modelData.toString())
|
||||
onTriggered: manager.addScriptToList(modelData.toString())
|
||||
}
|
||||
|
||||
onObjectAdded: scriptsMenu.insertItem(index, object)
|
||||
onObjectRemoved: scriptsMenu.removeItem(object)
|
||||
text: manager.getScriptLabelByKey(modelData.toString())
|
||||
onTriggered: manager.addScriptToList(modelData.toString())
|
||||
}
|
||||
|
||||
onObjectAdded: scriptsMenu.insertItem(index, object)
|
||||
onObjectRemoved: scriptsMenu.removeItem(object)
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,9 +271,9 @@ UM.Dialog
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
|
||||
ScrollView
|
||||
ListView
|
||||
{
|
||||
id: scrollView
|
||||
id: listview
|
||||
anchors
|
||||
{
|
||||
top: scriptSpecsHeader.bottom
|
||||
@ -309,124 +284,114 @@ UM.Dialog
|
||||
bottom: parent.bottom
|
||||
}
|
||||
|
||||
ScrollBar.vertical: UM.ScrollBar {}
|
||||
clip: true
|
||||
visible: manager.selectedScriptDefinitionId != ""
|
||||
style: UM.Theme.styles.scrollview;
|
||||
spacing: UM.Theme.getSize("default_lining").height
|
||||
|
||||
ListView
|
||||
model: UM.SettingDefinitionsModel
|
||||
{
|
||||
id: listview
|
||||
spacing: UM.Theme.getSize("default_lining").height
|
||||
model: UM.SettingDefinitionsModel
|
||||
id: definitionsModel
|
||||
containerId: manager.selectedScriptDefinitionId
|
||||
showAll: true
|
||||
}
|
||||
|
||||
delegate: Loader
|
||||
{
|
||||
id: settingLoader
|
||||
|
||||
width: listview.width
|
||||
height:
|
||||
{
|
||||
id: definitionsModel
|
||||
containerId: manager.selectedScriptDefinitionId
|
||||
showAll: true
|
||||
if (provider.properties.enabled == "True" && model.type != undefined)
|
||||
{
|
||||
return UM.Theme.getSize("section").height;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0
|
||||
}
|
||||
}
|
||||
Behavior on height { NumberAnimation { duration: 100 } }
|
||||
opacity: provider.properties.enabled == "True" ? 1 : 0
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
enabled: opacity > 0
|
||||
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: definitionsModel
|
||||
property var propertyProvider: provider
|
||||
property var globalPropertyProvider: inheritStackProvider
|
||||
|
||||
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
|
||||
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
|
||||
//causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
|
||||
asynchronous: model.type != "enum" && model.type != "extruder"
|
||||
|
||||
onLoaded:
|
||||
{
|
||||
settingLoader.item.showRevertButton = false
|
||||
settingLoader.item.showInheritButton = false
|
||||
settingLoader.item.showLinkedSettingIcon = false
|
||||
settingLoader.item.doDepthIndentation = false
|
||||
settingLoader.item.doQualityUserSettingEmphasis = false
|
||||
}
|
||||
|
||||
delegate: Loader
|
||||
sourceComponent:
|
||||
{
|
||||
id: settingLoader
|
||||
|
||||
width: parent.width
|
||||
height:
|
||||
switch(model.type)
|
||||
{
|
||||
if(provider.properties.enabled == "True")
|
||||
{
|
||||
if(model.type != undefined)
|
||||
{
|
||||
return UM.Theme.getSize("section").height
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0
|
||||
}
|
||||
case "int":
|
||||
return settingTextField
|
||||
case "float":
|
||||
return settingTextField
|
||||
case "enum":
|
||||
return settingComboBox
|
||||
case "extruder":
|
||||
return settingExtruder
|
||||
case "bool":
|
||||
return settingCheckBox
|
||||
case "str":
|
||||
return settingTextField
|
||||
case "category":
|
||||
return settingCategory
|
||||
default:
|
||||
return settingUnknown
|
||||
}
|
||||
Behavior on height { NumberAnimation { duration: 100 } }
|
||||
opacity: provider.properties.enabled == "True" ? 1 : 0
|
||||
}
|
||||
|
||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
enabled: opacity > 0
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: provider
|
||||
containerStackId: manager.selectedScriptStackId
|
||||
key: model.key ? model.key : "None"
|
||||
watchedProperties: [ "value", "enabled", "state", "validationState" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: definitionsModel
|
||||
property var propertyProvider: provider
|
||||
property var globalPropertyProvider: inheritStackProvider
|
||||
// Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
|
||||
// so we bypass that to make a dedicated provider).
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: inheritStackProvider
|
||||
containerStack: Cura.MachineManager.activeMachine
|
||||
key: model.key ? model.key : "None"
|
||||
watchedProperties: [ "limit_to_extruder" ]
|
||||
}
|
||||
|
||||
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
|
||||
//In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
|
||||
//causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
|
||||
asynchronous: model.type != "enum" && model.type != "extruder"
|
||||
Connections
|
||||
{
|
||||
target: item
|
||||
|
||||
onLoaded:
|
||||
function onShowTooltip(text)
|
||||
{
|
||||
settingLoader.item.showRevertButton = false
|
||||
settingLoader.item.showInheritButton = false
|
||||
settingLoader.item.showLinkedSettingIcon = false
|
||||
settingLoader.item.doDepthIndentation = false
|
||||
settingLoader.item.doQualityUserSettingEmphasis = false
|
||||
tooltip.text = text;
|
||||
var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0);
|
||||
tooltip.show(position);
|
||||
tooltip.target.x = position.x + 1;
|
||||
}
|
||||
|
||||
sourceComponent:
|
||||
{
|
||||
switch(model.type)
|
||||
{
|
||||
case "int":
|
||||
return settingTextField
|
||||
case "float":
|
||||
return settingTextField
|
||||
case "enum":
|
||||
return settingComboBox
|
||||
case "extruder":
|
||||
return settingExtruder
|
||||
case "bool":
|
||||
return settingCheckBox
|
||||
case "str":
|
||||
return settingTextField
|
||||
case "category":
|
||||
return settingCategory
|
||||
default:
|
||||
return settingUnknown
|
||||
}
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: provider
|
||||
containerStackId: manager.selectedScriptStackId
|
||||
key: model.key ? model.key : "None"
|
||||
watchedProperties: [ "value", "enabled", "state", "validationState" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
// Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
|
||||
// so we bypass that to make a dedicated provider).
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: inheritStackProvider
|
||||
containerStack: Cura.MachineManager.activeMachine
|
||||
key: model.key ? model.key : "None"
|
||||
watchedProperties: [ "limit_to_extruder" ]
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: item
|
||||
|
||||
function onShowTooltip(text)
|
||||
{
|
||||
tooltip.text = text
|
||||
var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0)
|
||||
tooltip.show(position)
|
||||
tooltip.target.x = position.x + 1
|
||||
}
|
||||
|
||||
function onHideTooltip() { tooltip.hide() }
|
||||
}
|
||||
function onHideTooltip() { tooltip.hide() }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -480,10 +445,9 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: Button
|
||||
rightButtons: Cura.TertiaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Close")
|
||||
iconName: "dialog-close"
|
||||
onClicked: dialog.accept()
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
//Copyright (c) 2020 Ultimaker B.V.
|
||||
//Copyright (c) 2021 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
@ -5,7 +5,7 @@ import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
@ -131,14 +131,10 @@ Item
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
hoverEnabled: true
|
||||
|
||||
contentItem: Label
|
||||
contentItem: UM.Label
|
||||
{
|
||||
text: model.displayText
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("medium")
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
width: contentWidth
|
||||
height: parent.height
|
||||
}
|
||||
|
@ -1,11 +1,7 @@
|
||||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Copyright (c) 2021 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2021 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
@ -1,10 +1,8 @@
|
||||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2021 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
@ -1,14 +1,15 @@
|
||||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.0 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
UM.PointingRectangle {
|
||||
UM.PointingRectangle
|
||||
{
|
||||
id: sliderLabelRoot
|
||||
|
||||
// custom properties
|
||||
@ -28,47 +29,41 @@ UM.PointingRectangle {
|
||||
borderColor: UM.Theme.getColor("lining")
|
||||
borderWidth: UM.Theme.getSize("default_lining").width
|
||||
|
||||
Behavior on height {
|
||||
NumberAnimation {
|
||||
duration: 50
|
||||
}
|
||||
}
|
||||
Behavior on height { NumberAnimation { duration: 50 } }
|
||||
|
||||
// catch all mouse events so they're not handled by underlying 3D scene
|
||||
MouseArea {
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
TextMetrics {
|
||||
TextMetrics
|
||||
{
|
||||
id: maxValueMetrics
|
||||
font: valueLabel.font
|
||||
text: maximumValue + 1 // layers are 0 based, add 1 for display value
|
||||
|
||||
}
|
||||
|
||||
TextField {
|
||||
TextField
|
||||
{
|
||||
id: valueLabel
|
||||
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
alignWhenCentered: false
|
||||
}
|
||||
anchors.centerIn: parent
|
||||
|
||||
width: maxValueMetrics.width + UM.Theme.getSize("default_margin").width
|
||||
//width: maxValueMetrics.contentWidth + 2 * UM.Theme.getSize("default_margin").width
|
||||
text: sliderLabelRoot.value + startFrom // the current handle value, add 1 because layers is an array
|
||||
horizontalAlignment: TextInput.AlignHCenter
|
||||
leftPadding: UM.Theme.getSize("narrow_margin").width
|
||||
rightPadding: UM.Theme.getSize("narrow_margin").width
|
||||
|
||||
// key bindings, work when label is currently focused (active handle in LayerSlider)
|
||||
Keys.onUpPressed: sliderLabelRoot.setValue(sliderLabelRoot.value + ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
|
||||
Keys.onDownPressed: sliderLabelRoot.setValue(sliderLabelRoot.value - ((event.modifiers & Qt.ShiftModifier) ? 10 : 1))
|
||||
|
||||
style: TextFieldStyle {
|
||||
textColor: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
background: Item { }
|
||||
}
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
background: Item {}
|
||||
selectByMouse: true
|
||||
|
||||
onEditingFinished: {
|
||||
|
||||
@ -84,16 +79,18 @@ UM.PointingRectangle {
|
||||
}
|
||||
}
|
||||
|
||||
validator: IntValidator {
|
||||
validator: IntValidator
|
||||
{
|
||||
bottom: startFrom
|
||||
top: sliderLabelRoot.maximumValue + startFrom // +startFrom because maybe we want to start in a different value rather than 0
|
||||
}
|
||||
}
|
||||
|
||||
BusyIndicator {
|
||||
BusyIndicator
|
||||
{
|
||||
id: busyIndicator
|
||||
|
||||
anchors {
|
||||
anchors
|
||||
{
|
||||
left: parent.right
|
||||
leftMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
|
||||
verticalCenter: parent.verticalCenter
|
||||
|
@ -2,9 +2,6 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.4 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
@ -1,13 +1,12 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.4
|
||||
import QtQuick.Controls 1.2
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
import UM 1.0 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
||||
@ -43,22 +42,19 @@ Cura.ExpandableComponent
|
||||
|
||||
headerItem: Item
|
||||
{
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: colorSchemeLabel
|
||||
text: catalog.i18nc("@label", "Color scheme")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
height: parent.height
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: layerTypeCombobox.currentText
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors
|
||||
{
|
||||
left: colorSchemeLabel.right
|
||||
@ -68,8 +64,6 @@ Cura.ExpandableComponent
|
||||
height: parent.height
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +93,8 @@ Cura.ExpandableComponent
|
||||
|
||||
spacing: UM.Theme.getSize("layerview_row_spacing").height
|
||||
|
||||
ListModel // matches SimulationView.py
|
||||
// matches SimulationView.py
|
||||
ListModel
|
||||
{
|
||||
id: layerViewTypes
|
||||
}
|
||||
@ -132,18 +127,17 @@ Cura.ExpandableComponent
|
||||
})
|
||||
}
|
||||
|
||||
ComboBox
|
||||
Cura.ComboBox
|
||||
{
|
||||
id: layerTypeCombobox
|
||||
textRole: "text"
|
||||
valueRole: "type_id"
|
||||
width: parent.width
|
||||
implicitHeight: UM.Theme.getSize("setting_control").height
|
||||
model: layerViewTypes
|
||||
visible: !UM.SimulationView.compatibilityMode
|
||||
style: UM.Theme.styles.combobox
|
||||
|
||||
onActivated:
|
||||
{
|
||||
UM.Preferences.setValue("layerview/layer_view_type", index);
|
||||
}
|
||||
onActivated: UM.Preferences.setValue("layerview/layer_view_type", index)
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
@ -165,16 +159,13 @@ Cura.ExpandableComponent
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: compatibilityModeLabel
|
||||
text: catalog.i18nc("@label", "Compatibility Mode")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
visible: UM.SimulationView.compatibilityMode
|
||||
height: UM.Theme.getSize("layerview_row").height
|
||||
width: parent.width
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Item // Spacer
|
||||
@ -187,7 +178,7 @@ Cura.ExpandableComponent
|
||||
{
|
||||
model: CuraApplication.getExtrudersModel()
|
||||
|
||||
CheckBox
|
||||
UM.CheckBox
|
||||
{
|
||||
id: extrudersModelCheckBox
|
||||
checked: viewSettings.extruder_opacities[index] > 0.5 || viewSettings.extruder_opacities[index] == undefined || viewSettings.extruder_opacities[index] == ""
|
||||
@ -201,8 +192,6 @@ Cura.ExpandableComponent
|
||||
UM.Preferences.setValue("layerview/extruder_opacities", viewSettings.extruder_opacities.join("|"));
|
||||
}
|
||||
|
||||
style: UM.Theme.styles.checkbox
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: swatch
|
||||
@ -215,12 +204,11 @@ Cura.ExpandableComponent
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: model.name
|
||||
elide: Text.ElideRight
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
anchors
|
||||
{
|
||||
verticalCenter: parent.verticalCenter
|
||||
@ -229,7 +217,6 @@ Cura.ExpandableComponent
|
||||
leftMargin: UM.Theme.getSize("checkbox").width + Math.round(UM.Theme.getSize("default_margin").width / 2)
|
||||
rightMargin: UM.Theme.getSize("default_margin").width * 2
|
||||
}
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -277,7 +264,7 @@ Cura.ExpandableComponent
|
||||
}
|
||||
}
|
||||
|
||||
CheckBox
|
||||
UM.CheckBox
|
||||
{
|
||||
id: legendModelCheckBox
|
||||
checked: model.initialValue
|
||||
@ -285,8 +272,6 @@ Cura.ExpandableComponent
|
||||
height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height
|
||||
width: parent.width
|
||||
|
||||
style: UM.Theme.styles.checkbox
|
||||
|
||||
Rectangle
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@ -299,7 +284,7 @@ Cura.ExpandableComponent
|
||||
visible: viewSettings.show_legend
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: label
|
||||
font: UM.Theme.getFont("default")
|
||||
@ -315,24 +300,22 @@ Cura.ExpandableComponent
|
||||
}
|
||||
}
|
||||
|
||||
CheckBox
|
||||
UM.CheckBox
|
||||
{
|
||||
checked: viewSettings.only_show_top_layers
|
||||
onClicked: UM.Preferences.setValue("view/only_show_top_layers", checked ? 1.0 : 0.0)
|
||||
text: catalog.i18nc("@label", "Only Show Top Layers")
|
||||
visible: UM.SimulationView.compatibilityMode
|
||||
style: UM.Theme.styles.checkbox
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
CheckBox
|
||||
UM.CheckBox
|
||||
{
|
||||
checked: viewSettings.top_layer_count == 5
|
||||
onClicked: UM.Preferences.setValue("view/top_layer_count", checked ? 5 : 1)
|
||||
text: catalog.i18nc("@label", "Show 5 Detailed Layers On Top")
|
||||
width: parent.width
|
||||
visible: UM.SimulationView.compatibilityMode
|
||||
style: UM.Theme.styles.checkbox
|
||||
}
|
||||
|
||||
Repeater
|
||||
@ -353,7 +336,7 @@ Cura.ExpandableComponent
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: label
|
||||
visible: viewSettings.show_legend
|
||||
@ -362,8 +345,6 @@ Cura.ExpandableComponent
|
||||
height: UM.Theme.getSize("layerview_row").height + UM.Theme.getSize("default_lining").height
|
||||
width: parent.width
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
Rectangle
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@ -388,7 +369,7 @@ Cura.ExpandableComponent
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("layerview_row").height
|
||||
|
||||
Label //Minimum value.
|
||||
UM.Label //Minimum value.
|
||||
{
|
||||
text:
|
||||
{
|
||||
@ -419,12 +400,9 @@ Cura.ExpandableComponent
|
||||
return catalog.i18nc("@label","min")
|
||||
}
|
||||
anchors.left: parent.left
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Label //Unit in the middle.
|
||||
UM.Label //Unit in the middle.
|
||||
{
|
||||
text:
|
||||
{
|
||||
@ -456,10 +434,9 @@ Cura.ExpandableComponent
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
|
||||
Label //Maximum value.
|
||||
UM.Label //Maximum value.
|
||||
{
|
||||
text: {
|
||||
if (UM.SimulationView.layerActivity && CuraApplication.platformActivity)
|
||||
@ -490,7 +467,6 @@ Cura.ExpandableComponent
|
||||
|
||||
anchors.right: parent.right
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Controls 2.4
|
||||
import QtQuick.Controls.Styles 1.3
|
||||
import UM 1.3 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
@ -19,7 +18,7 @@ Button
|
||||
{
|
||||
anchors.fill: parent
|
||||
radius: 0.5 * width
|
||||
color: parent.enabled ? (parent.hovered ? UM.Theme.getColor("monitor_secondary_button_hover") : "transparent") : UM.Theme.getColor("monitor_icon_disabled")
|
||||
color: parent.enabled ? (parent.hovered ? UM.Theme.getColor("monitor_card_hover") : "transparent") : UM.Theme.getColor("monitor_icon_disabled")
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
|
@ -1,14 +1,13 @@
|
||||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.5 as Cura
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.9
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
Cura.MachineAction
|
||||
{
|
||||
@ -36,32 +35,27 @@ Cura.MachineAction
|
||||
id: discoverUM3Action
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
SystemPalette { id: palette }
|
||||
UM.I18nCatalog { id: catalog; name:"cura" }
|
||||
Label
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: pageTitle
|
||||
width: parent.width
|
||||
text: catalog.i18nc("@title:window", "Connect to Networked Printer")
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
font.pointSize: 18
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: pageDescription
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
text: catalog.i18nc("@label", "To print directly to your printer over the network, please make sure your printer is connected to the network using a network cable or by connecting your printer to your WIFI network. If you don't connect Cura with your printer, you can still use a USB drive to transfer g-code files to your printer.") + "\n\n" + catalog.i18nc("@label", "Select your printer from the list below:")
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_lining").width
|
||||
spacing: UM.Theme.getSize("thin_margin").width
|
||||
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: addButton
|
||||
text: catalog.i18nc("@action:button", "Add");
|
||||
@ -71,7 +65,7 @@ Cura.MachineAction
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: editButton
|
||||
text: catalog.i18nc("@action:button", "Edit")
|
||||
@ -82,7 +76,7 @@ Cura.MachineAction
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: removeButton
|
||||
text: catalog.i18nc("@action:button", "Remove")
|
||||
@ -90,7 +84,7 @@ Cura.MachineAction
|
||||
onClicked: manager.removeManualDevice(base.selectedDevice.key, base.selectedDevice.ipAddress)
|
||||
}
|
||||
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: rediscoverButton
|
||||
text: catalog.i18nc("@action:button", "Refresh")
|
||||
@ -109,70 +103,61 @@ Cura.MachineAction
|
||||
width: Math.round(parent.width * 0.5)
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
ScrollView
|
||||
ListView
|
||||
{
|
||||
id: objectListContainer
|
||||
frameVisible: true
|
||||
id: listview
|
||||
|
||||
width: parent.width
|
||||
height: base.height - contentRow.y - discoveryTip.height
|
||||
|
||||
Rectangle
|
||||
ScrollBar.vertical: UM.ScrollBar {}
|
||||
clip: true
|
||||
|
||||
model: manager.foundDevices
|
||||
currentIndex: -1
|
||||
onCurrentIndexChanged:
|
||||
{
|
||||
parent: viewport
|
||||
anchors.fill: parent
|
||||
color: palette.light
|
||||
base.selectedDevice = listview.model[currentIndex];
|
||||
// Only allow connecting if the printer has responded to API query since the last refresh
|
||||
base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true";
|
||||
}
|
||||
Component.onCompleted: manager.startDiscovery()
|
||||
|
||||
ListView
|
||||
delegate: UM.Label
|
||||
{
|
||||
id: listview
|
||||
model: manager.foundDevices
|
||||
width: parent.width
|
||||
currentIndex: -1
|
||||
onCurrentIndexChanged:
|
||||
{
|
||||
base.selectedDevice = listview.model[currentIndex];
|
||||
// Only allow connecting if the printer has responded to API query since the last refresh
|
||||
base.completeProperties = base.selectedDevice != null && base.selectedDevice.getProperty("incomplete") != "true";
|
||||
}
|
||||
Component.onCompleted: manager.startDiscovery()
|
||||
delegate: Rectangle
|
||||
{
|
||||
height: childrenRect.height
|
||||
color: ListView.isCurrentItem ? palette.highlight : index % 2 ? palette.base : palette.alternateBase
|
||||
width: parent.width
|
||||
Label
|
||||
{
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.right: parent.right
|
||||
text: listview.model[index].name
|
||||
color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text
|
||||
elide: Text.ElideRight
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
id: printNameLabel
|
||||
width: listview.width
|
||||
height: contentHeight
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
MouseArea
|
||||
anchors.right: parent.right
|
||||
text: listview.model[index].name
|
||||
elide: Text.ElideRight
|
||||
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent;
|
||||
onClicked:
|
||||
{
|
||||
anchors.fill: parent;
|
||||
onClicked:
|
||||
if(!parent.ListView.isCurrentItem)
|
||||
{
|
||||
if(!parent.ListView.isCurrentItem)
|
||||
{
|
||||
parent.ListView.view.currentIndex = index;
|
||||
}
|
||||
parent.ListView.view.currentIndex = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
color: parent.ListView.isCurrentItem ? UM.Theme.getColor("background_3") : "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: discoveryTip
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
text: catalog.i18nc("@label", "If your printer is not listed, read the <a href='%1'>network printing troubleshooting guide</a>").arg("https://ultimaker.com/en/cura/troubleshooting/network?utm_source=cura&utm_medium=software&utm_campaign=manage-network-printer");
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
@ -183,32 +168,26 @@ Cura.MachineAction
|
||||
width: Math.round(parent.width * 0.5)
|
||||
visible: base.selectedDevice ? true : false
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
text: base.selectedDevice ? base.selectedDevice.name : ""
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
elide: Text.ElideRight
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
Grid
|
||||
GridLayout
|
||||
{
|
||||
visible: base.completeProperties
|
||||
width: parent.width
|
||||
columns: 2
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
Layout.fillWidth: true
|
||||
text: catalog.i18nc("@label", "Type")
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
Layout.fillWidth: true
|
||||
text:
|
||||
{
|
||||
if (base.selectedDevice) {
|
||||
@ -217,41 +196,31 @@ Cura.MachineAction
|
||||
return ""
|
||||
}
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
Layout.fillWidth: true
|
||||
text: catalog.i18nc("@label", "Firmware version")
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
Layout.fillWidth: true
|
||||
text: base.selectedDevice ? base.selectedDevice.firmwareVersion : ""
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
Layout.fillWidth: true
|
||||
text: catalog.i18nc("@label", "Address")
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: Math.round(parent.width * 0.5)
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
Layout.fillWidth: true
|
||||
text: base.selectedDevice ? base.selectedDevice.ipAddress : ""
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
text:{
|
||||
// The property cluster size does not exist for older UM3 devices.
|
||||
if(!base.selectedDevice || base.selectedDevice.clusterSize == null || base.selectedDevice.clusterSize == 1)
|
||||
@ -269,16 +238,14 @@ Cura.MachineAction
|
||||
}
|
||||
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
visible: base.selectedDevice != null && !base.completeProperties
|
||||
text: catalog.i18nc("@label", "The printer at this address has not yet responded." )
|
||||
}
|
||||
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Connect")
|
||||
enabled: (base.selectedDevice && base.completeProperties && base.selectedDevice.clusterSize > 0) ? true : false
|
||||
@ -288,18 +255,15 @@ Cura.MachineAction
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: invalidIPAddressMessageDialog
|
||||
x: parent ? (parent.x + (parent.width) / 2) : 0
|
||||
y: parent ? (parent.y + (parent.height) / 2) : 0
|
||||
title: catalog.i18nc("@title:window", "Invalid IP address")
|
||||
text: catalog.i18nc("@text", "Please enter a valid IP address.")
|
||||
icon: StandardIcon.Warning
|
||||
standardButtons: StandardButton.Ok
|
||||
standardButtons: Dialog.Ok
|
||||
}
|
||||
|
||||
UM.Dialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: manualPrinterDialog
|
||||
property string printerKey
|
||||
@ -307,17 +271,19 @@ Cura.MachineAction
|
||||
|
||||
title: catalog.i18nc("@title:window", "Printer Address")
|
||||
|
||||
minimumWidth: 400 * screenScaleFactor
|
||||
minimumHeight: 130 * screenScaleFactor
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
width: UM.Theme.getSize("small_popup_dialog").width
|
||||
height: UM.Theme.getSize("small_popup_dialog").height
|
||||
|
||||
anchors.centerIn: Overlay.overlay
|
||||
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
|
||||
signal showDialog(string key, string address)
|
||||
onShowDialog:
|
||||
{
|
||||
printerKey = key;
|
||||
addressText = address;
|
||||
manualPrinterDialog.show();
|
||||
manualPrinterDialog.open();
|
||||
addressField.selectAll();
|
||||
addressField.focus = true;
|
||||
}
|
||||
@ -326,67 +292,45 @@ Cura.MachineAction
|
||||
anchors.fill: parent
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Enter the IP address of your printer on the network.")
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
TextField
|
||||
Cura.TextField
|
||||
{
|
||||
id: addressField
|
||||
width: parent.width
|
||||
validator: RegExpValidator
|
||||
{
|
||||
regExp: /[a-zA-Z0-9\.\-\_]*/
|
||||
}
|
||||
|
||||
onAccepted: btnOk.clicked()
|
||||
validator: RegExpValidator { regExp: /[a-zA-Z0-9\.\-\_]*/ }
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
Button {
|
||||
text: catalog.i18nc("@action:button","Cancel")
|
||||
onClicked:
|
||||
{
|
||||
manualPrinterDialog.reject()
|
||||
manualPrinterDialog.hide()
|
||||
}
|
||||
},
|
||||
Button {
|
||||
id: btnOk
|
||||
text: catalog.i18nc("@action:button", "OK")
|
||||
onClicked:
|
||||
{
|
||||
// Validate the input first
|
||||
if (!networkingUtil.isValidIP(manualPrinterDialog.addressText))
|
||||
{
|
||||
invalidIPAddressMessageDialog.open()
|
||||
return
|
||||
}
|
||||
|
||||
// if the entered IP address has already been discovered, switch the current item to that item
|
||||
// and do nothing else.
|
||||
for (var i = 0; i < manager.foundDevices.length; i++)
|
||||
{
|
||||
var device = manager.foundDevices[i]
|
||||
if (device.address == manualPrinterDialog.addressText)
|
||||
{
|
||||
currentItemIndex = i
|
||||
manualPrinterDialog.hide()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText)
|
||||
manualPrinterDialog.hide()
|
||||
}
|
||||
enabled: manualPrinterDialog.addressText.trim() != ""
|
||||
isDefault: true
|
||||
onAccepted:
|
||||
{
|
||||
// Validate the input first
|
||||
if (!networkingUtil.isValidIP(manualPrinterDialog.addressText))
|
||||
{
|
||||
// prefent closing of element, as we want to keep the dialog active after a wrongly entered IP adress
|
||||
manualPrinterDialog.open()
|
||||
// show invalid ip warning
|
||||
invalidIPAddressMessageDialog.open();
|
||||
return;
|
||||
}
|
||||
]
|
||||
|
||||
// if the entered IP address has already been discovered, switch the current item to that item
|
||||
// and do nothing else.
|
||||
for (var i = 0; i < manager.foundDevices.length; i++)
|
||||
{
|
||||
var device = manager.foundDevices[i]
|
||||
if (device.address == manualPrinterDialog.addressText)
|
||||
{
|
||||
currentItemIndex = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,6 @@
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtGraphicalEffects 1.0
|
||||
import UM 1.3 as UM
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.0
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
/**
|
||||
* This component comprises a buildplate icon and the buildplate name. It is
|
||||
@ -57,19 +57,15 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: buildplateLabel
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default") // 12pt, regular
|
||||
text: buildplate ? buildplate : ""
|
||||
visible: text !== ""
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: 18 * screenScaleFactor // TODO: Theme!
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,9 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Dialogs 1.2
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
UM.Dialog
|
||||
{
|
||||
@ -63,7 +62,7 @@ UM.Dialog
|
||||
}
|
||||
]
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
anchors
|
||||
{
|
||||
@ -72,7 +71,6 @@ UM.Dialog
|
||||
bottomMargin: 56 * screenScaleFactor // TODO: Theme!
|
||||
}
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
text:
|
||||
{
|
||||
if (!printer || !printer.activePrintJob)
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Dialogs 1.1
|
||||
import UM 1.3 as UM
|
||||
import QtQuick.Controls 2.15
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.6 as Cura
|
||||
|
||||
/**
|
||||
* A MonitorInfoBlurb is an extension of the GenericPopUp used to show static information (vs. interactive context
|
||||
@ -134,32 +134,29 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: sendToTopConfirmationDialog
|
||||
Component.onCompleted: visible = false
|
||||
icon: StandardIcon.Warning
|
||||
onYes: OutputDevice.sendJobToTop(printJob.key)
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
onAccepted: OutputDevice.sendJobToTop(printJob.key)
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to move %1 to the top of the queue?").arg(printJob.name) : ""
|
||||
title: catalog.i18nc("@window:title", "Move print job to top")
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: deleteConfirmationDialog
|
||||
Component.onCompleted: visible = false
|
||||
icon: StandardIcon.Warning
|
||||
onYes: OutputDevice.deleteJobFromQueue(printJob.key)
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
onAccepted: OutputDevice.deleteJobFromQueue(printJob.key)
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to delete %1?").arg(printJob.name) : ""
|
||||
title: catalog.i18nc("@window:title", "Delete print job")
|
||||
}
|
||||
|
||||
MessageDialog {
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: abortConfirmationDialog
|
||||
Component.onCompleted: visible = false
|
||||
icon: StandardIcon.Warning
|
||||
onYes: printJob.setState("abort")
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
onAccepted: printJob.setState("abort")
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
text: printJob && printJob.name ? catalog.i18nc("@label %1 is the name of a print job.", "Are you sure you want to abort %1?").arg(printJob.name) : ""
|
||||
title: catalog.i18nc("@window:title", "Abort print")
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Controls 2.0
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Button
|
||||
@ -17,13 +17,12 @@ Button
|
||||
radius: Math.round(0.5 * width)
|
||||
width: base.width
|
||||
}
|
||||
contentItem: Label {
|
||||
contentItem: UM.Label
|
||||
{
|
||||
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
|
||||
font.pixelSize: 32 * screenScaleFactor
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: base.text
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering;
|
||||
}
|
||||
height: width
|
||||
hoverEnabled: enabled
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.0
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
/**
|
||||
* This component is a sort of "super icon" which includes a colored SVG image
|
||||
@ -35,18 +35,16 @@ Item
|
||||
width: size
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: positionLabel
|
||||
anchors.centerIn: icon
|
||||
font: UM.Theme.getFont("small")
|
||||
color: UM.Theme.getColor("text")
|
||||
height: Math.round(size / 2)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: position + 1
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
width: Math.round(size / 2)
|
||||
visible: position >= 0
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.0
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
/**
|
||||
@ -55,10 +55,9 @@ Item
|
||||
visible: !printJob
|
||||
radius: 2 * screenScaleFactor // TODO: Theme!
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: printJob && printJob.name ? printJob.name : ""
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
visible: printJob
|
||||
@ -66,8 +65,6 @@ Item
|
||||
// FIXED-LINE-HEIGHT:
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,18 +83,15 @@ Item
|
||||
radius: 2 * screenScaleFactor // TODO: Theme!
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: printJob ? OutputDevice.formatDuration(printJob.timeTotal) : ""
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
visible: printJob
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: Math.round(18 * screenScaleFactor) // TODO: Theme!
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,11 +110,10 @@ Item
|
||||
radius: 2 * screenScaleFactor // TODO: Theme!
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: printerAssignmentLabel
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
text: {
|
||||
@ -143,8 +136,6 @@ Item
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: parent.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Row
|
||||
@ -186,17 +177,15 @@ Item
|
||||
height: Math.round(72 * screenScaleFactor) // TODO: Theme!
|
||||
}
|
||||
|
||||
Label {
|
||||
UM.Label
|
||||
{
|
||||
text: printJob && printJob.owner ? printJob.owner : ""
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
anchors.top: printerConfiguration.top
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: Math.round(18 * screenScaleFactor) // TODO: Theme!
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,7 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Controls.Styles 1.3
|
||||
import QtQuick.Controls 1.4
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
/**
|
||||
* NOTE: For most labels, a fixed height with vertical alignment is used to make
|
||||
@ -20,7 +18,7 @@ Item
|
||||
property var printJob: null
|
||||
|
||||
width: childrenRect.width
|
||||
height: UM.Theme.getSize("monitor_text_line").height
|
||||
height: percentLabel.height
|
||||
|
||||
UM.ProgressBar
|
||||
{
|
||||
@ -34,36 +32,28 @@ Item
|
||||
width: UM.Theme.getSize("monitor_progress_bar").width
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: percentLabel
|
||||
anchors
|
||||
{
|
||||
left: progressBar.right
|
||||
leftMargin: UM.Theme.getSize("monitor_margin").width
|
||||
verticalCenter: parent.verticalCenter
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
text: printJob ? Math.round(printJob.progress * 100) + "%" : "0%"
|
||||
color: printJob && printJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
|
||||
width: contentWidth
|
||||
font: UM.Theme.getFont("default") // 12pt, regular
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: UM.Theme.getSize("monitor_text_line").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
wrapMode: Text.NoWrap
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: statusLabel
|
||||
anchors
|
||||
{
|
||||
left: percentLabel.right
|
||||
leftMargin: UM.Theme.getSize("monitor_margin").width
|
||||
verticalCenter: parent.verticalCenter
|
||||
leftMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.NoWrap
|
||||
text:
|
||||
{
|
||||
if (!printJob)
|
||||
@ -117,10 +107,5 @@ Item
|
||||
}
|
||||
}
|
||||
width: contentWidth
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: UM.Theme.getSize("monitor_text_line").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,7 @@
|
||||
|
||||
import QtQuick 2.3
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Dialogs 1.1
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
/**
|
||||
@ -64,7 +63,7 @@ Item
|
||||
leftMargin: 36 * screenScaleFactor // TODO: Theme!
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
spacing: 18 * screenScaleFactor // TODO: Theme!
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Rectangle
|
||||
{
|
||||
@ -96,23 +95,18 @@ Item
|
||||
{
|
||||
id: printerNameLabel
|
||||
color: printer ? "transparent" : UM.Theme.getColor("monitor_skeleton_loading")
|
||||
height: 18 * screenScaleFactor // TODO: Theme!
|
||||
height: UM.Theme.getSize("default_margin").width
|
||||
width: parent.width
|
||||
radius: 2 * screenScaleFactor // TODO: Theme!
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: printer && printer.name ? printer.name : ""
|
||||
color: UM.Theme.getColor("text")
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("large") // 16pt, bold
|
||||
width: parent.width
|
||||
visible: printer
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: parent.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +114,7 @@ Item
|
||||
{
|
||||
color: UM.Theme.getColor("monitor_skeleton_loading")
|
||||
height: 18 * screenScaleFactor // TODO: Theme!
|
||||
radius: 2 * screenScaleFactor // TODO: Theme!
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
visible: !printer
|
||||
width: 48 * screenScaleFactor // TODO: Theme!
|
||||
}
|
||||
@ -138,21 +132,20 @@ Item
|
||||
Item
|
||||
{
|
||||
id: managePrinterLink
|
||||
anchors {
|
||||
anchors
|
||||
{
|
||||
top: printerFamilyPill.bottom
|
||||
topMargin: UM.Theme.getSize("narrow_margin").height
|
||||
}
|
||||
height: 18 * screenScaleFactor // TODO: Theme!
|
||||
width: childrenRect.width
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: managePrinterText
|
||||
anchors.verticalCenter: managePrinterLink.verticalCenter
|
||||
color: UM.Theme.getColor("text_link")
|
||||
font: UM.Theme.getFont("default")
|
||||
text: catalog.i18nc("@label link to Connect and Cloud interfaces", "Manage printer")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
UM.RecolorImage
|
||||
{
|
||||
@ -165,22 +158,16 @@ Item
|
||||
}
|
||||
color: UM.Theme.getColor("text_link")
|
||||
source: UM.Theme.getIcon("LinkExternal")
|
||||
width: 12 * screenScaleFactor
|
||||
height: 12 * screenScaleFactor
|
||||
width: UM.Theme.getSize("icon").width
|
||||
height: UM.Theme.getSize("icon").height
|
||||
}
|
||||
}
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: managePrinterLink
|
||||
onClicked: OutputDevice.openPrinterControlPanel()
|
||||
onEntered:
|
||||
{
|
||||
manageQueueText.font.underline = true
|
||||
}
|
||||
onExited:
|
||||
{
|
||||
manageQueueText.font.underline = false
|
||||
}
|
||||
onEntered: manageQueueText.font.underline = true
|
||||
onExited: manageQueueText.font.underline = false
|
||||
}
|
||||
}
|
||||
|
||||
@ -332,9 +319,9 @@ Item
|
||||
leftMargin: 36 * screenScaleFactor // TODO: Theme!
|
||||
}
|
||||
height: childrenRect.height
|
||||
spacing: 18 * screenScaleFactor // TODO: Theme!
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: printerStatus
|
||||
anchors
|
||||
@ -371,7 +358,6 @@ Item
|
||||
return ""
|
||||
}
|
||||
visible: text !== ""
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Item
|
||||
@ -401,22 +387,18 @@ Item
|
||||
height: printerNameLabel.height + printerFamilyPill.height + 6 * screenScaleFactor // TODO: Theme!
|
||||
visible: printer && printer.activePrintJob && !printerStatus.visible
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: printerJobNameLabel
|
||||
color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
font: UM.Theme.getFont("large") // 16pt, bold
|
||||
text: printer && printer.activePrintJob ? printer.activePrintJob.name : catalog.i18nc("@label", "Untitled")
|
||||
width: parent.width
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: 18 * screenScaleFactor // TODO: Theme!
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: printerJobOwnerLabel
|
||||
anchors
|
||||
@ -427,14 +409,8 @@ Item
|
||||
}
|
||||
color: printer && printer.activePrintJob && printer.activePrintJob.isActive ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default") // 12pt, regular
|
||||
text: printer && printer.activePrintJob ? printer.activePrintJob.owner : catalog.i18nc("@label", "Anonymous")
|
||||
width: parent.width
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: 18 * screenScaleFactor // TODO: Theme!
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
@ -448,59 +424,27 @@ Item
|
||||
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length === 0 && !printerStatus.visible
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
anchors
|
||||
{
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
font: UM.Theme.getFont("default")
|
||||
text: catalog.i18nc("@label:status", "Requires configuration changes")
|
||||
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible
|
||||
color: UM.Theme.getColor("text")
|
||||
|
||||
// FIXED-LINE-HEIGHT:
|
||||
height: 18 * screenScaleFactor // TODO: Theme!
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: detailsButton
|
||||
anchors
|
||||
{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
rightMargin: 18 * screenScaleFactor // TODO: Theme!
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
background: Rectangle
|
||||
{
|
||||
color: UM.Theme.getColor("monitor_secondary_button_shadow")
|
||||
radius: 2 * screenScaleFactor // Todo: Theme!
|
||||
Rectangle
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme!
|
||||
color: detailsButton.hovered ? UM.Theme.getColor("monitor_secondary_button_hover") : UM.Theme.getColor("monitor_secondary_button")
|
||||
radius: 2 * screenScaleFactor // Todo: Theme!
|
||||
}
|
||||
}
|
||||
contentItem: Label
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.bottomMargin: 2 * screenScaleFactor // TODO: Theme!
|
||||
color: UM.Theme.getColor("monitor_secondary_button_text")
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
text: catalog.i18nc("@action:button", "Details");
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
height: 18 * screenScaleFactor // TODO: Theme!
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
implicitHeight: 32 * screenScaleFactor // TODO: Theme!
|
||||
implicitWidth: 96 * screenScaleFactor // TODO: Theme!
|
||||
text: catalog.i18nc("@action:button", "Details")
|
||||
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible
|
||||
onClicked: base.enabled ? overrideConfirmationDialog.open() : {}
|
||||
enabled: OutputDevice.supportsPrintJobActions
|
||||
|
@ -2,8 +2,7 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
/**
|
||||
* A MonitorPrinterPill is a blue-colored tag indicating which printers a print
|
||||
@ -17,20 +16,19 @@ Item
|
||||
implicitHeight: 18 * screenScaleFactor // TODO: Theme!
|
||||
implicitWidth: Math.max(printerNameLabel.contentWidth + 12 * screenScaleFactor, 36 * screenScaleFactor) // TODO: Theme!
|
||||
|
||||
Rectangle {
|
||||
Rectangle
|
||||
{
|
||||
id: background
|
||||
anchors.fill: parent
|
||||
color: printerNameLabel.visible ? UM.Theme.getColor("monitor_printer_family_tag") : UM.Theme.getColor("monitor_skeleton_loading")
|
||||
radius: 2 * screenScaleFactor // TODO: Theme!
|
||||
}
|
||||
|
||||
Label {
|
||||
UM.Label
|
||||
{
|
||||
id: printerNameLabel
|
||||
anchors.centerIn: parent
|
||||
color: UM.Theme.getColor("text")
|
||||
text: monitorPrinterPill.text
|
||||
font.pointSize: 10 // TODO: Theme!
|
||||
visible: monitorPrinterPill.text !== ""
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,9 @@
|
||||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import UM 1.3 as UM
|
||||
import QtQuick.Controls 2.15
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
/**
|
||||
@ -18,18 +17,16 @@ Item
|
||||
// they might not need to though.
|
||||
property bool cloudConnection: Cura.MachineManager.activeMachineIsUsingCloudConnection
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: queuedLabel
|
||||
anchors
|
||||
{
|
||||
left: queuedPrintJobs.left
|
||||
left: printJobList.left
|
||||
top: parent.top
|
||||
}
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("large")
|
||||
text: catalog.i18nc("@label", "Queued")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Item
|
||||
@ -37,7 +34,7 @@ Item
|
||||
id: manageQueueLabel
|
||||
anchors
|
||||
{
|
||||
right: queuedPrintJobs.right
|
||||
right: printJobList.right
|
||||
verticalCenter: queuedLabel.verticalCenter
|
||||
}
|
||||
height: 18 * screenScaleFactor // TODO: Theme!
|
||||
@ -52,7 +49,7 @@ Item
|
||||
width: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
|
||||
height: 16 * screenScaleFactor // TODO: Theme! (Y U NO USE 18 LIKE ALL OTHER ICONS?!)
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: manageQueueText
|
||||
anchors
|
||||
@ -64,7 +61,6 @@ Item
|
||||
color: UM.Theme.getColor("text_link")
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
text: catalog.i18nc("@label link to connect manager", "Manage in browser")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,14 +68,9 @@ Item
|
||||
{
|
||||
anchors.fill: manageQueueLabel
|
||||
onClicked: OutputDevice.openPrintJobControlPanel()
|
||||
onEntered:
|
||||
{
|
||||
manageQueueText.font.underline = true
|
||||
}
|
||||
onExited:
|
||||
{
|
||||
manageQueueText.font.underline = false
|
||||
}
|
||||
onEntered: manageQueueText.font.underline = true
|
||||
|
||||
onExited: manageQueueText.font.underline = false
|
||||
}
|
||||
|
||||
Row
|
||||
@ -87,96 +78,85 @@ Item
|
||||
id: printJobQueueHeadings
|
||||
anchors
|
||||
{
|
||||
left: queuedPrintJobs.left
|
||||
left: printJobList.left
|
||||
leftMargin: UM.Theme.getSize("narrow_margin").width
|
||||
top: queuedLabel.bottom
|
||||
topMargin: 24 * screenScaleFactor // TODO: Theme!
|
||||
}
|
||||
spacing: 18 * screenScaleFactor // TODO: Theme!
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "There are no print jobs in the queue. Slice and send a job to add one.")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("medium")
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
renderType: Text.NativeRendering
|
||||
visible: printJobList.count === 0
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Print jobs")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 284 * screenScaleFactor // TODO: Theme! (Should match column size)
|
||||
|
||||
renderType: Text.NativeRendering
|
||||
visible: printJobList.count > 0
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Total print time")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: UM.Theme.getSize("monitor_column").width
|
||||
|
||||
renderType: Text.NativeRendering
|
||||
visible: printJobList.count > 0
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Waiting for")
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("medium") // 14pt, regular
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: UM.Theme.getSize("monitor_column").width
|
||||
|
||||
renderType: Text.NativeRendering
|
||||
visible: printJobList.count > 0
|
||||
}
|
||||
}
|
||||
|
||||
ScrollView
|
||||
ListView
|
||||
{
|
||||
id: queuedPrintJobs
|
||||
id: printJobList
|
||||
anchors
|
||||
{
|
||||
bottom: parent.bottom
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
top: printJobQueueHeadings.bottom
|
||||
topMargin: 12 * screenScaleFactor // TODO: Theme!
|
||||
topMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
style: UM.Theme.styles.scrollview
|
||||
width: parent.width
|
||||
|
||||
ListView
|
||||
ScrollBar.vertical: UM.ScrollBar
|
||||
{
|
||||
id: printJobList
|
||||
anchors.fill: parent
|
||||
delegate: MonitorPrintJobCard
|
||||
id: printJobScrollBar
|
||||
}
|
||||
spacing: UM.Theme.getSize("narrow_margin").width
|
||||
clip: true
|
||||
|
||||
delegate: MonitorPrintJobCard
|
||||
{
|
||||
anchors
|
||||
{
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
printJob: modelData
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
rightMargin: printJobScrollBar.width
|
||||
}
|
||||
model:
|
||||
printJob: modelData
|
||||
}
|
||||
model:
|
||||
{
|
||||
if (OutputDevice.receivedData)
|
||||
{
|
||||
if (OutputDevice.receivedData)
|
||||
{
|
||||
return OutputDevice.queuedPrintJobs
|
||||
}
|
||||
return [null, null]
|
||||
return OutputDevice.queuedPrintJobs
|
||||
}
|
||||
spacing: 6 // TODO: Theme!
|
||||
return [null, null]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import UM 1.3 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
@ -1,24 +1,24 @@
|
||||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Copyright (c) 2021 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
Button {
|
||||
background: Rectangle {
|
||||
opacity: parent.down || parent.hovered ? 1 : 0;
|
||||
Button
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
opacity: parent.down || parent.hovered ? 1 : 0
|
||||
color: UM.Theme.getColor("monitor_context_menu_hover")
|
||||
}
|
||||
contentItem: Label {
|
||||
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled");
|
||||
contentItem: UM.Label
|
||||
{
|
||||
color: enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("monitor_text_disabled")
|
||||
text: parent.text
|
||||
horizontalAlignment: Text.AlignLeft;
|
||||
verticalAlignment: Text.AlignVCenter;
|
||||
renderType: Text.NativeRendering;
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
}
|
||||
height: visible ? 39 * screenScaleFactor : 0; // TODO: Theme!
|
||||
hoverEnabled: true;
|
||||
width: parent.width;
|
||||
height: visible ? 39 * screenScaleFactor : 0 // TODO: Theme!
|
||||
hoverEnabled: true
|
||||
width: parent.width
|
||||
}
|
||||
|
@ -2,8 +2,7 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.15 as NewControls
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import UM 1.1 as UM
|
||||
|
||||
@ -84,7 +83,7 @@ UM.Dialog {
|
||||
renderType: Text.NativeRendering;
|
||||
}
|
||||
|
||||
NewControls.ComboBox {
|
||||
ComboBox {
|
||||
id: printerComboBox;
|
||||
currentIndex: 0;
|
||||
Behavior on height { NumberAnimation { duration: 100 } }
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import UM 1.3 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.4 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
Item
|
||||
@ -46,15 +46,12 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Label
|
||||
contentItem: UM.Label
|
||||
{
|
||||
id: label
|
||||
text: signInButton.text
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("primary_text")
|
||||
width: contentWidth
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,7 +110,7 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: initialLabel
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@ -121,9 +118,7 @@ Item
|
||||
text: accountWidget.text
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
color: UM.Theme.getColor("primary_text")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.4 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
Column
|
||||
@ -12,14 +12,12 @@ Column
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
padding: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: title
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
renderType: Text.NativeRendering
|
||||
text: catalog.i18nc("@label", "Sign in to the Ultimaker platform")
|
||||
text: catalog.i18nc("@label", "Sign in to the Ultimaker platform")
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
|
||||
Image
|
||||
@ -33,16 +31,14 @@ Column
|
||||
verticalAlignment: Image.AlignVCenter
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: generalInformationPoints
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
renderType: Text.NativeRendering
|
||||
text: catalog.i18nc("@text", "- Add material profiles and plug-ins from the Marketplace\n- Back-up and sync your material profiles and plug-ins\n- Share ideas and get help from 48,000+ users in the Ultimaker community")
|
||||
lineHeight: 1.4
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
wrapMode: Text.NoWrap
|
||||
}
|
||||
|
||||
Cura.PrimaryButton
|
||||
|
@ -1,7 +1,7 @@
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.4 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
Row // Sync state icon + message
|
||||
@ -77,28 +77,26 @@ Row // Sync state icon + message
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: stateLabel
|
||||
// text is determined by State
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("medium")
|
||||
renderType: Text.NativeRendering
|
||||
width: contentWidth + UM.Theme.getSize("default_margin").height
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
wrapMode: Text.NoWrap
|
||||
height: contentHeight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
visible: !Cura.API.account.manualSyncEnabled && !Cura.API.account.updatePackagesEnabled
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: updatePackagesButton
|
||||
text: catalog.i18nc("@button", "Install pending updates")
|
||||
color: UM.Theme.getColor("text_link")
|
||||
font: UM.Theme.getFont("medium")
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
height: contentHeight
|
||||
wrapMode: Text.NoWrap
|
||||
width: contentWidth + UM.Theme.getSize("default_margin").height
|
||||
visible: Cura.API.account.updatePackagesEnabled
|
||||
|
||||
@ -112,14 +110,13 @@ Row // Sync state icon + message
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: accountSyncButton
|
||||
text: catalog.i18nc("@button", "Check for account updates")
|
||||
color: UM.Theme.getColor("text_link")
|
||||
font: UM.Theme.getFont("medium")
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.NoWrap
|
||||
height: contentHeight
|
||||
width: contentWidth + UM.Theme.getSize("default_margin").height
|
||||
visible: Cura.API.account.manualSyncEnabled
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.4 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
Column
|
||||
@ -41,16 +41,13 @@ Column
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: UM.Theme.getColor("action_button_disabled")
|
||||
visible: !avatar.hasAvatar
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: initialLabel
|
||||
anchors.centerIn: parent
|
||||
text: profile["username"].charAt(0).toUpperCase()
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
color: UM.Theme.getColor("text")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,25 +59,22 @@ Column
|
||||
spacing: UM.Theme.getSize("narrow_margin").height
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: username
|
||||
renderType: Text.NativeRendering
|
||||
text: profile.username
|
||||
font: UM.Theme.getFont("large_bold")
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
|
||||
SyncState
|
||||
{
|
||||
id: syncRow
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: lastSyncLabel
|
||||
renderType: Text.NativeRendering
|
||||
text: catalog.i18nc("@label The argument is a timestamp", "Last update: %1").arg(Cura.API.account.lastSyncDateTime)
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_medium")
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import QtQuick 2.7
|
||||
import QtQuick.Controls 2.1
|
||||
import QtGraphicalEffects 1.0 // For the dropshadow
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
||||
@ -128,18 +128,16 @@ Button
|
||||
elideWidth: buttonText.width
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: buttonText
|
||||
text: button.text
|
||||
color: button.enabled ? (button.hovered ? button.textHoverColor : button.textColor): button.textDisabledColor
|
||||
font: UM.Theme.getFont("medium")
|
||||
visible: text != ""
|
||||
renderType: Text.NativeRendering
|
||||
height: parent.height
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
|
||||
Binding
|
||||
|
@ -1,10 +1,9 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Controls 2.4
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 1.4 as Controls1
|
||||
|
||||
import UM 1.4 as UM
|
||||
import Cura 1.0 as Cura
|
||||
@ -122,7 +121,9 @@ Column
|
||||
tooltip: catalog.i18nc("@label", "Start the slicing process")
|
||||
enabled: widget.backendState != UM.Backend.Error && !widget.waitingForSliceToStart
|
||||
visible: widget.backendState == UM.Backend.NotStarted || widget.backendState == UM.Backend.Error
|
||||
onClicked: sliceOrStopSlicing()
|
||||
onClicked: {
|
||||
sliceOrStopSlicing()
|
||||
}
|
||||
}
|
||||
|
||||
Cura.SecondaryButton
|
||||
@ -136,7 +137,9 @@ Column
|
||||
text: catalog.i18nc("@button", "Cancel")
|
||||
enabled: sliceButton.enabled
|
||||
visible: !sliceButton.visible
|
||||
onClicked: sliceOrStopSlicing()
|
||||
onClicked: {
|
||||
sliceOrStopSlicing()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,7 +168,7 @@ Column
|
||||
}
|
||||
|
||||
// Shortcut for "slice/stop"
|
||||
Controls1.Action
|
||||
Action
|
||||
{
|
||||
shortcut: "Ctrl+P"
|
||||
onTriggered:
|
||||
|
@ -4,75 +4,73 @@
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.3 as Controls2
|
||||
import QtQuick.Controls 2.4
|
||||
import UM 1.1 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
{
|
||||
property alias newProject: newProjectAction;
|
||||
property alias open: openAction;
|
||||
property alias quit: quitAction;
|
||||
property alias newProject: newProjectAction
|
||||
property alias open: openAction
|
||||
property alias quit: quitAction
|
||||
|
||||
property alias undo: undoAction;
|
||||
property alias redo: redoAction;
|
||||
property alias undo: undoAction
|
||||
property alias redo: redoAction
|
||||
|
||||
property alias view3DCamera: view3DCameraAction;
|
||||
property alias viewFrontCamera: viewFrontCameraAction;
|
||||
property alias viewTopCamera: viewTopCameraAction;
|
||||
property alias viewBottomCamera: viewBottomCameraAction;
|
||||
property alias viewLeftSideCamera: viewLeftSideCameraAction;
|
||||
property alias viewRightSideCamera: viewRightSideCameraAction;
|
||||
property alias view3DCamera: view3DCameraAction
|
||||
property alias viewFrontCamera: viewFrontCameraAction
|
||||
property alias viewTopCamera: viewTopCameraAction
|
||||
property alias viewBottomCamera: viewBottomCameraAction
|
||||
property alias viewLeftSideCamera: viewLeftSideCameraAction
|
||||
property alias viewRightSideCamera: viewRightSideCameraAction
|
||||
|
||||
property alias deleteSelection: deleteSelectionAction;
|
||||
property alias centerSelection: centerSelectionAction;
|
||||
property alias multiplySelection: multiplySelectionAction;
|
||||
property alias deleteSelection: deleteSelectionAction
|
||||
property alias centerSelection: centerSelectionAction
|
||||
property alias multiplySelection: multiplySelectionAction
|
||||
|
||||
property alias deleteObject: deleteObjectAction;
|
||||
property alias centerObject: centerObjectAction;
|
||||
property alias groupObjects: groupObjectsAction;
|
||||
property alias unGroupObjects:unGroupObjectsAction;
|
||||
property alias mergeObjects: mergeObjectsAction;
|
||||
//property alias unMergeObjects: unMergeObjectsAction;
|
||||
property alias deleteObject: deleteObjectAction
|
||||
property alias centerObject: centerObjectAction
|
||||
property alias groupObjects: groupObjectsAction
|
||||
property alias unGroupObjects:unGroupObjectsAction
|
||||
property alias mergeObjects: mergeObjectsAction
|
||||
//property alias unMergeObjects: unMergeObjectsAction
|
||||
|
||||
property alias multiplyObject: multiplyObjectAction;
|
||||
property alias multiplyObject: multiplyObjectAction
|
||||
|
||||
property alias selectAll: selectAllAction;
|
||||
property alias deleteAll: deleteAllAction;
|
||||
property alias reloadAll: reloadAllAction;
|
||||
property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction;
|
||||
property alias arrangeAll: arrangeAllAction;
|
||||
property alias arrangeSelection: arrangeSelectionAction;
|
||||
property alias resetAllTranslation: resetAllTranslationAction;
|
||||
property alias resetAll: resetAllAction;
|
||||
property alias selectAll: selectAllAction
|
||||
property alias deleteAll: deleteAllAction
|
||||
property alias reloadAll: reloadAllAction
|
||||
property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction
|
||||
property alias arrangeAll: arrangeAllAction
|
||||
property alias arrangeSelection: arrangeSelectionAction
|
||||
property alias resetAllTranslation: resetAllTranslationAction
|
||||
property alias resetAll: resetAllAction
|
||||
|
||||
property alias addMachine: addMachineAction;
|
||||
property alias configureMachines: settingsAction;
|
||||
property alias addProfile: addProfileAction;
|
||||
property alias updateProfile: updateProfileAction;
|
||||
property alias resetProfile: resetProfileAction;
|
||||
property alias manageProfiles: manageProfilesAction;
|
||||
property alias addMachine: addMachineAction
|
||||
property alias configureMachines: settingsAction
|
||||
property alias addProfile: addProfileAction
|
||||
property alias updateProfile: updateProfileAction
|
||||
property alias resetProfile: resetProfileAction
|
||||
property alias manageProfiles: manageProfilesAction
|
||||
|
||||
property alias manageMaterials: manageMaterialsAction;
|
||||
property alias marketplaceMaterials: marketplaceMaterialsAction;
|
||||
property alias manageMaterials: manageMaterialsAction
|
||||
property alias marketplaceMaterials: marketplaceMaterialsAction
|
||||
|
||||
property alias preferences: preferencesAction;
|
||||
property alias preferences: preferencesAction
|
||||
|
||||
property alias showProfileFolder: showProfileFolderAction;
|
||||
property alias documentation: documentationAction;
|
||||
property alias showProfileFolder: showProfileFolderAction
|
||||
property alias documentation: documentationAction
|
||||
property alias showTroubleshooting: showTroubleShootingAction
|
||||
property alias reportBug: reportBugAction;
|
||||
property alias reportBug: reportBugAction
|
||||
property alias whatsNew: whatsNewAction
|
||||
property alias about: aboutAction;
|
||||
property alias about: aboutAction
|
||||
|
||||
property alias toggleFullScreen: toggleFullScreenAction;
|
||||
property alias toggleFullScreen: toggleFullScreenAction
|
||||
property alias exitFullScreen: exitFullScreenAction
|
||||
|
||||
property alias configureSettingVisibility: configureSettingVisibilityAction
|
||||
|
||||
property alias browsePackages: browsePackagesAction
|
||||
property alias openMarketplace: openMarketplaceAction
|
||||
|
||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
|
||||
@ -81,7 +79,7 @@ Item
|
||||
{
|
||||
id: showTroubleShootingAction
|
||||
onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/troubleshooting?utm_source=cura&utm_medium=software&utm_campaign=dropdown-troubleshooting")
|
||||
text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting Guide");
|
||||
text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting Guide")
|
||||
}
|
||||
|
||||
Action
|
||||
@ -89,7 +87,7 @@ Item
|
||||
id: toggleFullScreenAction
|
||||
shortcut: StandardKey.FullScreen
|
||||
text: catalog.i18nc("@action:inmenu", "Toggle Full Screen")
|
||||
iconName: "view-fullscreen"
|
||||
icon.name: "view-fullscreen"
|
||||
}
|
||||
|
||||
Action
|
||||
@ -97,27 +95,27 @@ Item
|
||||
id: exitFullScreenAction
|
||||
shortcut: StandardKey.Cancel
|
||||
text: catalog.i18nc("@action:inmenu", "Exit Full Screen")
|
||||
iconName: "view-fullscreen"
|
||||
icon.name: "view-fullscreen"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: undoAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "&Undo");
|
||||
iconName: "edit-undo";
|
||||
shortcut: StandardKey.Undo;
|
||||
onTriggered: UM.OperationStack.undo();
|
||||
enabled: UM.OperationStack.canUndo;
|
||||
id: undoAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "&Undo")
|
||||
icon.name: "edit-undo"
|
||||
shortcut: StandardKey.Undo
|
||||
onTriggered: UM.OperationStack.undo()
|
||||
enabled: UM.OperationStack.canUndo
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: redoAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo");
|
||||
iconName: "edit-redo";
|
||||
shortcut: StandardKey.Redo;
|
||||
onTriggered: UM.OperationStack.redo();
|
||||
enabled: UM.OperationStack.canRedo;
|
||||
id: redoAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo")
|
||||
icon.name: "edit-redo"
|
||||
shortcut: StandardKey.Redo
|
||||
onTriggered: UM.OperationStack.redo()
|
||||
enabled: UM.OperationStack.canRedo
|
||||
}
|
||||
|
||||
Action
|
||||
@ -132,7 +130,7 @@ Item
|
||||
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
|
||||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
text: (Qt.platform.os == "osx") ? "&Quit" : catalog.i18nc("@action:inmenu menubar:file", "&Quit")
|
||||
iconName: "application-exit"
|
||||
icon.name: "application-exit"
|
||||
shortcut: StandardKey.Quit
|
||||
}
|
||||
|
||||
@ -189,7 +187,7 @@ Item
|
||||
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
|
||||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
text: (Qt.platform.os == "osx") ? "Configure Cura..." : catalog.i18nc("@action:inmenu", "Configure Cura...")
|
||||
iconName: "configure"
|
||||
icon.name: "configure"
|
||||
}
|
||||
|
||||
Action
|
||||
@ -202,14 +200,14 @@ Item
|
||||
{
|
||||
id: settingsAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:printer", "Manage Pr&inters...")
|
||||
iconName: "configure"
|
||||
icon.name: "configure"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: manageMaterialsAction
|
||||
text: catalog.i18nc("@action:inmenu", "Manage Materials...")
|
||||
iconName: "configure"
|
||||
icon.name: "configure"
|
||||
shortcut: "Ctrl+K"
|
||||
}
|
||||
|
||||
@ -221,7 +219,7 @@ Item
|
||||
|
||||
Action
|
||||
{
|
||||
id: updateProfileAction;
|
||||
id: updateProfileAction
|
||||
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile", "&Update profile with current settings/overrides");
|
||||
onTriggered: Cura.ContainerManager.updateQualityChanges();
|
||||
@ -229,56 +227,56 @@ Item
|
||||
|
||||
Action
|
||||
{
|
||||
id: resetProfileAction;
|
||||
id: resetProfileAction
|
||||
enabled: Cura.MachineManager.hasUserSettings
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile", "&Discard current changes");
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile", "&Discard current changes")
|
||||
onTriggered:
|
||||
{
|
||||
forceActiveFocus();
|
||||
Cura.ContainerManager.clearUserContainers();
|
||||
forceActiveFocus()
|
||||
Cura.ContainerManager.clearUserContainers()
|
||||
}
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: addProfileAction;
|
||||
id: addProfileAction
|
||||
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile", "&Create profile from current settings/overrides...");
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile", "&Create profile from current settings/overrides...")
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: manageProfilesAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile", "Manage Profiles...")
|
||||
iconName: "configure"
|
||||
icon.name: "configure"
|
||||
shortcut: "Ctrl+J"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: documentationAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:help", "Show Online &Documentation");
|
||||
iconName: "help-contents";
|
||||
shortcut: StandardKey.Help;
|
||||
onTriggered: CuraActions.openDocumentation();
|
||||
id: documentationAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:help", "Show Online &Documentation")
|
||||
icon.name: "help-contents"
|
||||
shortcut: StandardKey.Help
|
||||
onTriggered: CuraActions.openDocumentation()
|
||||
}
|
||||
|
||||
Action {
|
||||
id: reportBugAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:help", "Report a &Bug");
|
||||
iconName: "tools-report-bug";
|
||||
onTriggered: CuraActions.openBugReportPage();
|
||||
id: reportBugAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:help", "Report a &Bug")
|
||||
icon.name: "tools-report-bug"
|
||||
onTriggered: CuraActions.openBugReportPage()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: whatsNewAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:help", "What's New");
|
||||
id: whatsNewAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:help", "What's New")
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: aboutAction;
|
||||
id: aboutAction
|
||||
|
||||
//On MacOS, don't translate the "About" word.
|
||||
//Qt moves the "about" entry to a different place, and if it got renamed can't find it again when it
|
||||
@ -287,60 +285,60 @@ Item
|
||||
//For more information, see:
|
||||
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
|
||||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
text: (Qt.platform.os == "osx") ? "About..." : catalog.i18nc("@action:inmenu menubar:help", "About...");
|
||||
iconName: "help-about";
|
||||
text: (Qt.platform.os == "osx") ? "About..." : catalog.i18nc("@action:inmenu menubar:help", "About...")
|
||||
icon.name: "help-about"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: deleteSelectionAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "Delete Selected");
|
||||
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection;
|
||||
iconName: "edit-delete";
|
||||
id: deleteSelectionAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "Delete Selected")
|
||||
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
|
||||
icon.name: "edit-delete"
|
||||
shortcut: StandardKey.Delete | "Backspace"
|
||||
onTriggered: CuraActions.deleteSelection();
|
||||
onTriggered: CuraActions.deleteSelection()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: centerSelectionAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "Center Selected");
|
||||
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection;
|
||||
iconName: "align-vertical-center";
|
||||
onTriggered: CuraActions.centerSelection();
|
||||
id: centerSelectionAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "Center Selected")
|
||||
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
|
||||
icon.name: "align-vertical-center"
|
||||
onTriggered: CuraActions.centerSelection()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: multiplySelectionAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "Multiply Selected");
|
||||
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection;
|
||||
iconName: "edit-duplicate";
|
||||
id: multiplySelectionAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit", "Multiply Selected")
|
||||
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
|
||||
icon.name: "edit-duplicate"
|
||||
shortcut: "Ctrl+M"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: deleteObjectAction;
|
||||
text: catalog.i18nc("@action:inmenu","Delete Model");
|
||||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-delete";
|
||||
id: deleteObjectAction
|
||||
text: catalog.i18nc("@action:inmenu","Delete Model")
|
||||
enabled: UM.Controller.toolsEnabled
|
||||
icon.name: "edit-delete"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: centerObjectAction;
|
||||
text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform");
|
||||
id: centerObjectAction
|
||||
text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform")
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: groupObjectsAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models")
|
||||
enabled: UM.Selection.selectionCount > 1 ? true: false
|
||||
iconName: "object-group"
|
||||
shortcut: "Ctrl+G";
|
||||
onTriggered: CuraApplication.groupSelected();
|
||||
icon.name: "object-group"
|
||||
shortcut: "Ctrl+G"
|
||||
onTriggered: CuraApplication.groupSelected()
|
||||
}
|
||||
|
||||
Action
|
||||
@ -356,139 +354,132 @@ Item
|
||||
Action
|
||||
{
|
||||
id: unGroupObjectsAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models")
|
||||
enabled: UM.Selection.isGroupSelected
|
||||
iconName: "object-ungroup"
|
||||
shortcut: "Ctrl+Shift+G";
|
||||
onTriggered: CuraApplication.ungroupSelected();
|
||||
icon.name: "object-ungroup"
|
||||
shortcut: "Ctrl+Shift+G"
|
||||
onTriggered: CuraApplication.ungroupSelected()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: mergeObjectsAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models");
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models")
|
||||
enabled: UM.Selection.selectionCount > 1 ? true: false
|
||||
iconName: "merge";
|
||||
shortcut: "Ctrl+Alt+G";
|
||||
onTriggered: CuraApplication.mergeSelected();
|
||||
icon.name: "merge"
|
||||
shortcut: "Ctrl+Alt+G"
|
||||
onTriggered: CuraApplication.mergeSelected()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: multiplyObjectAction;
|
||||
text: catalog.i18nc("@action:inmenu","&Multiply Model...");
|
||||
iconName: "edit-duplicate"
|
||||
id: multiplyObjectAction
|
||||
text: catalog.i18nc("@action:inmenu","&Multiply Model...")
|
||||
icon.name: "edit-duplicate"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: selectAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models");
|
||||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-select-all";
|
||||
shortcut: "Ctrl+A";
|
||||
onTriggered: CuraApplication.selectAll();
|
||||
id: selectAllAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models")
|
||||
enabled: UM.Controller.toolsEnabled
|
||||
icon.name: "edit-select-all"
|
||||
shortcut: "Ctrl+A"
|
||||
onTriggered: CuraApplication.selectAll()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: deleteAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate");
|
||||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-delete";
|
||||
shortcut: "Ctrl+D";
|
||||
onTriggered: CuraApplication.deleteAll();
|
||||
id: deleteAllAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate")
|
||||
enabled: UM.Controller.toolsEnabled
|
||||
icon.name: "edit-delete"
|
||||
shortcut: "Ctrl+D"
|
||||
onTriggered: CuraApplication.deleteAll()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: reloadAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models");
|
||||
iconName: "document-revert";
|
||||
id: reloadAllAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models")
|
||||
icon.name: "document-revert"
|
||||
shortcut: "F5"
|
||||
onTriggered: CuraApplication.reloadAll();
|
||||
onTriggered: CuraApplication.reloadAll()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: arrangeAllBuildPlatesAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates");
|
||||
onTriggered: Printer.arrangeObjectsToAllBuildPlates();
|
||||
id: arrangeAllBuildPlatesAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates")
|
||||
onTriggered: Printer.arrangeObjectsToAllBuildPlates()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: arrangeAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models");
|
||||
onTriggered: Printer.arrangeAll();
|
||||
shortcut: "Ctrl+R";
|
||||
id: arrangeAllAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models")
|
||||
onTriggered: Printer.arrangeAll()
|
||||
shortcut: "Ctrl+R"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: arrangeSelectionAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange Selection");
|
||||
onTriggered: Printer.arrangeSelection();
|
||||
id: arrangeSelectionAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange Selection")
|
||||
onTriggered: Printer.arrangeSelection()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: resetAllTranslationAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions");
|
||||
onTriggered: CuraApplication.resetAllTranslation();
|
||||
id: resetAllTranslationAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions")
|
||||
onTriggered: CuraApplication.resetAllTranslation()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: resetAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations");
|
||||
onTriggered: CuraApplication.resetAll();
|
||||
id: resetAllAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations")
|
||||
onTriggered: CuraApplication.resetAll()
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: openAction;
|
||||
id: openAction
|
||||
property var fileProviderModel: CuraApplication.getFileProviderModel()
|
||||
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)...");
|
||||
iconName: "document-open";
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)...")
|
||||
icon.name: "document-open"
|
||||
// Unassign the shortcut when there are more than one file providers, since then the file provider's shortcut is
|
||||
// enabled instead, and Ctrl+O is assigned to the local file provider
|
||||
shortcut: fileProviderModel.count == 1 ? StandardKey.Open : "";
|
||||
shortcut: fileProviderModel.count == 1 ? StandardKey.Open : ""
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: newProjectAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","&New Project...");
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","&New Project...")
|
||||
shortcut: StandardKey.New
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: showProfileFolderAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:help","Show Configuration Folder");
|
||||
id: showProfileFolderAction
|
||||
text: catalog.i18nc("@action:inmenu menubar:help","Show Configuration Folder")
|
||||
}
|
||||
|
||||
|
||||
Action
|
||||
{
|
||||
id: configureSettingVisibilityAction
|
||||
text: catalog.i18nc("@action:menu", "Configure setting visibility...");
|
||||
iconName: "configure"
|
||||
text: catalog.i18nc("@action:menu", "Configure setting visibility...")
|
||||
icon.name: "configure"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: browsePackagesAction
|
||||
text: "&Marketplace"
|
||||
iconName: "plugins_browse"
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: openMarketplaceAction
|
||||
text: catalog.i18nc("@action:menu", "&Marketplace")
|
||||
iconName: "plugins_browse"
|
||||
icon.name: "plugins_browse"
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.4 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
Button
|
||||
@ -73,7 +73,7 @@ Button
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: applicationDisplayName
|
||||
|
||||
@ -82,10 +82,8 @@ Button
|
||||
|
||||
height: base.height - applicationIcon.height - 2 * UM.Theme.getSize("default_margin").width // Account for the top and bottom margins
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
elide: Text.ElideRight
|
||||
color: UM.Theme.getColor("text")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
148
resources/qml/ColorDialog.qml
Normal file
148
resources/qml/ColorDialog.qml
Normal file
@ -0,0 +1,148 @@
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
/*
|
||||
* A dialog that provides the option to pick a color. Currently it only asks for a hex code and shows the color
|
||||
* in a color swath
|
||||
*/
|
||||
UM.Dialog
|
||||
{
|
||||
id: base
|
||||
|
||||
property variant catalog: UM.I18nCatalog { name: "cura" }
|
||||
|
||||
margin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
property alias swatchGridColumns: colorSwatchGrid.columns
|
||||
|
||||
// In this case we would like to let the content of the dialog determine the size of the dialog
|
||||
// however with the current implementation of the dialog this is not possible, so instead we calculate
|
||||
// the size of the dialog ourselves.
|
||||
minimumWidth: content.width + 4 * margin
|
||||
minimumHeight:
|
||||
content.height // content height
|
||||
+ buttonRow.height // button row height
|
||||
+ 5 * margin // top and bottom margin and margin between buttons and content
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
property alias color: colorInput.text
|
||||
property var swatchColors: [
|
||||
"#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD",
|
||||
"#5D88BE", "#5ABD0E", "#E17239", "#F74E46", "#874AF9",
|
||||
"#50C2EC", "#8DC15A", "#C3977A", "#CD7776", "#9086BA",
|
||||
"#FFFFFF", "#D3D3D3", "#9E9E9E", "#5A5A5A", "#000000",
|
||||
]
|
||||
|
||||
Component.onCompleted: updateSwatches()
|
||||
onSwatchColorsChanged: updateSwatches()
|
||||
|
||||
function updateSwatches()
|
||||
{
|
||||
swatchColorsModel.clear();
|
||||
for (const swatchColor of base.swatchColors)
|
||||
{
|
||||
swatchColorsModel.append({ swatchColor });
|
||||
}
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
id: content
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
spacing: UM.Theme.getSize("wide_margin").height
|
||||
|
||||
GridLayout {
|
||||
id: colorSwatchGrid
|
||||
columns: 5
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
columnSpacing: UM.Theme.getSize("thick_margin").width
|
||||
rowSpacing: UM.Theme.getSize("thick_margin").height
|
||||
|
||||
Repeater
|
||||
{
|
||||
model: ListModel
|
||||
{
|
||||
id: swatchColorsModel
|
||||
}
|
||||
|
||||
delegate: Rectangle
|
||||
{
|
||||
color: swatchColor
|
||||
implicitWidth: UM.Theme.getSize("medium_button_icon").width
|
||||
implicitHeight: UM.Theme.getSize("medium_button_icon").height
|
||||
radius: width / 2
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.fill: parent
|
||||
visible: swatchColor == base.color
|
||||
source: UM.Theme.getIcon("Check", "low")
|
||||
color: UM.Theme.getColor("checkbox")
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent
|
||||
onClicked: base.color = swatchColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
width: parent.width
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Hex")
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: colorInput
|
||||
Layout.fillWidth: true
|
||||
text: "#FFFFFF"
|
||||
selectByMouse: true
|
||||
onTextChanged: {
|
||||
if (!text.startsWith("#"))
|
||||
{
|
||||
text = `#${text}`;
|
||||
}
|
||||
}
|
||||
validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ }
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
color: base.color
|
||||
Layout.preferredHeight: parent.height
|
||||
Layout.preferredWidth: height
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buttonSpacing: UM.Theme.getSize("thin_margin").width
|
||||
|
||||
rightButtons:
|
||||
[
|
||||
Cura.TertiaryButton {
|
||||
text: catalog.i18nc("@action:button", "Cancel")
|
||||
onClicked: base.close()
|
||||
},
|
||||
Cura.PrimaryButton {
|
||||
text: catalog.i18nc("@action:button", "OK")
|
||||
onClicked: base.accept()
|
||||
}
|
||||
]
|
||||
}
|
@ -1,14 +1,11 @@
|
||||
// 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.7
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
import "Dialogs"
|
||||
@ -161,7 +158,6 @@ UM.MainWindow
|
||||
ApplicationMenu
|
||||
{
|
||||
id: applicationMenu
|
||||
window: base
|
||||
}
|
||||
|
||||
Item
|
||||
@ -255,7 +251,6 @@ UM.MainWindow
|
||||
// Try to install plugin & close.
|
||||
CuraApplication.installPackageViaDragAndDrop(filename);
|
||||
packageInstallDialog.text = catalog.i18nc("@label", "This package will be installed after restarting.");
|
||||
packageInstallDialog.icon = StandardIcon.Information;
|
||||
packageInstallDialog.open();
|
||||
}
|
||||
else
|
||||
@ -588,18 +583,15 @@ UM.MainWindow
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: exitConfirmationDialog
|
||||
title: catalog.i18nc("@title:window %1 is the application name", "Closing %1").arg(CuraApplication.applicationDisplayName)
|
||||
text: catalog.i18nc("@label %1 is the application name", "Are you sure you want to exit %1?").arg(CuraApplication.applicationDisplayName)
|
||||
icon: StandardIcon.Question
|
||||
modality: Qt.ApplicationModal
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
onYes: CuraApplication.callConfirmExitDialogCallback(true)
|
||||
onNo: CuraApplication.callConfirmExitDialogCallback(false)
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
onAccepted: CuraApplication.callConfirmExitDialogCallback(true)
|
||||
onRejected: CuraApplication.callConfirmExitDialogCallback(false)
|
||||
onVisibilityChanged:
|
||||
onClosed:
|
||||
{
|
||||
if (!visible)
|
||||
{
|
||||
@ -749,20 +741,18 @@ UM.MainWindow
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: packageInstallDialog
|
||||
title: catalog.i18nc("@window:title", "Install Package");
|
||||
title: catalog.i18nc("@window:title", "Install Package")
|
||||
standardButtons: StandardButton.Ok
|
||||
modality: Qt.ApplicationModal
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: infoMultipleFilesWithGcodeDialog
|
||||
title: catalog.i18nc("@title:window", "Open File(s)")
|
||||
icon: StandardIcon.Information
|
||||
standardButtons: StandardButton.Ok
|
||||
standardButtons: Dialog.Ok
|
||||
text: catalog.i18nc("@text:window", "We have found one or more G-Code files within the files you have selected. You can only open one G-Code file at a time. If you want to open a G-Code file, please just select only one.")
|
||||
|
||||
property var selectedMultipleFiles
|
||||
@ -821,35 +811,6 @@ UM.MainWindow
|
||||
}
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
{
|
||||
id: messageDialog
|
||||
modality: Qt.ApplicationModal
|
||||
onAccepted: CuraApplication.messageBoxClosed(clickedButton)
|
||||
onApply: CuraApplication.messageBoxClosed(clickedButton)
|
||||
onDiscard: CuraApplication.messageBoxClosed(clickedButton)
|
||||
onHelp: CuraApplication.messageBoxClosed(clickedButton)
|
||||
onNo: CuraApplication.messageBoxClosed(clickedButton)
|
||||
onRejected: CuraApplication.messageBoxClosed(clickedButton)
|
||||
onReset: CuraApplication.messageBoxClosed(clickedButton)
|
||||
onYes: CuraApplication.messageBoxClosed(clickedButton)
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: CuraApplication
|
||||
function onShowMessageBox(title, text, informativeText, detailedText, buttons, icon)
|
||||
{
|
||||
messageDialog.title = title
|
||||
messageDialog.text = text
|
||||
messageDialog.informativeText = informativeText
|
||||
messageDialog.detailedText = detailedText
|
||||
messageDialog.standardButtons = buttons
|
||||
messageDialog.icon = icon
|
||||
messageDialog.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: discardOrKeepProfileChangesDialogComponent
|
||||
|
@ -1,11 +1,11 @@
|
||||
// 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.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Controls 2.9
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.5 as Cura
|
||||
|
||||
UM.Dialog
|
||||
{
|
||||
@ -50,7 +50,7 @@ UM.Dialog
|
||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: version
|
||||
|
||||
@ -63,7 +63,7 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: description
|
||||
width: parent.width
|
||||
@ -76,7 +76,7 @@ UM.Dialog
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: creditsNotes
|
||||
width: parent.width
|
||||
@ -89,90 +89,87 @@ UM.Dialog
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
|
||||
ScrollView
|
||||
ListView
|
||||
{
|
||||
id: credits
|
||||
id: projectsList
|
||||
anchors.top: creditsNotes.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
|
||||
width: parent.width
|
||||
height: base.height - y - (2 * UM.Theme.getSize("default_margin").height + closeButton.height)
|
||||
|
||||
ListView
|
||||
ScrollBar.vertical: UM.ScrollBar
|
||||
{
|
||||
id: projectsList
|
||||
id: projectsListScrollBar
|
||||
}
|
||||
|
||||
width: parent.width
|
||||
delegate: Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("narrow_margin").width
|
||||
UM.Label
|
||||
{
|
||||
text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
|
||||
width: (projectsList.width * 0.25) | 0
|
||||
elide: Text.ElideRight
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: model.description
|
||||
elide: Text.ElideRight
|
||||
width: ((projectsList.width * 0.6) | 0) - parent.spacing * 2 - projectsListScrollBar.width
|
||||
}
|
||||
UM.Label
|
||||
{
|
||||
text: model.license
|
||||
elide: Text.ElideRight
|
||||
width: (projectsList.width * 0.15) | 0
|
||||
}
|
||||
}
|
||||
model: ListModel
|
||||
{
|
||||
id: projectsModel
|
||||
}
|
||||
Component.onCompleted:
|
||||
{
|
||||
projectsModel.append({ name: "Cura", description: catalog.i18nc("@label", "Graphical user interface"), license: "LGPLv3", url: "https://github.com/Ultimaker/Cura" });
|
||||
projectsModel.append({ name: "Uranium", description: catalog.i18nc("@label", "Application framework"), license: "LGPLv3", url: "https://github.com/Ultimaker/Uranium" });
|
||||
projectsModel.append({ name: "CuraEngine", description: catalog.i18nc("@label", "G-code generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" });
|
||||
projectsModel.append({ name: "libArcus", description: catalog.i18nc("@label", "Interprocess communication library"), license: "LGPLv3", url: "https://github.com/Ultimaker/libArcus" });
|
||||
|
||||
delegate: Row
|
||||
{
|
||||
Label
|
||||
{
|
||||
text: "<a href='%1' title='%2'>%2</a>".arg(model.url).arg(model.name)
|
||||
width: (projectsList.width * 0.25) | 0
|
||||
elide: Text.ElideRight
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: model.description
|
||||
elide: Text.ElideRight
|
||||
width: (projectsList.width * 0.6) | 0
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: model.license
|
||||
elide: Text.ElideRight
|
||||
width: (projectsList.width * 0.15) | 0
|
||||
}
|
||||
}
|
||||
model: ListModel
|
||||
{
|
||||
id: projectsModel
|
||||
}
|
||||
Component.onCompleted:
|
||||
{
|
||||
projectsModel.append({ name: "Cura", description: catalog.i18nc("@label", "Graphical user interface"), license: "LGPLv3", url: "https://github.com/Ultimaker/Cura" });
|
||||
projectsModel.append({ name: "Uranium", description: catalog.i18nc("@label", "Application framework"), license: "LGPLv3", url: "https://github.com/Ultimaker/Uranium" });
|
||||
projectsModel.append({ name: "CuraEngine", description: catalog.i18nc("@label", "G-code generator"), license: "AGPLv3", url: "https://github.com/Ultimaker/CuraEngine" });
|
||||
projectsModel.append({ name: "libArcus", description: catalog.i18nc("@label", "Interprocess communication library"), license: "LGPLv3", url: "https://github.com/Ultimaker/libArcus" });
|
||||
|
||||
projectsModel.append({ name: "Python", description: catalog.i18nc("@label", "Programming language"), license: "Python", url: "http://python.org/" });
|
||||
projectsModel.append({ name: "Qt5", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" });
|
||||
projectsModel.append({ name: "PyQt", description: catalog.i18nc("@label", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" });
|
||||
projectsModel.append({ name: "SIP", description: catalog.i18nc("@label", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" });
|
||||
projectsModel.append({ name: "Protobuf", description: catalog.i18nc("@label", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" });
|
||||
projectsModel.append({ name: "SciPy", description: catalog.i18nc("@label", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" });
|
||||
projectsModel.append({ name: "NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" });
|
||||
projectsModel.append({ name: "NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" });
|
||||
projectsModel.append({ name: "Trimesh", description: catalog.i18nc("@label", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" });
|
||||
projectsModel.append({ name: "libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" });
|
||||
projectsModel.append({ name: "libCharon", description: catalog.i18nc("@label", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" });
|
||||
projectsModel.append({ name: "PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
|
||||
projectsModel.append({ name: "python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
|
||||
projectsModel.append({ name: "Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
|
||||
projectsModel.append({ name: "Pyclipper", description: catalog.i18nc("@label", "Python bindings for Clipper"), license: "MIT", url: "https://github.com/fonttools/pyclipper" });
|
||||
projectsModel.append({ name: "mypy", description: catalog.i18nc("@Label", "Static type checker for Python"), license: "MIT", url: "http://mypy-lang.org/" });
|
||||
projectsModel.append({ name: "certifi", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "MPL", url: "https://github.com/certifi/python-certifi" });
|
||||
projectsModel.append({ name: "cryptography", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "APACHE and BSD", url: "https://cryptography.io/" });
|
||||
projectsModel.append({ name: "Sentry", description: catalog.i18nc("@Label", "Python Error tracking library"), license: "BSD 2-Clause 'Simplified'", url: "https://sentry.io/for/python/" });
|
||||
projectsModel.append({ name: "libnest2d", description: catalog.i18nc("@label", "Polygon packing library, developed by Prusa Research"), license: "LGPL", url: "https://github.com/tamasmeszaros/libnest2d" });
|
||||
projectsModel.append({ name: "pynest2d", description: catalog.i18nc("@label", "Python bindings for libnest2d"), license: "LGPL", url: "https://github.com/Ultimaker/pynest2d" });
|
||||
projectsModel.append({ name: "keyring", description: catalog.i18nc("@label", "Support library for system keyring access"), license: "MIT", url: "https://github.com/jaraco/keyring" });
|
||||
projectsModel.append({ name: "pywin32", description: catalog.i18nc("@label", "Python extensions for Microsoft Windows"), license: "PSF", url: "https://github.com/mhammond/pywin32" });
|
||||
projectsModel.append({ name: "Noto Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://www.google.com/get/noto/" });
|
||||
projectsModel.append({ name: "Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" });
|
||||
projectsModel.append({ name: "AppImageKit", description: catalog.i18nc("@label", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" });
|
||||
}
|
||||
projectsModel.append({ name: "Python", description: catalog.i18nc("@label", "Programming language"), license: "Python", url: "http://python.org/" });
|
||||
projectsModel.append({ name: "Qt5", description: catalog.i18nc("@label", "GUI framework"), license: "LGPLv3", url: "https://www.qt.io/" });
|
||||
projectsModel.append({ name: "PyQt", description: catalog.i18nc("@label", "GUI framework bindings"), license: "GPL", url: "https://riverbankcomputing.com/software/pyqt" });
|
||||
projectsModel.append({ name: "SIP", description: catalog.i18nc("@label", "C/C++ Binding library"), license: "GPL", url: "https://riverbankcomputing.com/software/sip" });
|
||||
projectsModel.append({ name: "Protobuf", description: catalog.i18nc("@label", "Data interchange format"), license: "BSD", url: "https://developers.google.com/protocol-buffers" });
|
||||
projectsModel.append({ name: "SciPy", description: catalog.i18nc("@label", "Support library for scientific computing"), license: "BSD-new", url: "https://www.scipy.org/" });
|
||||
projectsModel.append({ name: "NumPy", description: catalog.i18nc("@label", "Support library for faster math"), license: "BSD", url: "http://www.numpy.org/" });
|
||||
projectsModel.append({ name: "NumPy-STL", description: catalog.i18nc("@label", "Support library for handling STL files"), license: "BSD", url: "https://github.com/WoLpH/numpy-stl" });
|
||||
projectsModel.append({ name: "Trimesh", description: catalog.i18nc("@label", "Support library for handling triangular meshes"), license: "MIT", url: "https://trimsh.org" });
|
||||
projectsModel.append({ name: "libSavitar", description: catalog.i18nc("@label", "Support library for handling 3MF files"), license: "LGPLv3", url: "https://github.com/ultimaker/libsavitar" });
|
||||
projectsModel.append({ name: "libCharon", description: catalog.i18nc("@label", "Support library for file metadata and streaming"), license: "LGPLv3", url: "https://github.com/ultimaker/libcharon" });
|
||||
projectsModel.append({ name: "PySerial", description: catalog.i18nc("@label", "Serial communication library"), license: "Python", url: "http://pyserial.sourceforge.net/" });
|
||||
projectsModel.append({ name: "python-zeroconf", description: catalog.i18nc("@label", "ZeroConf discovery library"), license: "LGPL", url: "https://github.com/jstasiak/python-zeroconf" });
|
||||
projectsModel.append({ name: "Clipper", description: catalog.i18nc("@label", "Polygon clipping library"), license: "Boost", url: "http://www.angusj.com/delphi/clipper.php" });
|
||||
projectsModel.append({ name: "Pyclipper", description: catalog.i18nc("@label", "Python bindings for Clipper"), license: "MIT", url: "https://github.com/fonttools/pyclipper" });
|
||||
projectsModel.append({ name: "mypy", description: catalog.i18nc("@Label", "Static type checker for Python"), license: "MIT", url: "http://mypy-lang.org/" });
|
||||
projectsModel.append({ name: "certifi", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "MPL", url: "https://github.com/certifi/python-certifi" });
|
||||
projectsModel.append({ name: "cryptography", description: catalog.i18nc("@Label", "Root Certificates for validating SSL trustworthiness"), license: "APACHE and BSD", url: "https://cryptography.io/" });
|
||||
projectsModel.append({ name: "Sentry", description: catalog.i18nc("@Label", "Python Error tracking library"), license: "BSD 2-Clause 'Simplified'", url: "https://sentry.io/for/python/" });
|
||||
projectsModel.append({ name: "libnest2d", description: catalog.i18nc("@label", "Polygon packing library, developed by Prusa Research"), license: "LGPL", url: "https://github.com/tamasmeszaros/libnest2d" });
|
||||
projectsModel.append({ name: "pynest2d", description: catalog.i18nc("@label", "Python bindings for libnest2d"), license: "LGPL", url: "https://github.com/Ultimaker/pynest2d" });
|
||||
projectsModel.append({ name: "keyring", description: catalog.i18nc("@label", "Support library for system keyring access"), license: "MIT", url: "https://github.com/jaraco/keyring" });
|
||||
projectsModel.append({ name: "pywin32", description: catalog.i18nc("@label", "Python extensions for Microsoft Windows"), license: "PSF", url: "https://github.com/mhammond/pywin32" });
|
||||
projectsModel.append({ name: "Noto Sans", description: catalog.i18nc("@label", "Font"), license: "Apache 2.0", url: "https://www.google.com/get/noto/" });
|
||||
projectsModel.append({ name: "Font-Awesome-SVG-PNG", description: catalog.i18nc("@label", "SVG icons"), license: "SIL OFL 1.1", url: "https://github.com/encharm/Font-Awesome-SVG-PNG" });
|
||||
projectsModel.append({ name: "AppImageKit", description: catalog.i18nc("@label", "Linux cross-distribution application deployment"), license: "MIT", url: "https://github.com/AppImage/AppImageKit" });
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: Button
|
||||
rightButtons: Cura.TertiaryButton
|
||||
{
|
||||
//: Close about dialog button
|
||||
id: closeButton
|
||||
text: catalog.i18nc("@action:button","Close");
|
||||
|
||||
onClicked: base.visible = false;
|
||||
text: catalog.i18nc("@action:button", "Close")
|
||||
onClicked: reject()
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,9 @@
|
||||
// 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.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
@ -77,17 +74,13 @@ UM.Dialog
|
||||
Column
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 20 * screenScaleFactor
|
||||
anchors.rightMargin: 20 * screenScaleFactor
|
||||
anchors.bottomMargin: 10 * screenScaleFactor
|
||||
spacing: 10 * screenScaleFactor
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: questionText
|
||||
width: parent.width
|
||||
text: catalog.i18nc("@text:window", "This is a Cura project file. Would you like to open it as a project or import the models from it?")
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
@ -98,29 +91,24 @@ UM.Dialog
|
||||
text: catalog.i18nc("@text:window", "Remember my choice")
|
||||
checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask"
|
||||
}
|
||||
|
||||
// Buttons
|
||||
Item {
|
||||
id: buttonBar
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
height: childrenRect.height
|
||||
|
||||
Button {
|
||||
id: openAsProjectButton
|
||||
text: catalog.i18nc("@action:button", "Open as project")
|
||||
anchors.right: importModelsButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
isDefault: true
|
||||
onClicked: loadProjectFile()
|
||||
}
|
||||
|
||||
Button {
|
||||
id: importModelsButton
|
||||
text: catalog.i18nc("@action:button", "Import models")
|
||||
anchors.right: parent.right
|
||||
onClicked: loadModelFiles()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onAccepted: loadProjectFile()
|
||||
onRejected: loadModelFiles()
|
||||
|
||||
buttonSpacing: UM.Theme.getSize("thin_margin").width
|
||||
|
||||
rightButtons:
|
||||
[
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Open as project")
|
||||
onClicked: loadProjectFile()
|
||||
},
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Import models")
|
||||
onClicked: loadModelFiles()
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,23 +1,30 @@
|
||||
// Copyright (c) 2020 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
//Copyright (c) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import Qt.labs.qmlmodels 1.0
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.15 as NewControls
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Window 2.1
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.6 as Cura
|
||||
|
||||
UM.Dialog
|
||||
{
|
||||
id: base
|
||||
title: catalog.i18nc("@title:window", "Discard or Keep changes")
|
||||
|
||||
onAccepted: CuraApplication.discardOrKeepProfileChangesClosed("discard")
|
||||
onRejected: CuraApplication.discardOrKeepProfileChangesClosed("keep")
|
||||
|
||||
minimumWidth: UM.Theme.getSize("popup_dialog").width
|
||||
minimumHeight: UM.Theme.getSize("popup_dialog").height
|
||||
property var changesModel: Cura.UserChangesModel{ id: userChangesModel}
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
margin: UM.Theme.getSize("thick_margin").width
|
||||
|
||||
property var changesModel: Cura.UserChangesModel { id: userChangesModel }
|
||||
|
||||
onVisibilityChanged:
|
||||
{
|
||||
if(visible)
|
||||
@ -37,119 +44,59 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
|
||||
Row
|
||||
UM.Label
|
||||
{
|
||||
id: infoTextRow
|
||||
height: childrenRect.height
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
id: infoText
|
||||
text: catalog.i18nc("@text:window, %1 is a profile name", "You have customized some profile settings. Would you like to Keep these changed settings after switching profiles? Alternatively, you can discard the changes to load the defaults from '%1'.").arg(Cura.MachineManager.activeQualityDisplayNameMap["main"])
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
UM.I18nCatalog
|
||||
{
|
||||
id: catalog;
|
||||
id: catalog
|
||||
name: "cura"
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@text:window, %1 is a profile name", "You have customized some profile settings.\nWould you like to Keep these changed settings after switching profiles?\nAlternatively, you can discard the changes to load the defaults from '%1'.").arg(Cura.MachineManager.activeQualityDisplayNameMap["main"])
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
anchors.top: infoTextRow.bottom
|
||||
anchors.bottom: optionRow.top
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.top: infoText.bottom
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
TableView
|
||||
|
||||
Cura.TableView
|
||||
{
|
||||
anchors.fill: parent
|
||||
height: base.height - 150
|
||||
id: tableView
|
||||
Component
|
||||
{
|
||||
id: labelDelegate
|
||||
Label
|
||||
{
|
||||
property var extruder_name: userChangesModel.getItem(styleData.row).extruder
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.right: parent.right
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("system")
|
||||
text:
|
||||
{
|
||||
var result = styleData.value
|
||||
if (extruder_name != "")
|
||||
{
|
||||
result += " (" + extruder_name + ")"
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
||||
}
|
||||
anchors.fill: parent
|
||||
|
||||
Component
|
||||
columnHeaders: [
|
||||
catalog.i18nc("@title:column", "Profile settings"),
|
||||
Cura.MachineManager.activeQualityDisplayNameMap["main"],
|
||||
catalog.i18nc("@title:column", "Current changes")
|
||||
]
|
||||
model: TableModel
|
||||
{
|
||||
id: defaultDelegate
|
||||
Label
|
||||
{
|
||||
text: styleData.value
|
||||
font: UM.Theme.getFont("system")
|
||||
}
|
||||
TableModelColumn { display: "label" }
|
||||
TableModelColumn { display: "original_value" }
|
||||
TableModelColumn { display: "user_value" }
|
||||
rows: userChangesModel.items
|
||||
}
|
||||
|
||||
TableViewColumn
|
||||
{
|
||||
role: "label"
|
||||
title: catalog.i18nc("@title:column", "Profile settings")
|
||||
delegate: labelDelegate
|
||||
width: (tableView.width * 0.4) | 0
|
||||
}
|
||||
TableViewColumn
|
||||
{
|
||||
role: "original_value"
|
||||
title: Cura.MachineManager.activeQualityDisplayNameMap["main"]
|
||||
width: (tableView.width * 0.3) | 0
|
||||
delegate: defaultDelegate
|
||||
}
|
||||
TableViewColumn
|
||||
{
|
||||
role: "user_value"
|
||||
title: catalog.i18nc("@title:column", "Current changes")
|
||||
width: (tableView.width * 0.3) | 0
|
||||
}
|
||||
section.property: "category"
|
||||
section.delegate: Label
|
||||
{
|
||||
text: section
|
||||
font.bold: true
|
||||
}
|
||||
|
||||
model: userChangesModel
|
||||
sectionRole: "category"
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
id: optionRow
|
||||
anchors.bottom: buttonsRow.top
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
buttonSpacing: UM.Theme.getSize("thin_margin").width
|
||||
|
||||
NewControls.ComboBox
|
||||
leftButtons: [
|
||||
Cura.ComboBox
|
||||
{
|
||||
implicitHeight: UM.Theme.getSize("combobox_wide").height
|
||||
implicitWidth: UM.Theme.getSize("combobox_wide").width
|
||||
|
||||
id: discardOrKeepProfileChangesDropDownButton
|
||||
width: 300
|
||||
textRole: "text"
|
||||
|
||||
model: ListModel
|
||||
@ -182,41 +129,21 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Item
|
||||
{
|
||||
id: buttonsRow
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
anchors.margins: UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height
|
||||
|
||||
Button
|
||||
rightButtons:
|
||||
[
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
id: discardButton
|
||||
text: catalog.i18nc("@action:button", "Discard changes");
|
||||
anchors.right: parent.right
|
||||
onClicked:
|
||||
{
|
||||
CuraApplication.discardOrKeepProfileChangesClosed("discard")
|
||||
base.hide()
|
||||
}
|
||||
isDefault: true
|
||||
}
|
||||
|
||||
Button
|
||||
text: catalog.i18nc("@action:button", "Discard changes")
|
||||
onClicked: base.accept()
|
||||
},
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: keepButton
|
||||
text: catalog.i18nc("@action:button", "Keep changes");
|
||||
anchors.right: discardButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
onClicked:
|
||||
{
|
||||
CuraApplication.discardOrKeepProfileChangesClosed("keep")
|
||||
base.hide()
|
||||
}
|
||||
text: catalog.i18nc("@action:button", "Keep changes")
|
||||
onClicked: base.reject()
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
20
resources/qml/Dialogs/MessageDialog.qml
Normal file
20
resources/qml/Dialogs/MessageDialog.qml
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.5 as Cura
|
||||
|
||||
// Wrapper around the UM.MessageBox with the primary/secondarybuttons
|
||||
// set to Cura.PrimaryButton and Cura.SecondaryButton respectively
|
||||
UM.MessageDialog
|
||||
{
|
||||
primaryButton: Cura.PrimaryButton
|
||||
{
|
||||
text: model.text
|
||||
}
|
||||
|
||||
secondaryButton: Cura.TertiaryButton
|
||||
{
|
||||
text: model.text
|
||||
}
|
||||
}
|
@ -1,15 +1,12 @@
|
||||
// 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.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.3 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.5 as Cura
|
||||
|
||||
UM.Dialog
|
||||
{
|
||||
@ -17,9 +14,9 @@ UM.Dialog
|
||||
id: base
|
||||
|
||||
title: catalog.i18nc("@title:window", "Open file(s)")
|
||||
width: 420 * screenScaleFactor
|
||||
height: 170 * screenScaleFactor
|
||||
|
||||
width: UM.Theme.getSize("small_popup_dialog").width
|
||||
height: UM.Theme.getSize("small_popup_dialog").height
|
||||
maximumHeight: height
|
||||
maximumWidth: width
|
||||
minimumHeight: height
|
||||
@ -29,12 +26,6 @@ UM.Dialog
|
||||
|
||||
property var fileUrls: []
|
||||
property var addToRecent: true
|
||||
property int spacerHeight: 10 * screenScaleFactor
|
||||
|
||||
function loadProjectFile(projectFile)
|
||||
{
|
||||
UM.WorkspaceFileHandler.readLocalFile(projectFile, base.addToRecent);
|
||||
}
|
||||
|
||||
function loadModelFiles(fileUrls)
|
||||
{
|
||||
@ -44,70 +35,29 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
|
||||
Column
|
||||
onAccepted: loadModelFiles(base.fileUrls)
|
||||
|
||||
UM.Label
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 20 * screenScaleFactor
|
||||
anchors.rightMargin: 20 * screenScaleFactor
|
||||
anchors.bottomMargin: 20 * screenScaleFactor
|
||||
text: catalog.i18nc("@text:window", "We have found one or more project file(s) within the files you have selected. You can open only one project file at a time. We suggest to only import models from those files. Would you like to proceed?")
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
spacing: 10 * screenScaleFactor
|
||||
|
||||
Label
|
||||
{
|
||||
text: catalog.i18nc("@text:window", "We have found one or more project file(s) within the files you have selected. You can open only one project file at a time. We suggest to only import models from those files. Would you like to proceed?")
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
font: UM.Theme.getFont("default")
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
Item // Spacer
|
||||
{
|
||||
height: base.spacerHeight
|
||||
width: height
|
||||
}
|
||||
|
||||
// Buttons
|
||||
Item
|
||||
{
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
height: childrenRect.height
|
||||
|
||||
Button
|
||||
{
|
||||
id: cancelButton
|
||||
text: catalog.i18nc("@action:button", "Cancel");
|
||||
anchors.right: importAllAsModelsButton.left
|
||||
onClicked:
|
||||
{
|
||||
// cancel
|
||||
base.hide();
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: importAllAsModelsButton
|
||||
text: catalog.i18nc("@action:button", "Import all as models");
|
||||
anchors.right: parent.right
|
||||
isDefault: true
|
||||
onClicked:
|
||||
{
|
||||
// load models from all selected file
|
||||
loadModelFiles(base.fileUrls);
|
||||
|
||||
base.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UM.I18nCatalog
|
||||
{
|
||||
id: catalog
|
||||
name: "cura"
|
||||
}
|
||||
}
|
||||
|
||||
buttonSpacing: UM.Theme.getSize("thin_margin").width
|
||||
|
||||
// Buttons
|
||||
rightButtons:
|
||||
[
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Cancel");
|
||||
onClicked: base.reject()
|
||||
},
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Import all as models");
|
||||
onClicked: base.accept()
|
||||
}
|
||||
]
|
||||
}
|
@ -1,11 +1,9 @@
|
||||
// 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.10
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.0 as Controls2
|
||||
import QtQuick.Controls 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
@ -15,26 +13,14 @@ UM.Dialog
|
||||
id: base
|
||||
title: catalog.i18nc("@title:window", "Save Project")
|
||||
|
||||
minimumWidth: 500 * screenScaleFactor
|
||||
minimumHeight: 400 * screenScaleFactor
|
||||
minimumWidth: UM.Theme.getSize("popup_dialog").width
|
||||
minimumHeight: UM.Theme.getSize("popup_dialog").height
|
||||
width: minimumWidth
|
||||
height: minimumHeight
|
||||
|
||||
property int spacerHeight: 10 * screenScaleFactor
|
||||
|
||||
property bool dontShowAgain: true
|
||||
|
||||
signal yes();
|
||||
|
||||
function accept() { // pressing enter will call this function
|
||||
close();
|
||||
yes();
|
||||
}
|
||||
|
||||
onClosing:
|
||||
{
|
||||
UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked)
|
||||
}
|
||||
onClosing: UM.Preferences.setValue("cura/dialog_on_project_save", !dontShowAgainCheckbox.checked)
|
||||
|
||||
onVisibleChanged:
|
||||
{
|
||||
@ -59,11 +45,7 @@ UM.Dialog
|
||||
visibilityHandler: UM.SettingPreferenceVisibilityHandler { }
|
||||
}
|
||||
|
||||
SystemPalette
|
||||
{
|
||||
id: palette
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: mainHeading
|
||||
width: parent.width
|
||||
@ -79,16 +61,28 @@ UM.Dialog
|
||||
{
|
||||
top: mainHeading.bottom
|
||||
topMargin: UM.Theme.getSize("default_margin").height
|
||||
bottom: controls.top
|
||||
bottom: parent.bottom
|
||||
bottomMargin: UM.Theme.getSize("default_margin").height
|
||||
}
|
||||
style: UM.Theme.styles.scrollview
|
||||
|
||||
ScrollBar.vertical: UM.ScrollBar
|
||||
{
|
||||
parent: scroll
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
clip: true
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
Column
|
||||
{
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: settingsHeading
|
||||
text: catalog.i18nc("@action:label", "Printer settings")
|
||||
@ -98,14 +92,14 @@ UM.Dialog
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Type")
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: (Cura.MachineManager.activeMachine == null) ? "" : Cura.MachineManager.activeMachine.definition.name
|
||||
text: Cura.MachineManager.activeMachine == null ? "" : Cura.MachineManager.activeMachine.definition.name
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
}
|
||||
}
|
||||
@ -113,12 +107,12 @@ UM.Dialog
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name")
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text:
|
||||
{
|
||||
@ -157,7 +151,7 @@ UM.Dialog
|
||||
var material_name = extruder.material.name
|
||||
return (material_name !== undefined) ? material_name : ""
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: {
|
||||
var extruder = Number(modelData.position)
|
||||
@ -181,7 +175,7 @@ UM.Dialog
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text:
|
||||
{
|
||||
@ -194,7 +188,7 @@ UM.Dialog
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
enabled: modelData.isEnabled
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text:
|
||||
{
|
||||
@ -214,7 +208,7 @@ UM.Dialog
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Profile settings")
|
||||
font.bold: true
|
||||
@ -222,12 +216,12 @@ UM.Dialog
|
||||
Row
|
||||
{
|
||||
width: parent.width
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Not in profile")
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18ncp("@action:label", "%1 override", "%1 overrides", Cura.MachineManager.numUserSettings).arg(Cura.MachineManager.numUserSettings)
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
@ -238,12 +232,12 @@ UM.Dialog
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Name")
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: Cura.MachineManager.activeQualityOrQualityChangesName
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
@ -255,12 +249,12 @@ UM.Dialog
|
||||
{
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@action:label", "Intent")
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: Cura.MachineManager.activeIntentCategory
|
||||
width: Math.floor(scroll.width / 3) | 0
|
||||
@ -269,43 +263,31 @@ UM.Dialog
|
||||
}
|
||||
}
|
||||
}
|
||||
Item
|
||||
{
|
||||
id: controls
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
anchors.bottom: parent.bottom
|
||||
UM.CheckBox
|
||||
{
|
||||
id: dontShowAgainCheckbox
|
||||
anchors.left: parent.left
|
||||
text: catalog.i18nc("@action:label", "Don't show project summary on save again")
|
||||
checked: dontShowAgain
|
||||
}
|
||||
Controls2.Button
|
||||
{
|
||||
id: cancel_button
|
||||
anchors
|
||||
{
|
||||
right: ok_button.left
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
text: catalog.i18nc("@action:button","Cancel");
|
||||
enabled: true
|
||||
onClicked: close()
|
||||
}
|
||||
Controls2.Button
|
||||
{
|
||||
id: ok_button
|
||||
anchors.right: parent.right
|
||||
text: catalog.i18nc("@action:button","Save");
|
||||
enabled: true
|
||||
onClicked:
|
||||
{
|
||||
close()
|
||||
yes()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buttonSpacing: UM.Theme.getSize("thin_margin").width
|
||||
|
||||
leftButtons:
|
||||
[
|
||||
UM.CheckBox
|
||||
{
|
||||
id: dontShowAgainCheckbox
|
||||
text: catalog.i18nc("@action:label", "Don't show project summary on save again")
|
||||
checked: dontShowAgain
|
||||
}
|
||||
]
|
||||
|
||||
rightButtons:
|
||||
[
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Cancel")
|
||||
onClicked: base.reject()
|
||||
},
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Save")
|
||||
onClicked: base.accept()
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
// The expandable component has 2 major sub components:
|
||||
@ -30,8 +30,8 @@ Item
|
||||
property color contentBackgroundColor: UM.Theme.getColor("action_button")
|
||||
|
||||
property color headerBackgroundColor: UM.Theme.getColor("action_button")
|
||||
property color headerActiveColor: UM.Theme.getColor("secondary")
|
||||
property color headerHoverColor: UM.Theme.getColor("action_button_hovered")
|
||||
property color headerActiveColor: UM.Theme.getColor("expandable_active")
|
||||
property color headerHoverColor: UM.Theme.getColor("expandable_hover")
|
||||
|
||||
property alias enabled: mouseArea.enabled
|
||||
|
||||
@ -126,7 +126,7 @@ Item
|
||||
color: base.enabled ? (base.expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled")
|
||||
anchors.fill: parent
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: disabledLabel
|
||||
visible: !base.enabled
|
||||
@ -134,10 +134,6 @@ Item
|
||||
leftPadding: background.padding
|
||||
rightPadding: background.padding
|
||||
text: ""
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: UM.Theme.getColor("text")
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
// Header of the popup
|
||||
@ -16,20 +16,17 @@ Cura.RoundedRectangle
|
||||
property alias xPosCloseButton: closeButton.left
|
||||
|
||||
height: UM.Theme.getSize("expandable_component_content_header").height
|
||||
color: UM.Theme.getColor("secondary")
|
||||
color: UM.Theme.getColor("background_1")
|
||||
cornerSide: Cura.RoundedRectangle.Direction.Up
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: headerLabel
|
||||
text: ""
|
||||
font: UM.Theme.getFont("medium")
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: UM.Theme.getColor("small_button_text")
|
||||
height: parent.height
|
||||
|
||||
anchors
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
// The expandable component has 2 major sub components:
|
||||
@ -30,8 +30,8 @@ Item
|
||||
property color contentBackgroundColor: UM.Theme.getColor("action_button")
|
||||
|
||||
property color headerBackgroundColor: UM.Theme.getColor("action_button")
|
||||
property color headerActiveColor: UM.Theme.getColor("secondary")
|
||||
property color headerHoverColor: UM.Theme.getColor("action_button_hovered")
|
||||
property color headerActiveColor: UM.Theme.getColor("expandable_active")
|
||||
property color headerHoverColor: UM.Theme.getColor("expandable_hover")
|
||||
|
||||
property alias mouseArea: headerMouseArea
|
||||
property alias enabled: headerMouseArea.enabled
|
||||
@ -120,16 +120,12 @@ Item
|
||||
color: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled")
|
||||
anchors.fill: parent
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: disabledLabel
|
||||
visible: !base.enabled
|
||||
leftPadding: background.padding
|
||||
text: ""
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: UM.Theme.getColor("text")
|
||||
height: parent.height
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,7 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.11
|
||||
import QtQuick.Controls 1.1
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
Item
|
||||
{
|
||||
@ -43,18 +42,15 @@ Item
|
||||
color: extruderNumberText.color
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: extruderNumberText
|
||||
anchors.centerIn: parent
|
||||
text: index + 1
|
||||
font: UM.Theme.getFont("small_emphasis")
|
||||
color: UM.Theme.getColor("text")
|
||||
width: contentWidth
|
||||
height: contentHeight
|
||||
renderType: Text.NativeRendering
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
// Reusable component that holds an (re-colorable) icon on the left with some text on the right.
|
||||
@ -49,15 +49,10 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: label
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
anchors
|
||||
{
|
||||
left: icon.right
|
||||
|
@ -1,12 +1,11 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
@ -29,7 +28,8 @@ Item
|
||||
{
|
||||
if (!activity)
|
||||
{
|
||||
//When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't set an empty string as a jobName (which is later used for saving the file)
|
||||
// When there is no mesh in the buildplate; the printJobTextField is set to an empty string so it doesn't
|
||||
// set an empty string as a jobName (which is later used for saving the file)
|
||||
PrintInformation.baseName = ""
|
||||
}
|
||||
}
|
||||
@ -41,35 +41,21 @@ Item
|
||||
anchors.left: parent.left
|
||||
height: UM.Theme.getSize("jobspecs_line").height
|
||||
|
||||
Button
|
||||
UM.SimpleButton
|
||||
{
|
||||
id: printJobPencilIcon
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: UM.Theme.getSize("save_button_specs_icons").width
|
||||
height: UM.Theme.getSize("save_button_specs_icons").height
|
||||
|
||||
iconSource: UM.Theme.getIcon("Pen")
|
||||
hoverColor: UM.Theme.getColor("small_button_text_hover")
|
||||
color: UM.Theme.getColor("small_button_text")
|
||||
onClicked:
|
||||
{
|
||||
printJobTextfield.selectAll()
|
||||
printJobTextfield.focus = true
|
||||
}
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Item
|
||||
{
|
||||
UM.RecolorImage
|
||||
{
|
||||
width: UM.Theme.getSize("save_button_specs_icons").width
|
||||
height: UM.Theme.getSize("save_button_specs_icons").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: control.hovered ? UM.Theme.getColor("small_button_text_hover") : UM.Theme.getColor("small_button_text")
|
||||
source: UM.Theme.getIcon("Pen")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextField
|
||||
@ -78,9 +64,9 @@ Item
|
||||
anchors.left: printJobPencilIcon.right
|
||||
anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
|
||||
height: UM.Theme.getSize("jobspecs_line").height
|
||||
width: Math.max(__contentWidth + UM.Theme.getSize("default_margin").width, 50)
|
||||
width: Math.max(contentWidth + UM.Theme.getSize("default_margin").width, 50)
|
||||
maximumLength: 120
|
||||
text: (PrintInformation === null) ? "" : PrintInformation.jobName
|
||||
text: PrintInformation === null ? "" : PrintInformation.jobName
|
||||
horizontalAlignment: TextInput.AlignLeft
|
||||
|
||||
property string textBeforeEdit: ""
|
||||
@ -105,29 +91,20 @@ Item
|
||||
validator: RegExpValidator {
|
||||
regExp: /^[^\\\/\*\?\|\[\]]*$/
|
||||
}
|
||||
|
||||
style: TextFieldStyle
|
||||
{
|
||||
textColor: UM.Theme.getColor("text_scene")
|
||||
font: UM.Theme.getFont("default")
|
||||
background: Rectangle
|
||||
{
|
||||
opacity: 0
|
||||
border.width: 0
|
||||
}
|
||||
}
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_scene")
|
||||
background: Item {}
|
||||
selectByMouse: true
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: boundingSpec
|
||||
anchors.top: jobNameRow.bottom
|
||||
anchors.left: parent.left
|
||||
|
||||
height: UM.Theme.getSize("jobspecs_line").height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_scene")
|
||||
text: CuraApplication.getSceneBoundingBoxString
|
||||
}
|
||||
@ -141,10 +118,7 @@ Item
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
Component.onCompleted:
|
||||
{
|
||||
base.addAdditionalComponents("jobSpecsButton")
|
||||
}
|
||||
Component.onCompleted: base.addAdditionalComponents("jobSpecsButton")
|
||||
|
||||
Connections
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
// The labelBar shows a set of labels that are evenly spaced from one another.
|
||||
// The first item is aligned to the left, the last is aligned to the right.
|
||||
@ -34,13 +34,10 @@ Item
|
||||
Layout.maximumWidth: Math.round(index + 1 === repeater.count || repeater.count <= 1 ? itemSize : base.width / (repeater.count - 1))
|
||||
height: label.height
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: label
|
||||
text: model[modelKey]
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("default")
|
||||
renderType: Text.NativeRendering
|
||||
height: contentHeight
|
||||
anchors
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Copyright (c) 2020 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ UM.TooltipArea
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
ScrollView
|
||||
Flickable
|
||||
{
|
||||
anchors.top: titleLabel.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
@ -53,26 +53,9 @@ UM.TooltipArea
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
color: UM.Theme.getColor("main_background")
|
||||
anchors.fill: parent
|
||||
ScrollBar.vertical: UM.ScrollBar {}
|
||||
|
||||
border.color:
|
||||
{
|
||||
if (!gcodeTextArea.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled_border")
|
||||
}
|
||||
if (gcodeTextArea.hovered || gcodeTextArea.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_border_highlight")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control_border")
|
||||
}
|
||||
}
|
||||
|
||||
TextArea
|
||||
TextArea.flickable: TextArea
|
||||
{
|
||||
id: gcodeTextArea
|
||||
|
||||
@ -92,6 +75,27 @@ UM.TooltipArea
|
||||
propertyProvider.setPropertyValue("value", text)
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
color: UM.Theme.getColor("main_background")
|
||||
anchors.fill: parent
|
||||
anchors.margins: -border.width //Wrap the border around the parent.
|
||||
|
||||
border.color:
|
||||
{
|
||||
if (!gcodeTextArea.enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled_border")
|
||||
}
|
||||
if (gcodeTextArea.hovered || gcodeTextArea.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_border_highlight")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control_border")
|
||||
}
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
@ -83,13 +83,12 @@ UM.TooltipArea
|
||||
height: numericTextFieldWithUnit.controlHeight
|
||||
|
||||
// Background is a rounded-cornered box with filled color as state indication (normal, warning, error, etc.)
|
||||
background: Rectangle
|
||||
background: UM.UnderlineBackground
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.margins: Math.round(UM.Theme.getSize("default_lining").width)
|
||||
radius: UM.Theme.getSize("setting_control_radius").width
|
||||
|
||||
border.color:
|
||||
liningColor:
|
||||
{
|
||||
if (!textFieldWithUnit.enabled)
|
||||
{
|
||||
@ -108,9 +107,9 @@ UM.TooltipArea
|
||||
// Validation is OK.
|
||||
if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_border_highlight")
|
||||
return UM.Theme.getColor("border_main_light")
|
||||
}
|
||||
return UM.Theme.getColor("setting_control_border")
|
||||
return UM.Theme.getColor("border_field_light")
|
||||
}
|
||||
|
||||
color:
|
||||
@ -222,7 +221,7 @@ UM.TooltipArea
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: unitLabel
|
||||
anchors.right: parent.right
|
||||
@ -230,10 +229,7 @@ UM.TooltipArea
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: unitText
|
||||
textFormat: Text.PlainText
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
renderType: Text.NativeRendering
|
||||
color: UM.Theme.getColor("setting_unit")
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +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.7
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
import "../Menus"
|
||||
@ -16,38 +13,42 @@ import "../Dialogs"
|
||||
Item
|
||||
{
|
||||
id: menu
|
||||
width: applicationMenu.width
|
||||
width: parent.width
|
||||
height: applicationMenu.height
|
||||
property alias window: applicationMenu.window
|
||||
|
||||
UM.ApplicationMenu
|
||||
MenuBar
|
||||
{
|
||||
id: applicationMenu
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("context_menu").height
|
||||
|
||||
FileMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&File") }
|
||||
|
||||
Menu
|
||||
{
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit")
|
||||
|
||||
MenuItem { action: Cura.Actions.undo }
|
||||
MenuItem { action: Cura.Actions.redo }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: Cura.Actions.selectAll }
|
||||
MenuItem { action: Cura.Actions.arrangeAll }
|
||||
MenuItem { action: Cura.Actions.multiplySelection }
|
||||
MenuItem { action: Cura.Actions.deleteSelection }
|
||||
MenuItem { action: Cura.Actions.deleteAll }
|
||||
MenuItem { action: Cura.Actions.resetAllTranslation }
|
||||
MenuItem { action: Cura.Actions.resetAll }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: Cura.Actions.groupObjects }
|
||||
MenuItem { action: Cura.Actions.mergeObjects }
|
||||
MenuItem { action: Cura.Actions.unGroupObjects }
|
||||
background: Rectangle {
|
||||
color: UM.Theme.getColor("background_1")
|
||||
}
|
||||
|
||||
ViewMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&View") }
|
||||
delegate: MenuBarItem
|
||||
{
|
||||
id: menuBarItem
|
||||
|
||||
contentItem: UM.Label
|
||||
{
|
||||
text: menuBarItem.text.replace(new RegExp("&([A-Za-z])"), function (match, character)
|
||||
{
|
||||
return `<u>${character}</u>`;
|
||||
})
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
color: menuBarItem.highlighted ? UM.Theme.getColor("background_2") : "transparent"
|
||||
}
|
||||
}
|
||||
|
||||
FileMenu {}
|
||||
EditMenu {}
|
||||
ViewMenu {}
|
||||
SettingsMenu
|
||||
{
|
||||
//On MacOS, don't translate the "Settings" word.
|
||||
@ -59,93 +60,11 @@ Item
|
||||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings")
|
||||
}
|
||||
|
||||
Menu
|
||||
{
|
||||
id: extensionMenu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions")
|
||||
|
||||
Instantiator
|
||||
{
|
||||
id: extensions
|
||||
model: UM.ExtensionModel { }
|
||||
|
||||
Menu
|
||||
{
|
||||
id: sub_menu
|
||||
title: model.name;
|
||||
visible: actions != null
|
||||
enabled: actions != null
|
||||
Instantiator
|
||||
{
|
||||
model: actions
|
||||
Loader
|
||||
{
|
||||
property var extensionsModel: extensions.model
|
||||
property var modelText: model.text
|
||||
property var extensionName: name
|
||||
|
||||
sourceComponent: modelText.trim() == "" ? extensionsMenuSeparator : extensionsMenuItem
|
||||
}
|
||||
|
||||
onObjectAdded: sub_menu.insertItem(index, object.item)
|
||||
onObjectRemoved: sub_menu.removeItem(object.item)
|
||||
}
|
||||
}
|
||||
|
||||
onObjectAdded: extensionMenu.insertItem(index, object)
|
||||
onObjectRemoved: extensionMenu.removeItem(object)
|
||||
}
|
||||
}
|
||||
|
||||
Menu
|
||||
{
|
||||
id: preferencesMenu
|
||||
|
||||
//On MacOS, don't translate the "Preferences" word.
|
||||
//Qt moves the "preferences" entry to a different place, and if it got renamed can't find it again when it
|
||||
//attempts to delete the item upon closing the application, causing a crash.
|
||||
//In the new location, these items are translated automatically according to the system's language.
|
||||
//For more information, see:
|
||||
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
|
||||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references")
|
||||
|
||||
MenuItem { action: Cura.Actions.preferences }
|
||||
}
|
||||
|
||||
Menu
|
||||
{
|
||||
id: helpMenu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&Help")
|
||||
|
||||
MenuItem { action: Cura.Actions.showProfileFolder }
|
||||
MenuItem { action: Cura.Actions.showTroubleshooting}
|
||||
MenuItem { action: Cura.Actions.documentation }
|
||||
MenuItem { action: Cura.Actions.reportBug }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: Cura.Actions.whatsNew }
|
||||
MenuItem { action: Cura.Actions.about }
|
||||
}
|
||||
ExtensionMenu { id: extensionMenu }
|
||||
PreferencesMenu {}
|
||||
HelpMenu {}
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: extensionsMenuItem
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: modelText
|
||||
onTriggered: extensionsModel.subMenuTriggered(extensionName, modelText)
|
||||
}
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: extensionsMenuSeparator
|
||||
|
||||
MenuSeparator {}
|
||||
}
|
||||
|
||||
|
||||
// ###############################################################################################
|
||||
@ -156,18 +75,17 @@ Item
|
||||
{
|
||||
id: saveWorkspaceDialog
|
||||
property var args
|
||||
onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args)
|
||||
onAccepted: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args)
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
Cura.MessageDialog
|
||||
{
|
||||
id: newProjectDialog
|
||||
modality: Qt.ApplicationModal
|
||||
|
||||
title: catalog.i18nc("@title:window", "New project")
|
||||
text: catalog.i18nc("@info:question", "Are you sure you want to start a new project? This will clear the build plate and any unsaved settings.")
|
||||
standardButtons: StandardButton.Yes | StandardButton.No
|
||||
icon: StandardIcon.Question
|
||||
onYes:
|
||||
standardButtons: Dialog.Yes | Dialog.No
|
||||
onAccepted:
|
||||
{
|
||||
CuraApplication.resetWorkspace()
|
||||
Cura.Actions.resetProfile.trigger()
|
||||
@ -175,11 +93,6 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
UM.ExtensionModel
|
||||
{
|
||||
id: curaExtensions
|
||||
}
|
||||
|
||||
// ###############################################################################################
|
||||
// Definition of all the connections
|
||||
// ###############################################################################################
|
||||
@ -196,13 +109,13 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
// show the Marketplace
|
||||
// show the Toolbox
|
||||
Connections
|
||||
{
|
||||
target: Cura.Actions.openMarketplace
|
||||
target: Cura.Actions.browsePackages
|
||||
function onTriggered()
|
||||
{
|
||||
curaExtensions.callExtensionMethod("Marketplace", "show")
|
||||
extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show")
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,8 +125,8 @@ Item
|
||||
target: Cura.Actions.marketplaceMaterials
|
||||
function onTriggered()
|
||||
{
|
||||
curaExtensions.callExtensionMethod("Marketplace", "show")
|
||||
curaExtensions.callExtensionMethod("Marketplace", "setVisibleTabToMaterials")
|
||||
extensionMenu.extensionModel.callExtensionMethod("Marketplace", "show")
|
||||
extensionMenu.extensionModel.callExtensionMethod("Marketplace", "setVisibleTabToMaterials")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,10 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2021 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0 as Controls2
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.4 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
import "../Account"
|
||||
@ -33,6 +31,10 @@ Item
|
||||
sourceSize.width: width
|
||||
sourceSize.height: height
|
||||
}
|
||||
ButtonGroup
|
||||
{
|
||||
buttons: stagesListContainer.children
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
@ -61,15 +63,60 @@ Item
|
||||
checked: UM.Controller.activeStage !== null && model.id == UM.Controller.activeStage.stageId
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
exclusiveGroup: mainWindowHeaderMenuGroup
|
||||
style: UM.Theme.styles.main_window_header_tab
|
||||
//style: UM.Theme.styles.main_window_header_tab
|
||||
height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
|
||||
iconSource: model.stage.iconSource
|
||||
|
||||
property color overlayColor: "transparent"
|
||||
property string overlayIconSource: ""
|
||||
// This id is required to find the stage buttons through Squish
|
||||
property string stageId: model.id
|
||||
hoverEnabled: true
|
||||
leftPadding: 2 * UM.Theme.getSize("default_margin").width
|
||||
rightPadding: 2 * UM.Theme.getSize("default_margin").width
|
||||
|
||||
// Set top & bottom padding to whatever space is left from height and the size of the text.
|
||||
bottomPadding: Math.round((height - buttonLabel.contentHeight) / 2)
|
||||
topPadding: bottomPadding
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
radius: UM.Theme.getSize("action_button_radius").width
|
||||
color:
|
||||
{
|
||||
if (stageSelectorButton.checked)
|
||||
{
|
||||
return UM.Theme.getColor("main_window_header_button_background_active")
|
||||
}
|
||||
else
|
||||
{
|
||||
if (stageSelectorButton.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("main_window_header_button_background_hovered")
|
||||
}
|
||||
return UM.Theme.getColor("main_window_header_button_background_inactive")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: UM.Label
|
||||
{
|
||||
id: buttonLabel
|
||||
text: stageSelectorButton.text
|
||||
anchors.centerIn: stageSelectorButton
|
||||
font: UM.Theme.getFont("medium")
|
||||
color:
|
||||
{
|
||||
if (stageSelectorButton.checked)
|
||||
{
|
||||
return UM.Theme.getColor("main_window_header_button_text_active")
|
||||
}
|
||||
else
|
||||
{
|
||||
if (stageSelectorButton.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("main_window_header_button_text_hovered")
|
||||
}
|
||||
return UM.Theme.getColor("main_window_header_button_text_inactive")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This is a trick to assure the activeStage is correctly changed. It doesn't work properly if done in the onClicked (see CURA-6028)
|
||||
MouseArea
|
||||
@ -79,35 +126,21 @@ Item
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: mainWindowHeaderMenuGroup }
|
||||
}
|
||||
|
||||
Controls2.Button
|
||||
// Shortcut button to quick access the Toolbox
|
||||
Button
|
||||
{
|
||||
id: marketplaceButton
|
||||
text: catalog.i18nc("@action:button", "Marketplace")
|
||||
height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
|
||||
anchors
|
||||
{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: applicationSwitcher.left
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
onClicked: Cura.Actions.browsePackages.trigger()
|
||||
|
||||
hoverEnabled: true
|
||||
onClicked: Cura.Actions.openMarketplace.trigger()
|
||||
|
||||
contentItem: Label
|
||||
{
|
||||
text: "Marketplace" //Ultimaker considers this a product name, so it shouldn't be translated.
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("primary_text")
|
||||
width: contentWidth
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
{
|
||||
id: marketplaceButtonBorder
|
||||
radius: UM.Theme.getSize("action_button_radius").width
|
||||
color: UM.Theme.getColor("main_window_header_background")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
@ -115,6 +148,7 @@ Item
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: marketplaceButtonFill
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: UM.Theme.getColor("primary_text")
|
||||
@ -123,12 +157,30 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: UM.Label
|
||||
{
|
||||
id: label
|
||||
text: marketplaceButton.text
|
||||
color: UM.Theme.getColor("primary_text")
|
||||
width: contentWidth
|
||||
}
|
||||
|
||||
anchors
|
||||
{
|
||||
right: applicationSwitcher.left
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Cura.NotificationIcon
|
||||
{
|
||||
id: marketplaceNotificationIcon
|
||||
anchors
|
||||
{
|
||||
horizontalCenter: parent.right
|
||||
verticalCenter: parent.top
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
rightMargin: (-0.5 * width) | 0
|
||||
topMargin: (-0.5 * height) | 0
|
||||
}
|
||||
visible: CuraApplication.getPackageManager().packagesWithUpdate.length > 0
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Button
|
||||
@ -99,7 +99,7 @@ Button
|
||||
height: width
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: unknownMaterialMessage
|
||||
text:
|
||||
@ -147,10 +147,6 @@ Button
|
||||
anchors.top: unknownMaterial.top
|
||||
|
||||
wrapMode: Text.WordWrap
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
linkColor: UM.Theme.getColor("text_link")
|
||||
|
||||
onLinkActivated:
|
||||
{
|
||||
|
@ -1,10 +1,10 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.4 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
@ -67,18 +67,14 @@ Item
|
||||
contentHeight: configurationList.height
|
||||
clip: true
|
||||
|
||||
ScrollBar.vertical.policy: (configurationList.height > maximumHeight) ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff //The AsNeeded policy also hides it when the cursor is away, and we don't want that.
|
||||
ScrollBar.vertical.background: Rectangle
|
||||
{
|
||||
implicitWidth: UM.Theme.getSize("scrollbar").width
|
||||
radius: width / 2
|
||||
color: UM.Theme.getColor("scrollbar_background")
|
||||
}
|
||||
ScrollBar.vertical.contentItem: Rectangle
|
||||
{
|
||||
implicitWidth: UM.Theme.getSize("scrollbar").width
|
||||
radius: width / 2
|
||||
color: UM.Theme.getColor(parent.pressed ? "scrollbar_handle_down" : parent.hovered ? "scrollbar_handle_hover" : "scrollbar_handle")
|
||||
ScrollBar.vertical: UM.ScrollBar {
|
||||
parent: container
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
}
|
||||
|
||||
ButtonGroup
|
||||
|
@ -3,10 +3,9 @@
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import UM 1.4 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
||||
@ -19,7 +18,7 @@ Cura.ExpandablePopup
|
||||
id: base
|
||||
|
||||
property var extrudersModel: CuraApplication.getExtrudersModel()
|
||||
|
||||
property var activeMachine: Cura.MachineManager.activeMachine
|
||||
UM.I18nCatalog
|
||||
{
|
||||
id: catalog
|
||||
@ -33,7 +32,7 @@ Cura.ExpandablePopup
|
||||
}
|
||||
|
||||
contentPadding: UM.Theme.getSize("default_lining").width
|
||||
enabled: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials || Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates : false; //Only let it drop down if there is any configuration that you could change.
|
||||
enabled: activeMachine ? activeMachine.hasMaterials || activeMachine.hasVariants || activeMachine.hasVariantBuildplates : false; //Only let it drop down if there is any configuration that you could change.
|
||||
|
||||
headerItem: Item
|
||||
{
|
||||
@ -44,7 +43,7 @@ Cura.ExpandablePopup
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
width: parent.width - UM.Theme.getSize("standard_arrow").width
|
||||
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials : false
|
||||
visible: activeMachine ? activeMachine.hasMaterials : false
|
||||
Repeater
|
||||
{
|
||||
model: extrudersModel
|
||||
@ -56,9 +55,9 @@ Cura.ExpandablePopup
|
||||
Layout.maximumWidth: Math.round(parent.width / extrudersModel.count)
|
||||
Layout.fillHeight: true
|
||||
|
||||
property var extruderStack: Cura.MachineManager.activeMachine.extruders[model.index]
|
||||
property var extruderStack: activeMachine ? activeMachine.extruders[model.index]: null
|
||||
property bool valueWarning: !Cura.ExtruderManager.getExtruderHasQualityForMaterial(extruderStack)
|
||||
property bool valueError: Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True"
|
||||
property bool valueError: activeMachine ? Cura.ContainerManager.getContainerMetaDataEntry(extruderStack.material.id, "compatible", "") != "True" : false
|
||||
|
||||
// Extruder icon. Shows extruder index and has the same color as the active material.
|
||||
Cura.ExtruderIcon
|
||||
@ -190,56 +189,49 @@ Cura.ExpandablePopup
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
// Label for the brand of the material
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: materialBrandNameLabel
|
||||
|
||||
text: model.material_brand + " " + model.material_name
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
wrapMode: Text.NoWrap
|
||||
width: parent.width
|
||||
visible: !truncated
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: materialNameLabel
|
||||
|
||||
text: model.material_name
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
width: parent.width
|
||||
wrapMode: Text.NoWrap
|
||||
visible: !materialBrandNameLabel.visible && !truncated
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: materialTypeLabel
|
||||
|
||||
text: model.material_type
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
width: parent.width
|
||||
wrapMode: Text.NoWrap
|
||||
visible: !materialBrandNameLabel.visible && !materialNameLabel.visible
|
||||
}
|
||||
// Label that shows the name of the variant
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: variantLabel
|
||||
|
||||
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasVariants : false
|
||||
visible: activeMachine ? activeMachine.hasVariants : false
|
||||
|
||||
text: model.variant
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
Layout.preferredWidth: parent.width
|
||||
}
|
||||
}
|
||||
@ -248,15 +240,13 @@ Cura.ExpandablePopup
|
||||
}
|
||||
|
||||
// Placeholder text if there is a configuration to select but no materials (so we can't show the materials per extruder).
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Select configuration")
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("text")
|
||||
renderType: Text.NativeRendering
|
||||
|
||||
visible: Cura.MachineManager.activeMachine ? !Cura.MachineManager.activeMachine.hasMaterials && (Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasVariantBuildplates) : false
|
||||
visible: activeMachine ? !activeMachine.hasMaterials && (activeMachine.hasVariants || activeMachine.hasVariantBuildplates) : false
|
||||
|
||||
anchors
|
||||
{
|
||||
@ -281,7 +271,7 @@ Cura.ExpandablePopup
|
||||
|
||||
onVisibleChanged:
|
||||
{
|
||||
is_connected = Cura.MachineManager.activeMachine.hasRemoteConnection && Cura.MachineManager.printerConnected && Cura.MachineManager.printerOutputDevices[0].uniqueConfigurations.length > 0 //Re-evaluate.
|
||||
is_connected = activeMachine.hasRemoteConnection && Cura.MachineManager.printerConnected && Cura.MachineManager.printerOutputDevices[0].uniqueConfigurations.length > 0 //Re-evaluate.
|
||||
|
||||
// If the printer is not connected or does not have configurations, we switch always to the custom mode. If is connected instead, the auto mode
|
||||
// or the previous state is selected
|
||||
|
@ -1,12 +1,14 @@
|
||||
// Copyright (c) 2019 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
//Copyright (c) 2022 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.6
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Controls 1.1 as OldControls
|
||||
|
||||
import Cura 1.0 as Cura
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
|
||||
// Simple button for displaying text and changes appearance for various states: enabled, valueError, valueWarning
|
||||
// - and hovered. Mainly used in CustomConfiguration.qml
|
||||
|
||||
Item
|
||||
{
|
||||
@ -19,14 +21,13 @@ Item
|
||||
width: parent.width
|
||||
height: childrenRect.height
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: header
|
||||
text: catalog.i18nc("@header", "Custom")
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("small_button_text")
|
||||
height: contentHeight
|
||||
renderType: Text.NativeRendering
|
||||
|
||||
anchors
|
||||
{
|
||||
@ -36,7 +37,7 @@ Item
|
||||
}
|
||||
}
|
||||
|
||||
//Printer type selector.
|
||||
// Printer type selector.
|
||||
Item
|
||||
{
|
||||
id: printerTypeSelectorRow
|
||||
@ -56,28 +57,27 @@ Item
|
||||
topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Printer")
|
||||
width: Math.round(parent.width * 0.3) - UM.Theme.getSize("default_margin").width
|
||||
height: contentHeight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
anchors.verticalCenter: printerTypeSelector.verticalCenter
|
||||
anchors.left: parent.left
|
||||
}
|
||||
|
||||
OldControls.ToolButton
|
||||
Button
|
||||
{
|
||||
id: printerTypeSelector
|
||||
text: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.definition.name: ""
|
||||
tooltip: text
|
||||
|
||||
height: UM.Theme.getSize("print_setup_big_item").height
|
||||
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width
|
||||
anchors.right: parent.right
|
||||
style: UM.Theme.styles.print_setup_header_button
|
||||
onClicked: menu.open()
|
||||
//style: UM.Theme.styles.print_setup_header_button
|
||||
|
||||
menu: Cura.PrinterTypeMenu { }
|
||||
Cura.PrinterTypeMenu { id: menu}
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,6 +94,7 @@ Item
|
||||
model: extrudersModel
|
||||
delegate: UM.TabRowButton
|
||||
{
|
||||
checked: model.index == 0
|
||||
contentItem: Item
|
||||
{
|
||||
Cura.ExtruderIcon
|
||||
@ -208,23 +209,18 @@ Item
|
||||
height: visible ? UM.Theme.getSize("setting_control").height : 0
|
||||
visible: extrudersModel.count > 1 // If there is only one extruder, there is no point to enable/disable that.
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Enabled")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
height: parent.height
|
||||
width: selectors.textWidth
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
OldControls.CheckBox
|
||||
UM.CheckBox
|
||||
{
|
||||
id: enabledCheckbox
|
||||
enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder.
|
||||
height: parent.height
|
||||
style: UM.Theme.styles.checkbox
|
||||
|
||||
Binding
|
||||
{
|
||||
@ -262,18 +258,14 @@ Item
|
||||
height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0
|
||||
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasMaterials : false
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Material")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
height: parent.height
|
||||
width: selectors.textWidth
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
OldControls.ToolButton
|
||||
Cura.PrintSetupHeaderButton
|
||||
{
|
||||
id: materialSelection
|
||||
|
||||
@ -286,20 +278,19 @@ Item
|
||||
|
||||
width: selectors.controlWidth
|
||||
height: parent.height
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
focusPolicy: Qt.ClickFocus
|
||||
|
||||
style: UM.Theme.styles.print_setup_header_button
|
||||
activeFocusOnPress: true
|
||||
Cura.MaterialMenu
|
||||
{
|
||||
id: materialsMenu
|
||||
extruderIndex: Cura.ExtruderManager.activeExtruderIndex
|
||||
updateModels: materialSelection.visible
|
||||
}
|
||||
onClicked:
|
||||
{
|
||||
materialsMenu.popup();
|
||||
}
|
||||
onClicked: materialsMenu.popup()
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
width: instructionButton.width + 2 * UM.Theme.getSize("narrow_margin").width
|
||||
@ -328,26 +319,22 @@ Item
|
||||
height: visible ? UM.Theme.getSize("print_setup_big_item").height : 0
|
||||
visible: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.hasVariants : false
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: Cura.MachineManager.activeDefinitionVariantsName
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
height: parent.height
|
||||
width: selectors.textWidth
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
OldControls.ToolButton
|
||||
Cura.PrintSetupHeaderButton
|
||||
{
|
||||
id: variantSelection
|
||||
text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.variant.name : ""
|
||||
tooltip: text
|
||||
height: parent.height
|
||||
width: selectors.controlWidth
|
||||
style: UM.Theme.styles.print_setup_header_button
|
||||
activeFocusOnPress: true
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
focusPolicy: Qt.ClickFocus
|
||||
enabled: enabledCheckbox.checked
|
||||
|
||||
Cura.NozzleMenu
|
||||
@ -355,10 +342,7 @@ Item
|
||||
id: nozzlesMenu
|
||||
extruderIndex: Cura.ExtruderManager.activeExtruderIndex
|
||||
}
|
||||
onClicked:
|
||||
{
|
||||
nozzlesMenu.popup();
|
||||
}
|
||||
onClicked: nozzlesMenu.popup()
|
||||
}
|
||||
}
|
||||
|
||||
@ -372,11 +356,10 @@ Item
|
||||
property bool buildplateCompatibilityWarning: Cura.MachineManager.variantBuildplateUsable
|
||||
|
||||
// This is a space holder aligning the warning messages.
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: ""
|
||||
width: selectors.textWidth
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
Item
|
||||
@ -397,19 +380,15 @@ Item
|
||||
visible: !Cura.MachineManager.isCurrentSetupSupported || warnings.buildplateCompatibilityError || warnings.buildplateCompatibilityWarning
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
id: materialCompatibilityLabel
|
||||
anchors.left: warningImage.right
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
width: selectors.controlWidth - warningImage.width - UM.Theme.getSize("default_margin").width
|
||||
text: catalog.i18nc("@label", "Use glue for better adhesion with this material combination.")
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text")
|
||||
visible: CuraSDKVersion == "dev" ? false : warnings.buildplateCompatibilityError || warnings.buildplateCompatibilityWarning
|
||||
wrapMode: Text.WordWrap
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
@ -33,30 +33,24 @@ Item
|
||||
margins: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: (printCoreConfiguration !== null && printCoreConfiguration.material.brand) ? printCoreConfiguration.material.brand : " " //Use space so that the height is still correct.
|
||||
renderType: Text.NativeRendering
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_inactive")
|
||||
width: parent.width
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: (printCoreConfiguration !== null && printCoreConfiguration.material.brand) ? printCoreConfiguration.material.name : " " //Use space so that the height is still correct.
|
||||
renderType: Text.NativeRendering
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("text")
|
||||
width: parent.width
|
||||
}
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: (printCoreConfiguration !== null && printCoreConfiguration.hotendID) ? printCoreConfiguration.hotendID : " " //Use space so that the height is still correct.
|
||||
renderType: Text.NativeRendering
|
||||
elide: Text.ElideRight
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("text_inactive")
|
||||
width: parent.width
|
||||
}
|
||||
|
@ -1,15 +1,14 @@
|
||||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Dialogs 1.2
|
||||
import QtQuick.Controls 2.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: base
|
||||
|
||||
@ -18,17 +17,25 @@ Menu
|
||||
property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel()
|
||||
|
||||
// Selection-related actions.
|
||||
MenuItem { action: Cura.Actions.centerSelection; }
|
||||
MenuItem { action: Cura.Actions.deleteSelection; }
|
||||
MenuItem { action: Cura.Actions.multiplySelection; }
|
||||
Cura.MenuItem { action: Cura.Actions.centerSelection; }
|
||||
Cura.MenuItem { action: Cura.Actions.deleteSelection; }
|
||||
Cura.MenuItem { action: Cura.Actions.multiplySelection; }
|
||||
|
||||
// Extruder selection - only visible if there is more than 1 extruder
|
||||
MenuSeparator { visible: base.shouldShowExtruders }
|
||||
MenuItem { id: extruderHeader; text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount); enabled: false; visible: base.shouldShowExtruders }
|
||||
Cura.MenuSeparator { visible: base.shouldShowExtruders }
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: extruderHeader
|
||||
text: catalog.i18ncp("@label", "Print Selected Model With:", "Print Selected Models With:", UM.Selection.selectionCount)
|
||||
enabled: false
|
||||
visible: base.shouldShowExtruders
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: CuraApplication.getExtrudersModel()
|
||||
MenuItem {
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: "%1: %2 - %3".arg(model.name).arg(model.material).arg(model.variant)
|
||||
visible: base.shouldShowExtruders
|
||||
enabled: UM.Selection.hasSelection && model.enabled
|
||||
@ -37,60 +44,30 @@ Menu
|
||||
onTriggered: CuraActions.setExtruderForSelection(model.id)
|
||||
shortcut: "Ctrl+" + (model.index + 1)
|
||||
}
|
||||
onObjectAdded: base.insertItem(index, object)
|
||||
// Add it to the fifth position (and above) as we want it to be added after the extruder header.
|
||||
onObjectAdded: base.insertItem(index + 5, object)
|
||||
onObjectRemoved: base.removeItem(object)
|
||||
}
|
||||
|
||||
MenuSeparator {
|
||||
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: base.multiBuildPlateModel
|
||||
MenuItem {
|
||||
enabled: UM.Selection.hasSelection
|
||||
text: base.multiBuildPlateModel.getItem(index).name;
|
||||
onTriggered: CuraActions.setBuildPlateForSelection(base.multiBuildPlateModel.getItem(index).buildPlateNumber);
|
||||
checkable: true
|
||||
checked: base.multiBuildPlateModel.selectionBuildPlates.indexOf(base.multiBuildPlateModel.getItem(index).buildPlateNumber) != -1;
|
||||
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
|
||||
}
|
||||
onObjectAdded: base.insertItem(index, object);
|
||||
onObjectRemoved: base.removeItem(object);
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
enabled: UM.Selection.hasSelection
|
||||
text: "New build plate";
|
||||
onTriggered: {
|
||||
CuraActions.setBuildPlateForSelection(base.multiBuildPlateModel.maxBuildPlate + 1);
|
||||
checked = false;
|
||||
}
|
||||
checkable: true
|
||||
checked: false
|
||||
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
|
||||
}
|
||||
|
||||
// Global actions
|
||||
MenuSeparator {}
|
||||
MenuItem { action: Cura.Actions.selectAll; }
|
||||
MenuItem { action: Cura.Actions.arrangeAll; }
|
||||
MenuItem { action: Cura.Actions.deleteAll; }
|
||||
MenuItem { action: Cura.Actions.reloadAll; }
|
||||
MenuItem { action: Cura.Actions.resetAllTranslation; }
|
||||
MenuItem { action: Cura.Actions.resetAll; }
|
||||
Cura.MenuSeparator {}
|
||||
Cura.MenuItem { action: Cura.Actions.selectAll }
|
||||
Cura.MenuItem { action: Cura.Actions.arrangeAll }
|
||||
Cura.MenuItem { action: Cura.Actions.deleteAll }
|
||||
Cura.MenuItem { action: Cura.Actions.reloadAll }
|
||||
Cura.MenuItem { action: Cura.Actions.resetAllTranslation }
|
||||
Cura.MenuItem { action: Cura.Actions.resetAll }
|
||||
|
||||
// Group actions
|
||||
MenuSeparator {}
|
||||
MenuItem { action: Cura.Actions.groupObjects; }
|
||||
MenuItem { action: Cura.Actions.mergeObjects; }
|
||||
MenuItem { action: Cura.Actions.unGroupObjects; }
|
||||
Cura.MenuSeparator {}
|
||||
Cura.MenuItem { action: Cura.Actions.groupObjects }
|
||||
Cura.MenuItem { action: Cura.Actions.mergeObjects }
|
||||
Cura.MenuItem { action: Cura.Actions.unGroupObjects }
|
||||
|
||||
Connections
|
||||
{
|
||||
target: UM.Controller
|
||||
function onContextMenuRequested() { base.popup(); }
|
||||
function onContextMenuRequested() { base.popup() }
|
||||
}
|
||||
|
||||
Connections
|
||||
@ -108,69 +85,56 @@ Menu
|
||||
watchedProperties: [ "value" ]
|
||||
}
|
||||
|
||||
Dialog
|
||||
UM.Dialog
|
||||
{
|
||||
id: multiplyDialog
|
||||
modality: Qt.ApplicationModal
|
||||
|
||||
title: catalog.i18ncp("@title:window", "Multiply Selected Model", "Multiply Selected Models", UM.Selection.selectionCount)
|
||||
|
||||
width: UM.Theme.getSize("small_popup_dialog").width
|
||||
height: UM.Theme.getSize("small_popup_dialog").height
|
||||
minimumWidth: UM.Theme.getSize("small_popup_dialog").width
|
||||
minimumHeight: UM.Theme.getSize("small_popup_dialog").height
|
||||
|
||||
onAccepted: CuraActions.multiplySelection(copiesField.value)
|
||||
|
||||
signal reset()
|
||||
onReset:
|
||||
{
|
||||
copiesField.value = 1;
|
||||
copiesField.focus = true;
|
||||
}
|
||||
buttonSpacing: UM.Theme.getSize("thin_margin").width
|
||||
|
||||
onVisibleChanged:
|
||||
{
|
||||
copiesField.forceActiveFocus();
|
||||
}
|
||||
|
||||
standardButtons: StandardButton.Ok | StandardButton.Cancel
|
||||
rightButtons:
|
||||
[
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
text: "Cancel"
|
||||
onClicked: multiplyDialog.reject()
|
||||
},
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
text: "Ok"
|
||||
onClicked: multiplyDialog.accept()
|
||||
}
|
||||
]
|
||||
|
||||
Row
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label
|
||||
UM.Label
|
||||
{
|
||||
text: catalog.i18nc("@label", "Number of Copies")
|
||||
anchors.verticalCenter: copiesField.verticalCenter
|
||||
width: contentWidth
|
||||
wrapMode: Text.NoWrap
|
||||
}
|
||||
|
||||
SpinBox
|
||||
Cura.SpinBox
|
||||
{
|
||||
id: copiesField
|
||||
editable: true
|
||||
focus: true
|
||||
minimumValue: 1
|
||||
maximumValue: 99
|
||||
from: 1
|
||||
to: 99
|
||||
width: 2 * UM.Theme.getSize("button").width
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Find the index of an item in the list of child items of this menu.
|
||||
//
|
||||
// This is primarily intended as a helper function so we do not have to
|
||||
// hard-code the position of the extruder selection actions.
|
||||
//
|
||||
// \param item The item to find the index of.
|
||||
//
|
||||
// \return The index of the item or -1 if it was not found.
|
||||
function findItemIndex(item)
|
||||
{
|
||||
for(var i in base.items)
|
||||
{
|
||||
if(base.items[i] == item)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
}
|
||||
|
28
resources/qml/Menus/EditMenu.qml
Normal file
28
resources/qml/Menus/EditMenu.qml
Normal file
@ -0,0 +1,28 @@
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.6 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Cura.Menu
|
||||
{
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit")
|
||||
|
||||
Cura.MenuItem { action: Cura.Actions.undo }
|
||||
Cura.MenuItem { action: Cura.Actions.redo }
|
||||
Cura.MenuSeparator { }
|
||||
Cura.MenuItem { action: Cura.Actions.selectAll }
|
||||
Cura.MenuItem { action: Cura.Actions.arrangeAll }
|
||||
Cura.MenuItem { action: Cura.Actions.multiplySelection }
|
||||
Cura.MenuItem { action: Cura.Actions.deleteSelection }
|
||||
Cura.MenuItem { action: Cura.Actions.deleteAll }
|
||||
Cura.MenuItem { action: Cura.Actions.resetAllTranslation }
|
||||
Cura.MenuItem { action: Cura.Actions.resetAll }
|
||||
Cura.MenuSeparator { }
|
||||
Cura.MenuItem { action: Cura.Actions.groupObjects }
|
||||
Cura.MenuItem { action: Cura.Actions.mergeObjects }
|
||||
Cura.MenuItem { action: Cura.Actions.unGroupObjects }
|
||||
}
|
64
resources/qml/Menus/ExtensionMenu.qml
Normal file
64
resources/qml/Menus/ExtensionMenu.qml
Normal file
@ -0,0 +1,64 @@
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Cura.Menu
|
||||
{
|
||||
id: extensionMenu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions")
|
||||
property var extensionModel: UM.ExtensionModel { }
|
||||
Component
|
||||
{
|
||||
id: extensionsMenuItem
|
||||
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: modelText
|
||||
onTriggered: extensionsModel.subMenuTriggered(extensionName, modelText)
|
||||
}
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: extensionsMenuSeparator
|
||||
|
||||
Cura.MenuSeparator {}
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
id: extensions
|
||||
model: extensionModel
|
||||
|
||||
Cura.Menu
|
||||
{
|
||||
id: sub_menu
|
||||
title: model.name
|
||||
shouldBeVisible: actions !== undefined
|
||||
enabled: actions != null
|
||||
Instantiator
|
||||
{
|
||||
model: actions
|
||||
Loader
|
||||
{
|
||||
property var extensionsModel: extensions.model
|
||||
property var modelText: model.text
|
||||
property var extensionName: name
|
||||
|
||||
sourceComponent: modelText.trim() == "" ? extensionsMenuSeparator : extensionsMenuItem
|
||||
}
|
||||
|
||||
onObjectAdded: sub_menu.insertItem(index, object.item)
|
||||
onObjectRemoved: sub_menu.removeItem(object.item)
|
||||
}
|
||||
}
|
||||
|
||||
onObjectAdded: extensionMenu.insertMenu(index, object)
|
||||
onObjectRemoved: extensionMenu.removeMenu(object)
|
||||
}
|
||||
}
|
@ -1,46 +1,49 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.6 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: base
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&File")
|
||||
property var fileProviderModel: CuraApplication.getFileProviderModel()
|
||||
|
||||
MenuItem
|
||||
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: newProjectMenu
|
||||
action: Cura.Actions.newProject
|
||||
}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: openMenu
|
||||
action: Cura.Actions.open
|
||||
visible: (base.fileProviderModel.count == 1)
|
||||
visible: base.fileProviderModel.count == 1
|
||||
enabled: base.fileProviderModel.count == 1
|
||||
}
|
||||
|
||||
OpenFilesMenu
|
||||
{
|
||||
id: openFilesMenu
|
||||
visible: (base.fileProviderModel.count > 1)
|
||||
|
||||
shouldBeVisible: base.fileProviderModel.count > 1
|
||||
}
|
||||
|
||||
RecentFilesMenu { }
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: saveWorkspaceMenu
|
||||
shortcut: visible ? StandardKey.Save : ""
|
||||
shortcut: StandardKey.Save
|
||||
text: catalog.i18nc("@title:menu menubar:file", "&Save Project...")
|
||||
visible: saveProjectMenu.model.count == 1
|
||||
enabled: UM.WorkspaceFileHandler.enabled
|
||||
enabled: UM.WorkspaceFileHandler.enabled && saveProjectMenu.model.count == 1
|
||||
onTriggered:
|
||||
{
|
||||
var args = { "filter_by_machine": false, "file_type": "workspace", "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml" };
|
||||
@ -62,13 +65,13 @@ Menu
|
||||
{
|
||||
id: saveProjectMenu
|
||||
model: projectOutputDevicesModel
|
||||
visible: model.count > 1
|
||||
shouldBeVisible: model.count > 1
|
||||
enabled: UM.WorkspaceFileHandler.enabled
|
||||
}
|
||||
|
||||
MenuSeparator { }
|
||||
Cura.MenuSeparator { }
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: saveAsMenu
|
||||
text: catalog.i18nc("@title:menu menubar:file", "&Export...")
|
||||
@ -79,24 +82,24 @@ Menu
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: exportSelectionMenu
|
||||
text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...")
|
||||
enabled: UM.Selection.hasSelection
|
||||
iconName: "document-save-as"
|
||||
icon.name: "document-save-as"
|
||||
onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"})
|
||||
}
|
||||
|
||||
MenuSeparator { }
|
||||
Cura.MenuSeparator { }
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: reloadAllMenu
|
||||
action: Cura.Actions.reloadAll
|
||||
}
|
||||
|
||||
MenuSeparator { }
|
||||
Cura.MenuSeparator { }
|
||||
|
||||
MenuItem { action: Cura.Actions.quit }
|
||||
Cura.MenuItem { action: Cura.Actions.quit }
|
||||
}
|
||||
|
23
resources/qml/Menus/HelpMenu.qml
Normal file
23
resources/qml/Menus/HelpMenu.qml
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
||||
Cura.Menu
|
||||
{
|
||||
id: helpMenu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&Help")
|
||||
|
||||
Cura.MenuItem { action: Cura.Actions.showProfileFolder }
|
||||
Cura.MenuItem { action: Cura.Actions.showTroubleshooting}
|
||||
Cura.MenuItem { action: Cura.Actions.documentation }
|
||||
Cura.MenuItem { action: Cura.Actions.reportBug }
|
||||
Cura.MenuSeparator { }
|
||||
Cura.MenuItem { action: Cura.Actions.whatsNew }
|
||||
Cura.MenuItem { action: Cura.Actions.about }
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: Cura.GlobalStacksModel {}
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false
|
||||
exclusiveGroup: group
|
||||
visible: !model.hasRemoteConnection
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
//Copyright (c) 2020 Ultimaker B.V.
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: menu
|
||||
id: materialMenu
|
||||
title: catalog.i18nc("@label:category menu label", "Material")
|
||||
|
||||
property int extruderIndex: 0
|
||||
@ -25,55 +25,54 @@ Menu
|
||||
}
|
||||
property bool isActiveExtruderEnabled: (activeExtruder === null || activeExtruder === undefined) ? false : activeExtruder.isEnabled
|
||||
|
||||
property string activeMaterialId: (activeExtruder === null || activeExtruder === undefined) ? false : activeExtruder.material.id
|
||||
|
||||
property string activeMaterialId: (activeExtruder === null || activeExtruder === undefined) ? "" : activeExtruder.material.id
|
||||
property bool updateModels: true
|
||||
Cura.FavoriteMaterialsModel
|
||||
{
|
||||
id: favoriteMaterialsModel
|
||||
extruderPosition: menu.extruderIndex
|
||||
extruderPosition: materialMenu.extruderIndex
|
||||
enabled: updateModels
|
||||
}
|
||||
|
||||
Cura.GenericMaterialsModel
|
||||
{
|
||||
id: genericMaterialsModel
|
||||
extruderPosition: menu.extruderIndex
|
||||
extruderPosition: materialMenu.extruderIndex
|
||||
enabled: updateModels
|
||||
}
|
||||
|
||||
Cura.MaterialBrandsModel
|
||||
{
|
||||
id: brandModel
|
||||
extruderPosition: menu.extruderIndex
|
||||
extruderPosition: materialMenu.extruderIndex
|
||||
enabled: updateModels
|
||||
}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@label:category menu label", "Favorites")
|
||||
enabled: false
|
||||
visible: favoriteMaterialsModel.items.length > 0
|
||||
}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: favoriteMaterialsModel
|
||||
delegate: MenuItem
|
||||
delegate: Cura.MenuItem
|
||||
{
|
||||
text: model.brand + " " + model.name
|
||||
checkable: true
|
||||
enabled: isActiveExtruderEnabled
|
||||
checked: model.root_material_id === menu.currentRootMaterialId
|
||||
checked: model.root_material_id === materialMenu.currentRootMaterialId
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
exclusiveGroup: favoriteGroup // One favorite and one item from the others can be active at the same time.
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(index)
|
||||
onObjectAdded: materialMenu.insertItem(index + 1, object)
|
||||
onObjectRemoved: materialMenu.removeItem(index)
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
Cura.MenuSeparator { visible: favoriteMaterialsModel.items.length > 0}
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: genericMenu
|
||||
title: catalog.i18nc("@label:category menu label", "Generic")
|
||||
@ -81,13 +80,12 @@ Menu
|
||||
Instantiator
|
||||
{
|
||||
model: genericMaterialsModel
|
||||
delegate: MenuItem
|
||||
delegate: Cura.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
enabled: isActiveExtruderEnabled
|
||||
checked: model.root_material_id === menu.currentRootMaterialId
|
||||
exclusiveGroup: group
|
||||
checked: model.root_material_id === materialMenu.currentRootMaterialId
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
}
|
||||
onObjectAdded: genericMenu.insertItem(index, object)
|
||||
@ -95,12 +93,12 @@ Menu
|
||||
}
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
Cura.MenuSeparator {}
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: brandModel
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: brandMenu
|
||||
title: brandName
|
||||
@ -110,7 +108,7 @@ Menu
|
||||
Instantiator
|
||||
{
|
||||
model: brandMaterials
|
||||
delegate: Menu
|
||||
delegate: Cura.Menu
|
||||
{
|
||||
id: brandMaterialsMenu
|
||||
title: materialName
|
||||
@ -120,47 +118,37 @@ Menu
|
||||
Instantiator
|
||||
{
|
||||
model: brandMaterialColors
|
||||
delegate: MenuItem
|
||||
delegate: Cura.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
enabled: isActiveExtruderEnabled
|
||||
checked: model.id === menu.activeMaterialId
|
||||
exclusiveGroup: group
|
||||
checked: model.id === materialMenu.activeMaterialId
|
||||
|
||||
onTriggered: Cura.MachineManager.setMaterial(extruderIndex, model.container_node)
|
||||
}
|
||||
onObjectAdded: brandMaterialsMenu.insertItem(index, object)
|
||||
onObjectRemoved: brandMaterialsMenu.removeItem(object)
|
||||
}
|
||||
}
|
||||
onObjectAdded: brandMenu.insertItem(index, object)
|
||||
onObjectRemoved: brandMenu.removeItem(object)
|
||||
onObjectAdded: brandMenu.insertMenu(index, object)
|
||||
onObjectRemoved: brandMenu.removeMenu(object)
|
||||
}
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
onObjectAdded: materialMenu.insertMenu(index + 4, object)
|
||||
onObjectRemoved: materialMenu.removeMenu(object)
|
||||
}
|
||||
|
||||
ExclusiveGroup
|
||||
{
|
||||
id: group
|
||||
}
|
||||
Cura.MenuSeparator {}
|
||||
|
||||
ExclusiveGroup
|
||||
{
|
||||
id: favoriteGroup
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
action: Cura.Actions.manageMaterials
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
Cura.MenuSeparator {}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
action: Cura.Actions.marketplaceMaterials
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: Cura.GlobalStacksModel {}
|
||||
MenuItem
|
||||
{
|
||||
property string connectGroupName:
|
||||
{
|
||||
if("group_name" in model.metadata)
|
||||
{
|
||||
return model.metadata["group_name"]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
text: connectGroupName
|
||||
checkable: true
|
||||
visible: model.hasRemoteConnection
|
||||
checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName
|
||||
exclusiveGroup: group
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
@ -1,15 +1,15 @@
|
||||
// Copyright (c) 2017 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: menu
|
||||
id: nozzleMenu
|
||||
title: "Nozzle"
|
||||
|
||||
property int extruderIndex: 0
|
||||
@ -23,38 +23,34 @@ Menu
|
||||
{
|
||||
model: nozzleModel
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: model.hotend_name
|
||||
checkable: true
|
||||
checked: {
|
||||
var activeMachine = Cura.MachineManager.activeMachine
|
||||
property var activeMachine: Cura.MachineManager.activeMachine
|
||||
checked:
|
||||
{
|
||||
if (activeMachine === null)
|
||||
{
|
||||
return false
|
||||
}
|
||||
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex]
|
||||
var extruder = activeMachine.extruderList[extruderIndex]
|
||||
return (extruder === undefined) ? false : (extruder.variant.name == model.hotend_name)
|
||||
}
|
||||
exclusiveGroup: group
|
||||
enabled:
|
||||
{
|
||||
var activeMachine = Cura.MachineManager.activeMachine
|
||||
if (activeMachine === null)
|
||||
{
|
||||
return false
|
||||
}
|
||||
var extruder = Cura.MachineManager.activeMachine.extruderList[extruderIndex]
|
||||
var extruder = activeMachine.extruderList[extruderIndex]
|
||||
return (extruder === undefined) ? false : extruder.isEnabled
|
||||
}
|
||||
onTriggered: {
|
||||
Cura.MachineManager.setVariant(menu.extruderIndex, model.container_node);
|
||||
}
|
||||
onTriggered: Cura.MachineManager.setVariant(nozzleMenu.extruderIndex, model.container_node)
|
||||
}
|
||||
|
||||
onObjectAdded: menu.insertItem(index, object);
|
||||
onObjectRemoved: menu.removeItem(object);
|
||||
onObjectAdded: nozzleMenu.insertItem(index, object)
|
||||
onObjectRemoved: nozzleMenu.removeItem(object)
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: group }
|
||||
}
|
||||
|
@ -1,30 +1,26 @@
|
||||
// Copyright (c) 2020 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.6 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
import "../Dialogs"
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: openFilesMenu
|
||||
title: catalog.i18nc("@title:menu menubar:file", "Open File(s)...")
|
||||
iconName: "document-open-recent";
|
||||
|
||||
Instantiator
|
||||
{
|
||||
id: fileProviders
|
||||
model: CuraApplication.getFileProviderModel()
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text:
|
||||
{
|
||||
return model.displayText;
|
||||
}
|
||||
text: model.displayText
|
||||
onTriggered:
|
||||
{
|
||||
if (model.index == 0) // The 0th element is the "From Disk" option, which should activate the open local file dialog
|
||||
@ -36,11 +32,10 @@ Menu
|
||||
CuraApplication.getFileProviderModel().trigger(model.name);
|
||||
}
|
||||
}
|
||||
// Unassign the shortcuts when the submenu is invisible (i.e. when there is only one file provider) to avoid ambiguous shortcuts.
|
||||
// When there is a single file provider, the openAction is assigned with the Ctrl+O shortcut instead.
|
||||
shortcut: openFilesMenu.visible ? model.shortcut : ""
|
||||
shortcut: model.shortcut
|
||||
}
|
||||
onObjectAdded: openFilesMenu.insertItem(index, object)
|
||||
|
||||
onObjectRemoved: openFilesMenu.removeItem(object)
|
||||
}
|
||||
}
|
||||
|
25
resources/qml/Menus/PreferencesMenu.qml
Normal file
25
resources/qml/Menus/PreferencesMenu.qml
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Cura.Menu
|
||||
{
|
||||
id: preferencesMenu
|
||||
|
||||
//On MacOS, don't translate the "Preferences" word.
|
||||
//Qt moves the "preferences" entry to a different place, and if it got renamed can't find it again when it
|
||||
//attempts to delete the item upon closing the application, causing a crash.
|
||||
//In the new location, these items are translated automatically according to the system's language.
|
||||
//For more information, see:
|
||||
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
|
||||
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
|
||||
title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references")
|
||||
|
||||
Cura.MenuItem { action: Cura.Actions.preferences }
|
||||
}
|
||||
|
@ -1,61 +1,77 @@
|
||||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Copyright (c) 2022 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.6 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: menu
|
||||
// TODO Enable custom style to the menu
|
||||
// style: MenuStyle
|
||||
// {
|
||||
// frame: Rectangle
|
||||
// {
|
||||
// color: "white"
|
||||
// }
|
||||
// }
|
||||
|
||||
MenuItem
|
||||
title: catalog.i18nc("@title:menu menubar:settings", "&Printer")
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: networkEnabledPrinterItem
|
||||
text: catalog.i18nc("@label:category menu label", "Network enabled printers")
|
||||
enabled: false
|
||||
visible: networkPrinterMenu.count > 0
|
||||
visible: networKPrinterInstantiator.count > 0
|
||||
}
|
||||
|
||||
NetworkPrinterMenu
|
||||
Instantiator
|
||||
{
|
||||
id: networkPrinterMenu
|
||||
id: networKPrinterInstantiator
|
||||
model: Cura.GlobalStacksModel {filterOnlineOnly: true }
|
||||
Cura.MenuItem
|
||||
{
|
||||
property string connectGroupName:
|
||||
{
|
||||
if("group_name" in model.metadata)
|
||||
{
|
||||
return model.metadata["group_name"]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
text: connectGroupName
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
|
||||
}
|
||||
onObjectAdded: menu.insertItem(2, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
{
|
||||
visible: networkPrinterMenu.count > 0
|
||||
}
|
||||
Cura.MenuSeparator { visible: networKPrinterInstantiator.count > 0 }
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@label:category menu label", "Local printers")
|
||||
enabled: false
|
||||
visible: localPrinterMenu.count > 0
|
||||
}
|
||||
|
||||
LocalPrinterMenu
|
||||
Cura.MenuItem
|
||||
{
|
||||
id: localPrinterMenu
|
||||
text: catalog.i18nc("@label:category menu label", "Local printers")
|
||||
enabled: false
|
||||
visible: localPrinterInstantiator.count > 0
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: group; }
|
||||
|
||||
MenuSeparator
|
||||
Instantiator
|
||||
{
|
||||
visible: localPrinterMenu.count > 0
|
||||
id: localPrinterInstantiator
|
||||
model: Cura.GlobalStacksModel {}
|
||||
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false
|
||||
visible: !model.hasRemoteConnection
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
|
||||
}
|
||||
// A bit hackish, but we have 2 items at the end, put them before that
|
||||
onObjectAdded: menu.insertItem(menu.count - 2, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
MenuItem { action: Cura.Actions.addMachine; }
|
||||
MenuItem { action: Cura.Actions.configureMachines; }
|
||||
Cura.MenuSeparator { visible: localPrinterInstantiator.count > 0 }
|
||||
|
||||
Cura.MenuItem { action: Cura.Actions.addMachine }
|
||||
Cura.MenuItem { action: Cura.Actions.configureMachines }
|
||||
}
|
||||
|
@ -2,12 +2,12 @@
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.3 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: menu
|
||||
title: "Printer type"
|
||||
@ -18,12 +18,11 @@ Menu
|
||||
id: printerTypeInstantiator
|
||||
model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : []
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: modelData.machine_type
|
||||
checkable: true
|
||||
checked: Cura.MachineManager.activeMachine.definition.name == modelData.machine_type
|
||||
exclusiveGroup: group
|
||||
onTriggered:
|
||||
{
|
||||
Cura.MachineManager.switchPrinterType(modelData.machine_type)
|
||||
@ -32,6 +31,4 @@ Menu
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
ExclusiveGroup { id: group }
|
||||
}
|
||||
|
@ -1,26 +1,26 @@
|
||||
// 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.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.3 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
import "../Dialogs"
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: menu
|
||||
title: catalog.i18nc("@title:menu menubar:file", "Open &Recent")
|
||||
iconName: "document-open-recent";
|
||||
//iconName: "document-open-recent";
|
||||
|
||||
enabled: CuraApplication.recentFiles.length > 0;
|
||||
|
||||
Instantiator
|
||||
{
|
||||
model: CuraApplication.recentFiles
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text:
|
||||
{
|
||||
@ -32,9 +32,4 @@ Menu
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
}
|
||||
|
||||
Cura.AskOpenAsProjectOrModelsDialog
|
||||
{
|
||||
id: askOpenAsProjectOrModelsDialog
|
||||
}
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
// 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.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
import UM 1.6 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
import "../Dialogs"
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: saveProjectMenu
|
||||
title: catalog.i18nc("@title:menu menubar:file", "Save Project...")
|
||||
@ -18,7 +18,7 @@ Menu
|
||||
Instantiator
|
||||
{
|
||||
id: projectOutputDevices
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: model.name
|
||||
onTriggered:
|
||||
@ -40,9 +40,8 @@ Menu
|
||||
UM.OutputDeviceManager.requestWriteToDevice(model.id, PrintInformation.jobName, args)
|
||||
}
|
||||
}
|
||||
// Unassign the shortcuts when the submenu is invisible (i.e. when there is only one project output device) to avoid ambiguous shortcuts.
|
||||
// When there is only the LocalFileOutputDevice, the Ctrl+S shortcut is assigned to the saveWorkspaceMenu MenuItem
|
||||
shortcut: saveProjectMenu.visible ? model.shortcut : ""
|
||||
shortcut: model.shortcut
|
||||
enabled: saveProjectMenu.shouldBeVisible
|
||||
}
|
||||
onObjectAdded: saveProjectMenu.insertItem(index, object)
|
||||
onObjectRemoved: saveProjectMenu.removeItem(object)
|
||||
@ -53,6 +52,6 @@ Menu
|
||||
id: saveWorkspaceDialog
|
||||
property var args
|
||||
property var deviceId
|
||||
onYes: UM.OutputDeviceManager.requestWriteToDevice(deviceId, PrintInformation.jobName, args)
|
||||
onAccepted: UM.OutputDeviceManager.requestWriteToDevice(deviceId, PrintInformation.jobName, args)
|
||||
}
|
||||
}
|
||||
|
@ -2,70 +2,76 @@
|
||||
//Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Controls 2.4
|
||||
|
||||
import UM 1.2 as UM
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
id: base
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&Settings")
|
||||
|
||||
PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") }
|
||||
PrinterMenu { }
|
||||
|
||||
property var activeMachine: Cura.MachineManager.activeMachine
|
||||
Instantiator
|
||||
{
|
||||
id: extruderInstantiator
|
||||
model: activeMachine == null ? null : activeMachine.extruderList
|
||||
Menu
|
||||
Cura.Menu
|
||||
{
|
||||
title: modelData.name
|
||||
property var extruder: (base.activeMachine === null) ? null : activeMachine.extruderList[model.index]
|
||||
NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.activeMachine.hasVariants; extruderIndex: index }
|
||||
NozzleMenu
|
||||
{
|
||||
title: Cura.MachineManager.activeDefinitionVariantsName
|
||||
shouldBeVisible: activeMachine.hasVariants
|
||||
extruderIndex: index
|
||||
}
|
||||
MaterialMenu
|
||||
{
|
||||
title: catalog.i18nc("@title:menu", "&Material")
|
||||
visible: Cura.MachineManager.activeMachine.hasMaterials
|
||||
shouldBeVisible: activeMachine.hasMaterials
|
||||
extruderIndex: index
|
||||
updateModels: false
|
||||
onAboutToShow: updateModels = true
|
||||
onAboutToHide: updateModels = false
|
||||
}
|
||||
|
||||
MenuSeparator
|
||||
Cura.MenuSeparator
|
||||
{
|
||||
visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials
|
||||
}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Set as Active Extruder")
|
||||
onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index)
|
||||
}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Enable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
|
||||
visible: (extruder === null || extruder === undefined) ? false : !extruder.isEnabled
|
||||
height: visible ? implicitHeight: 0
|
||||
}
|
||||
|
||||
MenuItem
|
||||
Cura.MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Disable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(index, false)
|
||||
visible: (extruder === null || extruder === undefined) ? false : extruder.isEnabled
|
||||
enabled: Cura.MachineManager.numberExtrudersEnabled > 1
|
||||
height: visible ? implicitHeight: 0
|
||||
}
|
||||
|
||||
}
|
||||
onObjectAdded: base.insertItem(index, object)
|
||||
onObjectRemoved: base.removeItem(object)
|
||||
onObjectAdded: base.insertMenu(index, object)
|
||||
onObjectRemoved: base.removeMenu(object)
|
||||
}
|
||||
|
||||
MenuSeparator { }
|
||||
Cura.MenuSeparator { }
|
||||
|
||||
MenuItem { action: Cura.Actions.configureSettingVisibility }
|
||||
Cura.MenuItem { action: Cura.Actions.configureSettingVisibility }
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user