-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Improve responsiveness of library loading #6417
Comments
I am gonna check this. |
This is too complex for me...Sorry. |
It seems that the function "open a library" involves many classes and files without a top level file controlling them. |
There should be two entry points for this: |
Thanks for your suggestion, I will try it. |
@sustcstar Hi, do you still work on this issue? My teamate and I want to try this issue if you are not doing it now. ^_^ |
Yeah, I have been doing this for two days. |
OK, best wishes! |
I give up on this issue, everyone please feel free to take it |
Is anyone actively working on this? I'd like to work on it but I don't want to step on anyones toes. |
Feel free to take this issue. |
I'd like to work on this, @tmrd993 If you're still working on it tell me |
Hi @HoussemNasri , have fun coding. Maybe @tmrd993 can show what he already did and you both can join forces? |
No, you can go ahead and work on it. I only skimmed over the files but I am pretty sure you need to look at
This is the action that gets executed when the user loads a database from the menu. When a database wasn't closed, the program opens it on startup from here
|
Can anyone explain to me what this code is doing jabref/src/main/java/org/jabref/gui/JabRefGUI.java Lines 149 to 171 in 0412684
|
This code should autoload the databases on startup. |
@calixtus Thank you for responding, but I have another question, my code will close tabs automatically so to achieve this I copied this method from jabref/src/main/java/org/jabref/gui/JabRefFrame.java Lines 1157 to 1162 in b0af521
The tab disappear indeed, The problem is when I close the app it keeps running in the background, After some investigation, I found out this was happening because AutosaveManager.shutdown(context);
BackupManager.shutdown(context); My question is it ok if I added this snippet into the jabref/src/main/java/org/jabref/gui/LibraryTab.java Lines 586 to 588 in b0af521
|
Can you make a pull request with your changes so far? Then we can discuss this more easily. About autosave: @Siedlerchr is most experienced with this part of the code. |
@HoussemNasri The autosave / tab shutdown closing seems plausible and should be done.A tab has an attach bibdatabasecontext so this is correct |
I am trying a new approach by adding a new tab with 0 entries then when data is ready I call a method from LibraryTab to update BibdatabaseContext but the problem is that Groups Pane doesn't update and keep showing 0 entries although when I navigate away from the tab and come back it updates just fine. public void feedData(BibDatabaseContext bibDatabaseContext){
cleanUp();
this.bibDatabaseContext = Objects.requireNonNull(bibDatabaseContext);
bibDatabaseContext.getDatabase().registerListener(this);
bibDatabaseContext.getMetaData().registerListener(this);
this.sidePaneManager = frame.getSidePaneManager();
this.tableModel = new MainTableDataModel(getBibDatabaseContext(), preferencesService, Globals.stateManager);
citationStyleCache = new CitationStyleCache(bibDatabaseContext);
annotationCache = new FileAnnotationCache(bibDatabaseContext, preferencesService.getFilePreferences());
setupMainPanel();
setupAutoCompletion();
this.getDatabase().registerListener(new SearchListener());
this.getDatabase().registerListener(new EntriesRemovedListener());
// ensure that at each addition of a new entry, the entry is added to the groups interface
this.bibDatabaseContext.getDatabase().registerListener(new GroupTreeListener());
// ensure that all entry changes mark the panel as changed
this.bibDatabaseContext.getDatabase().registerListener(this);
this.getDatabase().registerListener(new UpdateTimestampListener(preferencesService));
this.entryEditor = new EntryEditor(this, externalFileTypes);
Platform.runLater(() -> {
EasyBind.subscribe(changedProperty, this::updateTabTitle);
Globals.stateManager.getOpenDatabases().addListener((ListChangeListener<BibDatabaseContext>) c ->
updateTabTitle(changedProperty.getValue()));
});
//I took some code from add() method in JabRefFrame to reinitialize Backup and Autosave.
if (readyForAutosave(bibDatabaseContext)) {
AutosaveManager autosaver = AutosaveManager.start(bibDatabaseContext);
autosaver.registerListener(new AutosaveUiManager(this));
}
BackupManager.start(this.bibDatabaseContext, Globals.entryTypesManager, Globals.prefs);
trackOpenNewDatabase(this);
} |
When JabRef opens a library, it opens a file, runs the database parser, and after everything is done, creates a new tab in the frame with the contents of the open database.
An improvement would be to first create a tab in the frame, display a loading animation, and after the parser has finished, display all entries (or display every entry as soon as it is parsed).
The text was updated successfully, but these errors were encountered: