20#ifndef ORES_QT_ENTITY_CONTROLLER_HPP
21#define ORES_QT_ENTITY_CONTROLLER_HPP
29#include "ores.qt/ClientManager.hpp"
33class DetachableMdiSubWindow;
56 QMainWindow* mainWindow,
59 const QString& username,
60 QObject* parent =
nullptr);
72 void setUsername(
const QString& username) { username_ = username; }
100 QString
build_window_key(
const QString& windowType,
const QString& identifier)
const;
125 QMainWindow* mainWindow_;
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Manages the lifecycle of the network client and IO context.
Definition ClientManager.hpp:56
QMdiSubWindow that can be detached to become a floating window.
Definition DetachableMdiSubWindow.hpp:39
Abstract base class for entity controllers.
Definition EntityController.hpp:43
QMap< QString, DetachableMdiSubWindow * > managed_windows_
Map of active windows indexed by unique key.
Definition EntityController.hpp:131
void bring_window_to_front(DetachableMdiSubWindow *window)
Activates the specified window, handling detached state.
Definition EntityController.cpp:60
void untrack_window(const QString &key)
Unregisters a window from tracking.
Definition EntityController.cpp:79
QString build_window_key(const QString &windowType, const QString &identifier) const
Generates a unique key for tracking windows.
Definition EntityController.cpp:44
void statusMessage(const QString &message)
Emitted when a status message should be shown to the user.
bool try_reuse_window(const QString &key)
Tries to reuse an existing window if one exists for the key.
Definition EntityController.cpp:49
virtual void closeAllWindows()=0
Closes all windows managed by this controller. Must be implemented by derived classes.
void track_window(const QString &key, DetachableMdiSubWindow *window)
Registers a window for tracking.
Definition EntityController.cpp:74
void setClientManager(ClientManager *clientManager, const QString &username)
Updates the client manager and username (e.g. after re-login).
Definition EntityController.cpp:38
virtual void showListWindow()=0
Shows the main list window for this entity. Must be implemented by derived classes.
void setUsername(const QString &username)
Updates just the username.
Definition EntityController.hpp:72
void errorMessage(const QString &message)
Emitted when an error message should be shown to the user.