aboutsummaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/toggle_pause.cpp13
-rw-r--r--src/commands/toggle_pause.hpp6
2 files changed, 6 insertions, 13 deletions
diff --git a/src/commands/toggle_pause.cpp b/src/commands/toggle_pause.cpp
index 434330e..54682c6 100644
--- a/src/commands/toggle_pause.cpp
+++ b/src/commands/toggle_pause.cpp
@@ -5,10 +5,10 @@
TogglePauseCommand::TogglePauseCommand(
std::shared_ptr<IGenerationTracker> generation_tracker,
- std::shared_ptr<IStatusLine> statusline
+ std::shared_ptr<IStatusManager> status_manager
) noexcept
: _generation_tracker(std::move(generation_tracker)),
- _statusline(std::move(statusline))
+ _status_manager(std::move(status_manager))
{
}
@@ -18,12 +18,5 @@ void TogglePauseCommand::execute() noexcept
_generation_tracker->set_is_paused(onoff);
- _statusline->set_status(
- StatusLineSection::B,
- fmt::format(
- "Paused: {} Generation: {}",
- _generation_tracker->get_is_paused() ? "yes" : "no",
- _generation_tracker->get_current_generation()
- )
- );
+ _status_manager->set_section_body(StatusLineSection::D, onoff ? "yes" : "no");
}
diff --git a/src/commands/toggle_pause.hpp b/src/commands/toggle_pause.hpp
index e243cc3..43502f8 100644
--- a/src/commands/toggle_pause.hpp
+++ b/src/commands/toggle_pause.hpp
@@ -2,7 +2,7 @@
#include "interfaces/command.hpp"
#include "interfaces/generation_tracker.hpp"
-#include "interfaces/statusline.hpp"
+#include "interfaces/status_manager.hpp"
#include <memory>
@@ -11,12 +11,12 @@ class TogglePauseCommand : public ICommand
public:
explicit TogglePauseCommand(
std::shared_ptr<IGenerationTracker> generation_tracker,
- std::shared_ptr<IStatusLine> statusline
+ std::shared_ptr<IStatusManager> status_manager
) noexcept;
void execute() noexcept override;
private:
std::shared_ptr<IGenerationTracker> _generation_tracker;
- std::shared_ptr<IStatusLine> _statusline;
+ std::shared_ptr<IStatusManager> _status_manager;
};