mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 00:05:59 +08:00
Use OutputDeviceManagerProxy for save menu and button
This commit is contained in:
parent
c1b55cc651
commit
cb06668628
@ -58,7 +58,7 @@ UM.MainWindow {
|
|||||||
text: "Save Selection to File";
|
text: "Save Selection to File";
|
||||||
enabled: UM.Selection.hasSelection;
|
enabled: UM.Selection.hasSelection;
|
||||||
iconName: "document-save-as";
|
iconName: "document-save-as";
|
||||||
onTriggered: devicesModel.requestWriteSelectionToDevice("local_file");
|
onTriggered: UM.OutputDeviceManager.requestWriteSelectionToDevice("local_file");
|
||||||
}
|
}
|
||||||
Menu {
|
Menu {
|
||||||
id: saveAllMenu
|
id: saveAllMenu
|
||||||
@ -70,8 +70,8 @@ UM.MainWindow {
|
|||||||
model: UM.OutputDevicesModel { id: devicesModel; }
|
model: UM.OutputDevicesModel { id: devicesModel; }
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: model.description
|
text: model.description;
|
||||||
onTriggered: devicesModel.requestWriteToDevice(model.id);
|
onTriggered: UM.OutputDeviceManager.requestWriteToDevice(model.id);
|
||||||
}
|
}
|
||||||
onObjectAdded: saveAllMenu.insertItem(index, object)
|
onObjectAdded: saveAllMenu.insertItem(index, object)
|
||||||
onObjectRemoved: saveAllMenu.removeItem(object)
|
onObjectRemoved: saveAllMenu.removeItem(object)
|
||||||
|
@ -107,13 +107,13 @@ Rectangle {
|
|||||||
anchors.topMargin: UM.Theme.sizes.save_button_text_margin.height;
|
anchors.topMargin: UM.Theme.sizes.save_button_text_margin.height;
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
anchors.leftMargin: UM.Theme.sizes.default_margin.width;
|
||||||
tooltip: devicesModel.activeDevice.description;
|
tooltip: UM.OutputDeviceManager.activeDeviceDescription;
|
||||||
enabled: progress > 0.99 && base.activity == true
|
enabled: progress > 0.99 && base.activity == true
|
||||||
|
|
||||||
width: infoBox.width/6*4.5
|
width: infoBox.width/6*4.5
|
||||||
height: UM.Theme.sizes.save_button_save_to_button.height
|
height: UM.Theme.sizes.save_button_save_to_button.height
|
||||||
|
|
||||||
text: devicesModel.activeDevice.short_description;
|
text: UM.OutputDeviceManager.activeDeviceShortDescription;
|
||||||
|
|
||||||
style: ButtonStyle {
|
style: ButtonStyle {
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
@ -128,7 +128,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
label: Item { }
|
label: Item { }
|
||||||
}
|
}
|
||||||
onClicked: devicesModel.requestWriteToDevice(devicesModel.activeDevice.id)
|
onClicked: UM.OutputDeviceManager.requestWriteToDevice(UM.OutputDeviceManager.activeDevice)
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@ -143,7 +143,7 @@ Rectangle {
|
|||||||
width: infoBox.width/6*1.3 - UM.Theme.sizes.save_button_text_margin.height;
|
width: infoBox.width/6*1.3 - UM.Theme.sizes.save_button_text_margin.height;
|
||||||
height: UM.Theme.sizes.save_button_save_to_button.height
|
height: UM.Theme.sizes.save_button_save_to_button.height
|
||||||
|
|
||||||
iconSource: UM.Theme.icons[devicesModel.activeDevice.icon_name];
|
iconSource: UM.Theme.icons[UM.OutputDeviceManager.activeDeviceIconName];
|
||||||
|
|
||||||
style: ButtonStyle {
|
style: ButtonStyle {
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
@ -188,10 +188,10 @@ Rectangle {
|
|||||||
MenuItem {
|
MenuItem {
|
||||||
text: model.description
|
text: model.description
|
||||||
checkable: true;
|
checkable: true;
|
||||||
checked: model.id == devicesModel.activeDevice.id;
|
checked: model.id == UM.OutputDeviceManager.activeDevice;
|
||||||
exclusiveGroup: devicesMenuGroup;
|
exclusiveGroup: devicesMenuGroup;
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
devicesModel.setActiveDevice(model.id);
|
UM.OutputDeviceManager.setActiveDevice(model.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onObjectAdded: devicesMenu.insertItem(index, object)
|
onObjectAdded: devicesMenu.insertItem(index, object)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user