Merge lp:~tapaal-contributor/tapaal/conjunction-button-fix into lp:tapaal

Proposed by Lena Ernstsen
Status: Merged
Approved by: Jiri Srba
Approved revision: 1170
Merged at revision: 1169
Proposed branch: lp:~tapaal-contributor/tapaal/conjunction-button-fix
Merge into: lp:tapaal
Diff against target: 41 lines (+12/-5)
1 file modified
src/pipe/gui/widgets/QueryDialog.java (+12/-5)
To merge this branch: bzr merge lp:~tapaal-contributor/tapaal/conjunction-button-fix
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+423166@code.launchpad.net

Commit message

Fixed issue with copied property when making a conjunction or a disjunction in the query dialog

Description of the change

When the property already includes an "and" and then pressing "and" in the query dialog, the conjunction would be copied, so it appeared twice. This is now fixed.

Also fixed for "or" properties.

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) wrote :

fixes the problem

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/pipe/gui/widgets/QueryDialog.java'
2--- src/pipe/gui/widgets/QueryDialog.java 2021-11-05 06:34:49 +0000
3+++ src/pipe/gui/widgets/QueryDialog.java 2022-05-23 13:05:39 +0000
4@@ -2424,9 +2424,13 @@
5 if (parentNode instanceof TCTLAndListNode) {
6 // current selection is child of an andList node => add
7 // new placeholder conjunct to it
8- andListNode = new TCTLAndListNode((TCTLAndListNode) parentNode);
9- andListNode.addConjunct(new TCTLStatePlaceHolder());
10- addPropertyToQuery(andListNode);
11+ andListNode = new TCTLAndListNode((TCTLAndListNode) parentNode);
12+ andListNode.addConjunct(new TCTLStatePlaceHolder());
13+ UndoableEdit edit = new QueryConstructionEdit(parentNode, andListNode);
14+ newProperty = newProperty.replace(parentNode, andListNode);
15+ updateSelection(andListNode);
16+ undoSupport.postEdit(edit);
17+ queryChanged();
18 } else {
19 TCTLStatePlaceHolder ph = new TCTLStatePlaceHolder();
20 andListNode = new TCTLAndListNode(getStateProperty(currentSelection.getObject()), ph);
21@@ -2436,7 +2440,6 @@
22 checkUntimedAndNode();
23 }
24 }
25-
26 });
27
28 disjunctionButton.addActionListener(new ActionListener() {
29@@ -2458,7 +2461,11 @@
30 // new placeholder disjunct to it
31 orListNode = new TCTLOrListNode((TCTLOrListNode) parentNode);
32 orListNode.addDisjunct(new TCTLStatePlaceHolder());
33- addPropertyToQuery(orListNode);
34+ UndoableEdit edit = new QueryConstructionEdit(parentNode, orListNode);
35+ newProperty = newProperty.replace(parentNode, orListNode);
36+ updateSelection(orListNode);
37+ undoSupport.postEdit(edit);
38+ queryChanged();
39 } else {
40 TCTLStatePlaceHolder ph = new TCTLStatePlaceHolder();
41 orListNode = new TCTLOrListNode(getStateProperty(currentSelection.getObject()), ph);

Subscribers

People subscribed via source and target branches