Switch out the file, view and edit menu for controls 2

CURA-8683
This commit is contained in:
Jaime van Kessel 2022-01-10 16:55:28 +01:00
parent 58a3aef8d4
commit 052898ce21
9 changed files with 285 additions and 251 deletions

View file

@ -4,69 +4,68 @@
pragma Singleton pragma Singleton
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 1.1 import QtQuick.Controls 2.4
import QtQuick.Controls 2.3 as Controls2
import UM 1.1 as UM import UM 1.1 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Item Item
{ {
property alias newProject: newProjectAction; property alias newProject: newProjectAction
property alias open: openAction; property alias open: openAction
property alias quit: quitAction; property alias quit: quitAction
property alias undo: undoAction; property alias undo: undoAction
property alias redo: redoAction; property alias redo: redoAction
property alias view3DCamera: view3DCameraAction; property alias view3DCamera: view3DCameraAction
property alias viewFrontCamera: viewFrontCameraAction; property alias viewFrontCamera: viewFrontCameraAction
property alias viewTopCamera: viewTopCameraAction; property alias viewTopCamera: viewTopCameraAction
property alias viewBottomCamera: viewBottomCameraAction; property alias viewBottomCamera: viewBottomCameraAction
property alias viewLeftSideCamera: viewLeftSideCameraAction; property alias viewLeftSideCamera: viewLeftSideCameraAction
property alias viewRightSideCamera: viewRightSideCameraAction; property alias viewRightSideCamera: viewRightSideCameraAction
property alias deleteSelection: deleteSelectionAction; property alias deleteSelection: deleteSelectionAction
property alias centerSelection: centerSelectionAction; property alias centerSelection: centerSelectionAction
property alias multiplySelection: multiplySelectionAction; property alias multiplySelection: multiplySelectionAction
property alias deleteObject: deleteObjectAction; property alias deleteObject: deleteObjectAction
property alias centerObject: centerObjectAction; property alias centerObject: centerObjectAction
property alias groupObjects: groupObjectsAction; property alias groupObjects: groupObjectsAction
property alias unGroupObjects:unGroupObjectsAction; property alias unGroupObjects:unGroupObjectsAction
property alias mergeObjects: mergeObjectsAction; property alias mergeObjects: mergeObjectsAction
//property alias unMergeObjects: unMergeObjectsAction; //property alias unMergeObjects: unMergeObjectsAction
property alias multiplyObject: multiplyObjectAction; property alias multiplyObject: multiplyObjectAction
property alias selectAll: selectAllAction; property alias selectAll: selectAllAction
property alias deleteAll: deleteAllAction; property alias deleteAll: deleteAllAction
property alias reloadAll: reloadAllAction; property alias reloadAll: reloadAllAction
property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction; property alias arrangeAllBuildPlates: arrangeAllBuildPlatesAction
property alias arrangeAll: arrangeAllAction; property alias arrangeAll: arrangeAllAction
property alias arrangeSelection: arrangeSelectionAction; property alias arrangeSelection: arrangeSelectionAction
property alias resetAllTranslation: resetAllTranslationAction; property alias resetAllTranslation: resetAllTranslationAction
property alias resetAll: resetAllAction; property alias resetAll: resetAllAction
property alias addMachine: addMachineAction; property alias addMachine: addMachineAction
property alias configureMachines: settingsAction; property alias configureMachines: settingsAction
property alias addProfile: addProfileAction; property alias addProfile: addProfileAction
property alias updateProfile: updateProfileAction; property alias updateProfile: updateProfileAction
property alias resetProfile: resetProfileAction; property alias resetProfile: resetProfileAction
property alias manageProfiles: manageProfilesAction; property alias manageProfiles: manageProfilesAction
property alias manageMaterials: manageMaterialsAction; property alias manageMaterials: manageMaterialsAction
property alias marketplaceMaterials: marketplaceMaterialsAction; property alias marketplaceMaterials: marketplaceMaterialsAction
property alias preferences: preferencesAction; property alias preferences: preferencesAction
property alias showProfileFolder: showProfileFolderAction; property alias showProfileFolder: showProfileFolderAction
property alias documentation: documentationAction; property alias documentation: documentationAction
property alias showTroubleshooting: showTroubleShootingAction property alias showTroubleshooting: showTroubleShootingAction
property alias reportBug: reportBugAction; property alias reportBug: reportBugAction
property alias whatsNew: whatsNewAction property alias whatsNew: whatsNewAction
property alias about: aboutAction; property alias about: aboutAction
property alias toggleFullScreen: toggleFullScreenAction; property alias toggleFullScreen: toggleFullScreenAction
property alias exitFullScreen: exitFullScreenAction property alias exitFullScreen: exitFullScreenAction
property alias configureSettingVisibility: configureSettingVisibilityAction property alias configureSettingVisibility: configureSettingVisibilityAction
@ -80,7 +79,7 @@ Item
{ {
id: showTroubleShootingAction id: showTroubleShootingAction
onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/troubleshooting?utm_source=cura&utm_medium=software&utm_campaign=dropdown-troubleshooting") onTriggered: Qt.openUrlExternally("https://ultimaker.com/en/troubleshooting?utm_source=cura&utm_medium=software&utm_campaign=dropdown-troubleshooting")
text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting Guide"); text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting Guide")
} }
Action Action
@ -88,7 +87,7 @@ Item
id: toggleFullScreenAction id: toggleFullScreenAction
shortcut: StandardKey.FullScreen shortcut: StandardKey.FullScreen
text: catalog.i18nc("@action:inmenu", "Toggle Full Screen") text: catalog.i18nc("@action:inmenu", "Toggle Full Screen")
iconName: "view-fullscreen" icon.name: "view-fullscreen"
} }
Action Action
@ -96,27 +95,27 @@ Item
id: exitFullScreenAction id: exitFullScreenAction
shortcut: StandardKey.Cancel shortcut: StandardKey.Cancel
text: catalog.i18nc("@action:inmenu", "Exit Full Screen") text: catalog.i18nc("@action:inmenu", "Exit Full Screen")
iconName: "view-fullscreen" icon.name: "view-fullscreen"
} }
Action Action
{ {
id: undoAction; id: undoAction
text: catalog.i18nc("@action:inmenu menubar:edit", "&Undo"); text: catalog.i18nc("@action:inmenu menubar:edit", "&Undo")
iconName: "edit-undo"; icon.name: "edit-undo"
shortcut: StandardKey.Undo; shortcut: StandardKey.Undo
onTriggered: UM.OperationStack.undo(); onTriggered: UM.OperationStack.undo()
enabled: UM.OperationStack.canUndo; enabled: UM.OperationStack.canUndo
} }
Action Action
{ {
id: redoAction; id: redoAction
text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo"); text: catalog.i18nc("@action:inmenu menubar:edit", "&Redo")
iconName: "edit-redo"; icon.name: "edit-redo"
shortcut: StandardKey.Redo; shortcut: StandardKey.Redo
onTriggered: UM.OperationStack.redo(); onTriggered: UM.OperationStack.redo()
enabled: UM.OperationStack.canRedo; enabled: UM.OperationStack.canRedo
} }
Action Action
@ -131,7 +130,7 @@ Item
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
text: (Qt.platform.os == "osx") ? "&Quit" : catalog.i18nc("@action:inmenu menubar:file", "&Quit") text: (Qt.platform.os == "osx") ? "&Quit" : catalog.i18nc("@action:inmenu menubar:file", "&Quit")
iconName: "application-exit" icon.name: "application-exit"
shortcut: StandardKey.Quit shortcut: StandardKey.Quit
} }
@ -188,7 +187,7 @@ Item
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
text: (Qt.platform.os == "osx") ? "Configure Cura..." : catalog.i18nc("@action:inmenu", "Configure Cura...") text: (Qt.platform.os == "osx") ? "Configure Cura..." : catalog.i18nc("@action:inmenu", "Configure Cura...")
iconName: "configure" icon.name: "configure"
} }
Action Action
@ -201,14 +200,14 @@ Item
{ {
id: settingsAction id: settingsAction
text: catalog.i18nc("@action:inmenu menubar:printer", "Manage Pr&inters...") text: catalog.i18nc("@action:inmenu menubar:printer", "Manage Pr&inters...")
iconName: "configure" icon.name: "configure"
} }
Action Action
{ {
id: manageMaterialsAction id: manageMaterialsAction
text: catalog.i18nc("@action:inmenu", "Manage Materials...") text: catalog.i18nc("@action:inmenu", "Manage Materials...")
iconName: "configure" icon.name: "configure"
shortcut: "Ctrl+K" shortcut: "Ctrl+K"
} }
@ -220,64 +219,64 @@ Item
Action Action
{ {
id: updateProfileAction; id: updateProfileAction
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null
text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings/overrides"); text: catalog.i18nc("@action:inmenu menubar:profile","&Update profile with current settings/overrides")
onTriggered: Cura.ContainerManager.updateQualityChanges(); onTriggered: Cura.ContainerManager.updateQualityChanges()
} }
Action Action
{ {
id: resetProfileAction; id: resetProfileAction
enabled: Cura.MachineManager.hasUserSettings enabled: Cura.MachineManager.hasUserSettings
text: catalog.i18nc("@action:inmenu menubar:profile", "&Discard current changes"); text: catalog.i18nc("@action:inmenu menubar:profile", "&Discard current changes")
onTriggered: onTriggered:
{ {
forceActiveFocus(); forceActiveFocus()
Cura.ContainerManager.clearUserContainers(); Cura.ContainerManager.clearUserContainers()
} }
} }
Action Action
{ {
id: addProfileAction; id: addProfileAction
enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings
text: catalog.i18nc("@action:inmenu menubar:profile", "&Create profile from current settings/overrides..."); text: catalog.i18nc("@action:inmenu menubar:profile", "&Create profile from current settings/overrides...")
} }
Action Action
{ {
id: manageProfilesAction id: manageProfilesAction
text: catalog.i18nc("@action:inmenu menubar:profile", "Manage Profiles...") text: catalog.i18nc("@action:inmenu menubar:profile", "Manage Profiles...")
iconName: "configure" icon.name: "configure"
shortcut: "Ctrl+J" shortcut: "Ctrl+J"
} }
Action Action
{ {
id: documentationAction; id: documentationAction
text: catalog.i18nc("@action:inmenu menubar:help", "Show Online &Documentation"); text: catalog.i18nc("@action:inmenu menubar:help", "Show Online &Documentation")
iconName: "help-contents"; icon.name: "help-contents"
shortcut: StandardKey.Help; shortcut: StandardKey.Help
onTriggered: CuraActions.openDocumentation(); onTriggered: CuraActions.openDocumentation()
} }
Action { Action {
id: reportBugAction; id: reportBugAction
text: catalog.i18nc("@action:inmenu menubar:help", "Report a &Bug"); text: catalog.i18nc("@action:inmenu menubar:help", "Report a &Bug")
iconName: "tools-report-bug"; icon.name: "tools-report-bug"
onTriggered: CuraActions.openBugReportPage(); onTriggered: CuraActions.openBugReportPage()
} }
Action Action
{ {
id: whatsNewAction; id: whatsNewAction
text: catalog.i18nc("@action:inmenu menubar:help", "What's New"); text: catalog.i18nc("@action:inmenu menubar:help", "What's New")
} }
Action Action
{ {
id: aboutAction; id: aboutAction
//On MacOS, don't translate the "About" word. //On MacOS, don't translate the "About" word.
//Qt moves the "about" entry to a different place, and if it got renamed can't find it again when it //Qt moves the "about" entry to a different place, and if it got renamed can't find it again when it
@ -286,60 +285,60 @@ Item
//For more information, see: //For more information, see:
//- https://doc.qt.io/qt-5/macos-issues.html#menu-bar //- https://doc.qt.io/qt-5/macos-issues.html#menu-bar
//- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar //- https://doc.qt.io/qt-5/qmenubar.html#qmenubar-as-a-global-menu-bar
text: (Qt.platform.os == "osx") ? "About..." : catalog.i18nc("@action:inmenu menubar:help", "About..."); text: (Qt.platform.os == "osx") ? "About..." : catalog.i18nc("@action:inmenu menubar:help", "About...")
iconName: "help-about"; icon.name: "help-about"
} }
Action Action
{ {
id: deleteSelectionAction; id: deleteSelectionAction
text: catalog.i18nc("@action:inmenu menubar:edit", "Delete Selected"); text: catalog.i18nc("@action:inmenu menubar:edit", "Delete Selected")
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
iconName: "edit-delete"; icon.name: "edit-delete"
shortcut: StandardKey.Delete | "Backspace" shortcut: StandardKey.Delete | "Backspace"
onTriggered: CuraActions.deleteSelection(); onTriggered: CuraActions.deleteSelection()
} }
Action Action
{ {
id: centerSelectionAction; id: centerSelectionAction
text: catalog.i18nc("@action:inmenu menubar:edit", "Center Selected"); text: catalog.i18nc("@action:inmenu menubar:edit", "Center Selected")
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
iconName: "align-vertical-center"; icon.name: "align-vertical-center"
onTriggered: CuraActions.centerSelection(); onTriggered: CuraActions.centerSelection()
} }
Action Action
{ {
id: multiplySelectionAction; id: multiplySelectionAction
text: catalog.i18nc("@action:inmenu menubar:edit", "Multiply Selected"); text: catalog.i18nc("@action:inmenu menubar:edit", "Multiply Selected")
enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection; enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
iconName: "edit-duplicate"; icon.name: "edit-duplicate"
shortcut: "Ctrl+M" shortcut: "Ctrl+M"
} }
Action Action
{ {
id: deleteObjectAction; id: deleteObjectAction
text: catalog.i18nc("@action:inmenu","Delete Model"); text: catalog.i18nc("@action:inmenu","Delete Model")
enabled: UM.Controller.toolsEnabled; enabled: UM.Controller.toolsEnabled
iconName: "edit-delete"; icon.name: "edit-delete"
} }
Action Action
{ {
id: centerObjectAction; id: centerObjectAction
text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform"); text: catalog.i18nc("@action:inmenu","Ce&nter Model on Platform")
} }
Action Action
{ {
id: groupObjectsAction id: groupObjectsAction
text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models"); text: catalog.i18nc("@action:inmenu menubar:edit","&Group Models")
enabled: UM.Selection.selectionCount > 1 ? true: false enabled: UM.Selection.selectionCount > 1 ? true: false
iconName: "object-group" icon.name: "object-group"
shortcut: "Ctrl+G"; shortcut: "Ctrl+G"
onTriggered: CuraApplication.groupSelected(); onTriggered: CuraApplication.groupSelected()
} }
Action Action
@ -355,132 +354,132 @@ Item
Action Action
{ {
id: unGroupObjectsAction id: unGroupObjectsAction
text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models"); text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Models")
enabled: UM.Selection.isGroupSelected enabled: UM.Selection.isGroupSelected
iconName: "object-ungroup" icon.name: "object-ungroup"
shortcut: "Ctrl+Shift+G"; shortcut: "Ctrl+Shift+G"
onTriggered: CuraApplication.ungroupSelected(); onTriggered: CuraApplication.ungroupSelected()
} }
Action Action
{ {
id: mergeObjectsAction id: mergeObjectsAction
text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models"); text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Models")
enabled: UM.Selection.selectionCount > 1 ? true: false enabled: UM.Selection.selectionCount > 1 ? true: false
iconName: "merge"; icon.name: "merge"
shortcut: "Ctrl+Alt+G"; shortcut: "Ctrl+Alt+G"
onTriggered: CuraApplication.mergeSelected(); onTriggered: CuraApplication.mergeSelected()
} }
Action Action
{ {
id: multiplyObjectAction; id: multiplyObjectAction
text: catalog.i18nc("@action:inmenu","&Multiply Model..."); text: catalog.i18nc("@action:inmenu","&Multiply Model...")
iconName: "edit-duplicate" icon.name: "edit-duplicate"
} }
Action Action
{ {
id: selectAllAction; id: selectAllAction
text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models"); text: catalog.i18nc("@action:inmenu menubar:edit","Select All Models")
enabled: UM.Controller.toolsEnabled; enabled: UM.Controller.toolsEnabled
iconName: "edit-select-all"; icon.name: "edit-select-all"
shortcut: "Ctrl+A"; shortcut: "Ctrl+A"
onTriggered: CuraApplication.selectAll(); onTriggered: CuraApplication.selectAll()
} }
Action Action
{ {
id: deleteAllAction; id: deleteAllAction
text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate"); text: catalog.i18nc("@action:inmenu menubar:edit","Clear Build Plate")
enabled: UM.Controller.toolsEnabled; enabled: UM.Controller.toolsEnabled
iconName: "edit-delete"; icon.name: "edit-delete"
shortcut: "Ctrl+D"; shortcut: "Ctrl+D"
onTriggered: CuraApplication.deleteAll(); onTriggered: CuraApplication.deleteAll()
} }
Action Action
{ {
id: reloadAllAction; id: reloadAllAction
text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models"); text: catalog.i18nc("@action:inmenu menubar:file","Reload All Models")
iconName: "document-revert"; icon.name: "document-revert"
shortcut: "F5" shortcut: "F5"
onTriggered: CuraApplication.reloadAll(); onTriggered: CuraApplication.reloadAll()
} }
Action Action
{ {
id: arrangeAllBuildPlatesAction; id: arrangeAllBuildPlatesAction
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates"); text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models To All Build Plates")
onTriggered: Printer.arrangeObjectsToAllBuildPlates(); onTriggered: Printer.arrangeObjectsToAllBuildPlates()
} }
Action Action
{ {
id: arrangeAllAction; id: arrangeAllAction
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models"); text: catalog.i18nc("@action:inmenu menubar:edit","Arrange All Models")
onTriggered: Printer.arrangeAll(); onTriggered: Printer.arrangeAll()
shortcut: "Ctrl+R"; shortcut: "Ctrl+R"
} }
Action Action
{ {
id: arrangeSelectionAction; id: arrangeSelectionAction
text: catalog.i18nc("@action:inmenu menubar:edit","Arrange Selection"); text: catalog.i18nc("@action:inmenu menubar:edit","Arrange Selection")
onTriggered: Printer.arrangeSelection(); onTriggered: Printer.arrangeSelection()
} }
Action Action
{ {
id: resetAllTranslationAction; id: resetAllTranslationAction
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions"); text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Positions")
onTriggered: CuraApplication.resetAllTranslation(); onTriggered: CuraApplication.resetAllTranslation()
} }
Action Action
{ {
id: resetAllAction; id: resetAllAction
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations"); text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Model Transformations")
onTriggered: CuraApplication.resetAll(); onTriggered: CuraApplication.resetAll()
} }
Action Action
{ {
id: openAction; id: openAction
property var fileProviderModel: CuraApplication.getFileProviderModel() property var fileProviderModel: CuraApplication.getFileProviderModel()
text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)..."); text: catalog.i18nc("@action:inmenu menubar:file","&Open File(s)...")
iconName: "document-open"; icon.name: "document-open"
// Unassign the shortcut when there are more than one file providers, since then the file provider's shortcut is // Unassign the shortcut when there are more than one file providers, since then the file provider's shortcut is
// enabled instead, and Ctrl+O is assigned to the local file provider // enabled instead, and Ctrl+O is assigned to the local file provider
shortcut: fileProviderModel.count == 1 ? StandardKey.Open : ""; shortcut: fileProviderModel.count == 1 ? StandardKey.Open : ""
} }
Action Action
{ {
id: newProjectAction id: newProjectAction
text: catalog.i18nc("@action:inmenu menubar:file","&New Project..."); text: catalog.i18nc("@action:inmenu menubar:file","&New Project...")
shortcut: StandardKey.New shortcut: StandardKey.New
} }
Action Action
{ {
id: showProfileFolderAction; id: showProfileFolderAction
text: catalog.i18nc("@action:inmenu menubar:help","Show Configuration Folder"); text: catalog.i18nc("@action:inmenu menubar:help","Show Configuration Folder")
} }
Action Action
{ {
id: configureSettingVisibilityAction id: configureSettingVisibilityAction
text: catalog.i18nc("@action:menu", "Configure setting visibility..."); text: catalog.i18nc("@action:menu", "Configure setting visibility...")
iconName: "configure" icon.name: "configure"
} }
Action Action
{ {
id: browsePackagesAction id: browsePackagesAction
text: catalog.i18nc("@action:menu", "&Marketplace") text: catalog.i18nc("@action:menu", "&Marketplace")
iconName: "plugins_browse" icon.name: "plugins_browse"
} }
} }

View file

@ -6,8 +6,8 @@ import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import QtQuick.Controls 2.15 as NewControls
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
import "Dialogs" import "Dialogs"
@ -160,7 +160,6 @@ UM.MainWindow
ApplicationMenu ApplicationMenu
{ {
id: applicationMenu id: applicationMenu
window: base
} }
Item Item

View file

@ -2,11 +2,10 @@
// 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
import QtQuick.Controls 1.4 import QtQuick.Controls 2.4
import QtQuick.Layouts 1.1
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import UM 1.3 as UM import UM 1.5 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
import "../Menus" import "../Menus"
@ -17,13 +16,48 @@ Item
id: menu id: menu
width: applicationMenu.width width: applicationMenu.width
height: applicationMenu.height height: applicationMenu.height
property alias window: applicationMenu.window
UM.ApplicationMenu Component
{
id: menuBarComponent
MenuBarItem
{
id: menuBarItem
function replaceText(txt)
{
var index = txt.indexOf("&")
if(index >= 0)
{
txt = txt.replace(txt.substr(index, 2), ("<u>" + txt.substr(index + 1, 1) +"</u>"))
}
return txt
}
contentItem: Label {
text: replaceText(menuBarItem.text)
color: "white"
verticalAlignment: Text.AlignVCenter
textFormat: Text.RichText
}
}
}
MenuBar
{
id: applicationMenu
delegate: menuBarComponent
FileMenu {}
EditMenu {}
ViewMenu {}
}
/*UM.ApplicationMenu
{ {
id: applicationMenu id: applicationMenu
FileMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&File") } //FileMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&File") }
Menu Menu
{ {
@ -126,9 +160,10 @@ Item
MenuItem { action: Cura.Actions.whatsNew } MenuItem { action: Cura.Actions.whatsNew }
MenuItem { action: Cura.Actions.about } MenuItem { action: Cura.Actions.about }
} }
} }*/
Component
/*Component
{ {
id: extensionsMenuItem id: extensionsMenuItem
@ -214,5 +249,5 @@ Item
curaExtensions.callExtensionMethod("Toolbox", "launch") curaExtensions.callExtensionMethod("Toolbox", "launch")
curaExtensions.callExtensionMethod("Toolbox", "setViewCategoryToMaterials") curaExtensions.callExtensionMethod("Toolbox", "setViewCategoryToMaterials")
} }
} }*/
} }

View file

@ -0,0 +1,28 @@
// Copyright (c) 2022 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 2.1
import UM 1.6 as UM
import Cura 1.0 as Cura
Menu
{
title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit")
UM.MenuItem { action: Cura.Actions.undo }
UM.MenuItem { action: Cura.Actions.redo }
MenuSeparator { }
UM.MenuItem { action: Cura.Actions.selectAll }
UM.MenuItem { action: Cura.Actions.arrangeAll }
UM.MenuItem { action: Cura.Actions.multiplySelection }
UM.MenuItem { action: Cura.Actions.deleteSelection }
UM.MenuItem { action: Cura.Actions.deleteAll }
UM.MenuItem { action: Cura.Actions.resetAllTranslation }
UM.MenuItem { action: Cura.Actions.resetAll }
MenuSeparator { }
UM.MenuItem { action: Cura.Actions.groupObjects }
UM.MenuItem { action: Cura.Actions.mergeObjects }
UM.MenuItem { action: Cura.Actions.unGroupObjects }
}

View file

@ -1,8 +1,8 @@
// Copyright (c) 2018 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.1
import UM 1.6 as UM import UM 1.6 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -13,31 +13,34 @@ Menu
title: catalog.i18nc("@title:menu menubar:toplevel", "&File") title: catalog.i18nc("@title:menu menubar:toplevel", "&File")
property var fileProviderModel: CuraApplication.getFileProviderModel() property var fileProviderModel: CuraApplication.getFileProviderModel()
MenuItem
UM.MenuItem
{ {
id: newProjectMenu id: newProjectMenu
action: Cura.Actions.newProject action: Cura.Actions.newProject
} }
MenuItem UM.MenuItem
{ {
id: openMenu id: openMenu
action: Cura.Actions.open action: Cura.Actions.open
visible: (base.fileProviderModel.count == 1) visible: base.fileProviderModel.count == 1
height: visible ? implicitHeight: 0
} }
OpenFilesMenu OpenFilesMenu
{ {
id: openFilesMenu id: openFilesMenu
visible: (base.fileProviderModel.count > 1)
shouldBeVisible: base.fileProviderModel.count > 1
} }
RecentFilesMenu { } RecentFilesMenu { }
MenuItem UM.MenuItem
{ {
id: saveWorkspaceMenu id: saveWorkspaceMenu
shortcut: visible ? StandardKey.Save : "" shortcut: StandardKey.Save
text: catalog.i18nc("@title:menu menubar:file", "&Save Project...") text: catalog.i18nc("@title:menu menubar:file", "&Save Project...")
visible: saveProjectMenu.model.count == 1 visible: saveProjectMenu.model.count == 1
enabled: UM.WorkspaceFileHandler.enabled enabled: UM.WorkspaceFileHandler.enabled
@ -62,13 +65,13 @@ Menu
{ {
id: saveProjectMenu id: saveProjectMenu
model: projectOutputDevicesModel model: projectOutputDevicesModel
visible: model.count > 1 shouldBeVisible: model.count > 1
enabled: UM.WorkspaceFileHandler.enabled enabled: UM.WorkspaceFileHandler.enabled
} }
MenuSeparator { } MenuSeparator { }
MenuItem UM.MenuItem
{ {
id: saveAsMenu id: saveAsMenu
text: catalog.i18nc("@title:menu menubar:file", "&Export...") text: catalog.i18nc("@title:menu menubar:file", "&Export...")
@ -79,18 +82,18 @@ Menu
} }
} }
MenuItem UM.MenuItem
{ {
id: exportSelectionMenu id: exportSelectionMenu
text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...") text: catalog.i18nc("@action:inmenu menubar:file", "Export Selection...")
enabled: UM.Selection.hasSelection enabled: UM.Selection.hasSelection
iconName: "document-save-as" icon.name: "document-save-as"
onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"}) onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file", PrintInformation.jobName, { "filter_by_machine": false, "preferred_mimetypes": "application/vnd.ms-package.3dmanufacturing-3dmodel+xml"})
} }
MenuSeparator { } MenuSeparator { }
MenuItem UM.MenuItem
{ {
id: reloadAllMenu id: reloadAllMenu
action: Cura.Actions.reloadAll action: Cura.Actions.reloadAll
@ -98,5 +101,5 @@ Menu
MenuSeparator { } MenuSeparator { }
MenuItem { action: Cura.Actions.quit } UM.MenuItem { action: Cura.Actions.quit }
} }

View file

@ -1,25 +1,24 @@
// Copyright (c) 2020 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.1
import UM 1.6 as UM import UM 1.6 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
import "../Dialogs" import "../Dialogs"
Menu UM.Menu
{ {
id: openFilesMenu id: openFilesMenu
title: catalog.i18nc("@title:menu menubar:file", "Open File(s)...") title: catalog.i18nc("@title:menu menubar:file", "Open File(s)...")
iconName: "document-open-recent";
Instantiator Instantiator
{ {
id: fileProviders id: fileProviders
model: CuraApplication.getFileProviderModel() model: CuraApplication.getFileProviderModel()
MenuItem UM.MenuItem
{ {
text: text:
{ {
@ -39,6 +38,7 @@ Menu
// Unassign the shortcuts when the submenu is invisible (i.e. when there is only one file provider) to avoid ambiguous shortcuts. // Unassign the shortcuts when the submenu is invisible (i.e. when there is only one file provider) to avoid ambiguous shortcuts.
// When there is a single file provider, the openAction is assigned with the Ctrl+O shortcut instead. // When there is a single file provider, the openAction is assigned with the Ctrl+O shortcut instead.
shortcut: openFilesMenu.visible ? model.shortcut : "" shortcut: openFilesMenu.visible ? model.shortcut : ""
visible: openFilesMenu.visible
} }
onObjectAdded: openFilesMenu.insertItem(index, object) onObjectAdded: openFilesMenu.insertItem(index, object)
onObjectRemoved: openFilesMenu.removeItem(object) onObjectRemoved: openFilesMenu.removeItem(object)

View file

@ -1,8 +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.1
import UM 1.3 as UM import UM 1.3 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
@ -13,7 +13,7 @@ Menu
{ {
id: menu id: menu
title: catalog.i18nc("@title:menu menubar:file", "Open &Recent") title: catalog.i18nc("@title:menu menubar:file", "Open &Recent")
iconName: "document-open-recent"; //iconName: "document-open-recent";
enabled: CuraApplication.recentFiles.length > 0; enabled: CuraApplication.recentFiles.length > 0;

View file

@ -1,15 +1,15 @@
// 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.1
import UM 1.6 as UM import UM 1.6 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
import "../Dialogs" import "../Dialogs"
Menu UM.Menu
{ {
id: saveProjectMenu id: saveProjectMenu
title: catalog.i18nc("@title:menu menubar:file", "Save Project...") title: catalog.i18nc("@title:menu menubar:file", "Save Project...")
@ -18,7 +18,7 @@ Menu
Instantiator Instantiator
{ {
id: projectOutputDevices id: projectOutputDevices
MenuItem UM.MenuItem
{ {
text: model.name text: model.name
onTriggered: onTriggered:

View file

@ -2,33 +2,34 @@
// 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.1
import UM 1.2 as UM import UM 1.5 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
Menu Menu
{ {
title: catalog.i18nc("@title:menu menubar:toplevel", "&View")
id: base id: base
title: catalog.i18nc("@title:menu menubar:toplevel", "&View")
property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel()
Menu Menu
{ {
title: catalog.i18nc("@action:inmenu menubar:view","&Camera position"); title: catalog.i18nc("@action:inmenu menubar:view", "&Camera position")
MenuItem { action: Cura.Actions.view3DCamera; } UM.MenuItem { action: Cura.Actions.view3DCamera }
MenuItem { action: Cura.Actions.viewFrontCamera; } UM.MenuItem { action: Cura.Actions.viewFrontCamera }
MenuItem { action: Cura.Actions.viewTopCamera; } UM.MenuItem { action: Cura.Actions.viewTopCamera }
MenuItem { action: Cura.Actions.viewBottomCamera; } UM.MenuItem { action: Cura.Actions.viewBottomCamera }
MenuItem { action: Cura.Actions.viewLeftSideCamera; } UM.MenuItem { action: Cura.Actions.viewLeftSideCamera }
MenuItem { action: Cura.Actions.viewRightSideCamera; } UM.MenuItem { action: Cura.Actions.viewRightSideCamera }
} }
Menu Menu
{ {
id: cameraViewMenu id: cameraViewMenu
title: catalog.i18nc("@action:inmenu menubar:view","Camera view")
property string cameraMode: UM.Preferences.getValue("general/camera_perspective_mode") property string cameraMode: UM.Preferences.getValue("general/camera_perspective_mode")
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
@ -42,7 +43,6 @@ Menu
} }
} }
title: catalog.i18nc("@action:inmenu menubar:view","Camera view")
MenuItem MenuItem
{ {
text: catalog.i18nc("@action:inmenu menubar:view", "Perspective") text: catalog.i18nc("@action:inmenu menubar:view", "Perspective")
@ -52,8 +52,9 @@ Menu
{ {
UM.Preferences.setValue("general/camera_perspective_mode", "perspective") UM.Preferences.setValue("general/camera_perspective_mode", "perspective")
} }
exclusiveGroup: group //exclusiveGroup: group
} }
MenuItem MenuItem
{ {
text: catalog.i18nc("@action:inmenu menubar:view", "Orthographic") text: catalog.i18nc("@action:inmenu menubar:view", "Orthographic")
@ -63,45 +64,14 @@ Menu
{ {
UM.Preferences.setValue("general/camera_perspective_mode", "orthographic") UM.Preferences.setValue("general/camera_perspective_mode", "orthographic")
} }
exclusiveGroup: group //exclusiveGroup: group
}
ExclusiveGroup { id: group }
}
MenuSeparator
{
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
Menu
{
id: buildPlateMenu;
title: catalog.i18nc("@action:inmenu menubar:view","&Build plate")
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
Instantiator
{
model: base.multiBuildPlateModel
MenuItem
{
text: base.multiBuildPlateModel.getItem(index).name;
onTriggered: Cura.SceneController.setActiveBuildPlate(base.multiBuildPlateModel.getItem(index).buildPlateNumber)
checkable: true
checked: base.multiBuildPlateModel.getItem(index).buildPlateNumber == base.multiBuildPlateModel.activeBuildPlate
exclusiveGroup: buildPlateGroup
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
}
onObjectAdded: buildPlateMenu.insertItem(index, object)
onObjectRemoved: buildPlateMenu.removeItem(object)
}
ExclusiveGroup
{
id: buildPlateGroup
} }
//ExclusiveGroup { id: group }
} }
MenuSeparator {} MenuSeparator {}
MenuItem UM.MenuItem
{ {
action: Cura.Actions.toggleFullScreen action: Cura.Actions.toggleFullScreen
} }