Changeset 86978 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 25, 2020 4:56:23 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 141520
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 6 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r86814 r86978 850 850 src/settings/editors/UIHotKeyEditor.h \ 851 851 src/settings/editors/UILanguageSettingsEditor.h \ 852 src/settings/editors/UIMaximumGuestScreenSizeEditor.h \ 852 853 src/settings/editors/UINameAndSystemEditor.h \ 853 854 src/settings/editors/UINetworkAttachmentEditor.h \ … … 1376 1377 src/settings/editors/UIHotKeyEditor.cpp \ 1377 1378 src/settings/editors/UILanguageSettingsEditor.cpp \ 1379 src/settings/editors/UIMaximumGuestScreenSizeEditor.cpp \ 1378 1380 src/settings/editors/UINameAndSystemEditor.cpp \ 1379 1381 src/settings/editors/UINetworkAttachmentEditor.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r86977 r86978 262 262 template<> SHARED_LIBRARY_STUFF InformationElementType fromInternalString<InformationElementType>(const QString &strInformationElementType); 263 263 template<> SHARED_LIBRARY_STUFF QIcon toIcon(const InformationElementType &informationElementType); 264 template<> SHARED_LIBRARY_STUFF QString toString(const MaximumGuestScreenSizePolicy &enmMaximumGuestScreenSizePolicy); 264 265 template<> SHARED_LIBRARY_STUFF QString toInternalString(const MaximumGuestScreenSizePolicy &enmMaximumGuestScreenSizePolicy); 265 266 template<> SHARED_LIBRARY_STUFF MaximumGuestScreenSizePolicy fromInternalString<MaximumGuestScreenSizePolicy>(const QString &strMaximumGuestScreenSizePolicy); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r86977 r86978 2458 2458 2459 2459 /* QString <= MaximumGuestScreenSizePolicy: */ 2460 template<> QString toString(const MaximumGuestScreenSizePolicy &enmMaximumGuestScreenSizePolicy) 2461 { 2462 QString strResult; 2463 switch (enmMaximumGuestScreenSizePolicy) 2464 { 2465 case MaximumGuestScreenSizePolicy_Any: strResult = QApplication::translate("UICommon", "None", "Maximum Guest Screen Size"); break; 2466 case MaximumGuestScreenSizePolicy_Fixed: strResult = QApplication::translate("UICommon", "Hint", "Maximum Guest Screen Size"); break; 2467 case MaximumGuestScreenSizePolicy_Automatic: strResult = QApplication::translate("UICommon", "Automatic", "Maximum Guest Screen Size"); break; 2468 default: 2469 { 2470 AssertMsgFailed(("No text for maximum guest resolution policy=%d", enmMaximumGuestScreenSizePolicy)); 2471 break; 2472 } 2473 } 2474 return strResult; 2475 } 2476 2477 /* QString <= MaximumGuestScreenSizePolicy: */ 2460 2478 template<> QString toInternalString(const MaximumGuestScreenSizePolicy &enmMaximumGuestScreenSizePolicy) 2461 2479 { … … 2467 2485 default: 2468 2486 { 2469 AssertMsgFailed(("No text for max guest resolution policy=%d", enmMaximumGuestScreenSizePolicy));2487 AssertMsgFailed(("No text for maximum guest resolution policy=%d", enmMaximumGuestScreenSizePolicy)); 2470 2488 break; 2471 2489 } -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r86977 r86978 1071 1071 MaximumGuestScreenSizePolicy_Automatic 1072 1072 }; 1073 Q_DECLARE_METATYPE(MaximumGuestScreenSizePolicy); 1073 1074 1074 1075 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIMaximumGuestScreenSizeEditor.cpp
r86910 r86978 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI AudioControllerEditor class implementation.3 * VBox Qt GUI - UIMaximumGuestScreenSizeEditor class implementation. 4 4 */ 5 5 … … 20 20 #include <QHBoxLayout> 21 21 #include <QLabel> 22 #include <QSpinBox> 22 23 23 24 /* GUI includes: */ … … 25 26 #include "UICommon.h" 26 27 #include "UIConverter.h" 27 #include "UIAudioControllerEditor.h" 28 29 /* COM includes: */ 30 #include "CSystemProperties.h" 31 32 33 UIAudioControllerEditor::UIAudioControllerEditor(QWidget *pParent /* = 0 */, bool fWithLabel /* = false */) 28 #include "UIMaximumGuestScreenSizeEditor.h" 29 30 31 /********************************************************************************************************************************* 32 * Class UIMaximumGuestScreenSizeValue implementation. * 33 *********************************************************************************************************************************/ 34 35 UIMaximumGuestScreenSizeValue::UIMaximumGuestScreenSizeValue(MaximumGuestScreenSizePolicy enmPolicy /* = MaximumGuestScreenSizePolicy_Any */, 36 const QSize &size /* = QSize() */) 37 : m_enmPolicy(enmPolicy) 38 , m_size(size) 39 { 40 } 41 42 bool UIMaximumGuestScreenSizeValue::equal(const UIMaximumGuestScreenSizeValue &other) const 43 { 44 return true 45 && (m_enmPolicy == other.m_enmPolicy) 46 && (m_size == other.m_size) 47 ; 48 } 49 50 51 /********************************************************************************************************************************* 52 * Class UIMaximumGuestScreenSizeEditor implementation. * 53 *********************************************************************************************************************************/ 54 55 UIMaximumGuestScreenSizeEditor::UIMaximumGuestScreenSizeEditor(QWidget *pParent /* = 0 */, bool fWithLabels /* = false */) 34 56 : QIWithRetranslateUI<QWidget>(pParent) 35 , m_fWithLabel(fWithLabel) 36 , m_enmValue(KAudioControllerType_Max) 37 , m_pLabel(0) 38 , m_pCombo(0) 57 , m_fWithLabels(fWithLabels) 58 , m_pLabelPolicy(0) 59 , m_pComboPolicy(0) 60 , m_pLabelMaxWidth(0) 61 , m_pSpinboxMaxWidth(0) 62 , m_pLabelMaxHeight(0) 63 , m_pSpinboxMaxHeight(0) 39 64 { 40 65 prepare(); 41 66 } 42 67 43 void UIAudioControllerEditor::setValue(KAudioControllerType enmValue) 44 { 45 if (m_pCombo) 46 { 47 /* Update cached value and 48 * combo if value has changed: */ 49 if (m_enmValue != enmValue) 50 { 51 m_enmValue = enmValue; 52 populateCombo(); 53 } 54 55 /* Look for proper index to choose: */ 56 int iIndex = m_pCombo->findData(QVariant::fromValue(m_enmValue)); 68 QWidget *UIMaximumGuestScreenSizeEditor::focusProxy1() const 69 { 70 return m_pComboPolicy->focusProxy(); 71 } 72 73 QWidget *UIMaximumGuestScreenSizeEditor::focusProxy2() const 74 { 75 return m_pSpinboxMaxWidth; 76 } 77 78 QWidget *UIMaximumGuestScreenSizeEditor::focusProxy3() const 79 { 80 return m_pSpinboxMaxHeight; 81 } 82 83 void UIMaximumGuestScreenSizeEditor::setValue(const UIMaximumGuestScreenSizeValue &guiValue) 84 { 85 /* Update cached value if value has changed: */ 86 if (m_guiValue != guiValue) 87 m_guiValue = guiValue; 88 89 /* Look for proper policy index to choose: */ 90 if (m_pComboPolicy) 91 { 92 const int iIndex = m_pComboPolicy->findData(QVariant::fromValue(guiValue.m_enmPolicy)); 57 93 if (iIndex != -1) 58 m_pCombo->setCurrentIndex(iIndex); 59 } 60 } 61 62 KAudioControllerType UIAudioControllerEditor::value() const 63 { 64 return m_pCombo ? m_pCombo->currentData().value<KAudioControllerType>() : m_enmValue; 65 } 66 67 void UIAudioControllerEditor::retranslateUi() 68 { 69 if (m_pLabel) 70 m_pLabel->setText(tr("Audio &Controller:")); 71 if (m_pCombo) 72 { 73 for (int i = 0; i < m_pCombo->count(); ++i) 74 { 75 const KAudioControllerType enmType = m_pCombo->itemData(i).value<KAudioControllerType>(); 76 m_pCombo->setItemText(i, gpConverter->toString(enmType)); 77 } 78 } 79 } 80 81 void UIAudioControllerEditor::sltHandleCurrentIndexChanged() 82 { 83 if (m_pCombo) 84 emit sigValueChanged(m_pCombo->itemData(m_pCombo->currentIndex()).value<KAudioControllerType>()); 85 } 86 87 void UIAudioControllerEditor::prepare() 94 { 95 m_pComboPolicy->setCurrentIndex(iIndex); 96 sltHandleCurrentPolicyIndexChanged(); 97 } 98 } 99 /* Load size as well: */ 100 if (m_pSpinboxMaxWidth && m_pSpinboxMaxHeight) 101 { 102 if (guiValue.m_enmPolicy == MaximumGuestScreenSizePolicy_Fixed) 103 { 104 m_pSpinboxMaxWidth->setValue(guiValue.m_size.width()); 105 m_pSpinboxMaxHeight->setValue(guiValue.m_size.height()); 106 } 107 } 108 } 109 110 UIMaximumGuestScreenSizeValue UIMaximumGuestScreenSizeEditor::value() const 111 { 112 return m_pComboPolicy && m_pSpinboxMaxWidth && m_pSpinboxMaxHeight 113 ? UIMaximumGuestScreenSizeValue(m_pComboPolicy->currentData().value<MaximumGuestScreenSizePolicy>(), 114 QSize(m_pSpinboxMaxWidth->value(), m_pSpinboxMaxHeight->value())) 115 : m_guiValue; 116 } 117 118 void UIMaximumGuestScreenSizeEditor::retranslateUi() 119 { 120 if (m_pLabelPolicy) 121 m_pLabelPolicy->setText(tr("Maximum Guest Screen &Size:")); 122 if (m_pLabelMaxWidth) 123 m_pLabelMaxWidth->setText(tr("&Width:")); 124 if (m_pSpinboxMaxWidth) 125 m_pSpinboxMaxWidth->setWhatsThis(tr("Holds the maximum width which we would like the guest to use.")); 126 if (m_pLabelMaxHeight) 127 m_pLabelMaxHeight->setText(tr("&Height:")); 128 if (m_pSpinboxMaxHeight) 129 m_pSpinboxMaxHeight->setWhatsThis(tr("Holds the maximum height which we would like the guest to use.")); 130 131 if (m_pComboPolicy) 132 { 133 for (int i = 0; i < m_pComboPolicy->count(); ++i) 134 { 135 const MaximumGuestScreenSizePolicy enmType = m_pComboPolicy->itemData(i).value<MaximumGuestScreenSizePolicy>(); 136 m_pComboPolicy->setItemText(i, gpConverter->toString(enmType)); 137 switch (enmType) 138 { 139 case MaximumGuestScreenSizePolicy_Automatic: 140 m_pComboPolicy->setItemData(i, 141 tr("Suggest a reasonable maximum screen size to the guest. The guest " 142 "will only see this suggestion when guest additions are installed."), 143 Qt::ToolTipRole); 144 break; 145 case MaximumGuestScreenSizePolicy_Any: 146 m_pComboPolicy->setItemData(i, 147 tr("Do not attempt to limit the size of the guest screen."), 148 Qt::ToolTipRole); 149 break; 150 case MaximumGuestScreenSizePolicy_Fixed: 151 m_pComboPolicy->setItemData(i, 152 tr("Suggest a maximum screen size to the guest. The guest will only see " 153 "this suggestion when guest additions are installed."), 154 Qt::ToolTipRole); 155 break; 156 } 157 } 158 } 159 } 160 161 void UIMaximumGuestScreenSizeEditor::sltHandleCurrentPolicyIndexChanged() 162 { 163 if (m_pComboPolicy) 164 { 165 /* Get current size-combo tool-tip data: */ 166 const QString strCurrentComboItemTip = m_pComboPolicy->currentData(Qt::ToolTipRole).toString(); 167 m_pComboPolicy->setWhatsThis(strCurrentComboItemTip); 168 169 /* Get current size-combo item data: */ 170 const MaximumGuestScreenSizePolicy enmPolicy = m_pComboPolicy->currentData().value<MaximumGuestScreenSizePolicy>(); 171 /* Should be combo-level widgets enabled? */ 172 const bool fComboLevelWidgetsEnabled = enmPolicy == MaximumGuestScreenSizePolicy_Fixed; 173 /* Enable/disable combo-level widgets: */ 174 if (m_pLabelMaxWidth) 175 m_pLabelMaxWidth->setEnabled(fComboLevelWidgetsEnabled); 176 if (m_pSpinboxMaxWidth) 177 m_pSpinboxMaxWidth->setEnabled(fComboLevelWidgetsEnabled); 178 if (m_pLabelMaxHeight) 179 m_pLabelMaxHeight->setEnabled(fComboLevelWidgetsEnabled); 180 if (m_pSpinboxMaxHeight) 181 m_pSpinboxMaxHeight->setEnabled(fComboLevelWidgetsEnabled); 182 183 /* Notify listeners: */ 184 emit sigValueChanged(value()); 185 } 186 } 187 188 void UIMaximumGuestScreenSizeEditor::sltHandleSizeChanged() 189 { 190 if (m_pSpinboxMaxWidth && m_pSpinboxMaxHeight) 191 { 192 /* Notify listeners: */ 193 emit sigValueChanged(value()); 194 } 195 } 196 197 void UIMaximumGuestScreenSizeEditor::prepare() 88 198 { 89 199 /* Create main layout: */ 90 QGridLayout *pMainLayout = new QGridLayout(this); 91 if (pMainLayout) 92 { 93 pMainLayout->setContentsMargins(0, 0, 0, 0); 94 int iRow = 0; 95 96 /* Create label: */ 97 if (m_fWithLabel) 98 m_pLabel = new QLabel(this); 99 if (m_pLabel) 100 pMainLayout->addWidget(m_pLabel, 0, iRow++, 1, 1); 101 102 /* Create combo layout: */ 103 QHBoxLayout *pComboLayout = new QHBoxLayout; 104 if (pComboLayout) 105 { 106 /* Create combo: */ 107 m_pCombo = new QIComboBox(this); 108 if (m_pCombo) 200 QGridLayout *pLayoutMain = new QGridLayout(this); 201 if (pLayoutMain) 202 { 203 pLayoutMain->setContentsMargins(0, 0, 0, 0); 204 205 const int iMinWidth = 640; 206 const int iMinHeight = 480; 207 const int iMaxSize = 16 * _1K; 208 209 int iColumn = 0; 210 if (m_fWithLabels) 211 { 212 /* Prepare policy label: */ 213 m_pLabelPolicy = new QLabel(this); 214 if (m_pLabelPolicy) 109 215 { 110 setFocusProxy(m_pCombo->focusProxy()); 111 /* This is necessary since contents is dynamical now: */ 112 m_pCombo->setSizeAdjustPolicy(QComboBox::AdjustToContents); 113 if (m_pLabel) 114 m_pLabel->setBuddy(m_pCombo->focusProxy()); 115 connect(m_pCombo, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::currentIndexChanged), 116 this, &UIAudioControllerEditor::sltHandleCurrentIndexChanged); 117 pComboLayout->addWidget(m_pCombo); 216 m_pLabelPolicy->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 217 pLayoutMain->addWidget(m_pLabelPolicy, 0, iColumn++); 118 218 } 119 120 /* Add stretch: */ 121 pComboLayout->addStretch(); 122 123 /* Add combo-layout into main-layout: */ 124 pMainLayout->addLayout(pComboLayout, 0, iRow++, 1, 1); 219 } 220 /* Prepare policy combo: */ 221 m_pComboPolicy = new QIComboBox(this); 222 if (m_pComboPolicy) 223 { 224 if (m_pLabelPolicy) 225 m_pLabelPolicy->setBuddy(m_pComboPolicy); 226 connect(m_pComboPolicy, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated), 227 this, &UIMaximumGuestScreenSizeEditor::sltHandleCurrentPolicyIndexChanged); 228 229 pLayoutMain->addWidget(m_pComboPolicy, 0, iColumn++); 230 } 231 232 iColumn = 0; 233 if (m_fWithLabels) 234 { 235 /* Prepare max width label: */ 236 m_pLabelMaxWidth = new QLabel(this); 237 if (m_pLabelMaxWidth) 238 { 239 m_pLabelMaxWidth->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 240 pLayoutMain->addWidget(m_pLabelMaxWidth, 1, iColumn++); 241 } 242 } 243 /* Prepare max width spinbox: */ 244 m_pSpinboxMaxWidth = new QSpinBox(this); 245 if (m_pSpinboxMaxWidth) 246 { 247 if (m_pLabelMaxWidth) 248 m_pLabelMaxWidth->setBuddy(m_pSpinboxMaxWidth); 249 m_pSpinboxMaxWidth->setMinimum(iMinWidth); 250 m_pSpinboxMaxWidth->setMaximum(iMaxSize); 251 connect(m_pSpinboxMaxWidth, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), 252 this, &UIMaximumGuestScreenSizeEditor::sltHandleSizeChanged); 253 254 pLayoutMain->addWidget(m_pSpinboxMaxWidth, 1, iColumn++); 255 } 256 257 iColumn = 0; 258 if (m_fWithLabels) 259 { 260 /* Prepare max height label: */ 261 m_pLabelMaxHeight = new QLabel(this); 262 if (m_pLabelMaxHeight) 263 { 264 m_pLabelMaxHeight->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 265 pLayoutMain->addWidget(m_pLabelMaxHeight, 2, iColumn++); 266 } 267 } 268 /* Prepare max width spinbox: */ 269 m_pSpinboxMaxHeight = new QSpinBox(this); 270 if (m_pSpinboxMaxHeight) 271 { 272 if (m_pLabelMaxHeight) 273 m_pLabelMaxHeight->setBuddy(m_pSpinboxMaxHeight); 274 m_pSpinboxMaxHeight->setMinimum(iMinHeight); 275 m_pSpinboxMaxHeight->setMaximum(iMaxSize); 276 connect(m_pSpinboxMaxHeight, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), 277 this, &UIMaximumGuestScreenSizeEditor::sltHandleSizeChanged); 278 279 pLayoutMain->addWidget(m_pSpinboxMaxHeight, 2, iColumn++); 125 280 } 126 281 } … … 133 288 } 134 289 135 void UI AudioControllerEditor::populateCombo()136 { 137 if (m_pCombo )290 void UIMaximumGuestScreenSizeEditor::populateCombo() 291 { 292 if (m_pComboPolicy) 138 293 { 139 294 /* Clear combo first of all: */ 140 m_pCombo->clear(); 141 142 /* Load currently supported audio driver types: */ 143 CSystemProperties comProperties = uiCommon().virtualBox().GetSystemProperties(); 144 m_supportedValues = comProperties.GetSupportedAudioControllerTypes(); 145 146 /* Make sure requested value if sane is present as well: */ 147 if ( m_enmValue != KAudioControllerType_Max 148 && !m_supportedValues.contains(m_enmValue)) 149 m_supportedValues.prepend(m_enmValue); 295 m_pComboPolicy->clear(); 296 297 /* Init currently supported maximum guest size policy types: */ 298 QList<MaximumGuestScreenSizePolicy> supportedValues = QList<MaximumGuestScreenSizePolicy>() 299 << MaximumGuestScreenSizePolicy_Automatic 300 << MaximumGuestScreenSizePolicy_Any 301 << MaximumGuestScreenSizePolicy_Fixed; 150 302 151 303 /* Update combo with all the supported values: */ 152 foreach (const KAudioControllerType &enmType, m_supportedValues)153 m_pCombo ->addItem(QString(), QVariant::fromValue(enmType));304 foreach (const MaximumGuestScreenSizePolicy &enmType, supportedValues) 305 m_pComboPolicy->addItem(QString(), QVariant::fromValue(enmType)); 154 306 155 307 /* Retranslate finally: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIMaximumGuestScreenSizeEditor.h
r86910 r86978 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - UI AudioControllerEditor class declaration.3 * VBox Qt GUI - UIMaximumGuestScreenSizeEditor class declaration. 4 4 */ 5 5 … … 16 16 */ 17 17 18 #ifndef FEQT_INCLUDED_SRC_settings_editors_UI AudioControllerEditor_h19 #define FEQT_INCLUDED_SRC_settings_editors_UI AudioControllerEditor_h18 #ifndef FEQT_INCLUDED_SRC_settings_editors_UIMaximumGuestScreenSizeEditor_h 19 #define FEQT_INCLUDED_SRC_settings_editors_UIMaximumGuestScreenSizeEditor_h 20 20 #ifndef RT_WITHOUT_PRAGMA_ONCE 21 21 # pragma once … … 27 27 /* GUI includes: */ 28 28 #include "QIWithRetranslateUI.h" 29 #include "UIExtraDataDefs.h" 29 30 #include "UILibraryDefs.h" 30 31 /* COM includes: */32 #include "COMEnums.h"33 31 34 32 /* Forward declarations: */ 35 33 class QLabel; 34 class QSpinBox; 36 35 class QIComboBox; 37 36 38 /** QWidget subclass used as an audio controller editor. */ 39 class SHARED_LIBRARY_STUFF UIAudioControllerEditor : public QIWithRetranslateUI<QWidget> 37 38 /** Maximum guest screen size value. */ 39 struct SHARED_LIBRARY_STUFF UIMaximumGuestScreenSizeValue 40 { 41 /** Constructs maximum guest screen size value. */ 42 UIMaximumGuestScreenSizeValue(MaximumGuestScreenSizePolicy enmPolicy = MaximumGuestScreenSizePolicy_Any, 43 const QSize &resolution = QSize()); 44 45 /** Returns whether the @a other passed data is equal to this one. */ 46 bool equal(const UIMaximumGuestScreenSizeValue &other) const; 47 /** Returns whether the @a other passed data is equal to this one. */ 48 bool operator==(const UIMaximumGuestScreenSizeValue &other) const { return equal(other); } 49 /** Returns whether the @a other passed data is different from this one. */ 50 bool operator!=(const UIMaximumGuestScreenSizeValue &other) const { return !equal(other); } 51 52 /** Holds the maximum guest-screen policy. */ 53 MaximumGuestScreenSizePolicy m_enmPolicy; 54 /** Holds the maximum guest-screen size. */ 55 QSize m_size; 56 }; 57 Q_DECLARE_METATYPE(UIMaximumGuestScreenSizeValue); 58 59 60 /** QWidget subclass used as a maximum guest screen size editor. */ 61 class SHARED_LIBRARY_STUFF UIMaximumGuestScreenSizeEditor : public QIWithRetranslateUI<QWidget> 40 62 { 41 63 Q_OBJECT; … … 43 65 signals: 44 66 45 /** Notifies listeners about @a enmValue change. */46 void sigValueChanged( KAudioControllerType enmValue);67 /** Notifies listeners about @a guiValue change. */ 68 void sigValueChanged(const UIMaximumGuestScreenSizeValue &guiValue); 47 69 48 70 public: 49 71 50 /** Constructs audio controllereditor passing @a pParent to the base-class.51 * @param fWithLabel Brings whether we should add labelourselves. */52 UI AudioControllerEditor(QWidget *pParent = 0, bool fWithLabel= false);72 /** Constructs maximum guest screen size editor passing @a pParent to the base-class. 73 * @param fWithLabels Brings whether we should add labels ourselves. */ 74 UIMaximumGuestScreenSizeEditor(QWidget *pParent = 0, bool fWithLabels = false); 53 75 54 /** Defines editor @a enmValue. */ 55 void setValue(KAudioControllerType enmValue); 76 /** Returns focus proxy 1. */ 77 QWidget *focusProxy1() const; 78 /** Returns focus proxy 2. */ 79 QWidget *focusProxy2() const; 80 /** Returns focus proxy 3. */ 81 QWidget *focusProxy3() const; 82 83 /** Defines editor @a guiValue. */ 84 void setValue(const UIMaximumGuestScreenSizeValue &guiValue); 56 85 /** Returns editor value. */ 57 KAudioControllerType value() const; 58 59 /** Returns the vector of supported values. */ 60 QVector<KAudioControllerType> supportedValues() const { return m_supportedValues; } 86 UIMaximumGuestScreenSizeValue value() const; 61 87 62 88 protected: … … 67 93 private slots: 68 94 69 /** Handles current index change. */ 70 void sltHandleCurrentIndexChanged(); 95 /** Handles current policy index change. */ 96 void sltHandleCurrentPolicyIndexChanged(); 97 /** Handles size change. */ 98 void sltHandleSizeChanged(); 71 99 72 100 private: … … 77 105 void populateCombo(); 78 106 79 /** Holds whether descriptive label should be created. */80 bool m_fWithLabel ;107 /** Holds whether descriptive labels should be created. */ 108 bool m_fWithLabels; 81 109 82 110 /** Holds the value to be selected. */ 83 KAudioControllerType m_enmValue;111 UIMaximumGuestScreenSizeValue m_guiValue; 84 112 85 /** Holds the vector of supported values. */ 86 QVector<KAudioControllerType> m_supportedValues; 87 88 /** Holds the label instance. */ 89 QLabel *m_pLabel; 90 /** Holds the combo instance. */ 91 QIComboBox *m_pCombo; 113 /** Holds the policy label instance. */ 114 QLabel *m_pLabelPolicy; 115 /** Holds the policy combo instance. */ 116 QIComboBox *m_pComboPolicy; 117 /** Holds the max width label instance. */ 118 QLabel *m_pLabelMaxWidth; 119 /** Holds the max width spinbox instance. */ 120 QSpinBox *m_pSpinboxMaxWidth; 121 /** Holds the max height label instance. */ 122 QLabel *m_pLabelMaxHeight; 123 /** Holds the max height spinbox instance. */ 124 QSpinBox *m_pSpinboxMaxHeight; 92 125 }; 93 126 94 #endif /* !FEQT_INCLUDED_SRC_settings_editors_UIAudioControllerEditor_h */ 127 128 #endif /* !FEQT_INCLUDED_SRC_settings_editors_UIMaximumGuestScreenSizeEditor_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.cpp
r86977 r86978 18 18 /* Qt includes: */ 19 19 #include <QCheckBox> 20 #include <QComboBox>21 20 #include <QGridLayout> 22 21 #include <QLabel> 23 #include <QSpacerItem>24 #include <QSpinBox>25 22 26 23 /* GUI includes: */ … … 28 25 #include "UIExtraDataManager.h" 29 26 #include "UIGlobalSettingsDisplay.h" 27 #include "UIMaximumGuestScreenSizeEditor.h" 30 28 #include "UIMessageCenter.h" 31 29 #include "UIScaleFactorEditor.h" 32 30 31 33 32 /** Global settings: Display page data structure. */ 34 33 struct UIDataSettingsGlobalDisplay … … 36 35 /** Constructs data. */ 37 36 UIDataSettingsGlobalDisplay() 38 : m_enmMaximumGuestScreenSizePolicy(MaximumGuestScreenSizePolicy_Automatic) 39 , m_maximumGuestScreenSize(QSize()) 40 , m_fActivateHoveredMachineWindow(false) 37 : m_fActivateHoveredMachineWindow(false) 41 38 {} 42 39 … … 45 42 { 46 43 return true 47 && (m_enmMaximumGuestScreenSizePolicy == other.m_enmMaximumGuestScreenSizePolicy) 48 && (m_maximumGuestScreenSize == other.m_maximumGuestScreenSize) 44 && (m_guiMaximumGuestScreenSizeValue == other.m_guiMaximumGuestScreenSizeValue) 49 45 && (m_fActivateHoveredMachineWindow == other.m_fActivateHoveredMachineWindow) 50 46 && (m_scaleFactors == other.m_scaleFactors) … … 57 53 bool operator!=(const UIDataSettingsGlobalDisplay &other) const { return !equal(other); } 58 54 59 /** Holds the maximum guest-screen size policy. */ 60 MaximumGuestScreenSizePolicy m_enmMaximumGuestScreenSizePolicy; 61 /** Holds the maximum guest-screen size. */ 62 QSize m_maximumGuestScreenSize; 55 /** Holds the maximum guest-screen size value. */ 56 UIMaximumGuestScreenSizeValue m_guiMaximumGuestScreenSizeValue; 63 57 /** Holds whether we should automatically activate machine window under the mouse cursor. */ 64 bool m_fActivateHoveredMachineWindow;58 bool m_fActivateHoveredMachineWindow; 65 59 /** Holds the guest screen scale-factor. */ 66 QList<double> m_scaleFactors;60 QList<double> m_scaleFactors; 67 61 }; 68 62 … … 70 64 UIGlobalSettingsDisplay::UIGlobalSettingsDisplay() 71 65 : m_pCache(0) 72 , m_pLabelMaxGuestScreenSize(0) 73 , m_pComboMaxGuestScreenSize(0) 74 , m_pLabelMaxGuestScreenWidth(0) 75 , m_pSpinboxMaxGuestScreenWidth(0) 76 , m_pLabelMaxGuestScreenHeight(0) 77 , m_pSpinboxMaxGuestScreenHeight(0) 66 , m_pLabelMaximumGuestScreenSizePolicy(0) 67 , m_pLabelMaximumGuestScreenWidth(0) 68 , m_pLabelMaximumGuestScreenHeight(0) 69 , m_pEditorMaximumGuestScreenSize(0) 78 70 , m_pLabelScaleFactor(0) 79 71 , m_pEditorScaleFactor(0) … … 81 73 , m_pCheckBoxActivateOnMouseHover(0) 82 74 { 83 /* Prepare: */84 75 prepare(); 85 76 } … … 87 78 UIGlobalSettingsDisplay::~UIGlobalSettingsDisplay() 88 79 { 89 /* Cleanup: */90 80 cleanup(); 91 81 } … … 99 89 m_pCache->clear(); 100 90 101 /* Prepare old display data: */ 102 UIDataSettingsGlobalDisplay oldDisplayData; 103 104 /* Gather old display data: */ 105 oldDisplayData.m_enmMaximumGuestScreenSizePolicy = gEDataManager->maxGuestResolutionPolicy(); 106 if (oldDisplayData.m_enmMaximumGuestScreenSizePolicy == MaximumGuestScreenSizePolicy_Fixed) 107 oldDisplayData.m_maximumGuestScreenSize = gEDataManager->maxGuestResolutionForPolicyFixed(); 108 oldDisplayData.m_fActivateHoveredMachineWindow = gEDataManager->activateHoveredMachineWindow(); 109 oldDisplayData.m_scaleFactors = gEDataManager->scaleFactors(UIExtraDataManager::GlobalID); 110 111 /* Cache old display data: */ 112 m_pCache->cacheInitialData(oldDisplayData); 91 /* Cache old data: */ 92 UIDataSettingsGlobalDisplay oldData; 93 oldData.m_guiMaximumGuestScreenSizeValue = UIMaximumGuestScreenSizeValue(gEDataManager->maxGuestResolutionPolicy(), 94 gEDataManager->maxGuestResolutionForPolicyFixed()); 95 oldData.m_fActivateHoveredMachineWindow = gEDataManager->activateHoveredMachineWindow(); 96 oldData.m_scaleFactors = gEDataManager->scaleFactors(UIExtraDataManager::GlobalID); 97 m_pCache->cacheInitialData(oldData); 113 98 114 99 /* Upload properties to data: */ … … 118 103 void UIGlobalSettingsDisplay::getFromCache() 119 104 { 120 /* Get old display data from the cache: */ 121 const UIDataSettingsGlobalDisplay &oldDisplayData = m_pCache->base(); 122 123 /* Load old display data from the cache: */ 124 m_pComboMaxGuestScreenSize->setCurrentIndex(m_pComboMaxGuestScreenSize->findData((int)oldDisplayData.m_enmMaximumGuestScreenSizePolicy)); 125 if (oldDisplayData.m_enmMaximumGuestScreenSizePolicy == MaximumGuestScreenSizePolicy_Fixed) 126 { 127 m_pSpinboxMaxGuestScreenWidth->setValue(oldDisplayData.m_maximumGuestScreenSize.width()); 128 m_pSpinboxMaxGuestScreenHeight->setValue(oldDisplayData.m_maximumGuestScreenSize.height()); 129 } 130 m_pCheckBoxActivateOnMouseHover->setChecked(oldDisplayData.m_fActivateHoveredMachineWindow); 131 m_pEditorScaleFactor->setScaleFactors(oldDisplayData.m_scaleFactors); 105 /* Load old data from cache: */ 106 const UIDataSettingsGlobalDisplay &oldData = m_pCache->base(); 107 m_pEditorMaximumGuestScreenSize->setValue(oldData.m_guiMaximumGuestScreenSizeValue); 108 m_pCheckBoxActivateOnMouseHover->setChecked(oldData.m_fActivateHoveredMachineWindow); 109 m_pEditorScaleFactor->setScaleFactors(oldData.m_scaleFactors); 132 110 m_pEditorScaleFactor->setMonitorCount(gpDesktop->screenCount()); 133 111 } … … 135 113 void UIGlobalSettingsDisplay::putToCache() 136 114 { 137 /* Prepare new display data: */ 138 UIDataSettingsGlobalDisplay newDisplayData = m_pCache->base(); 139 140 /* Gather new display data: */ 141 newDisplayData.m_enmMaximumGuestScreenSizePolicy = (MaximumGuestScreenSizePolicy)m_pComboMaxGuestScreenSize->itemData(m_pComboMaxGuestScreenSize->currentIndex()).toInt(); 142 if (newDisplayData.m_enmMaximumGuestScreenSizePolicy == MaximumGuestScreenSizePolicy_Fixed) 143 newDisplayData.m_maximumGuestScreenSize = QSize(m_pSpinboxMaxGuestScreenWidth->value(), m_pSpinboxMaxGuestScreenHeight->value()); 144 newDisplayData.m_fActivateHoveredMachineWindow = m_pCheckBoxActivateOnMouseHover->isChecked(); 145 newDisplayData.m_scaleFactors = m_pEditorScaleFactor->scaleFactors(); 146 147 /* Cache new display data: */ 148 m_pCache->cacheCurrentData(newDisplayData); 115 /* Prepare new data: */ 116 UIDataSettingsGlobalDisplay newData = m_pCache->base(); 117 118 /* Cache new data: */ 119 newData.m_guiMaximumGuestScreenSizeValue = m_pEditorMaximumGuestScreenSize->value(); 120 newData.m_fActivateHoveredMachineWindow = m_pCheckBoxActivateOnMouseHover->isChecked(); 121 newData.m_scaleFactors = m_pEditorScaleFactor->scaleFactors(); 122 m_pCache->cacheCurrentData(newData); 149 123 } 150 124 … … 154 128 UISettingsPageGlobal::fetchData(data); 155 129 156 /* Update d isplay data and failing state: */130 /* Update data and failing state: */ 157 131 setFailed(!saveDisplayData()); 158 132 … … 163 137 void UIGlobalSettingsDisplay::retranslateUi() 164 138 { 165 m_pLabelMaxGuestScreenSize->setText(tr("Maximum Guest Screen &Size:")); 166 m_pLabelMaxGuestScreenWidth->setText(tr("&Width:")); 167 m_pSpinboxMaxGuestScreenWidth->setWhatsThis(tr("Holds the maximum width which we would like the guest to use.")); 168 m_pLabelMaxGuestScreenHeight->setText(tr("&Height:")); 169 m_pSpinboxMaxGuestScreenHeight->setWhatsThis(tr("Holds the maximum height which we would like the guest to use.")); 170 m_pLabelScaleFactor->setText(tr("Scale Factor:")); 139 m_pLabelMaximumGuestScreenSizePolicy->setText(tr("Maximum Guest Screen &Size:")); 140 m_pLabelMaximumGuestScreenWidth->setText(tr("&Width:")); 141 m_pLabelMaximumGuestScreenHeight->setText(tr("&Height:")); 142 m_pLabelScaleFactor->setText(tr("Scale &Factor:")); 171 143 m_pEditorScaleFactor->setWhatsThis(tr("Controls the guest screen scale factor.")); 172 144 m_pLabelMachineWindows->setText(tr("Machine Windows:")); 173 145 m_pCheckBoxActivateOnMouseHover->setWhatsThis(tr("When checked, machine windows will be raised when the mouse pointer moves over them.")); 174 146 m_pCheckBoxActivateOnMouseHover->setText(tr("&Raise Window Under Mouse")); 175 176 /* Reload combo-box: */177 reloadMaximumGuestScreenSizePolicyComboBox();178 }179 180 void UIGlobalSettingsDisplay::sltHandleMaximumGuestScreenSizePolicyChange()181 {182 /* Get current size-combo tool-tip data: */183 const QString strCurrentComboItemTip = m_pComboMaxGuestScreenSize->itemData(m_pComboMaxGuestScreenSize->currentIndex(), Qt::ToolTipRole).toString();184 m_pComboMaxGuestScreenSize->setWhatsThis(strCurrentComboItemTip);185 186 /* Get current size-combo item data: */187 const MaximumGuestScreenSizePolicy enmPolicy = (MaximumGuestScreenSizePolicy)m_pComboMaxGuestScreenSize->itemData(m_pComboMaxGuestScreenSize->currentIndex()).toInt();188 /* Should be combo-level widgets enabled? */189 const bool fComboLevelWidgetsEnabled = enmPolicy == MaximumGuestScreenSizePolicy_Fixed;190 /* Enable/disable combo-level widgets: */191 m_pLabelMaxGuestScreenWidth->setEnabled(fComboLevelWidgetsEnabled);192 m_pSpinboxMaxGuestScreenWidth->setEnabled(fComboLevelWidgetsEnabled);193 m_pLabelMaxGuestScreenHeight->setEnabled(fComboLevelWidgetsEnabled);194 m_pSpinboxMaxGuestScreenHeight->setEnabled(fComboLevelWidgetsEnabled);195 147 } 196 148 … … 203 155 /* Prepare everything: */ 204 156 prepareWidgets(); 205 prepareConnections();206 157 207 158 /* Apply language settings: */ … … 218 169 pLayoutMain->setRowStretch(6, 1); 219 170 220 const int iMinWidth = 640; 221 const int iMinHeight = 480; 222 const int iMaxSize = 16 * _1K; 223 224 /* Prepare max guest screen size label: */ 225 m_pLabelMaxGuestScreenSize = new QLabel(this); 226 if (m_pLabelMaxGuestScreenSize) 227 { 228 m_pLabelMaxGuestScreenSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 229 pLayoutMain->addWidget(m_pLabelMaxGuestScreenSize, 0, 0); 230 } 231 /* Prepare max guest screen size combo: */ 232 m_pComboMaxGuestScreenSize = new QComboBox(this); 233 if (m_pComboMaxGuestScreenSize) 234 { 235 if (m_pLabelMaxGuestScreenSize) 236 m_pLabelMaxGuestScreenSize->setBuddy(m_pComboMaxGuestScreenSize); 237 pLayoutMain->addWidget(m_pComboMaxGuestScreenSize, 0, 1, 1, 2); 238 } 239 240 /* Prepare max guest screen width label: */ 241 m_pLabelMaxGuestScreenWidth = new QLabel(this); 242 if (m_pLabelMaxGuestScreenWidth) 243 { 244 m_pLabelMaxGuestScreenWidth->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 245 pLayoutMain->addWidget(m_pLabelMaxGuestScreenWidth, 1, 0); 246 } 247 /* Prepare max guest screen width spinbox: */ 248 m_pSpinboxMaxGuestScreenWidth = new QSpinBox(this); 249 if (m_pSpinboxMaxGuestScreenWidth) 250 { 251 if (m_pLabelMaxGuestScreenWidth) 252 m_pLabelMaxGuestScreenWidth->setBuddy(m_pSpinboxMaxGuestScreenWidth); 253 m_pSpinboxMaxGuestScreenWidth->setMinimum(iMinWidth); 254 m_pSpinboxMaxGuestScreenWidth->setMaximum(iMaxSize); 255 256 pLayoutMain->addWidget(m_pSpinboxMaxGuestScreenWidth, 1, 1, 1, 2); 257 } 258 259 /* Prepare max guest screen height label: */ 260 m_pLabelMaxGuestScreenHeight = new QLabel(this); 261 if (m_pLabelMaxGuestScreenHeight) 262 { 263 m_pLabelMaxGuestScreenHeight->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 264 pLayoutMain->addWidget(m_pLabelMaxGuestScreenHeight, 2, 0); 265 } 266 /* Prepare max guest screen width spinbox: */ 267 m_pSpinboxMaxGuestScreenHeight = new QSpinBox(this); 268 if (m_pSpinboxMaxGuestScreenHeight) 269 { 270 if (m_pLabelMaxGuestScreenHeight) 271 m_pLabelMaxGuestScreenHeight->setBuddy(m_pSpinboxMaxGuestScreenHeight); 272 m_pSpinboxMaxGuestScreenHeight->setMinimum(iMinHeight); 273 m_pSpinboxMaxGuestScreenHeight->setMaximum(iMaxSize); 274 275 pLayoutMain->addWidget(m_pSpinboxMaxGuestScreenHeight, 2, 1, 1, 2); 171 /* Prepare maximum guest screen size label: */ 172 m_pLabelMaximumGuestScreenSizePolicy = new QLabel(this); 173 if (m_pLabelMaximumGuestScreenSizePolicy) 174 { 175 m_pLabelMaximumGuestScreenSizePolicy->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 176 pLayoutMain->addWidget(m_pLabelMaximumGuestScreenSizePolicy, 0, 0); 177 } 178 /* Prepare maximum guest screen width label: */ 179 m_pLabelMaximumGuestScreenWidth = new QLabel(this); 180 if (m_pLabelMaximumGuestScreenWidth) 181 { 182 m_pLabelMaximumGuestScreenWidth->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 183 pLayoutMain->addWidget(m_pLabelMaximumGuestScreenWidth, 1, 0); 184 } 185 /* Prepare maximum guest screen height label: */ 186 m_pLabelMaximumGuestScreenHeight = new QLabel(this); 187 if (m_pLabelMaximumGuestScreenHeight) 188 { 189 m_pLabelMaximumGuestScreenHeight->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 190 pLayoutMain->addWidget(m_pLabelMaximumGuestScreenHeight, 2, 0); 191 } 192 /* Prepare maximum guest screen size editor: */ 193 m_pEditorMaximumGuestScreenSize = new UIMaximumGuestScreenSizeEditor(this); 194 if (m_pEditorMaximumGuestScreenSize) 195 { 196 if (m_pLabelMaximumGuestScreenSizePolicy) 197 m_pLabelMaximumGuestScreenSizePolicy->setBuddy(m_pEditorMaximumGuestScreenSize->focusProxy1()); 198 if (m_pLabelMaximumGuestScreenWidth) 199 m_pLabelMaximumGuestScreenWidth->setBuddy(m_pEditorMaximumGuestScreenSize->focusProxy2()); 200 if (m_pLabelMaximumGuestScreenHeight) 201 m_pLabelMaximumGuestScreenHeight->setBuddy(m_pEditorMaximumGuestScreenSize->focusProxy3()); 202 pLayoutMain->addWidget(m_pEditorMaximumGuestScreenSize, 0, 1, 3, 2); 276 203 } 277 204 … … 286 213 m_pEditorScaleFactor = new UIScaleFactorEditor(this); 287 214 if (m_pEditorScaleFactor) 215 { 216 if (m_pLabelScaleFactor) 217 m_pLabelScaleFactor->setBuddy(m_pEditorScaleFactor->focusProxy()); 288 218 pLayoutMain->addWidget(m_pEditorScaleFactor, 3, 1, 2, 2); 219 } 289 220 290 221 /* Prepare 'machine-windows' label: */ … … 302 233 } 303 234 304 void UIGlobalSettingsDisplay::prepareConnections()305 {306 connect(m_pComboMaxGuestScreenSize, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),307 this, &UIGlobalSettingsDisplay::sltHandleMaximumGuestScreenSizePolicyChange);308 }309 310 235 void UIGlobalSettingsDisplay::cleanup() 311 236 { … … 315 240 } 316 241 317 void UIGlobalSettingsDisplay::reloadMaximumGuestScreenSizePolicyComboBox()318 {319 /* Remember current position: */320 int iCurrentPosition = m_pComboMaxGuestScreenSize->currentIndex();321 if (iCurrentPosition == -1)322 iCurrentPosition = 0;323 324 /* Clear combo-box: */325 m_pComboMaxGuestScreenSize->clear();326 327 /* Create corresponding items: */328 m_pComboMaxGuestScreenSize->addItem(tr("Automatic", "Maximum Guest Screen Size"),329 QVariant((int)MaximumGuestScreenSizePolicy_Automatic));330 m_pComboMaxGuestScreenSize->setItemData(m_pComboMaxGuestScreenSize->count() - 1,331 tr("Suggest a reasonable maximum screen size to the guest. "332 "The guest will only see this suggestion when guest additions are installed."),333 Qt::ToolTipRole);334 m_pComboMaxGuestScreenSize->addItem(tr("None", "Maximum Guest Screen Size"),335 QVariant((int)MaximumGuestScreenSizePolicy_Any));336 m_pComboMaxGuestScreenSize->setItemData(m_pComboMaxGuestScreenSize->count() - 1,337 tr("Do not attempt to limit the size of the guest screen."),338 Qt::ToolTipRole);339 m_pComboMaxGuestScreenSize->addItem(tr("Hint", "Maximum Guest Screen Size"),340 QVariant((int)MaximumGuestScreenSizePolicy_Fixed));341 m_pComboMaxGuestScreenSize->setItemData(m_pComboMaxGuestScreenSize->count() - 1,342 tr("Suggest a maximum screen size to the guest. "343 "The guest will only see this suggestion when guest additions are installed."),344 Qt::ToolTipRole);345 346 /* Choose previous position: */347 m_pComboMaxGuestScreenSize->setCurrentIndex(iCurrentPosition);348 sltHandleMaximumGuestScreenSizePolicyChange();349 }350 351 242 bool UIGlobalSettingsDisplay::saveDisplayData() 352 243 { 353 244 /* Prepare result: */ 354 245 bool fSuccess = true; 355 /* Save display settings from thecache: */246 /* Save display settings from cache: */ 356 247 if (fSuccess && m_pCache->wasChanged()) 357 248 { 358 /* Get old display data from the cache: */ 359 const UIDataSettingsGlobalDisplay &oldDisplayData = m_pCache->base(); 360 /* Get new display data from the cache: */ 361 const UIDataSettingsGlobalDisplay &newDisplayData = m_pCache->data(); 362 363 /* Save maximum guest resolution policy and/or value: */ 364 if ( fSuccess 365 && ( newDisplayData.m_enmMaximumGuestScreenSizePolicy != oldDisplayData.m_enmMaximumGuestScreenSizePolicy 366 || newDisplayData.m_maximumGuestScreenSize != oldDisplayData.m_maximumGuestScreenSize)) 367 gEDataManager->setMaxGuestScreenResolution(newDisplayData.m_enmMaximumGuestScreenSizePolicy, newDisplayData.m_maximumGuestScreenSize); 249 /* Get old data from cache: */ 250 const UIDataSettingsGlobalDisplay &oldData = m_pCache->base(); 251 /* Get new data from cache: */ 252 const UIDataSettingsGlobalDisplay &newData = m_pCache->data(); 253 254 /* Save maximum guest screen size and policy: */ 255 if (fSuccess && newData.m_guiMaximumGuestScreenSizeValue != oldData.m_guiMaximumGuestScreenSizeValue) 256 gEDataManager->setMaxGuestScreenResolution(newData.m_guiMaximumGuestScreenSizeValue.m_enmPolicy, 257 newData.m_guiMaximumGuestScreenSizeValue.m_size); 368 258 /* Save whether hovered machine-window should be activated automatically: */ 369 if (fSuccess && newD isplayData.m_fActivateHoveredMachineWindow != oldDisplayData.m_fActivateHoveredMachineWindow)370 gEDataManager->setActivateHoveredMachineWindow(newD isplayData.m_fActivateHoveredMachineWindow);259 if (fSuccess && newData.m_fActivateHoveredMachineWindow != oldData.m_fActivateHoveredMachineWindow) 260 gEDataManager->setActivateHoveredMachineWindow(newData.m_fActivateHoveredMachineWindow); 371 261 /* Save guest-screen scale-factor: */ 372 if (fSuccess && newD isplayData.m_scaleFactors != oldDisplayData.m_scaleFactors)373 gEDataManager->setScaleFactors(newD isplayData.m_scaleFactors, UIExtraDataManager::GlobalID);262 if (fSuccess && newData.m_scaleFactors != oldData.m_scaleFactors) 263 gEDataManager->setScaleFactors(newData.m_scaleFactors, UIExtraDataManager::GlobalID); 374 264 } 375 265 /* Return result: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.h
r86095 r86978 27 27 /* Forward declarations: */ 28 28 class QCheckBox; 29 class QComboBox;30 29 class QLabel; 31 class QSpinBox;30 class UIMaximumGuestScreenSizeEditor; 32 31 class UIScaleFactorEditor; 33 32 struct UIDataSettingsGlobalDisplay; … … 44 43 UIGlobalSettingsDisplay(); 45 44 /** Destructs Display settings page. */ 46 ~UIGlobalSettingsDisplay();45 virtual ~UIGlobalSettingsDisplay() /* override */; 47 46 48 47 protected: … … 65 64 virtual void retranslateUi() /* override */; 66 65 67 private slots:68 69 /** Handles maximum guest-screen size policy change. */70 void sltHandleMaximumGuestScreenSizePolicyChange();71 72 66 private: 73 67 … … 76 70 /** Prepares widgets. */ 77 71 void prepareWidgets(); 78 /** Prepares connections. */79 void prepareConnections();80 72 /** Cleanups all. */ 81 73 void cleanup(); 82 74 83 /** Reloads maximum guest-screen size policy combo-box. */ 84 void reloadMaximumGuestScreenSizePolicyComboBox(); 85 86 /** Saves existing display data from the cache. */ 75 /** Saves existing data from the cache. */ 87 76 bool saveDisplayData(); 88 77 … … 92 81 /** @name Widgets 93 82 * @{ */ 94 /** Holds the max guest screen size label instance. */ 95 QLabel *m_pLabelMaxGuestScreenSize; 96 /** Holds the max guest screen size combo instance. */ 97 QComboBox *m_pComboMaxGuestScreenSize; 98 /** Holds the max guest screen width label instance. */ 99 QLabel *m_pLabelMaxGuestScreenWidth; 100 /** Holds the max guest screen width spinbox instance. */ 101 QSpinBox *m_pSpinboxMaxGuestScreenWidth; 102 /** Holds the max guest screen height label instance. */ 103 QLabel *m_pLabelMaxGuestScreenHeight; 104 /** Holds the max guest screen height spinbox instance. */ 105 QSpinBox *m_pSpinboxMaxGuestScreenHeight; 83 /** Holds the maximum guest screen size label instance. */ 84 QLabel *m_pLabelMaximumGuestScreenSizePolicy; 85 /** Holds the maximum guest screen width label instance. */ 86 QLabel *m_pLabelMaximumGuestScreenWidth; 87 /** Holds the maximum guest screen height label instance. */ 88 QLabel *m_pLabelMaximumGuestScreenHeight; 89 /** Holds the maximum guest screen size editor instance. */ 90 UIMaximumGuestScreenSizeEditor *m_pEditorMaximumGuestScreenSize; 106 91 /** Holds the scale-factor label instance. */ 107 QLabel *m_pLabelScaleFactor;92 QLabel *m_pLabelScaleFactor; 108 93 /** Holds the scale-factor editor instance. */ 109 UIScaleFactorEditor *m_pEditorScaleFactor;94 UIScaleFactorEditor *m_pEditorScaleFactor; 110 95 /** Holds the 'machine-windows' label instance. */ 111 QLabel *m_pLabelMachineWindows;96 QLabel *m_pLabelMachineWindows; 112 97 /** Holds the 'activate on mouse hover' check-box instance. */ 113 QCheckBox *m_pCheckBoxActivateOnMouseHover;98 QCheckBox *m_pCheckBoxActivateOnMouseHover; 114 99 /** @} */ 115 100 };
Note:
See TracChangeset
for help on using the changeset viewer.