Skip to content

Commit

Permalink
Add tooltips on flag/feedback panel headers on error (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyborger1 authored Nov 9, 2022
1 parent d847c7a commit f6c5bb0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/botdetector/ui/BotDetectorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,7 @@ private void sendFeedbackToClient(FeedbackPredictionLabel proposedLabel)
}

feedbackHeaderLabel.setIcon(Icons.LOADING_SPINNER);
feedbackHeaderLabel.setToolTipText(null);
detectorClient.sendFeedback(lastPrediction, lastPredictionUploaderName, proposedLabel, feedbackText)
.whenComplete((b, ex) ->
{
Expand All @@ -1358,6 +1359,7 @@ private void sendFeedbackToClient(FeedbackPredictionLabel proposedLabel)
if (stillSame)
{
feedbackHeaderLabel.setIcon(null);
feedbackHeaderLabel.setToolTipText(null);
}
}
else
Expand All @@ -1369,6 +1371,7 @@ private void sendFeedbackToClient(FeedbackPredictionLabel proposedLabel)
{
resetFeedbackPanel(false);
feedbackHeaderLabel.setIcon(Icons.ERROR_ICON);
feedbackHeaderLabel.setToolTipText(ex != null ? ex.getMessage() : "Unknown error");
}
}

Expand Down Expand Up @@ -1401,6 +1404,7 @@ private void sendFlagToClient(boolean doFlag)
}

flaggingHeaderLabel.setIcon(Icons.LOADING_SPINNER);
flaggingHeaderLabel.setToolTipText(null);
detectorClient.sendSighting(lastPredictionPlayerSighting, lastPredictionUploaderName, true)
.whenComplete((b, ex) ->
{
Expand All @@ -1415,6 +1419,7 @@ private void sendFlagToClient(boolean doFlag)
if (stillSame)
{
flaggingHeaderLabel.setIcon(null);
flaggingHeaderLabel.setToolTipText(null);
}
}
else
Expand All @@ -1426,6 +1431,7 @@ private void sendFlagToClient(boolean doFlag)
{
resetFlaggingPanel();
flaggingHeaderLabel.setIcon(Icons.ERROR_ICON);
flaggingHeaderLabel.setToolTipText(ex != null ? ex.getMessage() : "Unknown error");
}
}

Expand All @@ -1449,6 +1455,7 @@ private boolean shouldAllowFlagging()
private void resetFeedbackPanel(boolean clearText)
{
feedbackHeaderLabel.setIcon(null);
feedbackHeaderLabel.setToolTipText(null);
feedbackSendButton.setBackground(null);
feedbackSendButton.setEnabled(true);
feedbackTextbox.setEnabled(true);
Expand Down Expand Up @@ -1498,6 +1505,7 @@ private void disableAndSetComboBoxOnFeedbackPanel(FeedbackPredictionLabel label,
private void resetFlaggingPanel()
{
flaggingHeaderLabel.setIcon(null);
flaggingHeaderLabel.setToolTipText(null);
flaggingYesButton.setBackground(null);
flaggingYesButton.setEnabled(true);
flaggingNoButton.setBackground(null);
Expand Down

0 comments on commit f6c5bb0

Please sign in to comment.