Apply clang-format to Lts/Common and DTC/enum headers
- Formatted all CodeGen module files (9 files) - Formatted LtsAppDescriptor module files - Formatted LtsAppManager/AppChooser files - Applied clang-format to all DTC and enum headers across modules - Removed coordTransTests from CommonUnitTestsPlaceholder (moved to tests/) Cosmetic changes only, no functional modifications. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
848 files changed
+89305
-100020
No files matched your search
Executable → Regular
+246
-298
@@ -1,19 +1,16 @@
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
|
||||
#include "lts_base.h"
|
||||
#include "ltswidgets_export.h"
|
||||
#include "lts_notification_box.h"
|
||||
#include "ltswidgets_export.h"
|
||||
#include "qevent.h"
|
||||
|
||||
#include <memory>
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <QPointer>
|
||||
#include <QWidget>
|
||||
|
||||
#include <memory>
|
||||
|
||||
class QButtonGroup;
|
||||
class QPropertyAnimation;
|
||||
@@ -31,7 +28,10 @@ namespace IDL
|
||||
enum class PartitionType;
|
||||
}
|
||||
|
||||
namespace LtsUtils { class Promise; }
|
||||
namespace LtsUtils
|
||||
{
|
||||
class Promise;
|
||||
}
|
||||
|
||||
namespace LtsWidgets
|
||||
{
|
||||
@@ -43,305 +43,253 @@ class LtsToolBox;
|
||||
|
||||
struct ExerciseData
|
||||
{
|
||||
QString exName;
|
||||
QString exDescription;
|
||||
int phId = -1;
|
||||
QString phName;
|
||||
QString phDescription;
|
||||
QString exStateString;
|
||||
ExcState exState = ExerciseState::eUnknown;
|
||||
QColor exStateCol;
|
||||
QString partitionType;
|
||||
QString exName;
|
||||
QString exDescription;
|
||||
int phId = -1;
|
||||
QString phName;
|
||||
QString phDescription;
|
||||
QString exStateString;
|
||||
ExcState exState = ExerciseState::eUnknown;
|
||||
QColor exStateCol;
|
||||
QString partitionType;
|
||||
|
||||
bool operator==(const ExerciseData &o) const
|
||||
{
|
||||
return exName == o.exName &&
|
||||
exDescription == o.exDescription &&
|
||||
phId == o.phId &&
|
||||
phName == o.phName &&
|
||||
phDescription == o.phDescription &&
|
||||
exStateString == o.exStateString &&
|
||||
exState == o.exState &&
|
||||
exStateCol == o.exStateCol &&
|
||||
partitionType == o.partitionType;
|
||||
}
|
||||
bool operator!=(const ExerciseData &o) const
|
||||
{
|
||||
return !operator ==(o);
|
||||
}
|
||||
bool operator==(const ExerciseData& o) const
|
||||
{
|
||||
return exName == o.exName && exDescription == o.exDescription && phId == o.phId && phName == o.phName &&
|
||||
phDescription == o.phDescription && exStateString == o.exStateString && exState == o.exState &&
|
||||
exStateCol == o.exStateCol && partitionType == o.partitionType;
|
||||
}
|
||||
|
||||
bool operator!=(const ExerciseData& o) const
|
||||
{
|
||||
return !operator==(o);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class LTSWIDGETS_EXPORT LtsBaseLayoutWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
explicit LtsBaseLayoutWidget(QWidget *parent = nullptr, bool splitMenu = true);
|
||||
~LtsBaseLayoutWidget();
|
||||
|
||||
|
||||
|
||||
void hideVisibleLayouts();
|
||||
|
||||
|
||||
|
||||
void resetLayoutVisibility();
|
||||
|
||||
|
||||
|
||||
void setMenuVisible(bool visible);
|
||||
|
||||
|
||||
|
||||
bool isMenuVisible() const;
|
||||
|
||||
bool isTopBarVisible() const;
|
||||
void setTopBarVisible(bool visible);
|
||||
|
||||
|
||||
|
||||
bool isMenuCollapsed() const;
|
||||
|
||||
|
||||
|
||||
void collapseMenu(bool collapse = true);
|
||||
|
||||
|
||||
|
||||
void setSessionInfo(const int domainId, const IDL::PartitionType &partitionType, const int partitionId, const QString &workspaceId);
|
||||
|
||||
|
||||
|
||||
LtsDragIcon *addMenuAction(const PluginData &plData, bool isFirstRun = false);
|
||||
|
||||
|
||||
|
||||
bool removeMenuAction(const PluginData &plData);
|
||||
|
||||
|
||||
|
||||
bool removeMenuAction(LtsDragIcon *icon);
|
||||
|
||||
bool removeMenuAction(const QString &byIdentifier);
|
||||
|
||||
|
||||
|
||||
void clearMenuActions();
|
||||
|
||||
void setAppName(const QString &appName);
|
||||
bool isDialogFocused(const LtsDialog *dialog) const;
|
||||
|
||||
|
||||
|
||||
void setCustomText(const QString &text);
|
||||
const QString customText() const;
|
||||
|
||||
|
||||
|
||||
LtsTabWidget *getTabFromLayoutArea(LayoutArea area) const;
|
||||
|
||||
|
||||
|
||||
LtsDialog *getWidget(const QString &menuGroup, const QString &identifier, LayoutArea area = LayoutArea::eUnknown);
|
||||
|
||||
|
||||
|
||||
QWidget *getMenu() const;
|
||||
|
||||
|
||||
|
||||
LtsToolBarArea *getToolbar() const;
|
||||
|
||||
|
||||
|
||||
void setOperatorName(const QString &operatorName, bool showTerminalButton);
|
||||
|
||||
|
||||
|
||||
void setProfilePicture(const QPixmap &profilePicture);
|
||||
|
||||
|
||||
|
||||
void setExerciseData(const ExerciseData &data);
|
||||
|
||||
|
||||
|
||||
void initilizationFinished();
|
||||
|
||||
|
||||
|
||||
void addNotification(QToolButton *noti);
|
||||
|
||||
|
||||
|
||||
bool isWidgetsHidden() const;
|
||||
|
||||
bool notificationExists(const QString &identifier) const;
|
||||
const QMap<LtsDragIcon *, PluginData> &mapButtons() const { return m_mapButtons; }
|
||||
void setToolBarActions(const QStringList &actions);
|
||||
QStringList toolBarActions() const;
|
||||
void setFunctionKeys(const QMap<int, QString> &actions);
|
||||
QMap<int, QString> functionKeys() const;
|
||||
void setWorkspaceId(const QString &workspaceId) { m_workspaceId = workspaceId; }
|
||||
|
||||
|
||||
|
||||
void showMessage(const QString &title, const QString &text, LtsNotificationBox::MessageType type = LtsNotificationBox::MessageType::Info, const std::function<void(const QString &link)> &clickedLinkCallback = nullptr, bool closeOnLinkClicked = true, const QString &identifier = {});
|
||||
bool messageIdentifierExists(const QString &identifier) const;
|
||||
|
||||
void executeAction(const QString &actionIdentifier);
|
||||
bool isSecondaryWidget() const { return m_isSecondaryWidget; }
|
||||
void setSecondaryWidget() { m_isSecondaryWidget = true; }
|
||||
|
||||
|
||||
|
||||
void removeQueuedMessage(const QString &messageIdentifier);
|
||||
|
||||
|
||||
public slots:
|
||||
bool slotClose();
|
||||
void slotLogout();
|
||||
|
||||
void slotScreenCountChanged(int count);
|
||||
|
||||
|
||||
|
||||
void onMenuEntryClicked();
|
||||
|
||||
void onHideAnimated();
|
||||
void onReShowAnimated();
|
||||
|
||||
|
||||
|
||||
bool addWidget(LtsWidgets::LtsDialog *dialog, const QString &menuGroup, const QString &identifier, LtsWidgets::LayoutArea area = LayoutArea::eUnknown, bool setClosable = true, bool focusNewTab = true);
|
||||
|
||||
|
||||
|
||||
bool addOrReplaceWidget(LtsDialog *dialog, const QString &menuGroup, const QString &identifier, LayoutArea area = LayoutArea::eUnknown, bool setClosable = true, bool focusNewTab = true );
|
||||
|
||||
bool focusTab(const QString &menuGroup, const QString &identifier, LtsWidgets::LayoutArea area);
|
||||
|
||||
|
||||
|
||||
void executeCreateInstantFunctions(const LtsWidgets::PluginData &plData);
|
||||
|
||||
void setExerciseTime(qint64 mSecsSinceEpoch);
|
||||
bool haveUnsavedChanges();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool notifyUnsavedChanges();
|
||||
|
||||
|
||||
|
||||
void setIrreplaceableOnce() { m_irreplaceableOnce = true; }
|
||||
bool irreplaceableReset() { bool r = m_irreplaceableOnce; m_irreplaceableOnce = false; return r; }
|
||||
bool isIrreplaceable() const { return m_irreplaceableOnce; }
|
||||
|
||||
|
||||
|
||||
void showWidgets();
|
||||
|
||||
|
||||
|
||||
void hideWidgets();
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
void slotOperatorMenuClicked();
|
||||
|
||||
void setCurrentTime();
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
|
||||
|
||||
void signalClose();
|
||||
void signalLogout();
|
||||
void signalShowOperatorSettings();
|
||||
void signalRetranslateActions();
|
||||
void signalSwap();
|
||||
void signalStapleTopicLockHandler(LtsWidgets::LtsDialog *widget);
|
||||
void signalSuccessfullyPlaced();
|
||||
|
||||
|
||||
|
||||
void signalNotifyUnsavedChanges(bool &reject);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void changeEvent(QEvent *e) override;
|
||||
|
||||
|
||||
private:
|
||||
void addDebugMenu();
|
||||
void retranslate();
|
||||
void addTouchScroll(QWidget *widget);
|
||||
LtsDragIcon *createButton(const PluginData &plData);
|
||||
int getIndexOfTab(LtsTabWidget *tab);
|
||||
LtsToolBox *getToolBox(const ExercisePart &exercisePart) const;
|
||||
QPushButton *getExercisePartButton(const ExercisePart &exercisePart) const;
|
||||
void checkExercisePartButtonVisibility();
|
||||
void checkMenuGroup(const QString &menuGroup, const ExercisePart &exercisePart);
|
||||
bool isDialogFocused(const LtsDialog *dialog, const LayoutArea &layoutArea) const;
|
||||
bool isDialogFocused(const LtsDialog *dialog, const LtsTabWidget *tab) const;
|
||||
void applyExerciseStateRestricition();
|
||||
void executePluginData(const PluginData &plData);
|
||||
void showNextQueuedMessage();
|
||||
|
||||
|
||||
struct Message
|
||||
{
|
||||
public:
|
||||
QString title;
|
||||
QString text;
|
||||
LtsNotificationBox::MessageType type;
|
||||
std::function<void(const QString &link)> clickedLinkCallback;
|
||||
bool closeOnLinkClicked;
|
||||
QString identifier;
|
||||
};
|
||||
explicit LtsBaseLayoutWidget(QWidget* parent = nullptr, bool splitMenu = true);
|
||||
~LtsBaseLayoutWidget();
|
||||
|
||||
ExerciseData m_exerciseData;
|
||||
QMap<LtsDragIcon *, PluginData> m_mapButtons;
|
||||
QList<int> m_mainSplitterSizes;
|
||||
QList<int> m_menuSplitterSizes;
|
||||
bool m_isHidden;
|
||||
QPropertyAnimation *m_currentAnimation{nullptr};
|
||||
Ui::LtsBaseLayoutWidget *m_ui{nullptr};
|
||||
IDL::PartitionType m_partitionType;
|
||||
int m_domainId;
|
||||
int m_partitionId;
|
||||
QString m_operatorName;
|
||||
bool m_firstShow;
|
||||
bool m_showTerminalButton;
|
||||
qint64 m_exerciseTime;
|
||||
QTimer *m_setCurrentTimeTimer{nullptr};
|
||||
bool m_irreplaceableOnce;
|
||||
QButtonGroup *m_bg{nullptr};
|
||||
QString m_workspaceId;
|
||||
int m_screenCount;
|
||||
bool m_menuCollapsed;
|
||||
QMap<QPointer<LtsWidgets::LtsTabWidget>, bool> m_oldLayoutVisibilityStates;
|
||||
LtsNotificationBox *m_notiBox{nullptr};
|
||||
QStringList m_notFoundYet;
|
||||
bool m_isSecondaryWidget { false };
|
||||
QVector<Message> m_currentMessage;
|
||||
QVector<Message> m_messageQueue;
|
||||
void hideVisibleLayouts();
|
||||
|
||||
void resetLayoutVisibility();
|
||||
|
||||
void setMenuVisible(bool visible);
|
||||
|
||||
bool isMenuVisible() const;
|
||||
|
||||
bool isTopBarVisible() const;
|
||||
void setTopBarVisible(bool visible);
|
||||
|
||||
bool isMenuCollapsed() const;
|
||||
|
||||
void collapseMenu(bool collapse = true);
|
||||
|
||||
void setSessionInfo(const int domainId, const IDL::PartitionType& partitionType, const int partitionId,
|
||||
const QString& workspaceId);
|
||||
|
||||
LtsDragIcon* addMenuAction(const PluginData& plData, bool isFirstRun = false);
|
||||
|
||||
bool removeMenuAction(const PluginData& plData);
|
||||
|
||||
bool removeMenuAction(LtsDragIcon* icon);
|
||||
|
||||
bool removeMenuAction(const QString& byIdentifier);
|
||||
|
||||
void clearMenuActions();
|
||||
|
||||
void setAppName(const QString& appName);
|
||||
bool isDialogFocused(const LtsDialog* dialog) const;
|
||||
|
||||
void setCustomText(const QString& text);
|
||||
const QString customText() const;
|
||||
|
||||
LtsTabWidget* getTabFromLayoutArea(LayoutArea area) const;
|
||||
|
||||
LtsDialog* getWidget(const QString& menuGroup, const QString& identifier, LayoutArea area = LayoutArea::eUnknown);
|
||||
|
||||
QWidget* getMenu() const;
|
||||
|
||||
LtsToolBarArea* getToolbar() const;
|
||||
|
||||
void setOperatorName(const QString& operatorName, bool showTerminalButton);
|
||||
|
||||
void setProfilePicture(const QPixmap& profilePicture);
|
||||
|
||||
void setExerciseData(const ExerciseData& data);
|
||||
|
||||
void initilizationFinished();
|
||||
|
||||
void addNotification(QToolButton* noti);
|
||||
|
||||
bool isWidgetsHidden() const;
|
||||
|
||||
bool notificationExists(const QString& identifier) const;
|
||||
|
||||
const QMap<LtsDragIcon*, PluginData>& mapButtons() const
|
||||
{
|
||||
return m_mapButtons;
|
||||
}
|
||||
|
||||
void setToolBarActions(const QStringList& actions);
|
||||
QStringList toolBarActions() const;
|
||||
void setFunctionKeys(const QMap<int, QString>& actions);
|
||||
QMap<int, QString> functionKeys() const;
|
||||
|
||||
void setWorkspaceId(const QString& workspaceId)
|
||||
{
|
||||
m_workspaceId = workspaceId;
|
||||
}
|
||||
|
||||
void showMessage(const QString& title, const QString& text,
|
||||
LtsNotificationBox::MessageType type = LtsNotificationBox::MessageType::Info,
|
||||
const std::function<void(const QString& link)>& clickedLinkCallback = nullptr,
|
||||
bool closeOnLinkClicked = true, const QString& identifier = {});
|
||||
bool messageIdentifierExists(const QString& identifier) const;
|
||||
|
||||
void executeAction(const QString& actionIdentifier);
|
||||
|
||||
bool isSecondaryWidget() const
|
||||
{
|
||||
return m_isSecondaryWidget;
|
||||
}
|
||||
|
||||
void setSecondaryWidget()
|
||||
{
|
||||
m_isSecondaryWidget = true;
|
||||
}
|
||||
|
||||
void removeQueuedMessage(const QString& messageIdentifier);
|
||||
|
||||
public slots:
|
||||
bool slotClose();
|
||||
void slotLogout();
|
||||
|
||||
void slotScreenCountChanged(int count);
|
||||
|
||||
void onMenuEntryClicked();
|
||||
|
||||
void onHideAnimated();
|
||||
void onReShowAnimated();
|
||||
|
||||
bool addWidget(LtsWidgets::LtsDialog* dialog, const QString& menuGroup, const QString& identifier,
|
||||
LtsWidgets::LayoutArea area = LayoutArea::eUnknown, bool setClosable = true,
|
||||
bool focusNewTab = true);
|
||||
|
||||
bool addOrReplaceWidget(LtsDialog* dialog, const QString& menuGroup, const QString& identifier,
|
||||
LayoutArea area = LayoutArea::eUnknown, bool setClosable = true, bool focusNewTab = true);
|
||||
|
||||
bool focusTab(const QString& menuGroup, const QString& identifier, LtsWidgets::LayoutArea area);
|
||||
|
||||
void executeCreateInstantFunctions(const LtsWidgets::PluginData& plData);
|
||||
|
||||
void setExerciseTime(qint64 mSecsSinceEpoch);
|
||||
bool haveUnsavedChanges();
|
||||
|
||||
bool notifyUnsavedChanges();
|
||||
|
||||
void setIrreplaceableOnce()
|
||||
{
|
||||
m_irreplaceableOnce = true;
|
||||
}
|
||||
|
||||
bool irreplaceableReset()
|
||||
{
|
||||
bool r = m_irreplaceableOnce;
|
||||
m_irreplaceableOnce = false;
|
||||
return r;
|
||||
}
|
||||
|
||||
bool isIrreplaceable() const
|
||||
{
|
||||
return m_irreplaceableOnce;
|
||||
}
|
||||
|
||||
void showWidgets();
|
||||
|
||||
void hideWidgets();
|
||||
|
||||
private slots:
|
||||
|
||||
void slotOperatorMenuClicked();
|
||||
|
||||
void setCurrentTime();
|
||||
|
||||
signals:
|
||||
|
||||
void signalClose();
|
||||
void signalLogout();
|
||||
void signalShowOperatorSettings();
|
||||
void signalRetranslateActions();
|
||||
void signalSwap();
|
||||
void signalStapleTopicLockHandler(LtsWidgets::LtsDialog* widget);
|
||||
void signalSuccessfullyPlaced();
|
||||
|
||||
void signalNotifyUnsavedChanges(bool& reject);
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
void showEvent(QShowEvent* event) override;
|
||||
void changeEvent(QEvent* e) override;
|
||||
|
||||
private:
|
||||
void addDebugMenu();
|
||||
void retranslate();
|
||||
void addTouchScroll(QWidget* widget);
|
||||
LtsDragIcon* createButton(const PluginData& plData);
|
||||
int getIndexOfTab(LtsTabWidget* tab);
|
||||
LtsToolBox* getToolBox(const ExercisePart& exercisePart) const;
|
||||
QPushButton* getExercisePartButton(const ExercisePart& exercisePart) const;
|
||||
void checkExercisePartButtonVisibility();
|
||||
void checkMenuGroup(const QString& menuGroup, const ExercisePart& exercisePart);
|
||||
bool isDialogFocused(const LtsDialog* dialog, const LayoutArea& layoutArea) const;
|
||||
bool isDialogFocused(const LtsDialog* dialog, const LtsTabWidget* tab) const;
|
||||
void applyExerciseStateRestricition();
|
||||
void executePluginData(const PluginData& plData);
|
||||
void showNextQueuedMessage();
|
||||
|
||||
struct Message
|
||||
{
|
||||
public:
|
||||
QString title;
|
||||
QString text;
|
||||
LtsNotificationBox::MessageType type;
|
||||
std::function<void(const QString& link)> clickedLinkCallback;
|
||||
bool closeOnLinkClicked;
|
||||
QString identifier;
|
||||
};
|
||||
|
||||
ExerciseData m_exerciseData;
|
||||
QMap<LtsDragIcon*, PluginData> m_mapButtons;
|
||||
QList<int> m_mainSplitterSizes;
|
||||
QList<int> m_menuSplitterSizes;
|
||||
bool m_isHidden;
|
||||
QPropertyAnimation* m_currentAnimation{nullptr};
|
||||
Ui::LtsBaseLayoutWidget* m_ui{nullptr};
|
||||
IDL::PartitionType m_partitionType;
|
||||
int m_domainId;
|
||||
int m_partitionId;
|
||||
QString m_operatorName;
|
||||
bool m_firstShow;
|
||||
bool m_showTerminalButton;
|
||||
qint64 m_exerciseTime;
|
||||
QTimer* m_setCurrentTimeTimer{nullptr};
|
||||
bool m_irreplaceableOnce;
|
||||
QButtonGroup* m_bg{nullptr};
|
||||
QString m_workspaceId;
|
||||
int m_screenCount;
|
||||
bool m_menuCollapsed;
|
||||
QMap<QPointer<LtsWidgets::LtsTabWidget>, bool> m_oldLayoutVisibilityStates;
|
||||
LtsNotificationBox* m_notiBox{nullptr};
|
||||
QStringList m_notFoundYet;
|
||||
bool m_isSecondaryWidget{false};
|
||||
QVector<Message> m_currentMessage;
|
||||
QVector<Message> m_messageQueue;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace LtsWidgets
|
||||
Reference in new issue
Block a user