Skip to content

Commit

Permalink
proof of concept of fixing #7135, double-click Select Language and Co…
Browse files Browse the repository at this point in the history
…mpiler Specification
  • Loading branch information
hippietrail committed Nov 2, 2024
1 parent 23b75ec commit 5dc9947
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public SetLanguageDialog(PluginTool tool, LanguageCompilerSpecPair lcsPair, Stri
currentLCSPair = lcsPair;
this.tool = tool;

selectLangPanel = new NewLanguagePanel();
selectLangPanel = new NewLanguagePanel(null);

if (lcsPair != null) {
selectLangPanel.setSelectedLcsPair(lcsPair);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SelectLanguageDialog extends DialogComponentProvider {
public SelectLanguageDialog(String title, String approveButtonText) {
super(title, true);

languagePanel = new NewLanguagePanel();
languagePanel = new NewLanguagePanel(null);

setTransient(true);
addWorkPanel(languagePanel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void run() {
}

private void build() {
languagePanel = new NewLanguagePanel();
languagePanel = new NewLanguagePanel(this);
languagePanel.setRecommendedLcsPairsList(new ArrayList<LanguageCompilerSpecPair>());
languagePanel.setShowAllLcsPairs(false);
languagePanel.setBorder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
public class NewLanguagePanel extends JPanel {
private static final String DEFAULT_DESCRIPTION_TEXT = " ";

private ImporterLanguageDialog importerLanguageDialog;
private LanguageSortedTableModel tableModel;
private GhidraTable table;
private GhidraTableFilterPanel<LanguageCompilerSpecPair> tableFilterPanel;
Expand All @@ -48,7 +49,8 @@ private void setDescriptionLabelText(String text) {
descriptionLabel.setText(text);
}

public NewLanguagePanel() {
public NewLanguagePanel(ImporterLanguageDialog importerLanguageDialog) {
this.importerLanguageDialog = importerLanguageDialog;
constructEverything();
layoutEverything();
wireEverything();
Expand Down Expand Up @@ -145,6 +147,9 @@ private void wireEverything() {
public void mouseReleased(MouseEvent e) {
if (e.getClickCount() == 2) {
// do the next action thingie
if (importerLanguageDialog != null) {
importerLanguageDialog.close();
}
}
}
});
Expand Down

0 comments on commit 5dc9947

Please sign in to comment.