-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Restore auto rename feature 2 #12604
base: main
Are you sure you want to change the base?
Conversation
…ibliography entries change, respecting user preferences and file naming patterns.
…nked files based on entry changes and follows user-defined file naming patterns.
…enaming is enabled based on user preferences. refreshFileLink(): Updates and returns a linked file with the correct relative path based on its current location and database context.
Files are correctly renamed on disk File links in the bibliography entries are properly updated Appropriate fallback mechanisms work when exact renaming isn't possible
Added autoRenameFilesOnEntryChange property to control automatic renaming Updated constructor and related getter/setter methods
Added "Auto rename files if entry changes" checkbox to the preferences UI Implemented data binding with the ViewModel
Added properties and methods for managing the automatic renaming setting Implemented logic for loading and saving settings
Added AUTO_RENAME_FILES_ON_ENTRY_CHANGE constant Updated FilePreferences initialization code
Added internationalization support for UI text
Register automatic file renamer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code currently does not meet JabRef's code guidelines. We use Checkstyle to identify issues. Please carefully follow the setup guide for the codestyle. Afterwards, please run checkstyle locally and fix the issues.
In case of issues with the import order, double check that you activated Auto Import. You can trigger fixing imports by pressing Ctrl+Alt+O to trigger Optimize Imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code currently does not meet JabRef's code guidelines. We use OpenRewrite to ensure "modern" Java coding practices. The issues found can be automatically fixed. Please execute the gradle task rewriteRun
, check the results, commit, and push.
You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "OpenRewrite".
Hello @wtfjjking |
hello i am using ide to make these commits not in terminal |
Can you sign in to GitHub on your IDE properly (using authorization) so that these commits have a traceable author? |
…is related to the unused method that has been deleted, change bootstrap method so that it has the correct parameters
… more useful comments to the listen method
If you are using IntelliJ and not the terminal, how exactly are you adding the commit descriptions (apart from the message)? |
oh i figure it out I am using windsurf ide to commit the code |
@@ -105,7 +105,7 @@ private static void insertBasicFactories(XSet xSet, XImplementationLoader xImpLo | |||
* </pre> | |||
* | |||
* @return an array of default commandline options | |||
* @see #bootstrap(String[]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here lacks one parameter it should be @see #bootstrap(String[], Path) otherwise the project doesn't compile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't see why openoffice gui files need to be touched here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side track: Git Butler is a neat git client for submitting unrelated pull requests while keeping all changes locally merged. - However, this for advanced users, because one will get feedback on the pull requests and need to handle them.
TBH JabRef might not be fitting your coding needs. We are a project where humans curate the code. Especially, we avoid code duplciations nearly at all costs. Windsurf and other AI-driven IDEs just produce code without taking care if there is existing similar functionality. I suggest either to take this Java learning opportinuity and navigate JabRefs code for yourself using the senior developer IDE IntelliJ or move on to a project which is more relaxed on AI usage. |
I clicked on update branch to ensure that our latest quality check workflows run. |
@trag-bot didn't find any issues in the code! ✅✨ |
You modified Markdown ( You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "Markdown". |
|
||
new Thread(() -> { | ||
try { | ||
Thread.sleep(500); // avoid renaming the file too frequently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use background task infrasturcture
|
||
import com.google.common.eventbus.Subscribe; | ||
|
||
public class AutomaticFileRenamer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use org.jabref.logic.cleanup.RenamePdfCleanup#cleanup instead of self-written class. If this is not possible, comment why.
User now can be able to automatically change their file name when they change their entry data, by just click the checkbox in the preferences ->linked file -> auto rename files if entry changes, and the auto rename functionality will be started,
and also when the user change the entry data, the citation key. Also will automatically change, so they don't need to click the generate button manually,(This automatically change citation key functionality is initiated regardless of the checkbox of the auto rename files functionality is clicked)
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)