Changeset 80079 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 31, 2019 3:57:55 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132519
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r80068 r80079 888 888 src/settings/machine/UIMachineSettingsUSBFilterDetails.h \ 889 889 src/widgets/UIAddDiskEncryptionPasswordDialog.h \ 890 src/widgets/UIAudioHostDriverEditor.h \ 890 891 src/widgets/UIBaseMemoryEditor.h \ 891 892 src/widgets/UIBaseMemorySlider.h \ … … 1382 1383 src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp \ 1383 1384 src/widgets/UIAddDiskEncryptionPasswordDialog.cpp \ 1385 src/widgets/UIAudioHostDriverEditor.cpp \ 1384 1386 src/widgets/UIBaseMemoryEditor.cpp \ 1385 1387 src/widgets/UIBaseMemorySlider.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.cpp
r76606 r80079 122 122 /* Load old audio data from the cache: */ 123 123 m_pCheckBoxAudio->setChecked(oldAudioData.m_fAudioEnabled); 124 m_p ComboAudioDriver->setCurrentIndex(m_pComboAudioDriver->findData((int)oldAudioData.m_audioDriverType));124 m_pAudioHostDriverEditor->setValue(oldAudioData.m_audioDriverType); 125 125 m_pComboAudioController->setCurrentIndex(m_pComboAudioController->findData((int)oldAudioData.m_audioControllerType)); 126 126 m_pCheckBoxAudioOutput->setChecked(oldAudioData.m_fAudioOutputEnabled); … … 138 138 /* Gather new audio data: */ 139 139 newAudioData.m_fAudioEnabled = m_pCheckBoxAudio->isChecked(); 140 newAudioData.m_audioDriverType = static_cast<KAudioDriverType>(m_pComboAudioDriver->itemData(m_pComboAudioDriver->currentIndex()).toInt());140 newAudioData.m_audioDriverType = m_pAudioHostDriverEditor->value(); 141 141 newAudioData.m_audioControllerType = static_cast<KAudioControllerType>(m_pComboAudioController->itemData(m_pComboAudioController->currentIndex()).toInt()); 142 142 newAudioData.m_fAudioOutputEnabled = m_pCheckBoxAudioOutput->isChecked(); … … 164 164 Ui::UIMachineSettingsAudio::retranslateUi(this); 165 165 166 /* Translate audio- driver combo.166 /* Translate audio-controller combo. 167 167 * Make sure this order corresponds the same in prepare(): */ 168 168 int iIndex = -1; 169 m_pComboAudioDriver->setItemText(++iIndex, gpConverter->toString(KAudioDriverType_Null));170 #ifdef Q_OS_WIN171 m_pComboAudioDriver->setItemText(++iIndex, gpConverter->toString(KAudioDriverType_DirectSound));172 # ifdef VBOX_WITH_WINMM173 m_pComboAudioDriver->setItemText(++iIndex, gpConverter->toString(KAudioDriverType_WinMM));174 # endif175 #endif176 #ifdef VBOX_WITH_AUDIO_OSS177 m_pComboAudioDriver->setItemText(++iIndex, gpConverter->toString(KAudioDriverType_OSS));178 #endif179 #ifdef VBOX_WITH_AUDIO_ALSA180 m_pComboAudioDriver->setItemText(++iIndex, gpConverter->toString(KAudioDriverType_ALSA));181 #endif182 #ifdef VBOX_WITH_AUDIO_PULSE183 m_pComboAudioDriver->setItemText(++iIndex, gpConverter->toString(KAudioDriverType_Pulse));184 #endif185 #ifdef Q_OS_MACX186 m_pComboAudioDriver->setItemText(++iIndex, gpConverter->toString(KAudioDriverType_CoreAudio));187 #endif188 189 /* Translate audio-controller combo.190 * Make sure this order corresponds the same in prepare(): */191 iIndex = -1;192 169 m_pComboAudioController->setItemText(++iIndex, gpConverter->toString(KAudioControllerType_HDA)); 193 170 m_pComboAudioController->setItemText(++iIndex, gpConverter->toString(KAudioControllerType_AC97)); … … 199 176 /* Polish audio page availability: */ 200 177 m_pCheckBoxAudio->setEnabled(isMachineOffline()); 201 m_p LabelAudioDriver->setEnabled(isMachineOffline());202 m_p ComboAudioDriver->setEnabled(isMachineOffline());178 m_pAudioHostDriverLabel->setEnabled(isMachineOffline()); 179 m_pAudioHostDriverEditor->setEnabled(isMachineOffline()); 203 180 m_pLabelAudioController->setEnabled(isMachineOffline()); 204 181 m_pComboAudioController->setEnabled(isMachineOffline()); … … 220 197 /* Layout created in the .ui file. */ 221 198 { 222 /* Audio-driver combo-box created in the .ui file. */ 223 AssertPtrReturnVoid(m_pComboAudioDriver); 199 /* Audio host-driver label & editor created in the .ui file. */ 200 AssertPtrReturnVoid(m_pAudioHostDriverLabel); 201 AssertPtrReturnVoid(m_pAudioHostDriverEditor); 224 202 { 225 /* Configure combo-box. 226 * Make sure this order corresponds the same in retranslateUi(): */ 227 int iIndex = -1; 228 m_pComboAudioDriver->insertItem(++iIndex, "", KAudioDriverType_Null); 229 #ifdef Q_OS_WIN 230 m_pComboAudioDriver->insertItem(++iIndex, "", KAudioDriverType_DirectSound); 231 # ifdef VBOX_WITH_WINMM 232 m_pComboAudioDriver->insertItem(++iIndex, "", KAudioDriverType_WinMM); 233 # endif 234 #endif 235 #ifdef VBOX_WITH_AUDIO_OSS 236 m_pComboAudioDriver->insertItem(++iIndex, "", KAudioDriverType_OSS); 237 #endif 238 #ifdef VBOX_WITH_AUDIO_ALSA 239 m_pComboAudioDriver->insertItem(++iIndex, "", KAudioDriverType_ALSA); 240 #endif 241 #ifdef VBOX_WITH_AUDIO_PULSE 242 m_pComboAudioDriver->insertItem(++iIndex, "", KAudioDriverType_Pulse); 243 #endif 244 #ifdef Q_OS_MACX 245 m_pComboAudioDriver->insertItem(++iIndex, "", KAudioDriverType_CoreAudio); 246 #endif 203 /* Configure label & editor: */ 204 m_pAudioHostDriverLabel->setBuddy(m_pAudioHostDriverEditor->focusProxy()); 247 205 } 248 206 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsAudio.ui
r71027 r80079 52 52 </property> 53 53 <item row="0" column="0"> 54 <widget class="QLabel" name="m_p LabelAudioDriver">54 <widget class="QLabel" name="m_pAudioHostDriverLabel"> 55 55 <property name="text"> 56 56 <string>Host Audio &Driver:</string> … … 59 59 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 60 60 </property> 61 <property name="buddy">62 <cstring>m_pComboAudioDriver</cstring>63 </property>64 61 </widget> 65 62 </item> 66 63 <item row="0" column="1"> 67 <widget class=" QComboBox" name="m_pComboAudioDriver">64 <widget class="UIAudioHostDriverEditor" name="m_pAudioHostDriverEditor"> 68 65 <property name="sizePolicy"> 69 66 <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> … … 167 164 </widget> 168 165 <resources/> 166 <customwidgets> 167 <customwidget> 168 <class>UIAudioHostDriverEditor</class> 169 <extends>QWidget</extends> 170 <header>UIAudioHostDriverEditor.h</header> 171 </customwidget> 172 </customwidgets> 169 173 <connections> 170 174 <connection> -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAudioHostDriverEditor.cpp
r80072 r80079 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GraphicsControllerEditor class implementation.3 * VBox Qt GUI - UIAudioHostDriverEditor class implementation. 4 4 */ 5 5 … … 24 24 #include "QIComboBox.h" 25 25 #include "UIConverter.h" 26 #include "UI GraphicsControllerEditor.h"26 #include "UIAudioHostDriverEditor.h" 27 27 28 28 29 UI GraphicsControllerEditor::UIGraphicsControllerEditor(QWidget *pParent /* = 0 */, bool fWithLabel /* = false */)29 UIAudioHostDriverEditor::UIAudioHostDriverEditor(QWidget *pParent /* = 0 */, bool fWithLabel /* = false */) 30 30 : QIWithRetranslateUI<QWidget>(pParent) 31 31 , m_fWithLabel(fWithLabel) … … 36 36 } 37 37 38 void UI GraphicsControllerEditor::setValue(KGraphicsControllerType enmValue)38 void UIAudioHostDriverEditor::setValue(KAudioDriverType enmValue) 39 39 { 40 40 if (m_pCombo) … … 46 46 } 47 47 48 K GraphicsControllerType UIGraphicsControllerEditor::value() const48 KAudioDriverType UIAudioHostDriverEditor::value() const 49 49 { 50 return m_pCombo ? m_pCombo->itemData(m_pCombo->currentIndex()).value<K GraphicsControllerType>() : KGraphicsControllerType_Null;50 return m_pCombo ? m_pCombo->itemData(m_pCombo->currentIndex()).value<KAudioDriverType>() : KAudioDriverType_Null; 51 51 } 52 52 53 void UI GraphicsControllerEditor::retranslateUi()53 void UIAudioHostDriverEditor::retranslateUi() 54 54 { 55 55 if (m_pLabel) 56 m_pLabel->setText(tr(" &Graphics Controller:"));56 m_pLabel->setText(tr("Host Audio &Driver:")); 57 57 if (m_pCombo) 58 58 { 59 59 for (int i = 0; i < m_pCombo->count(); ++i) 60 60 { 61 const K GraphicsControllerType enmType = m_pCombo->itemData(i).value<KGraphicsControllerType>();61 const KAudioDriverType enmType = m_pCombo->itemData(i).value<KAudioDriverType>(); 62 62 m_pCombo->setItemText(i, gpConverter->toString(enmType)); 63 63 } … … 65 65 } 66 66 67 void UI GraphicsControllerEditor::sltHandleCurrentIndexChanged()67 void UIAudioHostDriverEditor::sltHandleCurrentIndexChanged() 68 68 { 69 69 if (m_pCombo) 70 emit sigValueChanged(m_pCombo->itemData(m_pCombo->currentIndex()).value<K GraphicsControllerType>());70 emit sigValueChanged(m_pCombo->itemData(m_pCombo->currentIndex()).value<KAudioDriverType>()); 71 71 } 72 72 73 void UI GraphicsControllerEditor::prepare()73 void UIAudioHostDriverEditor::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, &UI GraphicsControllerEditor::sltHandleCurrentIndexChanged);100 this, &UIAudioHostDriverEditor::sltHandleCurrentIndexChanged); 101 101 pComboLayout->addWidget(m_pCombo); 102 102 } … … 117 117 } 118 118 119 void UI GraphicsControllerEditor::populateCombo()119 void UIAudioHostDriverEditor::populateCombo() 120 120 { 121 for (int i = 0; i < KGraphicsControllerType_Max; ++i) 122 m_pCombo->addItem(QString(), QVariant::fromValue(static_cast<KGraphicsControllerType>(i))); 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 123 141 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAudioHostDriverEditor.h
r80068 r80079 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI GraphicsControllerEditor class declaration.3 * VBox Qt GUI - UIAudioHostDriverEditor class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_widgets_UI GraphicsControllerEditor_h19 #define FEQT_INCLUDED_SRC_widgets_UI GraphicsControllerEditor_h18 #ifndef FEQT_INCLUDED_SRC_widgets_UIAudioHostDriverEditor_h 19 #define FEQT_INCLUDED_SRC_widgets_UIAudioHostDriverEditor_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 36 36 class QIComboBox; 37 37 38 /** QWidget subclass used as a graphics controller editor. */39 class SHARED_LIBRARY_STUFF UI GraphicsControllerEditor : public QIWithRetranslateUI<QWidget>38 /** QWidget subclass used as a audio host driver editor. */ 39 class SHARED_LIBRARY_STUFF UIAudioHostDriverEditor : public QIWithRetranslateUI<QWidget> 40 40 { 41 41 Q_OBJECT; … … 44 44 45 45 /** Notifies listeners about @a enmValue change. */ 46 void sigValueChanged(K GraphicsControllerType enmValue);46 void sigValueChanged(KAudioDriverType enmValue); 47 47 48 48 public: 49 49 50 /** Constructs graphics controller editor passing @a pParent to the base-class.50 /** Constructs audio host driver editor passing @a pParent to the base-class. 51 51 * @param fWithLabel Brings whether we should add label ourselves. */ 52 UI GraphicsControllerEditor(QWidget *pParent = 0, bool fWithLabel = false);52 UIAudioHostDriverEditor(QWidget *pParent = 0, bool fWithLabel = false); 53 53 54 54 /** Defines editor @a enmValue. */ 55 void setValue(K GraphicsControllerType enmValue);55 void setValue(KAudioDriverType enmValue); 56 56 /** Returns editor value. */ 57 K GraphicsControllerType value() const;57 KAudioDriverType value() const; 58 58 59 59 protected: … … 83 83 }; 84 84 85 #endif /* !FEQT_INCLUDED_SRC_widgets_UI GraphicsControllerEditor_h */85 #endif /* !FEQT_INCLUDED_SRC_widgets_UIAudioHostDriverEditor_h */
Note:
See TracChangeset
for help on using the changeset viewer.