mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Yes/No dialogs considered harmful, provide more immediate and descriptive button texts instead (for the most blatant bloopers)
This commit is contained in:
+4
-3
@@ -157,9 +157,10 @@ public class InspectionProfileSchemesPanel extends AbstractDescriptionAwareSchem
|
||||
}
|
||||
final SingleInspectionProfilePanel existed = InspectionProfileSchemesPanel.this.getModel().getProfilePanel(profile);
|
||||
if (existed != null) {
|
||||
if (Messages.showOkCancelDialog(myProject, "Profile with name \'" +
|
||||
profile.getName() +
|
||||
"\' already exists. Do you want to overwrite it?", "Warning",
|
||||
if (Messages.showOkCancelDialog(myProject, "Profile with name \'" + profile.getName() +
|
||||
"\' already exists. Do you want to overwrite it?",
|
||||
"Overwrite Warning",
|
||||
"Overwrite", "Cancel",
|
||||
Messages.getInformationIcon()) != Messages.OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
+5
-5
@@ -116,11 +116,11 @@ public class ExportTestResultsAction extends DumbAwareAction {
|
||||
}
|
||||
filename = d.getFileName();
|
||||
showDialog = getOutputFile(config, project, filename).exists()
|
||||
&& Messages.showOkCancelDialog(
|
||||
project,
|
||||
ExecutionBundle.message("export.test.results.file.exists.message", filename),
|
||||
ExecutionBundle.message("export.test.results.file.exists.title"),
|
||||
Messages.getQuestionIcon()
|
||||
&& Messages.showOkCancelDialog(project,
|
||||
ExecutionBundle.message("export.test.results.file.exists.message", filename),
|
||||
ExecutionBundle.message("export.test.results.file.exists.title"),
|
||||
"Overwrite", "Cancel",
|
||||
Messages.getQuestionIcon()
|
||||
) != Messages.OK;
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -637,11 +637,13 @@ public class PathsVerifier<BinaryType extends FilePatch> {
|
||||
final List<FilePatch> result = new LinkedList<>();
|
||||
if (! myOverrideExisting.isEmpty()) {
|
||||
final String title = "Overwrite Existing Files";
|
||||
final Collection<FilePath> selected = AbstractVcsHelper.getInstance(myProject).selectFilePathsToProcess(
|
||||
new ArrayList<>(myOverrideExisting.keySet()), title,
|
||||
List<FilePath> files = new ArrayList<>(myOverrideExisting.keySet());
|
||||
Collection<FilePath> selected = AbstractVcsHelper.getInstance(myProject).selectFilePathsToProcess(
|
||||
files, title,
|
||||
"\nThe following files should be created by patch, but they already exist.\nDo you want to overwrite them?\n", title,
|
||||
"The following file should be created by patch, but it already exists.\nDo you want to overwrite it?\n{0}",
|
||||
VcsShowConfirmationOption.STATIC_SHOW_CONFIRMATION);
|
||||
VcsShowConfirmationOption.STATIC_SHOW_CONFIRMATION,
|
||||
"Overwrite", "Cancel");
|
||||
if (selected != null) {
|
||||
for (FilePath path : selected) {
|
||||
myOverrideExisting.remove(path);
|
||||
|
||||
+3
-1
@@ -157,7 +157,9 @@ public class CreatePatchCommitExecutor extends LocalCommitExecutor implements Pr
|
||||
WaitForProgressToShow.runOrInvokeAndWaitAboveProgress(
|
||||
() -> result[0] = Messages.showYesNoDialog(myProject, "File " + file.getName() + " (" + file.getParent() + ")" +
|
||||
" already exists.\nDo you want to overwrite it?",
|
||||
CommonBundle.getWarningTitle(), Messages.getWarningIcon()));
|
||||
CommonBundle.getWarningTitle(),
|
||||
"Overwrite", "Cancel",
|
||||
Messages.getWarningIcon()));
|
||||
if (Messages.NO == result[0]) return;
|
||||
}
|
||||
if (file.getParentFile() == null) {
|
||||
|
||||
Reference in New Issue
Block a user