mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00

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.
31 lines
779 B
QML
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)
|
|
}
|
|
}
|