1 | /* $Id: UIVMLogViewerDialog.h 101027 2023-09-06 11:21:36Z 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 | #include "QIWithRetranslateUI.h"
|
---|
41 |
|
---|
42 | /* Forward declarations: */
|
---|
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 uMachineId Brings the machine id for which VM Log-Viewer is requested. */
|
---|
55 | UIVMLogViewerDialogFactory(UIActionPool *pActionPool = 0, const QUuid &uMachineId = QUuid(),
|
---|
56 | const QString &strMachineName = QString());
|
---|
57 |
|
---|
58 | protected:
|
---|
59 |
|
---|
60 | /** Creates derived @a pDialog instance.
|
---|
61 | * @param pCenterWidget Brings the widget to center wrt. pCenterWidget. */
|
---|
62 | virtual void create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) RT_OVERRIDE;
|
---|
63 |
|
---|
64 | /** Holds the action-pool reference. */
|
---|
65 | UIActionPool *m_pActionPool;
|
---|
66 | /** Holds the machine id. */
|
---|
67 | QUuid m_uMachineId;
|
---|
68 | QString m_strMachineName;
|
---|
69 | };
|
---|
70 |
|
---|
71 |
|
---|
72 | /** QIManagerDialog extension providing GUI with the dialog displaying machine logs. */
|
---|
73 | class SHARED_LIBRARY_STUFF UIVMLogViewerDialog : public QIWithRetranslateUI<QIManagerDialog>
|
---|
74 | {
|
---|
75 | Q_OBJECT;
|
---|
76 |
|
---|
77 | public:
|
---|
78 |
|
---|
79 | /** Constructs Log Viewer dialog.
|
---|
80 | * @param pCenterWidget Brings the widget reference to center according to.
|
---|
81 | * @param pActionPool Brings the action-pool reference.
|
---|
82 | * @param machine id Brings the machine id. */
|
---|
83 | UIVMLogViewerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool,
|
---|
84 | const QUuid &uMachineId = QUuid(), const QString &strMachineName = QString());
|
---|
85 | ~UIVMLogViewerDialog();
|
---|
86 | void setSelectedVMListItems(const QList<UIVirtualMachineItem*> &items);
|
---|
87 | void addSelectedVMListItems(const QList<UIVirtualMachineItem*> &items);
|
---|
88 |
|
---|
89 | protected:
|
---|
90 |
|
---|
91 | /** @name Event-handling stuff.
|
---|
92 | * @{ */
|
---|
93 | /** Handles translation event. */
|
---|
94 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
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 | /** Perform final preparations. */
|
---|
105 | virtual void finalize() RT_OVERRIDE;
|
---|
106 | /** Loads dialog geometry from extradata. */
|
---|
107 | virtual void loadDialogGeometry();
|
---|
108 |
|
---|
109 | /** Saves dialog geometry into extradata. */
|
---|
110 | virtual void saveDialogGeometry();
|
---|
111 | /** @} */
|
---|
112 |
|
---|
113 | /** @name Functions related to geometry restoration.
|
---|
114 | * @{ */
|
---|
115 | /** Returns whether the window should be maximized when geometry being restored. */
|
---|
116 | virtual bool shouldBeMaximized() const RT_OVERRIDE;
|
---|
117 | /** @} */
|
---|
118 |
|
---|
119 | private slots:
|
---|
120 |
|
---|
121 | /** Must be handles soemthing related to close @a shortcut. */
|
---|
122 | void sltSetCloseButtonShortCut(QKeySequence shortcut);
|
---|
123 |
|
---|
124 | private:
|
---|
125 |
|
---|
126 | /** Holds the action-pool reference. */
|
---|
127 | UIActionPool *m_pActionPool;
|
---|
128 | /** Holds the machine id. */
|
---|
129 | QUuid m_uMachineId;
|
---|
130 | int m_iGeometrySaveTimerId;
|
---|
131 | QString m_strMachineName;
|
---|
132 | };
|
---|
133 |
|
---|
134 |
|
---|
135 | #endif /* !FEQT_INCLUDED_SRC_logviewer_UIVMLogViewerDialog_h */
|
---|