blob: cb04576fdcb185734513ecc37d8f5bb3a79bc82c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
/* $Id$ */
/** @file
* VBox Qt GUI - UIFileManagerDialog class declaration.
*/
/*
* Copyright (C) 2010-2022 Oracle and/or its affiliates.
*
* This file is part of VirtualBox base platform packages, as
* available from https://www.virtualbox.org.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, in version 3 of the
* License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <https://www.gnu.org/licenses>.
*
* SPDX-License-Identifier: GPL-3.0-only
*/
#ifndef FEQT_INCLUDED_SRC_guestctrl_UIFileManagerDialog_h
#define FEQT_INCLUDED_SRC_guestctrl_UIFileManagerDialog_h
#ifndef RT_WITHOUT_PRAGMA_ONCE
# pragma once
#endif
/* Qt includes: */
#include <QString>
#include <QUuid>
/* GUI includes: */
#include "QIManagerDialog.h"
#include "QIWithRetranslateUI.h"
/* Forward declarations: */
class QDialogButtonBox;
class QVBoxLayout;
class UIActionPool;
class UIFileManagerDialog;
/** QIManagerDialogFactory extension used as a factory for the file manager dialog. */
class UIFileManagerDialogFactory : public QIManagerDialogFactory
{
public:
UIFileManagerDialogFactory(UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName);
UIFileManagerDialogFactory();
protected:
/** Creates derived @a pDialog instance.
* @param pCenterWidget Passes the widget to center wrt. pCenterWidget. */
virtual void create(QIManagerDialog *&pDialog, QWidget *pCenterWidget) RT_OVERRIDE;
UIActionPool *m_pActionPool;
QUuid m_uMachineId;
QString m_strMachineName;
};
/** QIManagerDialog extension providing GUI with the dialog displaying file manager releated logs. */
class UIFileManagerDialog : public QIWithRetranslateUI<QIManagerDialog>
{
Q_OBJECT;
public:
/** Constructs File Manager dialog.
* @param pCenterWidget Passes the widget reference to center according to.
* @param pActionPool Passes the action-pool reference.
* @param uMachineId Passes the machine id. */
UIFileManagerDialog(QWidget *pCenterWidget, UIActionPool *pActionPool, const QUuid &uMachineId, const QString &strMachineName);
~UIFileManagerDialog();
protected:
/** @name Event-handling stuff.
* @{ */
/** Handles translation event. */
virtual void retranslateUi() RT_OVERRIDE;
/** @} */
/** @name Prepare/cleanup cascade.
* @{ */
/** Configures all. */
virtual void configure() RT_OVERRIDE;
/** Configures central-widget. */
virtual void configureCentralWidget() RT_OVERRIDE;
/** Perform final preparations. */
virtual void finalize() RT_OVERRIDE;
/** Loads dialog setting from extradata. */
virtual void loadSettings() RT_OVERRIDE;
/** Saves dialog setting into extradata. */
virtual void saveSettings() RT_OVERRIDE;
/** @} */
/** @name Functions related to geometry restoration.
* @{ */
/** Returns whether the window should be maximized when geometry being restored. */
virtual bool shouldBeMaximized() const RT_OVERRIDE;
/** @} */
private slots:
void sltSetCloseButtonShortCut(QKeySequence shortcut);
private:
void manageEscapeShortCut();
UIActionPool *m_pActionPool;
QUuid m_uMachineId;
QString m_strMachineName;
};
#endif /* !FEQT_INCLUDED_SRC_guestctrl_UIFileManagerDialog_h */
|