Move TopBar to the Skeleton folder.

Clean up the Cura.qml even more by moving some components to the
ApplicationMenu, where they are called.

Contributes to CURA-5784.
This commit is contained in:
Diego Prado Gesto 2018-10-08 10:59:46 +02:00
parent 193f113851
commit 8bdd27183f
4 changed files with 229 additions and 222 deletions

View File

@ -183,7 +183,6 @@ UM.MainWindow
bottom: parent.bottom; bottom: parent.bottom;
left: parent.left; left: parent.left;
} }
} }
Topbar Topbar
@ -340,13 +339,6 @@ UM.MainWindow
} }
} }
WorkspaceSummaryDialog
{
id: saveWorkspaceDialog
property var args
onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args)
}
Connections Connections
{ {
target: Cura.Actions.preferences target: Cura.Actions.preferences
@ -359,33 +351,6 @@ UM.MainWindow
onShowPreferencesWindow: preferences.visible = true onShowPreferencesWindow: preferences.visible = true
} }
MessageDialog
{
id: newProjectDialog
modality: Qt.ApplicationModal
title: catalog.i18nc("@title:window", "New project")
text: catalog.i18nc("@info:question", "Are you sure you want to start a new project? This will clear the build plate and any unsaved settings.")
standardButtons: StandardButton.Yes | StandardButton.No
icon: StandardIcon.Question
onYes:
{
CuraApplication.deleteAll();
Cura.Actions.resetProfile.trigger();
}
}
Connections
{
target: Cura.Actions.newProject
onTriggered:
{
if(Printer.platformActivity || Cura.MachineManager.hasUserSettings)
{
newProjectDialog.visible = true
}
}
}
Connections Connections
{ {
target: Cura.Actions.addProfile target: Cura.Actions.addProfile

View File

@ -11,10 +11,18 @@ import UM 1.3 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
import "../Menus" import "../Menus"
import "../Dialogs"
Item
{
id: menu
width: applicationMenu.width
height: applicationMenu.height
property alias window: applicationMenu.window
UM.ApplicationMenu UM.ApplicationMenu
{ {
id: menu id: applicationMenu
Menu Menu
{ {
@ -232,3 +240,38 @@ UM.ApplicationMenu
MenuItem { action: Cura.Actions.about } MenuItem { action: Cura.Actions.about }
} }
} }
WorkspaceSummaryDialog
{
id: saveWorkspaceDialog
property var args
onYes: UM.OutputDeviceManager.requestWriteToDevice("local_file", PrintInformation.jobName, args)
}
MessageDialog
{
id: newProjectDialog
modality: Qt.ApplicationModal
title: catalog.i18nc("@title:window", "New project")
text: catalog.i18nc("@info:question", "Are you sure you want to start a new project? This will clear the build plate and any unsaved settings.")
standardButtons: StandardButton.Yes | StandardButton.No
icon: StandardIcon.Question
onYes:
{
CuraApplication.deleteAll();
Cura.Actions.resetProfile.trigger();
}
}
Connections
{
target: Cura.Actions.newProject
onTriggered:
{
if(Printer.platformActivity || Cura.MachineManager.hasUserSettings)
{
newProjectDialog.visible = true
}
}
}
}

View File

@ -1,4 +1,4 @@
// Copyright (c) 2017 Ultimaker B.V. // Copyright (c) 2018 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
@ -8,7 +8,6 @@ import QtQuick.Layouts 1.1
import UM 1.4 as UM import UM 1.4 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
import "Menus"
Rectangle Rectangle
{ {