diff --git a/client/src/dialog/screenshotdialog.cpp b/client/src/dialog/screenshotdialog.cpp index 712b2045..9b298bba 100644 --- a/client/src/dialog/screenshotdialog.cpp +++ b/client/src/dialog/screenshotdialog.cpp @@ -42,6 +42,7 @@ #include "../network/error.hpp" #include "../network/method.hpp" #include "../network/object.hpp" +#include "../network/objectproperty.hpp" #include "../settings/boardsettings.hpp" #include "../settings/generalsettings.hpp" #include "../subwindow/subwindow.hpp" @@ -50,6 +51,7 @@ #include "../widget/objectlist/objectlistwidget.hpp" #include "../widget/objectlist/interfacelistwidget.hpp" #include "../widget/objectlist/throttleobjectlistwidget.hpp" +#include "../widget/outputmapwidget.hpp" #include "../widget/throttle/throttlebutton.hpp" #include "../widget/throttle/throttlewidget.hpp" #include "../wizard/newboardwizard.hpp" @@ -556,6 +558,39 @@ void ScreenShotDialog::start() return false; }); + // Turnout dialog: + m_steps.push( + [this]() + { + m_mainWindow.showObject("turnout_1"); + return true; + }); + m_steps.push( + [this]() + { + if(auto* w = getSubWindow(QStringLiteral("turnout_1"))) + { + w->resize(400, 300); + auto* map = static_cast(static_cast(w->widget()->layout()->itemAt(0)->widget())->widget(1)->layout()->itemAt(0)->widget()); + map->m_object->getObjectProperty("interface")->setByObjectId("loconet_1"); + return true; + } + return false; + }); + m_steps.push( + [this]() + { + if(auto* w = getSubWindow(QStringLiteral("turnout_1"))) + { + saveWidgetImage(w, QStringLiteral("getting-started/turnout-general.png")); + static_cast(w->widget()->layout()->itemAt(0)->widget())->setCurrentIndex(1); + saveWidgetImage(w, QStringLiteral("getting-started/turnout-output-mapping.png")); + w->close(); + return true; + } + return false; + }); + // Board tiles: m_steps.push( [this]() diff --git a/client/src/widget/outputmapwidget.hpp b/client/src/widget/outputmapwidget.hpp index 563100e2..ea80a7d2 100644 --- a/client/src/widget/outputmapwidget.hpp +++ b/client/src/widget/outputmapwidget.hpp @@ -3,7 +3,7 @@ * * This file is part of the traintastic source code. * - * Copyright (C) 2021,2024 Reinder Feenstra + * Copyright (C) 2021-2025 Reinder Feenstra * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -39,6 +39,8 @@ class OutputMapWidget : public QWidget { Q_OBJECT + friend class ScreenShotDialog; + protected: ObjectPtr m_object; ObjectPtr m_parentObject;