Skip to content

Commit

Permalink
fix(showNewEntryWindow): handle the case when editEntryDlg is null
Browse files Browse the repository at this point in the history
Clicking on the "Neueingabefenster anzeigen … F11" menu entry should either bring the existing edit window to the front or create a new input window if one doesn't exist.

TODO: ZettelkastenViewTest
  • Loading branch information
RalfBarkow committed May 5, 2024
1 parent c587b12 commit 6965c05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 56 deletions.
21 changes: 12 additions & 9 deletions src/main/java/de/danielluedecke/zettelkasten/ZettelkastenView.java
Original file line number Diff line number Diff line change
Expand Up @@ -9504,15 +9504,18 @@ public void showSearchResultWindow() {
ZettelkastenApp.getApplication().show(searchResultsDlg);
}

@Action
public void showNewEntryWindow() {
if (editEntryDlg != null) {
editEntryDlg.setAlwaysOnTop(true);
editEntryDlg.toFront();
editEntryDlg.requestFocus();
editEntryDlg.setAlwaysOnTop(false);
}
}
@Action
public void showNewEntryWindow() {
if (editEntryDlg != null) {
editEntryDlg.setAlwaysOnTop(true);
editEntryDlg.toFront();
editEntryDlg.requestFocus();
editEntryDlg.setAlwaysOnTop(false);
} else {
openEditWindow(false, -1, false, false, -1, ""); // Create a new input window
}
}


/**
* Shows the desktop/outliner window. If it hasn't been created yet, a new
Expand Down

This file was deleted.

0 comments on commit 6965c05

Please sign in to comment.