Changeset 80081 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 31, 2019 4:19:53 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r80079 r80081 888 888 src/settings/machine/UIMachineSettingsUSBFilterDetails.h \ 889 889 src/widgets/UIAddDiskEncryptionPasswordDialog.h \ 890 src/widgets/UIAudioControllerEditor.h \ 890 891 src/widgets/UIAudioHostDriverEditor.h \ 891 892 src/widgets/UIBaseMemoryEditor.h \ … … 1383 1384 src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp \ 1384 1385 src/widgets/UIAddDiskEncryptionPasswordDialog.cpp \ 1386 src/widgets/UIAudioControllerEditor.cpp \ 1385 1387 src/widgets/UIAudioHostDriverEditor.cpp \ 1386 1388 src/widgets/UIBaseMemoryEditor.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.cpp
r80079 r80081 123 123 m_pCheckBoxAudio->setChecked(oldAudioData.m_fAudioEnabled); 124 124 m_pAudioHostDriverEditor->setValue(oldAudioData.m_audioDriverType); 125 m_p ComboAudioController->setCurrentIndex(m_pComboAudioController->findData((int)oldAudioData.m_audioControllerType));125 m_pAudioControllerEditor->setValue(oldAudioData.m_audioControllerType); 126 126 m_pCheckBoxAudioOutput->setChecked(oldAudioData.m_fAudioOutputEnabled); 127 127 m_pCheckBoxAudioInput->setChecked(oldAudioData.m_fAudioInputEnabled); … … 139 139 newAudioData.m_fAudioEnabled = m_pCheckBoxAudio->isChecked(); 140 140 newAudioData.m_audioDriverType = m_pAudioHostDriverEditor->value(); 141 newAudioData.m_audioControllerType = static_cast<KAudioControllerType>(m_pComboAudioController->itemData(m_pComboAudioController->currentIndex()).toInt());141 newAudioData.m_audioControllerType = m_pAudioControllerEditor->value(); 142 142 newAudioData.m_fAudioOutputEnabled = m_pCheckBoxAudioOutput->isChecked(); 143 143 newAudioData.m_fAudioInputEnabled = m_pCheckBoxAudioInput->isChecked(); … … 163 163 /* Translate generated strings: */ 164 164 Ui::UIMachineSettingsAudio::retranslateUi(this); 165 166 /* Translate audio-controller combo.167 * Make sure this order corresponds the same in prepare(): */168 int iIndex = -1;169 m_pComboAudioController->setItemText(++iIndex, gpConverter->toString(KAudioControllerType_HDA));170 m_pComboAudioController->setItemText(++iIndex, gpConverter->toString(KAudioControllerType_AC97));171 m_pComboAudioController->setItemText(++iIndex, gpConverter->toString(KAudioControllerType_SB16));172 165 } 173 166 … … 178 171 m_pAudioHostDriverLabel->setEnabled(isMachineOffline()); 179 172 m_pAudioHostDriverEditor->setEnabled(isMachineOffline()); 180 m_p LabelAudioController->setEnabled(isMachineOffline());181 m_p ComboAudioController->setEnabled(isMachineOffline());173 m_pAudioControllerLabel->setEnabled(isMachineOffline()); 174 m_pAudioControllerEditor->setEnabled(isMachineOffline()); 182 175 m_pLabelAudioExtended->setEnabled(isMachineInValidMode()); 183 176 m_pCheckBoxAudioOutput->setEnabled(isMachineInValidMode()); … … 205 198 } 206 199 207 /* Audio-controller combo-box created in the .ui file. */ 208 AssertPtrReturnVoid(m_pComboAudioController); 200 /* Audio controller label & editor created in the .ui file. */ 201 AssertPtrReturnVoid(m_pAudioControllerLabel); 202 AssertPtrReturnVoid(m_pAudioControllerEditor); 209 203 { 210 /* Configure combo-box. 211 * Make sure this order corresponds the same in retranslateUi(): */ 212 int iIndex = -1; 213 m_pComboAudioController->insertItem(++iIndex, "", KAudioControllerType_HDA); 214 m_pComboAudioController->insertItem(++iIndex, "", KAudioControllerType_AC97); 215 m_pComboAudioController->insertItem(++iIndex, "", KAudioControllerType_SB16); 204 /* Configure label & editor: */ 205 m_pAudioControllerLabel->setBuddy(m_pAudioControllerEditor->focusProxy()); 216 206 } 217 207 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.ui
r80079 r80081 63 63 <item row="0" column="1"> 64 64 <widget class="UIAudioHostDriverEditor" name="m_pAudioHostDriverEditor"> 65 <property name="sizePolicy">66 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">67 <horstretch>1</horstretch>68 <verstretch>0</verstretch>69 </sizepolicy>70 </property>71 65 <property name="whatsThis"> 72 66 <string>Selects the audio output driver. The <b>Null Audio Driver</b> makes the guest see an audio card, however every access to it will be ignored.</string> … … 75 69 </item> 76 70 <item row="1" column="0"> 77 <widget class="QLabel" name="m_p LabelAudioController">71 <widget class="QLabel" name="m_pAudioControllerLabel"> 78 72 <property name="text"> 79 73 <string>Audio &Controller:</string> … … 82 76 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 83 77 </property> 84 <property name="buddy">85 <cstring>m_pComboAudioController</cstring>86 </property>87 78 </widget> 88 79 </item> 89 80 <item row="1" column="1"> 90 <widget class="QComboBox" name="m_pComboAudioController"> 91 <property name="sizePolicy"> 92 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> 93 <horstretch>1</horstretch> 94 <verstretch>0</verstretch> 95 </sizepolicy> 96 </property> 81 <widget class="UIAudioControllerEditor" name="m_pAudioControllerEditor"> 97 82 <property name="whatsThis"> 98 83 <string>Selects the type of the virtual sound card. Depending on this value, VirtualBox will provide different audio hardware to the virtual machine.</string> … … 166 151 <customwidgets> 167 152 <customwidget> 153 <class>UIAudioControllerEditor</class> 154 <extends>QWidget</extends> 155 <header>UIAudioControllerEditor.h</header> 156 </customwidget> 157 <customwidget> 168 158 <class>UIAudioHostDriverEditor</class> 169 159 <extends>QWidget</extends> -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAudioControllerEditor.cpp
r80079 r80081 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIAudio HostDriverEditor class implementation.3 * VBox Qt GUI - UIAudioControllerEditor class implementation. 4 4 */ 5 5 … … 24 24 #include "QIComboBox.h" 25 25 #include "UIConverter.h" 26 #include "UIAudio HostDriverEditor.h"26 #include "UIAudioControllerEditor.h" 27 27 28 28 29 UIAudio HostDriverEditor::UIAudioHostDriverEditor(QWidget *pParent /* = 0 */, bool fWithLabel /* = false */)29 UIAudioControllerEditor::UIAudioControllerEditor(QWidget *pParent /* = 0 */, bool fWithLabel /* = false */) 30 30 : QIWithRetranslateUI<QWidget>(pParent) 31 31 , m_fWithLabel(fWithLabel) … … 36 36 } 37 37 38 void UIAudio HostDriverEditor::setValue(KAudioDriverType enmValue)38 void UIAudioControllerEditor::setValue(KAudioControllerType enmValue) 39 39 { 40 40 if (m_pCombo) … … 46 46 } 47 47 48 KAudio DriverType UIAudioHostDriverEditor::value() const48 KAudioControllerType UIAudioControllerEditor::value() const 49 49 { 50 return m_pCombo ? m_pCombo->itemData(m_pCombo->currentIndex()).value<KAudio DriverType>() : KAudioDriverType_Null;50 return m_pCombo ? m_pCombo->itemData(m_pCombo->currentIndex()).value<KAudioControllerType>() : KAudioControllerType_AC97; 51 51 } 52 52 53 void UIAudio HostDriverEditor::retranslateUi()53 void UIAudioControllerEditor::retranslateUi() 54 54 { 55 55 if (m_pLabel) 56 m_pLabel->setText(tr(" Host Audio &Driver:"));56 m_pLabel->setText(tr("Audio &Controller:")); 57 57 if (m_pCombo) 58 58 { 59 59 for (int i = 0; i < m_pCombo->count(); ++i) 60 60 { 61 const KAudio DriverType enmType = m_pCombo->itemData(i).value<KAudioDriverType>();61 const KAudioControllerType enmType = m_pCombo->itemData(i).value<KAudioControllerType>(); 62 62 m_pCombo->setItemText(i, gpConverter->toString(enmType)); 63 63 } … … 65 65 } 66 66 67 void UIAudio HostDriverEditor::sltHandleCurrentIndexChanged()67 void UIAudioControllerEditor::sltHandleCurrentIndexChanged() 68 68 { 69 69 if (m_pCombo) 70 emit sigValueChanged(m_pCombo->itemData(m_pCombo->currentIndex()).value<KAudio DriverType>());70 emit sigValueChanged(m_pCombo->itemData(m_pCombo->currentIndex()).value<KAudioControllerType>()); 71 71 } 72 72 73 void UIAudio HostDriverEditor::prepare()73 void UIAudioControllerEditor::prepare() 74 74 { 75 75 /* Create main layout: */ … … 98 98 m_pLabel->setBuddy(m_pCombo->focusProxy()); 99 99 connect(m_pCombo, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged), 100 this, &UIAudio HostDriverEditor::sltHandleCurrentIndexChanged);100 this, &UIAudioControllerEditor::sltHandleCurrentIndexChanged); 101 101 pComboLayout->addWidget(m_pCombo); 102 102 } … … 117 117 } 118 118 119 void UIAudio HostDriverEditor::populateCombo()119 void UIAudioControllerEditor::populateCombo() 120 120 { 121 121 /* Fill combo manually: */ 122 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioDriverType_Null)); 123 #ifdef Q_OS_WIN 124 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioDriverType_DirectSound)); 125 # ifdef VBOX_WITH_WINMM 126 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioDriverType_WinMM)); 127 # endif 128 #endif 129 #ifdef VBOX_WITH_AUDIO_OSS 130 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioDriverType_OSS)); 131 #endif 132 #ifdef VBOX_WITH_AUDIO_ALSA 133 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioDriverType_ALSA)); 134 #endif 135 #ifdef VBOX_WITH_AUDIO_PULSE 136 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioDriverType_Pulse)); 137 #endif 138 #ifdef Q_OS_MACX 139 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioDriverType_CoreAudio)); 140 #endif 122 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioControllerType_HDA)); 123 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioControllerType_AC97)); 124 m_pCombo->addItem(QString(), QVariant::fromValue(KAudioControllerType_SB16)); 141 125 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAudioControllerEditor.h
r80079 r80081 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UIAudio HostDriverEditor class declaration.3 * VBox Qt GUI - UIAudioControllerEditor class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_widgets_UIAudio HostDriverEditor_h19 #define FEQT_INCLUDED_SRC_widgets_UIAudio HostDriverEditor_h18 #ifndef FEQT_INCLUDED_SRC_widgets_UIAudioControllerEditor_h 19 #define FEQT_INCLUDED_SRC_widgets_UIAudioControllerEditor_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 36 36 class QIComboBox; 37 37 38 /** QWidget subclass used as a audio host driver editor. */39 class SHARED_LIBRARY_STUFF UIAudio HostDriverEditor : public QIWithRetranslateUI<QWidget>38 /** QWidget subclass used as an audio controller editor. */ 39 class SHARED_LIBRARY_STUFF UIAudioControllerEditor : public QIWithRetranslateUI<QWidget> 40 40 { 41 41 Q_OBJECT; … … 44 44 45 45 /** Notifies listeners about @a enmValue change. */ 46 void sigValueChanged(KAudio DriverType enmValue);46 void sigValueChanged(KAudioControllerType enmValue); 47 47 48 48 public: 49 49 50 /** Constructs audio host driver editor passing @a pParent to the base-class.50 /** Constructs audio controller editor passing @a pParent to the base-class. 51 51 * @param fWithLabel Brings whether we should add label ourselves. */ 52 UIAudio HostDriverEditor(QWidget *pParent = 0, bool fWithLabel = false);52 UIAudioControllerEditor(QWidget *pParent = 0, bool fWithLabel = false); 53 53 54 54 /** Defines editor @a enmValue. */ 55 void setValue(KAudio DriverType enmValue);55 void setValue(KAudioControllerType enmValue); 56 56 /** Returns editor value. */ 57 KAudio DriverType value() const;57 KAudioControllerType value() const; 58 58 59 59 protected: … … 83 83 }; 84 84 85 #endif /* !FEQT_INCLUDED_SRC_widgets_UIAudio HostDriverEditor_h */85 #endif /* !FEQT_INCLUDED_SRC_widgets_UIAudioControllerEditor_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAudioHostDriverEditor.h
r80079 r80081 36 36 class QIComboBox; 37 37 38 /** QWidget subclass used as a audio host driver editor. */38 /** QWidget subclass used as an audio host driver editor. */ 39 39 class SHARED_LIBRARY_STUFF UIAudioHostDriverEditor : public QIWithRetranslateUI<QWidget> 40 40 {
Note:
See TracChangeset
for help on using the changeset viewer.