Changeset 08d5f8b in mainline for uspace/app/nav/nav.c


Ignore:
Timestamp:
2021-10-19T20:54:17Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Children:
2651dc5
Parents:
bdb2a72f
Message:

Add File / Open, properly deliver menu events to Navigator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/nav/nav.c

    rbdb2a72f r08d5f8b  
    5555};
    5656
     57static void navigator_file_open(void *);
     58static void navigator_file_exit(void *);
     59
     60static nav_menu_cb_t navigator_menu_cb = {
     61        .file_open = navigator_file_open,
     62        .file_exit = navigator_file_exit
     63};
     64
    5765/** Window close button was clicked.
    5866 *
     
    154162                goto error;
    155163
     164        nav_menu_set_cb(navigator->menu, &navigator_menu_cb,
     165            (void *)navigator);
     166
    156167        rc = ui_fixed_add(navigator->fixed, nav_menu_ctl(navigator->menu));
    157168        if (rc != EOK) {
     
    278289}
    279290
     291/** File / Open menu entry selected */
     292static void navigator_file_open(void *arg)
     293{
     294        navigator_t *navigator = (navigator_t *)arg;
     295        panel_t *panel;
     296
     297        panel = navigator_get_active_panel(navigator);
     298        panel_open(panel, panel->cursor);
     299}
     300
     301/** File / Exit menu entry selected */
     302static void navigator_file_exit(void *arg)
     303{
     304        navigator_t *navigator = (navigator_t *)arg;
     305
     306        ui_quit(navigator->ui);
     307}
     308
    280309/** @}
    281310 */
Note: See TracChangeset for help on using the changeset viewer.