Browse Source

Added new project option

CURA-3494
Jaime van Kessel 8 years ago
parent
commit
66afc2a391
2 changed files with 21 additions and 0 deletions
  1. 8 0
      resources/qml/Actions.qml
  2. 13 0
      resources/qml/Cura.qml

+ 8 - 0
resources/qml/Actions.qml

@@ -10,6 +10,7 @@ import Cura 1.0 as Cura
 
 Item
 {
+    property alias newProject: newProjectAction;
     property alias open: openAction;
     property alias loadWorkspace: loadWorkspaceAction;
     property alias quit: quitAction;
@@ -288,6 +289,13 @@ Item
         shortcut: StandardKey.Open;
     }
 
+    Action
+    {
+        id: newProjectAction
+        text: catalog.i18nc("@action:inmenu menubar:file","&New Project...");
+        shortcut: StandardKey.New
+    }
+
     Action
     {
         id: loadWorkspaceAction

+ 13 - 0
resources/qml/Cura.qml

@@ -66,6 +66,10 @@ UM.MainWindow
             {
                 id: fileMenu
                 title: catalog.i18nc("@title:menu menubar:toplevel","&File");
+                MenuItem
+                {
+                    action: Cura.Actions.newProject;
+                }
 
                 MenuItem
                 {
@@ -533,6 +537,15 @@ UM.MainWindow
         target: Cura.Actions.preferences
         onTriggered: preferences.visible = true
     }
+    Connections
+    {
+        target: Cura.Actions.newProject
+        onTriggered:
+        {
+            Printer.deleteAll();
+            Cura.Actions.resetProfile.trigger();
+        }
+    }
 
     Connections
     {