From c9254a3095ad4fc7654cf8dc3a628912c7186668 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 6 Mar 2017 12:15:58 +0100 Subject: [PATCH 1/2] CURA-3397 Enable/disable "keep" and "discard" buttons according to the choice --- .../qml/DiscardOrKeepProfileChangesDialog.qml | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/resources/qml/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/DiscardOrKeepProfileChangesDialog.qml index 4c88801bb0..ed720adafa 100644 --- a/resources/qml/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/DiscardOrKeepProfileChangesDialog.qml @@ -146,7 +146,25 @@ UM.Dialog ] width: 300 currentIndex: UM.Preferences.getValue("cura/choice_on_profile_override") - onCurrentIndexChanged: UM.Preferences.setValue("cura/choice_on_profile_override", currentIndex) + onCurrentIndexChanged: + { + UM.Preferences.setValue("cura/choice_on_profile_override", currentIndex) + if (currentIndex == 1) { + // 1 == "Discard and never ask again", so only enable the "Discard" button + discardButton.enabled = true + keepButton.enabled = false + } + else if (currentIndex == 2) { + // 2 == "Keep and never ask again", so only enable the "Keep" button + keepButton.enabled = true + discardButton.enabled = false + } + else { + // 0 == "Always ask me this", so show both + keepButton.enabled = true + discardButton.enabled = true + } + } } } From 1c15d24e5bc1d650c27467a8852e3012741f6994 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Mon, 6 Mar 2017 12:37:29 +0100 Subject: [PATCH 2/2] CURA-3397 Reduce tableView height to show buttons --- resources/qml/DiscardOrKeepProfileChangesDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/DiscardOrKeepProfileChangesDialog.qml index ed720adafa..26c343ad5c 100644 --- a/resources/qml/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/DiscardOrKeepProfileChangesDialog.qml @@ -64,7 +64,7 @@ UM.Dialog anchors.margins: UM.Theme.getSize("default_margin").width anchors.left: parent.left anchors.right: parent.right - height: base.height - 130 + height: base.height - 200 id: tableView Component {