Skip to content

Commit

Permalink
- code refactor settings and quit menu item creation
Browse files Browse the repository at this point in the history
  • Loading branch information
derreisende77 committed Mar 29, 2024
1 parent e0f9d9b commit fe4ad3a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/main/java/mediathek/mac/MediathekGuiMac.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ class MediathekGuiMac : MediathekGui() {
return true
}

override fun addQuitMenuItem() {
//using native handler instead
}

override fun addSettingsMenuItem() {
//using native handler instead
}
override fun setToolBarProperties() {
//not used on macOS
}
Expand Down
19 changes: 12 additions & 7 deletions src/main/java/mediathek/mainwindow/MediathekGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -943,13 +943,18 @@ private void createFileMenu() {
jMenuDatei.add(exportMenu);
jMenuDatei.add(importMenu);

//on macOS we will use native handlers instead...
if (!SystemUtils.IS_OS_MAC_OSX) {
jMenuDatei.addSeparator();
jMenuDatei.add(settingsAction);
jMenuDatei.addSeparator();
jMenuDatei.add(new QuitAction(this));
}
addSettingsMenuItem();
addQuitMenuItem();
}

protected void addSettingsMenuItem() {
jMenuDatei.addSeparator();
jMenuDatei.add(settingsAction);
}

protected void addQuitMenuItem() {
jMenuDatei.addSeparator();
jMenuDatei.add(new QuitAction(this));
}

private void createViewMenu() {
Expand Down

0 comments on commit fe4ad3a

Please sign in to comment.