diff options
| author | Jiehong <email@majiehong.com> | 2021-01-20 15:52:35 +0100 |
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2021-01-22 20:45:43 +0100 |
| commit | 9ae5fed64ec1647d1c8a8e21528c1d2f08b3ebac (patch) | |
| tree | fd338be311196f7769f911b85880e0cfe8a5af13 /src/basic/unit-def.c | |
| parent | 95457dc13cc5fba332c44cbe3aa35e2fa129588f (diff) | |
| download | systemd-9ae5fed64ec1647d1c8a8e21528c1d2f08b3ebac.tar.gz | |
feature: display status with a different shape depending on the status (#17728)
Diffstat (limited to 'src/basic/unit-def.c')
| -rw-r--r-- | src/basic/unit-def.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/basic/unit-def.c b/src/basic/unit-def.c index 145399c963..bb4fa1ec6b 100644 --- a/src/basic/unit-def.c +++ b/src/basic/unit-def.c @@ -287,3 +287,24 @@ static const char* const notify_access_table[_NOTIFY_ACCESS_MAX] = { }; DEFINE_STRING_TABLE_LOOKUP(notify_access, NotifyAccess); + +SpecialGlyph unit_active_state_to_glyph(UnitActiveState state) { + switch (state) { + case UNIT_ACTIVE: + return SPECIAL_GLYPH_BLACK_CIRCLE; + case UNIT_RELOADING: + return SPECIAL_GLYPH_CIRCLE_ARROW; + case UNIT_INACTIVE: + return SPECIAL_GLYPH_WHITE_CIRCLE; + case UNIT_FAILED: + return SPECIAL_GLYPH_MULTIPLICATION_SIGN; + case UNIT_ACTIVATING: + case UNIT_DEACTIVATING: + return SPECIAL_GLYPH_BLACK_CIRCLE; + case UNIT_MAINTENANCE: + return SPECIAL_GLYPH_WHITE_CIRCLE; + + default: + return SPECIAL_GLYPH_BLACK_CIRCLE; + } +} |
