VirtualBox

Changeset 86045 in vbox for trunk/src


Ignore:
Timestamp:
Sep 7, 2020 2:58:04 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9812: Cumulative cleanup for layout rework done before for VM settings.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.cpp

    r85958 r86045  
    7878    , m_pCheckBoxAudio(0)
    7979    , m_pWidgetAudioSettings(0)
    80     , m_pAudioHostDriverLabel(0)
    81     , m_pAudioHostDriverEditor(0)
    82     , m_pAudioControllerLabel(0)
    83     , m_pAudioControllerEditor(0)
     80    , m_pLabelAudioHostDriver(0)
     81    , m_pEditorAudioHostDriver(0)
     82    , m_pLabelAudioController(0)
     83    , m_pEditorAudioController(0)
    8484    , m_pLabelAudioExtended(0)
    8585    , m_pCheckBoxAudioOutput(0)
     
    138138    /* Load old audio data from the cache: */
    139139    m_pCheckBoxAudio->setChecked(oldAudioData.m_fAudioEnabled);
    140     m_pAudioHostDriverEditor->setValue(oldAudioData.m_audioDriverType);
    141     m_pAudioControllerEditor->setValue(oldAudioData.m_audioControllerType);
     140    m_pEditorAudioHostDriver->setValue(oldAudioData.m_audioDriverType);
     141    m_pEditorAudioController->setValue(oldAudioData.m_audioControllerType);
    142142    m_pCheckBoxAudioOutput->setChecked(oldAudioData.m_fAudioOutputEnabled);
    143143    m_pCheckBoxAudioInput->setChecked(oldAudioData.m_fAudioInputEnabled);
     
    154154    /* Gather new audio data: */
    155155    newAudioData.m_fAudioEnabled = m_pCheckBoxAudio->isChecked();
    156     newAudioData.m_audioDriverType = m_pAudioHostDriverEditor->value();
    157     newAudioData.m_audioControllerType = m_pAudioControllerEditor->value();
     156    newAudioData.m_audioDriverType = m_pEditorAudioHostDriver->value();
     157    newAudioData.m_audioControllerType = m_pEditorAudioController->value();
    158158    newAudioData.m_fAudioOutputEnabled = m_pCheckBoxAudioOutput->isChecked();
    159159    newAudioData.m_fAudioInputEnabled = m_pCheckBoxAudioInput->isChecked();
     
    181181                                      "the host audio system using the specified driver."));
    182182    m_pCheckBoxAudio->setText(tr("Enable &Audio"));
    183     m_pAudioHostDriverLabel->setText(tr("Host Audio &Driver:"));
    184     m_pAudioHostDriverEditor->setWhatsThis(tr("Selects the audio output driver."
     183    m_pLabelAudioHostDriver->setText(tr("Host Audio &Driver:"));
     184    m_pEditorAudioHostDriver->setWhatsThis(tr("Selects the audio output driver."
    185185                                              "The <b>Null Audio Driver</b> makes the guest see an audio card,"
    186186                                              "however every access to it will be ignored."));
    187     m_pAudioControllerLabel->setText(tr("Audio &Controller:"));
    188     m_pAudioControllerEditor->setWhatsThis(tr("Selects the type of the virtual sound"
     187    m_pLabelAudioController->setText(tr("Audio &Controller:"));
     188    m_pEditorAudioController->setWhatsThis(tr("Selects the type of the virtual sound"
    189189                                              "card. Depending on this value, VirtualBox will provide different"
    190190                                              "audio hardware to the virtual machine."));
     
    204204    /* Polish audio page availability: */
    205205    m_pCheckBoxAudio->setEnabled(isMachineOffline());
    206     m_pAudioHostDriverLabel->setEnabled(isMachineOffline() || isMachineSaved());
    207     m_pAudioHostDriverEditor->setEnabled(isMachineOffline() || isMachineSaved());
    208     m_pAudioControllerLabel->setEnabled(isMachineOffline());
    209     m_pAudioControllerEditor->setEnabled(isMachineOffline());
     206    m_pLabelAudioHostDriver->setEnabled(isMachineOffline() || isMachineSaved());
     207    m_pEditorAudioHostDriver->setEnabled(isMachineOffline() || isMachineSaved());
     208    m_pLabelAudioController->setEnabled(isMachineOffline());
     209    m_pEditorAudioController->setEnabled(isMachineOffline());
    210210    m_pLabelAudioExtended->setEnabled(isMachineInValidMode());
    211211    m_pCheckBoxAudioOutput->setEnabled(isMachineInValidMode());
     
    255255            {
    256256                pLayoutAudioSettings->setContentsMargins(0, 0, 0, 0);
    257 
    258                 /* Prepare host driver label: */
    259                 m_pAudioHostDriverLabel = new QLabel(m_pWidgetAudioSettings);
    260                 if (m_pAudioHostDriverLabel)
    261                 {
    262                     m_pAudioHostDriverLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    263                     pLayoutAudioSettings->addWidget(m_pAudioHostDriverLabel, 0, 0);
    264                 }
    265                 /* Prepare host driver editor: */
    266                 m_pAudioHostDriverEditor = new UIAudioHostDriverEditor(m_pWidgetAudioSettings);
    267                 if (m_pAudioHostDriverEditor)
    268                 {
    269                     m_pAudioHostDriverLabel->setBuddy(m_pAudioHostDriverEditor->focusProxy());
    270                     pLayoutAudioSettings->addWidget(m_pAudioHostDriverEditor, 0, 1);
    271                 }
    272 
    273                 /* Prepare host controller label: */
    274                 m_pAudioControllerLabel = new QLabel(m_pWidgetAudioSettings);
    275                 if (m_pAudioControllerLabel)
    276                 {
    277                     m_pAudioControllerLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    278                     pLayoutAudioSettings->addWidget(m_pAudioControllerLabel, 1, 0);
    279                 }
    280                 /* Prepare host controller editor: */
    281                 m_pAudioControllerEditor = new UIAudioControllerEditor(m_pWidgetAudioSettings);
    282                 if (m_pAudioControllerEditor)
    283                 {
    284                     m_pAudioControllerLabel->setBuddy(m_pAudioControllerEditor->focusProxy());
    285                     pLayoutAudioSettings->addWidget(m_pAudioControllerEditor, 1, 1);
    286                 }
    287 
    288                 /* Prepare extended label: */
     257                pLayoutAudioSettings->setColumnStretch(1, 1);
     258
     259                /* Prepare audio host driver label: */
     260                m_pLabelAudioHostDriver = new QLabel(m_pWidgetAudioSettings);
     261                if (m_pLabelAudioHostDriver)
     262                {
     263                    m_pLabelAudioHostDriver->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     264                    pLayoutAudioSettings->addWidget(m_pLabelAudioHostDriver, 0, 0);
     265                }
     266                /* Prepare audio host driver editor: */
     267                m_pEditorAudioHostDriver = new UIAudioHostDriverEditor(m_pWidgetAudioSettings);
     268                if (m_pEditorAudioHostDriver)
     269                {
     270                    if (m_pLabelAudioHostDriver)
     271                        m_pLabelAudioHostDriver->setBuddy(m_pEditorAudioHostDriver->focusProxy());
     272                    pLayoutAudioSettings->addWidget(m_pEditorAudioHostDriver, 0, 1, 1, 2);
     273                }
     274
     275                /* Prepare audio host controller label: */
     276                m_pLabelAudioController = new QLabel(m_pWidgetAudioSettings);
     277                if (m_pLabelAudioController)
     278                {
     279                    m_pLabelAudioController->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
     280                    pLayoutAudioSettings->addWidget(m_pLabelAudioController, 1, 0);
     281                }
     282                /* Prepare audio host controller editor: */
     283                m_pEditorAudioController = new UIAudioControllerEditor(m_pWidgetAudioSettings);
     284                if (m_pEditorAudioController)
     285                {
     286                    if (m_pLabelAudioController)
     287                        m_pLabelAudioController->setBuddy(m_pEditorAudioController->focusProxy());
     288                    pLayoutAudioSettings->addWidget(m_pEditorAudioController, 1, 1, 1, 2);
     289                }
     290
     291                /* Prepare audio extended label: */
    289292                m_pLabelAudioExtended = new QLabel(m_pWidgetAudioSettings);
    290293                if (m_pLabelAudioExtended)
     
    293296                    pLayoutAudioSettings->addWidget(m_pLabelAudioExtended, 2, 0);
    294297                }
    295                 /* Prepare output check-box: */
     298                /* Prepare audio output check-box: */
    296299                m_pCheckBoxAudioOutput = new QCheckBox(m_pWidgetAudioSettings);
    297300                if (m_pCheckBoxAudioOutput)
    298301                    pLayoutAudioSettings->addWidget(m_pCheckBoxAudioOutput, 2, 1);
    299                 /* Prepare input check-box: */
     302                /* Prepare audio input check-box: */
    300303                m_pCheckBoxAudioInput = new QCheckBox(m_pWidgetAudioSettings);
    301304                if (m_pCheckBoxAudioInput)
    302305                    pLayoutAudioSettings->addWidget(m_pCheckBoxAudioInput, 3, 1);
    303 
    304                 pLayoutMain->addWidget(m_pWidgetAudioSettings, 1, 1, 1, 1);
    305             }
     306            }
     307
     308            pLayoutMain->addWidget(m_pWidgetAudioSettings, 1, 1);
    306309        }
    307310    }
     
    310313void UIMachineSettingsAudio::prepareConnections()
    311314{
    312     QObject::connect(m_pCheckBoxAudio, &QCheckBox::toggled, m_pWidgetAudioSettings, &QWidget::setEnabled);
     315    connect(m_pCheckBoxAudio, &QCheckBox::toggled, m_pWidgetAudioSettings, &QWidget::setEnabled);
    313316}
    314317
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.h

    r85883 r86045  
    9393        /** Holds the audio settings widget instance. */
    9494        QWidget                 *m_pWidgetAudioSettings;
    95         /** Holds the host audio driver label instance. */
    96         QLabel                  *m_pAudioHostDriverLabel;
    97         /** Holds the host audio driver editor instance. */
    98         UIAudioHostDriverEditor *m_pAudioHostDriverEditor;
    99         /** Holds the host audio controller label instance. */
    100         QLabel                  *m_pAudioControllerLabel;
    101         /** Holds the host audio controller instance instance. */
    102         UIAudioControllerEditor *m_pAudioControllerEditor;
     95        /** Holds the audio host driver label instance. */
     96        QLabel                  *m_pLabelAudioHostDriver;
     97        /** Holds the audio host driver editor instance. */
     98        UIAudioHostDriverEditor *m_pEditorAudioHostDriver;
     99        /** Holds the audio host controller label instance. */
     100        QLabel                  *m_pLabelAudioController;
     101        /** Holds the audio host controller instance instance. */
     102        UIAudioControllerEditor *m_pEditorAudioController;
    103103        /** Holds the audio extended label instance. */
    104104        QLabel                  *m_pLabelAudioExtended;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r85871 r86045  
    10801080    const CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties();
    10811081
    1082     /* Prepare Screen tab: */
     1082    /* Prepare 'Screen' tab: */
    10831083    m_pTabScreen = new QWidget;
    10841084    if (m_pTabScreen)
    10851085    {
    1086         /* Prepare Screen tab layout: */
     1086        /* Prepare 'Screen' tab layout: */
    10871087        QGridLayout *pLayoutScreen = new QGridLayout(m_pTabScreen);
    10881088        if (pLayoutScreen)
     
    11011101            if (m_pEditorVideoMemorySize)
    11021102            {
    1103                 m_pLabelVideoMemorySize->setBuddy(m_pEditorVideoMemorySize->focusProxy());
     1103                if (m_pLabelVideoMemorySize)
     1104                    m_pLabelVideoMemorySize->setBuddy(m_pEditorVideoMemorySize->focusProxy());
    11041105                pLayoutScreen->addWidget(m_pEditorVideoMemorySize, 0, 1, 2, 2);
    11051106            }
     
    11621163            if (m_pSpinboxMonitorCount)
    11631164            {
    1164                 m_pLabelMonitorCount->setBuddy(m_pSpinboxMonitorCount);
     1165                if (m_pLabelMonitorCount)
     1166                    m_pLabelMonitorCount->setBuddy(m_pSpinboxMonitorCount);
    11651167                m_pSpinboxMonitorCount->setMinimum(1);
    11661168                m_pSpinboxMonitorCount->setMaximum(comProperties.GetMaxGuestMonitors());
     
    11801182            if (m_pEditorScaleFactor)
    11811183            {
    1182                 m_pLabelScaleFactor->setBuddy(m_pEditorScaleFactor->focusProxy());
     1184                if (m_pLabelScaleFactor)
     1185                    m_pLabelScaleFactor->setBuddy(m_pEditorScaleFactor->focusProxy());
    11831186                pLayoutScreen->addWidget(m_pEditorScaleFactor, 4, 1, 2, 2);
    11841187            }
     
    11951198            if (m_pEditorGraphicsController)
    11961199            {
    1197                 m_pLabelGraphicsController->setBuddy(m_pEditorGraphicsController->focusProxy());
     1200                if (m_pLabelGraphicsController)
     1201                    m_pLabelGraphicsController->setBuddy(m_pEditorGraphicsController->focusProxy());
    11981202                pLayoutScreen->addWidget(m_pEditorGraphicsController, 6, 1, 1, 2);
    11991203            }
     
    12181222void UIMachineSettingsDisplay::prepareTabRemoteDisplay()
    12191223{
    1220     /* Prepare Remote Display tab: */
     1224    /* Prepare 'Remote Display' tab: */
    12211225    m_pTabRemoteDisplay = new QWidget;
    12221226    if (m_pTabRemoteDisplay)
    12231227    {
    1224         /* Prepare Remote Display tab layout: */
    1225         QGridLayout *pLayoutTabRemoteDisplay = new QGridLayout(m_pTabRemoteDisplay);
    1226         if (pLayoutTabRemoteDisplay)
     1228        /* Prepare 'Remote Display' tab layout: */
     1229        QGridLayout *pLayoutRemoteDisplay = new QGridLayout(m_pTabRemoteDisplay);
     1230        if (pLayoutRemoteDisplay)
    12271231        {
    1228             pLayoutTabRemoteDisplay->setRowStretch(2, 1);
     1232            pLayoutRemoteDisplay->setRowStretch(2, 1);
    12291233
    12301234            /* Prepare remote display check-box: */
    12311235            m_pCheckboxRemoteDisplay = new QCheckBox(m_pTabRemoteDisplay);
    12321236            if (m_pCheckboxRemoteDisplay)
    1233                 pLayoutTabRemoteDisplay->addWidget(m_pCheckboxRemoteDisplay, 0, 0, 1, 2);
     1237                pLayoutRemoteDisplay->addWidget(m_pCheckboxRemoteDisplay, 0, 0, 1, 2);
    12341238
    12351239            /* Prepare 20-px shifting spacer: */
    12361240            QSpacerItem *pSpacerItem = new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum);
    12371241            if (pSpacerItem)
    1238                 pLayoutTabRemoteDisplay->addItem(pSpacerItem, 1, 0);
     1242                pLayoutRemoteDisplay->addItem(pSpacerItem, 1, 0);
    12391243
    12401244            /* Prepare remote display settings widget: */
     
    12591263                    if (m_pEditorRemoteDisplayPort)
    12601264                    {
    1261                         m_pLabelRemoteDisplayPort->setBuddy(m_pEditorRemoteDisplayPort);
     1265                        if (m_pLabelRemoteDisplayPort)
     1266                            m_pLabelRemoteDisplayPort->setBuddy(m_pEditorRemoteDisplayPort);
    12621267                        m_pEditorRemoteDisplayPort->setValidator(new QRegExpValidator(
    12631268                            QRegExp("(([0-9]{1,5}(\\-[0-9]{1,5}){0,1}),)*([0-9]{1,5}(\\-[0-9]{1,5}){0,1})"), this));
     
    12771282                    if (m_pComboRemoteDisplayAuthMethod)
    12781283                    {
    1279                         m_pLabelRemoteDisplayAuthMethod->setBuddy(m_pComboRemoteDisplayAuthMethod);
     1284                        if (m_pLabelRemoteDisplayAuthMethod)
     1285                            m_pLabelRemoteDisplayAuthMethod->setBuddy(m_pComboRemoteDisplayAuthMethod);
    12801286                        m_pComboRemoteDisplayAuthMethod->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    12811287
     
    12941300                    if (m_pEditorRemoteDisplayTimeout)
    12951301                    {
    1296                         m_pLabelRemoteDisplayTimeout->setBuddy(m_pEditorRemoteDisplayTimeout);
     1302                        if (m_pLabelRemoteDisplayTimeout)
     1303                            m_pLabelRemoteDisplayTimeout->setBuddy(m_pEditorRemoteDisplayTimeout);
    12971304                        m_pEditorRemoteDisplayTimeout->setValidator(new QIntValidator(this));
    12981305
     
    13131320                }
    13141321
    1315                 pLayoutTabRemoteDisplay->addWidget(m_pWidgetRemoteDisplaySettings, 1, 1);
     1322                pLayoutRemoteDisplay->addWidget(m_pWidgetRemoteDisplaySettings, 1, 1);
    13161323            }
    13171324        }
     
    13231330void UIMachineSettingsDisplay::prepareTabRecording()
    13241331{
    1325     /* Prepare Recording tab: */
     1332    /* Prepare 'Recording' tab: */
    13261333    m_pTabRecording = new QWidget;
    13271334    if (m_pTabRecording)
    13281335    {
    1329         /* Prepare Recording tab layout: */
     1336        /* Prepare 'Recording' tab layout: */
    13301337        QGridLayout *pLayoutRecording = new QGridLayout(m_pTabRecording);
    13311338        if (pLayoutRecording)
     
    13641371                    if (m_pComboRecordingMode)
    13651372                    {
    1366                         m_pLabelRecordingMode->setBuddy(m_pComboRecordingMode);
     1373                        if (m_pLabelRecordingMode)
     1374                            m_pLabelRecordingMode->setBuddy(m_pComboRecordingMode);
    13671375                        m_pComboRecordingMode->insertItem(0, ""); /* UISettingsDefs::RecordingMode_VideoAudio */
    13681376                        m_pComboRecordingMode->insertItem(1, ""); /* UISettingsDefs::RecordingMode_VideoOnly */
     
    13831391                    if (m_pEditorRecordingFilePath)
    13841392                    {
    1385                         m_pLabelRecordingFilePath->setBuddy(m_pEditorRecordingFilePath->focusProxy());
     1393                        if (m_pLabelRecordingFilePath)
     1394                            m_pLabelRecordingFilePath->setBuddy(m_pEditorRecordingFilePath->focusProxy());
    13861395                        m_pEditorRecordingFilePath->setEditable(false);
    13871396                        m_pEditorRecordingFilePath->setMode(UIFilePathSelector::Mode_File_Save);
     
    14011410                    if (m_pComboRecordingFrameSize)
    14021411                    {
    1403                         m_pLabelRecordingFrameSize->setBuddy(m_pComboRecordingFrameSize);
     1412                        if (m_pLabelRecordingFrameSize)
     1413                            m_pLabelRecordingFrameSize->setBuddy(m_pComboRecordingFrameSize);
    14041414                        m_pComboRecordingFrameSize->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
    14051415                        m_pComboRecordingFrameSize->addItem(""); /* User Defined */
     
    15081518                    if (m_pSpinboxRecordingFrameRate)
    15091519                    {
    1510                         m_pLabelRecordingFrameRate->setBuddy(m_pSpinboxRecordingFrameRate);
     1520                        if (m_pLabelRecordingFrameRate)
     1521                            m_pLabelRecordingFrameRate->setBuddy(m_pSpinboxRecordingFrameRate);
    15111522                        uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxRecordingFrameRate, 3);
    15121523                        m_pSpinboxRecordingFrameRate->setMinimum(1);
     
    15811592                    if (m_pSpinboxRecordingVideoQuality)
    15821593                    {
    1583                         m_pLabelRecordingVideoQuality->setBuddy(m_pSpinboxRecordingVideoQuality);
     1594                        if (m_pLabelRecordingVideoQuality)
     1595                            m_pLabelRecordingVideoQuality->setBuddy(m_pSpinboxRecordingVideoQuality);
    15841596                        uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxRecordingVideoQuality, 5);
    15851597                        m_pSpinboxRecordingVideoQuality->setMinimum(VIDEO_CAPTURE_BIT_RATE_MIN);
     
    16101622                            if (m_pSliderRecordingAudioQuality)
    16111623                            {
    1612                                 m_pLabelRecordingAudioQuality->setBuddy(m_pSliderRecordingAudioQuality);
     1624                                if (m_pLabelRecordingAudioQuality)
     1625                                    m_pLabelRecordingAudioQuality->setBuddy(m_pSliderRecordingAudioQuality);
    16131626                                m_pSliderRecordingAudioQuality->setOrientation(Qt::Horizontal);
    16141627                                m_pSliderRecordingAudioQuality->setMinimum(1);
     
    16201633                                m_pSliderRecordingAudioQuality->setOptimalHint(1, 2);
    16211634                                m_pSliderRecordingAudioQuality->setWarningHint(2, 3);
     1635
    16221636                                pLayoutRecordingAudioQuality->addWidget(m_pSliderRecordingAudioQuality);
    16231637                            }
     
    16661680                    if (m_pScrollerRecordingScreens)
    16671681                    {
    1668                         m_pLabelRecordingScreens->setBuddy(m_pScrollerRecordingScreens);
     1682                        if (m_pLabelRecordingScreens)
     1683                            m_pLabelRecordingScreens->setBuddy(m_pScrollerRecordingScreens);
    16691684                        pLayoutRecordingSettings->addWidget(m_pScrollerRecordingScreens, 10, 1, 1, 3);
    16701685                    }
     
    17041719    connect(m_pCheckboxRecording, &QCheckBox::toggled,
    17051720            this, &UIMachineSettingsDisplay::sltHandleRecordingCheckboxToggle);
     1721    connect(m_pComboRecordingMode, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     1722            this, &UIMachineSettingsDisplay::sltHandleRecordingComboBoxChange);
    17061723    connect(m_pComboRecordingFrameSize, static_cast<void(QComboBox::*)(int)>(&QComboBox:: currentIndexChanged),
    17071724            this, &UIMachineSettingsDisplay::sltHandleRecordingVideoFrameSizeComboboxChange);
     
    17181735    connect(m_pSpinboxRecordingVideoQuality, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
    17191736            this, &UIMachineSettingsDisplay::sltHandleRecordingVideoBitRateEditorChange);
    1720 
    1721     connect(m_pComboRecordingMode, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
    1722                 this, &UIMachineSettingsDisplay::sltHandleRecordingComboBoxChange);
    17231737}
    17241738
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r85871 r86045  
    611611void UIMachineSettingsGeneral::prepareTabBasic()
    612612{
    613     /* Prepare Basic tab: */
     613    /* Prepare 'Basic' tab: */
    614614    m_pTabBasic = new QWidget;
    615615    if (m_pTabBasic)
    616616    {
    617         /* Prepare Basic tab layout: */
     617        /* Prepare 'Basic' tab layout: */
    618618        QVBoxLayout *pLayoutBasic = new QVBoxLayout(m_pTabBasic);
    619619        if (pLayoutBasic)
     
    637637void UIMachineSettingsGeneral::prepareTabAdvanced()
    638638{
    639     /* Prepare Advanced tab: */
     639    /* Prepare 'Advanced' tab: */
    640640    m_pTabAdvanced = new QWidget;
    641641    if (m_pTabAdvanced)
    642642    {
    643         /* Prepare Advanced tab layout: */
     643        /* Prepare 'Advanced' tab layout: */
    644644        QGridLayout *pLayoutAdvanced = new QGridLayout(m_pTabAdvanced);
    645645        if (pLayoutAdvanced)
     
    703703void UIMachineSettingsGeneral::prepareTabDescription()
    704704{
    705     /* Prepare Description tab: */
     705    /* Prepare 'Description' tab: */
    706706    m_pTabDescription = new QWidget;
    707707    if (m_pTabDescription)
    708708    {
    709         /* Prepare Description tab layout: */
     709        /* Prepare 'Description' tab layout: */
    710710        QVBoxLayout *pLayoutDescription = new QVBoxLayout(m_pTabDescription);
    711711        if (pLayoutDescription)
     
    731731void UIMachineSettingsGeneral::prepareTabEncryption()
    732732{
    733     /* Prepare Encryption tab: */
     733    /* Prepare 'Encryption' tab: */
    734734    m_pTabEncryption = new QWidget;
    735735    if (m_pTabEncryption)
    736736    {
    737         /* Prepare Encryption tab layout: */
     737        /* Prepare 'Encryption' tab layout: */
    738738        QGridLayout *pLayoutEncryption = new QGridLayout(m_pTabEncryption);
    739739        if (pLayoutEncryption)
     
    772772                    if (m_pComboCipher)
    773773                    {
     774                        if (m_pLabelCipher)
     775                            m_pLabelCipher->setBuddy(m_pComboCipher);
    774776                        m_encryptionCiphers << QString()
    775777                                            << "AES-XTS256-PLAIN64"
    776778                                            << "AES-XTS128-PLAIN64";
    777779                        m_pComboCipher->addItems(m_encryptionCiphers);
    778                         if (m_pLabelCipher)
    779                             m_pLabelCipher->setBuddy(m_pComboCipher);
    780780                        m_pLayoutEncryptionSettings->addWidget(m_pComboCipher, 0, 1);
    781781                    }
     
    792792                    if (m_pEditorEncryptionPassword)
    793793                    {
    794                         m_pEditorEncryptionPassword->setEchoMode(QLineEdit::Password);
    795794                        if (m_pLabelEncryptionPassword)
    796795                            m_pLabelEncryptionPassword->setBuddy(m_pEditorEncryptionPassword);
     796                        m_pEditorEncryptionPassword->setEchoMode(QLineEdit::Password);
    797797                        m_pLayoutEncryptionSettings->addWidget(m_pEditorEncryptionPassword, 1, 1);
    798798                    }
     
    809809                    if (m_pEditorEncryptionPasswordConfirm)
    810810                    {
    811                         m_pEditorEncryptionPasswordConfirm->setEchoMode(QLineEdit::Password);
    812811                        if (m_pLabelEncryptionPasswordConfirm)
    813812                            m_pLabelEncryptionPasswordConfirm->setBuddy(m_pEditorEncryptionPasswordConfirm);
     813                        m_pEditorEncryptionPasswordConfirm->setEchoMode(QLineEdit::Password);
    814814                        m_pLayoutEncryptionSettings->addWidget(m_pEditorEncryptionPasswordConfirm, 2, 1);
    815815                    }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.cpp

    r85972 r86045  
    149149    , m_pLabelMiniToolBar(0)
    150150    , m_pCheckBoxShowMiniToolBar(0)
    151     , m_pCheckBoxToolBarAlignment(0)
     151    , m_pCheckBoxMiniToolBarAlignment(0)
    152152    , m_pEditorStatusBar(0)
    153153{
     
    238238#ifndef VBOX_WS_MAC
    239239    m_pCheckBoxShowMiniToolBar->setChecked(oldInterfaceData.m_fShowMiniToolBar);
    240     m_pCheckBoxToolBarAlignment->setChecked(oldInterfaceData.m_fMiniToolBarAtTop);
     240    m_pCheckBoxMiniToolBarAlignment->setChecked(oldInterfaceData.m_fMiniToolBarAtTop);
    241241#endif
    242242    m_pEditorVisualState->setMachineId(m_machine.GetId());
     
    277277#ifndef VBOX_WS_MAC
    278278    newInterfaceData.m_fShowMiniToolBar = m_pCheckBoxShowMiniToolBar->isChecked();
    279     newInterfaceData.m_fMiniToolBarAtTop = m_pCheckBoxToolBarAlignment->isChecked();
     279    newInterfaceData.m_fMiniToolBarAtTop = m_pCheckBoxMiniToolBarAlignment->isChecked();
    280280#endif
    281281    newInterfaceData.m_enmVisualState = m_pEditorVisualState->value();
     
    306306    m_pCheckBoxShowMiniToolBar->setWhatsThis(tr("When checked, show the Mini ToolBar in full-screen and seamless modes."));
    307307    m_pCheckBoxShowMiniToolBar->setText(tr("Show in &Full-screen/Seamless"));
    308     m_pCheckBoxToolBarAlignment->setWhatsThis(tr("When checked, show the Mini ToolBar at the top of the screen, rather than in its"
     308    m_pCheckBoxMiniToolBarAlignment->setWhatsThis(tr("When checked, show the Mini ToolBar at the top of the screen, rather than in its"
    309309                                              "default position at the bottom of the screen."));
    310     m_pCheckBoxToolBarAlignment->setText(tr("Show at &Top of Screen"));
     310    m_pCheckBoxMiniToolBarAlignment->setText(tr("Show at &Top of Screen"));
    311311    m_pEditorStatusBar->setWhatsThis(tr("Allows to modify VM status-bar contents."));
    312312}
     
    319319    m_pLabelMiniToolBar->hide();
    320320    m_pCheckBoxShowMiniToolBar->hide();
    321     m_pCheckBoxToolBarAlignment->hide();
     321    m_pCheckBoxMiniToolBarAlignment->hide();
    322322#else /* !VBOX_WS_MAC */
    323323    m_pLabelMiniToolBar->setEnabled(isMachineInValidMode());
    324324    m_pCheckBoxShowMiniToolBar->setEnabled(isMachineInValidMode());
    325     m_pCheckBoxToolBarAlignment->setEnabled(isMachineInValidMode() && m_pCheckBoxShowMiniToolBar->isChecked());
     325    m_pCheckBoxMiniToolBarAlignment->setEnabled(isMachineInValidMode() && m_pCheckBoxShowMiniToolBar->isChecked());
    326326#endif /* !VBOX_WS_MAC */
    327327    m_pEditorStatusBar->setEnabled(isMachineInValidMode());
     
    361361            m_pEditorMenuBar->setMachineID(m_uMachineId);
    362362
    363             pLayoutMain->addWidget(m_pEditorMenuBar, 0, 0, 1, 2);
     363            pLayoutMain->addWidget(m_pEditorMenuBar, 0, 0, 1, 3);
    364364        }
    365365
     
    383383            pLayoutMain->addWidget(m_pLabelMiniToolBar, 2, 0);
    384384        }
    385         /* Prepare show mini-toolbar check-box: */
     385        /* Prepare 'show mini-toolbar' check-box: */
    386386        m_pCheckBoxShowMiniToolBar = new QCheckBox(this);
    387387        if (m_pCheckBoxShowMiniToolBar)
    388388            pLayoutMain->addWidget(m_pCheckBoxShowMiniToolBar, 2, 1);
    389         /* Prepare mini-toolbar alignment check-box: */
    390         m_pCheckBoxToolBarAlignment = new QCheckBox(this);
    391         if (m_pCheckBoxToolBarAlignment)
    392             pLayoutMain->addWidget(m_pCheckBoxToolBarAlignment, 3, 1);
     389        /* Prepare 'mini-toolbar alignment' check-box: */
     390        m_pCheckBoxMiniToolBarAlignment = new QCheckBox(this);
     391        if (m_pCheckBoxMiniToolBarAlignment)
     392            pLayoutMain->addWidget(m_pCheckBoxMiniToolBarAlignment, 3, 1);
    393393
    394394        /* Prepare status-bar editor: */
     
    397397        {
    398398            m_pEditorStatusBar->setMachineID(m_uMachineId);
    399             pLayoutMain->addWidget(m_pEditorStatusBar, 5, 0, 1, 2);
     399            pLayoutMain->addWidget(m_pEditorStatusBar, 5, 0, 1, 3);
    400400        }
    401401    }
     
    405405{
    406406    connect(m_pCheckBoxShowMiniToolBar, &QCheckBox::toggled,
    407             m_pCheckBoxToolBarAlignment, &UIMachineSettingsInterface::setEnabled);
     407            m_pCheckBoxMiniToolBarAlignment, &UIMachineSettingsInterface::setEnabled);
    408408}
    409409
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.h

    r85972 r86045  
    112112        /** Holds the mini-toolbar label instance. */
    113113        QLabel                  *m_pLabelMiniToolBar;
    114         /** Holds the show mini-toolbar check-box instance. */
     114        /** Holds the 'show mini-toolbar' check-box instance. */
    115115        QCheckBox               *m_pCheckBoxShowMiniToolBar;
    116         /** Holds the mini-toolbar alignment check-box instance. */
    117         QCheckBox               *m_pCheckBoxToolBarAlignment;
     116        /** Holds the 'mini-toolbar alignment' check-box instance. */
     117        QCheckBox               *m_pCheckBoxMiniToolBarAlignment;
    118118        /** Holds the status-bar editor instance. */
    119119        UIStatusBarEditorWidget *m_pEditorStatusBar;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp

    r85958 r86045  
    787787                if (m_pEditorAttachmentType)
    788788                {
    789                     m_pLabelAttachmentType->setBuddy(m_pEditorAttachmentType->focusProxy1());
    790                     m_pLabelAdapterName->setBuddy(m_pEditorAttachmentType->focusProxy2());
     789                    if (m_pLabelAttachmentType)
     790                        m_pLabelAttachmentType->setBuddy(m_pEditorAttachmentType->focusProxy1());
     791                    if (m_pLabelAdapterName)
     792                        m_pLabelAdapterName->setBuddy(m_pEditorAttachmentType->focusProxy2());
     793
    791794                    pLayoutAdapterSettings->addWidget(m_pEditorAttachmentType, 0, 1, 2, 3);
    792795                }
    793796
    794                 /* Prepare advanced arraow button: */
     797                /* Prepare advanced arrow button: */
    795798                m_pButtonAdvanced = new QIArrowButtonSwitch(m_pWidgetAdapterSettings);
    796799                if (m_pButtonAdvanced)
     
    816819                if (m_pComboAdapterType)
    817820                {
    818                     m_pLabelAdapterType->setBuddy(m_pComboAdapterType);
     821                    if (m_pLabelAdapterType)
     822                        m_pLabelAdapterType->setBuddy(m_pComboAdapterType);
    819823                    pLayoutAdapterSettings->addWidget(m_pComboAdapterType, 3, 1, 1, 3);
    820824                }
     
    831835                if (m_pComboPromiscuousMode)
    832836                {
    833                     m_pLabelPromiscuousMode->setBuddy(m_pComboPromiscuousMode);
     837                    if (m_pLabelPromiscuousMode)
     838                        m_pLabelPromiscuousMode->setBuddy(m_pComboPromiscuousMode);
    834839                    pLayoutAdapterSettings->addWidget(m_pComboPromiscuousMode, 4, 1, 1, 3);
    835840                }
     
    846851                if (m_pEditorMAC)
    847852                {
    848                     m_pLabelMAC->setBuddy(m_pEditorMAC);
     853                    if (m_pLabelMAC)
     854                        m_pLabelMAC->setBuddy(m_pEditorMAC);
    849855                    m_pEditorMAC->setValidator(new QRegExpValidator(QRegExp("[0-9A-Fa-f]{12}"), this));
    850856                    m_pEditorMAC->setMinimumWidthByText(QString().fill('0', 12));
     
    875881                m_pCheckBoxCableConnected = new QCheckBox(m_pWidgetAdapterSettings);
    876882                if (m_pCheckBoxCableConnected)
    877                     pLayoutAdapterSettings->addWidget(m_pCheckBoxCableConnected, 7, 1, 1, 3);
     883                    pLayoutAdapterSettings->addWidget(m_pCheckBoxCableConnected, 7, 1, 1, 2);
    878884
    879885                /* Prepare port forwarding button: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.cpp

    r85959 r86045  
    283283    , m_pLayoutTree(0)
    284284    , m_pTreeWidget(0)
    285     , m_pToolBar(0)
     285    , m_pToolbar(0)
    286286    , m_pActionAdd(0)
    287287    , m_pActionEdit(0)
     
    450450    /* Polish shared folders page availability: */
    451451    m_pLabelSeparator->setEnabled(isMachineInValidMode());
    452     m_pToolBar->setEnabled(isMachineInValidMode());
    453     m_pToolBar->setEnabled(isMachineInValidMode());
     452    m_pToolbar->setEnabled(isMachineInValidMode());
     453    m_pToolbar->setEnabled(isMachineInValidMode());
    454454
    455455    /* Update root items visibility: */
     
    711711    if (pLayoutMain)
    712712    {
    713         pLayoutMain->setContentsMargins(0, 0, 0, 0);
    714 
    715713        /* Prepare separator: */
    716714        m_pLabelSeparator = new QILabelSeparator(this);
     
    756754{
    757755    /* Prepare shared folders toolbar: */
    758     m_pToolBar = new UIToolBar(this);
    759     if (m_pToolBar)
     756    m_pToolbar = new UIToolBar(this);
     757    if (m_pToolbar)
    760758    {
    761759        const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
    762         m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric));
    763         m_pToolBar->setOrientation(Qt::Vertical);
    764 
    765         /* Prepare 'Add Shared Folder' action: */
    766         m_pActionAdd = m_pToolBar->addAction(UIIconPool::iconSet(":/sf_add_16px.png",
    767                                                                         ":/sf_add_disabled_16px.png"),
    768                                                     QString(), this, SLOT(sltAddFolder()));
     760        m_pToolbar->setIconSize(QSize(iIconMetric, iIconMetric));
     761        m_pToolbar->setOrientation(Qt::Vertical);
     762
     763        /* Prepare 'add shared folder' action: */
     764        m_pActionAdd = m_pToolbar->addAction(UIIconPool::iconSet(":/sf_add_16px.png",
     765                                                                 ":/sf_add_disabled_16px.png"),
     766                                             QString(), this, SLOT(sltAddFolder()));
    769767        if (m_pActionAdd)
    770768            m_pActionAdd->setShortcuts(QList<QKeySequence>() << QKeySequence("Ins") << QKeySequence("Ctrl+N"));
    771769
    772         /* Prepare 'Edit Shared Folder' action: */
    773         m_pActionEdit = m_pToolBar->addAction(UIIconPool::iconSet(":/sf_edit_16px.png",
    774                                                                          ":/sf_edit_disabled_16px.png"),
    775                                                      QString(), this, SLOT(sltEditFolder()));
     770        /* Prepare 'edit shared folder' action: */
     771        m_pActionEdit = m_pToolbar->addAction(UIIconPool::iconSet(":/sf_edit_16px.png",
     772                                                                  ":/sf_edit_disabled_16px.png"),
     773                                              QString(), this, SLOT(sltEditFolder()));
    776774        if (m_pActionEdit)
    777775            m_pActionEdit->setShortcuts(QList<QKeySequence>() << QKeySequence("Space") << QKeySequence("F2"));
    778776
    779         /* Prepare 'Remove Shared Folder' action: */
    780         m_pActionRemove = m_pToolBar->addAction(UIIconPool::iconSet(":/sf_remove_16px.png",
    781                                                                            ":/sf_remove_disabled_16px.png"),
    782                                                        QString(), this, SLOT(sltRemoveFolder()));
     777        /* Prepare 'remove shared folder' action: */
     778        m_pActionRemove = m_pToolbar->addAction(UIIconPool::iconSet(":/sf_remove_16px.png",
     779                                                                    ":/sf_remove_disabled_16px.png"),
     780                                                QString(), this, SLOT(sltRemoveFolder()));
    783781        if (m_pActionRemove)
    784782            m_pActionRemove->setShortcuts(QList<QKeySequence>() << QKeySequence("Del") << QKeySequence("Ctrl+R"));
    785783
    786         m_pLayoutTree->addWidget(m_pToolBar);
     784        m_pLayoutTree->addWidget(m_pToolbar);
    787785    }
    788786}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSF.h

    r85959 r86045  
    163163        QITreeWidget     *m_pTreeWidget;
    164164        /** Holds the toolbar instance. */
    165         UIToolBar        *m_pToolBar;
    166         /** Holds the Add action instance. */
     165        UIToolBar        *m_pToolbar;
     166        /** Holds the 'add shared folder' action instance. */
    167167        QAction          *m_pActionAdd;
    168         /** Holds the Edit action instance. */
     168        /** Holds the 'edit shared folder' action instance. */
    169169        QAction          *m_pActionEdit;
    170         /** Holds the Remove action instance. */
     170        /** Holds the 'remove shared folder' action instance. */
    171171        QAction          *m_pActionRemove;
    172172    /** @} */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.cpp

    r85961 r86045  
    4646    , m_pLabelAutoMountPoint(0)
    4747    , m_pEditorAutoMountPoint(0)
    48     , m_pReadonlyCheckBox(0)
    49     , m_pAutoMountCheckBox(0)
    50     , m_pPermanentCheckBox(0)
     48    , m_pCheckBoxReadonly(0)
     49    , m_pCheckBoxAutoMount(0)
     50    , m_pCheckBoxPermanent(0)
    5151    , m_pButtonBox(0)
    5252{
     
    7676void UIMachineSettingsSFDetails::setWriteable(bool fWritable)
    7777{
    78     m_pReadonlyCheckBox->setChecked(!fWritable);
     78    m_pCheckBoxReadonly->setChecked(!fWritable);
    7979}
    8080
    8181bool UIMachineSettingsSFDetails::isWriteable() const
    8282{
    83     return !m_pReadonlyCheckBox->isChecked();
     83    return !m_pCheckBoxReadonly->isChecked();
    8484}
    8585
    8686void UIMachineSettingsSFDetails::setAutoMount(bool fAutoMount)
    8787{
    88     m_pAutoMountCheckBox->setChecked(fAutoMount);
     88    m_pCheckBoxAutoMount->setChecked(fAutoMount);
    8989}
    9090
    9191bool UIMachineSettingsSFDetails::isAutoMounted() const
    9292{
    93     return m_pAutoMountCheckBox->isChecked();
     93    return m_pCheckBoxAutoMount->isChecked();
    9494}
    9595
     
    106106void UIMachineSettingsSFDetails::setPermanent(bool fPermanent)
    107107{
    108     m_pPermanentCheckBox->setChecked(fPermanent);
     108    m_pCheckBoxPermanent->setChecked(fPermanent);
    109109}
    110110
    111111bool UIMachineSettingsSFDetails::isPermanent() const
    112112{
    113     return m_fUsePermanent ? m_pPermanentCheckBox->isChecked() : true;
     113    return m_fUsePermanent ? m_pCheckBoxPermanent->isChecked() : true;
    114114}
    115115
     
    119119    m_pLabelName->setText(tr("Folder Name:"));
    120120    m_pEditorName->setToolTip(tr("Holds the name of the shared folder (as it will be seen by the guest OS)."));
    121     m_pReadonlyCheckBox->setToolTip(tr("When checked, the guest OS will not be able to write to the specified shared folder."));
    122     m_pReadonlyCheckBox->setText(tr("&Read-only"));
    123     m_pAutoMountCheckBox->setToolTip(tr("When checked, the guest OS will try to automatically mount the shared folder on startup."));
    124     m_pAutoMountCheckBox->setText(tr("&Auto-mount"));
     121    m_pCheckBoxReadonly->setToolTip(tr("When checked, the guest OS will not be able to write to the specified shared folder."));
     122    m_pCheckBoxReadonly->setText(tr("&Read-only"));
     123    m_pCheckBoxAutoMount->setToolTip(tr("When checked, the guest OS will try to automatically mount the shared folder on startup."));
     124    m_pCheckBoxAutoMount->setText(tr("&Auto-mount"));
    125125    m_pLabelAutoMountPoint->setText(tr("Mount point:"));
    126126    m_pEditorAutoMountPoint->setToolTip(tr("Where to automatically mount the folder in the guest.  A drive letter (e.g. 'G:') for Windows and OS/2 guests, path for the others.  If left empty the guest will pick something fitting."));
    127     m_pPermanentCheckBox->setToolTip(tr("When checked, this shared folder will be permanent."));
    128     m_pPermanentCheckBox->setText(tr("&Make Permanent"));
     127    m_pCheckBoxPermanent->setToolTip(tr("When checked, this shared folder will be permanent."));
     128    m_pCheckBoxPermanent->setText(tr("&Make Permanent"));
    129129
    130130    switch (m_type)
     
    255255
    256256        /* Prepare read-only check-box: */
    257         m_pReadonlyCheckBox = new QCheckBox;
    258         if (m_pReadonlyCheckBox)
    259             pLayoutMain->addWidget(m_pReadonlyCheckBox, 3, 1);
     257        m_pCheckBoxReadonly = new QCheckBox;
     258        if (m_pCheckBoxReadonly)
     259            pLayoutMain->addWidget(m_pCheckBoxReadonly, 3, 1);
    260260        /* Prepare auto-mount check-box: */
    261         m_pAutoMountCheckBox = new QCheckBox;
    262         if (m_pAutoMountCheckBox)
    263             pLayoutMain->addWidget(m_pAutoMountCheckBox, 4, 1);
     261        m_pCheckBoxAutoMount = new QCheckBox;
     262        if (m_pCheckBoxAutoMount)
     263            pLayoutMain->addWidget(m_pCheckBoxAutoMount, 4, 1);
    264264        /* Prepare permanent check-box: */
    265         m_pPermanentCheckBox = new QCheckBox;
    266         if (m_pPermanentCheckBox)
    267         {
    268             m_pPermanentCheckBox->setHidden(!m_fUsePermanent);
    269             pLayoutMain->addWidget(m_pPermanentCheckBox, 5, 1);
     265        m_pCheckBoxPermanent = new QCheckBox;
     266        if (m_pCheckBoxPermanent)
     267        {
     268            m_pCheckBoxPermanent->setHidden(!m_fUsePermanent);
     269            pLayoutMain->addWidget(m_pCheckBoxPermanent, 5, 1);
    270270        }
    271271
     
    287287    connect(m_pEditorName, &QLineEdit::textChanged, this, &UIMachineSettingsSFDetails::sltValidate);
    288288    if (m_fUsePermanent)
    289         connect(m_pPermanentCheckBox, &QCheckBox::toggled, this, &UIMachineSettingsSFDetails::sltValidate);
     289        connect(m_pCheckBoxPermanent, &QCheckBox::toggled, this, &UIMachineSettingsSFDetails::sltValidate);
    290290    connect(m_pButtonBox, &QIDialogButtonBox::accepted, this, &UIMachineSettingsSFDetails::accept);
    291291    connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIMachineSettingsSFDetails::reject);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSFDetails.h

    r85961 r86045  
    107107        QLineEdit          *m_pEditorAutoMountPoint;
    108108        /** Holds the read-only check-box instance. */
    109         QCheckBox          *m_pReadonlyCheckBox;
     109        QCheckBox          *m_pCheckBoxReadonly;
    110110        /** Holds the auto-mount check-box instance. */
    111         QCheckBox          *m_pAutoMountCheckBox;
     111        QCheckBox          *m_pCheckBoxAutoMount;
    112112        /** Holds the permanent check-box instance. */
    113         QCheckBox          *m_pPermanentCheckBox;
     113        QCheckBox          *m_pCheckBoxPermanent;
    114114        /** Holds the button-box instance. */
    115115        QIDialogButtonBox  *m_pButtonBox;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp

    r85958 r86045  
    414414                if (m_pComboNumber)
    415415                {
    416                     m_pLabelNumber->setBuddy(m_pComboNumber);
     416                    if (m_pLabelNumber)
     417                        m_pLabelNumber->setBuddy(m_pComboNumber);
    417418                    m_pComboNumber->insertItem(0, uiCommon().toCOMPortName(0, 0));
    418419                    m_pComboNumber->insertItems(0, uiCommon().COMPortNames());
     
    427428                if (m_pLineEditIRQ)
    428429                {
    429                     m_pLabelIRQ->setBuddy(m_pLineEditIRQ);
     430                    if (m_pLabelIRQ)
     431                        m_pLabelIRQ->setBuddy(m_pLineEditIRQ);
    430432                    m_pLineEditIRQ->setFixedWidth(m_pLineEditIRQ->fontMetrics().width("8888"));
    431433                    m_pLineEditIRQ->setValidator(new QIULongValidator(0, 255, this));
     
    440442                if (m_pLineEditIOPort)
    441443                {
    442                     m_pLabelIOPort->setBuddy(m_pLineEditIOPort);
     444                    if (m_pLabelIOPort)
     445                        m_pLabelIOPort->setBuddy(m_pLineEditIOPort);
    443446                    m_pLineEditIOPort->setFixedWidth(m_pLineEditIOPort->fontMetrics().width("8888888"));
    444447                    m_pLineEditIOPort->setValidator(new QIULongValidator(0, 0xFFFF, this));
     
    457460                if (m_pComboMode)
    458461                {
    459                     m_pLabelMode->setBuddy(m_pComboMode);
     462                    if (m_pLabelMode)
     463                        m_pLabelMode->setBuddy(m_pComboMode);
    460464                    pLayoutPortSettings->addWidget(m_pComboMode, 1, 1);
    461465                }
     
    477481                if (m_pEditorPath)
    478482                {
    479                     m_pLabelPath->setBuddy(m_pEditorPath);
     483                    if (m_pLabelPath)
     484                        m_pLabelPath->setBuddy(m_pEditorPath);
    480485                    m_pEditorPath->setValidator(new QRegExpValidator(QRegExp(".+"), this));
    481486                    pLayoutPortSettings->addWidget(m_pEditorPath, 3, 1, 1, 6);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp

    r85872 r86045  
    29452945UIMachineSettingsStorage::UIMachineSettingsStorage()
    29462946    : m_pModelStorage(0)
    2947     , m_pActionAddController(0), m_pActionRemoveController(0)
    2948     , m_pActionAddAttachment(0), m_pActionRemoveAttachment(0)
    2949     , m_pActionAddAttachmentHD(0), m_pActionAddAttachmentCD(0), m_pActionAddAttachmentFD(0)
    29502947    , m_pMediumIdHolder(new UIMediumIDHolder(this))
    29512948    , m_fLoadingInProgress(0)
     
    29542951    , m_pWidgetLeftPane(0)
    29552952    , m_pLabelSeparatorLeftPane(0)
    2956     , m_pLayoutTreeView(0)
    2957     , m_pTreeStorage(0)
    2958     , m_pLayoutToolBar(0)
    2959     , m_pToolBar(0)
     2953    , m_pLayoutTree(0)
     2954    , m_pTreeViewStorage(0)
     2955    , m_pLayoutToolbar(0)
     2956    , m_pToolbar(0)
     2957    , m_pActionAddController(0)
     2958    , m_pActionRemoveController(0)
     2959    , m_pActionAddAttachment(0)
     2960    , m_pActionRemoveAttachment(0)
     2961    , m_pActionAddAttachmentHD(0)
     2962    , m_pActionAddAttachmentCD(0)
     2963    , m_pActionAddAttachmentFD(0)
    29602964    , m_pStackRightPane(0)
    29612965    , m_pLabelSeparatorEmpty(0)
     
    29672971    , m_pComboType(0)
    29682972    , m_pLabelPortCount(0)
    2969     , m_pSpinBoxPortCount(0)
     2973    , m_pSpinboxPortCount(0)
    29702974    , m_pCheckBoxIoCache(0)
    29712975    , m_pLabelSeparatorAttributes(0)
     
    31663170    /* Choose first controller as current: */
    31673171    if (m_pModelStorage->rowCount(m_pModelStorage->root()) > 0)
    3168         m_pTreeStorage->setCurrentIndex(m_pModelStorage->index(0, 0, m_pModelStorage->root()));
     3172        m_pTreeViewStorage->setCurrentIndex(m_pModelStorage->index(0, 0, m_pModelStorage->root()));
    31693173
    31703174    /* Fetch recent information: */
     
    33563360    m_pComboType->setWhatsThis(tr("Selects the sub-type of the storage controller currently selected in the Storage Tree."));
    33573361    m_pLabelPortCount->setText(tr("&Port Count:"));
    3358     m_pSpinBoxPortCount->setWhatsThis(tr("Selects the port count of the SATA storage controller currently selected in the"
     3362    m_pSpinboxPortCount->setWhatsThis(tr("Selects the port count of the SATA storage controller currently selected in the"
    33593363                                         "Storage Tree. This must be at least one more than the highest port number you need to use."));
    33603364    m_pCheckBoxIoCache->setWhatsThis(tr("When checked, allows to use host I/O caching capabilities."));
     
    33863390
    33873391    /* Translate storage-view: */
    3388     m_pTreeStorage->setWhatsThis(tr("Lists all storage controllers for this machine and "
     3392    m_pTreeViewStorage->setWhatsThis(tr("Lists all storage controllers for this machine and "
    33893393                                    "the virtual images and host drives attached to them."));
    33903394
     
    34283432{
    34293433    /* Declare required variables: */
    3430     const QModelIndex index = m_pTreeStorage->currentIndex();
     3434    const QModelIndex index = m_pTreeViewStorage->currentIndex();
    34313435    const KDeviceType enmDeviceType = m_pModelStorage->data(index, StorageModel::R_AttDevice).value<KDeviceType>();
    34323436
    34333437    /* Polish left pane availability: */
    34343438    m_pLabelSeparatorLeftPane->setEnabled(isMachineInValidMode());
    3435     m_pTreeStorage->setEnabled(isMachineInValidMode());
     3439    m_pTreeViewStorage->setEnabled(isMachineInValidMode());
    34363440
    34373441    /* Polish empty information pane availability: */
     
    34463450    m_pComboType->setEnabled(isMachineOffline());
    34473451    m_pLabelPortCount->setEnabled(isMachineOffline());
    3448     m_pSpinBoxPortCount->setEnabled(isMachineOffline());
     3452    m_pSpinboxPortCount->setEnabled(isMachineOffline());
    34493453    m_pCheckBoxIoCache->setEnabled(isMachineOffline());
    34503454
     
    36043608void UIMachineSettingsStorage::sltRemoveController()
    36053609{
    3606     const QModelIndex index = m_pTreeStorage->currentIndex();
     3610    const QModelIndex index = m_pTreeViewStorage->currentIndex();
    36073611    if (!m_pModelStorage->data(index, StorageModel::R_IsController).toBool())
    36083612        return;
     
    36173621void UIMachineSettingsStorage::sltAddAttachment()
    36183622{
    3619     const QModelIndex index = m_pTreeStorage->currentIndex();
     3623    const QModelIndex index = m_pTreeViewStorage->currentIndex();
    36203624    Assert(m_pModelStorage->data(index, StorageModel::R_IsController).toBool());
    36213625
     
    36713675void UIMachineSettingsStorage::sltRemoveAttachment()
    36723676{
    3673     const QModelIndex index = m_pTreeStorage->currentIndex();
     3677    const QModelIndex index = m_pTreeViewStorage->currentIndex();
    36743678
    36753679    const KDeviceType enmDeviceType = m_pModelStorage->data(index, StorageModel::R_AttDevice).value<KDeviceType>();
     
    37003704    m_fLoadingInProgress = true;
    37013705
    3702     const QModelIndex index = m_pTreeStorage->currentIndex();
     3706    const QModelIndex index = m_pTreeViewStorage->currentIndex();
    37033707    if (!index.isValid() || index == m_pModelStorage->root())
    37043708    {
     
    37383742                const KStorageBus enmBus = m_pModelStorage->data(index, StorageModel::R_CtrBusType).value<KStorageBus>();
    37393743                m_pLabelPortCount->setVisible(enmBus == KStorageBus_SATA || enmBus == KStorageBus_SAS);
    3740                 m_pSpinBoxPortCount->setVisible(enmBus == KStorageBus_SATA || enmBus == KStorageBus_SAS);
     3744                m_pSpinboxPortCount->setVisible(enmBus == KStorageBus_SATA || enmBus == KStorageBus_SAS);
    37413745                const uint uPortCount = m_pModelStorage->data(index, StorageModel::R_CtrPortCount).toUInt();
    37423746                const uint uMaxPortCount = m_pModelStorage->data(index, StorageModel::R_CtrMaxPortCount).toUInt();
    3743                 m_pSpinBoxPortCount->setMaximum(uMaxPortCount);
    3744                 m_pSpinBoxPortCount->setValue(uPortCount);
     3747                m_pSpinboxPortCount->setMaximum(uMaxPortCount);
     3748                m_pSpinboxPortCount->setValue(uPortCount);
    37453749
    37463750                const bool fUseIoCache = m_pModelStorage->data(index, StorageModel::R_CtrIoCache).toBool();
     
    38533857void UIMachineSettingsStorage::sltSetInformation()
    38543858{
    3855     const QModelIndex index = m_pTreeStorage->currentIndex();
     3859    const QModelIndex index = m_pTreeViewStorage->currentIndex();
    38563860    if (m_fLoadingInProgress || !index.isValid() || index == m_pModelStorage->root())
    38573861        return;
     
    38773881                                             StorageModel::R_CtrType);
    38783882            }
    3879             else if (pSender == m_pSpinBoxPortCount)
    3880                 m_pModelStorage->setData(index, m_pSpinBoxPortCount->value(), StorageModel::R_CtrPortCount);
     3883            else if (pSender == m_pSpinboxPortCount)
     3884                m_pModelStorage->setData(index, m_pSpinboxPortCount->value(), StorageModel::R_CtrPortCount);
    38813885            else if (pSender == m_pCheckBoxIoCache)
    38823886                m_pModelStorage->setData(index, m_pCheckBoxIoCache->isChecked(), StorageModel::R_CtrIoCache);
     
    38933897                QModelIndex theSameIndexAtNewPosition = m_pModelStorage->attachmentBySlot(controllerIndex, attachmentStorageSlot);
    38943898                AssertMsg(theSameIndexAtNewPosition.isValid(), ("Current attachment disappears!\n"));
    3895                 m_pTreeStorage->setCurrentIndex(theSameIndexAtNewPosition);
     3899                m_pTreeViewStorage->setCurrentIndex(theSameIndexAtNewPosition);
    38963900            }
    38973901            /* Setting Attachment Medium: */
     
    40544058void UIMachineSettingsStorage::sltUpdateActionStates()
    40554059{
    4056     const QModelIndex index = m_pTreeStorage->currentIndex();
     4060    const QModelIndex index = m_pTreeViewStorage->currentIndex();
    40574061
    40584062    const bool fIDEPossible = m_pModelStorage->data(index, StorageModel::R_IsMoreIDEControllersPossible).toBool();
     
    41094113        {
    41104114            /* Select the newly created Controller Item: */
    4111             m_pTreeStorage->setCurrentIndex(index);
     4115            m_pTreeViewStorage->setCurrentIndex(index);
    41124116            break;
    41134117        }
     
    41154119        {
    41164120            /* Expand parent if it is not expanded yet: */
    4117             if (!m_pTreeStorage->isExpanded(parentIndex))
    4118                 m_pTreeStorage->setExpanded(parentIndex, true);
     4121            if (!m_pTreeViewStorage->isExpanded(parentIndex))
     4122                m_pTreeViewStorage->setExpanded(parentIndex, true);
    41194123            break;
    41204124        }
     
    41304134{
    41314135    if (m_pModelStorage->rowCount (m_pModelStorage->root()) == 0)
    4132         m_pTreeStorage->setCurrentIndex (m_pModelStorage->root());
     4136        m_pTreeViewStorage->setCurrentIndex (m_pModelStorage->root());
    41334137
    41344138    sltUpdateActionStates();
     
    41474151    m_mousePressPosition = QPoint();
    41484152
    4149     const QModelIndex index = m_pTreeStorage->indexAt(position);
     4153    const QModelIndex index = m_pTreeViewStorage->indexAt(position);
    41504154    if (!index.isValid())
    41514155        return sltAddController();
     
    41864190    }
    41874191    if (!menu.isEmpty())
    4188         menu.exec(m_pTreeStorage->viewport()->mapToGlobal(position));
     4192        menu.exec(m_pTreeViewStorage->viewport()->mapToGlobal(position));
    41894193}
    41904194
     
    41964200    pPainter->save();
    41974201    QStyleOption options;
    4198     options.initFrom(m_pTreeStorage);
     4202    options.initFrom(m_pTreeViewStorage);
    41994203    options.rect = rect;
    42004204    options.state |= QStyle::State_Item;
     
    42164220    AssertPtrReturnVoid(pEvent);
    42174221
    4218     const QModelIndex index = m_pTreeStorage->indexAt(pEvent->pos());
    4219     const QRect indexRect = m_pTreeStorage->visualRect(index);
     4222    const QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos());
     4223    const QRect indexRect = m_pTreeViewStorage->visualRect(index);
    42204224
    42214225    /* Expander tool-tip: */
     
    42354239    /* Adder tool-tip: */
    42364240    if (m_pModelStorage->data(index, StorageModel::R_IsController).toBool() &&
    4237         m_pTreeStorage->currentIndex() == index)
     4241        m_pTreeViewStorage->currentIndex() == index)
    42384242    {
    42394243        const DeviceTypeList devicesList(m_pModelStorage->data(index, StorageModel::R_CtrDevices).value<DeviceTypeList>());
     
    43084312
    43094313        /* Check what item we are hovering currently: */
    4310         QModelIndex index = m_pTreeStorage->indexAt(pEvent->pos());
     4314        QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos());
    43114315        AbstractItem *pItem = static_cast<AbstractItem*>(index.internalPointer());
    43124316        /* And make sure this is attachment item, we are supporting dragging for this kind only: */
     
    43444348    m_mousePressPosition = pEvent->globalPos();
    43454349
    4346     const QModelIndex index = m_pTreeStorage->indexAt(pEvent->pos());
    4347     const QRect indexRect = m_pTreeStorage->visualRect(index);
     4350    const QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos());
     4351    const QRect indexRect = m_pTreeViewStorage->visualRect(index);
    43484352
    43494353    /* Expander icon: */
     
    43554359        {
    43564360            pEvent->setAccepted(true);
    4357             m_pTreeStorage->setExpanded(index, !m_pTreeStorage->isExpanded(index));
     4361            m_pTreeViewStorage->setExpanded(index, !m_pTreeViewStorage->isExpanded(index));
    43584362            return;
    43594363        }
     
    43624366    /* Adder icons: */
    43634367    if (m_pModelStorage->data(index, StorageModel::R_IsController).toBool() &&
    4364         m_pTreeStorage->currentIndex() == index)
     4368        m_pTreeViewStorage->currentIndex() == index)
    43654369    {
    43664370        const DeviceTypeList devicesList(m_pModelStorage->data(index, StorageModel::R_CtrDevices).value<DeviceTypeList>());
     
    44364440
    44374441    /* Check what item we are hovering currently: */
    4438     QModelIndex index = m_pTreeStorage->indexAt(pEvent->pos());
     4442    QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos());
    44394443    AbstractItem *pItem = static_cast<AbstractItem*>(index.internalPointer());
    44404444    /* And make sure this is controller item, we are supporting dropping for this kind only: */
     
    44644468
    44654469    /* Check what item we are hovering currently: */
    4466     QModelIndex index = m_pTreeStorage->indexAt(pEvent->pos());
     4470    QModelIndex index = m_pTreeViewStorage->indexAt(pEvent->pos());
    44674471    AbstractItem *pItem = static_cast<AbstractItem*>(index.internalPointer());
    44684472    /* And make sure this is controller item, we are supporting dropping for this kind only: */
     
    45424546
    45434547            /* Prepare storage layout: */
    4544             m_pLayoutTreeView = new QVBoxLayout;
    4545             if (m_pLayoutTreeView)
     4548            m_pLayoutTree = new QVBoxLayout;
     4549            if (m_pLayoutTree)
    45464550            {
    45474551#ifdef VBOX_WS_MAC
    4548                 m_pLayoutTreeView->setContentsMargins(3, 0, 3, 0);
    4549                 m_pLayoutTreeView->setSpacing(3);
     4552                m_pLayoutTree->setContentsMargins(3, 0, 3, 0);
     4553                m_pLayoutTree->setSpacing(3);
    45504554#else
    4551                 m_pLayoutTreeView->setContentsMargins(0, 0, 0, 0);
    4552                 m_pLayoutTreeView->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 3);
     4555                m_pLayoutTree->setContentsMargins(0, 0, 0, 0);
     4556                m_pLayoutTree->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 3);
    45534557#endif
    45544558
     
    45574561
    45584562                /* Prepare toolbar layout: */
    4559                 m_pLayoutToolBar = new QHBoxLayout;
    4560                 if (m_pLayoutToolBar)
     4563                m_pLayoutToolbar = new QHBoxLayout;
     4564                if (m_pLayoutToolbar)
    45614565                {
    4562                     m_pLayoutToolBar->addStretch();
     4566                    m_pLayoutToolbar->addStretch();
    45634567
    45644568                    /* Prepare toolbar: */
    45654569                    prepareToolBar();
    45664570
    4567                     m_pLayoutTreeView->addLayout(m_pLayoutToolBar);
     4571                    m_pLayoutTree->addLayout(m_pLayoutToolbar);
    45684572                }
    45694573
    4570                 pLayoutLeftPane->addLayout(m_pLayoutTreeView);
     4574                pLayoutLeftPane->addLayout(m_pLayoutTree);
    45714575            }
    45724576        }
     
    45794583{
    45804584    /* Prepare tree-view: */
    4581     m_pTreeStorage = new QITreeView;
    4582     if (m_pTreeStorage)
     4585    m_pTreeViewStorage = new QITreeView(m_pWidgetLeftPane);
     4586    if (m_pTreeViewStorage)
    45834587    {
    45844588        if (m_pLabelSeparatorLeftPane)
    4585             m_pLabelSeparatorLeftPane->setBuddy(m_pTreeStorage);
    4586         m_pTreeStorage->setMouseTracking(true);
    4587         m_pTreeStorage->setAcceptDrops(true);
    4588         m_pTreeStorage->setContextMenuPolicy(Qt::CustomContextMenu);
     4589            m_pLabelSeparatorLeftPane->setBuddy(m_pTreeViewStorage);
     4590        m_pTreeViewStorage->setMouseTracking(true);
     4591        m_pTreeViewStorage->setAcceptDrops(true);
     4592        m_pTreeViewStorage->setContextMenuPolicy(Qt::CustomContextMenu);
    45894593
    45904594        /* Prepare storage model: */
    4591         m_pModelStorage = new StorageModel(m_pTreeStorage);
     4595        m_pModelStorage = new StorageModel(m_pTreeViewStorage);
    45924596        if (m_pModelStorage)
    45934597        {
    4594             m_pTreeStorage->setModel(m_pModelStorage);
    4595             m_pTreeStorage->setRootIndex(m_pModelStorage->root());
    4596             m_pTreeStorage->setCurrentIndex(m_pModelStorage->root());
     4598            m_pTreeViewStorage->setModel(m_pModelStorage);
     4599            m_pTreeViewStorage->setRootIndex(m_pModelStorage->root());
     4600            m_pTreeViewStorage->setCurrentIndex(m_pModelStorage->root());
    45974601        }
    45984602
    45994603        /* Prepare storage delegate: */
    4600         StorageDelegate *pStorageDelegate = new StorageDelegate(m_pTreeStorage);
     4604        StorageDelegate *pStorageDelegate = new StorageDelegate(m_pTreeViewStorage);
    46014605        if (pStorageDelegate)
    4602             m_pTreeStorage->setItemDelegate(pStorageDelegate);
    4603 
    4604         m_pLayoutTreeView->addWidget(m_pTreeStorage);
     4606            m_pTreeViewStorage->setItemDelegate(pStorageDelegate);
     4607
     4608        m_pLayoutTree->addWidget(m_pTreeViewStorage);
    46054609    }
    46064610}
     
    46094613{
    46104614    /* Prepare toolbar: */
    4611     m_pToolBar = new UIToolBar(m_pWidgetLeftPane);
    4612     if (m_pToolBar)
     4615    m_pToolbar = new UIToolBar(m_pWidgetLeftPane);
     4616    if (m_pToolbar)
    46134617    {
    46144618        /* Configure toolbar: */
    46154619        const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
    4616         m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric));
     4620        m_pToolbar->setIconSize(QSize(iIconMetric, iIconMetric));
    46174621
    46184622        /* Prepare 'Add Controller' action: */
     
    46214625        {
    46224626            m_pActionAddController->setIcon(iconPool()->icon(ControllerAddEn, ControllerAddDis));
    4623             m_pToolBar->addAction(m_pActionAddController);
     4627            m_pToolbar->addAction(m_pActionAddController);
    46244628        }
    46254629
     
    46744678        {
    46754679            m_pActionRemoveController->setIcon(iconPool()->icon(ControllerDelEn, ControllerDelDis));
    4676             m_pToolBar->addAction(m_pActionRemoveController);
     4680            m_pToolbar->addAction(m_pActionRemoveController);
    46774681        }
    46784682
     
    46824686        {
    46834687            m_pActionAddAttachment->setIcon(iconPool()->icon(AttachmentAddEn, AttachmentAddDis));
    4684             m_pToolBar->addAction(m_pActionAddAttachment);
     4688            m_pToolbar->addAction(m_pActionAddAttachment);
    46854689        }
    46864690
     
    47034707        {
    47044708            m_pActionRemoveAttachment->setIcon(iconPool()->icon(AttachmentDelEn, AttachmentDelDis));
    4705             m_pToolBar->addAction(m_pActionRemoveAttachment);
    4706         }
    4707 
    4708         m_pLayoutToolBar->addWidget(m_pToolBar);
     4709            m_pToolbar->addAction(m_pActionRemoveAttachment);
     4710        }
     4711
     4712        m_pLayoutToolbar->addWidget(m_pToolbar);
    47094713    }
    47104714}
     
    47484752            {
    47494753                m_pLabelInfo->setWordWrap(true);
    4750                 pLayoutEmpty->addWidget(m_pLabelInfo, 1, 1, 1, 1);
     4754                pLayoutEmpty->addWidget(m_pLabelInfo, 1, 1);
    47514755            }
    47524756
     
    47814785            {
    47824786                m_pLabelName->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    4783                 m_pLayoutController->addWidget(m_pLabelName, 1, 1, 1, 1);
     4787                m_pLayoutController->addWidget(m_pLabelName, 1, 1);
    47844788            }
    47854789            /* Prepare name editor: */
     
    47874791            if (m_pEditorName)
    47884792            {
    4789                 m_pLabelName->setBuddy(m_pEditorName);
    4790                 m_pLayoutController->addWidget(m_pEditorName, 1, 2, 1, 1);
     4793                if (m_pLabelName)
     4794                    m_pLabelName->setBuddy(m_pEditorName);
     4795                m_pLayoutController->addWidget(m_pEditorName, 1, 2);
    47914796            }
    47924797
     
    47964801            {
    47974802                m_pLabelType->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    4798                 m_pLayoutController->addWidget(m_pLabelType, 2, 1, 1, 1);
     4803                m_pLayoutController->addWidget(m_pLabelType, 2, 1);
    47994804            }
    48004805            /* Prepare type combo: */
     
    48024807            if (m_pComboType)
    48034808            {
    4804                 m_pLabelType->setBuddy(m_pComboType);
     4809                if (m_pLabelType)
     4810                    m_pLabelType->setBuddy(m_pComboType);
    48054811                m_pComboType->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    4806                 m_pLayoutController->addWidget(m_pComboType, 2, 2, 1, 1);
     4812                m_pLayoutController->addWidget(m_pComboType, 2, 2);
    48074813            }
    48084814
     
    48124818            {
    48134819                m_pLabelPortCount->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    4814                 m_pLayoutController->addWidget(m_pLabelPortCount, 3, 1, 1, 1);
     4820                m_pLayoutController->addWidget(m_pLabelPortCount, 3, 1);
    48154821            }
    48164822            /* Prepare port count spinbox: */
    4817             m_pSpinBoxPortCount = new QSpinBox(pWidgetController);
    4818             if (m_pSpinBoxPortCount)
    4819             {
    4820                 m_pLabelPortCount->setBuddy(m_pSpinBoxPortCount);
    4821                 m_pLayoutController->addWidget(m_pSpinBoxPortCount, 3, 2, 1, 1);
     4823            m_pSpinboxPortCount = new QSpinBox(pWidgetController);
     4824            if (m_pSpinboxPortCount)
     4825            {
     4826                if (m_pLabelPortCount)
     4827                    m_pLabelPortCount->setBuddy(m_pSpinboxPortCount);
     4828                m_pLayoutController->addWidget(m_pSpinboxPortCount, 3, 2);
    48224829            }
    48234830
     
    48254832            m_pCheckBoxIoCache = new QCheckBox(pWidgetController);
    48264833            if (m_pCheckBoxIoCache)
    4827                 m_pLayoutController->addWidget(m_pCheckBoxIoCache, 4, 2, 1, 1);
     4834                m_pLayoutController->addWidget(m_pCheckBoxIoCache, 4, 2);
    48284835
    48294836            m_pLayoutController->setColumnMinimumWidth(0, 10);
     
    49184925                    pLayoutAttachmentSettings->addWidget(m_pCheckBoxHotPluggable);
    49194926
    4920                 m_pLayoutAttachment->addLayout(pLayoutAttachmentSettings, 2, 2, 1, 1);
     4927                m_pLayoutAttachment->addLayout(pLayoutAttachmentSettings, 2, 2);
    49214928            }
    49224929
     
    50775084
    50785085    /* Configure tree-view: */
    5079     connect(m_pTreeStorage, &QITreeView::currentItemChanged,
     5086    connect(m_pTreeViewStorage, &QITreeView::currentItemChanged,
    50805087             this, &UIMachineSettingsStorage::sltHandleCurrentItemChange);
    5081     connect(m_pTreeStorage, &QITreeView::customContextMenuRequested,
     5088    connect(m_pTreeViewStorage, &QITreeView::customContextMenuRequested,
    50825089            this, &UIMachineSettingsStorage::sltHandleContextMenuRequest);
    5083     connect(m_pTreeStorage, &QITreeView::drawItemBranches,
     5090    connect(m_pTreeViewStorage, &QITreeView::drawItemBranches,
    50845091            this, &UIMachineSettingsStorage::sltHandleDrawItemBranches);
    5085     connect(m_pTreeStorage, &QITreeView::mouseMoved,
     5092    connect(m_pTreeViewStorage, &QITreeView::mouseMoved,
    50865093            this, &UIMachineSettingsStorage::sltHandleMouseMove);
    5087     connect(m_pTreeStorage, &QITreeView::mousePressed,
     5094    connect(m_pTreeViewStorage, &QITreeView::mousePressed,
    50885095            this, &UIMachineSettingsStorage::sltHandleMouseClick);
    5089     connect(m_pTreeStorage, &QITreeView::mouseReleased,
     5096    connect(m_pTreeViewStorage, &QITreeView::mouseReleased,
    50905097            this, &UIMachineSettingsStorage::sltHandleMouseRelease);
    5091     connect(m_pTreeStorage, &QITreeView::mouseDoubleClicked,
     5098    connect(m_pTreeViewStorage, &QITreeView::mouseDoubleClicked,
    50925099            this, &UIMachineSettingsStorage::sltHandleMouseClick);
    5093     connect(m_pTreeStorage, &QITreeView::dragEntered,
     5100    connect(m_pTreeViewStorage, &QITreeView::dragEntered,
    50945101            this, &UIMachineSettingsStorage::sltHandleDragEnter);
    5095     connect(m_pTreeStorage, &QITreeView::dragMoved,
     5102    connect(m_pTreeViewStorage, &QITreeView::dragMoved,
    50965103            this, &UIMachineSettingsStorage::sltHandleDragMove);
    5097     connect(m_pTreeStorage, &QITreeView::dragDropped,
     5104    connect(m_pTreeViewStorage, &QITreeView::dragDropped,
    50985105            this, &UIMachineSettingsStorage::sltHandleDragDrop);
    50995106
     
    51325139    connect(m_pMediumIdHolder, &UIMediumIDHolder::sigChanged,
    51335140            this, &UIMachineSettingsStorage::sltSetInformation);
    5134     connect(m_pSpinBoxPortCount, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
     5141    connect(m_pSpinboxPortCount, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),
    51355142            this, &UIMachineSettingsStorage::sltSetInformation);
    51365143    connect(m_pEditorName, &QLineEdit::textEdited,
     
    51655172{
    51665173#ifdef RT_STRICT
    5167     const QModelIndex index = m_pTreeStorage->currentIndex();
     5174    const QModelIndex index = m_pTreeViewStorage->currentIndex();
    51685175    switch (enmBus)
    51695176    {
     
    52035210void UIMachineSettingsStorage::addAttachmentWrapper(KDeviceType enmDeviceType)
    52045211{
    5205     const QModelIndex index = m_pTreeStorage->currentIndex();
     5212    const QModelIndex index = m_pTreeViewStorage->currentIndex();
    52065213    Assert(m_pModelStorage->data(index, StorageModel::R_IsController).toBool());
    52075214    Assert(m_pModelStorage->data(index, StorageModel::R_IsMoreAttachmentsPossible).toBool());
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h

    r85952 r86045  
    285285    StorageModel *m_pModelStorage;
    286286
    287     /** Holds the 'Add Controller' action instance. */
    288     QAction *m_pActionAddController;
    289     /** Holds the 'Remove Controller' action instance. */
    290     QAction *m_pActionRemoveController;
    291     /** Holds the map of add controller action instances. */
    292     QMap<KStorageControllerType, QAction*> m_addControllerActions;
    293 
    294     /** Holds the 'Add Attachment' action instance. */
    295     QAction *m_pActionAddAttachment;
    296     /** Holds the 'Remove Attachment' action instance. */
    297     QAction *m_pActionRemoveAttachment;
    298     /** Holds the 'Add HD Attachment' action instance. */
    299     QAction *m_pActionAddAttachmentHD;
    300     /** Holds the 'Add CD Attachment' action instance. */
    301     QAction *m_pActionAddAttachmentCD;
    302     /** Holds the 'Add FD Attachment' action instance. */
    303     QAction *m_pActionAddAttachmentFD;
    304 
    305287    /** Holds the medium ID wrapper instance. */
    306288    UIMediumIDHolder *m_pMediumIdHolder;
     
    318300     * @{ */
    319301        /** Holds the splitter instance. */
    320         QISplitter       *m_pSplitter;
     302        QISplitter *m_pSplitter;
     303
    321304        /** Holds the left pane instance. */
    322         QWidget          *m_pWidgetLeftPane;
     305        QWidget                                *m_pWidgetLeftPane;
    323306        /** Holds the left pane separator instance. */
    324         QILabelSeparator *m_pLabelSeparatorLeftPane;
     307        QILabelSeparator                       *m_pLabelSeparatorLeftPane;
    325308        /** Holds the tree-view layout instance. */
    326         QVBoxLayout      *m_pLayoutTreeView;
     309        QVBoxLayout                            *m_pLayoutTree;
    327310        /** Holds the tree-view instance. */
    328         QITreeView       *m_pTreeStorage;
     311        QITreeView                             *m_pTreeViewStorage;
    329312        /** Holds the toolbar layout instance. */
    330         QHBoxLayout      *m_pLayoutToolBar;
     313        QHBoxLayout                            *m_pLayoutToolbar;
    331314        /** Holds the toolbar instance. */
    332         UIToolBar        *m_pToolBar;
     315        UIToolBar                              *m_pToolbar;
     316        /** Holds the 'Add Controller' action instance. */
     317        QAction                                *m_pActionAddController;
     318        /** Holds the 'Remove Controller' action instance. */
     319        QAction                                *m_pActionRemoveController;
     320        /** Holds the map of add controller action instances. */
     321        QMap<KStorageControllerType, QAction*>  m_addControllerActions;
     322        /** Holds the 'Add Attachment' action instance. */
     323        QAction                                *m_pActionAddAttachment;
     324        /** Holds the 'Remove Attachment' action instance. */
     325        QAction                                *m_pActionRemoveAttachment;
     326        /** Holds the 'Add HD Attachment' action instance. */
     327        QAction                                *m_pActionAddAttachmentHD;
     328        /** Holds the 'Add CD Attachment' action instance. */
     329        QAction                                *m_pActionAddAttachmentCD;
     330        /** Holds the 'Add FD Attachment' action instance. */
     331        QAction                                *m_pActionAddAttachmentFD;
    333332
    334333        /** Holds the right pane instance. */
     
    351350        QLabel           *m_pLabelPortCount;
    352351        /** Holds the port count spinbox instance. */
    353         QSpinBox         *m_pSpinBoxPortCount;
     352        QSpinBox         *m_pSpinboxPortCount;
    354353        /** Holds the IO cache check-box instance. */
    355354        QCheckBox        *m_pCheckBoxIoCache;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp

    r85871 r86045  
    839839void UIMachineSettingsSystem::prepareTabMotherboard()
    840840{
    841     /* Prepare Motherboard tab: */
     841    /* Prepare 'Motherboard' tab: */
    842842    m_pTabMotherboard = new QWidget;
    843843    if (m_pTabMotherboard)
    844844    {
    845         /* Prepare Motherboard tab layout: */
     845        /* Prepare 'Motherboard' tab layout: */
    846846        QGridLayout *pLayoutMotherboard = new QGridLayout(m_pTabMotherboard);
    847847        if (pLayoutMotherboard)
     
    861861            if (m_pEditorBaseMemory)
    862862            {
    863                 m_pLabelBaseMemory->setBuddy(m_pEditorBaseMemory->focusProxy());
     863                if (m_pLabelBaseMemory)
     864                    m_pLabelBaseMemory->setBuddy(m_pEditorBaseMemory->focusProxy());
    864865                m_pEditorBaseMemory->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed));
    865866
     
    878879            if (m_pEditorBootOrder)
    879880            {
    880                 m_pLabelBootOrder->setBuddy(m_pEditorBootOrder->focusProxy());
     881                if (m_pLabelBootOrder)
     882                    m_pLabelBootOrder->setBuddy(m_pEditorBootOrder->focusProxy());
    881883                m_pEditorBootOrder->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
    882884
     
    895897            if (m_pComboChipset)
    896898            {
    897                 m_pLabelChipset->setBuddy(m_pComboChipset);
     899                if (m_pLabelChipset)
     900                    m_pLabelChipset->setBuddy(m_pComboChipset);
    898901                m_pComboChipset->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    899902                m_pComboChipset->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
     
    913916            if (m_pComboPointingHID)
    914917            {
    915                 m_pLabelPointingHID->setBuddy(m_pComboPointingHID);
     918                if (m_pLabelPointingHID)
     919                    m_pLabelPointingHID->setBuddy(m_pComboPointingHID);
    916920                m_pComboPointingHID->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    917921                m_pComboPointingHID->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
     
    965969    m_uMaxGuestCPUExecCap = 100;
    966970
    967     /* Prepare Processor tab: */
     971    /* Prepare 'Processor' tab: */
    968972    m_pTabProcessor = new QWidget;
    969973    if (m_pTabProcessor)
    970974    {
    971         /* Prepare Processor tab layout: */
     975        /* Prepare 'Processor' tab layout: */
    972976        QGridLayout *pLayoutProcessor = new QGridLayout(m_pTabProcessor);
    973977        if (pLayoutProcessor)
    974978        {
     979            pLayoutProcessor->setColumnStretch(1, 1);
    975980            pLayoutProcessor->setRowStretch(6, 1);
    976981
     
    10201025                }
    10211026
    1022                 pLayoutProcessor->addLayout(pLayoutProcessorCount, 0, 1, 2, 1);
     1027                pLayoutProcessor->addLayout(pLayoutProcessorCount, 0, 1, 2, 2);
    10231028            }
    10241029            /* Prepare processor count spinbox: */
     
    10261031            if (m_pSpinboxProcessorCount)
    10271032            {
    1028                 m_pLabelProcessorCount->setBuddy(m_pSpinboxProcessorCount);
     1033                if (m_pLabelProcessorCount)
     1034                    m_pLabelProcessorCount->setBuddy(m_pSpinboxProcessorCount);
    10291035                m_pSpinboxProcessorCount->setMinimum(m_uMinGuestCPU);
    10301036                m_pSpinboxProcessorCount->setMaximum(m_uMaxGuestCPU);
    10311037                uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxProcessorCount, 4);
    10321038
    1033                 pLayoutProcessor->addWidget(m_pSpinboxProcessorCount, 0, 2);
     1039                pLayoutProcessor->addWidget(m_pSpinboxProcessorCount, 0, 3);
    10341040            }
    10351041
     
    10791085                }
    10801086
    1081                 pLayoutProcessor->addLayout(pLayoutProcessorExecCap, 2, 1, 2, 1);
     1087                pLayoutProcessor->addLayout(pLayoutProcessorExecCap, 2, 1, 2, 2);
    10821088            }
    10831089            /* Prepare processor exec cap spinbox: */
     
    10851091            if (m_pSpinboxProcessorExecCap)
    10861092            {
    1087                 m_pLabelProcessorExecCap->setBuddy(m_pSpinboxProcessorExecCap);
     1093                if (m_pLabelProcessorExecCap)
     1094                    m_pLabelProcessorExecCap->setBuddy(m_pSpinboxProcessorExecCap);
    10881095                m_pSpinboxProcessorExecCap->setMinimum(m_uMinGuestCPUExecCap);
    10891096                m_pSpinboxProcessorExecCap->setMaximum(m_uMaxGuestCPUExecCap);
    10901097                uiCommon().setMinimumWidthAccordingSymbolCount(m_pSpinboxProcessorExecCap, 4);
    10911098
    1092                 pLayoutProcessor->addWidget(m_pSpinboxProcessorExecCap, 2, 2);
     1099                pLayoutProcessor->addWidget(m_pSpinboxProcessorExecCap, 2, 3);
    10931100            }
    10941101
     
    11031110            m_pCheckBoxPAE = new QCheckBox(m_pTabProcessor);
    11041111            if (m_pCheckBoxPAE)
    1105                 pLayoutProcessor->addWidget(m_pCheckBoxPAE, 4, 1, 1, 2);
     1112                pLayoutProcessor->addWidget(m_pCheckBoxPAE, 4, 1);
    11061113            /* Prepare nested virtualization check-box: */
    11071114            m_pCheckBoxNestedVirtualization = new QCheckBox(m_pTabProcessor);
    11081115            if (m_pCheckBoxNestedVirtualization)
    1109                 pLayoutProcessor->addWidget(m_pCheckBoxNestedVirtualization, 5, 1, 1, 2);
     1116                pLayoutProcessor->addWidget(m_pCheckBoxNestedVirtualization, 5, 1);
    11101117        }
    11111118
     
    11161123void UIMachineSettingsSystem::prepareTabAcceleration()
    11171124{
    1118     /* Prepare Acceleration tab: */
     1125    /* Prepare 'Acceleration' tab: */
    11191126    m_pTabAcceleration = new QWidget;
    11201127    if (m_pTabAcceleration)
    11211128    {
    1122         /* Prepare Acceleration tab layout: */
     1129        /* Prepare 'Acceleration' tab layout: */
    11231130        QGridLayout *pLayoutAcceleration = new QGridLayout(m_pTabAcceleration);
    11241131        if (pLayoutAcceleration)
     
    11381145            if (m_pComboParavirtProvider)
    11391146            {
    1140                 m_pLabelParavirtProvider->setBuddy(m_pComboParavirtProvider);
     1147                if (m_pLabelParavirtProvider)
     1148                    m_pLabelParavirtProvider->setBuddy(m_pComboParavirtProvider);
    11411149                m_pComboParavirtProvider->setSizeAdjustPolicy(QComboBox::AdjustToContents);
    11421150                m_pComboParavirtProvider->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
    11431151
    1144                 pLayoutAcceleration->addWidget(m_pComboParavirtProvider, 0, 1);
     1152                pLayoutAcceleration->addWidget(m_pComboParavirtProvider, 0, 1, 1, 2);
    11451153            }
    11461154
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h

    r85839 r86045  
    244244        QComboBox *m_pComboParavirtProvider;
    245245        /** Holds the virtualization label instance. */
    246         QLabel *m_pLabelVirtualization;
     246        QLabel    *m_pLabelVirtualization;
    247247        /** Holds the virtualization check-box instance. */
    248248        QCheckBox *m_pCheckBoxVirtualization;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp

    r85958 r86045  
    341341    , m_pLayoutFilters(0)
    342342    , m_pTreeWidgetFilters(0)
    343     , m_pToolBarFilters(0)
     343    , m_pToolbarFilters(0)
    344344    , m_pActionNew(0)
    345345    , m_pActionAdd(0)
     
    961961{
    962962    /* Prepare USB filters toolbar: */
    963     m_pToolBarFilters = new UIToolBar(m_pWidgetUSBSettings);
    964     if (m_pToolBarFilters)
     963    m_pToolbarFilters = new UIToolBar(m_pWidgetUSBSettings);
     964    if (m_pToolbarFilters)
    965965    {
    966966        const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
    967         m_pToolBarFilters->setIconSize(QSize(iIconMetric, iIconMetric));
    968         m_pToolBarFilters->setOrientation(Qt::Vertical);
     967        m_pToolbarFilters->setIconSize(QSize(iIconMetric, iIconMetric));
     968        m_pToolbarFilters->setOrientation(Qt::Vertical);
    969969
    970970        /* Prepare 'New USB Filter' action: */
    971         m_pActionNew = m_pToolBarFilters->addAction(UIIconPool::iconSet(":/usb_new_16px.png",
     971        m_pActionNew = m_pToolbarFilters->addAction(UIIconPool::iconSet(":/usb_new_16px.png",
    972972                                                                        ":/usb_new_disabled_16px.png"),
    973973                                                    QString(), this, SLOT(sltNewFilter()));
     
    976976
    977977        /* Prepare 'Add USB Filter' action: */
    978         m_pActionAdd = m_pToolBarFilters->addAction(UIIconPool::iconSet(":/usb_add_16px.png",
     978        m_pActionAdd = m_pToolbarFilters->addAction(UIIconPool::iconSet(":/usb_add_16px.png",
    979979                                                                        ":/usb_add_disabled_16px.png"),
    980980                                                    QString(), this, SLOT(sltAddFilter()));
     
    983983
    984984        /* Prepare 'Edit USB Filter' action: */
    985         m_pActionEdit = m_pToolBarFilters->addAction(UIIconPool::iconSet(":/usb_filter_edit_16px.png",
     985        m_pActionEdit = m_pToolbarFilters->addAction(UIIconPool::iconSet(":/usb_filter_edit_16px.png",
    986986                                                                         ":/usb_filter_edit_disabled_16px.png"),
    987987                                                     QString(), this, SLOT(sltEditFilter()));
     
    990990
    991991        /* Prepare 'Remove USB Filter' action: */
    992         m_pActionRemove = m_pToolBarFilters->addAction(UIIconPool::iconSet(":/usb_remove_16px.png",
     992        m_pActionRemove = m_pToolbarFilters->addAction(UIIconPool::iconSet(":/usb_remove_16px.png",
    993993                                                                           ":/usb_remove_disabled_16px.png"),
    994994                                                       QString(), this, SLOT(sltRemoveFilter()));
     
    997997
    998998        /* Prepare 'Move USB Filter Up' action: */
    999         m_pActionMoveUp = m_pToolBarFilters->addAction(UIIconPool::iconSet(":/usb_moveup_16px.png",
     999        m_pActionMoveUp = m_pToolbarFilters->addAction(UIIconPool::iconSet(":/usb_moveup_16px.png",
    10001000                                                                           ":/usb_moveup_disabled_16px.png"),
    10011001                                                       QString(), this, SLOT(sltMoveFilterUp()));
     
    10041004
    10051005        /* Prepare 'Move USB Filter Down' action: */
    1006         m_pActionMoveDown = m_pToolBarFilters->addAction(UIIconPool::iconSet(":/usb_movedown_16px.png",
     1006        m_pActionMoveDown = m_pToolbarFilters->addAction(UIIconPool::iconSet(":/usb_movedown_16px.png",
    10071007                                                                             ":/usb_movedown_disabled_16px.png"),
    10081008                                                         QString(), this, SLOT(sltMoveFilterDown()));
     
    10131013        m_pMenuUSBDevices = new VBoxUSBMenu(this);
    10141014
    1015         m_pLayoutFilters->addWidget(m_pToolBarFilters);
     1015        m_pLayoutFilters->addWidget(m_pToolbarFilters);
    10161016    }
    10171017}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h

    r85953 r86045  
    174174        QITreeWidget     *m_pTreeWidgetFilters;
    175175        /** Holds the USB filters toolbar instance. */
    176         UIToolBar        *m_pToolBarFilters;
     176        UIToolBar        *m_pToolbarFilters;
    177177        /** Holds the New action instance. */
    178178        QAction          *m_pActionNew;
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