Add "Show Hotkeys" to Help Menu (#5863)

Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
Christian Günter 2022-11-08 16:52:41 +01:00 committed by GitHub
parent 3a4396fdb6
commit e2dbcf6308
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 5 deletions

View File

@ -11,4 +11,7 @@ INTERFACE zif_abapgit_gui_hotkey_ctl
VALUE(rt_registered_hotkeys) TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr VALUE(rt_registered_hotkeys) TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr
RAISING RAISING
zcx_abapgit_exception. zcx_abapgit_exception.
METHODS set_visible
IMPORTING
iv_visible TYPE abap_bool.
ENDINTERFACE. ENDINTERFACE.

View File

@ -336,7 +336,10 @@ CLASS ZCL_ABAPGIT_GUI_CHUNK_LIB IMPLEMENTATION.
iv_act = zif_abapgit_definitions=>c_action-go_explore iv_act = zif_abapgit_definitions=>c_action-go_explore
)->add( )->add(
iv_txt = 'Changelog' iv_txt = 'Changelog'
iv_act = zif_abapgit_definitions=>c_action-changelog ). iv_act = zif_abapgit_definitions=>c_action-changelog
)->add(
iv_txt = 'Hotkeys'
iv_act = zif_abapgit_definitions=>c_action-show_hotkeys ).
ENDMETHOD. ENDMETHOD.

View File

@ -23,7 +23,8 @@ CLASS zcl_abapgit_gui_hotkey_ctl DEFINITION
DATA: DATA:
mt_hotkeys TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr, mt_hotkeys TYPE zif_abapgit_gui_hotkeys=>ty_hotkeys_with_descr,
ms_user_settings TYPE zif_abapgit_definitions=>ty_s_user_settings. ms_user_settings TYPE zif_abapgit_definitions=>ty_s_user_settings,
mv_visible TYPE abap_bool.
CLASS-DATA gv_hint_was_shown TYPE abap_bool . CLASS-DATA gv_hint_was_shown TYPE abap_bool .
METHODS render_scripts METHODS render_scripts
@ -176,14 +177,14 @@ CLASS zcl_abapgit_gui_hotkey_ctl IMPLEMENTATION.
lv_hint = |Close window with upper right corner 'X'|. lv_hint = |Close window with upper right corner 'X'|.
IF lv_hotkey IS NOT INITIAL. IF lv_hotkey IS NOT INITIAL.
lv_hint = lv_hint && | or press '{ <ls_hotkey>-hotkey }' again|. lv_hint = lv_hint && | or press '{ <ls_hotkey>-hotkey }'|.
ENDIF. ENDIF.
ri_html = zcl_abapgit_gui_chunk_lib=>render_infopanel( ri_html = zcl_abapgit_gui_chunk_lib=>render_infopanel(
iv_div_id = 'hotkeys' iv_div_id = 'hotkeys'
iv_title = 'Hotkeys' iv_title = 'Hotkeys'
iv_hint = lv_hint iv_hint = lv_hint
iv_hide = abap_true iv_hide = boolc( mv_visible = abap_false )
iv_scrollable = abap_false iv_scrollable = abap_false
io_content = ri_html ). io_content = ri_html ).
@ -193,5 +194,17 @@ CLASS zcl_abapgit_gui_hotkey_ctl IMPLEMENTATION.
&& |</div>| ). && |</div>| ).
ENDIF. ENDIF.
" Always reset visibility here. Closing of the popup has to be done by the
" user and is handeled in JS.
mv_visible = abap_false.
ENDMETHOD. ENDMETHOD.
METHOD zif_abapgit_gui_hotkey_ctl~set_visible.
mv_visible = iv_visible.
ENDMETHOD.
ENDCLASS. ENDCLASS.

View File

@ -266,7 +266,11 @@ CLASS zcl_abapgit_gui_router IMPLEMENTATION.
WHEN zif_abapgit_definitions=>c_action-changelog. " abapGit full changelog WHEN zif_abapgit_definitions=>c_action-changelog. " abapGit full changelog
zcl_abapgit_services_abapgit=>open_abapgit_changelog( ). zcl_abapgit_services_abapgit=>open_abapgit_changelog( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act. rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-show_hotkeys. " show hotkeys
zcl_abapgit_ui_factory=>get_gui(
)->zif_abapgit_gui_services~get_hotkeys_ctl(
)->set_visible( abap_true ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ENDCASE. ENDCASE.
ENDMETHOD. ENDMETHOD.

View File

@ -508,6 +508,7 @@ INTERFACE zif_abapgit_definitions
documentation TYPE string VALUE 'documentation', documentation TYPE string VALUE 'documentation',
changelog TYPE string VALUE 'changelog', changelog TYPE string VALUE 'changelog',
clipboard TYPE string VALUE 'clipboard', clipboard TYPE string VALUE 'clipboard',
show_hotkeys TYPE string VALUE 'show_hotkeys',
END OF c_action. END OF c_action.
CONSTANTS c_spagpa_param_repo_key TYPE c LENGTH 20 VALUE 'REPO_KEY' ##NO_TEXT. CONSTANTS c_spagpa_param_repo_key TYPE c LENGTH 20 VALUE 'REPO_KEY' ##NO_TEXT.
CONSTANTS c_spagpa_param_package TYPE c LENGTH 20 VALUE 'PACKAGE' ##NO_TEXT. CONSTANTS c_spagpa_param_package TYPE c LENGTH 20 VALUE 'PACKAGE' ##NO_TEXT.