1 | /* $Id: UIVMActivityMonitorContainer.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIVMActivityMonitorPanel class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2024 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_activity_vmactivity_UIVMActivityMonitorContainer_h
|
---|
29 | #define FEQT_INCLUDED_SRC_activity_vmactivity_UIVMActivityMonitorContainer_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QUuid>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "UILibraryDefs.h"
|
---|
39 | #include "UIPaneContainer.h"
|
---|
40 |
|
---|
41 | class CCloudMachine;
|
---|
42 | class CMachine;
|
---|
43 | class QColor;
|
---|
44 | class QLabel;
|
---|
45 | class QPushButton;
|
---|
46 | class QTabWidget;
|
---|
47 | class UIActionPool;
|
---|
48 |
|
---|
49 | /** A pane container class for activity monitor widget. It hosts several controls
|
---|
50 | for activity monitor settings. */
|
---|
51 | class SHARED_LIBRARY_STUFF UIVMActivityMonitorPaneContainer : public UIPaneContainer
|
---|
52 | {
|
---|
53 |
|
---|
54 | Q_OBJECT;
|
---|
55 |
|
---|
56 | signals:
|
---|
57 |
|
---|
58 | void sigColorChanged(int iIndex, const QColor &color);
|
---|
59 |
|
---|
60 | public:
|
---|
61 |
|
---|
62 | UIVMActivityMonitorPaneContainer(QWidget *pParent);
|
---|
63 | void setDataSeriesColor(int iIndex, const QColor &color);
|
---|
64 | QColor dataSeriesColor(int iIndex) const;
|
---|
65 |
|
---|
66 | private slots:
|
---|
67 |
|
---|
68 | void sltRetranslateUI();
|
---|
69 | void sltColorChangeButtonPressed();
|
---|
70 | void sltResetToDefaults();
|
---|
71 |
|
---|
72 | private:
|
---|
73 | enum Tab
|
---|
74 | {
|
---|
75 | Tab_Preferences = 0
|
---|
76 | };
|
---|
77 |
|
---|
78 | void prepare();
|
---|
79 | void colorPushButtons(QPushButton *pButton, const QColor &color);
|
---|
80 | QString m_strTabText;
|
---|
81 |
|
---|
82 | QLabel *m_pColorLabel[2];
|
---|
83 | QPushButton *m_pColorChangeButton[2];
|
---|
84 | QPushButton *m_pResetButton;
|
---|
85 |
|
---|
86 | QColor m_color[2];
|
---|
87 |
|
---|
88 | };
|
---|
89 |
|
---|
90 | /** A QWidget extension to host a tab widget and UIVMActivityMonitorPaneContainer. The tab widget
|
---|
91 | hosts possibly multiple pages of UIVMActivityMonitor. */
|
---|
92 | class SHARED_LIBRARY_STUFF UIVMActivityMonitorContainer : public QWidget
|
---|
93 | {
|
---|
94 |
|
---|
95 | Q_OBJECT;
|
---|
96 |
|
---|
97 | public:
|
---|
98 |
|
---|
99 | UIVMActivityMonitorContainer(QWidget *pParent, UIActionPool *pActionPool, EmbedTo enmEmbedding);
|
---|
100 | void removeTabs(const QVector<QUuid> &machineIdsToRemove);
|
---|
101 | void addLocalMachine(const CMachine &comMachine);
|
---|
102 | void addCloudMachine(const CCloudMachine &comMachine);
|
---|
103 | void guestAdditionsStateChange(const QUuid &machineId);
|
---|
104 |
|
---|
105 | private slots:
|
---|
106 |
|
---|
107 | void sltCurrentTabChanged(int iIndex);
|
---|
108 | void sltDataSeriesColorChanged(int iIndex, const QColor &color);
|
---|
109 | void sltExportToFile();
|
---|
110 | void sltTogglePreferencesPane(bool fChecked);
|
---|
111 |
|
---|
112 | private:
|
---|
113 |
|
---|
114 | void prepare();
|
---|
115 | void loadSettings();
|
---|
116 | void saveSettings();
|
---|
117 | void setExportActionEnabled(bool fEnabled);
|
---|
118 |
|
---|
119 | UIVMActivityMonitorPaneContainer *m_pPaneContainer;
|
---|
120 | QTabWidget *m_pTabWidget;
|
---|
121 | QAction *m_pExportToFileAction;
|
---|
122 | UIActionPool *m_pActionPool;
|
---|
123 | EmbedTo m_enmEmbedding;
|
---|
124 | };
|
---|
125 |
|
---|
126 | #endif /* !FEQT_INCLUDED_SRC_activity_vmactivity_UIVMActivityMonitorContainer_h */
|
---|