Fix QML warnings due to depricated on<signal> calls in Connections

As of 5.12, the signals used in connections should not be declared as on<signal>, but as
function on<signal>(arguments).
This commit is contained in:
Kostas Karmas 2021-03-30 08:46:14 +02:00
parent a277adae64
commit 7827b36ab7
46 changed files with 113 additions and 122 deletions

View file

@ -27,7 +27,7 @@ Cura.MachineAction
Connections Connections
{ {
target: extrudersModel target: extrudersModel
onItemsChanged: tabNameModel.update() function onItemsChanged() { tabNameModel.update() }
} }
ListModel ListModel

View file

@ -326,7 +326,7 @@ Item
Connections Connections
{ {
target: Cura.MachineManager target: Cura.MachineManager
onGlobalContainerChanged: extruderCountModel.update() function onGlobalContainerChanged() { extruderCountModel.update() }
} }
} }

View file

@ -35,7 +35,7 @@ UM.TooltipArea
Connections Connections
{ {
target: addedSettingsModel target: addedSettingsModel
onVisibleCountChanged: function onVisibleCountChanged()
{ {
check.checked = addedSettingsModel.getVisible(model.key) check.checked = addedSettingsModel.getVisible(model.key)
} }

View file

@ -334,13 +334,13 @@ Item
Connections Connections
{ {
target: inheritStackProvider target: inheritStackProvider
onPropertiesChanged: provider.forcePropertiesChanged() function onPropertiesChanged() { provider.forcePropertiesChanged() }
} }
Connections Connections
{ {
target: UM.ActiveTool target: UM.ActiveTool
onPropertiesChanged: function onPropertiesChanged()
{ {
// the values cannot be bound with UM.ActiveTool.properties.getValue() calls, // the values cannot be bound with UM.ActiveTool.properties.getValue() calls,
// so here we connect to the signal and update the those values. // so here we connect to the signal and update the those values.

View file

@ -414,7 +414,7 @@ UM.Dialog
{ {
target: item target: item
onShowTooltip: function onShowTooltip(text)
{ {
tooltip.text = text tooltip.text = text
var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0) var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0)

View file

@ -55,8 +55,8 @@ Item
Connections Connections
{ {
target: UM.SimulationView target: UM.SimulationView
onMaxPathsChanged: pathSlider.setHandleValue(UM.SimulationView.currentPath) function onMaxPathsChanged() { pathSlider.setHandleValue(UM.SimulationView.currentPath) }
onCurrentPathChanged: function onCurrentPathChanged()
{ {
// Only pause the simulation when the layer was changed manually, not when the simulation is running // Only pause the simulation when the layer was changed manually, not when the simulation is running
if (pathSlider.manuallyChanged) if (pathSlider.manuallyChanged)
@ -89,7 +89,7 @@ Item
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if (preference !== "view/only_show_top_layers" && preference !== "view/top_layer_count" && ! preference.match("layerview/")) if (preference !== "view/only_show_top_layers" && preference !== "view/top_layer_count" && ! preference.match("layerview/"))
{ {
@ -221,9 +221,9 @@ Item
Connections Connections
{ {
target: UM.SimulationView target: UM.SimulationView
onMaxLayersChanged: layerSlider.setUpperValue(UM.SimulationView.currentLayer) function onMaxLayersChanged() { layerSlider.setUpperValue(UM.SimulationView.currentLayer) }
onMinimumLayerChanged: layerSlider.setLowerValue(UM.SimulationView.minimumLayer) function onMinimumLayerChanged() { layerSlider.setLowerValue(UM.SimulationView.minimumLayer) }
onCurrentLayerChanged: function onCurrentLayerChanged()
{ {
// Only pause the simulation when the layer was changed manually, not when the simulation is running // Only pause the simulation when the layer was changed manually, not when the simulation is running
if (layerSlider.manuallyChanged) if (layerSlider.manuallyChanged)

View file

@ -22,7 +22,7 @@ Cura.ExpandableComponent
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if (preference !== "view/only_show_top_layers" && preference !== "view/top_layer_count" && ! preference.match("layerview/")) if (preference !== "view/only_show_top_layers" && preference !== "view/top_layer_count" && ! preference.match("layerview/"))
{ {

View file

@ -100,8 +100,8 @@ Window
Connections Connections
{ {
target: toolbox target: toolbox
onShowLicenseDialog: { licenseDialog.show() } function onShowLicenseDialog() { licenseDialog.show() }
onCloseLicenseDialog: { licenseDialog.close() } function onCloseLicenseDialog() { licenseDialog.close() }
} }
ToolboxLicenseDialog ToolboxLicenseDialog

View file

@ -112,8 +112,8 @@ Column
Connections Connections
{ {
target: toolbox target: toolbox
onInstallChanged: installed = toolbox.isInstalled(model.id) function onInstallChanged() { installed = toolbox.isInstalled(model.id) }
onFilterChanged: function onFilterChanged()
{ {
installed = toolbox.isInstalled(model.id) installed = toolbox.isInstalled(model.id)
} }

View file

@ -117,7 +117,7 @@ Item
Connections Connections
{ {
target: toolbox target: toolbox
onEnabledChanged: isEnabled = toolbox.isEnabled(model.id) function onEnabledChanged() { isEnabled = toolbox.isEnabled(model.id) }
} }
} }
} }

View file

@ -81,7 +81,7 @@ Column
Connections Connections
{ {
target: toolbox target: toolbox
onMetadataChanged: function onMetadataChanged()
{ {
canDowngrade = toolbox.canDowngrade(model.id) canDowngrade = toolbox.canDowngrade(model.id)
} }

View file

@ -93,7 +93,7 @@ Item
Connections Connections
{ {
target: CuraApplication target: CuraApplication
onAdditionalComponentsChanged: base.addAdditionalComponents() function onAdditionalComponentsChanged(areaId) { base.addAdditionalComponents() }
} }
function addAdditionalComponents() function addAdditionalComponents()

View file

@ -127,7 +127,7 @@ Column
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if (preference !== "general/auto_slice") if (preference !== "general/auto_slice")
{ {

View file

@ -88,7 +88,7 @@ UM.MainWindow
{ {
// This connection is used when there is no ActiveMachine and the user is logged in // This connection is used when there is no ActiveMachine and the user is logged in
target: CuraApplication target: CuraApplication
onShowAddPrintersUncancellableDialog: function onShowAddPrintersUncancellableDialog()
{ {
Cura.Actions.parent = backgroundItem Cura.Actions.parent = backgroundItem
@ -102,7 +102,7 @@ UM.MainWindow
Connections Connections
{ {
target: CuraApplication target: CuraApplication
onInitializationFinished: function onInitializationFinished()
{ {
// Workaround silly issues with QML Action's shortcut property. // Workaround silly issues with QML Action's shortcut property.
// //
@ -471,19 +471,19 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.preferences target: Cura.Actions.preferences
onTriggered: preferences.visible = true function onTriggered() { preferences.visible = true }
} }
Connections Connections
{ {
target: CuraApplication target: CuraApplication
onShowPreferencesWindow: preferences.visible = true function onShowPreferencesWindow() { preferences.visible = true }
} }
Connections Connections
{ {
target: Cura.Actions.addProfile target: Cura.Actions.addProfile
onTriggered: function onTriggered()
{ {
preferences.show(); preferences.show();
preferences.setPage(4); preferences.setPage(4);
@ -495,7 +495,7 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.configureMachines target: Cura.Actions.configureMachines
onTriggered: function onTriggered()
{ {
preferences.visible = true; preferences.visible = true;
preferences.setPage(2); preferences.setPage(2);
@ -505,7 +505,7 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.manageProfiles target: Cura.Actions.manageProfiles
onTriggered: function onTriggered()
{ {
preferences.visible = true; preferences.visible = true;
preferences.setPage(4); preferences.setPage(4);
@ -515,7 +515,7 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.manageMaterials target: Cura.Actions.manageMaterials
onTriggered: function onTriggered()
{ {
preferences.visible = true; preferences.visible = true;
preferences.setPage(3) preferences.setPage(3)
@ -525,7 +525,7 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.configureSettingVisibility target: Cura.Actions.configureSettingVisibility
onTriggered: function onTriggered()
{ {
preferences.visible = true; preferences.visible = true;
preferences.setPage(1); preferences.setPage(1);
@ -550,7 +550,7 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.MachineManager target: Cura.MachineManager
onBlurSettings: function onBlurSettings()
{ {
contentItem.forceActiveFocus() contentItem.forceActiveFocus()
} }
@ -594,7 +594,7 @@ UM.MainWindow
Connections Connections
{ {
target: CuraApplication target: CuraApplication
onShowConfirmExitDialog: function onShowConfirmExitDialog(message)
{ {
exitConfirmationDialog.text = message; exitConfirmationDialog.text = message;
exitConfirmationDialog.open(); exitConfirmationDialog.open();
@ -604,19 +604,19 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.quit target: Cura.Actions.quit
onTriggered: CuraApplication.checkAndExitApplication(); function onTriggered() { CuraApplication.checkAndExitApplication(); }
} }
Connections Connections
{ {
target: Cura.Actions.toggleFullScreen target: Cura.Actions.toggleFullScreen
onTriggered: base.toggleFullscreen() function onTriggered() { base.toggleFullscreen() }
} }
Connections Connections
{ {
target: Cura.Actions.exitFullScreen target: Cura.Actions.exitFullScreen
onTriggered: base.exitFullscreen() function onTriggered() { base.exitFullscreen() }
} }
FileDialog FileDialog
@ -761,7 +761,7 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.open target: Cura.Actions.open
onTriggered: openDialog.open() function onTriggered() { openDialog.open() }
} }
OpenFilesIncludingProjectsDialog OpenFilesIncludingProjectsDialog
@ -777,7 +777,7 @@ UM.MainWindow
Connections Connections
{ {
target: CuraApplication target: CuraApplication
onOpenProjectFile: function onOpenProjectFile(project_file, add_to_recent_files)
{ {
askOpenAsProjectOrModelsDialog.fileUrl = project_file; askOpenAsProjectOrModelsDialog.fileUrl = project_file;
askOpenAsProjectOrModelsDialog.addToRecent = add_to_recent_files; askOpenAsProjectOrModelsDialog.addToRecent = add_to_recent_files;
@ -788,7 +788,7 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.showProfileFolder target: Cura.Actions.showProfileFolder
onTriggered: function onTriggered()
{ {
var path = UM.Resources.getPath(UM.Resources.Preferences, ""); var path = UM.Resources.getPath(UM.Resources.Preferences, "");
if(Qt.platform.os == "windows") if(Qt.platform.os == "windows")
@ -820,7 +820,7 @@ UM.MainWindow
Connections Connections
{ {
target: CuraApplication target: CuraApplication
onShowMessageBox: function onShowMessageBox(title, text, informativeText, detailedText, buttons, icon)
{ {
messageDialog.title = title messageDialog.title = title
messageDialog.text = text messageDialog.text = text
@ -844,7 +844,7 @@ UM.MainWindow
Connections Connections
{ {
target: CuraApplication target: CuraApplication
onShowDiscardOrKeepProfileChanges: function onShowDiscardOrKeepProfileChanges()
{ {
discardOrKeepProfileChangesDialogLoader.sourceComponent = discardOrKeepProfileChangesDialogComponent discardOrKeepProfileChangesDialogLoader.sourceComponent = discardOrKeepProfileChangesDialogComponent
discardOrKeepProfileChangesDialogLoader.item.show() discardOrKeepProfileChangesDialogLoader.item.show()
@ -871,13 +871,13 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.whatsNew target: Cura.Actions.whatsNew
onTriggered: whatsNewDialog.show() function onTriggered() { whatsNewDialog.show() }
} }
Connections Connections
{ {
target: Cura.Actions.addMachine target: Cura.Actions.addMachine
onTriggered: function onTriggered()
{ {
// Make sure to show from the first page when the dialog shows up. // Make sure to show from the first page when the dialog shows up.
addMachineDialog.resetModelState() addMachineDialog.resetModelState()
@ -893,7 +893,7 @@ UM.MainWindow
Connections Connections
{ {
target: Cura.Actions.about target: Cura.Actions.about
onTriggered: aboutDialog.visible = true; function onTriggered() { aboutDialog.visible = true; }
} }
Timer Timer

View file

@ -92,6 +92,15 @@ Item
contentContainer.trySetPosition(contentContainer.x, contentContainer.y); contentContainer.trySetPosition(contentContainer.x, contentContainer.y);
} }
onEnabledChanged:
{
if (!base.enabled && expanded)
{
toggleContent();
updateDragPosition();
}
}
// Add this binding since the background color is not updated otherwise // Add this binding since the background color is not updated otherwise
Binding Binding
{ {
@ -103,20 +112,6 @@ Item
} }
} }
// The panel needs to close when it becomes disabled
Connections
{
target: base
onEnabledChanged:
{
if (!base.enabled && expanded)
{
toggleContent();
updateDragPosition();
}
}
}
implicitHeight: 100 * screenScaleFactor implicitHeight: 100 * screenScaleFactor
implicitWidth: 400 * screenScaleFactor implicitWidth: 400 * screenScaleFactor
@ -300,7 +295,7 @@ Item
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if if
( (
@ -342,8 +337,8 @@ Item
{ {
// Since it could be that the content is dynamically populated, we should also take these changes into account. // Since it could be that the content is dynamically populated, we should also take these changes into account.
target: content.contentItem target: content.contentItem
onWidthChanged: content.width = content.contentItem.width + 2 * content.padding function onWidthChanged() { content.width = content.contentItem.width + 2 * content.padding }
onHeightChanged: function onHeightChanged()
{ {
content.height = content.contentItem.height + 2 * content.padding content.height = content.contentItem.height + 2 * content.padding
contentContainer.height = contentHeader.height + content.height contentContainer.height = contentHeader.height + content.height

View file

@ -78,6 +78,14 @@ Item
property int shadowOffset: 2 property int shadowOffset: 2
onEnabledChanged:
{
if (!base.enabled && expanded)
{
toggleContent()
}
}
function toggleContent() function toggleContent()
{ {
if (content.visible) if (content.visible)
@ -98,19 +106,6 @@ Item
value: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled") value: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled")
} }
// The panel needs to close when it becomes disabled
Connections
{
target: base
onEnabledChanged:
{
if (!base.enabled && expanded)
{
toggleContent()
}
}
}
implicitHeight: 100 * screenScaleFactor implicitHeight: 100 * screenScaleFactor
implicitWidth: 400 * screenScaleFactor implicitWidth: 400 * screenScaleFactor
@ -247,7 +242,7 @@ Item
{ {
// Since it could be that the content is dynamically populated, we should also take these changes into account. // Since it could be that the content is dynamically populated, we should also take these changes into account.
target: content.contentItem target: content.contentItem
onWidthChanged: content.width = content.contentItem.width + 2 * content.padding function onWidthChanged() { content.width = content.contentItem.width + 2 * content.padding }
onHeightChanged: content.height = content.contentItem.height + 2 * content.padding function onHeightChanged() { content.height = content.contentItem.height + 2 * content.padding }
} }
} }

View file

@ -149,7 +149,7 @@ Item
Connections Connections
{ {
target: CuraApplication target: CuraApplication
onAdditionalComponentsChanged: base.addAdditionalComponents("jobSpecsButton") function onAdditionalComponentsChanged(areaId) { base.addAdditionalComponents("jobSpecsButton") }
} }
function addAdditionalComponents(areaId) function addAdditionalComponents(areaId)

View file

@ -93,8 +93,8 @@ UM.TooltipArea
Connections Connections
{ {
target: propertyProvider target: propertyProvider
onContainerStackChanged: defaultOptionsModel.updateModel() function onContainerStackChanged() { defaultOptionsModel.updateModel() }
onIsValueUsedChanged: defaultOptionsModel.updateModel() function onIsValueUsedChanged() { defaultOptionsModel.updateModel() }
} }
Cura.ComboBox Cura.ComboBox

View file

@ -54,7 +54,7 @@ NumericTextFieldWithUnit
Connections Connections
{ {
target: textField target: textField
onActiveFocusChanged: function onActiveFocusChanged()
{ {
// When this text field loses focus and the entered text is not valid, make sure to recreate the binding to // When this text field loses focus and the entered text is not valid, make sure to recreate the binding to
// show the correct value. // show the correct value.

View file

@ -169,7 +169,7 @@ Item
Connections Connections
{ {
target: Cura.Actions.newProject target: Cura.Actions.newProject
onTriggered: function onTriggered()
{ {
if(Printer.platformActivity || Cura.MachineManager.hasUserSettings) if(Printer.platformActivity || Cura.MachineManager.hasUserSettings)
{ {
@ -182,7 +182,7 @@ Item
Connections Connections
{ {
target: Cura.Actions.browsePackages target: Cura.Actions.browsePackages
onTriggered: function onTriggered()
{ {
curaExtensions.callExtensionMethod("Toolbox", "launch") curaExtensions.callExtensionMethod("Toolbox", "launch")
} }
@ -192,7 +192,7 @@ Item
Connections Connections
{ {
target: Cura.Actions.marketplaceMaterials target: Cura.Actions.marketplaceMaterials
onTriggered: function onTriggered()
{ {
curaExtensions.callExtensionMethod("Toolbox", "launch") curaExtensions.callExtensionMethod("Toolbox", "launch")
curaExtensions.callExtensionMethod("Toolbox", "setViewCategoryToMaterials") curaExtensions.callExtensionMethod("Toolbox", "setViewCategoryToMaterials")

View file

@ -219,7 +219,7 @@ Button
Connections Connections
{ {
target: Cura.MachineManager target: Cura.MachineManager
onCurrentConfigurationChanged: function onCurrentConfigurationChanged()
{ {
configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration) configurationItem.checked = Cura.MachineManager.matchesConfiguration(configuration)
} }

View file

@ -126,7 +126,7 @@ Item
Connections Connections
{ {
target: outputDevice target: outputDevice
onUniqueConfigurationsChanged: function onUniqueConfigurationsChanged()
{ {
forceModelUpdate() forceModelUpdate()
} }
@ -135,7 +135,7 @@ Item
Connections Connections
{ {
target: Cura.MachineManager target: Cura.MachineManager
onOutputDevicesChanged: function onOutputDevicesChanged()
{ {
forceModelUpdate() forceModelUpdate()
} }

View file

@ -236,6 +236,6 @@ Cura.ExpandablePopup
Connections Connections
{ {
target: Cura.MachineManager target: Cura.MachineManager
onGlobalContainerChanged: popupItem.manual_selected_method = -1 // When switching printers, reset the value of the manual selected method function onGlobalContainerChanged() { popupItem.manual_selected_method = -1 } // When switching printers, reset the value of the manual selected method
} }
} }

View file

@ -118,7 +118,7 @@ Item
Connections Connections
{ {
target: Cura.ExtruderManager target: Cura.ExtruderManager
onActiveExtruderChanged: function onActiveExtruderChanged()
{ {
tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex); tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex);
} }
@ -139,7 +139,7 @@ Item
Connections Connections
{ {
target: repeater.model target: repeater.model
onModelChanged: function onModelChanged()
{ {
tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex) tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex)
} }

View file

@ -90,13 +90,13 @@ Menu
Connections Connections
{ {
target: UM.Controller target: UM.Controller
onContextMenuRequested: base.popup(); function onContextMenuRequested() { base.popup(); }
} }
Connections Connections
{ {
target: Cura.Actions.multiplySelection target: Cura.Actions.multiplySelection
onTriggered: multiplyDialog.open() function onTriggered() { multiplyDialog.open() }
} }
UM.SettingPropertyProvider UM.SettingPropertyProvider

View file

@ -31,7 +31,7 @@ Menu
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if (preference !== "general/camera_perspective_mode") if (preference !== "general/camera_perspective_mode")
{ {

View file

@ -252,9 +252,10 @@ Item
buttonsRow.updateAdditionalComponents("monitorButtons") buttonsRow.updateAdditionalComponents("monitorButtons")
} }
Connections { Connections
{
target: CuraApplication target: CuraApplication
onAdditionalComponentsChanged: buttonsRow.updateAdditionalComponents("monitorButtons") function onAdditionalComponentsChanged() { buttonsRow.updateAdditionalComponents("monitorButtons") }
} }
function updateAdditionalComponents (areaId) { function updateAdditionalComponents (areaId) {

View file

@ -416,7 +416,7 @@ UM.PreferencesPage
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if(preference != "general/camera_perspective_mode") if(preference != "general/camera_perspective_mode")
{ {
@ -856,7 +856,7 @@ UM.PreferencesPage
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if (preference !== "info/send_slice_info") if (preference !== "info/send_slice_info")
{ {

View file

@ -166,7 +166,7 @@ UM.ManagementPage
Connections Connections
{ {
target: Cura.MachineManager target: Cura.MachineManager
onGlobalContainerChanged: function onGlobalContainerChanged()
{ {
objectList.currentIndex = activeMachineIndex() objectList.currentIndex = activeMachineIndex()
objectList.onCurrentIndexChanged() objectList.onCurrentIndexChanged()

View file

@ -134,7 +134,7 @@ Item
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if (preference !== "cura/expanded_types" && preference !== "cura/expanded_brands") if (preference !== "cura/expanded_types" && preference !== "cura/expanded_brands")
{ {

View file

@ -124,13 +124,13 @@ Item
Connections Connections
{ {
target: materialsModel target: materialsModel
onItemsChanged: updateAfterModelChanges() function onItemsChanged() { updateAfterModelChanges() }
} }
Connections Connections
{ {
target: genericMaterialsModel target: genericMaterialsModel
onItemsChanged: updateAfterModelChanges() function onItemsChanged() { updateAfterModelChanges() }
} }
Column Column

View file

@ -124,7 +124,7 @@ Item
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if (preference !== "cura/expanded_types" && preference !== "cura/expanded_brands") if (preference !== "cura/expanded_types" && preference !== "cura/expanded_brands")
{ {

View file

@ -217,7 +217,7 @@ Item
Connections Connections
{ {
target: base.qualityManagementModel target: base.qualityManagementModel
onItemsChanged: function onItemsChanged()
{ {
var toSelectItemName = base.currentItem == null ? "" : base.currentItem.name; var toSelectItemName = base.currentItem == null ? "" : base.currentItem.name;
if (newQualityNameToSelect != "") if (newQualityNameToSelect != "")

View file

@ -244,7 +244,7 @@ Item
Connections Connections
{ {
target: Cura.ExtruderManager target: Cura.ExtruderManager
onActiveExtruderChanged: function onActiveExtruderChanged()
{ {
tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex); tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex);
} }
@ -256,7 +256,7 @@ Item
Connections Connections
{ {
target: repeater.model target: repeater.model
onModelChanged: function onModelChanged()
{ {
tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex) tabBar.setCurrentIndex(Cura.ExtruderManager.activeExtruderIndex)
} }

View file

@ -84,7 +84,7 @@ Item
Connections Connections
{ {
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: function onPreferenceChanged(preference)
{ {
if (preference !== "view/settings_list_height" && preference !== "general/window_height" && preference !== "general/window_state") if (preference !== "view/settings_list_height" && preference !== "general/window_height" && preference !== "general/window_state")
{ {

View file

@ -128,7 +128,7 @@ Item
Connections Connections
{ {
target: extruderModel target: extruderModel
onModelChanged: function onModelChanged()
{ {
var maybeColor = supportExtruderCombobox.model.getItem(supportExtruderCombobox.currentIndex).color var maybeColor = supportExtruderCombobox.model.getItem(supportExtruderCombobox.currentIndex).color
if (maybeColor) if (maybeColor)

View file

@ -17,7 +17,7 @@ Item
Connections Connections
{ {
target: Cura.MachineManager target: Cura.MachineManager
onGlobalContainerChanged: function onGlobalContainerChanged()
{ {
outputDevice = Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null; outputDevice = Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null;
} }

View file

@ -105,13 +105,13 @@ Button
Connections Connections
{ {
target: outputDevice target: outputDevice
onUniqueConfigurationsChanged: updatePrinterTypesFunction() function onUniqueConfigurationsChanged() { updatePrinterTypesFunction() }
} }
Connections Connections
{ {
target: Cura.MachineManager target: Cura.MachineManager
onOutputDevicesChanged: updatePrinterTypesFunction() function onOutputDevicesChanged() { updatePrinterTypesFunction() }
} }
Component.onCompleted: updatePrinterTypesFunction() Component.onCompleted: updatePrinterTypesFunction()

View file

@ -24,7 +24,7 @@ SettingItem
Connections Connections
{ {
target: extrudersModel target: extrudersModel
onModelChanged: function onModelChanged()
{ {
control.color = extrudersModel.getItem(control.currentIndex).color control.color = extrudersModel.getItem(control.currentIndex).color
} }

View file

@ -29,7 +29,7 @@ SettingItem
Connections Connections
{ {
target: base.extrudersWithOptionalModel target: base.extrudersWithOptionalModel
onModelChanged: control.color = base.extrudersWithOptionalModel.getItem(control.currentIndex).color function onModelChanged() { control.color = base.extrudersWithOptionalModel.getItem(control.currentIndex).color }
} }
textRole: "name" textRole: "name"

View file

@ -357,16 +357,16 @@ Item
Connections Connections
{ {
target: item target: item
onContextMenuRequested: function onContextMenuRequested()
{ {
contextMenu.key = model.key; contextMenu.key = model.key;
contextMenu.settingVisible = model.visible; contextMenu.settingVisible = model.visible;
contextMenu.provider = provider contextMenu.provider = provider
contextMenu.popup(); contextMenu.popup();
} }
onShowTooltip: base.showTooltip(delegate, Qt.point(-settingsView.x - UM.Theme.getSize("default_margin").width, 0), text) function onShowTooltip() { base.showTooltip(delegate, Qt.point(-settingsView.x - UM.Theme.getSize("default_margin").width, 0), text) }
onHideTooltip: base.hideTooltip() function onHideTooltip() { base.hideTooltip() }
onShowAllHiddenInheritedSettings: function onShowAllHiddenInheritedSettings()
{ {
var children_with_override = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(category_id) var children_with_override = Cura.SettingInheritanceManager.getChildrenKeysWithOverride(category_id)
for(var i = 0; i < children_with_override.length; i++) for(var i = 0; i < children_with_override.length; i++)
@ -375,7 +375,7 @@ Item
} }
Cura.SettingInheritanceManager.manualRemoveOverride(category_id) Cura.SettingInheritanceManager.manualRemoveOverride(category_id)
} }
onFocusReceived: function onFocusReceived()
{ {
contents.indexWithFocus = index; contents.indexWithFocus = index;
animateContentY.from = contents.contentY; animateContentY.from = contents.contentY;
@ -383,7 +383,7 @@ Item
animateContentY.to = contents.contentY; animateContentY.to = contents.contentY;
animateContentY.running = true; animateContentY.running = true;
} }
onSetActiveFocusToNextSetting: function onSetActiveFocusToNextSetting()
{ {
if (forward == undefined || forward) if (forward == undefined || forward)
{ {

View file

@ -41,7 +41,7 @@ Item
Connections Connections
{ {
target: CuraApplication.getDiscoveredPrintersModel() target: CuraApplication.getDiscoveredPrintersModel()
onDiscoveredPrintersChanged: function onDiscoveredPrintersChanged()
{ {
if (hasRequestFinished && currentRequestAddress) if (hasRequestFinished && currentRequestAddress)
{ {
@ -310,7 +310,7 @@ Item
Connections Connections
{ {
target: CuraApplication.getDiscoveredPrintersModel() target: CuraApplication.getDiscoveredPrintersModel()
onManualDeviceRequestFinished: function onManualDeviceRequestFinished(success)
{ {
var discovered_printers_model = CuraApplication.getDiscoveredPrintersModel() var discovered_printers_model = CuraApplication.getDiscoveredPrintersModel()
var printer = discovered_printers_model.discoveredPrintersByAddress[hostnameField.text] var printer = discovered_printers_model.discoveredPrintersByAddress[hostnameField.text]

View file

@ -35,7 +35,7 @@ Item
Connections Connections
{ {
target: header target: header
onClicked: function onClicked()
{ {
base.contentShown = !base.contentShown base.contentShown = !base.contentShown
clicked() clicked()

View file

@ -27,7 +27,7 @@ Item
Connections Connections
{ {
target: machineActionsModel target: machineActionsModel
onAllFinished: function onAllFinished()
{ {
if (visible) if (visible)
{ {

View file

@ -61,6 +61,6 @@ Item
Connections Connections
{ {
target: model target: model
onAllFinished: dialog.visible = false function onAllFinished() { dialog.visible = false }
} }
} }

View file

@ -47,6 +47,6 @@ Window
Connections Connections
{ {
target: model target: model
onAllFinished: dialog.hide() function onAllFinished() { dialog.hide() }
} }
} }