[platform] in desktop entry/launcher script configuration; default to user-scope changes (IDEA-152531)

I.e. do not ask for super-user privileges unless system-wide scope was chosen explicitly.
This commit is contained in:
Roman Shevchenko
2016-04-25 21:13:00 +02:00
parent 04d23467ba
commit 60ec41ad21
3 changed files with 8 additions and 16 deletions
@@ -32,7 +32,6 @@ import com.intellij.openapi.Disposable;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ApplicationNamesInfo;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.application.impl.ApplicationImpl;
import com.intellij.openapi.editor.colors.EditorColorsManager;
import com.intellij.openapi.editor.colors.EditorColorsScheme;
@@ -164,22 +163,18 @@ public class InitialConfigurationDialog extends DialogWrapper {
init();
final boolean canCreateLauncherScript = canCreateLauncherScript();
myCreateScriptCheckbox.setVisible(canCreateLauncherScript);
myCreateScriptCheckbox.setSelected(canCreateLauncherScript);
myCreateScriptPanel.setVisible(canCreateLauncherScript);
myCreateScriptCheckbox.setSelected(false);
if (canCreateLauncherScript) {
myScriptPathTextField.setText(CreateLauncherScriptAction.defaultScriptPath());
}
final boolean canCreateDesktopEntry = canCreateDesktopEntry();
myCreateEntryCheckBox.setVisible(canCreateDesktopEntry);
myCreateEntryCheckBox.setSelected(canCreateDesktopEntry);
myCreateEntryPanel.setVisible(canCreateDesktopEntry);
if (canCreateDesktopEntry) {
myGlobalEntryCheckBox.setSelected(!PathManager.getHomePath().startsWith("/home"));
}
myCreateEntryCheckBox.setSelected(canCreateDesktopEntry);
myGlobalEntryCheckBox.setSelected(false);
myPreferencesLabel.setText("You can use "+ CommonBundle.settingsActionPath() + " to configure any of these settings later.");
myPreferencesLabel.setText("You can use " + CommonBundle.settingsActionPath() + " to configure any of these settings later.");
Disposer.register(myDisposable, new Disposable() {
@Override
@@ -17,7 +17,6 @@ package com.intellij.ide.customize;
import com.intellij.ide.actions.CreateDesktopEntryAction;
import com.intellij.idea.ActionsBundle;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.EmptyRunnable;
import com.intellij.openapi.util.IconLoader;
@@ -65,12 +64,10 @@ public class CustomizeDesktopEntryStep extends AbstractCustomizeWizardStep {
add(panel, BorderLayout.CENTER);
myCreateEntryCheckBox.addChangeListener(e -> {
myGlobalEntryCheckBox.setEnabled(myCreateEntryCheckBox.isSelected());
myGlobalEntryCheckBox.setSelected(myCreateEntryCheckBox.isSelected() && !PathManager.getHomePath().startsWith("/home"));
});
myCreateEntryCheckBox.addChangeListener(e -> myGlobalEntryCheckBox.setEnabled(myCreateEntryCheckBox.isSelected()));
myCreateEntryCheckBox.setSelected(!"true".equals(System.getProperty("idea.debug.mode")));
myCreateEntryCheckBox.setSelected(true);
myGlobalEntryCheckBox.setSelected(false);
}
@Override
@@ -37,7 +37,7 @@ public class CustomizeLauncherScriptStep extends AbstractCustomizeWizardStep {
setLayout(new BorderLayout());
myCreateScriptCheckBox.setOpaque(false);
myCreateScriptCheckBox.setSelected(true);
myCreateScriptCheckBox.setSelected(false);
myCreateScriptCheckBox.addChangeListener(e -> myScriptPathTextField.setEnabled(myCreateScriptCheckBox.isSelected()));
myScriptPathTextField.setText(CreateLauncherScriptAction.defaultScriptPath());