blob: fef8fca29119d4d6af5dfa16abf5af51cbd10a39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
/* $Id$ */
/** @file
* VBox Qt GUI - UIToolPaneGlobal class declaration.
*/
/*
* Copyright (C) 2017-2022 Oracle and/or its affiliates.
*
* This file is part of VirtualBox base platform packages, as
* available from https://www.virtualbox.org.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, in version 3 of the
* License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses>.
*
* SPDX-License-Identifier: GPL-3.0-only
*/
#ifndef FEQT_INCLUDED_SRC_manager_UIToolPaneGlobal_h
#define FEQT_INCLUDED_SRC_manager_UIToolPaneGlobal_h
#ifndef RT_WITHOUT_PRAGMA_ONCE
# pragma once
#endif
/* Qt includes: */
#include <QWidget>
/* GUI includes: */
#include "UIExtraDataDefs.h"
/* Forward declarations: */
class QHBoxLayout;
class QStackedLayout;
class QVBoxLayout;
class UIActionPool;
class UICloudProfileManagerWidget;
class UIExtensionPackManagerWidget;
class UIMediumManagerWidget;
class UINetworkManagerWidget;
class UIVMActivityOverviewWidget;
class UIVirtualMachineItem;
class UIWelcomePane;
class CMachine;
/** QWidget subclass representing container for tool panes. */
class UIToolPaneGlobal : public QWidget
{
Q_OBJECT;
signals:
/** Notifies listeners about request to switch to Activity pane of machine with @a uMachineId. */
void sigSwitchToMachineActivityPane(const QUuid &uMachineId);
public:
/** Constructs tools pane passing @a pParent to the base-class. */
UIToolPaneGlobal(UIActionPool *pActionPool, QWidget *pParent = 0);
/** Destructs tools pane. */
virtual ~UIToolPaneGlobal() RT_OVERRIDE;
/** Defines whether this pane is @a fActive. */
void setActive(bool fActive);
/** Returns whether this pane is active. */
bool active() const { return m_fActive; }
/** Returns type of tool currently opened. */
UIToolType currentTool() const;
/** Returns whether tool of particular @a enmType is opened. */
bool isToolOpened(UIToolType enmType) const;
/** Activates tool of passed @a enmType, creates new one if necessary. */
void openTool(UIToolType enmType);
/** Closes tool of passed @a enmType, deletes one if exists. */
void closeTool(UIToolType enmType);
/** Returns the help keyword of the current tool's widget. */
QString currentHelpKeyword() const;
private:
/** Prepares all. */
void prepare();
/** Prepares stacked-layout. */
void prepareStackedLayout();
/** Cleanups all. */
void cleanup();
/** Handles token change. */
void handleTokenChange();
/** Holds the action pool reference. */
UIActionPool *m_pActionPool;
/** Holds the stacked-layout instance. */
QStackedLayout *m_pLayout;
/** Holds the Welcome pane instance. */
UIWelcomePane *m_pPaneWelcome;
/** Holds the Extension Pack Manager instance. */
UIExtensionPackManagerWidget *m_pPaneExtensions;
/** Holds the Virtual Media Manager instance. */
UIMediumManagerWidget *m_pPaneMedia;
/** Holds the Network Manager instance. */
UINetworkManagerWidget *m_pPaneNetwork;
/** Holds the Cloud Profile Manager instance. */
UICloudProfileManagerWidget *m_pPaneCloud;
/** Holds the VM Activity Overview instance. */
UIVMActivityOverviewWidget *m_pPaneVMActivityOverview;
/** Holds whether this pane is active. */
bool m_fActive;
};
#endif /* !FEQT_INCLUDED_SRC_manager_UIToolPaneGlobal_h */
|