20#ifndef ORES_QT_CONNECTION_BROWSER_MDI_WINDOW_HPP
21#define ORES_QT_CONNECTION_BROWSER_MDI_WINDOW_HPP
36#include <boost/uuid/uuid.hpp>
37#include "ores.logging/make_logger.hpp"
38#include "ores.qt/ConnectionTypes.hpp"
40namespace ores::connections::service {
41class connection_manager;
46class ConnectionTreeModel;
47class ConnectionDetailPanel;
48class DetachableMdiSubWindow;
60 inline static std::string_view logger_name =
61 "ores.qt.connection_browser_mdi_window";
63 [[nodiscard]]
static auto& lg() {
65 static auto instance = make_logger(logger_name);
72 QWidget* parent =
nullptr);
75 QSize sizeHint()
const override;
85 void setMdiArea(QMdiArea* mdiArea, QMainWindow* mainWindow,
86 QList<QPointer<DetachableMdiSubWindow>>* allDetachableWindows);
89 void statusChanged(
const QString& message);
90 void errorOccurred(
const QString& errorMessage);
96 const QString& connectionName);
102 const QString& environmentName);
116 void openAddDialog();
119 void deleteSelected();
120 void connectToSelected();
121 void changeMasterPassword();
122 void purgeDatabase();
125 void onSelectionChanged();
126 void onDoubleClicked(
const QModelIndex& index);
127 void showContextMenu(
const QPoint& pos);
130 void closeEvent(QCloseEvent* event)
override;
134 void updateActionStates();
135 void updateDetailPanel();
136 void restoreExpansionState();
138 QVBoxLayout* layout_;
139 QSplitter* splitter_;
140 QTreeView* treeView_;
145 QAction* editAction_;
146 QAction* copyAction_;
147 QAction* deleteAction_;
148 QAction* connectAction_;
149 QAction* refreshAction_;
150 QAction* changeMasterPasswordAction_;
151 QAction* purgeDatabaseAction_;
153 std::unique_ptr<ConnectionTreeModel> model_;
158 QMainWindow* mainWindow_;
159 QList<QPointer<DetachableMdiSubWindow>>* allDetachableWindows_;
161 QSize savedWindowSize_;
163 inline static const QString settings_group_ =
"ConnectionBrowserWindow";
Implements logging infrastructure for ORE Studio.
Definition boost_severity.hpp:28
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
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 and environments.
Definition connection_manager.hpp:53
MDI window for browsing and managing saved server connections.
Definition ConnectionBrowserMdiWindow.hpp:56
void databasePurged()
Emitted when user purges the database.
void setTestCallback(TestConnectionCallback callback)
Set callback for testing connections from dialogs.
Definition ConnectionBrowserMdiWindow.cpp:67
void connectRequested(const boost::uuids::uuid &connectionId, const QString &connectionName)
Emitted when user requests to connect using a saved connection.
void changeMasterPasswordRequested()
Emitted when user requests to change the master password.
void setMdiArea(QMdiArea *mdiArea, QMainWindow *mainWindow, QList< QPointer< DetachableMdiSubWindow > > *allDetachableWindows)
Set MDI area and main window for creating sub-windows.
Definition ConnectionBrowserMdiWindow.cpp:71
void environmentConnectRequested(const boost::uuids::uuid &environmentId, const QString &environmentName)
Emitted when user requests to connect using a pure environment.
Detail panel showing read-only information about selected item.
Definition ConnectionDetailPanel.hpp:49