Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix available options for dialog messages #60

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ public boolean showDialog(Component parentComponent, String dialogTitle) {
sectionResBody.setSelected(defaults.contains(HttpSection.RES_BODY));
}

int returnValue = JOptionPane.showConfirmDialog(parentComponent, mainPanel, dialogTitle, JOptionPane.OK_CANCEL_OPTION);
int returnValue = JOptionPane.showConfirmDialog(
parentComponent,
mainPanel,
dialogTitle,
JOptionPane.OK_CANCEL_OPTION);
if (returnValue != JOptionPane.OK_OPTION) return false;

List<HttpSection> sections = Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ private JMenuItem createListClearMenuItem(List<RegexEntity> regexEntities,
null,
getLocaleString("options-list-clear-message"),
getLocaleString("options-list-clear-title"),
JOptionPane.OK_CANCEL_OPTION);
JOptionPane.YES_NO_OPTION);
if (dialogRes != JOptionPane.OK_OPTION) return;

if (!regexEntities.isEmpty()) {
Expand All @@ -394,7 +394,7 @@ private JMenuItem createListResetMenuItem(List<RegexEntity> regexEntities,
null,
getLocaleString("options-list-reset-message"),
getLocaleString("options-list-reset-title"),
JOptionPane.OK_CANCEL_OPTION);
JOptionPane.YES_NO_OPTION);
if (dialogRes != JOptionPane.OK_OPTION) return;

if (!regexEntities.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,11 @@ private JToggleButton createExportLogsButton() {
private JButton createClearLogsButton(JScrollPane scrollPaneLogger) {
JButton btnClearLogs = new JButton(getLocaleString("logger-clearLogs-label"));
btnClearLogs.addActionListener(e -> {
int dialog = JOptionPane.showConfirmDialog(null, getLocaleString("logger-clearLogs-confirm"));
int dialog = JOptionPane.showConfirmDialog(
null,
getLocaleString("logger-clearLogs-message"),
getLocaleString("logger-clearLogs-title"),
JOptionPane.YES_NO_OPTION);
if (dialog == JOptionPane.YES_OPTION) {
logEntriesManager.clear();
logsTableModel.fireTableDataChanged();
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/TextUI_en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ logger-analysis-start=Analyze HTTP History
logger-analysis-stop=Stop analysis
logger-analysis-stopping=Stopping the analysis...
logger-clearLogs-label=Clear all logs
logger-clearLogs-confirm=Delete ALL the logs in the list?
logger-clearLogs-message=Delete ALL the logs in the list?
logger-clearLogs-title=Clear list?
logger-exportLogs-label=Export list logs...
logger-searchBar-label=Filter results:
logger-resultsCount-label=Results:
Expand Down
Loading