JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.54k stars 2.48k forks source link

Add a visible notice when user opens more than one JabRef instance #11783

Open InAnYan opened 1 day ago

InAnYan commented 1 day ago

Is your suggestion for improvement related to a problem? Please describe.

I wanted to run a portable version of JabRef, but I already had running JabRef in IntelliJ.

When I double clicked on the executable file in portable version, nothing happended. I didn't give up, and started it from terminal. In terminal there was:

Messages are not initialized before accessing key: Display help on command line options
2024-09-18 08:10:49 [main] org.jabref.Launcher.handleMultipleAppInstances()
INFO: Arguments passed on to running JabRef instance. Shutting down.

I couldn't understood this at the beginning, but then I finally understood that I had another instance of JabRef running.

Arguments passed on to running JabRef instance - WTF is this? 1) I didn't pass any arguments, and 2) I was certain that exactly this executable wasn't run before.

Describe the solution you'd like

1) Refactor the message when user starts JabRef a second time. 2) Make a dialog with that message

Additional context

InAnYan commented 1 day ago

I think this could be a good first issue :)

koppor commented 20 hours ago

This issue needs refinement!

The JabRef CLI is also used by the browser extension. There should not be any dialog when the extension passes something to JabRef.

Maybe if no arguments are passed, a small dialog is OK.

See https://github.com/JabRef/jabref/issues/8653 for some more info on the feature!

koppor commented 14 hours ago

Code is at https://github.com/JabRef/jabref/blob/604896c67e2bc0b7af799be1211c12f9f92c87be/src/main/java/org/jabref/Launcher.java#L184

Add an if statement.

If 0 arguments available
    open dialog saying Localization.lang("Another JabRef instance is already running. Please switch to that instance.")
else
     old code (remoteclient. sendCommandLineArguments ( args ) )

(Before https://github.com/JabRef/jabref/blob/604896c67e2bc0b7af799be1211c12f9f92c87be/src/main/java/org/jabref/Launcher.java#L180)