1 | /* $Id: UIVMInformationDialog.h 103803 2024-03-12 11:15:18Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIVMInformationDialog class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2016-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_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 | #include "QIWithRetranslateUI.h"
|
---|
41 |
|
---|
42 | /* COM includes: */
|
---|
43 | #include "KMachineState.h"
|
---|
44 |
|
---|
45 | /* Forward declarations: */
|
---|
46 | class QITabWidget;
|
---|
47 | class QIDialogButtonBox;
|
---|
48 |
|
---|
49 | /* Type definitions: */
|
---|
50 | typedef QIWithRestorableGeometry<QMainWindow> QMainWindowWithRestorableGeometry;
|
---|
51 | typedef QIWithRetranslateUI<QMainWindowWithRestorableGeometry> QMainWindowWithRestorableGeometryAndRetranslateUi;
|
---|
52 |
|
---|
53 |
|
---|
54 | /** QMainWindow subclass providing user
|
---|
55 | * with the dialog unifying VM details and statistics. */
|
---|
56 | class UIVMInformationDialog : public QMainWindowWithRestorableGeometryAndRetranslateUi
|
---|
57 | {
|
---|
58 | Q_OBJECT;
|
---|
59 |
|
---|
60 | signals:
|
---|
61 |
|
---|
62 | void sigClose();
|
---|
63 |
|
---|
64 | public:
|
---|
65 |
|
---|
66 | /** Constructs information dialog. */
|
---|
67 | UIVMInformationDialog();
|
---|
68 |
|
---|
69 | /** Returns whether the dialog should be maximized when geometry being restored. */
|
---|
70 | virtual bool shouldBeMaximized() const RT_OVERRIDE;
|
---|
71 |
|
---|
72 | protected:
|
---|
73 |
|
---|
74 | /** Handles translation event. */
|
---|
75 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
76 | virtual void closeEvent(QCloseEvent *pEvent) RT_OVERRIDE;
|
---|
77 | virtual bool event(QEvent *pEvent) RT_OVERRIDE;
|
---|
78 |
|
---|
79 | private slots:
|
---|
80 |
|
---|
81 | /** Handles tab-widget page change. */
|
---|
82 | void sltHandlePageChanged(int iIndex);
|
---|
83 | void sltMachineStateChange(const QUuid &uMachineId, const KMachineState state);
|
---|
84 |
|
---|
85 | private:
|
---|
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 | };
|
---|
122 |
|
---|
123 | #endif /* !FEQT_INCLUDED_SRC_runtime_information_UIVMInformationDialog_h */
|
---|