1 | /* $Id: UIFileManagerDialog.h 104297 2024-04-11 13:20:43Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIFileManagerDialog 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_guestctrl_UIFileManagerDialog_h
|
---|
29 | #define FEQT_INCLUDED_SRC_guestctrl_UIFileManagerDialog_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 |
|
---|
42 | /* Forward declarations: */
|
---|
43 | class QDialogButtonBox;
|
---|
44 | class QVBoxLayout;
|
---|
45 | class UIActionPool;
|
---|
46 | class UIFileManagerDialog;
|
---|
47 |
|
---|
48 |
|
---|
49 | /** QIManagerDialogFactory extension used as a factory for the file manager dialog. */
|
---|
50 | class UIFileManagerDialogFactory : public QIManagerDialogFactory
|
---|
51 | {
|
---|
52 | public:
|
---|
53 |
|
---|
54 | UIFileManagerDialogFactory(UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName);
|
---|
55 | UIFileManagerDialogFactory();
|
---|
56 |
|
---|
57 | protected:
|
---|
58 |
|
---|
59 | /** Creates derived @a pDialog instance.
|
---|
60 | * @param pCenterWidget Passes the widget to center wrt. pCenterWidget. */
|
---|
61 | virtual void create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) RT_OVERRIDE;
|
---|
62 |
|
---|
63 | UIActionPool *m_pActionPool;
|
---|
64 | QUuid m_uMachineId;
|
---|
65 | QString m_strMachineName;
|
---|
66 | };
|
---|
67 |
|
---|
68 | /** QIManagerDialog extension providing GUI with the dialog displaying file manager releated logs. */
|
---|
69 | class UIFileManagerDialog : public QIManagerDialog
|
---|
70 | {
|
---|
71 | Q_OBJECT;
|
---|
72 |
|
---|
73 | public:
|
---|
74 |
|
---|
75 | /** Constructs File Manager dialog.
|
---|
76 | * @param pCenterWidget Passes the widget reference to center according to.
|
---|
77 | * @param pActionPool Passes the action-pool reference.
|
---|
78 | * @param uMachineId Passes the machine id. */
|
---|
79 | UIFileManagerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName);
|
---|
80 | ~UIFileManagerDialog();
|
---|
81 |
|
---|
82 | protected:
|
---|
83 |
|
---|
84 | /** @name Prepare/cleanup cascade.
|
---|
85 | * @{ */
|
---|
86 | /** Configures all. */
|
---|
87 | virtual void configure() RT_OVERRIDE;
|
---|
88 | /** Configures central-widget. */
|
---|
89 | virtual void configureCentralWidget() RT_OVERRIDE;
|
---|
90 | /** Perform final preparations. */
|
---|
91 | virtual void finalize() RT_OVERRIDE;
|
---|
92 | /** Loads dialog setting from extradata. */
|
---|
93 | virtual void loadSettings() RT_OVERRIDE;
|
---|
94 |
|
---|
95 | /** Saves dialog setting into extradata. */
|
---|
96 | virtual void saveSettings() RT_OVERRIDE;
|
---|
97 | /** @} */
|
---|
98 |
|
---|
99 | /** @name Functions related to geometry restoration.
|
---|
100 | * @{ */
|
---|
101 | /** Returns whether the window should be maximized when geometry being restored. */
|
---|
102 | virtual bool shouldBeMaximized() const RT_OVERRIDE;
|
---|
103 | /** @} */
|
---|
104 |
|
---|
105 | private slots:
|
---|
106 |
|
---|
107 | void sltSetCloseButtonShortCut(QKeySequence shortcut);
|
---|
108 | /** @name Event-handling stuff.
|
---|
109 | * @{ */
|
---|
110 | /** Handles translation event. */
|
---|
111 | void sltRetranslateUI();
|
---|
112 | /** @} */
|
---|
113 |
|
---|
114 | private:
|
---|
115 |
|
---|
116 | void manageEscapeShortCut();
|
---|
117 | UIActionPool *m_pActionPool;
|
---|
118 | QUuid m_uMachineId;
|
---|
119 | QString m_strMachineName;
|
---|
120 | };
|
---|
121 |
|
---|
122 |
|
---|
123 | #endif /* !FEQT_INCLUDED_SRC_guestctrl_UIFileManagerDialog_h */
|
---|