1 | /* $Id: UIToolPaneMachine.h 103803 2024-03-12 11:15:18Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIToolPaneMachine class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2017-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_manager_UIToolPaneMachine_h
|
---|
29 | #define FEQT_INCLUDED_SRC_manager_UIToolPaneMachine_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QUuid>
|
---|
36 | #include <QWidget>
|
---|
37 |
|
---|
38 | /* GUI includes: */
|
---|
39 | #include "UIExtraDataDefs.h"
|
---|
40 |
|
---|
41 | /* COM includes: */
|
---|
42 | #include "CMachine.h"
|
---|
43 |
|
---|
44 | /* Forward declarations: */
|
---|
45 | class QHBoxLayout;
|
---|
46 | class QStackedLayout;
|
---|
47 | class QVBoxLayout;
|
---|
48 | class UIActionPool;
|
---|
49 | class UIDetails;
|
---|
50 | class UIErrorPane;
|
---|
51 | class UIVMActivityToolWidget;
|
---|
52 | class UISnapshotPane;
|
---|
53 | class UIVirtualMachineItem;
|
---|
54 | class UIVMLogViewerWidget;
|
---|
55 | class UIFileManager;
|
---|
56 |
|
---|
57 | /** QWidget subclass representing container for tool panes. */
|
---|
58 | class UIToolPaneMachine : public QWidget
|
---|
59 | {
|
---|
60 | Q_OBJECT;
|
---|
61 |
|
---|
62 | signals:
|
---|
63 |
|
---|
64 | /** Redirects signal from UIVirtualBoxManager to UIDetails. */
|
---|
65 | void sigToggleStarted();
|
---|
66 | /** Redirects signal from UIVirtualBoxManager to UIDetails. */
|
---|
67 | void sigToggleFinished();
|
---|
68 | /** Redirects signal from UIDetails to UIVirtualBoxManager. */
|
---|
69 | void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &uId);
|
---|
70 |
|
---|
71 | /** Notifies listeners about current Snapshot pane item change. */
|
---|
72 | void sigCurrentSnapshotItemChange();
|
---|
73 |
|
---|
74 | /** Notifies listeners about request to switch to Activity Overview pane. */
|
---|
75 | void sigSwitchToActivityOverviewPane();
|
---|
76 |
|
---|
77 | /** Notifies listeners about request to detach pane with tool type @enmToolType. */
|
---|
78 | void sigDetachToolPane(UIToolType enmToolType);
|
---|
79 |
|
---|
80 | public:
|
---|
81 |
|
---|
82 | /** Constructs tools pane passing @a pParent to the base-class. */
|
---|
83 | UIToolPaneMachine(UIActionPool *pActionPool, QWidget *pParent = 0);
|
---|
84 | /** Destructs tools pane. */
|
---|
85 | virtual ~UIToolPaneMachine() RT_OVERRIDE;
|
---|
86 |
|
---|
87 | /** Defines whether this pane is @a fActive. */
|
---|
88 | void setActive(bool fActive);
|
---|
89 | /** Returns whether this pane is active. */
|
---|
90 | bool active() const { return m_fActive; }
|
---|
91 |
|
---|
92 | /** Returns type of tool currently opened. */
|
---|
93 | UIToolType currentTool() const;
|
---|
94 | /** Returns whether tool of particular @a enmType is opened. */
|
---|
95 | bool isToolOpened(UIToolType enmType) const;
|
---|
96 | /** Activates tool of passed @a enmType, creates new one if necessary. */
|
---|
97 | void openTool(UIToolType enmType);
|
---|
98 | /** Closes tool of passed @a enmType, deletes one if exists. */
|
---|
99 | void closeTool(UIToolType enmType);
|
---|
100 |
|
---|
101 | /** Defines error @a strDetails and switches to Error pane. */
|
---|
102 | void setErrorDetails(const QString &strDetails);
|
---|
103 |
|
---|
104 | /** Defines the machine @a items. */
|
---|
105 | void setItems(const QList<UIVirtualMachineItem*> &items);
|
---|
106 |
|
---|
107 | /** Returns whether current-state item of Snapshot pane is selected. */
|
---|
108 | bool isCurrentStateItemSelected() const;
|
---|
109 |
|
---|
110 | /** Returns currently selected snapshot ID if any. */
|
---|
111 | QUuid currentSnapshotId();
|
---|
112 |
|
---|
113 | /** Returns the help keyword of the current tool's widget. */
|
---|
114 | QString currentHelpKeyword() const;
|
---|
115 |
|
---|
116 | private slots:
|
---|
117 |
|
---|
118 | /** Handles the detach signals received from panes.*/
|
---|
119 | void sltDetachToolPane();
|
---|
120 |
|
---|
121 | private:
|
---|
122 |
|
---|
123 | /** Prepares all. */
|
---|
124 | void prepare();
|
---|
125 | /** Prepares stacked-layout. */
|
---|
126 | void prepareStackedLayout();
|
---|
127 | /** Cleanups all. */
|
---|
128 | void cleanup();
|
---|
129 |
|
---|
130 | /** Handles token change. */
|
---|
131 | void handleTokenChange();
|
---|
132 |
|
---|
133 | /** Holds the action pool reference. */
|
---|
134 | UIActionPool *m_pActionPool;
|
---|
135 |
|
---|
136 | /** Holds the stacked-layout instance. */
|
---|
137 | QStackedLayout *m_pLayout;
|
---|
138 | /** Holds the Error pane instance. */
|
---|
139 | UIErrorPane *m_pPaneError;
|
---|
140 | /** Holds the Details pane instance. */
|
---|
141 | UIDetails *m_pPaneDetails;
|
---|
142 | /** Holds the Snapshots pane instance. */
|
---|
143 | UISnapshotPane *m_pPaneSnapshots;
|
---|
144 | /** Holds the Logviewer pane instance. */
|
---|
145 | UIVMLogViewerWidget *m_pPaneLogViewer;
|
---|
146 | /** Holds the Performance Monitor pane instance. */
|
---|
147 | UIVMActivityToolWidget *m_pPaneVMActivityMonitor;
|
---|
148 | /** Holds the File Manager pane instance. */
|
---|
149 | UIFileManager *m_pPaneFileManager;
|
---|
150 |
|
---|
151 | /** Holds whether this pane is active. */
|
---|
152 | bool m_fActive;
|
---|
153 |
|
---|
154 | /** Holds the cache of passed items. */
|
---|
155 | QList<UIVirtualMachineItem*> m_items;
|
---|
156 | };
|
---|
157 |
|
---|
158 | #endif /* !FEQT_INCLUDED_SRC_manager_UIToolPaneMachine_h */
|
---|