Virtual machine Management Terminal User Interface
修订版 | 2cea259b96ddb86b53573000b342d60e973b96ee (tree) |
---|---|
时间 | 2022-07-24 21:37:33 |
作者 | Koine Yuusuke(koinec) <koinec@user...> |
Commiter | Koine Yuusuke(koinec) |
Improve HyperVisor connecting animation logic.
@@ -191,6 +191,7 @@ int | ||
191 | 191 | VmList_Item *p_item; |
192 | 192 | char str_fmt[32]; |
193 | 193 | char str_stat[16]; |
194 | + char str_animation[5] = "-\\|/"; | |
194 | 195 | |
195 | 196 | i_err = TuiVmList_CreateList(); |
196 | 197 |
@@ -220,12 +221,10 @@ int | ||
220 | 221 | i_attr = COLOR_PAIR(2); // Green-Black |
221 | 222 | } |
222 | 223 | else if( HVISOR_STATUS_CONNECTING & p_hvisor->dw_status ) { |
223 | - if( 2 < p_item->i_animation ) { p_item->i_animation = 0; } | |
224 | - str_stat[0] = ((0 == p_item->i_animation) ? '-' : | |
225 | - ((1 == p_item->i_animation) ? '\\' : '/')); | |
224 | + str_stat[0] = str_animation[ p_item->i_animation ]; | |
226 | 225 | str_stat[1] = '\0'; |
227 | 226 | strncat( str_stat, " Connecting.", 15 ); |
228 | - p_item->i_animation++; | |
227 | + p_item->i_animation = ++p_item->i_animation % 4; | |
229 | 228 | |
230 | 229 | i_attr = COLOR_PAIR(6); // Green-Black |
231 | 230 | } |