diff --git a/README.md b/README.md index e642dd5..96383b4 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,3 @@ + list and search all system services + adjust runlevel + stop/start/restart service - -### Bugs -+ on every even call new\_menu fails; which is funny, because i made this project to try out menu.h diff --git a/documentation/TODO.md b/documentation/TODO.md index 8c55b68..0ba1cbe 100644 --- a/documentation/TODO.md +++ b/documentation/TODO.md @@ -1,2 +1,2 @@ # TODO -+ on every second call new\_nemu returns NULL with E\_NOT\_CONNECTED, which is bullshit `items` is passed correctly ++ wait for feature requests and bug reports diff --git a/source/tui.cpp b/source/tui.cpp index 1d52657..610354b 100644 --- a/source/tui.cpp +++ b/source/tui.cpp @@ -302,6 +302,19 @@ static inline void make_menu(const int w, int y, const int x, const int flip_abo wbkgd(wmenud, COLOR_PAIR(COLOR_PAIR_STD)); cmd_menu = new_menu(items.elements); + /* ITEM stores MENU information internally such as its position in the MENU; + * new_menu() will fail if it detects that the ITEMs passed in were already assigned; + * however, in the process it happens to reset the ITEMs; + * i assume this means the check is actually useless since it breaks the previous owner + * and does not create a new; someone should check + * yet, since it resets, it means a second call will succeed; + * we could statically alloc MENU, but we dont want to perserve cursor location + * and who knows what, so we dont + */ + if (not cmd_menu + && errno == E_NOT_CONNECTED) { + cmd_menu = new_menu(items.elements); + } set_menu_win(cmd_menu, wmenu); set_menu_sub(cmd_menu, wmenud);