Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@JayDusara
Copy link

Sketchbook updates automatically when new sketch is saved or when renamed.

Also if the main sketch is deleted from outside the processing window, the user can press SPACE to refresh and reflect changes.

Also, if the working directory is changed in Preferences window, the tree is updated and shows the sketches in the new directory.

Conflicts:
	app/src/processing/app/contrib/ContributionPanel.java
	app/src/processing/app/syntax/JEditTextArea.java
	build/macosx/appbundler.jar
	build/macosx/appbundler/native/main.m
	core/src/processing/core/PGraphics.java
	core/todo.txt
	java/src/processing/mode/java/pdex/JavaTextAreaPainter.java
	todo.txt
Conflicts:
	app/src/processing/app/Mode.java
	app/src/processing/app/PreferencesFrame.java
	app/src/processing/app/Sketch.java
	app/src/processing/app/contrib/ContributionListing.java
	app/src/processing/app/contrib/ContributionManager.java
	app/src/processing/app/contrib/ContributionManagerDialog.java
	app/src/processing/app/contrib/ContributionPanel.java
	app/src/processing/app/contrib/LocalContribution.java
	app/src/processing/app/syntax/JEditTextArea.java
	build/macosx/appbundler.jar
	build/macosx/appbundler/native/main.m
	core/src/processing/core/PGraphics.java
	core/todo.txt
	java/src/processing/mode/java/pdex/JavaTextAreaPainter.java
	todo.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These classes were removed from the source, please don't add them back again.

@JayDusara
Copy link
Author

Corrected the changes as needed. Have a look if everything is okay.

I had one more doubt in mind. While working on the sketchbook refresh issue, i discovered this. In preferences if you set your sketchbook folder to some folder having large number of files (for examples sake say i set it to D: (d-drive)), then it take a lot of time for the PDE to load. That is because the addSketches method is called recursively on the directory to check if a subfolder of this folder contains sketch. Can this be called an issue?

@benfry
Copy link
Contributor

benfry commented Apr 5, 2015

Yes, so now you understand why we don't reload the entire sketchbook whenever a file is saved or renamed. A related issue: #2945

On new/rename/save as, only the portion of the sketchbook tree that has changed (the one file) should be updated. Re-indexing the full sketchbook is way too slow (and overkill) for that situation.

@JayDusara
Copy link
Author

How about this:
Similar to what eclipse does...whenever we define some directory as eclipse workspace, it creates a .metadata folder from which it picks up what all projects were added to the IDE and other settings. Going on similar lines,

  1. when the user is saving a program in this directory for the first time, we add the full path to the index which is stored in a separate file, that file is read only and hidden.
  2. Henceforth whenever the user saves any program in this directory, it is added to the index
  3. Whenever the PDE is started it can directly pick up the index from this index file. For each entry in the index file, we can check if the entry is still valid...i.e. the file has not been moved/deleted etc. (can this checking run on a separate thread so it will not slowdown the PDE loading)
  4. If file is not found for some reason, ask the user if he wants to search it in the directory or knows the location in case he/she moved it.
  5. Also, we keep a copy of the index file in a master folder or perform some kind of logging to retrieve entries in case index file itself is affected in that directory
  6. If somehow the index file in the working directory is deleted, try and retrieve it from the master file.
  7. Finally if all of above fails and user still has files in that directory, and if he/she says yes when prompted to rebuild the indexes, then call those recursive methods

(Besides, there will be other things to take care of)

Has this been already thought of before? or is there some point i am missing regarding the working of the code?

@benfry
Copy link
Contributor

benfry commented Apr 7, 2015

That's much too complicated, and we have always gone out of our way to avoid adding extra metadata or properties files to the sketch folder. If people want Eclipse, they should use Eclipse.

There are three things here:

  1. On new/rename/save as, the entry for that sketch needs to update in the sketchbook menu. That's a regression, and needs to be fixed. sketchbook window doesn't update when sketches are added, renamed, etc #2944
  2. When the sketchbook is (or even files in the current sketch are) modified outside Processing, it should automatically reload. This is handled in other pull requests, but the support is buggy so it's not turned on. PDE erroneously detects changes in non-sketch files #2759
  3. Third is the performance of sketchbook loading, which should be carefully moved to an independent thread: improve start time by populating sketchbook/libraries on threads #2945

#1 is a very high priority. #2 is nice to have. #3 is also a lower priority.

Conflicts:
	app/src/processing/app/Mode.java
	app/src/processing/app/PreferencesFrame.java
	app/src/processing/app/Sketch.java
	build/macosx/appbundler.jar
	build/shared/lib/defaults.txt
	build/shared/lib/languages/PDE_de.properties
	build/shared/lib/languages/PDE_es.properties
	todo.txt
Signed-off-by: JayDusara <dusara39@gmail.com>
@benfry
Copy link
Contributor

benfry commented Apr 25, 2015

Closing this one since it's out of date, it mixes several of the issues at hand (see my last comment), and also includes quite a bit of code that's not related (language, core, and even todo.txt edits).

@benfry benfry closed this Apr 25, 2015
@processing processing locked as resolved and limited conversation to collaborators Sep 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.