1 | /* $Id: UIVMInformationDialog.h 106061 2024-09-16 14:03:52Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIVMInformationDialog class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-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_runtime_information_UIVMInformationDialog_h
|
---|
29 | #define FEQT_INCLUDED_SRC_runtime_information_UIVMInformationDialog_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QMainWindow>
|
---|
36 | #include <QUuid>
|
---|
37 |
|
---|
38 | /* GUI includes: */
|
---|
39 | #include "QIWithRestorableGeometry.h"
|
---|
40 |
|
---|
41 | /* COM includes: */
|
---|
42 | #include "KMachineState.h"
|
---|
43 |
|
---|
44 | /* Forward declarations: */
|
---|
45 | class QITabWidget;
|
---|
46 | class QIDialogButtonBox;
|
---|
47 | class UIActionPool;
|
---|
48 |
|
---|
49 | /* Type definitions: */
|
---|
50 | typedef QIWithRestorableGeometry<QMainWindow> QMainWindowWithRestorableGeometry;
|
---|
51 |
|
---|
52 | /** QMainWindow subclass providing user
|
---|
53 | * with the dialog unifying VM details and statistics. */
|
---|
54 | class UIVMInformationDialog : public QMainWindowWithRestorableGeometry
|
---|
55 | {
|
---|
56 | Q_OBJECT;
|
---|
57 |
|
---|
58 | signals:
|
---|
59 |
|
---|
60 | void sigClose();
|
---|
61 |
|
---|
62 | public:
|
---|
63 |
|
---|
64 | /** Constructs information dialog. */
|
---|
65 | UIVMInformationDialog(UIActionPool *pActionPool);
|
---|
66 |
|
---|
67 | /** Returns whether the dialog should be maximized when geometry being restored. */
|
---|
68 | virtual bool shouldBeMaximized() const RT_OVERRIDE;
|
---|
69 |
|
---|
70 | protected:
|
---|
71 |
|
---|
72 | virtual void closeEvent(QCloseEvent *pEvent) RT_OVERRIDE;
|
---|
73 | virtual bool event(QEvent *pEvent) RT_OVERRIDE;
|
---|
74 |
|
---|
75 | private slots:
|
---|
76 |
|
---|
77 | /** Handles translation event. */
|
---|
78 | void sltRetranslateUI();
|
---|
79 | /** Handles tab-widget page change. */
|
---|
80 | void sltHandlePageChanged(int iIndex);
|
---|
81 | void sltMachineStateChange(const QUuid &uMachineId, const KMachineState state);
|
---|
82 | void sltAdditionsStateChange();
|
---|
83 |
|
---|
84 | private:
|
---|
85 |
|
---|
86 | enum Tabs
|
---|
87 | {
|
---|
88 | Tabs_ConfigurationDetails = 0,
|
---|
89 | Tabs_RuntimeInformation,
|
---|
90 | Tabs_ActivityMonitor,
|
---|
91 | Tabs_GuestControl
|
---|
92 | };
|
---|
93 | /** Prepares all. */
|
---|
94 | void prepare();
|
---|
95 | /** Prepares central-widget. */
|
---|
96 | void prepareCentralWidget();
|
---|
97 | /** Prepares tab-widget. */
|
---|
98 | void prepareTabWidget();
|
---|
99 | /** Prepares tab with @a iTabIndex. */
|
---|
100 | void prepareTab(int iTabIndex);
|
---|
101 | /** Prepares button-box. */
|
---|
102 | void prepareButtonBox();
|
---|
103 | /** Prepares connections: */
|
---|
104 | void prepareConnections();
|
---|
105 | void loadDialogGeometry();
|
---|
106 | void saveDialogGeometry();
|
---|
107 |
|
---|
108 | /** @name Widget variables.
|
---|
109 | * @{ */
|
---|
110 | /** Holds the dialog tab-widget instance. */
|
---|
111 | QITabWidget *m_pTabWidget;
|
---|
112 | /** Holds the map of dialog tab instances. */
|
---|
113 | QMap<int, QWidget*> m_tabs;
|
---|
114 | /** Holds the dialog button-box instance. */
|
---|
115 | QIDialogButtonBox *m_pButtonBox;
|
---|
116 | /** @} */
|
---|
117 | bool m_fCloseEmitted;
|
---|
118 | int m_iGeometrySaveTimerId;
|
---|
119 | QUuid m_uMachineId;
|
---|
120 | QString m_strMachineName;
|
---|
121 | UIActionPool *m_pActionPool;
|
---|
122 | };
|
---|
123 |
|
---|
124 | #endif /* !FEQT_INCLUDED_SRC_runtime_information_UIVMInformationDialog_h */
|
---|