Skip to content

Commit

Permalink
Merge #2732
Browse files Browse the repository at this point in the history
2732: [gui] not reacting to primary instance being purged r=andrei-toterman a=sharder996

This PR fixes the text shown in the gui when no primary instance is found.

Fixes #1241

Co-authored-by: sharder996 <[email protected]>
  • Loading branch information
townsend2010 and sharder996 authored Sep 6, 2022
2 parents 45017b1 + 8903ce5 commit 7b27b4e
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions src/client/gui/gui_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,28 +399,25 @@ void cmd::GuiCmd::handle_petenv_instance(const google::protobuf::RepeatedPtrFiel
// petenv doesn't exist yet
if (petenv_instance == instances.cend())
{
if (current_petenv_name != petenv_name)
{
petenv_start_action.setText("Start");
petenv_start_action.setEnabled(false);
petenv_shell_action.setEnabled(true);
petenv_stop_action.setEnabled(false);

current_petenv_name = petenv_name;
}
petenv_start_action.setText("Start");
petenv_start_action.setEnabled(false);
petenv_shell_action.setEnabled(true);
petenv_stop_action.setEnabled(false);

return;
current_petenv_name = petenv_name;
}

auto state = petenv_instance->instance_status();

if (petenv_state.status() != state.status() || petenv_name != current_petenv_name)
else
{
petenv_start_action.setText(set_title_string_for(fmt::format("Start \"{}\"", petenv_name), state));
auto state = petenv_instance->instance_status();

set_input_state_for({&petenv_start_action, &petenv_shell_action, &petenv_stop_action}, state);
petenv_state = state;
current_petenv_name = petenv_name;
if (petenv_state.status() != state.status() || petenv_name != current_petenv_name)
{
petenv_start_action.setText(set_title_string_for(fmt::format("Start \"{}\"", petenv_name), state));

set_input_state_for({&petenv_start_action, &petenv_shell_action, &petenv_stop_action}, state);
petenv_state = state;
current_petenv_name = petenv_name;
}
}
}

Expand Down

0 comments on commit 7b27b4e

Please sign in to comment.