diff options
| author | Hannes Schulze <hannes.hs.schulze@fau.de> | 2025-05-02 16:17:56 +0200 |
|---|---|---|
| committer | Hannes Schulze <hannes.hs.schulze@fau.de> | 2025-05-02 16:17:56 +0200 |
| commit | 850159dc9663a1cb0a7bb8f25fe1d426134ccabb (patch) | |
| tree | 122c61166f6589be1e15ef328388cbc2596f97f4 /lib/nes/app/application.cc | |
| parent | 91c9b3addf5f3db972fd28752855eda811221afe (diff) | |
implement file viewer
Diffstat (limited to 'lib/nes/app/application.cc')
| -rw-r--r-- | lib/nes/app/application.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/nes/app/application.cc b/lib/nes/app/application.cc index 521cc40..622fdf7 100644 --- a/lib/nes/app/application.cc +++ b/lib/nes/app/application.cc @@ -1,6 +1,5 @@ #include "nes/app/application.hh" #include "nes/app/input/input-device-keyboard.hh" -#include "nes/app/input/input-device-controller.hh" #include "nes/app/ui/screen.hh" #include "nes/app/graphics/renderer.hh" #include "nes/app/action.hh" @@ -57,6 +56,7 @@ namespace nes::app , screen_error_{ keyboard } , screen_confirm_quit_{ keyboard } , screen_prompt_key_{ keyboard } + , screen_file_viewer_{ keyboard, file_browser } { display_.visible_screen = &screen_title_; } @@ -193,6 +193,14 @@ namespace nes::app } case action::type::view_file: { + if (auto const s = screen_file_viewer_.load(a.get_file_name()); s != status::success) + { + show_error("Unable to open file", s); + } + else + { + display_.visible_popup = &screen_file_viewer_; + } break; } case action::type::show_error: |
