mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Update Machine and Profile pages with the changes made to ManagementPage
Since all the individual properties are removed and we now just need to handle the buttons ourself. Contributes to CURA-342
This commit is contained in:
parent
c9b1c36cc3
commit
df3275a10a
2 changed files with 84 additions and 47 deletions
|
@ -27,14 +27,35 @@ UM.ManagementPage
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
onAddObject: Printer.requestAddPrinter()
|
buttons: [
|
||||||
onRemoveObject: confirmDialog.open();
|
Button
|
||||||
onRenameObject: renameDialog.open();
|
{
|
||||||
onActivateObject: Cura.MachineManager.setActiveMachine(base.currentItem.id)
|
text: catalog.i18nc("@action:button", "Activate");
|
||||||
|
iconName: "list-activate";
|
||||||
removeEnabled: base.currentItem != null && model.rowCount() > 1
|
enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMaterialId
|
||||||
renameEnabled: base.currentItem != null
|
onClicked: Cura.MachineManager.setActiveMachine(base.currentItem.id)
|
||||||
activateEnabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachineId
|
},
|
||||||
|
Button
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@action:button", "Add");
|
||||||
|
iconName: "list-add";
|
||||||
|
onClicked: Printer.requestAddPrinter()
|
||||||
|
},
|
||||||
|
Button
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@action:button", "Remove");
|
||||||
|
iconName: "list-remove";
|
||||||
|
enabled: base.currentItem != null && model.rowCount() > 1
|
||||||
|
onClicked: confirmDialog.open();
|
||||||
|
},
|
||||||
|
Button
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@action:button", "Rename");
|
||||||
|
iconName: "edit-rename";
|
||||||
|
enabled: base.currentItem != null
|
||||||
|
onClicked: renameDialog.open();
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,6 @@ UM.ManagementPage
|
||||||
id: base;
|
id: base;
|
||||||
|
|
||||||
title: catalog.i18nc("@title:tab", "Profiles");
|
title: catalog.i18nc("@title:tab", "Profiles");
|
||||||
addText: base.currentItem && (base.currentItem.id == Cura.MachineManager.activeQualityId) ? catalog.i18nc("@label", "Create") : catalog.i18nc("@label", "Duplicate")
|
|
||||||
|
|
||||||
model: UM.InstanceContainersModel
|
model: UM.InstanceContainersModel
|
||||||
{
|
{
|
||||||
|
@ -60,27 +59,62 @@ UM.ManagementPage
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
onActivateObject: Cura.MachineManager.setActiveQuality(currentItem.id)
|
buttons: [
|
||||||
onAddObject: {
|
Button
|
||||||
var selectedContainer;
|
{
|
||||||
if (objectList.currentItem.id == Cura.MachineManager.activeQualityId) {
|
text: catalog.i18nc("@action:button", "Activate");
|
||||||
selectedContainer = Cura.MachineManager.newQualityContainerFromQualityAndUser();
|
iconName: "list-activate";
|
||||||
} else {
|
enabled: base.currentItem != null ? base.currentItem.id != Cura.MachineManager.activeQualityId : false;
|
||||||
selectedContainer = Cura.MachineManager.duplicateContainer(base.currentItem.id);
|
onClicked: Cura.MachineManager.setActiveQuality(base.currentItem.id)
|
||||||
|
},
|
||||||
|
Button
|
||||||
|
{
|
||||||
|
text: base.currentItem && (base.currentItem.id == Cura.MachineManager.activeQualityId) ? catalog.i18nc("@label", "Create") : catalog.i18nc("@label", "Duplicate")
|
||||||
|
iconName: "list-add";
|
||||||
|
|
||||||
|
onClicked:
|
||||||
|
{
|
||||||
|
var selectedContainer;
|
||||||
|
if (objectList.currentItem.id == Cura.MachineManager.activeQualityId) {
|
||||||
|
selectedContainer = Cura.MachineManager.newQualityContainerFromQualityAndUser();
|
||||||
|
} else {
|
||||||
|
selectedContainer = Cura.MachineManager.duplicateContainer(base.currentItem.id);
|
||||||
|
}
|
||||||
|
base.selectContainer(selectedContainer);
|
||||||
|
|
||||||
|
renameDialog.removeWhenRejected = true;
|
||||||
|
renameDialog.open();
|
||||||
|
renameDialog.selectText();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Button
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@action:button", "Remove");
|
||||||
|
iconName: "list-remove";
|
||||||
|
enabled: base.currentItem != null ? !base.currentItem.readOnly : false;
|
||||||
|
onClicked: confirmDialog.open();
|
||||||
|
},
|
||||||
|
Button
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@action:button", "Rename");
|
||||||
|
iconName: "edit-rename";
|
||||||
|
enabled: base.currentItem != null ? !base.currentItem.readOnly : false;
|
||||||
|
onClicked: { renameDialog.removeWhenRejected = false; renameDialog.open(); renameDialog.selectText(); }
|
||||||
|
},
|
||||||
|
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()
|
||||||
|
enabled: currentItem != null
|
||||||
}
|
}
|
||||||
base.selectContainer(selectedContainer);
|
]
|
||||||
|
|
||||||
renameDialog.removeWhenRejected = true;
|
|
||||||
renameDialog.open();
|
|
||||||
renameDialog.selectText();
|
|
||||||
}
|
|
||||||
onRemoveObject: confirmDialog.open();
|
|
||||||
onRenameObject: { renameDialog.removeWhenRejected = false; renameDialog.open(); renameDialog.selectText(); }
|
|
||||||
|
|
||||||
activateEnabled: currentItem != null ? currentItem.id != Cura.MachineManager.activeQualityId : false;
|
|
||||||
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(Cura.MachineManager.activeMachineName)
|
scrollviewCaption: catalog.i18nc("@label %1 is printer name","Printer: %1").arg(Cura.MachineManager.activeMachineName)
|
||||||
|
|
||||||
|
@ -211,24 +245,6 @@ UM.ManagementPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
|
||||||
enabled: currentItem != null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
UM.I18nCatalog { id: catalog; name: "uranium"; }
|
UM.I18nCatalog { id: catalog; name: "uranium"; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue