Skip to content

Add right click->copy functionality to event logs#11104

Merged
Siedlerchr merged 7 commits into
JabRef:mainfrom
subhramit:fix-for-issue-11100
Mar 27, 2024
Merged

Add right click->copy functionality to event logs#11104
Siedlerchr merged 7 commits into
JabRef:mainfrom
subhramit:fix-for-issue-11100

Conversation

@subhramit

@subhramit subhramit commented Mar 26, 2024

Copy link
Copy Markdown
Member

This closes #11100
Users can now right click on a log entry from the event log window to copy the log entry using a context menu:

Screenshot (220)
(Note: Windows screenshots/print screen do not show the mouse cursor location)

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • [ ] Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Comment thread src/main/java/org/jabref/gui/errorconsole/ErrorConsoleView.java Outdated
@subhramit subhramit requested a review from koppor March 26, 2024 15:24

if ((event == null) || empty) {
setGraphic(null);
setContextMenu(null);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this call? What is the behavior if this is removed? I would not show any context menu if something is empty.

Then, in src/main/java/org/jabref/gui/errorconsole/ErrorConsoleViewModel.java, you can remove the null check.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Removed.

public void copyLogEntry(LogEventViewModel logEvent) {
if (logEvent != null) {
clipBoardManager.setContent(logEvent.getDetailedText());
dialogService.notify(Localization.lang("Log entry copied to clipboard."));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this.

I know that JabRef has notifications for copy operations. I personally find this strange. Moreover, the log scrolls down after copying. Thus, in this case, it is annoying.

I think, we won't have issues when copying to clipboard. Thus, no notification needed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@subhramit subhramit requested a review from koppor March 27, 2024 18:50
calixtus
calixtus previously approved these changes Mar 27, 2024
@Siedlerchr Siedlerchr added this pull request to the merge queue Mar 27, 2024
Merged via the queue into JabRef:main with commit 12142be Mar 27, 2024
@subhramit subhramit deleted the fix-for-issue-11100 branch March 27, 2024 21:20
@subhramit subhramit changed the title Add right click->context menu->copy functionality to event logs Add right click->copy functionality to event logs Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow to right-click to copy log content from Help → View Event log

4 participants