Skip to content

Commit

Permalink
Do nothing when dialog exit button is used
Browse files Browse the repository at this point in the history
  • Loading branch information
PyvesB committed Feb 20, 2022
1 parent 6df3c35 commit ae33670
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ private void displayNotFoundWarning() {
+ "after running \"gem install readapt\" in a terminal." + System.lineSeparator()
+ System.lineSeparator() + "Please restart the debug session once installation is complete.",
MessageDialog.WARNING, 0, "Install gem", "Specify path");
if (notFoundDialog.open() == 0) { // First button index, install.
int buttonIndex = notFoundDialog.open();
if (buttonIndex == 0) {
GemHelper.install("Readapt", READAPT_PATH);
HAS_UPDATED_READAPT.set(true);
} else {
} else if (buttonIndex == 1) {
PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(null, PreferencePage.PAGE_ID,
null, null);
((PreferencePage) preferenceDialog.getSelectedPage()).getPathField("readapt").setFocus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ private void displayNotFoundWarning() {
"Key features will not be available. Let Eclipse install the gem locally or specify its path "
+ "after running \"gem install solargraph\" in a terminal.",
MessageDialog.WARNING, 0, "Install gem", "Specify path");
if (notFoundDialog.open() == 0) { // First button index, install.
int buttonIndex = notFoundDialog.open();
if (buttonIndex == 0) {
GemHelper.install("Solargraph", GEM_PATH);
HAS_UPDATED_SOLARGRAPH.set(true);
} else {
} else if (buttonIndex == 1) {
PreferenceDialog preferenceDialog = PreferencesUtil.createPreferenceDialogOn(null, PreferencePage.PAGE_ID,
null, null);
((PreferencePage) preferenceDialog.getSelectedPage()).getPathField("solargraph").setFocus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ private static void displayInstallationError(String gem) {
null, "Please open the Error Log view for details. To manually install it, run \"gem install "
+ gem.toLowerCase() + "\" in a terminal and specify the path in the plugin's preferences.",
MessageDialog.ERROR, 0, "Open error logs", "Specify path");
if (errorDialog.open() == 0) { // First button index, open Error Log.
int buttonIndex = errorDialog.open();
if (buttonIndex == 0) {
try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.showView("org.eclipse.pde.runtime.LogView");
} catch (PartInitException e) {
LogHelper.error("Failed to open Error Log view.", e);
}
} else {
} else if (buttonIndex == 1) {
PreferenceDialog prefDialog = PreferencesUtil.createPreferenceDialogOn(null, PreferencePage.PAGE_ID, null, null);
((PreferencePage) prefDialog.getSelectedPage()).getPathField(gem).setFocus();
prefDialog.open();
Expand Down

0 comments on commit ae33670

Please sign in to comment.