* Bug #8157 fixed - Under Mac OS X, item "Scilab/Quit Scilab" and "File/Quit" were 93/8493/4
Vincent COUVERT [Thu, 2 Aug 2012 14:03:26 +0000 (16:03 +0200)]
                    duplicates.

* Bug #11597 fixed - On Mac OS X, the Preferences windows was not accessible
                     through the standard shortcut "CMD + ,".

Change-Id: Id0f674afcd515b5034ba2ae53020ae8f6f5d4887

scilab/CHANGES_5.4.X
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/utils/MenuBarBuilder.java
scilab/modules/gui/etc/main_menubar.xml
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/window/SwingScilabWindow.java
scilab/modules/ui_data/src/java/org/scilab/modules/ui_data/variableeditor/ScilabVariableEditor.java

index 1b469f1..de39c5a 100644 (file)
@@ -4,10 +4,17 @@
 Bug Fixes
 =========
 
+* Bug #8157 fixed - Under Mac OS X, item "Scilab/Quit Scilab" and "File/Quit" were
+                    duplicates.
+
+* Bug #11597 fixed - On Mac OS X, the Preferences windows was not accessible
+                     through the standard shortcut "CMD + ,".
+
 * Bug #11604 fixed - Some items were not localized in "Scilab Preferences" window.
 
 
 
+
             Changes between version 5.4.0-beta-1 and 5.4.0-beta-2 of Scilab
             ===============================================================
 
index 9114877..add39e7 100644 (file)
@@ -22,6 +22,7 @@ import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProp
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_MNEMONIC__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UI_SEPARATOR__;
 import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_UIMENU__;
+import static org.scilab.modules.graphic_objects.graphicObject.GraphicObjectProperties.__GO_VISIBLE__;
 
 import java.io.File;
 import java.io.IOException;
@@ -34,6 +35,7 @@ import java.util.TreeSet;
 
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.scilab.modules.commons.OS;
 import org.scilab.modules.commons.ScilabConstants;
 import org.scilab.modules.commons.xml.ScilabDocumentBuilderFactory;
 import org.scilab.modules.graphic_objects.graphicController.GraphicController;
@@ -149,6 +151,7 @@ public final class MenuBarBuilder {
         protected static final String INSTRUCTION = "instruction";
         protected static final String TRUE = "true";
         protected static final String ICON = "icon";
+        protected static final String MACOSX = "macosx";
 
         private Document dom;
         private Collection<String> internalMethodNames;
@@ -260,6 +263,7 @@ public final class MenuBarBuilder {
             Node submenu = dom.getElementsByTagName(MENU).item(index).getFirstChild();
 
             boolean separator = false;
+            boolean macosx = true;
 
             while (submenu != null) {
                 if (submenu.getNodeName() == SEPARATOR) {
@@ -304,6 +308,12 @@ public final class MenuBarBuilder {
                             // Set the accelerator
                             String acceleratorString = attributes.item(i).getNodeValue();
                             GraphicController.getController().setProperty(menuId, __GO_UI_ACCELERATOR__, acceleratorString);
+                        } else if (attributes.item(i).getNodeName() == MACOSX) {
+                            macosx = attributes.item(i).getNodeValue().equals(TRUE);
+                            if (!macosx && OS.get() == OS.MAC) {
+                                GraphicController.getController().setProperty(menuId, __GO_VISIBLE__, false);
+                                separator = false;
+                            }
                         }
                     }
 
@@ -336,8 +346,6 @@ public final class MenuBarBuilder {
                         GraphicController.getController().setProperty(menuId, __GO_UI_SEPARATOR__, true);
                         separator = false;
                     }
-
-
                 }
                 // Read next child
                 submenu = submenu.getNextSibling();
index 93af962..7cf82c7 100644 (file)
 <?xml version="1.0"?>
 <menubar>
-  <!-- All "main" menus are disabled when created and then enabled in scilab.start file after all macros are loaded -->
-  <!-- The accelerator can be "control shift A" or "control A" or "meta A" or "OSSCKEY A" where oskey means "OS ShortCut key"
+    <!-- All "main" menus are disabled when created and then enabled in scilab.start file after all macros are loaded -->
+    <!-- The accelerator can be "control shift A" or "control A" or "meta A" or "OSSCKEY A" where oskey means "OS ShortCut key"
        and is replaced by the good key (control for Unix/Windows OS and meta for Mac) -->
-  <!-- File menu -->
-  <menu label="&amp;File" enabled="false">
-    <submenu label="&amp;Execute..." accelerator="OSSCKEY E">
-      <callback instruction="               %fileToExec = uigetfile(&quot;*.sc*&quot;, &quot;&quot;, gettext(&quot;Select a file to execute&quot;));               if ~(%fileToExec == &quot;&quot;) then                 exec(%fileToExec);                 disp(msprintf(gettext(&quot;Execution done.\n&quot;)));               end               clear(&quot;%fileToExec&quot;);" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Open a file..." accelerator="OSSCKEY O" icon="document-open-sci">
-      <callback instruction="               %fileToOpen = uigetfile(&quot;*.sc*&quot;, &quot;&quot;, gettext(&quot;Select a file to open with SciNotes&quot;));               if ~(%fileToOpen == &quot;&quot;) then                 editor(%fileToOpen);               end               clear(&quot;%fileToOpen&quot;);" type="0"/>
-    </submenu>
-    <submenu label="&amp;Load environment..." accelerator="OSSCKEY L" icon="document-open">
-      <callback instruction="               %fileToLoad = uigetfile([&quot;*.sav&quot;;&quot;*.sod&quot;], &quot;&quot;, gettext(&quot;Select a file to load&quot;));               if ~(%fileToLoad == &quot;&quot;) then                 load(%fileToLoad);                 disp(msprintf(gettext(&quot;Environment loaded.\n&quot;)));               end               clear(&quot;%fileToLoad&quot;);" type="0"/>
-    </submenu>
-    <submenu label="&amp;Save environment..." accelerator="OSSCKEY S" icon="document-save">
-      <callback instruction="               %fileToSave = uiputfile([&quot;*.sav&quot;;&quot;*.sod&quot;], &quot;&quot;, gettext(&quot;Select a file to write&quot;));               if ~(%fileToSave == &quot;&quot;) then                 if (fileparts(%fileToSave, &quot;extension&quot;) == &quot;&quot;) then                   %fileToSave = %fileToSave + &quot;.sav&quot;;                 end                 save(%fileToSave);                 disp(msprintf(gettext(&quot;Environment saved.\n&quot;)));               end               clear(&quot;%fileToSave&quot;);" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Change current directory..." icon="scilab-folder-open">
-      <callback instruction="               %newDir = uigetdir(pwd(), gettext(&quot;Select a directory&quot;));               if ~(%newDir == &quot;&quot;) then                 cd(%newDir);               end               clear(&quot;%newDir&quot;);" type="0"/>
-    </submenu>
-    <submenu label="&amp;Display current directory">
-      <callback instruction="if iswaitingforinput() then printf(&quot;\n%s\n\n%s\n&quot;,prompt(),pwd()); else printf(&quot;\n\n%s\n\n&quot;,pwd());end" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="P&amp;age setup...">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.pageSetup" type="3"/>
-    </submenu>
-    <submenu label="&amp;Print..." accelerator="OSSCKEY P" icon="document-print">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.printConsoleContents" type="3"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Quit" accelerator="OSSCKEY Q">
-      <callback instruction="exit();" type="0"/>
-    </submenu>
-  </menu>
-  <!-- Edit menu -->
-  <menu label="&amp;Edit" enabled="false">
-    <submenu label="C&amp;ut" accelerator="OSSCKEY X" icon="edit-cut">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.cutConsoleSelection" type="3"/>
-    </submenu>
-    <submenu label="&amp;Copy" accelerator="OSSCKEY C" icon="edit-copy">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.copyConsoleSelection" type="3"/>
-    </submenu>
-    <submenu label="&amp;Paste" accelerator="OSSCKEY V" icon="edit-paste">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.pasteClipboardIntoConsole" type="3"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Empty clipboard">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.emptyClipboard" type="3"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Select all" accelerator="OSSCKEY A" icon="edit-select-all">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.selectAllConsoleContents" type="3"/>
-    </submenu>
-    <separator/>
-    <submenu label="Show/Hide &amp;Toolbar">
-      <callback instruction="                 if toolbar(-1)==&quot;on&quot; then                   toolbar(-1, &quot;off&quot;);                 else                   toolbar(-1, &quot;on&quot;);                 end" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="Clear &amp;History">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.clearHistory" type="3"/>
-    </submenu>
-    <submenu label="Clear C&amp;onsole" icon="edit-clear">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.clear" type="3"/>
-    </submenu>
-    <separator/>
-    <submenu label="P&amp;references" icon="preferences-system">
-      <callback instruction='org.scilab.modules.preferences.XConfigManager.openPreferences' type="3"/>
-    </submenu>
-  </menu>
-  <!-- Control menu -->
-  <menu label="&amp;Control" enabled="false">
-    <submenu label="&amp;Resume" icon="media-playback-start">
-      <callback instruction="resume;" type="-2"/>
-    </submenu>
-    <submenu label="&amp;Abort" icon="process-stop">
-      <callback instruction="abort;" type="-2"/>
-    </submenu>
-    <submenu label="&amp;Interrupt">
-      <callback instruction="pause;" type="-2"/>
-    </submenu>
-  </menu>
-  <!-- Applications menu -->
-  <menu label="&amp;Applications" enabled="false">
-    <submenu label="&amp;SciNotes" icon="accessories-text-editor">
-      <callback instruction="editor();" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Xcos" icon="utilities-system-monitor">
-      <callback instruction="if with_module(&quot;xcos&quot;) then xcos(); else disp(gettext(&quot;Please install xcos module.&quot;)); end" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Matlab to Scilab translator">
-      <callback instruction="if with_module(&quot;m2sci&quot;) then mfile2sci(); else disp(gettext(&quot;Please install m2sci module.&quot;)); end" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="M&amp;odule manager - ATOMS" icon="package-x-generic">
-      <callback instruction="if with_module(&quot;atoms&quot;) then atomsGui(); else disp(gettext(&quot;Please install atoms module.&quot;)); end" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Variable Browser">
-      <callback instruction="browsevar()" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Command History">
-      <callback instruction="org.scilab.modules.history_browser.CommandHistory.setVisible" type="3"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;File Browser">
-      <callback instruction="filebrowser()" type="0"/>
-    </submenu>
-  </menu>
-  <!-- Help menu -->
-  <menu label="&amp;?" enabled="false">
-    <submenu label="Scilab &amp;Help" accelerator="F1" icon="help-browser">
-      <callback instruction="help();" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="Scilab &amp;Demonstrations" icon="applications-system">
-      <callback instruction="demo_gui();" type="0"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Links">
-      <submenu label="Scilab &amp;Web Site">
-        <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openScilabWebSite" type="3"/>
-      </submenu>
-      <separator/>
-      <submenu label="Scilab &amp;Online Help">
-        <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openOnlineHelp" type="3"/>
-      </submenu>
-      <submenu label="Scilab &amp;Wiki">
-        <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openWiki" type="3"/>
-      </submenu>
-      <separator/>
-      <submenu label="Scilab &amp;ATOMS Web Site">
-        <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openAtomsScilab" type="3"/>
-      </submenu>
-      <submenu label="&amp;File Exchange">
-        <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openFileExchange" type="3"/>
-      </submenu>
-      <submenu label="&amp;Mailing Lists">
-        <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openMailingList" type="3"/>
-      </submenu>
-      <submenu label="Mailing Lists &amp;Archives">
-        <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openMailingListArchives" type="3"/>
-      </submenu>
-      <separator/>
-      <submenu label="&amp;Forge">
-        <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openForge" type="3"/>
-      </submenu>
-      <submenu label="&amp;Bugs And Requests">
-        <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openBugzilla" type="3"/>
-      </submenu>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;Scilab Enterprises">
-      <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openSE" type="3"/>
-    </submenu>
-    <separator/>
-    <submenu label="&amp;About Scilab..." accelerator="shift F1">
-      <callback instruction="about()" type="0"/>
-    </submenu>
-  </menu>
+    <!-- File menu -->
+    <menu label="&amp;File" enabled="false">
+        <submenu label="&amp;Execute..." accelerator="OSSCKEY E">
+            <callback instruction="               %fileToExec = uigetfile(&quot;*.sc*&quot;, &quot;&quot;, gettext(&quot;Select a file to execute&quot;));               if ~(%fileToExec == &quot;&quot;) then                 exec(%fileToExec);                 disp(msprintf(gettext(&quot;Execution done.\n&quot;)));               end               clear(&quot;%fileToExec&quot;);" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Open a file..." accelerator="OSSCKEY O" icon="document-open-sci">
+            <callback instruction="               %fileToOpen = uigetfile(&quot;*.sc*&quot;, &quot;&quot;, gettext(&quot;Select a file to open with SciNotes&quot;));               if ~(%fileToOpen == &quot;&quot;) then                 editor(%fileToOpen);               end               clear(&quot;%fileToOpen&quot;);" type="0"/>
+        </submenu>
+        <submenu label="&amp;Load environment..." accelerator="OSSCKEY L" icon="document-open">
+            <callback instruction="               %fileToLoad = uigetfile([&quot;*.sav&quot;;&quot;*.sod&quot;], &quot;&quot;, gettext(&quot;Select a file to load&quot;));               if ~(%fileToLoad == &quot;&quot;) then                 load(%fileToLoad);                 disp(msprintf(gettext(&quot;Environment loaded.\n&quot;)));               end               clear(&quot;%fileToLoad&quot;);" type="0"/>
+        </submenu>
+        <submenu label="&amp;Save environment..." accelerator="OSSCKEY S" icon="document-save">
+            <callback instruction="               %fileToSave = uiputfile([&quot;*.sav&quot;;&quot;*.sod&quot;], &quot;&quot;, gettext(&quot;Select a file to write&quot;));               if ~(%fileToSave == &quot;&quot;) then                 if (fileparts(%fileToSave, &quot;extension&quot;) == &quot;&quot;) then                   %fileToSave = %fileToSave + &quot;.sav&quot;;                 end                 save(%fileToSave);                 disp(msprintf(gettext(&quot;Environment saved.\n&quot;)));               end               clear(&quot;%fileToSave&quot;);" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Change current directory..." icon="scilab-folder-open">
+            <callback instruction="               %newDir = uigetdir(pwd(), gettext(&quot;Select a directory&quot;));               if ~(%newDir == &quot;&quot;) then                 cd(%newDir);               end               clear(&quot;%newDir&quot;);" type="0"/>
+        </submenu>
+        <submenu label="&amp;Display current directory">
+            <callback instruction="if iswaitingforinput() then printf(&quot;\n%s\n\n%s\n&quot;,prompt(),pwd()); else printf(&quot;\n\n%s\n\n&quot;,pwd());end" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="P&amp;age setup...">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.pageSetup" type="3"/>
+        </submenu>
+        <submenu label="&amp;Print..." accelerator="OSSCKEY P" icon="document-print">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.printConsoleContents" type="3"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Quit" accelerator="OSSCKEY Q" macosx="false">
+            <callback instruction="exit();" type="0"/>
+        </submenu>
+    </menu>
+    <!-- Edit menu -->
+    <menu label="&amp;Edit" enabled="false">
+        <submenu label="C&amp;ut" accelerator="OSSCKEY X" icon="edit-cut">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.cutConsoleSelection" type="3"/>
+        </submenu>
+        <submenu label="&amp;Copy" accelerator="OSSCKEY C" icon="edit-copy">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.copyConsoleSelection" type="3"/>
+        </submenu>
+        <submenu label="&amp;Paste" accelerator="OSSCKEY V" icon="edit-paste">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.pasteClipboardIntoConsole" type="3"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Empty clipboard">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.emptyClipboard" type="3"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Select all" accelerator="OSSCKEY A" icon="edit-select-all">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.selectAllConsoleContents" type="3"/>
+        </submenu>
+        <separator/>
+        <submenu label="Show/Hide &amp;Toolbar">
+            <callback instruction="                 if toolbar(-1)==&quot;on&quot; then                   toolbar(-1, &quot;off&quot;);                 else                   toolbar(-1, &quot;on&quot;);                 end" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="Clear &amp;History">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.clearHistory" type="3"/>
+        </submenu>
+        <submenu label="Clear C&amp;onsole" icon="edit-clear">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.clear" type="3"/>
+        </submenu>
+        <separator/>
+        <submenu label="P&amp;references" icon="preferences-system" macosx="false">
+            <callback instruction='org.scilab.modules.preferences.XConfigManager.openPreferences' type="3"/>
+        </submenu>
+    </menu>
+    <!-- Control menu -->
+    <menu label="&amp;Control" enabled="false">
+        <submenu label="&amp;Resume" icon="media-playback-start">
+            <callback instruction="resume;" type="-2"/>
+        </submenu>
+        <submenu label="&amp;Abort" icon="process-stop">
+            <callback instruction="abort;" type="-2"/>
+        </submenu>
+        <submenu label="&amp;Interrupt">
+            <callback instruction="pause;" type="-2"/>
+        </submenu>
+    </menu>
+    <!-- Applications menu -->
+    <menu label="&amp;Applications" enabled="false">
+        <submenu label="&amp;SciNotes" icon="accessories-text-editor">
+            <callback instruction="editor();" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Xcos" icon="utilities-system-monitor">
+            <callback instruction="if with_module(&quot;xcos&quot;) then xcos(); else disp(gettext(&quot;Please install xcos module.&quot;)); end" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Matlab to Scilab translator">
+            <callback instruction="if with_module(&quot;m2sci&quot;) then mfile2sci(); else disp(gettext(&quot;Please install m2sci module.&quot;)); end" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="M&amp;odule manager - ATOMS" icon="package-x-generic">
+            <callback instruction="if with_module(&quot;atoms&quot;) then atomsGui(); else disp(gettext(&quot;Please install atoms module.&quot;)); end" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Variable Browser">
+            <callback instruction="browsevar()" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Command History">
+            <callback instruction="org.scilab.modules.history_browser.CommandHistory.setVisible" type="3"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;File Browser">
+            <callback instruction="filebrowser()" type="0"/>
+        </submenu>
+    </menu>
+    <!-- Help menu -->
+    <menu label="&amp;?" enabled="false">
+        <submenu label="Scilab &amp;Help" accelerator="F1" icon="help-browser">
+            <callback instruction="help();" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="Scilab &amp;Demonstrations" icon="applications-system">
+            <callback instruction="demo_gui();" type="0"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Links">
+            <submenu label="Scilab &amp;Web Site">
+                <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openScilabWebSite" type="3"/>
+            </submenu>
+            <separator/>
+            <submenu label="Scilab &amp;Online Help">
+                <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openOnlineHelp" type="3"/>
+            </submenu>
+            <submenu label="Scilab &amp;Wiki">
+                <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openWiki" type="3"/>
+            </submenu>
+            <separator/>
+            <submenu label="Scilab &amp;ATOMS Web Site">
+                <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openAtomsScilab" type="3"/>
+            </submenu>
+            <submenu label="&amp;File Exchange">
+                <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openFileExchange" type="3"/>
+            </submenu>
+            <submenu label="&amp;Mailing Lists">
+                <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openMailingList" type="3"/>
+            </submenu>
+            <submenu label="Mailing Lists &amp;Archives">
+                <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openMailingListArchives" type="3"/>
+            </submenu>
+            <separator/>
+            <submenu label="&amp;Forge">
+                <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openForge" type="3"/>
+            </submenu>
+            <submenu label="&amp;Bugs And Requests">
+                <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openBugzilla" type="3"/>
+            </submenu>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;Scilab Enterprises">
+            <callback instruction="org.scilab.modules.gui.bridge.CallScilabBridge.openSE" type="3"/>
+        </submenu>
+        <separator/>
+        <submenu label="&amp;About Scilab..." accelerator="shift F1">
+            <callback instruction="about()" type="0"/>
+        </submenu>
+    </menu>
 </menubar>
 
index e3fa810..dd70d02 100644 (file)
@@ -174,8 +174,9 @@ public class SwingScilabWindow extends JFrame implements SimpleWindow {
         try {
             // Generate and register the OSXAdapter, passing it a hash of all the methods we wish to
             // use as delegates for various com.apple.eawt.ApplicationListener methods
-            OSXAdapter.setAboutHandler(this, getClass().getDeclaredMethod("OSXabout", (Class[])null));
-            OSXAdapter.setQuitHandler(this, getClass().getDeclaredMethod("OSXquit", (Class[])null));
+            OSXAdapter.setAboutHandler(this, getClass().getDeclaredMethod("macosxAbout", (Class[]) null));
+            OSXAdapter.setQuitHandler(this, getClass().getDeclaredMethod("macosxQuit", (Class[]) null));
+            OSXAdapter.setPreferencesHandler(this, getClass().getDeclaredMethod("macosxPreferences", (Class[]) null));
             OSXAdapter.setDockIcon(new ImageIcon(ScilabSwingUtilities.findIcon("puffin", "256x256")));
         } catch (java.lang.NoSuchMethodException e) {
             System.err.println("OSXAdapter could not find the method: " + e.getLocalizedMessage());
@@ -184,15 +185,29 @@ public class SwingScilabWindow extends JFrame implements SimpleWindow {
 
     /**
      * This method is called by the OSXAdapter class when the specific Mac
-     * OS X about menu is called. It is the only case where this method
+     * OS X "About" menu is called. It is the only case where this method
      * should be used
      */
-    public void OSXabout() {
-        InterpreterManagement.requestScilabExec("about()");
+    public void macosxAbout() {
+        InterpreterManagement.requestScilabExec("about();");
     }
 
-    public void OSXquit() {
-        InterpreterManagement.requestScilabExec("exit()");
+    /**
+     * This method is called by the OSXAdapter class when the specific Mac
+     * OS X "Quit Scilab" menu is called. It is the only case where this method
+     * should be used
+     */
+    public void macosxQuit() {
+        InterpreterManagement.requestScilabExec("exit();");
+    }
+
+    /**
+     * This method is called by the OSXAdapter class when the specific Mac
+     * OS X "Preferences" menu is called. It is the only case where this method
+     * should be used
+     */
+    public void macosxPreferences() {
+        InterpreterManagement.requestScilabExec("preferences();");
     }
 
     /**
index f851c3e..409095c 100644 (file)
@@ -181,14 +181,30 @@ public final class ScilabVariableEditor extends SwingScilabWindow implements Var
 
     /**
      * This method is called by the OSXAdapter class when the specific Mac
-     * OS X about menu is called. It is the only case where this method
+     * OS X "About" menu is called. It is the only case where this method
      * should be used
      */
-    public void OSXabout() {
+    public void macosxAbout() {
         InterpreterManagement.requestScilabExec("about()");
     }
 
-    public void OSXquit() {
+    /**
+     * This method is called by the OSXAdapter class when the specific Mac
+     * OS X "Quit Scilab" menu is called. It is the only case where this method
+     * should be used
+     */
+    public void macosxQuit() {
         InterpreterManagement.requestScilabExec("exit()");
     }
+
+    /**
+     * This method is called by the OSXAdapter class when the specific Mac
+     * OS X "Preferences" menu is called. It is the only case where this method
+     * should be used
+     */
+    public void macosxPreferences() {
+        InterpreterManagement.requestScilabExec("preferences();");
+    }
+
+
 }