Files
qt-migration-legatus/qt5-before/dlbo/Lts/Common/LtsAppManager/lts_app_manager.h
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

137 lines
4.6 KiB
C++

#pragma once
#include <LtsAppDescriptor/lts_app_descriptor.h>
#include <Common/ProjectConfig/project_defines.h>
#include <LtsWidgets/lts_dialog.h>
#include <LtsWidgets/lts_base_layout_widget.h>
#include <LtsSession/lts_session.h>
#include <memory>
#include <QObject>
#include <QVector>
#ifndef LTSAPPMANAGER_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define LTSAPPMANAGER_EXPORT
# else
# if defined(MAKE_LTSAPPMANAGER_LIB)
# define LTSAPPMANAGER_EXPORT Q_DECL_EXPORT
# else
# define LTSAPPMANAGER_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif
namespace LtsPluginManager
{
class LtsPluginManager;
}
namespace LtsLogin
{
class LtsLogin;
}
namespace LtsSession
{
class LtsSession;
struct DdsConnectionParams;
}
namespace DeveloperTools
{
class DevDialog;
}
class QTcpSocket;
namespace LtsAppManager
{
class LTSAPPMANAGER_EXPORT LtsAppManager : public QObject
{
Q_OBJECT
public:
static LtsAppManager* getInstance();
void showLogin();
/**
* @brief createApp
* @param appId
* @param connParams
* @return Warning: can be null!!
*/
LtsPluginManager::LtsPluginManager *createApp(LtsAppDescriptor::App appId, const LtsSession::DdsConnectionParams &connParams,
const QString &workspaceId = QString(), bool hidden = false, bool force = false);
bool startAppOrLetUserChoose(LtsAppDescriptor::App appId, const LtsSession::DdsConnectionParams &connParams, bool force = false);
void setLoginPluginIid(const QString &loginPluginIid) { m_loginPluginIid = loginPluginIid; }
void setMainApp(LtsAppDescriptor::App appId = LtsAppDescriptor::App::Login); // main app which is started after login
QVector<LtsPluginManager::LtsPluginManager *> getAppList() const { return m_appList ;}
LtsAppDescriptor::AppDescriptionVector getAvailableApps() const { return m_availableApps; }
void setAvailableApps(const LtsAppDescriptor::AppDescriptionVector &availableApps);
bool hasRightForApp(const LtsAppDescriptor::AppDescription &appDescription) const;
LtsAppDescriptor::AppDescription getApp(LtsAppDescriptor::App appId) const;
bool hasApp(LtsAppDescriptor::App appId) const;
int getNumberOfSituationMapInstances() const;
void debugSendMessage(const QString &msg);
/**
* @brief otherSessionsResponsibility checks if there is a session in all apps that can take a specified responsibility
* Example: Open a window in ONE session only. E.g. when receiving an alert via dtc to many sessions.
* @param thisSession
* @param requiredAppTypes
* @param requiredPartitionTypes
* @param menuGroup
* @param identifier
* @param area
* @return
*/
bool otherSessionsResponsibility(LtsSession::LtsSession *thisSession, const QVector<LtsAppDescriptor::App> &requiredAppTypes,
const QVector<IDL::PartitionType> &requiredPartitionTypes, const QString &menuGroup,
const QString &identifier, LtsWidgets::LayoutArea area);
private:
friend struct LtsAppManagerHandler;
friend class DeveloperTools::DevDialog;
LtsAppManager();
~LtsAppManager(); // no need to remove all apps, as the application only exits if all apps are closed
bool startAppOrLetUserChoose(const LtsAppDescriptor::AppDescription &appDescription, const LtsSession::DdsConnectionParams &connParams, bool force = false);
LtsPluginManager::LtsPluginManager *createApp(const LtsAppDescriptor::AppDescription &appDescription,
const LtsSession::DdsConnectionParams &connParams,
const QString &workspaceId = QString(),
bool hidden = false, bool force = false);
void saveState();
LtsAppDescriptor::AppDescriptionVector m_availableApps;
QVector<LtsPluginManager::LtsPluginManager *> m_appList; // started apps
LtsLogin::LtsLogin *m_login;
LtsAppDescriptor::AppDescription m_app; // the app to be started when the event loop is running
QString m_loginPluginIid;
public slots:
void slotLogout();
private slots:
void slotQuit(); // quit an app
void slotSoftQuit(); // quit an app, but make sure aboutToClose, etc. is called before deleting the app
void slotShowLogin();
void slotAppDestroyed();
void slotStartDebugServer();
void hideAllOtherBLWs(QObject *_caller);
void taskSwitch(QObject *_caller);
signals:
void signalLoginDone();
void signalLogoffDone();
void signalShowLogin();
void signalInitializationFinished(); // emit a signal if the base layout is shown (to notify that an app has been fully started)
void signalCommand(QTcpSocket *client, const QStringList argList);
};
} // namespace LtsAppManager