From 528814c9e62ba46cee3ab08462b2873797b8adb8 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 29 Oct 2019 09:33:30 +0100 Subject: [PATCH] Make jobname less sensitive to being touched --- resources/qml/JobSpecs.qml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/resources/qml/JobSpecs.qml b/resources/qml/JobSpecs.qml index 63ccbc336a..e48d3facda 100644 --- a/resources/qml/JobSpecs.qml +++ b/resources/qml/JobSpecs.qml @@ -83,10 +83,22 @@ Item text: PrintInformation.jobName horizontalAlignment: TextInput.AlignLeft + property string textBeforeEdit: "" + + onActiveFocusChanged: + { + if (activeFocus) + { + textBeforeEdit = text + } + } + onEditingFinished: { - var new_name = text == "" ? catalog.i18nc("@text Print job name", "Untitled") : text - PrintInformation.setJobName(new_name, true) + if (text != textBeforeEdit) { + var new_name = text == "" ? catalog.i18nc("@text Print job name", "Untitled") : text + PrintInformation.setJobName(new_name, true) + } printJobTextfield.focus = false }