Skip to content

Commit

Permalink
add onBeforeOpenMenu listener to TrayMenuController (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ledwardchow authored Nov 6, 2022
1 parent 60e32c5 commit ab2868e
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,16 @@ static Optional<TrayMenuController> get() {
*/
void updateTrayMenu(List<TrayMenuItem> items) throws TrayMenuException;

/**
* Action to run before the tray menu opens.
* <p>
* This method is used to set up an event listener for when the menu is opened,
* e.g. so that the vault list can be updated to reflect volume mount state changes
* which occur while Cryptomator is in the system tray (and not open).
*
* @param listener
* @throws IllegalStateException thrown when adding listeners fails (i.e. there's no tray menu)
*/
void onBeforeOpenMenu(Runnable listener);

}

0 comments on commit ab2868e

Please sign in to comment.