1 | /* $Id: UIGuestOSTypeSelectionButton.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIGuestOSTypeSelectionButton class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-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_widgets_UIGuestOSTypeSelectionButton_h
|
---|
29 | #define FEQT_INCLUDED_SRC_widgets_UIGuestOSTypeSelectionButton_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QPushButton>
|
---|
36 |
|
---|
37 | /* GUI includes: */
|
---|
38 | #include "QIWithRetranslateUI.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QMenu;
|
---|
42 | class QSignalMapper;
|
---|
43 |
|
---|
44 | /** QPushButton sub-class for choosing guest OS family/type inside appliance editor widget. */
|
---|
45 | class UIGuestOSTypeSelectionButton : public QIWithRetranslateUI<QPushButton>
|
---|
46 | {
|
---|
47 | Q_OBJECT;
|
---|
48 |
|
---|
49 | public:
|
---|
50 |
|
---|
51 | /** Constructs a button passing @a pParent to the base-class. */
|
---|
52 | UIGuestOSTypeSelectionButton(QWidget *pParent);
|
---|
53 |
|
---|
54 | /** Returns whether the menu is shown. */
|
---|
55 | bool isMenuShown() const;
|
---|
56 |
|
---|
57 | /** Returns current guest OS type ID. */
|
---|
58 | QString osTypeId() const { return m_strOSTypeId; }
|
---|
59 |
|
---|
60 | public slots:
|
---|
61 |
|
---|
62 | /** Defines current guest @a strOSTypeId. */
|
---|
63 | void setOSTypeId(const QString &strOSTypeId);
|
---|
64 |
|
---|
65 | protected:
|
---|
66 |
|
---|
67 | /** Handles translation event. */
|
---|
68 | virtual void retranslateUi() RT_OVERRIDE;
|
---|
69 |
|
---|
70 | private:
|
---|
71 |
|
---|
72 | /** Populates menu. */
|
---|
73 | void populateMenu();
|
---|
74 |
|
---|
75 | /** Holds the current guest OS type ID. */
|
---|
76 | QString m_strOSTypeId;
|
---|
77 |
|
---|
78 | /** Holds the menu instance. */
|
---|
79 | QMenu *m_pMainMenu;
|
---|
80 | /** Holds the signal mapper instance. */
|
---|
81 | QSignalMapper *m_pSignalMapper;
|
---|
82 | };
|
---|
83 |
|
---|
84 | #endif /* !FEQT_INCLUDED_SRC_widgets_UIGuestOSTypeSelectionButton_h */
|
---|