mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 15:13:56 -06:00
Revert "Merge branch '4.7' of github.com:Ultimaker/Cura into 4.7"
This reverts commit7f47f12bf0
, reversing changes made todd42c87da7
.
This commit is contained in:
parent
2fe9ee2cf2
commit
28f4d8513d
13 changed files with 149 additions and 274 deletions
|
@ -2,7 +2,7 @@
|
|||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls 1.4
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
|
@ -20,7 +20,6 @@ UM.Dialog
|
|||
|
||||
property int comboboxHeight: 15 * screenScaleFactor
|
||||
property int spacerHeight: 10 * screenScaleFactor
|
||||
property int doubleSpacerHeight: 20 * screenScaleFactor
|
||||
|
||||
onClosing: manager.notifyClosed()
|
||||
onVisibleChanged:
|
||||
|
@ -36,7 +35,7 @@ UM.Dialog
|
|||
Item
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10 * screenScaleFactor
|
||||
anchors.margins: 20 * screenScaleFactor
|
||||
|
||||
UM.I18nCatalog
|
||||
{
|
||||
|
@ -80,7 +79,7 @@ UM.Dialog
|
|||
}
|
||||
Item // Spacer
|
||||
{
|
||||
height: doubleSpacerHeight
|
||||
height: spacerHeight
|
||||
width: height
|
||||
}
|
||||
|
||||
|
@ -102,54 +101,36 @@ UM.Dialog
|
|||
}
|
||||
UM.TooltipArea
|
||||
{
|
||||
id: machineResolveStrategyTooltip
|
||||
id: machineResolveTooltip
|
||||
width: (parent.width / 3) | 0
|
||||
height: visible ? comboboxHeight : 0
|
||||
visible: base.visible && machineResolveComboBox.model.count > 1
|
||||
visible: manager.machineConflict
|
||||
text: catalog.i18nc("@info:tooltip", "How should the conflict in the machine be resolved?")
|
||||
ComboBox
|
||||
{
|
||||
id: machineResolveComboBox
|
||||
model: manager.updatableMachinesModel
|
||||
visible: machineResolveStrategyTooltip.visible
|
||||
textRole: "displayName"
|
||||
width: parent.width
|
||||
onCurrentIndexChanged:
|
||||
model: ListModel
|
||||
{
|
||||
if (model.getItem(currentIndex).id == "new"
|
||||
&& model.getItem(currentIndex).type == "default_option")
|
||||
Component.onCompleted:
|
||||
{
|
||||
manager.setResolveStrategy("machine", "new")
|
||||
}
|
||||
else
|
||||
{
|
||||
manager.setResolveStrategy("machine", "override")
|
||||
manager.setMachineToOverride(model.getItem(currentIndex).id)
|
||||
append({"key": "override", "label": catalog.i18nc("@action:ComboBox option", "Update") + " " + manager.machineName});
|
||||
append({"key": "new", "label": catalog.i18nc("@action:ComboBox option", "Create new")});
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged:
|
||||
Connections
|
||||
{
|
||||
if (!visible) {return}
|
||||
|
||||
currentIndex = 0
|
||||
// If the project printer exists in Cura, set it as the default dropdown menu option.
|
||||
// No need to check object 0, which is the "Create new" option
|
||||
for (var i = 1; i < model.count; i++)
|
||||
target: manager
|
||||
onMachineNameChanged:
|
||||
{
|
||||
if (model.getItem(i).name == manager.machineName)
|
||||
{
|
||||
currentIndex = i
|
||||
break
|
||||
}
|
||||
}
|
||||
// The project printer does not exist in Cura. If there is at least one printer of the same
|
||||
// type, select the first one, else set the index to "Create new"
|
||||
if (currentIndex == 0 && model.count > 1)
|
||||
{
|
||||
currentIndex = 1
|
||||
machineResolveComboBox.model.get(0).label = catalog.i18nc("@action:ComboBox option", "Update") + " " + manager.machineName;
|
||||
}
|
||||
}
|
||||
textRole: "label"
|
||||
id: machineResolveComboBox
|
||||
width: parent.width
|
||||
onActivated:
|
||||
{
|
||||
manager.setResolveStrategy("machine", resolveStrategiesModel.get(index).key)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -187,7 +168,7 @@ UM.Dialog
|
|||
|
||||
Item // Spacer
|
||||
{
|
||||
height: doubleSpacerHeight
|
||||
height: spacerHeight
|
||||
width: height
|
||||
}
|
||||
Row
|
||||
|
@ -290,7 +271,7 @@ UM.Dialog
|
|||
}
|
||||
Item // Spacer
|
||||
{
|
||||
height: doubleSpacerHeight
|
||||
height: spacerHeight
|
||||
width: height
|
||||
}
|
||||
Row
|
||||
|
@ -352,7 +333,7 @@ UM.Dialog
|
|||
|
||||
Item // Spacer
|
||||
{
|
||||
height: doubleSpacerHeight
|
||||
height: spacerHeight
|
||||
width: height
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue