Skip to content

Enable/Disable the undo and redo toolbar/menu buttons correctly#11758

Merged
Siedlerchr merged 2 commits into
JabRef:mainfrom
HoussemNasri:disable-undo-redo-buttons
Sep 13, 2024
Merged

Enable/Disable the undo and redo toolbar/menu buttons correctly#11758
Siedlerchr merged 2 commits into
JabRef:mainfrom
HoussemNasri:disable-undo-redo-buttons

Conversation

@HoussemNasri

@HoussemNasri HoussemNasri commented Sep 13, 2024

Copy link
Copy Markdown
Member

Closes #8807

Screenshots

  • Redo button is disabled
    image

  • Undo button is disabled
    image

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.

@Siedlerchr Siedlerchr left a comment

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.

from my side looks good but better have olly and carl take a look s well

@Siedlerchr Siedlerchr added this pull request to the merge queue Sep 13, 2024
Merged via the queue into JabRef:main with commit 9634a13 Sep 13, 2024
// TODO: Rework the UndoManager to something like the following, if it had a property.
// this.executable.bind(frame.getCurrentBasePanel().getUndoManager().canUndo())
this.executable.bind(ActionHelper.needsDatabase(stateManager));
stateManager.activeTabProperty().addListener((observable, oldValue, activeLibraryTab) -> {

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.

This will add a listener after each tab change. The old listener should be removed. Otherwise, memory consumption will increase IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only have active buttons for undo/redo if there is something to undo/redo

4 participants