Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.1:Update
sngrep
0001-ui-add-support-for-ncurses-compiled-with-o...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-ui-add-support-for-ncurses-compiled-with-opaque-stru.patch of Package sngrep
From f20a90b056200adae21ca2cace3d8a8c8852cdec Mon Sep 17 00:00:00 2001 From: Kaian <kaian@irontec.com> Date: Tue, 3 Apr 2018 20:53:31 +0200 Subject: [PATCH] ui: add support for ncurses compiled with opaque structures #239 --- src/curses/ui_column_select.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) Index: sngrep-1.4.5/src/curses/ui_column_select.c =================================================================== --- sngrep-1.4.5.orig/src/curses/ui_column_select.c +++ sngrep-1.4.5/src/curses/ui_column_select.c @@ -19,6 +19,7 @@ ** along with this program. If not, see <http://www.gnu.org/licenses/>. ** ****************************************************************************/ + /** * @file ui_column_select.c * @author Ivan Alonso [aka Kaian] <kaian@irontec.com> @@ -470,20 +471,31 @@ column_select_move_item(ui_t *ui, ITEM * // Swap position with destination int item_pos = item_index(item); info->items[item_pos] = info->items[pos]; - info->items[item_pos]->index = item_pos; info->items[pos] = item; - info->items[pos]->index = pos; + set_menu_items(info->menu, info->items); } void column_select_toggle_item(ui_t *ui, ITEM *item) { + // Get panel information + column_select_info_t *info = column_select_info(ui); + + int pos = item_index(item); + // Change item name if (!strncmp(item_name(item), "[ ]", 3)) { - item->name.str = "[*]"; + info->items[pos] = new_item("[*]", item_description(item)); } else { - item->name.str = "[ ]"; + info->items[pos] = new_item("[ ]", item_description(item)); } + + // Restore menu item + set_item_userptr(info->items[pos], item_userptr(item)); + set_menu_items(info->menu, info->items); + + // Destroy old item + free_item(item); } void @@ -504,4 +516,8 @@ column_select_update_menu(ui_t *ui) // Move until the current position is set set_top_row(info->menu, top_idx); set_current_item(info->menu, current); + + // Force menu redraw + menu_driver(info->menu, REQ_UP_ITEM); + menu_driver(info->menu, REQ_DOWN_ITEM); } Index: sngrep-1.4.5/src/curses/ui_manager.c =================================================================== --- sngrep-1.4.5.orig/src/curses/ui_manager.c +++ sngrep-1.4.5/src/curses/ui_manager.c @@ -93,7 +93,7 @@ ncurses_init() // Hide the cursor curs_set(0); // Only delay ESC Sequences 25 ms (we dont want Escape sequences) - ESCDELAY = 25; + set_escdelay(25); // Redefine some keys term = getenv("TERM");
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor