VirtualBox

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

Last change on this file was 104358, checked in by vboxsync, 5 weeks ago

FE/Qt. bugref:10622. More refactoring around the retranslation functionality.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/* $Id: UIGuestOSTypeSelectionButton.h 104358 2024-04-18 05:33:40Z 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/* Forward declarations: */
38class QMenu;
39class QSignalMapper;
40
41/** QPushButton sub-class for choosing guest OS family/type inside appliance editor widget. */
42class UIGuestOSTypeSelectionButton : public QPushButton
43{
44 Q_OBJECT;
45
46public:
47
48 /** Constructs a button passing @a pParent to the base-class. */
49 UIGuestOSTypeSelectionButton(QWidget *pParent);
50
51 /** Returns whether the menu is shown. */
52 bool isMenuShown() const;
53
54 /** Returns current guest OS type ID. */
55 QString osTypeId() const { return m_strOSTypeId; }
56
57public slots:
58
59 /** Defines current guest @a strOSTypeId. */
60 void setOSTypeId(const QString &strOSTypeId);
61
62private:
63
64 /** Handles translation event. */
65 void sltRetranslateUI();
66 /** Populates menu. */
67 void populateMenu();
68 /** A help fundtion for populateMenu(). @p is the list of os type and @p pMenu is the menu to populate. */
69 void createOSTypeMenu(const QVector<QPair<QString, QString> > &typeList, QMenu *pMenu);
70 /** Holds the current guest OS type ID. */
71 QString m_strOSTypeId;
72
73 /** Holds the menu instance. */
74 QMenu *m_pMainMenu;
75 /** Holds the signal mapper instance. */
76 QSignalMapper *m_pSignalMapper;
77};
78
79#endif /* !FEQT_INCLUDED_SRC_widgets_UIGuestOSTypeSelectionButton_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use