Cura/resources/qml/Menus/OpenFilesMenu.qml
Ghostkeeper b266904d76
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.
2021-01-04 18:12:15 +01:00

31 lines
779 B
QML

// Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.1
import UM 1.6 as UM
import Cura 1.0 as Cura
import "../Dialogs"
Menu
{
id: openFilesMenu
title: catalog.i18nc("@title:menu menubar:file", "Open File(s)...")
iconName: "document-open-recent";
Instantiator
{
id: fileProviders
model: CuraApplication.getFileProviderModel()
MenuItem
{
text: model.displayText
onTriggered: CuraApplication.getFileProviderModel().trigger(model.name)
shortcut: model.shortcut
}
onObjectAdded: openFilesMenu.insertItem(index, object)
onObjectRemoved: openFilesMenu.removeItem(object)
}
}