mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 04:08:27 +08:00
UI: Add help buttons to "New Online/Offline" (#4189)
* UI: Add help buttons to "New Online/Offline" - Add help button to both dialogs linking to docs.abapgit.org - Clicking the button brings up the documentation inside the GUI HTML viewer - Enhancement to `zcl_abapgit_gui` and `zcl_abapgit_html_viewer_gui` to properly handle 'Back' when navigating through Internet pages * Open help in external browser Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
59136bd06a
commit
9e385c264e
|
@ -117,6 +117,12 @@ CLASS ZCL_ABAPGIT_GUI IMPLEMENTATION.
|
||||||
DATA: lv_index TYPE i,
|
DATA: lv_index TYPE i,
|
||||||
ls_stack LIKE LINE OF mt_stack.
|
ls_stack LIKE LINE OF mt_stack.
|
||||||
|
|
||||||
|
" If viewer is showing Internet page, then use browser navigation
|
||||||
|
IF mi_html_viewer->get_url( ) CP 'http*'.
|
||||||
|
mi_html_viewer->back( ).
|
||||||
|
RETURN.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
lv_index = lines( mt_stack ).
|
lv_index = lines( mt_stack ).
|
||||||
|
|
||||||
IF lv_index = 0.
|
IF lv_index = 0.
|
||||||
|
|
|
@ -57,7 +57,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS zcl_abapgit_gui_page_addofflin IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_GUI_PAGE_ADDOFFLIN IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD constructor.
|
METHOD constructor.
|
||||||
|
@ -83,7 +83,9 @@ CLASS zcl_abapgit_gui_page_addofflin IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD get_form_schema.
|
METHOD get_form_schema.
|
||||||
|
|
||||||
ro_form = zcl_abapgit_html_form=>create( iv_form_id = 'add-repo-offline-form' ).
|
ro_form = zcl_abapgit_html_form=>create(
|
||||||
|
iv_form_id = 'add-repo-offline-form'
|
||||||
|
iv_help_page = 'https://docs.abapgit.org/guide-offline-install.html' ).
|
||||||
|
|
||||||
ro_form->text(
|
ro_form->text(
|
||||||
iv_name = c_id-url
|
iv_name = c_id-url
|
||||||
|
|
|
@ -61,7 +61,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS zcl_abapgit_gui_page_addonline IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_GUI_PAGE_ADDONLINE IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD constructor.
|
METHOD constructor.
|
||||||
|
@ -87,7 +87,9 @@ CLASS zcl_abapgit_gui_page_addonline IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD get_form_schema.
|
METHOD get_form_schema.
|
||||||
|
|
||||||
ro_form = zcl_abapgit_html_form=>create( iv_form_id = 'add-repo-online-form' ).
|
ro_form = zcl_abapgit_html_form=>create(
|
||||||
|
iv_form_id = 'add-repo-online-form'
|
||||||
|
iv_help_page = 'https://docs.abapgit.org/guide-online-install.html' ).
|
||||||
|
|
||||||
ro_form->text(
|
ro_form->text(
|
||||||
iv_name = c_id-url
|
iv_name = c_id-url
|
||||||
|
|
|
@ -334,6 +334,7 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
|
||||||
DATA lv_hint TYPE string.
|
DATA lv_hint TYPE string.
|
||||||
DATA ls_form_id TYPE string.
|
DATA ls_form_id TYPE string.
|
||||||
DATA lv_cur_group TYPE string.
|
DATA lv_cur_group TYPE string.
|
||||||
|
DATA lv_url TYPE string.
|
||||||
|
|
||||||
IF mv_form_id IS NOT INITIAL.
|
IF mv_form_id IS NOT INITIAL.
|
||||||
ls_form_id = | id="{ mv_form_id }"|.
|
ls_form_id = | id="{ mv_form_id }"|.
|
||||||
|
@ -393,10 +394,11 @@ CLASS zcl_abapgit_html_form IMPLEMENTATION.
|
||||||
ri_html->add( |<li class="dialog-commands">| ).
|
ri_html->add( |<li class="dialog-commands">| ).
|
||||||
|
|
||||||
IF mv_help_page IS NOT INITIAL.
|
IF mv_help_page IS NOT INITIAL.
|
||||||
|
lv_url = escape( val = mv_help_page
|
||||||
|
format = cl_abap_format=>e_url ).
|
||||||
ri_html->add_a(
|
ri_html->add_a(
|
||||||
iv_txt = zcl_abapgit_gui_buttons=>help( )
|
iv_txt = zcl_abapgit_gui_buttons=>help( )
|
||||||
iv_typ = zif_abapgit_html=>c_action_type-url
|
iv_act = |{ zif_abapgit_definitions=>c_action-url }?url={ lv_url }|
|
||||||
iv_act = mv_help_page
|
|
||||||
iv_class = 'dialog-help'
|
iv_class = 'dialog-help'
|
||||||
iv_title = 'Help' ).
|
iv_title = 'Help' ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
|
@ -26,7 +26,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS zcl_abapgit_html_viewer_gui IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_HTML_VIEWER_GUI IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD constructor.
|
METHOD constructor.
|
||||||
|
@ -62,6 +62,13 @@ CLASS zcl_abapgit_html_viewer_gui IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD zif_abapgit_html_viewer~back.
|
||||||
|
|
||||||
|
mo_html_viewer->go_back( ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD zif_abapgit_html_viewer~close_document.
|
METHOD zif_abapgit_html_viewer~close_document.
|
||||||
|
|
||||||
mo_html_viewer->close_document( ).
|
mo_html_viewer->close_document( ).
|
||||||
|
@ -76,6 +83,14 @@ CLASS zcl_abapgit_html_viewer_gui IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD zif_abapgit_html_viewer~get_url.
|
||||||
|
|
||||||
|
mo_html_viewer->get_current_url( IMPORTING url = rv_url ).
|
||||||
|
cl_gui_cfw=>flush( ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD zif_abapgit_html_viewer~load_data.
|
METHOD zif_abapgit_html_viewer~load_data.
|
||||||
|
|
||||||
mo_html_viewer->load_data(
|
mo_html_viewer->load_data(
|
||||||
|
|
|
@ -44,4 +44,8 @@ INTERFACE zif_abapgit_html_viewer
|
||||||
dp_error_general .
|
dp_error_general .
|
||||||
METHODS free .
|
METHODS free .
|
||||||
METHODS close_document .
|
METHODS close_document .
|
||||||
|
METHODS get_url
|
||||||
|
RETURNING
|
||||||
|
VALUE(rv_url) TYPE w3url.
|
||||||
|
METHODS back .
|
||||||
ENDINTERFACE.
|
ENDINTERFACE.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user