@@ -70,6 +70,7 @@ void UI::UpdateTooltips() {
7070 {.hotkeys = " C-p" ,
7171 .description =
7272 std::string (layout_.show_wave_picker ? " SHOW/hide" : " show/HIDE" ) + " picker" });
73+ tooltips_.push_back ({.hotkeys = " C-r" , .description = " Reload waves" });
7374 }
7475 if (panels_[focused_panel_idx_]->Searchable ()) {
7576 tooltips_.push_back ({" /nN" , " search" });
@@ -152,6 +153,21 @@ UI::~UI() {
152153 endwin ();
153154}
154155
156+ void UI::ReloadWaves () {
157+ for (Panel *p : panels_) {
158+ p->PrepareForWaveDataReload ();
159+ }
160+ Workspace::Get ().Waves ()->Reload ();
161+ Workspace::Get ().TryMatchDesignWithWaves ();
162+ for (Panel *p : panels_) {
163+ p->HandleReloadedWaves ();
164+ }
165+ // Force a refresh on the signals in the refreshed wave data tree.
166+ if (const auto scope = wave_tree_panel_->ScopeForSignals ()) {
167+ wave_signals_panel_->SetScope (*scope);
168+ }
169+ }
170+
155171void UI::EventLoop () {
156172 while (int ch = getch ()) {
157173 bool quit = false ;
@@ -265,6 +281,13 @@ void UI::EventLoop() {
265281 LayoutPanels ();
266282 }
267283 break ;
284+ case 0x12 : // ctrl-R
285+ if (layout_.has_waves && (panels_[focused_panel_idx_] == waves_panel_.get () ||
286+ panels_[focused_panel_idx_] == wave_tree_panel_.get () ||
287+ panels_[focused_panel_idx_] == wave_signals_panel_.get ())) {
288+ ReloadWaves ();
289+ }
290+ break ;
268291 case 0x9 : // tab
269292 case 0x161 : { // shift-tab
270293 const bool fwd = ch == 0x9 ;
0 commit comments