diff --git a/resources/qml/MainWindow/ApplicationMenu.qml b/resources/qml/MainWindow/ApplicationMenu.qml index aa6fb803c3..7d52a1c588 100644 --- a/resources/qml/MainWindow/ApplicationMenu.qml +++ b/resources/qml/MainWindow/ApplicationMenu.qml @@ -66,142 +66,19 @@ Item ExtensionMenu {} + PreferencesMenu {} + + HelpMenu {} + } - /*UM.ApplicationMenu - { - id: applicationMenu - - //FileMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&File") } - - Menu - { - title: catalog.i18nc("@title:menu menubar:toplevel", "&Edit") - - MenuItem { action: Cura.Actions.undo } - MenuItem { action: Cura.Actions.redo } - MenuSeparator { } - MenuItem { action: Cura.Actions.selectAll } - MenuItem { action: Cura.Actions.arrangeAll } - MenuItem { action: Cura.Actions.multiplySelection } - MenuItem { action: Cura.Actions.deleteSelection } - MenuItem { action: Cura.Actions.deleteAll } - MenuItem { action: Cura.Actions.resetAllTranslation } - MenuItem { action: Cura.Actions.resetAll } - MenuSeparator { } - MenuItem { action: Cura.Actions.groupObjects } - MenuItem { action: Cura.Actions.mergeObjects } - MenuItem { action: Cura.Actions.unGroupObjects } - } - - ViewMenu { title: catalog.i18nc("@title:menu menubar:toplevel", "&View") } - - SettingsMenu - { - //On MacOS, don't translate the "Settings" word. - //Qt moves the "settings" entry to a different place, and if it got renamed can't find it again when it - //attempts to delete the item upon closing the application, causing a crash. - //In the new location, these items are translated automatically according to the system's language. - //For more information, see: - //- 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 - title: (Qt.platform.os == "osx") ? "&Settings" : catalog.i18nc("@title:menu menubar:toplevel", "&Settings") - } - - Menu - { - id: extensionMenu - title: catalog.i18nc("@title:menu menubar:toplevel", "E&xtensions") - - Instantiator - { - id: extensions - model: UM.ExtensionModel { } - - Menu - { - id: sub_menu - title: model.name; - visible: actions != null - enabled: actions != null - Instantiator - { - model: actions - Loader - { - property var extensionsModel: extensions.model - property var modelText: model.text - property var extensionName: name - - sourceComponent: modelText.trim() == "" ? extensionsMenuSeparator : extensionsMenuItem - } - - onObjectAdded: sub_menu.insertItem(index, object.item) - onObjectRemoved: sub_menu.removeItem(object.item) - } - } - - onObjectAdded: extensionMenu.insertItem(index, object) - onObjectRemoved: extensionMenu.removeItem(object) - } - } - - Menu - { - id: preferencesMenu - - //On MacOS, don't translate the "Preferences" word. - //Qt moves the "preferences" entry to a different place, and if it got renamed can't find it again when it - //attempts to delete the item upon closing the application, causing a crash. - //In the new location, these items are translated automatically according to the system's language. - //For more information, see: - //- 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 - title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references") - - MenuItem { action: Cura.Actions.preferences } - } - - Menu - { - id: helpMenu - title: catalog.i18nc("@title:menu menubar:toplevel", "&Help") - - MenuItem { action: Cura.Actions.showProfileFolder } - MenuItem { action: Cura.Actions.showTroubleshooting} - MenuItem { action: Cura.Actions.documentation } - MenuItem { action: Cura.Actions.reportBug } - MenuSeparator { } - MenuItem { action: Cura.Actions.whatsNew } - MenuItem { action: Cura.Actions.about } - } - }*/ - - - /*Component - { - id: extensionsMenuItem - - MenuItem - { - text: modelText - onTriggered: extensionsModel.subMenuTriggered(extensionName, modelText) - } - } - - Component - { - id: extensionsMenuSeparator - - MenuSeparator {} - } // ############################################################################################### // Definition of other components that are linked to the menus // ############################################################################################### - WorkspaceSummaryDialog + /*WorkspaceSummaryDialog { id: saveWorkspaceDialog property var args diff --git a/resources/qml/Menus/HelpMenu.qml b/resources/qml/Menus/HelpMenu.qml new file mode 100644 index 0000000000..d90fec57bc --- /dev/null +++ b/resources/qml/Menus/HelpMenu.qml @@ -0,0 +1,23 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.4 + +import UM 1.5 as UM +import Cura 1.0 as Cura + + +Menu +{ + id: helpMenu + title: catalog.i18nc("@title:menu menubar:toplevel", "&Help") + + UM.MenuItem { action: Cura.Actions.showProfileFolder } + UM.MenuItem { action: Cura.Actions.showTroubleshooting} + UM.MenuItem { action: Cura.Actions.documentation } + UM.MenuItem { action: Cura.Actions.reportBug } + MenuSeparator { } + UM.MenuItem { action: Cura.Actions.whatsNew } + UM.MenuItem { action: Cura.Actions.about } +} \ No newline at end of file diff --git a/resources/qml/Menus/PreferencesMenu.qml b/resources/qml/Menus/PreferencesMenu.qml new file mode 100644 index 0000000000..8b5e8fbcd5 --- /dev/null +++ b/resources/qml/Menus/PreferencesMenu.qml @@ -0,0 +1,25 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.7 +import QtQuick.Controls 2.4 + +import UM 1.5 as UM +import Cura 1.0 as Cura + +Menu +{ + id: preferencesMenu + + //On MacOS, don't translate the "Preferences" word. + //Qt moves the "preferences" entry to a different place, and if it got renamed can't find it again when it + //attempts to delete the item upon closing the application, causing a crash. + //In the new location, these items are translated automatically according to the system's language. + //For more information, see: + //- 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 + title: (Qt.platform.os == "osx") ? "&Preferences" : catalog.i18nc("@title:menu menubar:toplevel", "P&references") + + UM.MenuItem { action: Cura.Actions.preferences } +} +