From 4d64bb48af7aef91de358f7e3be77b01c5060a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 11 Feb 2021 13:54:35 +0100 Subject: [PATCH 1/4] cmake: do not create the include symlink if it already exists Running "sudo make install" created the symlink as "root", the next "make" call failed when trying to re-create the symlink. --- src/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a6393982..5bce8712 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -217,9 +217,13 @@ set( LOCAL_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include ) # Symlink ../../libyui/src to build/src/include/yui # so the headers there can be included as add_custom_target( local-include-dir - COMMAND rm -rf ${LOCAL_INCLUDE_DIR} - COMMAND mkdir ${LOCAL_INCLUDE_DIR} - COMMAND ln -s ${CMAKE_CURRENT_SOURCE_DIR}/../../libyui/src ${LOCAL_INCLUDE_DIR}/yui ) + # check if the symlink already exists + COMMAND if [ ! -L "${LOCAL_INCLUDE_DIR}/yui" ]\; then + rm -rf ${LOCAL_INCLUDE_DIR}\; + mkdir ${LOCAL_INCLUDE_DIR}\; + ln -s ${CMAKE_CURRENT_SOURCE_DIR}/../../libyui/src ${LOCAL_INCLUDE_DIR}/yui\; + fi + ) add_dependencies( ${TARGETLIB} local-include-dir ) target_include_directories( ${TARGETLIB} BEFORE PUBLIC ${LOCAL_INCLUDE_DIR} ) From df3699fec93e9702e8e24aaa7698e87ddb87e6b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 11 Feb 2021 14:05:43 +0100 Subject: [PATCH 2/4] Added config and debug special keyboard shortcuts --- package/libyui-ncurses.spec | 2 +- src/NCDialog.cc | 7 +++++++ src/NCtoY2Event.cc | 6 ++++++ src/NCurses.cc | 2 ++ src/NCurses.h | 4 +++- 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/package/libyui-ncurses.spec b/package/libyui-ncurses.spec index 11182466..f757be00 100644 --- a/package/libyui-ncurses.spec +++ b/package/libyui-ncurses.spec @@ -24,7 +24,7 @@ Version: 4.0.1 Release: 0 %define so_version 15 -%define libyui_devel_version libyui-devel >= 3.10.0 +%define libyui_devel_version libyui-devel >= 4.0.1 %define bin_name %{name}%{so_version} BuildRequires: cmake >= 3.10 diff --git a/src/NCDialog.cc b/src/NCDialog.cc index 5d607377..cf614bb0 100644 --- a/src/NCDialog.cc +++ b/src/NCDialog.cc @@ -1160,6 +1160,13 @@ void NCDialog::processInput( int timeout_millisec ) YDialogSpy::showDialogSpy(); break; + case 'C': + pendingEvent = NCursesEvent::special_key_config; + break; + + case 'G': + pendingEvent = NCursesEvent::debug; + break; } break; diff --git a/src/NCtoY2Event.cc b/src/NCtoY2Event.cc index f7314ef6..84386640 100644 --- a/src/NCtoY2Event.cc +++ b/src/NCtoY2Event.cc @@ -76,6 +76,12 @@ NCtoY2Event::propagate() case cancel: return new YCancelEvent(); + case debug: + return new YDebugEvent(); + + case special_key_config: + return new YSpecialKeyEvent("config"); + case timeout: return new YTimeoutEvent(); diff --git a/src/NCurses.cc b/src/NCurses.cc index 30473c15..8bb75d61 100644 --- a/src/NCurses.cc +++ b/src/NCurses.cc @@ -115,6 +115,8 @@ std::ostream & operator<<( std::ostream & str, const NCursesEvent & obj ) ENUM_OUT( menu ); ENUM_OUT( timeout ); ENUM_OUT( key ); + ENUM_OUT( debug ); + ENUM_OUT( special_key_config ); } #undef ENUM_OUT diff --git a/src/NCurses.h b/src/NCurses.h index d547bdbf..0ddbf184 100644 --- a/src/NCurses.h +++ b/src/NCurses.h @@ -82,7 +82,9 @@ class NCursesEvent timeout, button, menu, - key + key, + debug, + special_key_config }; enum DETAIL From e9f3da25f70efc5ec4c25d3e49bac5483a609df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 11 Feb 2021 15:35:17 +0100 Subject: [PATCH 3/4] Document keyboard shortcuts --- doc/keyboard_shortcuts.md | 45 +++++++++++++++++++++++++++++++++++++++ src/NCDialog.cc | 5 ++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 doc/keyboard_shortcuts.md diff --git a/doc/keyboard_shortcuts.md b/doc/keyboard_shortcuts.md new file mode 100644 index 00000000..3ee3f69e --- /dev/null +++ b/doc/keyboard_shortcuts.md @@ -0,0 +1,45 @@ +# Libyui-ncurses Keyboard Shortcuts + +The libyui-ncurses interface implements several keyboard shortcuts. + +## Widget Shortcuts + +Some widgets use special keyboard shortcuts. Make sure that the respective +widget is active (the cursor is placed there). + +### Table + +- `Ctrl+O` - Change the ordering. After pressing it a list with the column + names is displayed. Select which column should be used for ordering, to + change the direction (ascending/descending) select the same column again. + +## Global Shortcuts + +These shortcuts can be used anytime, it does not matter which widget is active +(or if any widget is active at all). + +- `Shift+F1` - Display a hot key help. + +- `Ctrl+L` - Redraw the current screen. If for whatever reason the screen + content it not displayed properly you can force redrawing the whole screen. + +- `Shift+F4` - Change the color style. This cycles over the built-in color styles. + +- `Shift+F6` - Ask for widget ID. Enter the ID of the button which should be + activated. This is intended for automated tests. + +- `Ctrl+D Shift+D` - Dump the current dialog into the log. It dumps the screenshot + and also the logical structure of the dialog (the widget tree). + +- `Ctrl+D Shift+Y` - Start the widget inspector. Displays a special dialog which + can navigate in the widget tree and display detailed widget properties. It can + also change some widget properties and even delete or add new widgets. + +- `Ctrl+D Shift+G` - Send a debug event. This should start the debugger in the + running application. + +- `Ctrl+D Shift+C` - Send a configuration event. This should display a special + dialog for configuring the application. + +- `Ctrl+D Shift+S` (only when `Y2NCDBG` environment variable is set) - Display + a special style testing dialog. diff --git a/src/NCDialog.cc b/src/NCDialog.cc index cf614bb0..51a0d127 100644 --- a/src/NCDialog.cc +++ b/src/NCDialog.cc @@ -1393,10 +1393,13 @@ void NCDialog::showHotkeyHelp() "

Shift-F4 Change color schema.

" "

Ctrl-\\ Quit the application.

" "

Ctrl-L Refresh screen.

" + "

Ctrl-O Change table ordering, selecting the same column again changes the direction.

" "

Ctrl-D F1 Show a list of advanced hotkeys.

" "

Ctrl-D Shift-D Dump dialog to the log file as a screen shot.

" "

Ctrl-D Shift-Y Open YDialogSpy to see the widget hierarchy.

" - "

Depending on your desktop environment some of these key combinations
might not work.

" ), + "

Ctrl-D Shift-G Send a debug event, start the debugger.

" + "

Ctrl-D Shift-C Send a config event, display special configuration options.

" + "

Depending on your desktop environment some of these key combinations might not work.

" ), true ); // restore former text domain From 7044e01b707e01c63191dbe1c5bd48cdc5cf789d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 11 Feb 2021 14:39:24 +0100 Subject: [PATCH 4/4] Changes, version 4.0.2 --- VERSION.cmake | 2 +- package/libyui-ncurses-doc.spec | 2 +- package/libyui-ncurses.changes | 11 +++++++++++ package/libyui-ncurses.spec | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index ad6c1d13..e0da0134 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -1,6 +1,6 @@ SET( VERSION_MAJOR "4") SET( VERSION_MINOR "0" ) -SET( VERSION_PATCH "1" ) +SET( VERSION_PATCH "2" ) SET( VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ) SET( SONAME_MAJOR "15" ) diff --git a/package/libyui-ncurses-doc.spec b/package/libyui-ncurses-doc.spec index 825b089c..f9b4672c 100644 --- a/package/libyui-ncurses-doc.spec +++ b/package/libyui-ncurses-doc.spec @@ -22,7 +22,7 @@ Name: %{parent}-doc # DO NOT manually bump the version here; instead, use rake version:bump -Version: 4.0.1 +Version: 4.0.2 Release: 0 BuildArch: noarch diff --git a/package/libyui-ncurses.changes b/package/libyui-ncurses.changes index acd85af0..2b4fd661 100644 --- a/package/libyui-ncurses.changes +++ b/package/libyui-ncurses.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Feb 11 13:34:20 UTC 2021 - Ladislav Slezák + +- Added keyboard shortcuts: + Ctrl-D Shift-G - start the debugger + Ctrl-D Shift-C - start the configuration console + (jsc#PM-1895, jsc#SLE-16263) +- CMake fix: do not create the include/yui symlink if it already + exists +- 4.0.2 + ------------------------------------------------------------------- Thu Feb 4 10:19:11 UTC 2021 - Stefan Hundhammer diff --git a/package/libyui-ncurses.spec b/package/libyui-ncurses.spec index f757be00..8e9a24e9 100644 --- a/package/libyui-ncurses.spec +++ b/package/libyui-ncurses.spec @@ -20,7 +20,7 @@ Name: libyui-ncurses # DO NOT manually bump the version here; instead, use rake version:bump -Version: 4.0.1 +Version: 4.0.2 Release: 0 %define so_version 15