Add close all windows on exit and fixed remove row from mm doc app

This commit is contained in:
Willem Cazander 2025-02-03 23:48:59 +01:00
parent 0bee837b52
commit d146d5aed8
5 changed files with 24 additions and 6 deletions

View file

@ -69,6 +69,12 @@ public class MMDocDeskApp extends AbstractDeskApp implements DeskAppRenderer {
docManager.loadDrivers();
}
@Override
public void exit() {
docManager.getDataStore().clearAndCloseAllSafe();
}
@Override
public void create() {
getContours().setTitle("MMDoc");
getContours().registrateContour(DeskAppContourSection.MAIN, this);
@ -79,7 +85,7 @@ public class MMDocDeskApp extends AbstractDeskApp implements DeskAppRenderer {
dbPass.set("pass");
docTarget.set("target/mm-doc");
}
@Override
public void render() {
ImGui.inputText("docTarget", docTarget);
@ -134,8 +140,10 @@ public class MMDocDeskApp extends AbstractDeskApp implements DeskAppRenderer {
ImGui.tableSetupColumn("Remove");
ImGui.tableHeadersRow();
int i=1;
String removeId = null;
for (Entry<String,DataContext> data:docManager.getDataStore().entrySet()) {
ImGui.pushID(i);
ImGui.tableNextRow();
ImGui.tableNextColumn();
ImGui.text(data.getKey());
@ -147,6 +155,8 @@ public class MMDocDeskApp extends AbstractDeskApp implements DeskAppRenderer {
if (ImGui.smallButton("Remove")) {
removeId = data.getKey();
}
ImGui.popID();
i++;
}
ImGui.endTable();