mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-02 03:07:50 +08:00
GP-5953 fixed bug where dirty program indicator not working after
analyze all.
This commit is contained in:
+25
-12
@@ -31,6 +31,7 @@ import ghidra.app.events.*;
|
|||||||
import ghidra.app.plugin.PluginCategoryNames;
|
import ghidra.app.plugin.PluginCategoryNames;
|
||||||
import ghidra.app.services.CodeViewerService;
|
import ghidra.app.services.CodeViewerService;
|
||||||
import ghidra.app.services.ProgramManager;
|
import ghidra.app.services.ProgramManager;
|
||||||
|
import ghidra.framework.data.DomainObjectAdapterDB;
|
||||||
import ghidra.framework.model.*;
|
import ghidra.framework.model.*;
|
||||||
import ghidra.framework.options.OptionsChangeListener;
|
import ghidra.framework.options.OptionsChangeListener;
|
||||||
import ghidra.framework.options.ToolOptions;
|
import ghidra.framework.options.ToolOptions;
|
||||||
@@ -57,7 +58,7 @@ import help.Help;
|
|||||||
eventsConsumed = { ProgramOpenedPluginEvent.class, ProgramClosedPluginEvent.class, ProgramActivatedPluginEvent.class, ProgramVisibilityChangePluginEvent.class }
|
eventsConsumed = { ProgramOpenedPluginEvent.class, ProgramClosedPluginEvent.class, ProgramActivatedPluginEvent.class, ProgramVisibilityChangePluginEvent.class }
|
||||||
)
|
)
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
public class MultiTabPlugin extends Plugin implements DomainObjectListener, OptionsChangeListener {
|
public class MultiTabPlugin extends Plugin implements TransactionListener, OptionsChangeListener {
|
||||||
private final static Icon TRANSIENT_ICON = new GIcon("icon.plugin.programmanager.transient");
|
private final static Icon TRANSIENT_ICON = new GIcon("icon.plugin.programmanager.transient");
|
||||||
private final static Icon EMPTY8_ICON = new GIcon("icon.plugin.programmanager.empty.small");
|
private final static Icon EMPTY8_ICON = new GIcon("icon.plugin.programmanager.empty.small");
|
||||||
private static final String SHOW_TABS_ALWAYS = "Show Program Tabs Always";
|
private static final String SHOW_TABS_ALWAYS = "Show Program Tabs Always";
|
||||||
@@ -248,14 +249,6 @@ public class MultiTabPlugin extends Plugin implements DomainObjectListener, Opti
|
|||||||
selectHighlightedProgramTimer.restart();
|
selectHighlightedProgramTimer.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void domainObjectChanged(DomainObjectChangedEvent ev) {
|
|
||||||
if (ev.getSource() instanceof Program) {
|
|
||||||
Program program = (Program) ev.getSource();
|
|
||||||
tabPanel.refreshTab(program);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init() {
|
protected void init() {
|
||||||
tabPanel = new GTabPanel<Program>("Program");
|
tabPanel = new GTabPanel<Program>("Program");
|
||||||
@@ -314,14 +307,14 @@ public class MultiTabPlugin extends Plugin implements DomainObjectListener, Opti
|
|||||||
|
|
||||||
if (progService.isVisible(prog)) {
|
if (progService.isVisible(prog)) {
|
||||||
tabPanel.addTab(prog);
|
tabPanel.addTab(prog);
|
||||||
prog.removeListener(this);
|
prog.removeTransactionListener(this);
|
||||||
prog.addListener(this);
|
prog.addTransactionListener(this);
|
||||||
updateActionEnablement();
|
updateActionEnablement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void remove(Program prog) {
|
private void remove(Program prog) {
|
||||||
prog.removeListener(this);
|
prog.removeTransactionListener(this);
|
||||||
tabPanel.removeTab(prog);
|
tabPanel.removeTab(prog);
|
||||||
updateActionEnablement();
|
updateActionEnablement();
|
||||||
}
|
}
|
||||||
@@ -379,4 +372,24 @@ public class MultiTabPlugin extends Plugin implements DomainObjectListener, Opti
|
|||||||
cvService.setNorthComponent(null);
|
cvService.setNorthComponent(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void transactionStarted(DomainObjectAdapterDB domainObj, TransactionInfo tx) {
|
||||||
|
// don't care
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void transactionEnded(DomainObjectAdapterDB domainObj) {
|
||||||
|
tabPanel.refreshTab((Program) domainObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void undoStackChanged(DomainObjectAdapterDB domainObj) {
|
||||||
|
// don't care
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void undoRedoOccurred(DomainObjectAdapterDB domainObj) {
|
||||||
|
tabPanel.refreshTab((Program) domainObj);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user