mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-05 16:51:12 -07:00
Merge branch 'settings_rework'
Contributes to CURA-1278 * settings_rework: (224 commits) Improve slice trigger documentation Import Cura in materials preferences page so we can use the active definition id Add layer height to high quality profile so we have something that changes Update example XML material to use the right product names Filter available materials by the machine definition Show the add machine dialog when we do not have an active machine Create machine-specific material containers for machine specific overrides in XML material files When creating a new container stack, add empty containers for things where we cannot find containers Add preferred variant, material and quality to UM2+ definition Account for global container stack being None in the backend plugin Use the global stack instance variable and account for it potentially being None Store the global container stack as an instance property Added wildcard to filtering Per object settings filter now uses correct bool types (instead of strings) Removed stray = sign. Fix creating print job name Disable asynchronous loading of SettingItem when Qt Version < 5.5 Document QTbug Properly serialise all settings to g-code file Document GCodeWriter class ...
This commit is contained in:
commit
386aec32a8
125 changed files with 7651 additions and 2131 deletions
|
|
@ -1,6 +1,8 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import UM 1.1 as UM
|
||||
|
|
@ -45,6 +47,8 @@ Item
|
|||
|
||||
property alias toggleFullScreen: toggleFullScreenAction;
|
||||
|
||||
property alias configureSettingVisibility: configureSettingVisibilityAction
|
||||
|
||||
UM.I18nCatalog{id: catalog; name:"cura"}
|
||||
|
||||
Action
|
||||
|
|
@ -60,6 +64,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
|
||||
|
|
@ -68,6 +74,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
|
||||
|
|
@ -103,6 +111,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
|
||||
|
|
@ -110,6 +119,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
|
||||
|
|
@ -132,12 +142,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
|
||||
|
|
@ -154,6 +166,7 @@ Item
|
|||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-delete";
|
||||
shortcut: StandardKey.Delete;
|
||||
onTriggered: Printer.deleteSelection();
|
||||
}
|
||||
|
||||
Action
|
||||
|
|
@ -177,6 +190,7 @@ Item
|
|||
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
||||
iconName: "object-group"
|
||||
shortcut: "Ctrl+G";
|
||||
onTriggered: Printer.groupSelected();
|
||||
}
|
||||
|
||||
Action
|
||||
|
|
@ -186,6 +200,7 @@ Item
|
|||
enabled: UM.Scene.isGroupSelected
|
||||
iconName: "object-ungroup"
|
||||
shortcut: "Ctrl+Shift+G";
|
||||
onTriggered: Printer.ungroupSelected();
|
||||
}
|
||||
|
||||
Action
|
||||
|
|
@ -195,6 +210,7 @@ Item
|
|||
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
||||
iconName: "merge";
|
||||
shortcut: "Ctrl+Alt+G";
|
||||
onTriggered: Printer.mergeSelected();
|
||||
}
|
||||
|
||||
Action
|
||||
|
|
@ -211,6 +227,7 @@ Item
|
|||
enabled: UM.Controller.toolsEnabled;
|
||||
iconName: "edit-delete";
|
||||
shortcut: "Ctrl+D";
|
||||
onTriggered: Printer.deleteAll();
|
||||
}
|
||||
|
||||
Action
|
||||
|
|
@ -218,18 +235,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
|
||||
|
|
@ -247,4 +267,10 @@ Item
|
|||
iconName: "view-list-text";
|
||||
shortcut: StandardKey.WhatsThis;
|
||||
}
|
||||
|
||||
Action
|
||||
{
|
||||
id: configureSettingVisibilityAction
|
||||
text: catalog.i18nc("@action:menu", "Configure setting visiblity...");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
178
resources/qml/AddMachineDialog.qml
Normal file
178
resources/qml/AddMachineDialog.qml
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Cura is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Window 2.1
|
||||
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
|
||||
UM.Dialog
|
||||
{
|
||||
id: base
|
||||
title: catalog.i18nc("@title:window", "Add Printer")
|
||||
property string activeManufacturer: "Ultimaker";
|
||||
|
||||
function getMachineName()
|
||||
{
|
||||
var name = machineList.model.getItem(machineList.currentIndex).name
|
||||
return name
|
||||
}
|
||||
|
||||
ScrollView
|
||||
{
|
||||
id: machinesHolder
|
||||
|
||||
anchors
|
||||
{
|
||||
left: parent.left;
|
||||
top: parent.top;
|
||||
right: parent.right;
|
||||
bottom: parent.bottom;
|
||||
}
|
||||
ListView
|
||||
{
|
||||
id: machineList
|
||||
|
||||
model: UM.DefinitionContainersModel
|
||||
{
|
||||
id: machineDefinitionsModel
|
||||
filter: {"visible":true}
|
||||
}
|
||||
section.property: "manufacturer"
|
||||
section.delegate: Button
|
||||
{
|
||||
text: section
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: 0
|
||||
color: "transparent";
|
||||
height: UM.Theme.getSize("standard_list_lineheight").height
|
||||
width: machineList.width
|
||||
}
|
||||
label: Label
|
||||
{
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("standard_arrow").width + UM.Theme.getSize("default_margin").width
|
||||
text: control.text
|
||||
color: palette.windowText
|
||||
font.bold: true
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: downArrow
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: palette.windowText
|
||||
source: base.activeManufacturer == section ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_right")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClicked:
|
||||
{
|
||||
base.activeManufacturer = section;
|
||||
machineList.currentIndex = machineList.model.find("manufacturer", section)
|
||||
machineName.text = getMachineName()
|
||||
}
|
||||
}
|
||||
|
||||
delegate: RadioButton
|
||||
{
|
||||
id: machineButton
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("standard_list_lineheight").width
|
||||
|
||||
opacity: 1;
|
||||
height: UM.Theme.getSize("standard_list_lineheight").height;
|
||||
|
||||
checked: ListView.isCurrentItem;
|
||||
|
||||
exclusiveGroup: printerGroup;
|
||||
|
||||
text: model.name
|
||||
|
||||
onClicked:
|
||||
{
|
||||
ListView.view.currentIndex = index;
|
||||
machineName.text = getMachineName()
|
||||
}
|
||||
|
||||
states: State
|
||||
{
|
||||
name: "collapsed";
|
||||
when: base.activeManufacturer != model.manufacturer;
|
||||
|
||||
PropertyChanges { target: machineButton; opacity: 0; height: 0; }
|
||||
}
|
||||
|
||||
transitions:
|
||||
[
|
||||
Transition
|
||||
{
|
||||
to: "collapsed";
|
||||
SequentialAnimation
|
||||
{
|
||||
NumberAnimation { property: "opacity"; duration: 75; }
|
||||
NumberAnimation { property: "height"; duration: 75; }
|
||||
}
|
||||
},
|
||||
Transition
|
||||
{
|
||||
from: "collapsed";
|
||||
SequentialAnimation
|
||||
{
|
||||
NumberAnimation { property: "height"; duration: 75; }
|
||||
NumberAnimation { property: "opacity"; duration: 75; }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextField
|
||||
{
|
||||
id: machineName;
|
||||
text: getMachineName()
|
||||
implicitWidth: UM.Theme.getSize("standard_list_input").width
|
||||
maximumLength: 40
|
||||
anchors.bottom:parent.bottom
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
text:"save"
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
onClicked:
|
||||
{
|
||||
base.visible = false
|
||||
var item = machineList.model.getItem(machineList.currentIndex);
|
||||
Cura.MachineManager.addMachine(machineName.text, item.id)
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
UM.I18nCatalog
|
||||
{
|
||||
id: catalog;
|
||||
name: "cura";
|
||||
}
|
||||
SystemPalette { id: palette }
|
||||
ExclusiveGroup { id: printerGroup; }
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,10 @@ import QtQuick.Controls.Styles 1.1
|
|||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Dialogs 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
import "."
|
||||
|
||||
UM.MainWindow
|
||||
{
|
||||
|
|
@ -53,7 +56,7 @@ UM.MainWindow
|
|||
title: catalog.i18nc("@title:menu menubar:toplevel","&File");
|
||||
|
||||
MenuItem {
|
||||
action: actions.open;
|
||||
action: Actions.open;
|
||||
}
|
||||
|
||||
Menu
|
||||
|
|
@ -115,11 +118,11 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
MenuItem { action: actions.reloadAll; }
|
||||
MenuItem { action: Actions.reloadAll; }
|
||||
|
||||
MenuSeparator { }
|
||||
|
||||
MenuItem { action: actions.quit; }
|
||||
MenuItem { action: Actions.quit; }
|
||||
}
|
||||
|
||||
Menu
|
||||
|
|
@ -127,17 +130,17 @@ UM.MainWindow
|
|||
//: Edit menu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel","&Edit");
|
||||
|
||||
MenuItem { action: actions.undo; }
|
||||
MenuItem { action: actions.redo; }
|
||||
MenuItem { action: Actions.undo; }
|
||||
MenuItem { action: Actions.redo; }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: actions.deleteSelection; }
|
||||
MenuItem { action: actions.deleteAll; }
|
||||
MenuItem { action: actions.resetAllTranslation; }
|
||||
MenuItem { action: actions.resetAll; }
|
||||
MenuItem { action: Actions.deleteSelection; }
|
||||
MenuItem { action: Actions.deleteAll; }
|
||||
MenuItem { action: Actions.resetAllTranslation; }
|
||||
MenuItem { action: Actions.resetAll; }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: actions.groupObjects;}
|
||||
MenuItem { action: actions.mergeObjects;}
|
||||
MenuItem { action: actions.unGroupObjects;}
|
||||
MenuItem { action: Actions.groupObjects;}
|
||||
MenuItem { action: Actions.mergeObjects;}
|
||||
MenuItem { action: Actions.unGroupObjects;}
|
||||
}
|
||||
|
||||
Menu
|
||||
|
|
@ -168,14 +171,17 @@ UM.MainWindow
|
|||
|
||||
Instantiator
|
||||
{
|
||||
model: UM.MachineInstancesModel { }
|
||||
model: UM.ContainerStacksModel
|
||||
{
|
||||
filter: {"type": "machine"}
|
||||
}
|
||||
MenuItem
|
||||
{
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: model.active;
|
||||
exclusiveGroup: machineMenuGroup;
|
||||
onTriggered: UM.MachineManager.setActiveMachineInstance(model.name)
|
||||
checked: Cura.MachineManager.activeMachineId == model.id
|
||||
exclusiveGroup: machineSelectionMenuGroup;
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id);
|
||||
}
|
||||
onObjectAdded: machineMenu.insertItem(index, object)
|
||||
onObjectRemoved: machineMenu.removeItem(object)
|
||||
|
|
@ -187,13 +193,20 @@ UM.MainWindow
|
|||
|
||||
Instantiator
|
||||
{
|
||||
model: UM.MachineVariantsModel { }
|
||||
model: UM.InstanceContainersModel
|
||||
{
|
||||
filter:
|
||||
{
|
||||
"type": "variant",
|
||||
"definition": Cura.MachineManager.activeDefinitionId //Only show variants of this machine
|
||||
}
|
||||
}
|
||||
MenuItem {
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: model.active;
|
||||
checked: model.id == Cura.MachineManager.activeVariantId;
|
||||
exclusiveGroup: machineVariantsGroup;
|
||||
onTriggered: UM.MachineManager.setActiveMachineVariant(model.name)
|
||||
onTriggered: Cura.MachineManager.setActiveVariant(model.id)
|
||||
}
|
||||
onObjectAdded: machineMenu.insertItem(index, object)
|
||||
onObjectRemoved: machineMenu.removeItem(object)
|
||||
|
|
@ -201,10 +214,10 @@ UM.MainWindow
|
|||
|
||||
ExclusiveGroup { id: machineVariantsGroup; }
|
||||
|
||||
MenuSeparator { visible: UM.MachineManager.hasVariants; }
|
||||
MenuSeparator { visible: Cura.MachineManager.hasVariants; }
|
||||
|
||||
MenuItem { action: actions.addMachine; }
|
||||
MenuItem { action: actions.configureMachines; }
|
||||
MenuItem { action: Actions.addMachine; }
|
||||
MenuItem { action: Actions.configureMachines; }
|
||||
}
|
||||
|
||||
Menu
|
||||
|
|
@ -215,7 +228,7 @@ UM.MainWindow
|
|||
Instantiator
|
||||
{
|
||||
id: profileMenuInstantiator
|
||||
model: UM.ProfilesModel {}
|
||||
// model: UM.ProfilesModel {}
|
||||
property int separatorIndex: -1
|
||||
|
||||
Loader {
|
||||
|
|
@ -277,11 +290,11 @@ UM.MainWindow
|
|||
|
||||
MenuSeparator { id: profileMenuSeparator }
|
||||
|
||||
MenuItem { action: actions.updateProfile; }
|
||||
MenuItem { action: actions.resetProfile; }
|
||||
MenuItem { action: actions.addProfile; }
|
||||
MenuItem { action: Actions.updateProfile; }
|
||||
MenuItem { action: Actions.resetProfile; }
|
||||
MenuItem { action: Actions.addProfile; }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: actions.manageProfiles; }
|
||||
MenuItem { action: Actions.manageProfiles; }
|
||||
}
|
||||
|
||||
Menu
|
||||
|
|
@ -292,7 +305,7 @@ UM.MainWindow
|
|||
|
||||
Instantiator
|
||||
{
|
||||
model: UM.Models.extensionModel
|
||||
model: UM.ExtensionModel { }
|
||||
|
||||
Menu
|
||||
{
|
||||
|
|
@ -323,7 +336,7 @@ UM.MainWindow
|
|||
//: Settings menu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel","&Settings");
|
||||
|
||||
MenuItem { action: actions.preferences; }
|
||||
MenuItem { action: Actions.preferences; }
|
||||
}
|
||||
|
||||
Menu
|
||||
|
|
@ -331,11 +344,11 @@ UM.MainWindow
|
|||
//: Help menu
|
||||
title: catalog.i18nc("@title:menu menubar:toplevel","&Help");
|
||||
|
||||
MenuItem { action: actions.showEngineLog; }
|
||||
MenuItem { action: actions.documentation; }
|
||||
MenuItem { action: actions.reportBug; }
|
||||
MenuItem { action: Actions.showEngineLog; }
|
||||
MenuItem { action: Actions.documentation; }
|
||||
MenuItem { action: Actions.reportBug; }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: actions.about; }
|
||||
MenuItem { action: Actions.about; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -425,7 +438,7 @@ UM.MainWindow
|
|||
left: parent.left;
|
||||
//leftMargin: UM.Theme.getSize("loadfile_margin").width
|
||||
}
|
||||
action: actions.open;
|
||||
action: Actions.open;
|
||||
}
|
||||
|
||||
Image
|
||||
|
|
@ -513,22 +526,12 @@ UM.MainWindow
|
|||
|
||||
width: UM.Theme.getSize("sidebar").width;
|
||||
|
||||
addMachineAction: actions.addMachine;
|
||||
configureMachinesAction: actions.configureMachines;
|
||||
addProfileAction: actions.addProfile;
|
||||
updateProfileAction: actions.updateProfile;
|
||||
resetProfileAction: actions.resetProfile;
|
||||
manageProfilesAction: actions.manageProfiles;
|
||||
|
||||
configureSettingsAction: Action
|
||||
{
|
||||
onTriggered:
|
||||
{
|
||||
preferences.visible = true;
|
||||
preferences.setPage(2);
|
||||
preferences.getCurrentItem().scrollToSection(source.key);
|
||||
}
|
||||
}
|
||||
addMachineAction: Actions.addMachine;
|
||||
configureMachinesAction: Actions.configureMachines;
|
||||
addProfileAction: Actions.addProfile;
|
||||
updateProfileAction: Actions.updateProfile;
|
||||
resetProfileAction: Actions.resetProfile;
|
||||
manageProfilesAction: Actions.manageProfiles;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -546,6 +549,12 @@ UM.MainWindow
|
|||
//: View preferences page title
|
||||
insertPage(1, catalog.i18nc("@title:tab","View"), Qt.resolvedUrl("ViewPage.qml"));
|
||||
|
||||
insertPage(3, catalog.i18nc("@title:tab", "Printers"), Qt.resolvedUrl("MachinesPage.qml"));
|
||||
|
||||
insertPage(4, catalog.i18nc("@title:tab", "Materials"), Qt.resolvedUrl("Preferences/MaterialsPage.qml"));
|
||||
|
||||
insertPage(5, catalog.i18nc("@title:tab", "Profiles"), Qt.resolvedUrl("Preferences/ProfilesPage.qml"));
|
||||
|
||||
//Force refresh
|
||||
setPage(0);
|
||||
}
|
||||
|
|
@ -561,73 +570,16 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
Actions
|
||||
Connections
|
||||
{
|
||||
id: actions;
|
||||
target: Actions.preferences
|
||||
onTriggered: preferences.visible = true
|
||||
}
|
||||
|
||||
open.onTriggered: openDialog.open();
|
||||
|
||||
quit.onTriggered: base.visible = false;
|
||||
|
||||
undo.onTriggered: UM.OperationStack.undo();
|
||||
undo.enabled: UM.OperationStack.canUndo;
|
||||
redo.onTriggered: UM.OperationStack.redo();
|
||||
redo.enabled: UM.OperationStack.canRedo;
|
||||
|
||||
deleteSelection.onTriggered:
|
||||
{
|
||||
Printer.deleteSelection();
|
||||
}
|
||||
|
||||
deleteObject.onTriggered:
|
||||
{
|
||||
if(objectContextMenu.objectId != 0)
|
||||
{
|
||||
Printer.deleteObject(objectContextMenu.objectId);
|
||||
objectContextMenu.objectId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
multiplyObject.onTriggered:
|
||||
{
|
||||
if(objectContextMenu.objectId != 0)
|
||||
{
|
||||
Printer.multiplyObject(objectContextMenu.objectId, 1);
|
||||
objectContextMenu.objectId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
centerObject.onTriggered:
|
||||
{
|
||||
if(objectContextMenu.objectId != 0)
|
||||
{
|
||||
Printer.centerObject(objectContextMenu.objectId);
|
||||
objectContextMenu.objectId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
groupObjects.onTriggered:
|
||||
{
|
||||
Printer.groupSelected();
|
||||
}
|
||||
|
||||
unGroupObjects.onTriggered:
|
||||
{
|
||||
Printer.ungroupSelected();
|
||||
}
|
||||
|
||||
mergeObjects.onTriggered:
|
||||
{
|
||||
Printer.mergeSelected();
|
||||
}
|
||||
|
||||
deleteAll.onTriggered: Printer.deleteAll();
|
||||
resetAllTranslation.onTriggered: Printer.resetAllTranslation();
|
||||
resetAll.onTriggered: Printer.resetAll();
|
||||
reloadAll.onTriggered: Printer.reloadAll();
|
||||
|
||||
addMachine.onTriggered: addMachineWizard.visible = true;
|
||||
addProfile.onTriggered:
|
||||
Connections
|
||||
{
|
||||
target: Actions.addProfile
|
||||
onTriggered:
|
||||
{
|
||||
UM.MachineManager.createProfile();
|
||||
preferences.setPage(4);
|
||||
|
|
@ -636,26 +588,37 @@ UM.MainWindow
|
|||
// Show the renameDialog after a very short delay so the preference page has time to initiate
|
||||
showProfileNameDialogTimer.start();
|
||||
}
|
||||
updateProfile.onTriggered: UM.ActiveProfile.updateProfile();
|
||||
resetProfile.onTriggered: UM.ActiveProfile.discardChanges();
|
||||
}
|
||||
|
||||
preferences.onTriggered: preferences.visible = true;
|
||||
configureMachines.onTriggered:
|
||||
Connections
|
||||
{
|
||||
target: Actions.configureMachines
|
||||
onTriggered:
|
||||
{
|
||||
preferences.visible = true;
|
||||
preferences.setPage(3);
|
||||
}
|
||||
manageProfiles.onTriggered:
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Actions.manageProfiles
|
||||
onTriggered:
|
||||
{
|
||||
preferences.visible = true;
|
||||
preferences.setPage(4);
|
||||
}
|
||||
}
|
||||
|
||||
documentation.onTriggered: CuraActions.openDocumentation();
|
||||
reportBug.onTriggered: CuraActions.openBugReportPage();
|
||||
showEngineLog.onTriggered: engineLog.visible = true;
|
||||
about.onTriggered: aboutDialog.visible = true;
|
||||
toggleFullScreen.onTriggered: base.toggleFullscreen();
|
||||
Connections
|
||||
{
|
||||
target: Actions.configureSettingVisibility
|
||||
onTriggered:
|
||||
{
|
||||
preferences.visible = true;
|
||||
preferences.setPage(2);
|
||||
preferences.getCurrentItem().scrollToSection(source.key);
|
||||
}
|
||||
}
|
||||
|
||||
Timer
|
||||
|
|
@ -672,31 +635,70 @@ UM.MainWindow
|
|||
id: objectContextMenu;
|
||||
|
||||
property variant objectId: -1;
|
||||
MenuItem { action: actions.centerObject; }
|
||||
MenuItem { action: actions.deleteObject; }
|
||||
MenuItem { action: actions.multiplyObject; }
|
||||
MenuItem { action: Actions.centerObject; }
|
||||
MenuItem { action: Actions.deleteObject; }
|
||||
MenuItem { action: Actions.multiplyObject; }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: actions.deleteAll; }
|
||||
MenuItem { action: actions.reloadAll; }
|
||||
MenuItem { action: actions.resetAllTranslation; }
|
||||
MenuItem { action: actions.resetAll; }
|
||||
MenuItem { action: Actions.deleteAll; }
|
||||
MenuItem { action: Actions.reloadAll; }
|
||||
MenuItem { action: Actions.resetAllTranslation; }
|
||||
MenuItem { action: Actions.resetAll; }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: actions.groupObjects; }
|
||||
MenuItem { action: actions.mergeObjects; }
|
||||
MenuItem { action: actions.unGroupObjects; }
|
||||
MenuItem { action: Actions.groupObjects; }
|
||||
MenuItem { action: Actions.mergeObjects; }
|
||||
MenuItem { action: Actions.unGroupObjects; }
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Actions.deleteObject
|
||||
onTriggered:
|
||||
{
|
||||
if(objectContextMenu.objectId != 0)
|
||||
{
|
||||
Printer.deleteObject(objectContextMenu.objectId);
|
||||
objectContextMenu.objectId = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Actions.multiplyObject
|
||||
onTriggered:
|
||||
{
|
||||
if(objectContextMenu.objectId != 0)
|
||||
{
|
||||
Printer.multiplyObject(objectContextMenu.objectId, 1);
|
||||
objectContextMenu.objectId = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Actions.centerObject
|
||||
onTriggered:
|
||||
{
|
||||
if(objectContextMenu.objectId != 0)
|
||||
{
|
||||
Printer.centerObject(objectContextMenu.objectId);
|
||||
objectContextMenu.objectId = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Menu
|
||||
{
|
||||
id: contextMenu;
|
||||
MenuItem { action: actions.deleteAll; }
|
||||
MenuItem { action: actions.reloadAll; }
|
||||
MenuItem { action: actions.resetAllTranslation; }
|
||||
MenuItem { action: actions.resetAll; }
|
||||
MenuItem { action: Actions.deleteAll; }
|
||||
MenuItem { action: Actions.reloadAll; }
|
||||
MenuItem { action: Actions.resetAllTranslation; }
|
||||
MenuItem { action: Actions.resetAll; }
|
||||
MenuSeparator { }
|
||||
MenuItem { action: actions.groupObjects; }
|
||||
MenuItem { action: actions.mergeObjects; }
|
||||
MenuItem { action: actions.unGroupObjects; }
|
||||
MenuItem { action: Actions.groupObjects; }
|
||||
MenuItem { action: Actions.mergeObjects; }
|
||||
MenuItem { action: Actions.unGroupObjects; }
|
||||
}
|
||||
|
||||
Connections
|
||||
|
|
@ -715,6 +717,18 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Actions.quit
|
||||
onTriggered: base.visible = false;
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Actions.toggleFullScreen
|
||||
onTriggered: base.toggleFullscreen();
|
||||
}
|
||||
|
||||
FileDialog
|
||||
{
|
||||
id: openDialog;
|
||||
|
|
@ -739,14 +753,32 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Actions.open
|
||||
onTriggered: openDialog.open()
|
||||
}
|
||||
|
||||
EngineLog
|
||||
{
|
||||
id: engineLog;
|
||||
}
|
||||
|
||||
AddMachineWizard
|
||||
Connections
|
||||
{
|
||||
id: addMachineWizard
|
||||
target: Actions.showEngineLog
|
||||
onTriggered: engineLog.visible = true;
|
||||
}
|
||||
|
||||
AddMachineDialog
|
||||
{
|
||||
id: addMachineDialog
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Actions.addMachine
|
||||
onTriggered: addMachineDialog.visible = true;
|
||||
}
|
||||
|
||||
AboutDialog
|
||||
|
|
@ -754,13 +786,19 @@ UM.MainWindow
|
|||
id: aboutDialog
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Actions.about
|
||||
onTriggered: aboutDialog.visible = true;
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: Printer
|
||||
onRequestAddPrinter:
|
||||
{
|
||||
addMachineWizard.visible = true
|
||||
addMachineWizard.firstRun = false
|
||||
addMachineDialog.visible = true
|
||||
addMachineDialog.firstRun = false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -777,10 +815,9 @@ UM.MainWindow
|
|||
base.visible = true;
|
||||
restart();
|
||||
}
|
||||
else if(UM.MachineManager.activeMachineInstance == "")
|
||||
else if(Cura.MachineManager.activeMachineId == null || Cura.MachineManager.activeMachineId == "")
|
||||
{
|
||||
addMachineWizard.firstRun = true;
|
||||
addMachineWizard.open();
|
||||
addMachineDialog.open();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,15 +7,16 @@ import QtQuick.Controls.Styles 1.1
|
|||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Rectangle {
|
||||
id: base;
|
||||
|
||||
property bool activity: Printer.getPlatformActivity;
|
||||
property string fileBaseName
|
||||
property variant activeMachineInstance: UM.MachineManager.activeMachineInstance
|
||||
property variant activeMachineName: Cura.MachineManager.activeMachineName
|
||||
|
||||
onActiveMachineInstanceChanged:
|
||||
onActiveMachineNameChanged:
|
||||
{
|
||||
base.createFileName()
|
||||
}
|
||||
|
|
@ -28,36 +29,48 @@ Rectangle {
|
|||
height: childrenRect.height
|
||||
color: "transparent"
|
||||
|
||||
function createFileName(){
|
||||
var splitMachineName = UM.MachineManager.activeMachineInstance.split(" ")
|
||||
var abbrMachine = ''
|
||||
if ((UM.Preferences.getValue("cura/jobname_prefix"))) {
|
||||
for (var i = 0; i < splitMachineName.length; i++){
|
||||
if (splitMachineName[i].search(/ultimaker/i) != -1){
|
||||
abbrMachine += 'UM'
|
||||
function createFileName()
|
||||
{
|
||||
var splitMachineName = Cura.MachineManager.activeMachineName.split(" ")
|
||||
var abbrMachine = "";
|
||||
if ((UM.Preferences.getValue("cura/jobname_prefix")))
|
||||
{
|
||||
for (var i = 0; i < splitMachineName.length; i++)
|
||||
{
|
||||
if (splitMachineName[i].search(/ultimaker/i) != -1)
|
||||
{
|
||||
abbrMachine += "UM";
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
if (splitMachineName[i].charAt(0).search(/[0-9]/g) == -1)
|
||||
abbrMachine += splitMachineName[i].charAt(0)
|
||||
}
|
||||
var regExpAdditives = /[0-9\+]/g;
|
||||
var resultAdditives = splitMachineName[i].match(regExpAdditives);
|
||||
if (resultAdditives != null){
|
||||
for (var j = 0; j < resultAdditives.length; j++){
|
||||
abbrMachine += resultAdditives[j]
|
||||
|
||||
{
|
||||
abbrMachine += splitMachineName[i].charAt(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
printJobTextfield.text = abbrMachine + '_' + base.fileBaseName
|
||||
} else {
|
||||
printJobTextfield.text = base.fileBaseName
|
||||
var regExpAdditives = /[0-9\+]/g;
|
||||
var resultAdditives = splitMachineName[i].match(regExpAdditives);
|
||||
if (resultAdditives != null)
|
||||
{
|
||||
for (var j = 0; j < resultAdditives.length; j++)
|
||||
{
|
||||
abbrMachine += resultAdditives[j];
|
||||
}
|
||||
}
|
||||
printJobTextfield.text = abbrMachine + "_" + base.fileBaseName;
|
||||
}
|
||||
else
|
||||
{
|
||||
printJobTextfield.text = base.fileBaseName;
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
Connections
|
||||
{
|
||||
target: backgroundItem
|
||||
onHasMesh: {
|
||||
onHasMesh:
|
||||
{
|
||||
base.fileBaseName = name
|
||||
}
|
||||
}
|
||||
|
|
|
|||
68
resources/qml/MachinesPage.qml
Normal file
68
resources/qml/MachinesPage.qml
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
UM.ManagementPage
|
||||
{
|
||||
id: base;
|
||||
|
||||
title: catalog.i18nc("@title:tab", "Printers");
|
||||
property int numInstances: model.rowCount();
|
||||
model: UM.ContainerStacksModel
|
||||
{
|
||||
filter: {"type": "machine"}
|
||||
onDataChanged: numInstances = model.rowCount()
|
||||
}
|
||||
|
||||
onAddObject: Printer.requestAddPrinter()
|
||||
onRemoveObject: confirmDialog.open();
|
||||
onRenameObject: renameDialog.open();
|
||||
|
||||
removeEnabled: numInstances > 1
|
||||
renameEnabled: numInstances > 0
|
||||
|
||||
Flow
|
||||
{
|
||||
anchors.fill: parent;
|
||||
spacing: UM.Theme.getSize("default_margin").height;
|
||||
|
||||
Label
|
||||
{
|
||||
text: base.currentItem && base.currentItem.name ? base.currentItem.name : ""
|
||||
font: UM.Theme.getFont("large")
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
Label { text: catalog.i18nc("@label", "Type"); width: parent.width * 0.2; }
|
||||
Label { text: base.currentItem && base.currentItem.typeName ? base.currentItem.typeName : ""; width: parent.width * 0.7; }
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "uranium"; }
|
||||
|
||||
UM.ConfirmRemoveDialog
|
||||
{
|
||||
id: confirmDialog;
|
||||
object: base.currentItem && base.currentItem.name ? base.currentItem.name : "";
|
||||
onYes: Cura.MachineManager.removeMachine(base.currentItem.id);
|
||||
}
|
||||
|
||||
UM.RenameDialog
|
||||
{
|
||||
id: renameDialog;
|
||||
object: base.currentItem && base.currentItem.name ? base.currentItem.name : "";
|
||||
onAccepted:
|
||||
{
|
||||
Cura.MachineManager.renameMachine(base.currentItem.id, newName.trim());
|
||||
//Reselect current item to update details panel
|
||||
var index = objectList.currentIndex
|
||||
objectList.currentIndex = -1
|
||||
objectList.currentIndex = index
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
217
resources/qml/Preferences/MaterialsPage.qml
Normal file
217
resources/qml/Preferences/MaterialsPage.qml
Normal file
|
|
@ -0,0 +1,217 @@
|
|||
// Copyright (c) 2016 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
UM.ManagementPage
|
||||
{
|
||||
id: base;
|
||||
|
||||
title: catalog.i18nc("@title:tab", "Materials");
|
||||
|
||||
model: UM.InstanceContainersModel { filter: { "type": "material", "definition": Cura.MachineManager.activeDefinitionId } }
|
||||
/*
|
||||
onAddObject: { var selectedMaterial = UM.MaterialManager.createProfile(); base.selectMaterial(selectedMaterial); }
|
||||
onRemoveObject: confirmDialog.open();
|
||||
onRenameObject: { renameDialog.open(); renameDialog.selectText(); }
|
||||
*/
|
||||
// activateEnabled: false
|
||||
addEnabled: false
|
||||
removeEnabled: false
|
||||
renameEnabled: false
|
||||
|
||||
scrollviewCaption: " "
|
||||
detailsVisible: true
|
||||
|
||||
property string currency: UM.Preferences.getValue("general/currency")
|
||||
|
||||
Item {
|
||||
UM.I18nCatalog { id: catalog; name: "cura"; }
|
||||
|
||||
visible: base.currentItem != null
|
||||
anchors.fill: parent
|
||||
|
||||
Label { id: profileName; text: materialProperties.name; font: UM.Theme.getFont("large"); width: parent.width; }
|
||||
|
||||
TabView {
|
||||
id: scrollView
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: profileName.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
Tab {
|
||||
title: "Information"
|
||||
anchors.margins: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Flow {
|
||||
id: containerGrid
|
||||
|
||||
width: scrollView.width;
|
||||
property real columnWidth: width / 2
|
||||
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "Profile Type") }
|
||||
Label { width: parent.columnWidth; text: materialProperties.profile_type }
|
||||
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "Supplier") }
|
||||
Label { width: parent.columnWidth; text: materialProperties.supplier }
|
||||
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "Material Type") }
|
||||
Label { width: parent.columnWidth; text: materialProperties.material_type }
|
||||
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "Color") }
|
||||
|
||||
Row {
|
||||
width: parent.columnWidth;
|
||||
spacing: UM.Theme.getSize("default_margin").width/2
|
||||
Rectangle {
|
||||
color: materialProperties.color_code
|
||||
width: colorLabel.height
|
||||
height: colorLabel.height
|
||||
border.width: UM.Theme.getSize("default_lining").height
|
||||
}
|
||||
Label { id: colorLabel; text: materialProperties.color_name }
|
||||
}
|
||||
|
||||
Item { width: parent.width; height: UM.Theme.getSize("default_margin").height }
|
||||
|
||||
Label { width: parent.width; text: "<b>" + catalog.i18nc("@label", "Properties") + "</b>" }
|
||||
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "Density") }
|
||||
Label { width: parent.columnWidth; text: materialProperties.density }
|
||||
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "Diameter") }
|
||||
Label { width: parent.columnWidth; text: materialProperties.diameter }
|
||||
|
||||
Label {
|
||||
text: catalog.i18nc("@label", "Filament cost")
|
||||
width: parent.columnWidth;
|
||||
height: spoolCostInput.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
Row {
|
||||
width: parent.columnWidth;
|
||||
Label {
|
||||
text: base.currency ? base.currency + " " : " "
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
TextField {
|
||||
id: spoolCostInput
|
||||
text: materialProperties.spool_cost
|
||||
}
|
||||
}
|
||||
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "Filament weight") }
|
||||
Label { width: parent.columnWidth; text: materialProperties.spool_weight + " " + "g" }
|
||||
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "Filament length") }
|
||||
Label { width: parent.columnWidth; text: materialProperties.spool_length + " " + "m" }
|
||||
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "Cost per meter") }
|
||||
Label { width: parent.columnWidth; text: catalog.i18nc("@label", "approx. %1 %2/m").arg(materialProperties.cost_per_meter).arg(base.currency); }
|
||||
|
||||
Item { width: parent.width; height: UM.Theme.getSize("default_margin").height }
|
||||
|
||||
Label {
|
||||
text: materialProperties.description ? "<b>" + catalog.i18nc("@label", "Information") + "</b><br>" + materialProperties.description : "";
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
Label {
|
||||
text: materialProperties.adhesion_info ? "<b>" + catalog.i18nc("@label", "Adhesion") + "</b><br>" + materialProperties.adhesion_info : "";
|
||||
width: parent.width
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
}
|
||||
Tab {
|
||||
title: catalog.i18nc("@label", "Print settings")
|
||||
anchors.margins: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Grid {
|
||||
columns: 2
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Column {
|
||||
Repeater {
|
||||
model: base.currentItem ? base.currentItem.settings : null
|
||||
Label {
|
||||
text: modelData.name.toString();
|
||||
elide: Text.ElideMiddle;
|
||||
}
|
||||
}
|
||||
}
|
||||
Column {
|
||||
Repeater {
|
||||
model: base.currentItem ? base.currentItem.settings : null
|
||||
Label { text: modelData.value.toString() + " " + modelData.unit.toString(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QtObject
|
||||
{
|
||||
id: materialProperties
|
||||
|
||||
property string name: "Unknown";
|
||||
property string profile_type: "Unknown";
|
||||
property string supplier: "Unknown";
|
||||
property string material_type: "Unknown";
|
||||
|
||||
property string color_name: "Yellow";
|
||||
property color color_code: "yellow";
|
||||
|
||||
property string density: "Unknown";
|
||||
property string diameter: "Unknown";
|
||||
|
||||
property string spool_cost: "Unknown";
|
||||
property string spool_weight: "Unknown";
|
||||
property string spool_length: "Unknown";
|
||||
property string cost_per_meter: "Unknown";
|
||||
|
||||
property string description: "";
|
||||
property string adhesion_info: "";
|
||||
}
|
||||
}
|
||||
|
||||
onCurrentItemChanged:
|
||||
{
|
||||
if(!currentItem == null)
|
||||
{
|
||||
return
|
||||
}
|
||||
|
||||
materialProperties.name = currentItem.name;
|
||||
|
||||
if(currentItem.metadata != undefined && currentItem.metadata != null)
|
||||
{
|
||||
materialProperties.supplier = currentItem.metadata.brand ? currentItem.metadata.brand : "Unknown";
|
||||
materialProperties.material_type = currentItem.metadata.material ? currentItem.metadata.material : "Unknown";
|
||||
materialProperties.color_name = currentItem.metadata.color_name ? currentItem.metadata.color_name : "Yellow";
|
||||
materialProperties.color_code = currentItem.metadata.color_code ? currentItem.metadata.color_code : "yellow";
|
||||
|
||||
materialProperties.description = currentItem.metadata.description ? currentItem.metadata.description : "";
|
||||
materialProperties.adhesion_info = currentItem.metadata.adhesion_info ? currentItem.metadata.adhesion_info : "";
|
||||
|
||||
if(currentItem.metadata.properties != undefined && currentItem.metadata.properties != null)
|
||||
{
|
||||
materialProperties.density = currentItem.metadata.properties.density ? currentItem.metadata.properties.density : "Unknown";
|
||||
materialProperties.diameter = currentItem.metadata.properties.diameter ? currentItem.metadata.properties.diameter : "Unknown";
|
||||
}
|
||||
else
|
||||
{
|
||||
materialProperties.density = "Unknown";
|
||||
materialProperties.diameter = "Unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
222
resources/qml/Preferences/ProfilesPage.qml
Normal file
222
resources/qml/Preferences/ProfilesPage.qml
Normal file
|
|
@ -0,0 +1,222 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Dialogs 1.2
|
||||
|
||||
import UM 1.2 as UM
|
||||
|
||||
UM.ManagementPage
|
||||
{
|
||||
id: base;
|
||||
|
||||
title: catalog.i18nc("@title:tab", "Profiles");
|
||||
addText: catalog.i18nc("@label", "Duplicate")
|
||||
|
||||
model: UM.InstanceContainersModel { filter: { "type": "quality" } }
|
||||
|
||||
onAddObject: {
|
||||
var selectedProfile;
|
||||
if (objectList.currentIndex == 0) {
|
||||
// Current settings
|
||||
selectedProfile = UM.MachineManager.createProfile();
|
||||
} else {
|
||||
selectedProfile = UM.MachineManager.duplicateProfile(currentItem.name);
|
||||
}
|
||||
base.selectProfile(selectedProfile);
|
||||
|
||||
renameDialog.removeWhenRejected = true;
|
||||
renameDialog.open();
|
||||
renameDialog.selectText();
|
||||
}
|
||||
onRemoveObject: confirmDialog.open();
|
||||
onRenameObject: { renameDialog.removeWhenRejected = false; renameDialog.open(); renameDialog.selectText(); }
|
||||
|
||||
addEnabled: currentItem != null;
|
||||
removeEnabled: currentItem != null ? !currentItem.readOnly : false;
|
||||
renameEnabled: currentItem != null ? !currentItem.readOnly : false;
|
||||
|
||||
scrollviewCaption: catalog.i18nc("@label %1 is printer name","Printer: %1").arg(UM.MachineManager.activeMachineInstance)
|
||||
|
||||
signal selectProfile(string name)
|
||||
onSelectProfile: {
|
||||
objectList.currentIndex = objectList.model.find("name", name);
|
||||
}
|
||||
|
||||
Item {
|
||||
visible: base.currentItem != null
|
||||
anchors.fill: parent
|
||||
|
||||
Label {
|
||||
id: profileName
|
||||
text: base.currentItem ? base.currentItem.name : ""
|
||||
font: UM.Theme.getFont("large")
|
||||
width: parent.width
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
ScrollView {
|
||||
anchors.left: parent.left
|
||||
anchors.top: profileName.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
|
||||
Column
|
||||
{
|
||||
spacing: UM.Theme.getSize("default_margin").height
|
||||
|
||||
Row
|
||||
{
|
||||
visible: base.currentItem.id == -1 || base.currentItem.active
|
||||
Button
|
||||
{
|
||||
text: {
|
||||
var profileName = UM.MachineManager.activeProfile;
|
||||
profileName = (profileName.length > 20) ? profileName.substring(0, 20) + '...' : profileName;
|
||||
return catalog.i18nc("@action:button", "Update \"%1\"".arg(profileName));
|
||||
}
|
||||
enabled: UM.ActiveProfile.hasCustomisedValues && !UM.ActiveProfile.readOnly
|
||||
onClicked: UM.ActiveProfile.updateProfile()
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Discard changes");
|
||||
enabled: UM.ActiveProfile.hasCustomisedValues
|
||||
onClicked: UM.ActiveProfile.discardChanges()
|
||||
}
|
||||
}
|
||||
|
||||
Grid
|
||||
{
|
||||
id: containerGrid
|
||||
columns: 2
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Label {
|
||||
text: base.currentItem == null ? "" :
|
||||
base.currentItem.id == -1 ? catalog.i18nc("@label", "Based on") : catalog.i18nc("@label", "Profile type")
|
||||
}
|
||||
Label {
|
||||
text: base.currentItem == null ? "" :
|
||||
base.currentItem.id == -1 ? UM.MachineManager.activeProfile :
|
||||
base.currentItem.readOnly ? catalog.i18nc("@label", "Protected profile") : catalog.i18nc("@label", "Custom profile")
|
||||
}
|
||||
|
||||
Column {
|
||||
Repeater {
|
||||
model: base.currentItem ? base.currentItem.settings : null
|
||||
Label {
|
||||
text: modelData.name.toString();
|
||||
elide: Text.ElideMiddle;
|
||||
}
|
||||
}
|
||||
}
|
||||
Column {
|
||||
Repeater {
|
||||
model: base.currentItem ? base.currentItem.settings : null
|
||||
Label { text: modelData.value.toString(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buttons: Row {
|
||||
|
||||
Button
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Import");
|
||||
iconName: "document-import";
|
||||
onClicked: importDialog.open();
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
text: catalog.i18nc("@action:button", "Export");
|
||||
iconName: "document-export";
|
||||
onClicked: exportDialog.open();
|
||||
}
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
UM.I18nCatalog { id: catalog; name: "uranium"; }
|
||||
|
||||
UM.ConfirmRemoveDialog
|
||||
{
|
||||
id: confirmDialog;
|
||||
object: base.currentItem != null ? base.currentItem.name : "";
|
||||
onYes: base.model.removeProfile(base.currentItem.name);
|
||||
}
|
||||
UM.RenameDialog
|
||||
{
|
||||
id: renameDialog;
|
||||
object: base.currentItem != null ? base.currentItem.name : "";
|
||||
property bool removeWhenRejected: false;
|
||||
onAccepted: base.model.renameProfile(base.currentItem.name, newName.trim());
|
||||
onRejected: {
|
||||
if(removeWhenRejected) {
|
||||
base.model.removeProfile(base.currentItem.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
MessageDialog
|
||||
{
|
||||
id: messageDialog
|
||||
title: catalog.i18nc("@window:title", "Import Profile");
|
||||
standardButtons: StandardButton.Ok
|
||||
modality: Qt.ApplicationModal
|
||||
}
|
||||
|
||||
FileDialog
|
||||
{
|
||||
id: importDialog;
|
||||
title: catalog.i18nc("@title:window", "Import Profile");
|
||||
selectExisting: true;
|
||||
nameFilters: base.model.getFileNameFiltersRead()
|
||||
folder: base.model.getDefaultPath()
|
||||
onAccepted:
|
||||
{
|
||||
var result = base.model.importProfile(fileUrl)
|
||||
messageDialog.text = result.message
|
||||
if(result.status == "ok")
|
||||
{
|
||||
messageDialog.icon = StandardIcon.Information
|
||||
}
|
||||
else if(result.status == "duplicate")
|
||||
{
|
||||
messageDialog.icon = StandardIcon.Warning
|
||||
}
|
||||
else
|
||||
{
|
||||
messageDialog.icon = StandardIcon.Critical
|
||||
}
|
||||
messageDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog
|
||||
{
|
||||
id: exportDialog;
|
||||
title: catalog.i18nc("@title:window", "Export Profile");
|
||||
selectExisting: false;
|
||||
nameFilters: base.model.getFileNameFiltersWrite()
|
||||
folder: base.model.getDefaultPath()
|
||||
onAccepted:
|
||||
{
|
||||
var result = base.model.exportProfile(base.currentItem.id, base.currentItem.name, fileUrl, selectedNameFilter)
|
||||
if(result && result.status == "error")
|
||||
{
|
||||
messageDialog.icon = StandardIcon.Critical
|
||||
messageDialog.text = result.message
|
||||
messageDialog.open()
|
||||
}
|
||||
// else pop-up Message thing from python code
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,7 +6,8 @@ import QtQuick.Controls 1.1
|
|||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item{
|
||||
id: base;
|
||||
|
|
@ -41,13 +42,13 @@ Item{
|
|||
property int rightMargin: customisedSettings.visible ? customisedSettings.width + UM.Theme.getSize("default_margin").width / 2 : 0
|
||||
|
||||
id: globalProfileSelection
|
||||
text: UM.MachineManager.activeProfile
|
||||
text: Cura.MachineManager.activeQualityName
|
||||
width: parent.width/100*55
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
tooltip: UM.MachineManager.activeProfile
|
||||
tooltip: Cura.MachineManager.activeQualityName
|
||||
style: UM.Theme.styles.sidebar_header_button
|
||||
|
||||
menu: Menu
|
||||
|
|
@ -56,7 +57,10 @@ Item{
|
|||
Instantiator
|
||||
{
|
||||
id: profileSelectionInstantiator
|
||||
model: UM.ProfilesModel {}
|
||||
model: UM.InstanceContainersModel
|
||||
{
|
||||
filter: {"type": "quality"}
|
||||
}
|
||||
property int separatorIndex: -1
|
||||
|
||||
Loader {
|
||||
|
|
@ -98,18 +102,18 @@ Item{
|
|||
id: item
|
||||
text: model_data ? model_data.name : ""
|
||||
checkable: true;
|
||||
checked: model_data ? model_data.active : false;
|
||||
checked: Cura.MachineManager.activeQualityId == model_data.id
|
||||
exclusiveGroup: profileSelectionMenuGroup;
|
||||
onTriggered:
|
||||
{
|
||||
UM.MachineManager.setActiveProfile(model_data.name);
|
||||
if (!model_data.active) {
|
||||
Cura.MachineManager.setActiveQuality(model_data.id);
|
||||
/*if (!model_data.active) {
|
||||
//Selecting a profile was canceled; undo menu selection
|
||||
profileSelectionInstantiator.model.setProperty(model_index, "active", false);
|
||||
var activeProfileName = UM.MachineManager.activeProfile;
|
||||
var activeProfileIndex = profileSelectionInstantiator.model.find("name", activeProfileName);
|
||||
profileSelectionInstantiator.model.setProperty(activeProfileIndex, "active", true);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
82
resources/qml/Settings/SettingCategory.qml
Normal file
82
resources/qml/Settings/SettingCategory.qml
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
|
||||
import ".."
|
||||
|
||||
Button {
|
||||
id: base;
|
||||
|
||||
style: UM.Theme.styles.sidebar_category;
|
||||
|
||||
signal showTooltip(string text);
|
||||
signal hideTooltip();
|
||||
signal contextMenuRequested()
|
||||
|
||||
text: definition.label
|
||||
iconSource: UM.Theme.getIcon(definition.icon)
|
||||
|
||||
checkable: true
|
||||
checked: definition.expanded
|
||||
|
||||
onClicked: definition.expanded ? settingDefinitionsModel.collapse(definition.key) : settingDefinitionsModel.expandAll(definition.key)
|
||||
|
||||
UM.SimpleButton {
|
||||
id: settingsButton
|
||||
|
||||
visible: base.hovered || settingsButton.hovered
|
||||
height: base.height * 0.6
|
||||
width: base.height * 0.6
|
||||
|
||||
anchors {
|
||||
right: inheritButton.visible ? inheritButton.left : parent.right
|
||||
rightMargin: inheritButton.visible? UM.Theme.getSize("default_margin").width / 2 : UM.Theme.getSize("setting_preferences_button_margin").width
|
||||
verticalCenter: parent.verticalCenter;
|
||||
}
|
||||
|
||||
color: UM.Theme.getColor("setting_control_button");
|
||||
hoverColor: UM.Theme.getColor("setting_control_button_hover")
|
||||
iconSource: UM.Theme.getIcon("settings");
|
||||
|
||||
onClicked: {
|
||||
Actions.configureSettingVisibility.trigger(definition)
|
||||
}
|
||||
}
|
||||
|
||||
UM.SimpleButton
|
||||
{
|
||||
id: inheritButton;
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("setting_preferences_button_margin").width
|
||||
|
||||
visible: hiddenValuesCount > 0
|
||||
height: parent.height / 2;
|
||||
width: height;
|
||||
|
||||
onClicked: {
|
||||
base.showAllHiddenInheritedSettings()
|
||||
}
|
||||
|
||||
color: UM.Theme.getColor("setting_control_button")
|
||||
hoverColor: UM.Theme.getColor("setting_control_button_hover")
|
||||
iconSource: UM.Theme.getIcon("notice")
|
||||
|
||||
onEntered: {
|
||||
base.showTooltip(catalog.i18nc("@label","Some hidden settings use values different from their normal calculated value.\n\nClick to make these settings visible."))
|
||||
}
|
||||
|
||||
onExited: {
|
||||
base.hideTooltip();
|
||||
}
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
}
|
||||
}
|
||||
78
resources/qml/Settings/SettingCheckBox.qml
Normal file
78
resources/qml/Settings/SettingCheckBox.qml
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
|
||||
SettingItem
|
||||
{
|
||||
id: base
|
||||
|
||||
contents: MouseArea
|
||||
{
|
||||
id: control
|
||||
anchors.fill: parent
|
||||
|
||||
property bool checked:
|
||||
{
|
||||
switch(propertyProvider.properties.value)
|
||||
{
|
||||
case "True":
|
||||
return true
|
||||
case "False":
|
||||
return false
|
||||
default:
|
||||
return propertyProvider.properties.value
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: propertyProvider.setPropertyValue("value", !checked)
|
||||
|
||||
Rectangle
|
||||
{
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
}
|
||||
width: height
|
||||
|
||||
color:
|
||||
{
|
||||
if (!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled")
|
||||
}
|
||||
if(control.containsMouse || control.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_highlight")
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("setting_control")
|
||||
}
|
||||
}
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : control.containsMouse ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
||||
|
||||
UM.RecolorImage {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width/2.5
|
||||
height: parent.height/2.5
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");
|
||||
source: UM.Theme.getIcon("check")
|
||||
opacity: control.checked ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: 100; } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
109
resources/qml/Settings/SettingComboBox.qml
Normal file
109
resources/qml/Settings/SettingComboBox.qml
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
|
||||
SettingItem
|
||||
{
|
||||
id: base
|
||||
|
||||
contents: ComboBox
|
||||
{
|
||||
id: control
|
||||
|
||||
model: definition.options
|
||||
textRole: "value";
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
MouseArea
|
||||
{
|
||||
anchors.fill: parent;
|
||||
acceptedButtons: Qt.NoButton;
|
||||
onWheel: wheel.accepted = true;
|
||||
}
|
||||
|
||||
style: ComboBoxStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
color:
|
||||
{
|
||||
if (!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled")
|
||||
}
|
||||
if(control.hovered || base.activeFocus)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_highlight")
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("setting_control")
|
||||
}
|
||||
}
|
||||
border.width: UM.Theme.getSize("default_lining").width;
|
||||
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : control.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border");
|
||||
}
|
||||
label: Item
|
||||
{
|
||||
Label
|
||||
{
|
||||
anchors.left: parent.left;
|
||||
anchors.leftMargin: UM.Theme.getSize("default_lining").width
|
||||
anchors.right: downArrow.left;
|
||||
anchors.rightMargin: UM.Theme.getSize("default_lining").width;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
|
||||
text: control.currentText;
|
||||
font: UM.Theme.getFont("default");
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text");
|
||||
|
||||
elide: Text.ElideRight;
|
||||
verticalAlignment: Text.AlignVCenter;
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: downArrow
|
||||
anchors.right: parent.right;
|
||||
anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2;
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
|
||||
source: UM.Theme.getIcon("arrow_bottom")
|
||||
width: UM.Theme.getSize("standard_arrow").width
|
||||
height: UM.Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width + 5
|
||||
sourceSize.height: width + 5
|
||||
|
||||
color: UM.Theme.getColor("setting_control_text");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onActivated: provider.setPropertyValue("value", definition.options[index].key)
|
||||
onModelChanged: updateCurrentIndex();
|
||||
|
||||
Connections
|
||||
{
|
||||
target: provider
|
||||
onPropertiesChanged: control.updateCurrentIndex()
|
||||
}
|
||||
|
||||
function updateCurrentIndex() {
|
||||
for(var i = 0; i < definition.options.length; ++i) {
|
||||
if(definition.options[i].key == provider.properties.value) {
|
||||
currentIndex = i;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
currentIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
155
resources/qml/Settings/SettingItem.qml
Normal file
155
resources/qml/Settings/SettingItem.qml
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
|
||||
import "."
|
||||
|
||||
Item {
|
||||
id: base;
|
||||
|
||||
height: UM.Theme.getSize("section").height;
|
||||
|
||||
property alias contents: controlContainer.children;
|
||||
property alias hovered: mouse.containsMouse
|
||||
|
||||
signal contextMenuRequested()
|
||||
signal showTooltip(string text);
|
||||
signal hideTooltip();
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouse;
|
||||
|
||||
anchors.fill: parent;
|
||||
|
||||
acceptedButtons: Qt.RightButton;
|
||||
hoverEnabled: true;
|
||||
|
||||
onClicked: base.contextMenuRequested();
|
||||
|
||||
onEntered: {
|
||||
hoverTimer.start();
|
||||
}
|
||||
|
||||
onExited: {
|
||||
if(controlContainer.item && controlContainer.item.hovered) {
|
||||
return;
|
||||
}
|
||||
hoverTimer.stop();
|
||||
base.hideTooltip();
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: hoverTimer;
|
||||
interval: 500;
|
||||
repeat: false;
|
||||
|
||||
onTriggered: base.showTooltip(definition.description);
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: label;
|
||||
|
||||
anchors.left: parent.left;
|
||||
anchors.leftMargin: (UM.Theme.getSize("section_icon_column").width + 5) + ((definition.depth - 1) * UM.Theme.getSize("setting_control_depth_margin").width)
|
||||
anchors.right: settingControls.left;
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
height: UM.Theme.getSize("section").height;
|
||||
verticalAlignment: Text.AlignVCenter;
|
||||
|
||||
text: definition.label
|
||||
elide: Text.ElideMiddle;
|
||||
|
||||
color: UM.Theme.getColor("setting_control_text");
|
||||
font: UM.Theme.getFont("default");
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
id: settingControls
|
||||
|
||||
height: parent.height / 2
|
||||
spacing: UM.Theme.getSize("default_margin").width / 2
|
||||
|
||||
anchors {
|
||||
right: controlContainer.left
|
||||
rightMargin: UM.Theme.getSize("default_margin").width / 2
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
UM.SimpleButton
|
||||
{
|
||||
id: revertButton;
|
||||
|
||||
visible: propertyProvider.properties.state == "InstanceState.User"
|
||||
|
||||
height: parent.height;
|
||||
width: height;
|
||||
|
||||
backgroundColor: UM.Theme.getColor("setting_control");
|
||||
hoverBackgroundColor: UM.Theme.getColor("setting_control_highlight")
|
||||
color: UM.Theme.getColor("setting_control_button")
|
||||
hoverColor: UM.Theme.getColor("setting_control_button_hover")
|
||||
|
||||
iconSource: UM.Theme.getIcon("reset")
|
||||
|
||||
onClicked: {
|
||||
base.resetRequested()
|
||||
controlContainer.notifyReset();
|
||||
}
|
||||
|
||||
onEntered: base.showTooltip(catalog.i18nc("@label", "This setting has a value that is different from the profile.\n\nClick to restore the value of the profile."))
|
||||
onExited: base.showTooltip(definition.description);
|
||||
}
|
||||
|
||||
UM.SimpleButton
|
||||
{
|
||||
// This button shows when the setting has an inherited function, but is overriden by profile.
|
||||
id: inheritButton;
|
||||
|
||||
//visible: has_profile_value && base.has_inherit_function && base.is_enabled
|
||||
visible: propertyProvider.properties.state == "InstanceState.User"
|
||||
|
||||
height: parent.height;
|
||||
width: height;
|
||||
|
||||
onClicked: {
|
||||
base.resetToDefaultRequested();
|
||||
controlContainer.notifyReset();
|
||||
}
|
||||
|
||||
backgroundColor: UM.Theme.getColor("setting_control");
|
||||
hoverBackgroundColor: UM.Theme.getColor("setting_control_highlight")
|
||||
color: UM.Theme.getColor("setting_control_button")
|
||||
hoverColor: UM.Theme.getColor("setting_control_button_hover")
|
||||
|
||||
iconSource: UM.Theme.getIcon("notice");
|
||||
|
||||
onEntered: base.showTooltip(catalog.i18nc("@label", "This setting is normally calculated, but it currently has an absolute value set.\n\nClick to restore the calculated value."))
|
||||
onExited: base.showTooltip(definition.description);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
id: controlContainer;
|
||||
|
||||
anchors.right: parent.right;
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
width: UM.Theme.getSize("setting_control").width;
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
}
|
||||
}
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "cura" }
|
||||
}
|
||||
155
resources/qml/Settings/SettingTextField.qml
Normal file
155
resources/qml/Settings/SettingTextField.qml
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.2
|
||||
|
||||
import UM 1.1 as UM
|
||||
|
||||
SettingItem
|
||||
{
|
||||
id: base
|
||||
|
||||
contents: Rectangle
|
||||
{
|
||||
id: control
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
property alias hovered: mouseArea.containsMouse;
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: !enabled ? UM.Theme.getColor("setting_control_disabled_border") : hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border")
|
||||
|
||||
property variant parentValue: value //From parent loader
|
||||
function notifyReset() {
|
||||
input.text = format(parentValue)
|
||||
}
|
||||
|
||||
color: {
|
||||
if (!enabled)
|
||||
{
|
||||
return UM.Theme.getColor("setting_control_disabled")
|
||||
}
|
||||
switch(propertyProvider.properties.validationState)
|
||||
{
|
||||
case "ValidatorState.Exception":
|
||||
return UM.Theme.getColor("setting_validation_error")
|
||||
case "ValidatorState.MinimumError":
|
||||
return UM.Theme.getColor("setting_validation_error")
|
||||
case "ValidatorState.MaximumError":
|
||||
return UM.Theme.getColor("setting_validation_error")
|
||||
case "ValidatorState.MinimumWarning":
|
||||
return UM.Theme.getColor("setting_validation_warning")
|
||||
case "ValidatorState.MaximumWarning":
|
||||
return UM.Theme.getColor("setting_validation_warning")
|
||||
case "ValidatorState.Valid":
|
||||
return UM.Theme.getColor("setting_validation_ok")
|
||||
|
||||
default:
|
||||
return UM.Theme.getColor("setting_control")
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
anchors.fill: parent;
|
||||
anchors.margins: UM.Theme.getSize("default_lining").width;
|
||||
color: UM.Theme.getColor("setting_control_highlight")
|
||||
opacity: !control.hovered ? 0 : propertyProvider.properties.validationState == "ValidatorState.Valid" ? 1.0 : 0.35;
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
anchors.right: parent.right;
|
||||
anchors.rightMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter;
|
||||
|
||||
text: definition.unit;
|
||||
color: UM.Theme.getColor("setting_unit")
|
||||
font: UM.Theme.getFont("default")
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouseArea
|
||||
anchors.fill: parent;
|
||||
hoverEnabled: true;
|
||||
cursorShape: Qt.IBeamCursor
|
||||
}
|
||||
|
||||
TextInput
|
||||
{
|
||||
id: input
|
||||
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
leftMargin: UM.Theme.getSize("setting_unit_margin").width
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Keys.onReleased:
|
||||
{
|
||||
// text = text.replace(",", ".") // User convenience. We use dots for decimal values
|
||||
// if(parseFloat(text) != base.parentValue)
|
||||
// {
|
||||
// base.valueChanged(parseFloat(text));
|
||||
// }
|
||||
|
||||
propertyProvider.setPropertyValue("value", text)
|
||||
}
|
||||
|
||||
onEditingFinished:
|
||||
{
|
||||
// if(parseFloat(text) != base.parentValue)
|
||||
// {
|
||||
// base.valueChanged(parseFloat(text));
|
||||
// }
|
||||
propertyProvider.setPropertyValue("value", text)
|
||||
}
|
||||
|
||||
color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text")
|
||||
font: UM.Theme.getFont("default");
|
||||
|
||||
selectByMouse: true;
|
||||
|
||||
maximumLength: 10;
|
||||
|
||||
validator: RegExpValidator { regExp: /[0-9.,-]{0,10}/ }
|
||||
|
||||
Binding
|
||||
{
|
||||
target: input
|
||||
property: "text"
|
||||
value: control.format(propertyProvider.properties.value)
|
||||
when: !input.activeFocus
|
||||
}
|
||||
}
|
||||
|
||||
//Rounds a floating point number to 4 decimals. This prevents floating
|
||||
//point rounding errors.
|
||||
//
|
||||
//input: The number to round.
|
||||
//decimals: The number of decimals (digits after the radix) to round to.
|
||||
//return: The rounded number.
|
||||
function roundFloat(input, decimals)
|
||||
{
|
||||
//First convert to fixed-point notation to round the number to 4 decimals and not introduce new floating point errors.
|
||||
//Then convert to a string (is implicit). The fixed-point notation will be something like "3.200".
|
||||
//Then remove any trailing zeroes and the radix.
|
||||
return input.toFixed(decimals).replace(/\.?0*$/, ""); //Match on periods, if any ( \.? ), followed by any number of zeros ( 0* ), then the end of string ( $ ).
|
||||
}
|
||||
|
||||
//Formats a value for display in the text field.
|
||||
//
|
||||
//This correctly handles formatting of float values.
|
||||
//
|
||||
//input: The string value to format.
|
||||
//return: The formatted string.
|
||||
function format(inputValue) {
|
||||
return parseFloat(inputValue) ? roundFloat(parseFloat(inputValue), 4) : inputValue //If it's a float, round to four decimals.
|
||||
}
|
||||
}
|
||||
}
|
||||
19
resources/qml/Settings/SettingUnknown.qml
Normal file
19
resources/qml/Settings/SettingUnknown.qml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
|
||||
SettingItem
|
||||
{
|
||||
contents: Label
|
||||
{
|
||||
anchors.fill: parent
|
||||
text: value + " " + unit;
|
||||
color: UM.Theme.getColor("setting_control_text")
|
||||
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
}
|
||||
}
|
||||
135
resources/qml/Settings/SettingView.qml
Normal file
135
resources/qml/Settings/SettingView.qml
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
import ".."
|
||||
|
||||
ScrollView
|
||||
{
|
||||
id: base;
|
||||
|
||||
style: UM.Theme.styles.scrollview;
|
||||
flickableItem.flickableDirection: Flickable.VerticalFlick;
|
||||
|
||||
property Action configureSettings;
|
||||
signal showTooltip(Item item, point location, string text);
|
||||
signal hideTooltip();
|
||||
|
||||
ListView
|
||||
{
|
||||
id: contents
|
||||
spacing: UM.Theme.getSize("default_lining").height;
|
||||
|
||||
model: UM.SettingDefinitionsModel { id: definitionsModel; containerId: Cura.MachineManager.activeDefinitionId }
|
||||
|
||||
delegate: Loader
|
||||
{
|
||||
id: delegate
|
||||
|
||||
width: UM.Theme.getSize("sidebar").width;
|
||||
height: provider.properties.enabled ? UM.Theme.getSize("section").height : 0
|
||||
Behavior on height { NumberAnimation { duration: 100 } }
|
||||
opacity: provider.properties.enabled ? 1 : 0
|
||||
Behavior on opacity { NumberAnimation { duration: 100 } }
|
||||
enabled: provider.properties.enabled
|
||||
|
||||
property var definition: model
|
||||
property var settingDefinitionsModel: definitionsModel
|
||||
property var propertyProvider: provider
|
||||
|
||||
//Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
|
||||
asynchronous: QT_VERSION_STR.split(".")[1] >= 5
|
||||
|
||||
source:
|
||||
{
|
||||
switch(model.type)
|
||||
{
|
||||
case "int":
|
||||
return "SettingTextField.qml"
|
||||
case "float":
|
||||
return "SettingTextField.qml"
|
||||
case "enum":
|
||||
return "SettingComboBox.qml"
|
||||
case "bool":
|
||||
return "SettingCheckBox.qml"
|
||||
case "str":
|
||||
return "SettingTextField.qml"
|
||||
case "category":
|
||||
return "SettingCategory.qml"
|
||||
default:
|
||||
return "SettingUnknown.qml"
|
||||
}
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: provider
|
||||
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: model.key
|
||||
watchedProperties: [ "value", "enabled", "state", "validationState" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: item
|
||||
onContextMenuRequested: { contextMenu.key = model.key; contextMenu.popup() }
|
||||
onShowTooltip: base.showTooltip(delegate, { x: 0, y: delegate.height / 2 }, text)
|
||||
onHideTooltip: base.hideTooltip()
|
||||
}
|
||||
}
|
||||
|
||||
UM.I18nCatalog { id: catalog; name: "uranium"; }
|
||||
|
||||
add: Transition {
|
||||
SequentialAnimation {
|
||||
NumberAnimation { properties: "height"; from: 0; duration: 100 }
|
||||
NumberAnimation { properties: "opacity"; from: 0; duration: 100 }
|
||||
}
|
||||
}
|
||||
remove: Transition {
|
||||
SequentialAnimation {
|
||||
NumberAnimation { properties: "opacity"; to: 0; duration: 100 }
|
||||
NumberAnimation { properties: "height"; to: 0; duration: 100 }
|
||||
}
|
||||
}
|
||||
addDisplaced: Transition {
|
||||
NumberAnimation { properties: "x,y"; duration: 100 }
|
||||
}
|
||||
removeDisplaced: Transition {
|
||||
SequentialAnimation {
|
||||
PauseAnimation { duration: 100; }
|
||||
NumberAnimation { properties: "x,y"; duration: 100 }
|
||||
}
|
||||
}
|
||||
|
||||
Menu
|
||||
{
|
||||
id: contextMenu;
|
||||
|
||||
property string key;
|
||||
|
||||
MenuItem
|
||||
{
|
||||
//: Settings context menu action
|
||||
text: catalog.i18nc("@action:menu", "Hide this setting");
|
||||
onTriggered: definitionsModel.hide(contextMenu.key);
|
||||
}
|
||||
MenuItem
|
||||
{
|
||||
//: Settings context menu action
|
||||
text: catalog.i18nc("@action:menu", "Configure setting visiblity...");
|
||||
|
||||
onTriggered: Actions.configureSettingVisibility.trigger(contextMenu);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
119
resources/qml/Settings/SettingsConfigurationPage.qml
Normal file
119
resources/qml/Settings/SettingsConfigurationPage.qml
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
// Copyright (c) 2015 Ultimaker B.V.
|
||||
// Uranium is released under the terms of the AGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
import QtQuick.Dialogs 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQml 2.2
|
||||
|
||||
import UM 1.1 as UM
|
||||
|
||||
import "../Preferences"
|
||||
|
||||
PreferencesPage
|
||||
{
|
||||
//: Machine configuration page title.
|
||||
title: catalog.i18nc("@title:tab","Machine");
|
||||
id: base
|
||||
|
||||
contents: ColumnLayout
|
||||
{
|
||||
z: base.z
|
||||
anchors.fill: parent;
|
||||
UM.I18nCatalog { id: catalog; name:"uranium"}
|
||||
RowLayout
|
||||
{
|
||||
//: Active machine combo box label
|
||||
Label { text: catalog.i18nc("@label:listbox","Active Machine:"); }
|
||||
ComboBox
|
||||
{
|
||||
id: machineCombo;
|
||||
Layout.fillWidth: true;
|
||||
model: UM.Models.machinesModel;
|
||||
textRole: "name";
|
||||
onActivated:
|
||||
{
|
||||
if(index != -1)
|
||||
UM.Models.machinesModel.setActive(index);
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
id: machineChange
|
||||
target: UM.Application
|
||||
onMachineChanged: machineCombo.currentIndex = machineCombo.find(UM.Application.machineName);
|
||||
}
|
||||
|
||||
Component.onCompleted: machineCombo.currentIndex = machineCombo.find(UM.Application.machineName);
|
||||
}
|
||||
//: Remove active machine button
|
||||
Button { text: catalog.i18nc("@action:button","Remove"); onClicked: confirmRemoveDialog.open(); }
|
||||
}
|
||||
ScrollView
|
||||
{
|
||||
id: settingsScrollView
|
||||
Layout.fillWidth: true;
|
||||
Layout.fillHeight: true;
|
||||
|
||||
ListView
|
||||
{
|
||||
id: settingsListView
|
||||
delegate: settingDelegate
|
||||
model: UM.Models.settingsModel
|
||||
x: 0
|
||||
|
||||
section.property: "category"
|
||||
section.delegate: Label { text: section }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component
|
||||
{
|
||||
id: settingDelegate
|
||||
CheckBox
|
||||
{
|
||||
z:0
|
||||
id: settingCheckBox
|
||||
text: model.name;
|
||||
x: depth * 25
|
||||
checked: model.visibility
|
||||
onClicked: ListView.view.model.setVisibility(model.key, checked)
|
||||
//enabled: !model.disabled
|
||||
|
||||
onHoveredChanged:
|
||||
{
|
||||
if(hovered)
|
||||
{
|
||||
var xPos = parent.x + settingCheckBox.width;
|
||||
var yPos = parent.y;
|
||||
toolTip.show(model.description, 1000, 200, undefined, undefined) //tooltip-text, hover-delay in msec, animation-length in msec, position X, position Y (both y en x == undefined: gives the tooltip a standard placement in the right corner)
|
||||
} else
|
||||
{
|
||||
toolTip.hide(0, 0)//hover-delay in msec, animation-length in msec
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PreferencesToolTip
|
||||
{
|
||||
id: toolTip;
|
||||
}
|
||||
|
||||
MessageDialog
|
||||
{
|
||||
id: confirmRemoveDialog;
|
||||
|
||||
icon: StandardIcon.Question;
|
||||
//: Remove machine confirmation dialog title
|
||||
title: catalog.i18nc("@title:window","Confirm Machine Deletion");
|
||||
//: Remove machine confirmation dialog text
|
||||
text: catalog.i18nc("@label","Are you sure you wish to remove the machine?");
|
||||
standardButtons: StandardButton.Yes | StandardButton.No;
|
||||
|
||||
onYes: UM.Models.machinesModel.removeMachine(machineCombo.currentIndex);
|
||||
}
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ Rectangle
|
|||
function showTooltip(item, position, text)
|
||||
{
|
||||
tooltip.text = text;
|
||||
position = item.mapToItem(base, position.x, position.y / 2);
|
||||
position = item.mapToItem(base, position.x, position.y);
|
||||
tooltip.show(position);
|
||||
}
|
||||
|
||||
|
|
@ -247,7 +247,6 @@ Rectangle
|
|||
id: sidebarAdvanced;
|
||||
visible: false;
|
||||
|
||||
configureSettings: base.configureSettingsAction;
|
||||
onShowTooltip: base.showTooltip(item, location, text)
|
||||
onHideTooltip: base.hideTooltip()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ import QtQuick 2.0
|
|||
|
||||
import QtQuick.Controls 1.2
|
||||
|
||||
import UM 1.0 as UM
|
||||
import "Settings"
|
||||
|
||||
UM.SettingView {
|
||||
expandedCategories: Printer.expandedCategories;
|
||||
onExpandedCategoriesChanged: Printer.setExpandedCategories(expandedCategories);
|
||||
SettingView {
|
||||
// expandedCategories: Printer.expandedCategories;
|
||||
// onExpandedCategoriesChanged: Printer.setExpandedCategories(expandedCategories);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ import QtQuick 2.2
|
|||
import QtQuick.Controls 1.1
|
||||
import QtQuick.Controls.Styles 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
{
|
||||
|
|
@ -57,10 +58,10 @@ Item
|
|||
|
||||
ToolButton {
|
||||
id: machineSelection
|
||||
text: UM.MachineManager.activeMachineInstance;
|
||||
text: Cura.MachineManager.activeMachineName;
|
||||
width: parent.width/100*55
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
tooltip: UM.MachineManager.activeMachineInstance;
|
||||
tooltip: Cura.MachineManager.activeMachineName;
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
@ -71,14 +72,17 @@ Item
|
|||
id: machineSelectionMenu
|
||||
Instantiator
|
||||
{
|
||||
model: UM.MachineInstancesModel { }
|
||||
model: UM.ContainerStacksModel
|
||||
{
|
||||
filter: {"type": "machine"}
|
||||
}
|
||||
MenuItem
|
||||
{
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: model.active;
|
||||
checked: Cura.MachineManager.activeMachineId == model.id
|
||||
exclusiveGroup: machineSelectionMenuGroup;
|
||||
onTriggered: UM.MachineManager.setActiveMachineInstance(model.name);
|
||||
onTriggered: Cura.MachineManager.setActiveMachine(model.id);
|
||||
}
|
||||
onObjectAdded: machineSelectionMenu.insertItem(index, object)
|
||||
onObjectRemoved: machineSelectionMenu.removeItem(object)
|
||||
|
|
@ -100,12 +104,12 @@ Item
|
|||
anchors.topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
|
||||
width: base.width
|
||||
height: visible ? UM.Theme.getSize("sidebar_setup").height : 0
|
||||
visible: UM.MachineManager.hasVariants || UM.MachineManager.hasMaterials
|
||||
visible: Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials
|
||||
|
||||
Label{
|
||||
id: variantLabel
|
||||
text: (UM.MachineManager.hasVariants && UM.MachineManager.hasMaterials) ? catalog.i18nc("@label","Nozzle & Material:"):
|
||||
UM.MachineManager.hasVariants ? catalog.i18nc("@label","Nozzle:") : catalog.i18nc("@label","Material:");
|
||||
text: (Cura.MachineManager.hasVariants && Cura.MachineManager.hasMaterials) ? catalog.i18nc("@label","Nozzle & Material:"):
|
||||
Cura.MachineManager.hasVariants ? catalog.i18nc("@label","Nozzle:") : catalog.i18nc("@label","Material:");
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
@ -114,7 +118,8 @@ Item
|
|||
color: UM.Theme.getColor("text");
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Rectangle
|
||||
{
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
@ -124,9 +129,9 @@ Item
|
|||
|
||||
ToolButton {
|
||||
id: variantSelection
|
||||
text: UM.MachineManager.activeMachineVariant
|
||||
tooltip: UM.MachineManager.activeMachineVariant;
|
||||
visible: UM.MachineManager.hasVariants
|
||||
text: Cura.MachineManager.activeVariantName
|
||||
tooltip: Cura.MachineManager.activeVariantName;
|
||||
visible: Cura.MachineManager.hasVariants
|
||||
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: materialSelection.visible ? (parent.width - UM.Theme.getSize("default_margin").width) / 2 : parent.width
|
||||
|
|
@ -139,23 +144,30 @@ Item
|
|||
Instantiator
|
||||
{
|
||||
id: variantSelectionInstantiator
|
||||
model: UM.MachineVariantsModel { id: variantsModel }
|
||||
model: UM.InstanceContainersModel
|
||||
{
|
||||
filter:
|
||||
{
|
||||
"type": "variant",
|
||||
"definition": Cura.MachineManager.activeDefinitionId //Only show variants of this machine
|
||||
}
|
||||
}
|
||||
MenuItem
|
||||
{
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: model.active;
|
||||
checked: model.id == Cura.MachineManager.activeVariantId;
|
||||
exclusiveGroup: variantSelectionMenuGroup;
|
||||
onTriggered:
|
||||
{
|
||||
UM.MachineManager.setActiveMachineVariant(variantsModel.getItem(index).name);
|
||||
if (typeof(model) !== "undefined" && !model.active) {
|
||||
Cura.MachineManager.setActiveVariant(model.id);
|
||||
/*if (typeof(model) !== "undefined" && !model.active) {
|
||||
//Selecting a variant was canceled; undo menu selection
|
||||
variantSelectionInstantiator.model.setProperty(index, "active", false);
|
||||
var activeMachineVariantName = UM.MachineManager.activeMachineVariant;
|
||||
var activeMachineVariantIndex = variantSelectionInstantiator.model.find("name", activeMachineVariantName);
|
||||
variantSelectionInstantiator.model.setProperty(activeMachineVariantIndex, "active", true);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
onObjectAdded: variantsSelectionMenu.insertItem(index, object)
|
||||
|
|
@ -168,9 +180,9 @@ Item
|
|||
|
||||
ToolButton {
|
||||
id: materialSelection
|
||||
text: UM.MachineManager.activeMaterial
|
||||
tooltip: UM.MachineManager.activeMaterial
|
||||
visible: UM.MachineManager.hasMaterials
|
||||
text: Cura.MachineManager.activeMaterialName
|
||||
tooltip: Cura.MachineManager.activeMaterialName
|
||||
visible: Cura.MachineManager.hasMaterials
|
||||
|
||||
height: UM.Theme.getSize("setting_control").height
|
||||
width: variantSelection.visible ? (parent.width - UM.Theme.getSize("default_margin").width) / 2 : parent.width
|
||||
|
|
@ -183,23 +195,26 @@ Item
|
|||
Instantiator
|
||||
{
|
||||
id: materialSelectionInstantiator
|
||||
model: UM.MachineMaterialsModel { id: machineMaterialsModel }
|
||||
model: UM.InstanceContainersModel
|
||||
{
|
||||
filter: { "type": "material", "definition": Cura.MachineManager.activeDefinitionId }
|
||||
}
|
||||
MenuItem
|
||||
{
|
||||
text: model.name;
|
||||
checkable: true;
|
||||
checked: model.active;
|
||||
checked: model.id == Cura.MachineManager.activeMaterialId;
|
||||
exclusiveGroup: materialSelectionMenuGroup;
|
||||
onTriggered:
|
||||
{
|
||||
UM.MachineManager.setActiveMaterial(machineMaterialsModel.getItem(index).name);
|
||||
if (typeof(model) !== "undefined" && !model.active) {
|
||||
Cura.MachineManager.setActiveMaterial(model.id);
|
||||
/*if (typeof(model) !== "undefined" && !model.active) {
|
||||
//Selecting a material was canceled; undo menu selection
|
||||
materialSelectionInstantiator.model.setProperty(index, "active", false);
|
||||
var activeMaterialName = UM.MachineManager.activeMaterial;
|
||||
var activeMaterialName = Cura.MachineManager.activeMaterialName
|
||||
var activeMaterialIndex = materialSelectionInstantiator.model.find("name", activeMaterialName);
|
||||
materialSelectionInstantiator.model.setProperty(activeMaterialIndex, "active", true);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
onObjectAdded: materialSelectionMenu.insertItem(index, object)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ import QtQuick.Controls 1.1
|
|||
import QtQuick.Controls.Styles 1.1
|
||||
import QtQuick.Layouts 1.1
|
||||
|
||||
import UM 1.1 as UM
|
||||
import UM 1.2 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Item
|
||||
{
|
||||
|
|
@ -56,12 +57,7 @@ Item
|
|||
Repeater {
|
||||
id: infillListView
|
||||
property int activeIndex: {
|
||||
if(!UM.ActiveProfile.valid)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
var density = parseInt(UM.ActiveProfile.settingValues.getValue("infill_sparse_density"));
|
||||
var density = parseInt(infillDensity.properties.value)
|
||||
for(var i = 0; i < infillModel.count; ++i)
|
||||
{
|
||||
if(density > infillModel.get(i).percentageMin && density <= infillModel.get(i).percentageMax )
|
||||
|
|
@ -116,11 +112,11 @@ Item
|
|||
onClicked: {
|
||||
if (infillListView.activeIndex != index)
|
||||
{
|
||||
UM.MachineManager.setSettingValue("infill_sparse_density", model.percentage)
|
||||
infillDensity.setPropertyValue("value", model.percentage)
|
||||
}
|
||||
}
|
||||
onEntered: {
|
||||
base.showTooltip(infillCellRight, Qt.point(-infillCellRight.x, parent.height), model.text);
|
||||
base.showTooltip(infillCellRight, Qt.point(-infillCellRight.x, 0), model.text);
|
||||
}
|
||||
onExited: {
|
||||
base.hideTooltip();
|
||||
|
|
@ -213,18 +209,19 @@ Item
|
|||
text: catalog.i18nc("@option:check","Generate Brim");
|
||||
style: UM.Theme.styles.checkbox;
|
||||
|
||||
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.getValue("adhesion_type") == "brim" : false;
|
||||
checked: platformAdhesionType.properties.value == "brim"
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked:
|
||||
{
|
||||
UM.MachineManager.setSettingValue("adhesion_type", !parent.checked?"brim":"skirt")
|
||||
platformAdhesionType.setPropertyValue("value", !parent.checked ? "brim" : "skirt")
|
||||
}
|
||||
onEntered:
|
||||
{
|
||||
parent.hovered_ex = true
|
||||
base.showTooltip(brimCheckBox, Qt.point(-helpersCellRight.x, parent.height),
|
||||
base.showTooltip(brimCheckBox, Qt.point(-helpersCellRight.x, 0),
|
||||
catalog.i18nc("@label", "Enable printing a brim. This will add a single-layer-thick flat area around your object which is easy to cut off afterwards."));
|
||||
}
|
||||
onExited:
|
||||
|
|
@ -246,18 +243,18 @@ Item
|
|||
text: catalog.i18nc("@option:check","Generate Support Structure");
|
||||
style: UM.Theme.styles.checkbox;
|
||||
|
||||
checked: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.getValue("support_enable") : false;
|
||||
checked: supportEnabled.properties.value == "True"
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked:
|
||||
{
|
||||
UM.MachineManager.setSettingValue("support_enable", !parent.checked)
|
||||
supportEnabled.setPropertyValue("value", !parent.checked)
|
||||
}
|
||||
onEntered:
|
||||
{
|
||||
parent.hovered_ex = true
|
||||
base.showTooltip(supportCheckBox, Qt.point(-helpersCellRight.x, parent.height),
|
||||
base.showTooltip(supportCheckBox, Qt.point(-helpersCellRight.x, 0),
|
||||
catalog.i18nc("@label", "Enable printing support structures. This will build up supporting structures below the model to prevent the model from sagging or printing in mid air."));
|
||||
}
|
||||
onExited:
|
||||
|
|
@ -271,15 +268,15 @@ Item
|
|||
|
||||
function populateExtruderModel()
|
||||
{
|
||||
extruderModel.clear()
|
||||
var extruder_count = UM.MachineManager.getSettingValue("machine_extruder_count");
|
||||
for(var extruder = 0; extruder < extruder_count ; extruder++) {
|
||||
extruderModel.append({
|
||||
name: catalog.i18nc("@label", "Extruder %1").arg(extruder),
|
||||
text: catalog.i18nc("@label", "Extruder %1").arg(extruder),
|
||||
value: extruder
|
||||
})
|
||||
}
|
||||
// extruderModel.clear()
|
||||
// var extruder_count = UM.MachineManager.getSettingValue("machine_extruder_count");
|
||||
// for(var extruder = 0; extruder < extruder_count ; extruder++) {
|
||||
// extruderModel.append({
|
||||
// name: catalog.i18nc("@label", "Extruder %1").arg(extruder),
|
||||
// text: catalog.i18nc("@label", "Extruder %1").arg(extruder),
|
||||
// value: extruder
|
||||
// })
|
||||
// }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
@ -290,7 +287,7 @@ Item
|
|||
width: parent.width
|
||||
height: childrenRect.height
|
||||
// Use both UM.ActiveProfile and UM.MachineManager to force UM.MachineManager.getSettingValue() to be reevaluated
|
||||
visible: UM.ActiveProfile.settingValues.getValue("machine_extruder_count") || (UM.MachineManager.getSettingValue("machine_extruder_count") > 1)
|
||||
// visible: UM.ActiveProfile.settingValues.getValue("machine_extruder_count") || (UM.MachineManager.getSettingValue("machine_extruder_count") > 1)
|
||||
|
||||
Label {
|
||||
id: mainExtruderLabel
|
||||
|
|
@ -308,9 +305,9 @@ Item
|
|||
anchors.top: parent.top
|
||||
anchors.left: supportExtruderLabel.right
|
||||
style: UM.Theme.styles.combobox
|
||||
currentIndex: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.getValue("extruder_nr") : 0
|
||||
// currentIndex: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.getValue("extruder_nr") : 0
|
||||
onActivated: {
|
||||
UM.MachineManager.setSettingValue("extruder_nr", index)
|
||||
// UM.MachineManager.setSettingValue("extruder_nr", index)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -335,7 +332,7 @@ Item
|
|||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
anchors.left: supportExtruderLabel.right
|
||||
style: UM.Theme.styles.combobox
|
||||
currentIndex: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.getValue("support_extruder_nr") : 0
|
||||
// currentIndex: UM.ActiveProfile.valid ? UM.ActiveProfile.settingValues.getValue("support_extruder_nr") : 0
|
||||
onActivated: {
|
||||
UM.MachineManager.setSettingValue("support_extruder_nr", index)
|
||||
}
|
||||
|
|
@ -345,12 +342,12 @@ Item
|
|||
id: extruderModel
|
||||
Component.onCompleted: populateExtruderModel()
|
||||
}
|
||||
Connections
|
||||
{
|
||||
id: machineChange
|
||||
target: UM.MachineManager
|
||||
onActiveMachineInstanceChanged: populateExtruderModel()
|
||||
}
|
||||
// Connections
|
||||
// {
|
||||
// id: machineChange
|
||||
// target: UM.MachineManager
|
||||
// onActiveMachineInstanceChanged: populateExtruderModel()
|
||||
// }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
@ -375,4 +372,36 @@ Item
|
|||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: infillDensity
|
||||
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: "infill_sparse_density"
|
||||
watchedProperties: [ "value" ]
|
||||
storeIndex: 0
|
||||
|
||||
onPropertiesChanged: console.log(properties.value)
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: platformAdhesionType
|
||||
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: "adhesion_type"
|
||||
watchedProperties: [ "value" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
|
||||
UM.SettingPropertyProvider
|
||||
{
|
||||
id: supportEnabled
|
||||
|
||||
containerStackId: Cura.MachineManager.activeMachineId
|
||||
key: "support_enable"
|
||||
watchedProperties: [ "value" ]
|
||||
storeIndex: 0
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ UM.PointingRectangle {
|
|||
y = position.y - UM.Theme.getSize("tooltip_arrow_margins").height;
|
||||
}
|
||||
base.opacity = 1;
|
||||
target = Qt.point(40 , position.y)
|
||||
target = Qt.point(40 , position.y + UM.Theme.getSize("tooltip_arrow_margins").height / 2)
|
||||
}
|
||||
|
||||
function hide() {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ Item {
|
|||
Repeater {
|
||||
id: repeat
|
||||
|
||||
model: UM.Models.toolModel
|
||||
model: UM.ToolModel { }
|
||||
|
||||
Button {
|
||||
text: model.name
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ Item
|
|||
|
||||
Component.onDestruction:
|
||||
{
|
||||
if (extruderCheckBox.checked == true){
|
||||
UM.MachineManager.setMachineSettingValue("machine_extruder_drive_upgrade", true)
|
||||
}
|
||||
if (heatedBedCheckBox1.checked == true || heatedBedCheckBox2.checked == true){
|
||||
UM.MachineManager.setMachineSettingValue("machine_heated_bed", true)
|
||||
}
|
||||
|
|
@ -52,12 +49,6 @@ Item
|
|||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
width: parent.width - UM.Theme.getSize("default_margin").width
|
||||
CheckBox
|
||||
{
|
||||
id: extruderCheckBox
|
||||
text: catalog.i18nc("@option:check","Extruder driver ugrades")
|
||||
checked: true
|
||||
}
|
||||
CheckBox
|
||||
{
|
||||
id: heatedBedCheckBox1
|
||||
text: catalog.i18nc("@option:check","Heated printer bed")
|
||||
|
|
|
|||
3
resources/qml/qmldir
Normal file
3
resources/qml/qmldir
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
module Cura
|
||||
|
||||
singleton Actions 1.0 Actions.qml
|
||||
Loading…
Add table
Add a link
Reference in a new issue