DBE-7036 DataGrip is missing "Report a Problem" menu item under Help

This commit is contained in:
Gregory.Shrago
2018-09-07 19:38:04 +03:00
parent b46f19c55b
commit 68b871c9ac
6 changed files with 50 additions and 80 deletions
@@ -0,0 +1,22 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.actions;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ex.ApplicationInfoEx;
import com.intellij.openapi.project.DumbAwareAction;
import org.jetbrains.annotations.NotNull;
public class ReportProblemAction extends DumbAwareAction {
@Override
public void update(@NotNull AnActionEvent e) {
ApplicationInfoEx info = ApplicationInfoEx.getInstanceEx();
String url = info == null ? null : info.getEAPFeedbackUrl();
e.getPresentation().setEnabledAndVisible(url != null && url.contains("youtrack"));
}
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
SendFeedbackAction.doPerformAction(e.getProject(), ApplicationInfoEx.getInstanceEx().getEAPFeedbackUrl());
}
}
@@ -32,18 +32,32 @@ import java.awt.*;
public class SendFeedbackAction extends AnAction implements DumbAware {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
launchBrowser(e.getProject());
public void update(@NotNull AnActionEvent e) {
ApplicationInfoEx info = ApplicationInfoEx.getInstanceEx();
String url = info == null ? null : info.getReleaseFeedbackUrl();
e.getPresentation().setEnabledAndVisible(url != null);
}
public static void launchBrowser(@Nullable Project project) {
final ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
doPerformAction(e.getProject());
}
public static void doPerformAction(@Nullable Project project) {
ApplicationInfoEx info = ApplicationInfoEx.getInstanceEx();
String eapUrl = info.getEAPFeedbackUrl();
String urlTemplate = info.isEAP() && !eapUrl.contains("youtrack") ? eapUrl : info.getReleaseFeedbackUrl();
doPerformAction(project, urlTemplate);
}
static void doPerformAction(@Nullable Project project, @NotNull String urlTemplate) {
ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
boolean eap = appInfo.isEAP();
String urlTemplate = eap ? appInfo.getEAPFeedbackUrl() : appInfo.getReleaseFeedbackUrl();
LicensingFacade la = LicensingFacade.getInstance();
urlTemplate = urlTemplate
.replace("$BUILD", eap ? appInfo.getBuild().asStringWithoutProductCode() : appInfo.getBuild().asString())
.replace("$TIMEZONE", System.getProperty("user.timezone"))
.replace("$EVAL", isEvaluationLicense() ? "true" : "false")
.replace("$EVAL", la != null && la.isEvaluationLicense() ? "true" : "false")
.replace("$DESCR", getDescription());
BrowserUtil.browse(urlTemplate, project);
}
@@ -72,7 +86,7 @@ public class SendFeedbackAction extends AnAction implements DumbAware {
String osPatchLevel = System.getProperty("sun.os.patch.level");
if (osVersion != null) {
sb.append(" v").append(osVersion);
if (osPatchLevel != null) {
if (osPatchLevel != null && !"unknown".equals(osPatchLevel)) {
sb.append(" ").append(osPatchLevel);
}
}
@@ -85,18 +99,10 @@ public class SendFeedbackAction extends AnAction implements DumbAware {
Rectangle bounds = device.getDefaultConfiguration().getBounds();
sb.append(bounds.width).append("x").append(bounds.height);
}
if (UIUtil.isRetina()) sb.append(SystemInfo.isMac ? "; Retina" : "; HiDPI");
if (UIUtil.isRetina()) {
sb.append(SystemInfo.isMac ? "; Retina" : "; HiDPI");
}
}
return sb.toString();
}
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(ApplicationInfoEx.getInstanceEx() != null);
}
private static boolean isEvaluationLicense() {
final LicensingFacade la = LicensingFacade.getInstance();
return la != null && la.isEvaluationLicense();
}
}
@@ -1268,7 +1268,9 @@ action.EditCustomVmOptions.description=Opens an editor tab with a custom VM opti
action.LogDebugConfigure.text=D_ebug Log Settings...
action.LogDebugConfigure.description=Enable or disable additional log categories. Allows to provide more information to the support team by request.
action.TechnicalSupport.text=_Support Center
action.TechnicalSupport.description=Access technical support on JetBrains Web site
action.TechnicalSupport.description=Access technical support on JetBrains website
action.ReportProblem.text=Report Problem...
action.ReportProblem.description=Report problem in JetBrains issue tracker
action.TextComponent.ClearAction.text=Clear text
action.TextComponent.ClearAction.description=Clear text in text components
@@ -565,6 +565,7 @@
<action id="ProductivityGuide" class="com.intellij.featureStatistics.actions.ShowFeatureUsageStatisticsAction"/>
<separator/>
<action id="TechnicalSupport" class="com.intellij.ide.actions.TechnicalSupportAction"/>
<action id="ReportProblem" class="com.intellij.ide.actions.ReportProblemAction"/>
<action id="SendFeedback" class="com.intellij.ide.actions.SendFeedbackAction"/>
<action id="ShowLog" class="com.intellij.ide.actions.ShowLogAction"/>
<action id="CollectSettings" class="com.intellij.ide.actions.CollectSettingsAction" text="Settings Summary"/>
-4
View File
@@ -128,10 +128,6 @@
<group id="TypeHierarchyPopupMenu">
</group>
<action id="ReportProblem" class="com.jetbrains.python.ReportProblemAction" text="Report Problem...">
<add-to-group group-id="HelpMenu" anchor="before" relative-to-action="TechnicalSupport"/>
</action>
<action id="RenameProject" class="com.intellij.platform.renameProject.RenameProjectAction">
<add-to-group group-id="FileOpenGroup" anchor="after" relative-to-action="RenameFile"/>
</action>
@@ -1,57 +0,0 @@
/*
* Copyright 2000-2016 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.jetbrains.python;
import com.intellij.ide.BrowserUtil;
import com.intellij.ide.actions.SendFeedbackAction;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ex.ApplicationInfoEx;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.Project;
import com.intellij.ui.LicensingFacade;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class ReportProblemAction extends AnAction implements DumbAware {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
launchBrowser(e.getProject());
}
public static void launchBrowser(@Nullable Project project) {
final ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
boolean eap = appInfo.isEAP();
String urlTemplate = appInfo.getEAPFeedbackUrl();
urlTemplate = urlTemplate
.replace("$BUILD", eap ? appInfo.getBuild().asStringWithoutProductCode() : appInfo.getBuild().asString())
.replace("$TIMEZONE", System.getProperty("user.timezone"))
.replace("$EVAL", isEvaluationLicense() ? "true" : "false")
.replace("$DESCR", SendFeedbackAction.getDescription());
BrowserUtil.browse(urlTemplate, project);
}
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(ApplicationInfoEx.getInstanceEx() != null);
}
private static boolean isEvaluationLicense() {
final LicensingFacade la = LicensingFacade.getInstance();
return la != null && la.isEvaluationLicense();
}
}