Update open files dialog to QtControls 2

CURA-8684
This commit is contained in:
casper 2022-01-24 14:11:02 +01:00
parent 582e4fcbd0
commit 9e5fd998f4

View file

@ -1,9 +1,8 @@
// Copyright (c) 2021 Ultimaker B.V. // Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
import QtQuick.Controls 1.1 import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs 1.1
import QtQuick.Window 2.1 import QtQuick.Window 2.1
@ -69,45 +68,43 @@ UM.Dialog
width: height 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 UM.I18nCatalog
{ {
id: catalog id: catalog
name: "cura" name: "cura"
} }
ButtonGroup {
buttons: [cancelButton, importAllAsModelsButton]
checkedButton: importAllAsModelsButton
} }
}
onAccepted: loadModelFiles(base.fileUrls)
// Buttons
rightButtons:
[
Button
{
id: cancelButton
text: catalog.i18nc("@action:button", "Cancel");
onClicked:
{
// cancel
base.hide();
}
},
Button
{
id: importAllAsModelsButton
text: catalog.i18nc("@action:button", "Import all as models");
onClicked:
{
// load models from all selected file
loadModelFiles(base.fileUrls);
base.hide();
}
}
]
} }