VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIGuestOSTypeSelectionButton.h@ 103977

Last change on this file since 103977 was 101285, checked in by vboxsync, 15 months ago

FE/Qt: bugref:10523. Refactoring UIGuestOSTypeSelectionButton to adjust the new guest os type structure.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1/* $Id: UIGuestOSTypeSelectionButton.h 101285 2023-09-27 09:17:00Z 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: */
41class QMenu;
42class QSignalMapper;
43
44/** QPushButton sub-class for choosing guest OS family/type inside appliance editor widget. */
45class UIGuestOSTypeSelectionButton : public QIWithRetranslateUI<QPushButton>
46{
47 Q_OBJECT;
48
49public:
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
60public slots:
61
62 /** Defines current guest @a strOSTypeId. */
63 void setOSTypeId(const QString &strOSTypeId);
64
65protected:
66
67 /** Handles translation event. */
68 virtual void retranslateUi() RT_OVERRIDE;
69
70private:
71
72 /** Populates menu. */
73 void populateMenu();
74 /** A help fundtion for populateMenu(). @p is the list of os type and @p pMenu is the menu to populate. */
75 void createOSTypeMenu(const QVector<QPair<QString, QString> > &typeList, QMenu *pMenu);
76 /** Holds the current guest OS type ID. */
77 QString m_strOSTypeId;
78
79 /** Holds the menu instance. */
80 QMenu *m_pMainMenu;
81 /** Holds the signal mapper instance. */
82 QSignalMapper *m_pSignalMapper;
83};
84
85#endif /* !FEQT_INCLUDED_SRC_widgets_UIGuestOSTypeSelectionButton_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