mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-06 21:44:01 -06:00
Change the Open File(s) option according to the file providers count
When there is only one file provider (i.e. the local file provider), the Open File(s) will be a simple item in the File menu. When there are more than one file providers, the Open File(s) will become a submenu in the File menu, which will contain all the file providers as submenu items. CURA-7868
This commit is contained in:
parent
43615a57b6
commit
71994eaaf9
3 changed files with 31 additions and 9 deletions
|
@ -11,15 +11,14 @@ import "../Dialogs"
|
|||
|
||||
Menu
|
||||
{
|
||||
id: menu
|
||||
id: openFilesMenu
|
||||
title: catalog.i18nc("@title:menu menubar:file", "Open File(s)...")
|
||||
iconName: "document-open-recent";
|
||||
|
||||
|
||||
Instantiator
|
||||
{
|
||||
id: fileProviders
|
||||
model: UM.FileProviderModel { }
|
||||
model: CuraApplication.getFileProviderModel()
|
||||
MenuItem
|
||||
{
|
||||
text:
|
||||
|
@ -34,12 +33,12 @@ Menu
|
|||
}
|
||||
else
|
||||
{
|
||||
fileProviders.model.trigger(model.name);
|
||||
CuraApplication.getFileProviderModel().trigger(model.name);
|
||||
}
|
||||
}
|
||||
shortcut: model.shortcut
|
||||
}
|
||||
onObjectAdded: menu.insertItem(index, object)
|
||||
onObjectRemoved: menu.removeItem(object)
|
||||
onObjectAdded: openFilesMenu.insertItem(index, object)
|
||||
onObjectRemoved: openFilesMenu.removeItem(object)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue