VirtualBox

Changeset 53401 in vbox for trunk


Ignore:
Timestamp:
Nov 26, 2014 1:37:50 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 6278: Support for scaled video-output: UI setting in VM settings / Display page / Machine Window tab first of all.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r53389 r53401  
    32753275}
    32763276
     3277void UIExtraDataManager::setScaleFactor(double dScaleFactor, const QString &strID)
     3278{
     3279    /* Set corresponding extra-data value: */
     3280    setExtraDataString(GUI_ScaleFactor, QString::number(dScaleFactor), strID);
     3281}
     3282
    32773283QRect UIExtraDataManager::informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QString &strID)
    32783284{
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r53389 r53401  
    454454        bool hidLedsSyncState(const QString &strID);
    455455
    456         /** Returns scale-factor. */
     456        /** Returns the scale-factor. */
    457457        double scaleFactor(const QString &strID);
     458        /** Defines the @a dScaleFactor. */
     459        void setScaleFactor(double dScaleFactor, const QString &strID);
    458460    /** @} */
    459461
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r53397 r53401  
    55
    66/*
    7  * Copyright (C) 2008-2013 Oracle Corporation
     7 * Copyright (C) 2008-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    142142
    143143    /* Cache Machine Window data: */
     144    displayData.m_dScaleFactor = gEDataManager->scaleFactor(m_machine.GetId());
    144145    displayData.m_fShowMiniToolBar = gEDataManager->miniToolbarEnabled(m_machine.GetId());
    145146    displayData.m_fMiniToolBarAtTop = gEDataManager->miniToolbarAlignment(m_machine.GetId()) == Qt::AlignTop;
     
    197198    m_pStatusBarEditor->setMachineID(strMachineID);
    198199    m_pMenuBarEditor->setActionPool(m_pActionPool);
     200    m_pEditorGuestScreenScale->setValue(displayData.m_dScaleFactor * 100);
    199201    m_pCheckBoxShowMiniToolBar->setChecked(displayData.m_fShowMiniToolBar);
    200202    m_pComboToolBarAlignment->setChecked(displayData.m_fMiniToolBarAtTop);
     
    243245
    244246    /* Gather Machine Window data from page: */
     247    displayData.m_dScaleFactor = (double)m_pEditorGuestScreenScale->value() / 100;
    245248    displayData.m_fShowMiniToolBar = m_pCheckBoxShowMiniToolBar->isChecked();
    246249    displayData.m_fMiniToolBarAtTop = m_pComboToolBarAlignment->isChecked();
     
    331334        if (isMachineInValidMode())
    332335        {
     336            gEDataManager->setScaleFactor(displayData.m_dScaleFactor, m_machine.GetId());
    333337            gEDataManager->setMiniToolbarEnabled(displayData.m_fShowMiniToolBar, m_machine.GetId());
    334338            gEDataManager->setMiniToolbarAlignment(displayData.m_fMiniToolBarAtTop ? Qt::AlignTop : Qt::AlignBottom, m_machine.GetId());
     
    497501
    498502    /* Machine Window tab-order: */
    499     setTabOrder(m_pEditorVideoCaptureBitRate, m_pCheckBoxShowMiniToolBar);
     503    setTabOrder(m_pEditorVideoCaptureBitRate, m_pSliderGuestScreenScale);
     504    setTabOrder(m_pSliderGuestScreenScale, m_pEditorGuestScreenScale);
     505    setTabOrder(m_pEditorGuestScreenScale, m_pCheckBoxShowMiniToolBar);
    500506    setTabOrder(m_pCheckBoxShowMiniToolBar, m_pComboToolBarAlignment);
    501507}
     
    723729    m_pSliderVideoCaptureQuality->blockSignals(false);
    724730    updateVideoCaptureSizeHint();
     731}
     732
     733void UIMachineSettingsDisplay::sltHandleGuestScreenScaleSliderChange()
     734{
     735    /* Apply proposed scale-factor: */
     736    m_pEditorGuestScreenScale->blockSignals(true);
     737    m_pEditorGuestScreenScale->setValue(m_pSliderGuestScreenScale->value());
     738    m_pEditorGuestScreenScale->blockSignals(false);
     739}
     740
     741void UIMachineSettingsDisplay::sltHandleGuestScreenScaleEditorChange()
     742{
     743    /* Apply proposed scale-factor: */
     744    m_pSliderGuestScreenScale->blockSignals(true);
     745    m_pSliderGuestScreenScale->setValue(m_pEditorGuestScreenScale->value());
     746    m_pSliderGuestScreenScale->blockSignals(false);
    725747}
    726748
     
    887909    /* Create personal action-pool: */
    888910    m_pActionPool = UIActionPool::create(UIActionPoolType_Runtime);
     911
     912    /* Prepare scale-factor slider: */
     913    m_pSliderGuestScreenScale->setMinimum(100);
     914    m_pSliderGuestScreenScale->setMaximum(200);
     915    m_pSliderGuestScreenScale->setPageStep(10);
     916    m_pSliderGuestScreenScale->setSingleStep(1);
     917    m_pSliderGuestScreenScale->setTickInterval(10);
     918    m_pSliderGuestScreenScale->setSnappingEnabled(true);
     919    connect(m_pSliderGuestScreenScale, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenScaleSliderChange()));
     920
     921    /* Prepare scale-factor editor: */
     922    m_pEditorGuestScreenScale->setMinimum(100);
     923    m_pEditorGuestScreenScale->setMaximum(200);
     924    vboxGlobal().setMinimumWidthAccordingSymbolCount(m_pEditorGuestScreenScale, 5);
     925    connect(m_pEditorGuestScreenScale, SIGNAL(valueChanged(int)), this, SLOT(sltHandleGuestScreenScaleEditorChange()));
    889926}
    890927
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h

    r53397 r53401  
    44
    55/*
    6  * Copyright (C) 2008-2013 Oracle Corporation
     6 * Copyright (C) 2008-2014 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5252        , m_iVideoCaptureFrameRate(0)
    5353        , m_iVideoCaptureBitRate(0)
     54        , m_dScaleFactor(1)
    5455        , m_fShowMiniToolBar(false)
    5556        , m_fMiniToolBarAtTop(false)
     
    7879               (m_iVideoCaptureBitRate == other.m_iVideoCaptureBitRate) &&
    7980               (m_screens == other.m_screens) &&
     81               (m_dScaleFactor == other.m_dScaleFactor) &&
    8082               (m_fShowMiniToolBar == other.m_fShowMiniToolBar) &&
    8183               (m_fMiniToolBarAtTop == other.m_fMiniToolBarAtTop);
     
    113115
    114116    /* Variables: Machine Window stuff: */
     117    double m_dScaleFactor;
    115118    bool m_fShowMiniToolBar;
    116119    bool m_fMiniToolBarAtTop;
     
    185188    void sltHandleVideoCaptureQualitySliderChange();
    186189    void sltHandleVideoCaptureBitRateEditorChange();
     190
     191    /* Handlers: Guest-screen scale-factor stuff: */
     192    void sltHandleGuestScreenScaleSliderChange();
     193    void sltHandleGuestScreenScaleEditorChange();
    187194
    188195private:
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui

    r53397 r53401  
    33 VBox frontends: Qt4 GUI ("VirtualBox"):
    44
    5  Copyright (C) 2008-2013 Oracle Corporation
     5 Copyright (C) 2008-2014 Oracle Corporation
    66
    77 This file is part of VirtualBox Open Source Edition (OSE), as
     
    650650      </attribute>
    651651      <layout class="QGridLayout" name="m_pLayoutTabMachineWindow">
    652        <item row="0" column="0" colspan="2">
     652       <item row="0" column="0" colspan="3">
    653653        <widget class="UIMenuBarEditorWidget" name="m_pMenuBarEditor">
    654654         <property name="whatsThis">
     
    658658       </item>
    659659       <item row="1" column="0">
     660        <widget class="QLabel" name="m_pLabelGuestScreenScale">
     661         <property name="text">
     662          <string>Screen Scale Factor:</string>
     663         </property>
     664         <property name="alignment">
     665          <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     666         </property>
     667        </widget>
     668       </item>
     669       <item row="1" column="1" rowspan="2">
     670        <layout class="QGridLayout" name="m_pLayoutGuestScreenScaleSlider">
     671         <property name="spacing">
     672          <number>0</number>
     673         </property>
     674         <item row="0" column="0" colspan="3">
     675          <widget class="QIAdvancedSlider" name="m_pSliderGuestScreenScale">
     676           <property name="whatsThis">
     677            <string>This setting determines the guest-screen scale-factor.</string>
     678           </property>
     679           <property name="orientation">
     680            <enum>Qt::Horizontal</enum>
     681           </property>
     682          </widget>
     683         </item>
     684         <item row="1" column="0">
     685          <widget class="QLabel" name="m_pLabelGuestScreenScaleMin">
     686           <property name="text">
     687            <string>100%</string>
     688           </property>
     689          </widget>
     690         </item>
     691         <item row="1" column="1">
     692          <spacer name="m_pSpacerGuestScreenScale">
     693           <property name="orientation">
     694            <enum>Qt::Horizontal</enum>
     695           </property>
     696           <property name="sizeHint" stdset="0">
     697            <size>
     698             <width>0</width>
     699             <height>0</height>
     700            </size>
     701           </property>
     702          </spacer>
     703         </item>
     704         <item row="1" column="2">
     705          <widget class="QLabel" name="m_pLabelGuestScreenScaleMax">
     706           <property name="text">
     707            <string>200%</string>
     708           </property>
     709          </widget>
     710         </item>
     711        </layout>
     712       </item>
     713       <item row="1" column="2">
     714        <widget class="QSpinBox" name="m_pEditorGuestScreenScale">
     715         <property name="whatsThis">
     716          <string>This setting determines the guest-screen scale-factor.</string>
     717         </property>
     718         <property name="suffix">
     719          <string>%</string>
     720         </property>
     721        </widget>
     722       </item>
     723       <item row="3" column="0">
    660724        <widget class="QLabel" name="m_pLabelMiniToolBar">
    661725         <property name="text">
     
    667731        </widget>
    668732       </item>
    669        <item row="1" column="1">
     733       <item row="3" column="1" colspan="2">
    670734        <widget class="QCheckBox" name="m_pCheckBoxShowMiniToolBar">
    671735         <property name="sizePolicy">
     
    686750        </widget>
    687751       </item>
    688        <item row="2" column="1">
     752       <item row="4" column="1" colspan="2">
    689753        <widget class="QCheckBox" name="m_pComboToolBarAlignment">
    690754         <property name="sizePolicy">
     
    705769        </widget>
    706770       </item>
    707        <item row="3" column="0" colspan="2">
     771       <item row="5" column="0" colspan="3">
    708772        <spacer name="m_pSpacer">
    709773         <property name="orientation">
     
    718782        </spacer>
    719783       </item>
    720        <item row="4" column="0" colspan="2">
     784       <item row="6" column="0" colspan="3">
    721785        <widget class="UIStatusBarEditorWidget" name="m_pStatusBarEditor">
    722786         <property name="whatsThis">
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette