Skip to content

Commit 2afed22

Browse files
committed
GUI fixies
1 parent b1a4f68 commit 2afed22

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Manager/Windows/MainWindow/MainWindow.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,13 @@ bool MainWindow::Render()
597597
}
598598
if (disableAll)
599599
ImGui::EndDisabled();
600-
if (disableAll || selectedBuild == -1)
600+
disabled = disableAll || selectedBuild == -1 || !UpdateManager::GetHosts()->at(selectedHost).IsAdmin;
601+
if (disabled)
601602
ImGui::BeginDisabled();
602603
if (ImGui::Button("Add depot", ImVec2(ImGui::GetContentRegionAvail().x / 2 - style->FramePadding.x, 0))) {
603604
ImGui::OpenPopup("Add Depot##depot");
604605
}
605-
if (disableAll || selectedBuild == -1)
606+
if (disabled)
606607
ImGui::EndDisabled();
607608
ImGui::SameLine();
608609

@@ -695,6 +696,7 @@ bool MainWindow::Render()
695696
auto depots = new std::vector<UpdateManager::BuildDepot>(*UpdateManager::GetHosts()->at(selectedHost).GetApps()->at(selectedApp).GetBuilds()->at(selectedBuild).GetDepots());
696697

697698
processingDepots = depots;
699+
processingLeft = processingDepots->size();
698700

699701
for (int i = 0; i < min(depots->size(), Settings::ThreadsCount); i++) {
700702
threads.push_back(CreateThread(0, 0, (LPTHREAD_START_ROUTINE)processDepotsThread, 0, 0, 0));
@@ -709,6 +711,7 @@ bool MainWindow::Render()
709711
ImGui::BeginDisabled();
710712
if (ImGui::Button("Upload all", ImVec2(ImGui::GetContentRegionAvail().x / 2 - style->FramePadding.x, 0)))
711713
{
714+
CloseAllViewWindows();
712715
downloadOrUpload = true;
713716
auto depots = new std::vector<UpdateManager::BuildDepot>(*UpdateManager::GetHosts()->at(selectedHost).GetApps()->at(selectedApp).GetBuilds()->at(selectedBuild).GetDepots());
714717

@@ -797,7 +800,7 @@ bool MainWindow::Render()
797800
bool close = false;
798801

799802
ImGui::Text(" App Name");
800-
ImGui::InputText("##appname", inputAppNameBuffer, sizeof(inputAppNameBuffer), ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CallbackCharFilter, [](ImGuiInputTextCallbackData* data) { if (data->EventChar >= 'a' && data->EventChar <= 'z' || data->EventChar >= 'A' && data->EventChar <= 'Z' || data->EventChar >= '0' && data->EventChar <= '9') return 0; return 1; });
803+
ImGui::InputText("##appname", inputAppNameBuffer, sizeof(inputAppNameBuffer), ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CallbackCharFilter, [](ImGuiInputTextCallbackData* data) { if (data->EventChar >= 'a' && data->EventChar <= 'z' || data->EventChar >= 'A' && data->EventChar <= 'Z' || data->EventChar >= '0' && data->EventChar <= '9' || data->EventChar <= '_') return 0; return 1; });
801804

802805
if (UpdateManager::GetHosts()->at(selectedHost).IsAdmin) {
803806
ImGui::Text("Access Group");
@@ -877,15 +880,15 @@ bool MainWindow::Render()
877880
if (GetAsyncKeyState(VK_ESCAPE))
878881
ImGui::CloseCurrentPopup();
879882
ImGui::Text(" Are you sure you want to remove app?");
880-
if (ImGui::Button("Remove", ImVec2(100, 0))) {
883+
if (ImGui::Button("Remove", ImVec2(130, 0))) {
881884
UpdateManager::GetHosts()->at(selectedHost).RemoveApp(UpdateManager::GetHosts()->at(selectedHost).GetApps()->at(selectedApp).Id);
882885
selectedApp = -1;
883886
selectedBuild = -1;
884887
selectedDepots.clear();
885888
ImGui::CloseCurrentPopup();
886889
}
887890
ImGui::SameLine();
888-
if (ImGui::Button("Cancel", ImVec2(100, 0))) {
891+
if (ImGui::Button("Cancel", ImVec2(130, 0))) {
889892
ImGui::CloseCurrentPopup();
890893
}
891894

0 commit comments

Comments
 (0)