Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preferences not deleted properly from GUI #1

Closed
argherna opened this issue Jun 9, 2023 · 4 comments
Closed

Preferences not deleted properly from GUI #1

argherna opened this issue Jun 9, 2023 · 4 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@argherna
Copy link
Owner

argherna commented Jun 9, 2023

When a preference node is deleted from the GUI, all indications show that the node is gone. But when the GUI is exited and started again, the node reappears.

@argherna argherna added the help wanted Extra attention is needed label Jun 9, 2023
@argherna
Copy link
Owner Author

argherna commented Jun 9, 2023

There is a command line program you can run that is part of the class RemovePreferencesNode and it will delete the preferences node as expected. This can be shown as follows:

  1. Run RemovePreferencesNode.
  2. Run ExportPreferences exporting the whole subtree of the user or system node (depending on where the target node being removed lived).
  3. Launch the gui and confirm the node is no longer present.

You can see it's gone. But, when removing from the GUI using these steps it doesn't work at all:

  1. Launch the gui.
  2. Select the node to remove, then in the Edit menu select Remove → Node.
  3. The log messages that appear in the console show the removal of the node as if run from the command line and the JTree view of the nodes is updated.
  4. Exit the gui.
  5. Launch the gui again and expand the JTree view of the nodes. The target node is still there.
  6. Further, run ExportPreferences from the command line OR select File → Export.... The exported Preferences XML shows the node is still present.
  7. You can launch the gui again and confirm its presence.

@argherna
Copy link
Owner Author

argherna commented Jun 9, 2023

Speculating the main difference in the running of the RemovePreferencesNode from the command line vs from the gui is the command line is run in the main thread and the gui is run from the event thread.

Another speculation is that updating the JTree view may not be happening the way it ought to be. It's efficient to update just the part of the tree that changed and move on. Would there be a benefit to re-reading both roots of the Preferences tree on each update? It'd be OK if there weren't many Preferences stored but if there were a lot there could be performance problems later.

@argherna
Copy link
Owner Author

This problem is confusing and weird. Worse still, my development platform won't match all the different targets. Therefore, I'm going to remove the features for removing Preferences nodes from the GUI. The command line tools will keep the functionality and it can be run from that.

@argherna argherna added wontfix This will not be worked on and removed help wanted Extra attention is needed labels Jun 13, 2023
@argherna argherna self-assigned this Jun 13, 2023
argherna added a commit that referenced this issue Jun 14, 2023
- Get rid of Remove actions completely.

- Update UI to not show Remove options.
@argherna
Copy link
Owner Author

Fixed by #2 and #3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant