mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-07 05:53:59 -06: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
1 changed files with 16 additions and 0 deletions
|
@ -62,6 +62,8 @@ Item
|
|||
text: catalog.i18nc("@action:inmenu menubar:edit","&Undo");
|
||||
iconName: "edit-undo";
|
||||
shortcut: StandardKey.Undo;
|
||||
onTriggered: UM.OperationStack.undo();
|
||||
enabled: UM.OperationStack.canUndo;
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -70,6 +72,8 @@ Item
|
|||
text: catalog.i18nc("@action:inmenu menubar:edit","&Redo");
|
||||
iconName: "edit-redo";
|
||||
shortcut: StandardKey.Redo;
|
||||
onTriggered: UM.OperationStack.redo();
|
||||
enabled: UM.OperationStack.canRedo;
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -105,6 +109,7 @@ Item
|
|||
id: updateProfileAction;
|
||||
enabled: UM.ActiveProfile.valid && !UM.ActiveProfile.readOnly && UM.ActiveProfile.hasCustomisedValues
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile","&Update Current Profile");
|
||||
onTriggered: UM.ActiveProfile.updateProfile();
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -112,6 +117,7 @@ Item
|
|||
id: resetProfileAction;
|
||||
enabled: UM.ActiveProfile.valid && UM.ActiveProfile.hasCustomisedValues
|
||||
text: catalog.i18nc("@action:inmenu menubar:profile","&Reload Current Profile");
|
||||
onTriggered: UM.ActiveProfile.discardChanges();
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -134,12 +140,14 @@ Item
|
|||
text: catalog.i18nc("@action:inmenu menubar:help","Show Online &Documentation");
|
||||
iconName: "help-contents";
|
||||
shortcut: StandardKey.Help;
|
||||
onTriggered: CuraActions.openDocumentation();
|
||||
}
|
||||
|
||||
Action {
|
||||
id: reportBugAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:help","Report a &Bug");
|
||||
iconName: "tools-report-bug";
|
||||
onTriggered: CuraActions.openBugReportPage();
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -156,6 +164,7 @@ Item
|
|||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-delete";
|
||||
shortcut: StandardKey.Delete;
|
||||
onTriggered: Printer.deleteSelection();
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -178,6 +187,7 @@ Item
|
|||
text: catalog.i18nc("@action:inmenu menubar:edit","&Group Objects");
|
||||
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
||||
iconName: "object-group"
|
||||
onTriggered: Printer.groupSelected();
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -186,6 +196,7 @@ Item
|
|||
text: catalog.i18nc("@action:inmenu menubar:edit","Ungroup Objects");
|
||||
enabled: UM.Scene.isGroupSelected
|
||||
iconName: "object-ungroup"
|
||||
onTriggered: Printer.ungroupSelected();
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -194,6 +205,7 @@ Item
|
|||
text: catalog.i18nc("@action:inmenu menubar:edit","&Merge Objects");
|
||||
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
||||
iconName: "merge";
|
||||
onTriggered: Printer.mergeSelected();
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -210,6 +222,7 @@ Item
|
|||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-delete";
|
||||
shortcut: "Ctrl+D";
|
||||
onTriggered: Printer.deleteAll();
|
||||
}
|
||||
|
||||
Action
|
||||
|
@ -217,18 +230,21 @@ Item
|
|||
id: reloadAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:file","Re&load All Objects");
|
||||
iconName: "document-revert";
|
||||
onTriggered: Printer.reloadAll();
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: resetAllTranslationAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Object Positions");
|
||||
onTriggered: Printer.resetAllTranslation();
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: resetAllAction;
|
||||
text: catalog.i18nc("@action:inmenu menubar:edit","Reset All Object &Transformations");
|
||||
onTriggered: Printer.resetAll();
|
||||
}
|
||||
|
||||
Action
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue