blob: 852e093146fabf483a657655f5ac127198c5e0ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include "toggle_pause.hpp"
#include <fmt/core.h>
#include <utility>
TogglePauseCommand::TogglePauseCommand(
std::shared_ptr<IGenerationTracker> generation_tracker,
std::shared_ptr<IStatusManager> status_manager) noexcept
: _generation_tracker(std::move(generation_tracker)),
_status_manager(std::move(status_manager))
{
}
void TogglePauseCommand::execute() noexcept
{
auto onoff = !_generation_tracker->get_is_paused();
_generation_tracker->set_is_paused(onoff);
_status_manager->set_section_body(StatusLineSection::D, onoff ? "yes" : "no");
}
|