VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h@ 103538

Last change on this file since 103538 was 102787, checked in by vboxsync, 5 months ago

FE/Qt: bugref:10576. Parametrize tool pane detach slot in UIVirtualBoxManager.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.9 KB
Line 
1/* $Id: UIToolPaneMachine.h 102787 2024-01-08 15:59:38Z 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 "COMEnums.h"
43#include "CMachine.h"
44
45/* Forward declarations: */
46class QHBoxLayout;
47class QStackedLayout;
48class QVBoxLayout;
49class UIActionPool;
50class UIDetails;
51class UIErrorPane;
52class UIVMActivityToolWidget;
53class UISnapshotPane;
54class UIVirtualMachineItem;
55class UIVMLogViewerWidget;
56class UIFileManager;
57
58/** QWidget subclass representing container for tool panes. */
59class UIToolPaneMachine : public QWidget
60{
61 Q_OBJECT;
62
63signals:
64
65 /** Redirects signal from UIVirtualBoxManager to UIDetails. */
66 void sigToggleStarted();
67 /** Redirects signal from UIVirtualBoxManager to UIDetails. */
68 void sigToggleFinished();
69 /** Redirects signal from UIDetails to UIVirtualBoxManager. */
70 void sigLinkClicked(const QString &strCategory, const QString &strControl, const QUuid &uId);
71
72 /** Notifies listeners about current Snapshot pane item change. */
73 void sigCurrentSnapshotItemChange();
74
75 /** Notifies listeners about request to switch to Activity Overview pane. */
76 void sigSwitchToActivityOverviewPane();
77
78 /** Notifies listeners about request to detach pane with tool type @enmToolType. */
79 void sigDetachToolPane(UIToolType enmToolType);
80
81public:
82
83 /** Constructs tools pane passing @a pParent to the base-class. */
84 UIToolPaneMachine(UIActionPool *pActionPool, QWidget *pParent = 0);
85 /** Destructs tools pane. */
86 virtual ~UIToolPaneMachine() RT_OVERRIDE;
87
88 /** Defines whether this pane is @a fActive. */
89 void setActive(bool fActive);
90 /** Returns whether this pane is active. */
91 bool active() const { return m_fActive; }
92
93 /** Returns type of tool currently opened. */
94 UIToolType currentTool() const;
95 /** Returns whether tool of particular @a enmType is opened. */
96 bool isToolOpened(UIToolType enmType) const;
97 /** Activates tool of passed @a enmType, creates new one if necessary. */
98 void openTool(UIToolType enmType);
99 /** Closes tool of passed @a enmType, deletes one if exists. */
100 void closeTool(UIToolType enmType);
101
102 /** Defines error @a strDetails and switches to Error pane. */
103 void setErrorDetails(const QString &strDetails);
104
105 /** Defines the machine @a items. */
106 void setItems(const QList<UIVirtualMachineItem*> &items);
107
108 /** Returns whether current-state item of Snapshot pane is selected. */
109 bool isCurrentStateItemSelected() const;
110
111 /** Returns currently selected snapshot ID if any. */
112 QUuid currentSnapshotId();
113
114 /** Returns the help keyword of the current tool's widget. */
115 QString currentHelpKeyword() const;
116
117private slots:
118
119 /** Handles the detach signals received from panes.*/
120 void sltDetachToolPane();
121
122private:
123
124 /** Prepares all. */
125 void prepare();
126 /** Prepares stacked-layout. */
127 void prepareStackedLayout();
128 /** Cleanups all. */
129 void cleanup();
130
131 /** Handles token change. */
132 void handleTokenChange();
133
134 /** Holds the action pool reference. */
135 UIActionPool *m_pActionPool;
136
137 /** Holds the stacked-layout instance. */
138 QStackedLayout *m_pLayout;
139 /** Holds the Error pane instance. */
140 UIErrorPane *m_pPaneError;
141 /** Holds the Details pane instance. */
142 UIDetails *m_pPaneDetails;
143 /** Holds the Snapshots pane instance. */
144 UISnapshotPane *m_pPaneSnapshots;
145 /** Holds the Logviewer pane instance. */
146 UIVMLogViewerWidget *m_pPaneLogViewer;
147 /** Holds the Performance Monitor pane instance. */
148 UIVMActivityToolWidget *m_pPaneVMActivityMonitor;
149 /** Holds the File Manager pane instance. */
150 UIFileManager *m_pPaneFileManager;
151
152 /** Holds whether this pane is active. */
153 bool m_fActive;
154
155 /** Holds the cache of passed items. */
156 QList<UIVirtualMachineItem*> m_items;
157};
158
159#endif /* !FEQT_INCLUDED_SRC_manager_UIToolPaneMachine_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use