add "Check for Update" action to the new welcome screen
authorKonstantin Bulenkov <kb@jetbrains.com>
Fri, 24 Oct 2014 14:17:39 +0000 (16:17 +0200)
committerKonstantin Bulenkov <kb@jetbrains.com>
Fri, 24 Oct 2014 14:19:25 +0000 (16:19 +0200)
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/CheckForUpdateAction.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java
platform/platform-resources/src/idea/PlatformActions.xml

index 81b51cab9cb219bb0f90106f12164211748f40da..bfa477159ef1aa1e7cf23695b735a07b18726969 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -21,11 +21,17 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.CommonDataKeys;
 import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.wm.impl.welcomeScreen.FlatWelcomeFrameProvider;
 
 public class CheckForUpdateAction extends AnAction implements DumbAware {
   @Override
   public void update(AnActionEvent e) {
-    e.getPresentation().setVisible(!SystemInfo.isMacSystemMenu || !ActionPlaces.MAIN_MENU.equals(e.getPlace()));
+    final String place = e.getPlace();
+    if (ActionPlaces.WELCOME_SCREEN.equals(place) && FlatWelcomeFrameProvider.isAvailable()) {
+      e.getPresentation().setEnabledAndVisible(true);
+    } else {
+      e.getPresentation().setVisible(!SystemInfo.isMacSystemMenu || !ActionPlaces.MAIN_MENU.equals(place));
+    }
   }
 
   @Override
index fc3e5aee58a3c41cd5cda641df53684b01193d20..ba966b2510eddb382e1df3b67c70c3a485bb701b 100644 (file)
@@ -294,8 +294,7 @@ public class FlatWelcomeFrame extends JFrame implements IdeFrame {
         public void actionPerformed(@NotNull AnActionEvent e) {
           ActionGroup configureGroup = (ActionGroup)ActionManager.getInstance().getAction(groupId);
           final PopupFactoryImpl.ActionGroupPopup popup = (PopupFactoryImpl.ActionGroupPopup)JBPopupFactory.getInstance()
-            .createActionGroupPopup(null, new IconsFreeActionGroup(configureGroup), e.getDataContext(), false, false, false, null,
-                                    10, null);
+            .createActionGroupPopup(null, new IconsFreeActionGroup(configureGroup), e.getDataContext(), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false, ActionPlaces.WELCOME_SCREEN);
           popup.showUnderneathOfLabel(ref.get());
         }
       };
index 534ee28fe40b8a1dc94ebd172b93cdbaa68d7c0c..70985d3fb9e0b26e2e33e4f582b6ec31524020e9 100644 (file)
 
       <action id="WelcomeScreen.Configure.DesktopEntry" class="com.intellij.ide.actions.CreateDesktopEntryAction"
               icon="AllIcons.Welcome.CreateDesktopEntry"/>
+      <action id="WelcomeScreen.Update" class="com.intellij.openapi.updateSettings.impl.CheckForUpdateAction" text="Check for Update"/>
     </group>
 
     <group id="FileChooser">