Add user name and host name to user-specific file directory#658
Conversation
This commit adds hower to user-specific file directory, if the mouse is on the hower, jabref display: host: hostname, username: username Fixes JabRef#572
|
There went sthg wrong, when i tried to resolve merge conflicts with in a PR, sorry for that. |
|
Im afraid you have to create a new PR, but please this time targeting JabRef:JabRef, this repo is just a mirror. |
koppor
left a comment
There was a problem hiding this comment.
Some code comments, maybe the help for a future PR
| selectedDatabaseModeProperty.setValue(metaData.getMode().orElse(BibDatabaseMode.BIBLATEX)); | ||
| generalFileDirectoryProperty.setValue(metaData.getDefaultFileDirectory().orElse("").trim()); | ||
| userSpecificFileDirectoryProperty.setValue(metaData.getUserFileDirectory(preferencesService.getFilePreferences().getUserAndHost()).orElse("").trim()); | ||
| userSpecificFileDirectoryProperty.setValue(metaData.getUserFileDirectory(preferencesService.getFilePreferences().getUserAndHost()).map(path -> usernameProperty.getValue() + ": " + path).orElse("").trim()); |
There was a problem hiding this comment.
Shouldn't this more be a binding?
| generalFileDirectoryProperty.setValue(metaData.getDefaultFileDirectory().orElse("").trim()); | ||
| userSpecificFileDirectoryProperty.setValue(metaData.getUserFileDirectory(preferencesService.getFilePreferences().getUserAndHost()).orElse("").trim()); | ||
| userSpecificFileDirectoryProperty.setValue(metaData.getUserFileDirectory(preferencesService.getFilePreferences().getUserAndHost()).map(path -> usernameProperty.getValue() + ": " + path).orElse("").trim()); | ||
| String username = preferencesService.getFilePreferences().getUserAndHost(); // get the username |
There was a problem hiding this comment.
This return username AND hostname. -- You can add new methods to the getFilePreferences to return the username and the hostname separately. - The getUserAndHost should IMHO be still be avialble. Check the usages.
| InetAddress localHost = InetAddress.getLocalHost(); | ||
| hostProperty.set(localHost.getHostName()); // get the host Name |
There was a problem hiding this comment.
Remove this code - JabRef already knows the host name. It is returned in getUserAndHost().
| public void setUsername(String username) { | ||
| usernameProperty.setValue(username); | ||
| } |
There was a problem hiding this comment.
This is not necessary - because the change of the username would be handled in other places in JabRef.
|
Regrading the screenshot: The tooltip looks good. - The content of the text field seems to have a prefix inside, but maybe just a quirk because of the screenshot. |
Fixes JabRef#12269, user-specific file directory should show user name.

Implement a hover on user-specific file directory. If the mouse is on hower, JabRef displays: user: {username}, host: {hostname}.
Describe the changes you have made here: Change the src/main/java/org/jabref/gui/libraryproperties/general, add two properties to display the username and hostname in the frontend.
Fixed kopper issue : JabRef#12269 https://github.com/koppor/jabref/issues/572
Mandatory checks
CHANGELOG.mddescribed in a way that is understandable for the average user (if applicable)