mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-28 03:13:15 +08:00
Directly implement onTriggered in Actions for several actions
Since they use global objects we can directly call those methods. This makes it simpler to call these actions from other objects.
This commit is contained in:
parent
5e226038d9
commit
8c5b3c8b1d
@ -62,6 +62,8 @@ Item
|
|||||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Undo");
|
text: catalog.i18nc("@action:inmenu menubar:edit","&Undo");
|
||||||
iconName: "edit-undo";
|
iconName: "edit-undo";
|
||||||
shortcut: StandardKey.Undo;
|
shortcut: StandardKey.Undo;
|
||||||
|
onTriggered: UM.OperationStack.undo();
|
||||||
|
enabled: UM.OperationStack.canUndo;
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -70,6 +72,8 @@ Item
|
|||||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Redo");
|
text: catalog.i18nc("@action:inmenu menubar:edit","&Redo");
|
||||||
iconName: "edit-redo";
|
iconName: "edit-redo";
|
||||||
shortcut: StandardKey.Redo;
|
shortcut: StandardKey.Redo;
|
||||||
|
onTriggered: UM.OperationStack.redo();
|
||||||
|
enabled: UM.OperationStack.canRedo;
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -105,6 +109,7 @@ Item
|
|||||||
id: updateProfileAction;
|
id: updateProfileAction;
|
||||||
enabled: UM.ActiveProfile.valid && !UM.ActiveProfile.readOnly && UM.ActiveProfile.hasCustomisedValues
|
enabled: UM.ActiveProfile.valid && !UM.ActiveProfile.readOnly && UM.ActiveProfile.hasCustomisedValues
|
||||||
text: catalog.i18nc("@action:inmenu menubar:profile","&Update Current Profile");
|
text: catalog.i18nc("@action:inmenu menubar:profile","&Update Current Profile");
|
||||||
|
onTriggered: UM.ActiveProfile.updateProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -112,6 +117,7 @@ Item
|
|||||||
id: resetProfileAction;
|
id: resetProfileAction;
|
||||||
enabled: UM.ActiveProfile.valid && UM.ActiveProfile.hasCustomisedValues
|
enabled: UM.ActiveProfile.valid && UM.ActiveProfile.hasCustomisedValues
|
||||||
text: catalog.i18nc("@action:inmenu menubar:profile","&Reload Current Profile");
|
text: catalog.i18nc("@action:inmenu menubar:profile","&Reload Current Profile");
|
||||||
|
onTriggered: UM.ActiveProfile.discardChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -134,12 +140,14 @@ Item
|
|||||||
text: catalog.i18nc("@action:inmenu menubar:help","Show Online &Documentation");
|
text: catalog.i18nc("@action:inmenu menubar:help","Show Online &Documentation");
|
||||||
iconName: "help-contents";
|
iconName: "help-contents";
|
||||||
shortcut: StandardKey.Help;
|
shortcut: StandardKey.Help;
|
||||||
|
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";
|
iconName: "tools-report-bug";
|
||||||
|
onTriggered: CuraActions.openBugReportPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -156,6 +164,7 @@ Item
|
|||||||
enabled: UM.Controller.toolsEnabled;
|
enabled: UM.Controller.toolsEnabled;
|
||||||
iconName: "edit-delete";
|
iconName: "edit-delete";
|
||||||
shortcut: StandardKey.Delete;
|
shortcut: StandardKey.Delete;
|
||||||
|
onTriggered: Printer.deleteSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -178,6 +187,7 @@ Item
|
|||||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Group Objects");
|
text: catalog.i18nc("@action:inmenu menubar:edit","&Group Objects");
|
||||||
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
||||||
iconName: "object-group"
|
iconName: "object-group"
|
||||||
|
onTriggered: Printer.groupSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -186,6 +196,7 @@ Item
|
|||||||
text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Objects");
|
text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Objects");
|
||||||
enabled: UM.Scene.isGroupSelected
|
enabled: UM.Scene.isGroupSelected
|
||||||
iconName: "object-ungroup"
|
iconName: "object-ungroup"
|
||||||
|
onTriggered: Printer.ungroupSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -194,6 +205,7 @@ Item
|
|||||||
text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Objects");
|
text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Objects");
|
||||||
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
||||||
iconName: "merge";
|
iconName: "merge";
|
||||||
|
onTriggered: Printer.mergeSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -210,6 +222,7 @@ Item
|
|||||||
enabled: UM.Controller.toolsEnabled;
|
enabled: UM.Controller.toolsEnabled;
|
||||||
iconName: "edit-delete";
|
iconName: "edit-delete";
|
||||||
shortcut: "Ctrl+D";
|
shortcut: "Ctrl+D";
|
||||||
|
onTriggered: Printer.deleteAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
@ -217,18 +230,21 @@ Item
|
|||||||
id: reloadAllAction;
|
id: reloadAllAction;
|
||||||
text: catalog.i18nc("@action:inmenu menubar:file","Re&load All Objects");
|
text: catalog.i18nc("@action:inmenu menubar:file","Re&load All Objects");
|
||||||
iconName: "document-revert";
|
iconName: "document-revert";
|
||||||
|
onTriggered: Printer.reloadAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: resetAllTranslationAction;
|
id: resetAllTranslationAction;
|
||||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Object Positions");
|
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Object Positions");
|
||||||
|
onTriggered: Printer.resetAllTranslation();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
{
|
{
|
||||||
id: resetAllAction;
|
id: resetAllAction;
|
||||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Object &Transformations");
|
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Object &Transformations");
|
||||||
|
onTriggered: Printer.resetAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
Action
|
Action
|
||||||
|
Loading…
x
Reference in New Issue
Block a user