bug fixes

This commit is contained in:
2023-02-24 14:20:37 +01:00
parent 86ddf850af
commit df3de70398
6 changed files with 29 additions and 15 deletions

View File

@@ -363,7 +363,6 @@ ImVec2 timerWindow(DrawData& drawData, ApplicationData& appData)
ImGui::OpenPopup(SETTINGS_POPUP_NAME);
}
float timerDisplayMinutes = appData.settings.timerDuration / 60.f;
if (timerData.isTimerActive)
@@ -529,7 +528,7 @@ ImVec2 checklistWindow(ApplicationData& appData, const char* title)
double timeDiffSeconds = difftime(today, getDayStartOf(mostRecentDoneDate));
int timeDiffDays = timeDiffSeconds / (60 * 60 * 24);
bool highlightButton = timeDiffDays >= appData.checklistHighlightDurationDays;
bool highlightButton = timeDiffDays > appData.checklistHighlightDurationDays;
if (highlightButton)
{
ImGui::PushStyleColor(ImGuiCol_FrameBg, { .5f, .2f, .15f, 0.54f });
@@ -580,7 +579,7 @@ ImVec2 checklistWindow(ApplicationData& appData, const char* title)
return size;
}
void startBaseStationProc(const char* args)
void startBaseStationProc(const char* args, DWORD flags = 0)
{
// additional information
STARTUPINFOA si;
@@ -592,11 +591,7 @@ void startBaseStationProc(const char* args)
ZeroMemory(&pi, sizeof(pi));
// start the program up
DWORD creationFlags = 0;
#ifdef _DEBUG
creationFlags = CREATE_NEW_CONSOLE;
#endif
CreateProcessA("lighthouse-v2-manager.exe", const_cast<LPSTR>(args), NULL, NULL, FALSE, creationFlags, NULL, NULL, &si, &pi);
CreateProcessA("lighthouse-v2-manager.exe", const_cast<LPSTR>(args), NULL, NULL, FALSE, flags, NULL, NULL, &si, &pi);
// Close process and thread handles.
CloseHandle(pi.hProcess);
@@ -620,7 +615,7 @@ ImVec2 baseStationWindow(ApplicationData& appData)
params.append(" ");
params.append(mac.c_str());
}
startBaseStationProc(params.c_str());
startBaseStationProc(params.c_str(), appData.settings.baseStationShowConsole ? CREATE_NEW_CONSOLE : CREATE_NO_WINDOW);
}
ImGui::SameLine();
if (ImGui::Button("Shutdown"))
@@ -631,12 +626,13 @@ ImVec2 baseStationWindow(ApplicationData& appData)
params.append(" ");
params.append(mac.c_str());
}
startBaseStationProc(params.c_str());
startBaseStationProc(params.c_str(), appData.settings.baseStationShowConsole ? CREATE_NEW_CONSOLE : CREATE_NO_WINDOW);
}
}
if (ImGui::BeginPopup(SETTINGS_POPUP_NAME))
{
ImGui::Checkbox("Show Console", &appData.settings.baseStationShowConsole);
if (ImGui::Button("Search"))
{
startBaseStationProc("discover");