File tree 3 files changed +7
-4
lines changed
arduino-core/src/processing/app/helpers
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -971,7 +971,7 @@ public boolean handleQuit() {
971
971
// Save out the current prefs state
972
972
PreferencesData .save ();
973
973
974
- if (!OSUtils .isMacOS () || System . getProperty ( "apple.laf.useScreenMenuBar" ) == "false" ) {
974
+ if (!OSUtils .hasMacOSStyleMenus () ) {
975
975
// If this was fired from the menu or an AppleEvent (the Finder),
976
976
// then Mac OS X will send the terminate signal itself.
977
977
System .exit (0 );
Original file line number Diff line number Diff line change @@ -619,7 +619,7 @@ public void actionPerformed(ActionEvent e) {
619
619
fileMenu .add (item );
620
620
621
621
// macosx already has its own preferences and quit menu
622
- if (!OSUtils .isMacOS () || System . getProperty ( "apple.laf.useScreenMenuBar" ) == "false" ) {
622
+ if (!OSUtils .hasMacOSStyleMenus () ) {
623
623
fileMenu .addSeparator ();
624
624
625
625
item = newJMenuItem (tr ("Preferences" ), ',' );
@@ -1252,7 +1252,7 @@ public void actionPerformed(ActionEvent e) {
1252
1252
menu .add (item );
1253
1253
1254
1254
// macosx already has its own about menu
1255
- if (!OSUtils .isMacOS () || System . getProperty ( "apple.laf.useScreenMenuBar" ) == "false" ) {
1255
+ if (!OSUtils .hasMacOSStyleMenus () ) {
1256
1256
menu .addSeparator ();
1257
1257
item = new JMenuItem (tr ("About Arduino" ));
1258
1258
item .addActionListener (new ActionListener () {
@@ -1812,7 +1812,7 @@ protected boolean checkModified() {
1812
1812
String prompt = I18n .format (tr ("Save changes to \" {0}\" ? " ),
1813
1813
sketch .getName ());
1814
1814
1815
- if (!OSUtils .isMacOS () || System . getProperty ( "apple.laf.useScreenMenuBar" ) == "false" ) {
1815
+ if (!OSUtils .hasMacOSStyleMenus () ) {
1816
1816
int result =
1817
1817
JOptionPane .showConfirmDialog (this , prompt , tr ("Close" ),
1818
1818
JOptionPane .YES_NO_CANCEL_OPTION ,
Original file line number Diff line number Diff line change @@ -26,4 +26,7 @@ static public boolean isMacOS() {
26
26
return System .getProperty ("os.name" ).contains ("Mac" );
27
27
}
28
28
29
+ static public boolean hasMacOSStyleMenus () {
30
+ return OSUtils .isMacOS () && System .getProperty ("apple.laf.useScreenMenuBar" ).equals ("true" );
31
+ }
29
32
}
You can’t perform that action at this time.
0 commit comments