Changeset 55719 in vbox
- Timestamp:
- May 7, 2015 12:36:02 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
- Files:
-
- 6 edited
-
UIMachineSettingsDisplay.cpp (modified) (17 diffs)
-
UIMachineSettingsDisplay.h (modified) (5 diffs)
-
UIMachineSettingsDisplay.ui (modified) (4 diffs)
-
UIMachineSettingsInterface.cpp (modified) (9 diffs)
-
UIMachineSettingsInterface.h (modified) (4 diffs)
-
UIMachineSettingsInterface.ui (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r55506 r55719 5 5 6 6 /* 7 * Copyright (C) 2008-201 4Oracle Corporation7 * Copyright (C) 2008-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 # include "QIWidgetValidator.h" 27 27 # include "UIMachineSettingsDisplay.h" 28 # include "UI MessageCenter.h"28 # include "UIExtraDataManager.h" 29 29 # include "UIConverter.h" 30 30 # include "VBoxGlobal.h" … … 36 36 37 37 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 38 39 38 40 39 UIMachineSettingsDisplay::UIMachineSettingsDisplay() … … 101 100 UIDataSettingsMachineDisplay displayData; 102 101 103 /* Cache Videodata: */102 /* Cache Screen data: */ 104 103 displayData.m_iCurrentVRAM = m_machine.GetVRAMSize(); 105 104 displayData.m_cGuestScreenCount = m_machine.GetMonitorCount(); 105 displayData.m_dScaleFactor = gEDataManager->scaleFactor(m_machine.GetId()); 106 #ifdef Q_WS_MAC 107 displayData.m_fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(m_machine.GetId()); 108 #endif /* Q_WS_MAC */ 106 109 displayData.m_f3dAccelerationEnabled = m_machine.GetAccelerate3DEnabled(); 107 110 #ifdef VBOX_WITH_VIDEOHWACCEL … … 149 152 const UIDataSettingsMachineDisplay &displayData = m_cache.base(); 150 153 151 /* Load Videodata to page: */154 /* Load Screen data to page: */ 152 155 m_pEditorVideoScreenCount->setValue(displayData.m_cGuestScreenCount); 156 m_pEditorGuestScreenScale->setValue(displayData.m_dScaleFactor * 100); 157 #ifdef Q_WS_MAC 158 m_pCheckBoxUnscaledHiDPIOutput->setChecked(displayData.m_fUseUnscaledHiDPIOutput); 159 #endif /* Q_WS_MAC */ 153 160 m_pCheckbox3D->setChecked(displayData.m_f3dAccelerationEnabled); 154 161 #ifdef VBOX_WITH_VIDEOHWACCEL … … 193 200 UIDataSettingsMachineDisplay displayData = m_cache.base(); 194 201 195 /* Gather Videodata from page: */202 /* Gather Screen data from page: */ 196 203 displayData.m_iCurrentVRAM = m_pEditorVideoMemorySize->value(); 197 204 displayData.m_cGuestScreenCount = m_pEditorVideoScreenCount->value(); 205 displayData.m_dScaleFactor = (double)m_pEditorGuestScreenScale->value() / 100; 206 #ifdef Q_WS_MAC 207 displayData.m_fUseUnscaledHiDPIOutput = m_pCheckBoxUnscaledHiDPIOutput->isChecked(); 208 #endif /* Q_WS_MAC */ 198 209 displayData.m_f3dAccelerationEnabled = m_pCheckbox3D->isChecked(); 199 210 #ifdef VBOX_WITH_VIDEOHWACCEL … … 238 249 const UIDataSettingsMachineDisplay &displayData = m_cache.data(); 239 250 240 /* Make sure machine is 'offline': */251 /* Store Screen data: */ 241 252 if (isMachineOffline()) 242 253 { 243 /* Store Video data: */244 254 m_machine.SetVRAMSize(displayData.m_iCurrentVRAM); 245 255 m_machine.SetMonitorCount(displayData.m_cGuestScreenCount); … … 248 258 m_machine.SetAccelerate2DVideoEnabled(displayData.m_f2dAccelerationEnabled); 249 259 #endif /* VBOX_WITH_VIDEOHWACCEL */ 260 } 261 if (isMachineInValidMode()) 262 { 263 gEDataManager->setScaleFactor(displayData.m_dScaleFactor, m_machine.GetId()); 264 #ifdef Q_WS_MAC 265 gEDataManager->setUseUnscaledHiDPIOutput(displayData.m_fUseUnscaledHiDPIOutput, m_machine.GetId()); 266 #endif /* Q_WS_MAC */ 250 267 } 251 268 … … 316 333 bool fPass = true; 317 334 318 /* Videotab: */335 /* Screen tab: */ 319 336 { 320 337 /* Prepare message: */ … … 434 451 void UIMachineSettingsDisplay::setOrderAfter(QWidget *pWidget) 435 452 { 436 /* Videotab-order: */453 /* Screen tab-order: */ 437 454 setTabOrder(pWidget, m_pTabWidget->focusProxy()); 438 455 setTabOrder(m_pTabWidget->focusProxy(), m_pSliderVideoMemorySize); … … 440 457 setTabOrder(m_pEditorVideoMemorySize, m_pSliderVideoScreenCount); 441 458 setTabOrder(m_pSliderVideoScreenCount, m_pEditorVideoScreenCount); 442 setTabOrder(m_pEditorVideoScreenCount, m_pCheckbox3D); 459 setTabOrder(m_pEditorVideoScreenCount, m_pSliderGuestScreenScale); 460 setTabOrder(m_pSliderGuestScreenScale, m_pEditorGuestScreenScale); 461 setTabOrder(m_pEditorGuestScreenScale, m_pCheckBoxUnscaledHiDPIOutput); 462 setTabOrder(m_pCheckBoxUnscaledHiDPIOutput, m_pCheckbox3D); 443 463 #ifdef VBOX_WITH_VIDEOHWACCEL 444 464 setTabOrder(m_pCheckbox3D, m_pCheckbox2DVideo); … … 471 491 Ui::UIMachineSettingsDisplay::retranslateUi(this); 472 492 473 /* Videostuff: */493 /* Screen stuff: */ 474 494 CSystemProperties sys = vboxGlobal().virtualBox().GetSystemProperties(); 475 495 m_pLabelVideoMemorySizeMin->setText(tr("<qt>%1 MB</qt>").arg(m_iMinVRAM)); … … 501 521 const UIDataSettingsMachineDisplay &displayData = m_cache.base(); 502 522 503 /* Video tab: */ 504 m_pContainerVideo->setEnabled(isMachineOffline()); 505 #ifdef VBOX_WITH_VIDEOHWACCEL 506 m_pCheckbox2DVideo->setEnabled(VBoxGlobal::isAcceleration2DVideoAvailable()); 507 #endif /* VBOX_WITH_VIDEOHWACCEL */ 523 /* Screen tab: */ 524 m_pLabelVideoMemorySize->setEnabled(isMachineOffline()); 525 m_pSliderVideoMemorySize->setEnabled(isMachineOffline()); 526 m_pLabelVideoMemorySizeMin->setEnabled(isMachineOffline()); 527 m_pLabelVideoMemorySizeMax->setEnabled(isMachineOffline()); 528 m_pEditorVideoMemorySize->setEnabled(isMachineOffline()); 529 m_pLabelVideoMemoryUnit->setEnabled(isMachineOffline()); 530 m_pLabelVideoScreenCount->setEnabled(isMachineOffline()); 531 m_pSliderVideoScreenCount->setEnabled(isMachineOffline()); 532 m_pLabelVideoScreenCountMin->setEnabled(isMachineOffline()); 533 m_pLabelVideoScreenCountMax->setEnabled(isMachineOffline()); 534 m_pEditorVideoScreenCount->setEnabled(isMachineOffline()); 535 m_pLabelGuestScreenScale->setEnabled(isMachineInValidMode()); 536 m_pSliderGuestScreenScale->setEnabled(isMachineInValidMode()); 537 m_pLabelGuestScreenScaleMin->setEnabled(isMachineInValidMode()); 538 m_pLabelGuestScreenScaleMax->setEnabled(isMachineInValidMode()); 539 m_pEditorGuestScreenScale->setEnabled(isMachineInValidMode()); 540 #ifdef Q_WS_MAC 541 m_pLabelHiDPI->setEnabled(isMachineInValidMode()); 542 m_pCheckBoxUnscaledHiDPIOutput->setEnabled(isMachineInValidMode()); 543 #else /* !Q_WS_MAC */ 544 m_pLabelHiDPI->hide(); 545 m_pCheckBoxUnscaledHiDPIOutput->hide(); 546 #endif /* !Q_WS_MAC */ 547 m_pLabelVideoOptions->setEnabled(isMachineOffline()); 548 m_pCheckbox3D->setEnabled(isMachineOffline()); 549 #ifdef VBOX_WITH_VIDEOHWACCEL 550 m_pCheckbox2DVideo->setEnabled(isMachineOffline() && VBoxGlobal::isAcceleration2DVideoAvailable()); 551 #else /* !VBOX_WITH_VIDEOHWACCEL */ 552 m_pCheckbox2DVideo->hide(); 553 #endif /* !VBOX_WITH_VIDEOHWACCEL */ 508 554 509 555 /* Remote Display tab: */ … … 573 619 /* Revalidate: */ 574 620 revalidate(); 621 } 622 623 void UIMachineSettingsDisplay::sltHandleGuestScreenScaleSliderChange() 624 { 625 /* Apply proposed scale-factor: */ 626 m_pEditorGuestScreenScale->blockSignals(true); 627 m_pEditorGuestScreenScale->setValue(m_pSliderGuestScreenScale->value()); 628 m_pEditorGuestScreenScale->blockSignals(false); 629 } 630 631 void UIMachineSettingsDisplay::sltHandleGuestScreenScaleEditorChange() 632 { 633 /* Apply proposed scale-factor: */ 634 m_pSliderGuestScreenScale->blockSignals(true); 635 m_pSliderGuestScreenScale->setValue(m_pEditorGuestScreenScale->value()); 636 m_pSliderGuestScreenScale->blockSignals(false); 575 637 } 576 638 … … 691 753 692 754 /* Prepare tabs: */ 693 prepare VideoTab();755 prepareScreenTab(); 694 756 prepareRemoteDisplayTab(); 695 757 prepareVideoCaptureTab(); … … 702 764 } 703 765 704 void UIMachineSettingsDisplay::prepare VideoTab()766 void UIMachineSettingsDisplay::prepareScreenTab() 705 767 { 706 768 /* Prepare memory-size slider: */ … … 744 806 connect(m_pEditorVideoScreenCount, SIGNAL(valueChanged(int)), this, SLOT(sltHandleVideoScreenCountEditorChange())); 745 807 746 #ifndef VBOX_WITH_VIDEOHWACCEL 747 /* Hide check-box if not supported: */ 748 m_pCheckbox2DVideo->setVisible(false); 749 #endif /* VBOX_WITH_VIDEOHWACCEL */ 808 /* Prepare scale-factor slider: */ 809 m_pSliderGuestScreenScale->setMinimum(100); 810 m_pSliderGuestScreenScale->setMaximum(200); 811 m_pSliderGuestScreenScale->setPageStep(10); 812 m_pSliderGuestScreenScale->setSingleStep(1); 813 m_pSliderGuestScreenScale->setTickInterval(10); 814 m_pSliderGuestScreenScale->setSnappingEnabled(true); 815 connect(m_pSliderGuestScreenScale, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenScaleSliderChange())); 816 817 /* Prepare scale-factor editor: */ 818 m_pEditorGuestScreenScale->setMinimum(100); 819 m_pEditorGuestScreenScale->setMaximum(200); 820 vboxGlobal().setMinimumWidthAccordingSymbolCount(m_pEditorGuestScreenScale, 5); 821 connect(m_pEditorGuestScreenScale, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenScaleEditorChange())); 750 822 } 751 823 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
r55401 r55719 36 36 : m_iCurrentVRAM(0) 37 37 , m_cGuestScreenCount(0) 38 , m_dScaleFactor(1.0) 39 #ifdef Q_WS_MAC 40 , m_fUseUnscaledHiDPIOutput(false) 41 #endif /* Q_WS_MAC */ 38 42 , m_f3dAccelerationEnabled(false) 39 43 #ifdef VBOX_WITH_VIDEOHWACCEL … … 60 64 return (m_iCurrentVRAM == other.m_iCurrentVRAM) && 61 65 (m_cGuestScreenCount == other.m_cGuestScreenCount) && 66 (m_dScaleFactor == other.m_dScaleFactor) && 67 #ifdef Q_WS_MAC 68 (m_fUseUnscaledHiDPIOutput == other.m_fUseUnscaledHiDPIOutput) && 69 #endif /* Q_WS_MAC */ 62 70 (m_f3dAccelerationEnabled == other.m_f3dAccelerationEnabled) && 63 71 #ifdef VBOX_WITH_VIDEOHWACCEL … … 86 94 int m_iCurrentVRAM; 87 95 int m_cGuestScreenCount; 96 double m_dScaleFactor; 97 #ifdef Q_WS_MAC 98 bool m_fUseUnscaledHiDPIOutput; 99 #endif /* Q_WS_MAC */ 88 100 bool m_f3dAccelerationEnabled; 89 101 #ifdef VBOX_WITH_VIDEOHWACCEL … … 161 173 private slots: 162 174 163 /* Handlers: Videostuff: */175 /* Handlers: Screen stuff: */ 164 176 void sltHandleVideoMemorySizeSliderChange(); 165 177 void sltHandleVideoMemorySizeEditorChange(); 166 178 void sltHandleVideoScreenCountSliderChange(); 167 179 void sltHandleVideoScreenCountEditorChange(); 180 void sltHandleGuestScreenScaleSliderChange(); 181 void sltHandleGuestScreenScaleEditorChange(); 168 182 169 183 /* Handlers: Video Capture stuff: */ … … 181 195 /** Prepare routine. */ 182 196 void prepare(); 183 /** Prepare routine: Videotab. */184 void prepare VideoTab();197 /** Prepare routine: Screen tab. */ 198 void prepareScreenTab(); 185 199 /** Prepare routine: Remote Display tab. */ 186 200 void prepareRemoteDisplayTab(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui
r54199 r55719 28 28 <widget class="QWidget" name="m_pTabVideo"> 29 29 <attribute name="title"> 30 <string>& Video</string>30 <string>&Screen</string> 31 31 </attribute> 32 32 <layout class="QVBoxLayout" name="m_pLayoutTabVideo"> … … 154 154 </item> 155 155 <item row="4" column="0"> 156 <widget class="QLabel" name="m_pLabel VideoOptions">157 <property name="text"> 158 <string> Extended Features:</string>156 <widget class="QLabel" name="m_pLabelGuestScreenScale"> 157 <property name="text"> 158 <string>Scale Factor:</string> 159 159 </property> 160 160 <property name="alignment"> … … 163 163 </widget> 164 164 </item> 165 <item row="4" column="1" colspan="2"> 165 <item row="4" column="1" rowspan="2"> 166 <layout class="QGridLayout" name="m_pLayoutGuestScreenScaleSlider"> 167 <property name="spacing"> 168 <number>0</number> 169 </property> 170 <item row="0" column="0" colspan="3"> 171 <widget class="QIAdvancedSlider" name="m_pSliderGuestScreenScale"> 172 <property name="whatsThis"> 173 <string>Controls the guest screen scale factor.</string> 174 </property> 175 <property name="orientation"> 176 <enum>Qt::Horizontal</enum> 177 </property> 178 </widget> 179 </item> 180 <item row="1" column="0"> 181 <widget class="QLabel" name="m_pLabelGuestScreenScaleMin"> 182 <property name="text"> 183 <string>100%</string> 184 </property> 185 </widget> 186 </item> 187 <item row="1" column="1"> 188 <spacer name="m_pSpacerGuestScreenScale"> 189 <property name="orientation"> 190 <enum>Qt::Horizontal</enum> 191 </property> 192 <property name="sizeHint" stdset="0"> 193 <size> 194 <width>0</width> 195 <height>0</height> 196 </size> 197 </property> 198 </spacer> 199 </item> 200 <item row="1" column="2"> 201 <widget class="QLabel" name="m_pLabelGuestScreenScaleMax"> 202 <property name="text"> 203 <string>200%</string> 204 </property> 205 </widget> 206 </item> 207 </layout> 208 </item> 209 <item row="4" column="2"> 210 <widget class="QSpinBox" name="m_pEditorGuestScreenScale"> 211 <property name="whatsThis"> 212 <string>Controls the guest screen scale factor.</string> 213 </property> 214 <property name="suffix"> 215 <string>%</string> 216 </property> 217 </widget> 218 </item> 219 <item row="6" column="0"> 220 <widget class="QLabel" name="m_pLabelHiDPI"> 221 <property name="text"> 222 <string>HiDPI:</string> 223 </property> 224 <property name="alignment"> 225 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 226 </property> 227 </widget> 228 </item> 229 <item row="6" column="1" colspan="2"> 230 <widget class="QCheckBox" name="m_pCheckBoxUnscaledHiDPIOutput"> 231 <property name="sizePolicy"> 232 <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding"> 233 <horstretch>0</horstretch> 234 <verstretch>0</verstretch> 235 </sizepolicy> 236 </property> 237 <property name="whatsThis"> 238 <string>When checked, guest screen contents will not be scaled up to compensate for high host screen resolutions.</string> 239 </property> 240 <property name="text"> 241 <string>Use &Unscaled HiDPI Output</string> 242 </property> 243 </widget> 244 </item> 245 <item row="7" column="0"> 246 <widget class="QLabel" name="m_pLabelVideoOptions"> 247 <property name="text"> 248 <string>Acceleration:</string> 249 </property> 250 <property name="alignment"> 251 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 252 </property> 253 </widget> 254 </item> 255 <item row="7" column="1" colspan="2"> 166 256 <widget class="QCheckBox" name="m_pCheckbox3D"> 167 257 <property name="sizePolicy"> … … 179 269 </widget> 180 270 </item> 181 <item row=" 5" column="1" colspan="2">271 <item row="8" column="1" colspan="2"> 182 272 <widget class="QCheckBox" name="m_pCheckbox2DVideo"> 183 273 <property name="sizePolicy"> -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.cpp
r54463 r55719 24 24 # include "UIExtraDataManager.h" 25 25 # include "UIActionPool.h" 26 # include "VBoxGlobal.h"27 26 28 27 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 29 30 28 31 29 UIMachineSettingsInterface::UIMachineSettingsInterface(const QString strMachineID) … … 57 55 58 56 /* Cache interface data: */ 59 interfaceData.m_dScaleFactor = gEDataManager->scaleFactor(m_machine.GetId()); 60 #ifdef Q_WS_MAC 61 interfaceData.m_fUseUnscaledHiDPIOutput = gEDataManager->useUnscaledHiDPIOutput(m_machine.GetId()); 62 #else /* !Q_WS_MAC */ 57 #ifndef Q_WS_MAC 63 58 interfaceData.m_fShowMiniToolBar = gEDataManager->miniToolbarEnabled(m_machine.GetId()); 64 59 interfaceData.m_fMiniToolBarAtTop = gEDataManager->miniToolbarAlignment(m_machine.GetId()) == Qt::AlignTop; … … 80 75 81 76 /* Prepare interface data: */ 82 m_pEditorGuestScreenScale->setValue(interfaceData.m_dScaleFactor * 100); 83 #ifdef Q_WS_MAC 84 m_pCheckBoxUnscaledHiDPIOutput->setChecked(interfaceData.m_fUseUnscaledHiDPIOutput); 85 #else /* !Q_WS_MAC */ 77 #ifndef Q_WS_MAC 86 78 m_pCheckBoxShowMiniToolBar->setChecked(interfaceData.m_fShowMiniToolBar); 87 79 m_pComboToolBarAlignment->setChecked(interfaceData.m_fMiniToolBarAtTop); 88 #endif /* !Q_WS_MAC */ 80 #else /* Q_WS_MAC */ 81 Q_UNUSED(interfaceData); 82 #endif /* Q_WS_MAC */ 89 83 90 84 /* Polish page finally: */ … … 103 97 104 98 /* Gather interface data from page: */ 105 interfaceData.m_dScaleFactor = (double)m_pEditorGuestScreenScale->value() / 100; 106 #ifdef Q_WS_MAC 107 interfaceData.m_fUseUnscaledHiDPIOutput = m_pCheckBoxUnscaledHiDPIOutput->isChecked(); 108 #else /* !Q_WS_MAC */ 99 #ifndef Q_WS_MAC 109 100 interfaceData.m_fShowMiniToolBar = m_pCheckBoxShowMiniToolBar->isChecked(); 110 101 interfaceData.m_fMiniToolBarAtTop = m_pComboToolBarAlignment->isChecked(); … … 131 122 if (isMachineInValidMode()) 132 123 { 133 gEDataManager->setScaleFactor(interfaceData.m_dScaleFactor, m_machine.GetId()); 134 #ifdef Q_WS_MAC 135 gEDataManager->setUseUnscaledHiDPIOutput(interfaceData.m_fUseUnscaledHiDPIOutput, m_machine.GetId()); 136 #else /* !Q_WS_MAC */ 124 #ifndef Q_WS_MAC 137 125 gEDataManager->setMiniToolbarEnabled(interfaceData.m_fShowMiniToolBar, m_machine.GetId()); 138 126 gEDataManager->setMiniToolbarAlignment(interfaceData.m_fMiniToolBarAtTop ? Qt::AlignTop : Qt::AlignBottom, m_machine.GetId()); 139 #endif /* !Q_WS_MAC */ 127 #else /* Q_WS_MAC */ 128 Q_UNUSED(interfaceData); 129 #endif /* Q_WS_MAC */ 140 130 } 141 131 } … … 148 138 { 149 139 /* Tab-order: */ 150 setTabOrder(pWidget, m_pSliderGuestScreenScale); 151 setTabOrder(m_pSliderGuestScreenScale, m_pEditorGuestScreenScale); 152 setTabOrder(m_pEditorGuestScreenScale, m_pCheckBoxUnscaledHiDPIOutput); 153 setTabOrder(m_pCheckBoxUnscaledHiDPIOutput, m_pCheckBoxShowMiniToolBar); 140 setTabOrder(pWidget, m_pCheckBoxShowMiniToolBar); 154 141 setTabOrder(m_pCheckBoxShowMiniToolBar, m_pComboToolBarAlignment); 155 142 } … … 165 152 /* Polish interface availability: */ 166 153 m_pMenuBarEditor->setEnabled(isMachineInValidMode()); 167 m_pLabelGuestScreenScale->setEnabled(isMachineInValidMode());168 m_pSliderGuestScreenScale->setEnabled(isMachineInValidMode());169 m_pLabelGuestScreenScaleMin->setEnabled(isMachineInValidMode());170 m_pLabelGuestScreenScaleMax->setEnabled(isMachineInValidMode());171 m_pEditorGuestScreenScale->setEnabled(isMachineInValidMode());172 154 #ifdef Q_WS_MAC 173 m_pLabelHiDPI->setEnabled(isMachineInValidMode());174 m_pCheckBoxUnscaledHiDPIOutput->setEnabled(isMachineInValidMode());175 155 m_pLabelMiniToolBar->hide(); 176 156 m_pCheckBoxShowMiniToolBar->hide(); 177 157 m_pComboToolBarAlignment->hide(); 178 158 #else /* !Q_WS_MAC */ 179 m_pLabelHiDPI->hide();180 m_pCheckBoxUnscaledHiDPIOutput->hide();181 159 m_pLabelMiniToolBar->setEnabled(isMachineInValidMode()); 182 160 m_pCheckBoxShowMiniToolBar->setEnabled(isMachineInValidMode()); … … 184 162 #endif /* !Q_WS_MAC */ 185 163 m_pStatusBarEditor->setEnabled(isMachineInValidMode()); 186 }187 188 void UIMachineSettingsInterface::sltHandleGuestScreenScaleSliderChange()189 {190 /* Apply proposed scale-factor: */191 m_pEditorGuestScreenScale->blockSignals(true);192 m_pEditorGuestScreenScale->setValue(m_pSliderGuestScreenScale->value());193 m_pEditorGuestScreenScale->blockSignals(false);194 }195 196 void UIMachineSettingsInterface::sltHandleGuestScreenScaleEditorChange()197 {198 /* Apply proposed scale-factor: */199 m_pSliderGuestScreenScale->blockSignals(true);200 m_pSliderGuestScreenScale->setValue(m_pEditorGuestScreenScale->value());201 m_pSliderGuestScreenScale->blockSignals(false);202 164 } 203 165 … … 215 177 m_pStatusBarEditor->setMachineID(m_strMachineID); 216 178 217 /* Prepare scale-factor slider: */218 m_pSliderGuestScreenScale->setMinimum(100);219 m_pSliderGuestScreenScale->setMaximum(200);220 m_pSliderGuestScreenScale->setPageStep(10);221 m_pSliderGuestScreenScale->setSingleStep(1);222 m_pSliderGuestScreenScale->setTickInterval(10);223 m_pSliderGuestScreenScale->setSnappingEnabled(true);224 connect(m_pSliderGuestScreenScale, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenScaleSliderChange()));225 226 /* Prepare scale-factor editor: */227 m_pEditorGuestScreenScale->setMinimum(100);228 m_pEditorGuestScreenScale->setMaximum(200);229 vboxGlobal().setMinimumWidthAccordingSymbolCount(m_pEditorGuestScreenScale, 5);230 connect(m_pEditorGuestScreenScale, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenScaleEditorChange()));231 232 179 /* Translate finally: */ 233 180 retranslateUi(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.h
r55401 r55719 31 31 /* Constructor: */ 32 32 UIDataSettingsMachineInterface() 33 : m_dScaleFactor(1.0) 34 #ifdef Q_WS_MAC 35 , m_fUseUnscaledHiDPIOutput(false) 36 #else /* !Q_WS_MAC */ 37 , m_fShowMiniToolBar(false) 33 #ifndef Q_WS_MAC 34 : m_fShowMiniToolBar(false) 38 35 , m_fMiniToolBarAtTop(false) 39 36 #endif /* !Q_WS_MAC */ … … 43 40 bool equal(const UIDataSettingsMachineInterface &other) const 44 41 { 45 return (m_dScaleFactor == other.m_dScaleFactor) 46 #ifdef Q_WS_MAC 47 && (m_fUseUnscaledHiDPIOutput == other.m_fUseUnscaledHiDPIOutput) 48 #else /* !Q_WS_MAC */ 49 && (m_fShowMiniToolBar == other.m_fShowMiniToolBar) 50 && (m_fMiniToolBarAtTop == other.m_fMiniToolBarAtTop) 51 #endif /* !Q_WS_MAC */ 52 ; 42 #ifndef Q_WS_MAC 43 return (m_fShowMiniToolBar == other.m_fShowMiniToolBar) && 44 (m_fMiniToolBarAtTop == other.m_fMiniToolBarAtTop); 45 #else /* Q_WS_MAC */ 46 Q_UNUSED(other); 47 return true; 48 #endif /* Q_WS_MAC */ 53 49 } 54 50 … … 58 54 59 55 /* Variables: */ 60 double m_dScaleFactor; 61 #ifdef Q_WS_MAC 62 bool m_fUseUnscaledHiDPIOutput; 63 #else /* !Q_WS_MAC */ 56 #ifndef Q_WS_MAC 64 57 bool m_fShowMiniToolBar; 65 58 bool m_fMiniToolBarAtTop; … … 109 102 void polishPage(); 110 103 111 private slots:112 113 /* Handlers: Guest-screen scale-factor stuff: */114 void sltHandleGuestScreenScaleSliderChange();115 void sltHandleGuestScreenScaleEditorChange();116 117 104 private: 118 105 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsInterface.ui
r54216 r55719 38 38 </item> 39 39 <item row="1" column="0"> 40 <widget class="QLabel" name="m_pLabelGuestScreenScale">41 <property name="text">42 <string>Screen Scale Factor:</string>43 </property>44 <property name="alignment">45 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>46 </property>47 </widget>48 </item>49 <item row="1" column="1" rowspan="2">50 <layout class="QGridLayout" name="m_pLayoutGuestScreenScaleSlider">51 <property name="spacing">52 <number>0</number>53 </property>54 <item row="0" column="0" colspan="3">55 <widget class="QIAdvancedSlider" name="m_pSliderGuestScreenScale">56 <property name="whatsThis">57 <string>This setting determines the guest screen scale factor.</string>58 </property>59 <property name="orientation">60 <enum>Qt::Horizontal</enum>61 </property>62 </widget>63 </item>64 <item row="1" column="0">65 <widget class="QLabel" name="m_pLabelGuestScreenScaleMin">66 <property name="text">67 <string>100%</string>68 </property>69 </widget>70 </item>71 <item row="1" column="1">72 <spacer name="m_pSpacerGuestScreenScale">73 <property name="orientation">74 <enum>Qt::Horizontal</enum>75 </property>76 <property name="sizeHint" stdset="0">77 <size>78 <width>0</width>79 <height>0</height>80 </size>81 </property>82 </spacer>83 </item>84 <item row="1" column="2">85 <widget class="QLabel" name="m_pLabelGuestScreenScaleMax">86 <property name="text">87 <string>200%</string>88 </property>89 </widget>90 </item>91 </layout>92 </item>93 <item row="1" column="2">94 <widget class="QSpinBox" name="m_pEditorGuestScreenScale">95 <property name="whatsThis">96 <string>This setting determines the guest screen scale factor.</string>97 </property>98 <property name="suffix">99 <string>%</string>100 </property>101 </widget>102 </item>103 <item row="3" column="0">104 <widget class="QLabel" name="m_pLabelHiDPI">105 <property name="text">106 <string>HiDPI:</string>107 </property>108 <property name="alignment">109 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>110 </property>111 </widget>112 </item>113 <item row="3" column="1" colspan="2">114 <widget class="QCheckBox" name="m_pCheckBoxUnscaledHiDPIOutput">115 <property name="sizePolicy">116 <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding">117 <horstretch>0</horstretch>118 <verstretch>0</verstretch>119 </sizepolicy>120 </property>121 <property name="whatsThis">122 <string>If checked, guest screen contents will not be scaled up to compensate for high host screen resolutions.</string>123 </property>124 <property name="text">125 <string>Use &Unscaled HiDPI Output</string>126 </property>127 </widget>128 </item>129 <item row="4" column="0">130 40 <widget class="QLabel" name="m_pLabelMiniToolBar"> 131 41 <property name="text"> … … 137 47 </widget> 138 48 </item> 139 <item row=" 4" column="1" colspan="2">49 <item row="1" column="1" colspan="2"> 140 50 <widget class="QCheckBox" name="m_pCheckBoxShowMiniToolBar"> 141 51 <property name="sizePolicy"> … … 156 66 </widget> 157 67 </item> 158 <item row=" 5" column="1" colspan="2">68 <item row="2" column="1" colspan="2"> 159 69 <widget class="QCheckBox" name="m_pComboToolBarAlignment"> 160 70 <property name="sizePolicy"> … … 175 85 </widget> 176 86 </item> 177 <item row=" 6" column="0" colspan="3">87 <item row="3" column="0" colspan="3"> 178 88 <spacer name="m_pSpacer"> 179 89 <property name="orientation"> … … 188 98 </spacer> 189 99 </item> 190 <item row=" 7" column="0" colspan="3">100 <item row="4" column="0" colspan="3"> 191 101 <widget class="UIStatusBarEditorWidget" name="m_pStatusBarEditor"> 192 102 <property name="sizePolicy"> … … 204 114 </widget> 205 115 <customwidgets> 206 <customwidget>207 <class>QIAdvancedSlider</class>208 <extends>QSlider</extends>209 <header>QIAdvancedSlider.h</header>210 </customwidget>211 116 <customwidget> 212 117 <class>UIMenuBarEditorWidget</class>
Note:
See TracChangeset
for help on using the changeset viewer.

