-
Notifications
You must be signed in to change notification settings - Fork 15
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
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. |
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.
Some code comments, maybe the help for a future PR
@@ -61,6 +66,16 @@ public void setValues() { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this more be a binding?
@@ -61,6 +66,16 @@ public void setValues() { | |||
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()); | |||
String username = preferencesService.getFilePreferences().getUserAndHost(); // get the username |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.md
described in a way that is understandable for the average user (if applicable)