Merge lp:~tapaal-developers/tapaal/fix-915296-disableRename into lp:tapaal

Proposed by Kenneth Yrke Jørgensen
Status: Merged
Approved by: Jiri Srba
Approved revision: 679
Merged at revision: 680
Proposed branch: lp:~tapaal-developers/tapaal/fix-915296-disableRename
Merge into: lp:tapaal
Diff against target: 46 lines (+22/-0)
1 file modified
src/dk/aau/cs/gui/SharedPlacesAndTransitionsPanel.java (+22/-0)
To merge this branch: bzr merge lp:~tapaal-developers/tapaal/fix-915296-disableRename
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Review via email: mp+96517@code.launchpad.net

Commit message

Merged branch to fix bug #915296

Description of the change

Fix bug 915296 where the disable rename and remove buttons in the shared transition/places was not disabled when there where no element in the list.

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

The problem is solved for shared places. However, if you switch to shared transitions,
create one and delete, the rename and remove buttons are still enabled.

review: Needs Fixing
679. By Kenneth Yrke Jørgensen

Now also fixed bug #915296 for shared transitions and when moving between
shared transitions and shared places.

Revision history for this message
Jiri Srba (srba) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/dk/aau/cs/gui/SharedPlacesAndTransitionsPanel.java'
2--- src/dk/aau/cs/gui/SharedPlacesAndTransitionsPanel.java 2012-02-17 19:48:41 +0000
3+++ src/dk/aau/cs/gui/SharedPlacesAndTransitionsPanel.java 2012-03-08 07:56:17 +0000
4@@ -298,6 +298,10 @@
5 moveDownButton.setEnabled(false);
6 moveUpButton.setEnabled(false);
7 }
8+ if (list.getModel().getSize() <= 0){
9+ renameButton.setEnabled(false);
10+ removeButton.setEnabled(false);
11+ }
12 }
13 });
14 placesTransitionsComboBox.setSelectedIndex(0); // Sets up the proper list model
15@@ -624,6 +628,15 @@
16 public void removeElement(SharedPlace place) {
17 network.remove(place);
18 fireContentsChanged(this, 0, getSize());
19+ int numElements = list.getModel().getSize();
20+ if(numElements <= 1) {
21+ moveDownButton.setEnabled(false);
22+ moveUpButton.setEnabled(false);
23+ }
24+ if (numElements <= 0) {
25+ removeButton.setEnabled(false);
26+ renameButton.setEnabled(false);
27+ }
28 }
29
30 public void updatedName(){
31@@ -694,6 +707,15 @@
32 public void removeElement(SharedTransition transition) {
33 network.remove(transition);
34 fireContentsChanged(this, 0, getSize());
35+ int numElements = list.getModel().getSize();
36+ if(numElements <= 1) {
37+ moveDownButton.setEnabled(false);
38+ moveUpButton.setEnabled(false);
39+ }
40+ if (numElements <= 0) {
41+ removeButton.setEnabled(false);
42+ renameButton.setEnabled(false);
43+ }
44 }
45
46 public void updatedName() {

Subscribers

People subscribed via source and target branches