Skip to content

Commit

Permalink
Find/Replace dialog, remove ring-tone #1908
Browse files Browse the repository at this point in the history
Removes the beep which is issued after some unsuccessful operations in
the find/replace dialog.

fixes #1908
  • Loading branch information
Wittmaxi committed Jun 4, 2024
1 parent 6990a01 commit d749474
Showing 1 changed file with 2 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void modifyText(ModifyEvent e) {
}

findReplaceLogic.performIncrementalSearch(getFindString());
evaluateFindReplaceStatus(false);
evaluateFindReplaceStatus();

updateButtonState(!findReplaceLogic.isActive(SearchOptions.INCREMENTAL));
}
Expand Down Expand Up @@ -1298,16 +1298,10 @@ private void activateInFindReplaceLogicIf(SearchOptions option, boolean shouldAc
}
}

private void evaluateFindReplaceStatus() {
evaluateFindReplaceStatus(true);
}

/**
* Evaluate the status of the FindReplaceLogic object.
*
* @param allowBeep Whether the evaluation should beep on some codes.
*/
private void evaluateFindReplaceStatus(boolean allowBeep) {
private void evaluateFindReplaceStatus() {
IFindReplaceStatus status = findReplaceLogic.getStatus();

String dialogMessage = status.accept(new FindReplaceLogicMessageGenerator());
Expand All @@ -1317,23 +1311,6 @@ private void evaluateFindReplaceStatus(boolean allowBeep) {
} else {
fStatusLabel.setForeground(JFaceColors.getErrorText(fStatusLabel.getDisplay()));
}

if (!status.wasSuccessful()) {
tryToBeep(allowBeep);
}
}

/**
* Tries beeping using the default beep. Will beep if the shell is currently
* usable.
*
* @param allowBeep Whether or not beeps should be allowed. Suppresses all beeps
* if false.
*/
private void tryToBeep(boolean allowBeep) {
if (okToUse(getShell()) && allowBeep) {
getShell().getDisplay().beep();
}
}

private String getCurrentSelection() {
Expand Down

0 comments on commit d749474

Please sign in to comment.