/*
 * Copyright 2000-2009 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.intellij.ide.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.application.ex.ApplicationManagerEx;
import com.intellij.openapi.options.ConfigurableGroup;
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.options.ex.IdeConfigurablesGroup;
import com.intellij.openapi.options.ex.ProjectConfigurablesGroup;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;

import javax.swing.*;

public class ShowSettingsAction extends AnAction implements DumbAware {
  public void actionPerformed(AnActionEvent e) {
    Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
    if (project == null) {
      project = ProjectManager.getInstance().getDefaultProject();
    }

    ConfigurableGroup[] group = new ConfigurableGroup[]{
      new ProjectConfigurablesGroup(project),
      new IdeConfigurablesGroup()
    };

    final long startTime = System.nanoTime();
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        final long endTime = System.nanoTime();
        if (ApplicationManagerEx.getApplicationEx().isInternal()) {
          System.out.println("Displaying settings dialog took " + ((endTime - startTime) / 1000000) + " ms");
        }
      }
    });
    ShowSettingsUtil.getInstance().showSettingsDialog(project, group);
  }
}

@@ -629,16 +629,71 @@
 tions;%0A%0A
+import com.intellij.openapi.actionSystem.ActionPlaces;%0A
 import c
@@ -1295,16 +1295,61 @@
 Manager;
+%0Aimport com.intellij.openapi.util.SystemInfo;
 %0A%0Aimport
@@ -1437,16 +1437,250 @@
 Aware %7B%0A
+  @Override%0A  public void update(AnActionEvent e) %7B%0A    if (SystemInfo.isMac && e.getPlace().equals(ActionPlaces.MAIN_MENU)) %7B%0A      // It's called from Preferences in App menu.%0A      e.getPresentation().setVisible(false);%0A    %7D%0A  %7D%0A%0A
   public

Remove Settings from under File on Macs.