diff --git a/src/gui/ctrl/window-locator.cpp b/src/gui/ctrl/window-locator.cpp index c1152bd45..0338b6b1e 100644 --- a/src/gui/ctrl/window-locator.cpp +++ b/src/gui/ctrl/window-locator.cpp @@ -185,7 +185,19 @@ namespace ctrl { panel::Panel& PanelLocator::preliminary_impl_PanelLookup (int typeID) { - UNIMPLEMENTED ("search for existing panel in all windows, possibly create"); + REQUIRE (not isnil(windowList_)); + + for (auto window : windowList_) + if (window->getPanelManager().hasPanel (typeID)) + return window->getPanelManager().showPanel (typeID); + + // no instance of the desired panel type exists yet... + for (auto window : windowList_) + if (window->is_active()) + return window->getPanelManager().showPanel (typeID); + + // use the first window in list when none is active + return windowList_.front()->getPanelManager().showPanel (typeID); } diff --git a/src/gui/workspace/panel-manager.cpp b/src/gui/workspace/panel-manager.cpp index 73a2619fb..8691cac6c 100644 --- a/src/gui/workspace/panel-manager.cpp +++ b/src/gui/workspace/panel-manager.cpp @@ -136,6 +136,12 @@ namespace workspace { } + bool + PanelManager::hasPanel (const int description_index) + { + UNIMPLEMENTED ("search for a specific panel"); + } + panel::Panel& PanelManager::showPanel (const int description_index) { diff --git a/src/gui/workspace/panel-manager.hpp b/src/gui/workspace/panel-manager.hpp index d1ed12fce..1c136edd0 100644 --- a/src/gui/workspace/panel-manager.hpp +++ b/src/gui/workspace/panel-manager.hpp @@ -118,6 +118,9 @@ namespace workspace { */ panel::Panel& showPanel (const int description_index); + /** was the indicated panel already allocated within this PanelManager's realm? */ + bool hasPanel (const int description_index); + /** * Switches a panel from one type to another, * without touching the underlying GdlDockItem. diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 1153e5086..beaab6ce8 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -14539,14 +14539,14 @@ - - + + - - + + - - + +