VirtualBox

Changeset 64683 in vbox for trunk


Ignore:
Timestamp:
Nov 16, 2016 2:22:05 PM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 128): UIApplianceEditorWidget: Merge .ui xml content into .h/.cpp class files.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro

    r63838 r64683  
    4848    src/settings/machine/UIMachineSettingsSF.ui \
    4949    src/settings/machine/UIMachineSettingsSFDetails.ui \
    50     src/settings/machine/UIMachineSettingsInterface.ui \
    51     src/widgets/UIApplianceEditorWidget.ui
     50    src/settings/machine/UIMachineSettingsInterface.ui
    5251
    5352TRANSLATIONS = \
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp

    r63567 r64683  
    2525# include <QHeaderView>
    2626# include <QLineEdit>
    27 # include <QTextEdit>
    2827# include <QSpinBox>
    2928# include <QComboBox>
    3029# include <QDir>
     30# include <QTreeView>
     31# include <QCheckBox>
     32# include <QLabel>
     33# include <QTextEdit>
    3134
    3235/* GUI includes: */
     
    11191122    initSystemSettings();
    11201123
    1121     /* Apply UI decorations */
    1122     Ui::UIApplianceEditorWidget::setupUi(this);
    1123 
    1124     /* Make the tree looking nicer */
    1125     m_pTvSettings->setRootIsDecorated(false);
    1126     m_pTvSettings->setAlternatingRowColors(true);
    1127     m_pTvSettings->setAllColumnsShowFocus(true);
    1128     m_pTvSettings->header()->setStretchLastSection(true);
    1129 #if QT_VERSION >= 0x050000
    1130     m_pTvSettings->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
    1131 #else /* QT_VERSION < 0x050000 */
    1132     m_pTvSettings->header()->setResizeMode(QHeaderView::ResizeToContents);
    1133 #endif /* QT_VERSION < 0x050000 */
    1134 
    1135     /* Hidden by default */
    1136     m_pReinitMACsCheckBox->setHidden(true);
    1137 
    1138     /* Applying language settings */
     1124    /* Create layout: */
     1125    QVBoxLayout *pLayout = new QVBoxLayout(this);
     1126    {
     1127        /* Configure information layout: */
     1128        pLayout->setContentsMargins(0, 0, 0, 0);
     1129
     1130        /* Create information pane: */
     1131        m_pPaneInformation = new QWidget;
     1132        {
     1133            /* Create information layout: */
     1134            QVBoxLayout *pLayoutInformation = new QVBoxLayout(m_pPaneInformation);
     1135            {
     1136                /* Configure information layout: */
     1137                pLayoutInformation->setContentsMargins(0, 0, 0, 0);
     1138
     1139                /* Create tree-view: */
     1140                m_pTreeViewSettings = new QTreeView;
     1141                {
     1142                    /* Configure tree-view: */
     1143                    m_pTreeViewSettings->setRootIsDecorated(false);
     1144                    m_pTreeViewSettings->setAlternatingRowColors(true);
     1145                    m_pTreeViewSettings->setAllColumnsShowFocus(true);
     1146                    m_pTreeViewSettings->header()->setStretchLastSection(true);
     1147                    m_pTreeViewSettings->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding);
     1148#if QT_VERSION < 0x050000
     1149                    m_pTreeViewSettings->header()->setResizeMode(QHeaderView::ResizeToContents);
     1150#else
     1151                    m_pTreeViewSettings->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
     1152#endif
     1153
     1154                    /* Add tree-view into information layout: */
     1155                    pLayoutInformation->addWidget(m_pTreeViewSettings);
     1156                }
     1157
     1158                /* Create check-box: */
     1159                m_pCheckBoxReinitMACs = new QCheckBox;
     1160                {
     1161                    /* Configure check-box: */
     1162                    m_pCheckBoxReinitMACs->setHidden(true);
     1163
     1164                    /* Add tree-view into information layout: */
     1165                    pLayoutInformation->addWidget(m_pCheckBoxReinitMACs);
     1166                }
     1167            }
     1168
     1169            /* Add information pane into layout: */
     1170            pLayout->addWidget(m_pPaneInformation);
     1171        }
     1172
     1173        /* Create warning pane: */
     1174        m_pPaneWarning  = new QWidget;
     1175        {
     1176            /* Configure warning pane: */
     1177            m_pPaneWarning->hide();
     1178            m_pPaneWarning->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
     1179
     1180            /* Create warning layout: */
     1181            QVBoxLayout *pLayoutWarning = new QVBoxLayout(m_pPaneWarning);
     1182            {
     1183                /* Configure warning layout: */
     1184                pLayoutWarning->setContentsMargins(0, 0, 0, 0);
     1185
     1186                /* Create label: */
     1187                m_pLabelWarning = new QLabel;
     1188                {
     1189                    /* Add label into warning layout: */
     1190                    pLayoutWarning->addWidget(m_pLabelWarning);
     1191                }
     1192
     1193                /* Create text-edit: */
     1194                m_pTextEditWarning = new QTextEdit;
     1195                {
     1196                    /* Configure text-edit: */
     1197                    m_pTextEditWarning->setReadOnly(true);
     1198                    m_pTextEditWarning->setMaximumHeight(50);
     1199                    m_pTextEditWarning->setAutoFormatting(QTextEdit::AutoBulletList);
     1200
     1201                    /* Add text-edit into warning layout: */
     1202                    pLayoutWarning->addWidget(m_pTextEditWarning);
     1203                }
     1204            }
     1205
     1206            /* Add warning pane into layout: */
     1207            pLayout->addWidget(m_pPaneWarning);
     1208        }
     1209    }
     1210
     1211    /* Translate finally: */
    11391212    retranslateUi();
    11401213}
     
    11471220void UIApplianceEditorWidget::retranslateUi()
    11481221{
    1149     /* Translate uic generated strings */
    1150     Ui::UIApplianceEditorWidget::retranslateUi(this);
     1222    /* Translate information pane check-box: */
     1223    m_pCheckBoxReinitMACs->setText(tr("&Reinitialize the MAC address of all network cards"));
     1224    m_pCheckBoxReinitMACs->setToolTip(tr("When checked a new unique MAC address will assigned to all configured network cards."));
     1225
     1226    /* Translate warning pane label: */
     1227    m_pLabelWarning->setText(tr("Warnings:"));
    11511228}
    11521229
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.h

    r62493 r64683  
    2424
    2525/* GUI includes: */
    26 #include "UIApplianceEditorWidget.gen.h"
    2726#include "QIWithRetranslateUI.h"
    2827
     
    3332/* Forward declarations: */
    3433class ModelItem;
     34class QWidget;
     35class QTreeView;
     36class QCheckBox;
     37class QLabel;
     38class QTextEdit;
    3539
    3640////////////////////////////////////////////////////////////////////////////////
     
    251255// UIApplianceEditorWidget
    252256
    253 class UIApplianceEditorWidget: public QIWithRetranslateUI<QWidget>,
    254                                public Ui::UIApplianceEditorWidget
     257class UIApplianceEditorWidget: public QIWithRetranslateUI<QWidget>
    255258{
    256259    Q_OBJECT;
     
    276279    CAppliance         *m_pAppliance;
    277280    VirtualSystemModel *m_pModel;
     281
     282    /** Holds the information pane instance. */
     283    QWidget *m_pPaneInformation;
     284    /** Holds the settings tree-view instance. */
     285    QTreeView *m_pTreeViewSettings;
     286    /** Holds the 'reinit MACs' check-box instance. */
     287    QCheckBox *m_pCheckBoxReinitMACs;
     288
     289    /** Holds the warning pane instance. */
     290    QWidget *m_pPaneWarning;
     291    /** Holds the warning label instance. */
     292    QLabel *m_pLabelWarning;
     293    /** Holds the warning browser instance. */
     294    QTextEdit *m_pTextEditWarning;
    278295
    279296private:
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceExportEditorWidget.cpp

    r62493 r64683  
    1919# include <precomp.h>
    2020#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
     21
     22/* Qt includes: */
     23# include <QTextEdit>
     24# include <QTreeView>
    2125
    2226/* GUI includes: */
     
    9195
    9296    /* Set our own model */
    93     m_pTvSettings->setModel(pProxy);
     97    m_pTreeViewSettings->setModel(pProxy);
    9498    /* Set our own delegate */
    95     m_pTvSettings->setItemDelegate(pDelegate);
     99    m_pTreeViewSettings->setItemDelegate(pDelegate);
    96100    /* For now we hide the original column. This data is displayed as tooltip
    97101       also. */
    98     m_pTvSettings->setColumnHidden(OriginalValueSection, true);
    99     m_pTvSettings->expandAll();
     102    m_pTreeViewSettings->setColumnHidden(OriginalValueSection, true);
     103    m_pTreeViewSettings->expandAll();
    100104
    101105    /* Check for warnings & if there are one display them. */
     
    105109    {
    106110        foreach (const QString& text, warnings)
    107             mWarningTextEdit->append("- " + text);
     111            m_pTextEditWarning->append("- " + text);
    108112        fWarningsEnabled = true;
    109113    }
    110     m_pWarningWidget->setVisible(fWarningsEnabled);
     114    m_pPaneWarning->setVisible(fWarningsEnabled);
    111115}
    112116
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceImportEditorWidget.cpp

    r62493 r64683  
    1919# include <precomp.h>
    2020#else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
     21
     22/* Qt includes: */
     23# include <QCheckBox>
     24# include <QTextEdit>
     25# include <QTreeView>
    2126
    2227/* GUI includes: */
     
    5156{
    5257    /* Show the MAC check box */
    53     m_pReinitMACsCheckBox->setHidden(false);
     58    m_pCheckBoxReinitMACs->setHidden(false);
    5459}
    5560
     
    96101
    97102                        /* Set our own model */
    98                         m_pTvSettings->setModel(pProxy);
     103                        m_pTreeViewSettings->setModel(pProxy);
    99104                        /* Set our own delegate */
    100                         m_pTvSettings->setItemDelegate(pDelegate);
     105                        m_pTreeViewSettings->setItemDelegate(pDelegate);
    101106                        /* For now we hide the original column. This data is displayed as tooltip
    102107                           also. */
    103                         m_pTvSettings->setColumnHidden(OriginalValueSection, true);
    104                         m_pTvSettings->expandAll();
     108                        m_pTreeViewSettings->setColumnHidden(OriginalValueSection, true);
     109                        m_pTreeViewSettings->expandAll();
    105110
    106111                        /* Check for warnings & if there are one display them. */
     
    110115                        {
    111116                            foreach (const QString& text, warnings)
    112                                 mWarningTextEdit->append("- " + text);
     117                                m_pTextEditWarning->append("- " + text);
    113118                            fWarningsEnabled = true;
    114119                        }
    115                         m_pWarningWidget->setVisible(fWarningsEnabled);
     120                        m_pPaneWarning->setVisible(fWarningsEnabled);
    116121                    }
    117122                }
     
    145150        CProgress progress;
    146151        QVector<KImportOptions> options;
    147         if (!m_pReinitMACsCheckBox->isChecked())
     152        if (!m_pCheckBoxReinitMACs->isChecked())
    148153            options.append(KImportOptions_KeepAllMACs);
    149154        progress = m_pAppliance->ImportMachines(options);
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportApp.cpp

    r62493 r64683  
    2222/* Global includes: */
    2323# include <QDialogButtonBox>
     24# include <QLabel>
    2425# include <QPushButton>
     26# include <QTextEdit>
    2527# include <QTextStream>
    2628
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp

    r62279 r64683  
    2525# include <QPushButton>
    2626# include <QPointer>
     27# include <QLabel>
    2728
    2829/* Local includes: */
Note: See TracChangeset for help on using the changeset viewer.

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