20#ifndef ORES_QT_CONNECTION_BROWSER_MDI_WINDOW_HPP
21#define ORES_QT_CONNECTION_BROWSER_MDI_WINDOW_HPP
33#include <boost/uuid/uuid.hpp>
34#include "ores.logging/make_logger.hpp"
35#include "ores.qt/ConnectionTypes.hpp"
37namespace ores::connections::service {
38class connection_manager;
43class ConnectionTreeModel;
44class ConnectionDetailPanel;
45class DetachableMdiSubWindow;
57 inline static std::string_view logger_name =
58 "ores.qt.connection_browser_mdi_window";
60 [[nodiscard]]
static auto& lg() {
62 static auto instance = make_logger(logger_name);
69 QWidget* parent =
nullptr);
72 QSize sizeHint()
const override;
82 void setMdiArea(QMdiArea* mdiArea, QMainWindow* mainWindow,
83 QList<DetachableMdiSubWindow*>* allDetachableWindows);
86 void statusChanged(
const QString& message);
87 void errorOccurred(
const QString& errorMessage);
93 const QString& connectionName);
107 void openAddDialog();
109 void deleteSelected();
110 void connectToSelected();
111 void changeMasterPassword();
112 void purgeDatabase();
115 void onSelectionChanged();
116 void onDoubleClicked(
const QModelIndex& index);
117 void showContextMenu(
const QPoint& pos);
121 void updateActionStates();
122 void updateDetailPanel();
124 QVBoxLayout* layout_;
125 QSplitter* splitter_;
126 QTreeView* treeView_;
131 QAction* editAction_;
132 QAction* deleteAction_;
133 QAction* connectAction_;
134 QAction* refreshAction_;
135 QAction* changeMasterPasswordAction_;
136 QAction* purgeDatabaseAction_;
138 std::unique_ptr<ConnectionTreeModel> model_;
143 QMainWindow* mainWindow_;
144 QList<DetachableMdiSubWindow*>* allDetachableWindows_;
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
std::function< QString(const QString &host, int port, const QString &username, const QString &password)> TestConnectionCallback
Callback type for testing connections.
Definition ConnectionTypes.hpp:36
High-level service for managing server connections.
Definition connection_manager.hpp:48
MDI window for browsing and managing saved server connections.
Definition ConnectionBrowserMdiWindow.hpp:53
void connectRequested(const boost::uuids::uuid &environmentId, const QString &connectionName)
Emitted when user requests to connect using a saved environment.
void databasePurged()
Emitted when user purges the database.
void setMdiArea(QMdiArea *mdiArea, QMainWindow *mainWindow, QList< DetachableMdiSubWindow * > *allDetachableWindows)
Set MDI area and main window for creating sub-windows.
Definition ConnectionBrowserMdiWindow.cpp:59
void setTestCallback(TestConnectionCallback callback)
Set callback for testing connections from dialogs.
Definition ConnectionBrowserMdiWindow.cpp:55
void changeMasterPasswordRequested()
Emitted when user requests to change the master password.
Detail panel showing read-only information about selected item.
Definition ConnectionDetailPanel.hpp:47