mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 07:14:24 +08:00
Replace other references to the open action with the file provider model
This adds a function 'triggerFirst' to the file provider that triggers the first file provider in the model. That should then be the local file provider, but if the plug-in is disabled for some reason it would use another plug-in. Contributes to issue CURA-7868.
This commit is contained in:
parent
de80461954
commit
b266904d76
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2018 Ultimaker B.V.
|
// Copyright (c) 2021 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.7
|
import QtQuick 2.7
|
||||||
@ -96,7 +96,7 @@ Item
|
|||||||
id: openFileButton
|
id: openFileButton
|
||||||
height: UM.Theme.getSize("stage_menu").height
|
height: UM.Theme.getSize("stage_menu").height
|
||||||
width: UM.Theme.getSize("stage_menu").height
|
width: UM.Theme.getSize("stage_menu").height
|
||||||
onClicked: Cura.Actions.open.trigger()
|
onClicked: CuraApplication.getFileProviderModel().triggerFirst()
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
contentItem: Item
|
contentItem: Item
|
||||||
|
@ -627,12 +627,6 @@ UM.MainWindow
|
|||||||
modality: Qt.ApplicationModal
|
modality: Qt.ApplicationModal
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections
|
|
||||||
{
|
|
||||||
target: Cura.Actions.open
|
|
||||||
onTriggered: openDialog.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
{
|
{
|
||||||
target: Cura.Actions.showProfileFolder
|
target: Cura.Actions.showProfileFolder
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2020 Ultimaker B.V.
|
// Copyright (c) 2021 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
|
||||||
@ -21,21 +21,8 @@ Menu
|
|||||||
model: CuraApplication.getFileProviderModel()
|
model: CuraApplication.getFileProviderModel()
|
||||||
MenuItem
|
MenuItem
|
||||||
{
|
{
|
||||||
text:
|
text: model.displayText
|
||||||
{
|
onTriggered: CuraApplication.getFileProviderModel().trigger(model.name)
|
||||||
return model.displayText;
|
|
||||||
}
|
|
||||||
onTriggered:
|
|
||||||
{
|
|
||||||
if (model.index == 0) // The 0th element is the "From Disk" option, which should activate the open local file dialog
|
|
||||||
{
|
|
||||||
Cura.Actions.open.trigger()
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CuraApplication.getFileProviderModel().trigger(model.name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
shortcut: model.shortcut
|
shortcut: model.shortcut
|
||||||
}
|
}
|
||||||
onObjectAdded: openFilesMenu.insertItem(index, object)
|
onObjectAdded: openFilesMenu.insertItem(index, object)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user