DockAccess: implement preliminary simplistic lookup and allocation

This commit is contained in:
Fischlurch 2018-08-17 19:18:28 +02:00
parent 76e79c02ee
commit 67ac8601d8
4 changed files with 28 additions and 7 deletions

View file

@ -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);
}

View file

@ -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)
{

View file

@ -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.

View file

@ -14539,14 +14539,14 @@
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1534515750767" ID="ID_1614049284" MODIFIED="1534520027505" TEXT="Panel-Lookup/Allocation">
<linktarget COLOR="#aab7cb" DESTINATION="ID_1614049284" ENDARROW="Default" ENDINCLINATION="772;-6907;" ID="Arrow_ID_139428133" SOURCE="ID_1131466377" STARTARROW="None" STARTINCLINATION="676;1738;"/>
<icon BUILTIN="flag-yellow"/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1534520212473" ID="ID_172585735" MODIFIED="1534520248134" TEXT="durch alle WorkspaceWindows iterieren">
<icon BUILTIN="flag-yellow"/>
<node COLOR="#338800" CREATED="1534520212473" ID="ID_172585735" MODIFIED="1534526235983" TEXT="durch alle WorkspaceWindows iterieren">
<icon BUILTIN="button_ok"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1534520223304" ID="ID_605426716" MODIFIED="1534520247134" TEXT="jeden lokalen PanelManager fragen">
<icon BUILTIN="flag-yellow"/>
<node COLOR="#338800" CREATED="1534520223304" ID="ID_605426716" MODIFIED="1534526241279" TEXT="jeden lokalen PanelManager fragen">
<icon BUILTIN="button_ok"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1534520258251" ID="ID_634139165" MODIFIED="1534520270331" TEXT="wenn nicht gefunden, dann erzeugen">
<icon BUILTIN="flag-yellow"/>
<node COLOR="#338800" CREATED="1534520258251" ID="ID_634139165" MODIFIED="1534526246434" TEXT="wenn nicht gefunden, dann erzeugen">
<icon BUILTIN="button_ok"/>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1534520271354" ID="ID_1722998809" MODIFIED="1534522392135" TEXT="PanelManager: reine Anfrage">
<richcontent TYPE="NOTE"><html>
<head>