VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/medium/UIFDCreationDialog.h@ 102493

Last change on this file since 102493 was 98103, checked in by vboxsync, 20 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/* $Id: UIFDCreationDialog.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIFDCreationDialog class declaration.
4 */
5
6/*
7 * Copyright (C) 2008-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_medium_UIFDCreationDialog_h
29#define FEQT_INCLUDED_SRC_medium_UIFDCreationDialog_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QDialog>
36#include <QUuid>
37
38/* GUI Includes */
39#include "QIWithRetranslateUI.h"
40
41/* Forward declarations: */
42class QCheckBox;
43class QComboBox;
44class QIDialogButtonBox;
45class QLabel;
46class UIFilePathSelector;
47class CMedium;
48
49/* A QDialog extension to get necessary setting from the user for floppy disk creation. */
50class SHARED_LIBRARY_STUFF UIFDCreationDialog : public QIWithRetranslateUI<QDialog>
51{
52 Q_OBJECT;
53
54public:
55
56 /** Constructs the floppy disc creation dialog passing @a pParent to the base-class.
57 * @param strDefaultFolder Brings the default folder.
58 * @param strMachineName Brings the machine name. */
59 UIFDCreationDialog(QWidget *pParent,
60 const QString &strDefaultFolder,
61 const QString &strMachineName = QString());
62
63 /** Return the medium ID. */
64 QUuid mediumID() const;
65
66 /** Creates and shows a dialog thru which user can create a new floppy disk a VISO using the file-open dialog.
67 * @param parent Passes the parent of the dialog,
68 * @param strDefaultFolder Passes the default folder,
69 * @param strMachineName Passes the name of the machine,
70 * returns the UUID of the newly created medium if successful, a null QUuid otherwise.*/
71 static QUuid createFloppyDisk(QWidget *pParent, const QString &strDefaultFolder = QString(),
72 const QString &strMachineName = QString());
73
74
75public slots:
76
77 /** Creates the floppy disc image, asynchronously. */
78 virtual void accept() /* override final */;
79
80protected:
81
82 /** Handles translation event. */
83 virtual void retranslateUi() /* override final */;
84
85private slots:
86
87 /** Handles signal about @a comMedium was created. */
88 void sltHandleMediumCreated(const CMedium &comMedium);
89 void sltPathChanged(const QString &strPath);
90
91private:
92
93 /** Floppy disc sizes. */
94 enum FDSize
95 {
96 FDSize_2_88M,
97 FDSize_1_44M,
98 FDSize_1_2M,
99 FDSize_720K,
100 FDSize_360K
101 };
102
103 /** Prepares all. */
104 void prepare();
105
106 /** Returns default file-path. */
107 QString getDefaultFilePath() const;
108 /** Returns false if the file is already exists. */
109 bool checkFilePath(const QString &strPath) const;
110
111 /** Holds the default folder. */
112 QString m_strDefaultFolder;
113 /** Holds the machine name. */
114 QString m_strMachineName;
115
116 /** Holds the path label instance. */
117 QLabel *m_pPathLabel;
118 /** Holds the file path selector instance. */
119 UIFilePathSelector *m_pFilePathSelector;
120 /** Holds the size label instance. */
121 QLabel *m_pSizeLabel;
122 /** Holds the size combo instance. */
123 QComboBox *m_pSizeCombo;
124 /** Holds the format check-box instance. */
125 QCheckBox *m_pFormatCheckBox;
126 /** holds the button-box instance. */
127 QIDialogButtonBox *m_pButtonBox;
128
129 /** Holds the created medium ID. */
130 QUuid m_uMediumID;
131};
132
133#endif /* !FEQT_INCLUDED_SRC_medium_UIFDCreationDialog_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette