mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 21:28:58 +08:00
Change UM.Dialog to Controls.Dialog in connect to printer by ip window
As `UM.Dialog` is opened using in a new window, the error-confirmation that was displayed in a `UM.Dialog` was displayed _behind_ the window object. CURA 8687
This commit is contained in:
parent
ca0d84dcae
commit
3f658a4914
@ -288,7 +288,7 @@ Cura.MachineAction
|
||||
standardButtons: Dialog.Ok
|
||||
}
|
||||
|
||||
UM.Dialog
|
||||
Dialog
|
||||
{
|
||||
id: manualPrinterDialog
|
||||
property string printerKey
|
||||
@ -296,17 +296,18 @@ 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
|
||||
|
||||
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;
|
||||
}
|
||||
@ -327,28 +328,17 @@ Cura.MachineAction
|
||||
{
|
||||
id: addressField
|
||||
width: parent.width
|
||||
validator: RegExpValidator
|
||||
{
|
||||
regExp: /[a-zA-Z0-9\.\-\_]*/
|
||||
}
|
||||
|
||||
validator: RegExpValidator { regExp: /[a-zA-Z0-9\.\-\_]*/ }
|
||||
onAccepted: btnOk.clicked()
|
||||
}
|
||||
}
|
||||
|
||||
rightButtons: [
|
||||
Button {
|
||||
text: catalog.i18nc("@action:button","Cancel")
|
||||
onClicked:
|
||||
onRejected:
|
||||
{
|
||||
manualPrinterDialog.reject()
|
||||
manualPrinterDialog.hide()
|
||||
}
|
||||
},
|
||||
Button {
|
||||
id: btnOk
|
||||
text: catalog.i18nc("@action:button", "OK")
|
||||
onClicked:
|
||||
onAccepted:
|
||||
{
|
||||
// Validate the input first
|
||||
if (!networkingUtil.isValidIP(manualPrinterDialog.addressText))
|
||||
@ -373,8 +363,5 @@ Cura.MachineAction
|
||||
manager.setManualDevice(manualPrinterDialog.printerKey, manualPrinterDialog.addressText)
|
||||
manualPrinterDialog.hide()
|
||||
}
|
||||
enabled: manualPrinterDialog.addressText.trim() != ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user