Skip to content

Commit 523bef8

Browse files
committed
Fix minor issues
* Use SwingUtilities for Timer invocation * Prevent multi-registration of filter dialog hotkey
1 parent 9653b90 commit 523bef8

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎src/main/java/burp/CstcContextMenuItemsProvider.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import javax.swing.JMenu;
1313
import javax.swing.JMenuItem;
1414
import javax.swing.JTabbedPane;
15+
import javax.swing.SwingUtilities;
1516

1617
import burp.api.montoya.MontoyaApi;
1718
import burp.api.montoya.ui.contextmenu.ContextMenuEvent;
@@ -105,7 +106,11 @@ private void highlightExtensionName() {
105106

106107
@Override
107108
public void run() {
108-
resetHighlighting();
109+
SwingUtilities.invokeLater(new Runnable() {
110+
public void run(){
111+
resetHighlighting();
112+
}
113+
});
109114
}
110115

111116
};

‎src/main/java/de/usd/cstchef/view/RecipePanel.java‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public class RecipePanel extends JPanel implements ChangeListener {
105105
private static ImageIcon plusIcon = new ImageIcon(Operation.class.getResource("/plus.png"));
106106
private static ImageIcon minusIcon = new ImageIcon(Operation.class.getResource("/minus.png"));
107107

108+
private static boolean filterDialogHotKeyRegistered = false;
109+
108110
private JButton filters = new JButton("Filter");
109111

110112
private JButton addLaneButton = new JButton();
@@ -249,10 +251,13 @@ public void actionPerformed(ActionEvent e) {
249251
}
250252
});
251253

252-
HotKey hotKey = HotKey.hotKey("Open Filter Dialog", "Ctrl+Shift+F");
253-
HotKeyHandler handler = event -> filters.doClick();
254-
BurpUtils.getInstance().getApi().userInterface().registerHotKeyHandler(hotKey, handler);
255-
filters.setToolTipText("Hotkey from within a message editor: Ctrl + Shift + F");
254+
if(!RecipePanel.filterDialogHotKeyRegistered){
255+
HotKey hotKey = HotKey.hotKey("Open Filter Dialog", "Ctrl+Shift+F");
256+
HotKeyHandler handler = event -> filters.doClick();
257+
BurpUtils.getInstance().getApi().userInterface().registerHotKeyHandler(hotKey, handler);
258+
filters.setToolTipText("Hotkey from within a message editor: Ctrl + Shift + F");
259+
RecipePanel.filterDialogHotKeyRegistered = true;
260+
}
256261

257262
bakeButton.setEnabled(!autoBake);
258263
controlsPanel.add(bakeButton);

0 commit comments

Comments
 (0)