Skip to content

Commit

Permalink
moved ingo document context menu initializiation from constructor to …
Browse files Browse the repository at this point in the history
…when the popup is opened. close #2589
  • Loading branch information
j-dimension committed Sep 29, 2024
1 parent 8d1e5e2 commit e618fa1
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1052,17 +1052,6 @@ public Component getTableCellRendererComponent(JTable table, Object value, boole
htrs.setComparator(0, dtComparator);
this.tblAccountEntries.setRowSorter(htrs);

AssistantAccess ingo = AssistantAccess.getInstance();
try {
Map<AssistantConfig, List<AiCapability>> capabilities2 = ingo.filterCapabilities(AiCapability.REQUESTTYPE_SUMMARIZE, AiCapability.INPUTTYPE_STRING);
ingo.populateMenu(this.mnuAssistant, capabilities2, (AssistantInputAdapter)this, this.dto);
this.mnuAssistant.add(new JSeparator());
Map<AssistantConfig, List<AiCapability>> capabilities3 = ingo.filterCapabilities(AiCapability.REQUESTTYPE_CHAT, AiCapability.INPUTTYPE_NONE);
ingo.populateMenu(this.mnuAssistant, capabilities3, (AssistantInputAdapter)this, this.dto);
} catch (Exception ex) {
log.error(ex);
}

EventBroker b = EventBroker.getInstance();
b.subscribeConsumer(this, Event.TYPE_DOCUMENTADDED);
b.subscribeConsumer(this, Event.TYPE_REVIEWADDED);
Expand Down Expand Up @@ -4199,6 +4188,19 @@ public void showDocumentsPopup(MouseEvent evt) {
this.mnuOpenDocumentMicrosoftOffice.setEnabled(false);
this.mnuUseDocumentAsTemplate.setEnabled(true);
}

AssistantAccess ingo = AssistantAccess.getInstance();
try {
this.mnuAssistant.removeAll();
Map<AssistantConfig, List<AiCapability>> capabilities2 = ingo.filterCapabilities(AiCapability.REQUESTTYPE_SUMMARIZE, AiCapability.INPUTTYPE_STRING);
ingo.populateMenu(this.mnuAssistant, capabilities2, (AssistantInputAdapter)this, this.dto);
this.mnuAssistant.add(new JSeparator());
Map<AssistantConfig, List<AiCapability>> capabilities3 = ingo.filterCapabilities(AiCapability.REQUESTTYPE_CHAT, AiCapability.INPUTTYPE_NONE);
ingo.populateMenu(this.mnuAssistant, capabilities3, (AssistantInputAdapter)this, this.dto);
} catch (Exception ex) {
log.error(ex);
}

this.documentsPopup.show(evt.getComponent(), evt.getX(), evt.getY());

}
Expand Down

0 comments on commit e618fa1

Please sign in to comment.