mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 07:38:58 +08:00
Replace with the new add machine dialog
CURA-6435
This commit is contained in:
parent
8f755f8818
commit
8e9a934035
@ -731,44 +731,6 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddMachineDialog
|
|
||||||
{
|
|
||||||
id: addMachineDialog
|
|
||||||
onMachineAdded:
|
|
||||||
{
|
|
||||||
machineActionsWizard.firstRun = addMachineDialog.firstRun
|
|
||||||
machineActionsWizard.start(id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dialog to handle first run machine actions
|
|
||||||
UM.Wizard
|
|
||||||
{
|
|
||||||
id: machineActionsWizard;
|
|
||||||
|
|
||||||
title: catalog.i18nc("@title:window", "Add Printer")
|
|
||||||
property var machine;
|
|
||||||
|
|
||||||
function start(id)
|
|
||||||
{
|
|
||||||
var actions = Cura.MachineActionManager.getFirstStartActions(id)
|
|
||||||
resetPages() // Remove previous pages
|
|
||||||
|
|
||||||
for (var i = 0; i < actions.length; i++)
|
|
||||||
{
|
|
||||||
actions[i].displayItem.reset()
|
|
||||||
machineActionsWizard.appendPage(actions[i].displayItem, catalog.i18nc("@title", actions[i].label));
|
|
||||||
}
|
|
||||||
|
|
||||||
//Only start if there are actions to perform.
|
|
||||||
if (actions.length > 0)
|
|
||||||
{
|
|
||||||
machineActionsWizard.currentPage = 0;
|
|
||||||
show()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MessageDialog
|
MessageDialog
|
||||||
{
|
{
|
||||||
id: messageDialog
|
id: messageDialog
|
||||||
@ -812,10 +774,23 @@ UM.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Cura.WizardDialog
|
||||||
|
{
|
||||||
|
id: addMachineDialog
|
||||||
|
title: catalog.i18nc("@title:window", "Add Printer")
|
||||||
|
model: CuraApplication.getAddPrinterPagesModel()
|
||||||
|
}
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
{
|
{
|
||||||
target: Cura.Actions.addMachine
|
target: Cura.Actions.addMachine
|
||||||
onTriggered: addMachineDialog.visible = true;
|
onTriggered: addMachineDialog.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections
|
||||||
|
{
|
||||||
|
target: CuraApplication
|
||||||
|
onRequestAddPrinter: addMachineDialog.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
AboutDialog
|
AboutDialog
|
||||||
@ -829,31 +804,17 @@ UM.MainWindow
|
|||||||
onTriggered: aboutDialog.visible = true;
|
onTriggered: aboutDialog.visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections
|
|
||||||
{
|
|
||||||
target: CuraApplication
|
|
||||||
onRequestAddPrinter:
|
|
||||||
{
|
|
||||||
addMachineDialog.visible = true
|
|
||||||
addMachineDialog.firstRun = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer
|
Timer
|
||||||
{
|
{
|
||||||
id: startupTimer;
|
id: startupTimer
|
||||||
interval: 100;
|
interval: 100
|
||||||
repeat: false;
|
repeat: false
|
||||||
running: true;
|
running: true
|
||||||
onTriggered:
|
onTriggered:
|
||||||
{
|
{
|
||||||
if (!base.visible)
|
if (!base.visible)
|
||||||
{
|
{
|
||||||
base.visible = true;
|
base.visible = true
|
||||||
}
|
|
||||||
if(!CuraApplication.needToShowUserAgreement && Cura.MachineManager.activeMachine == null)
|
|
||||||
{
|
|
||||||
addMachineDialog.open();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user