1 | /* $Id: UIVMLogViewerDialog.h 103923 2024-03-19 17:01:11Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIVMLogViewerDialog class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-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_logviewer_UIVMLogViewerDialog_h
|
---|
29 | #define FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerDialog_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QString>
|
---|
36 | #include <QUuid>
|
---|
37 |
|
---|
38 | /* GUI includes: */
|
---|
39 | #include "QIManagerDialog.h"
|
---|
40 |
|
---|
41 | /* Forward declarations: */
|
---|
42 | class QAbstractButton;
|
---|
43 | class UIActionPool;
|
---|
44 | class UIVirtualMachineItem;
|
---|
45 |
|
---|
46 |
|
---|
47 | /** QIManagerDialogFactory extension used as a factory for Log Viewer dialog. */
|
---|
48 | class SHARED_LIBRARY_STUFF UIVMLogViewerDialogFactory : public QIManagerDialogFactory
|
---|
49 | {
|
---|
50 | public:
|
---|
51 |
|
---|
52 | /** Constructs Log Viewer factory acquiring additional arguments.
|
---|
53 | * @param pActionPool Brings the action-pool reference.
|
---|
54 | * @param machineIDs Brings the list of machine IDs. */
|
---|
55 | UIVMLogViewerDialogFactory(UIActionPool *pActionPool = 0,
|
---|
56 | const QList<QUuid> &machineIDs = QList<QUuid>(),
|
---|
57 | const QString &strMachineName = QString());
|
---|
58 |
|
---|
59 | protected:
|
---|
60 |
|
---|
61 | /** Creates derived @a pDialog instance.
|
---|
62 | * @param pCenterWidget Brings the widget to center wrt. pCenterWidget. */
|
---|
63 | virtual void create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) RT_OVERRIDE;
|
---|
64 |
|
---|
65 | /** Holds the action-pool reference. */
|
---|
66 | UIActionPool *m_pActionPool;
|
---|
67 | /** Holds the list of machine IDs. */
|
---|
68 | QList<QUuid> m_machineIDs;
|
---|
69 | QString m_strMachineName;
|
---|
70 | };
|
---|
71 |
|
---|
72 |
|
---|
73 | /** QIManagerDialog extension providing GUI with the dialog displaying machine logs. */
|
---|
74 | class SHARED_LIBRARY_STUFF UIVMLogViewerDialog : public QIManagerDialog
|
---|
75 | {
|
---|
76 | Q_OBJECT;
|
---|
77 |
|
---|
78 | public:
|
---|
79 |
|
---|
80 | /** Constructs Log Viewer dialog.
|
---|
81 | * @param pCenterWidget Brings the widget reference to center according to.
|
---|
82 | * @param pActionPool Brings the action-pool reference.
|
---|
83 | * @param machineIDs Brings the list of machine IDs. */
|
---|
84 | UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool,
|
---|
85 | const QList<QUuid> &machineIDs = QList<QUuid>(),
|
---|
86 | const QString &strMachineName = QString());
|
---|
87 | ~UIVMLogViewerDialog();
|
---|
88 | void setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items);
|
---|
89 |
|
---|
90 | protected:
|
---|
91 |
|
---|
92 | /** @name Event-handling stuff.
|
---|
93 | * @{ */
|
---|
94 | /** Handles translation event. */
|
---|
95 | virtual bool event(QEvent *pEvent) RT_OVERRIDE;
|
---|
96 | /** @} */
|
---|
97 |
|
---|
98 | /** @name Prepare/cleanup cascade.
|
---|
99 | * @{ */
|
---|
100 | /** Configures all. */
|
---|
101 | virtual void configure() RT_OVERRIDE;
|
---|
102 | /** Configures central-widget. */
|
---|
103 | virtual void configureCentralWidget() RT_OVERRIDE;
|
---|
104 | /** Configures button-box. */
|
---|
105 | virtual void configureButtonBox() RT_OVERRIDE;
|
---|
106 | /** Perform final preparations. */
|
---|
107 | virtual void finalize() RT_OVERRIDE;
|
---|
108 | /** Loads dialog geometry from extradata. */
|
---|
109 | virtual void loadDialogGeometry();
|
---|
110 |
|
---|
111 | /** Saves dialog geometry into extradata. */
|
---|
112 | virtual void saveDialogGeometry();
|
---|
113 | /** @} */
|
---|
114 |
|
---|
115 | /** @name Functions related to geometry restoration.
|
---|
116 | * @{ */
|
---|
117 | /** Returns whether the window should be maximized when geometry being restored. */
|
---|
118 | virtual bool shouldBeMaximized() const RT_OVERRIDE;
|
---|
119 | /** @} */
|
---|
120 |
|
---|
121 | private slots:
|
---|
122 |
|
---|
123 | /** Must be handles soemthing related to close @a shortcut. */
|
---|
124 | void sltSetCloseButtonShortCut(QKeySequence shortcut);
|
---|
125 |
|
---|
126 | /** Handles button-box button click. */
|
---|
127 | void sltHandleButtonBoxClick(QAbstractButton *pButton);
|
---|
128 | void sltRetranslateUI();
|
---|
129 |
|
---|
130 | private:
|
---|
131 |
|
---|
132 | /** Holds the action-pool reference. */
|
---|
133 | UIActionPool *m_pActionPool;
|
---|
134 | /** Holds the list of machine IDs. */
|
---|
135 | QList<QUuid> m_machineIDs;
|
---|
136 | int m_iGeometrySaveTimerId;
|
---|
137 | QString m_strMachineName;
|
---|
138 | };
|
---|
139 |
|
---|
140 |
|
---|
141 | #endif /* !FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerDialog_h */
|
---|