VirtualBox

Changeset 53397 in vbox for trunk/src


Ignore:
Timestamp:
Nov 25, 2014 3:26:49 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Machine settings: Moving mini-toolbar settings from General page to Display page: Machine Window tab for now.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r53321 r53397  
    2626# include "QIWidgetValidator.h"
    2727# include "UIMachineSettingsDisplay.h"
     28# include "UIExtraDataManager.h"
     29# include "UIMessageCenter.h"
     30# include "UIActionPool.h"
     31# include "UIConverter.h"
    2832# include "VBoxGlobal.h"
    29 # include "UIMessageCenter.h"
    30 # include "UIConverter.h"
    31 # include "UIActionPool.h"
    3233
    3334/* COM includes: */
     
    140141    displayData.m_screens = m_machine.GetVideoCaptureScreens();
    141142
     143    /* Cache Machine Window data: */
     144    displayData.m_fShowMiniToolBar = gEDataManager->miniToolbarEnabled(m_machine.GetId());
     145    displayData.m_fMiniToolBarAtTop = gEDataManager->miniToolbarAlignment(m_machine.GetId()) == Qt::AlignTop;
     146
    142147    /* Initialize other variables: */
    143148    m_iInitialVRAM = RT_MIN(displayData.m_iCurrentVRAM, m_iMaxVRAM);
     
    192197    m_pStatusBarEditor->setMachineID(strMachineID);
    193198    m_pMenuBarEditor->setActionPool(m_pActionPool);
     199    m_pCheckBoxShowMiniToolBar->setChecked(displayData.m_fShowMiniToolBar);
     200    m_pComboToolBarAlignment->setChecked(displayData.m_fMiniToolBarAtTop);
    194201
    195202    /* Polish page finally: */
     
    234241    displayData.m_iVideoCaptureBitRate = m_pEditorVideoCaptureBitRate->value();
    235242    displayData.m_screens = m_pScrollerVideoCaptureScreens->value();
     243
     244    /* Gather Machine Window data from page: */
     245    displayData.m_fShowMiniToolBar = m_pCheckBoxShowMiniToolBar->isChecked();
     246    displayData.m_fMiniToolBarAtTop = m_pComboToolBarAlignment->isChecked();
    236247
    237248    /* Cache display data: */
     
    316327            m_machine.SetVideoCaptureScreens(displayData.m_screens);
    317328        }
     329
     330        /* Store Machine Window data: */
     331        if (isMachineInValidMode())
     332        {
     333            gEDataManager->setMiniToolbarEnabled(displayData.m_fShowMiniToolBar, m_machine.GetId());
     334            gEDataManager->setMiniToolbarAlignment(displayData.m_fMiniToolBarAtTop ? Qt::AlignTop : Qt::AlignBottom, m_machine.GetId());
     335        }
    318336    }
    319337
     
    477495    setTabOrder(m_pEditorVideoCaptureFrameRate, m_pSliderVideoCaptureQuality);
    478496    setTabOrder(m_pSliderVideoCaptureQuality, m_pEditorVideoCaptureBitRate);
     497
     498    /* Machine Window tab-order: */
     499    setTabOrder(m_pEditorVideoCaptureBitRate, m_pCheckBoxShowMiniToolBar);
     500    setTabOrder(m_pCheckBoxShowMiniToolBar, m_pComboToolBarAlignment);
    479501}
    480502
     
    530552    m_pContainerVideoCapture->setEnabled(isMachineInValidMode());
    531553    sltHandleVideoCaptureCheckboxToggle();
     554
     555    /* Machine-window tab: */
     556    m_pLabelMiniToolBar->setEnabled(isMachineInValidMode());
     557    m_pCheckBoxShowMiniToolBar->setEnabled(isMachineInValidMode());
     558    m_pComboToolBarAlignment->setEnabled(isMachineInValidMode() && m_pCheckBoxShowMiniToolBar->isChecked());
    532559}
    533560
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h

    r53321 r53397  
    5252        , m_iVideoCaptureFrameRate(0)
    5353        , m_iVideoCaptureBitRate(0)
     54        , m_fShowMiniToolBar(false)
     55        , m_fMiniToolBarAtTop(false)
    5456    {}
    5557
     
    7577               (m_iVideoCaptureFrameRate == other.m_iVideoCaptureFrameRate) &&
    7678               (m_iVideoCaptureBitRate == other.m_iVideoCaptureBitRate) &&
    77                (m_screens == other.m_screens);
     79               (m_screens == other.m_screens) &&
     80               (m_fShowMiniToolBar == other.m_fShowMiniToolBar) &&
     81               (m_fMiniToolBarAtTop == other.m_fMiniToolBarAtTop);
    7882    }
    7983
     
    107111    int m_iVideoCaptureBitRate;
    108112    QVector<BOOL> m_screens;
     113
     114    /* Variables: Machine Window stuff: */
     115    bool m_fShowMiniToolBar;
     116    bool m_fMiniToolBarAtTop;
    109117};
    110118typedef UISettingsCache<UIDataSettingsMachineDisplay> UICacheSettingsMachineDisplay;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.ui

    r53321 r53397  
    649649       <string>Machine &amp;Window</string>
    650650      </attribute>
    651       <layout class="QVBoxLayout" name="m_pLayoutTabMachineWindow">
    652        <item>
     651      <layout class="QGridLayout" name="m_pLayoutTabMachineWindow">
     652       <item row="0" column="0" colspan="2">
    653653        <widget class="UIMenuBarEditorWidget" name="m_pMenuBarEditor">
    654654         <property name="whatsThis">
     
    657657        </widget>
    658658       </item>
    659        <item>
     659       <item row="1" column="0">
     660        <widget class="QLabel" name="m_pLabelMiniToolBar">
     661         <property name="text">
     662          <string>Mini ToolBar:</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">
     670        <widget class="QCheckBox" name="m_pCheckBoxShowMiniToolBar">
     671         <property name="sizePolicy">
     672          <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding">
     673           <horstretch>0</horstretch>
     674           <verstretch>0</verstretch>
     675          </sizepolicy>
     676         </property>
     677         <property name="whatsThis">
     678          <string>If checked, show the Mini ToolBar in Fullscreen and Seamless modes.</string>
     679         </property>
     680         <property name="text">
     681          <string>Show in &amp;Fullscreen/Seamless</string>
     682         </property>
     683         <property name="checked">
     684          <bool>true</bool>
     685         </property>
     686        </widget>
     687       </item>
     688       <item row="2" column="1">
     689        <widget class="QCheckBox" name="m_pComboToolBarAlignment">
     690         <property name="sizePolicy">
     691          <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding">
     692           <horstretch>0</horstretch>
     693           <verstretch>0</verstretch>
     694          </sizepolicy>
     695         </property>
     696         <property name="whatsThis">
     697          <string>If checked, show the Mini ToolBar at the top of the screen, rather than in its default position at the bottom of the screen.</string>
     698         </property>
     699         <property name="text">
     700          <string>Show at &amp;Top of Screen</string>
     701         </property>
     702         <property name="checked">
     703          <bool>false</bool>
     704         </property>
     705        </widget>
     706       </item>
     707       <item row="3" column="0" colspan="2">
    660708        <spacer name="m_pSpacer">
    661709         <property name="orientation">
     
    670718        </spacer>
    671719       </item>
    672        <item>
     720       <item row="4" column="0" colspan="2">
    673721        <widget class="UIStatusBarEditorWidget" name="m_pStatusBarEditor">
    674722         <property name="whatsThis">
     
    724772   <slot>setEnabled(bool)</slot>
    725773  </connection>
     774  <connection>
     775   <sender>m_pCheckBoxShowMiniToolBar</sender>
     776   <signal>toggled(bool)</signal>
     777   <receiver>m_pComboToolBarAlignment</receiver>
     778   <slot>setEnabled(bool)</slot>
     779   <hints>
     780    <hint type="sourcelabel">
     781     <x>195</x>
     782     <y>50</y>
     783    </hint>
     784    <hint type="destinationlabel">
     785     <x>196</x>
     786     <y>72</y>
     787    </hint>
     788   </hints>
     789  </connection>
    726790 </connections>
    727791</ui>
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r52730 r53397  
    2727# include "QIWidgetValidator.h"
    2828# include "UIMachineSettingsGeneral.h"
    29 # include "UIExtraDataManager.h"
    3029# include "UIMessageCenter.h"
    3130# include "UIConverter.h"
     
    112111    generalData.m_strName = m_machine.GetName();
    113112    generalData.m_strGuestOsTypeId = m_machine.GetOSTypeId();
    114     generalData.m_fShowMiniToolBar = gEDataManager->miniToolbarEnabled(m_machine.GetId());
    115     generalData.m_fMiniToolBarAtTop = gEDataManager->miniToolbarAlignment(m_machine.GetId()) == Qt::AlignTop;
    116113    generalData.m_strSnapshotsFolder = m_machine.GetSnapshotFolder();
    117114    generalData.m_strSnapshotsHomeDir = QFileInfo(m_machine.GetSettingsFilePath()).absolutePath();
     
    137134    m_pNameAndSystemEditor->setName(generalData.m_strName);
    138135    m_pNameAndSystemEditor->setType(vboxGlobal().vmGuestOSType(generalData.m_strGuestOsTypeId));
    139     mCbShowToolBar->setChecked(generalData.m_fShowMiniToolBar);
    140     mCbToolBarAlignment->setChecked(generalData.m_fMiniToolBarAtTop);
    141136    mPsSnapshot->setPath(generalData.m_strSnapshotsFolder);
    142137    mPsSnapshot->setHomeDir(generalData.m_strSnapshotsHomeDir);
     
    162157    generalData.m_strName = m_pNameAndSystemEditor->name();
    163158    generalData.m_strGuestOsTypeId = m_pNameAndSystemEditor->type().GetId();
    164     generalData.m_fShowMiniToolBar = mCbShowToolBar->isChecked();
    165     generalData.m_fMiniToolBarAtTop = mCbToolBarAlignment->isChecked();
    166159    generalData.m_strSnapshotsFolder = mPsSnapshot->path();
    167160    generalData.m_clipboardMode = (KClipboardMode)mCbClipboard->currentIndex();
     
    193186            m_machine.SetClipboardMode(generalData.m_clipboardMode);
    194187            m_machine.SetDnDMode(generalData.m_dndMode);
    195             gEDataManager->setMiniToolbarEnabled(generalData.m_fShowMiniToolBar, m_machine.GetId());
    196             gEDataManager->setMiniToolbarAlignment(generalData.m_fMiniToolBarAtTop ? Qt::AlignTop : Qt::AlignBottom, m_machine.GetId());
    197188            /* Description tab: */
    198189            m_machine.SetDescription(generalData.m_strDescription);
     
    265256    setTabOrder (mPsSnapshot, mCbClipboard);
    266257    setTabOrder (mCbClipboard, mCbDragAndDrop);
    267     setTabOrder (mCbDragAndDrop, mCbShowToolBar);
    268     setTabOrder (mCbShowToolBar, mCbToolBarAlignment);
    269258
    270259    /* Description tab-order */
    271     setTabOrder (mCbToolBarAlignment, mTeDescription);
     260    setTabOrder (mCbDragAndDrop, mTeDescription);
    272261}
    273262
     
    314303    mLbDragAndDrop->setEnabled(isMachineInValidMode());
    315304    mCbDragAndDrop->setEnabled(isMachineInValidMode());
    316     mLbToolBar->setEnabled(isMachineInValidMode());
    317     mCbShowToolBar->setEnabled(isMachineInValidMode());
    318     mCbToolBarAlignment->setEnabled(isMachineInValidMode() && mCbShowToolBar->isChecked());
    319 }
    320 
     305}
     306
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h

    r52727 r53397  
    2929        : m_strName(QString())
    3030        , m_strGuestOsTypeId(QString())
    31         , m_fShowMiniToolBar(false)
    32         , m_fMiniToolBarAtTop(false)
    3331        , m_strSnapshotsFolder(QString())
    3432        , m_strSnapshotsHomeDir(QString())
     
    3634        , m_dndMode(KDnDMode_Disabled)
    3735        , m_strDescription(QString()) {}
     36
    3837    /* Functions: */
    3938    bool equal(const UIDataSettingsMachineGeneral &other) const
     
    4140        return (m_strName == other.m_strName) &&
    4241               (m_strGuestOsTypeId == other.m_strGuestOsTypeId) &&
    43                (m_fShowMiniToolBar == other.m_fShowMiniToolBar) &&
    44                (m_fMiniToolBarAtTop == other.m_fMiniToolBarAtTop) &&
    4542               (m_strSnapshotsFolder == other.m_strSnapshotsFolder) &&
    4643               (m_strSnapshotsHomeDir == other.m_strSnapshotsHomeDir) &&
     
    4946               (m_strDescription == other.m_strDescription);
    5047    }
     48
    5149    /* Operators: */
    5250    bool operator==(const UIDataSettingsMachineGeneral &other) const { return equal(other); }
    5351    bool operator!=(const UIDataSettingsMachineGeneral &other) const { return !equal(other); }
     52
    5453    /* Variables: */
    5554    QString m_strName;
    5655    QString m_strGuestOsTypeId;
    57     bool m_fShowMiniToolBar;
    58     bool m_fMiniToolBarAtTop;
    5956    QString m_strSnapshotsFolder;
    6057    QString m_strSnapshotsHomeDir;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.ui

    r52917 r53397  
    170170           </spacer>
    171171          </item>
    172           <item row="3" column="0" >
    173            <widget class="QLabel" name="mLbToolBar" >
    174             <property name="text" >
    175              <string>Mini ToolBar:</string>
    176             </property>
    177             <property name="alignment" >
    178              <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    179             </property>
    180            </widget>
    181           </item>
    182           <item row="3" column="1" >
    183            <widget class="QCheckBox" name="mCbShowToolBar" >
    184             <property name="sizePolicy" >
    185              <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
    186               <horstretch>0</horstretch>
    187               <verstretch>0</verstretch>
    188              </sizepolicy>
    189             </property>
    190             <property name="whatsThis" >
    191              <string>If checked, show the Mini ToolBar in Fullscreen and Seamless modes.</string>
    192             </property>
    193             <property name="text" >
    194              <string>Show in &amp;Fullscreen/Seamless</string>
    195             </property>
    196             <property name="checked" >
    197              <bool>true</bool>
    198             </property>
    199            </widget>
    200           </item>
    201           <item row="4" column="1" >
    202            <widget class="QCheckBox" name="mCbToolBarAlignment" >
    203             <property name="sizePolicy" >
    204              <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
    205               <horstretch>0</horstretch>
    206               <verstretch>0</verstretch>
    207              </sizepolicy>
    208             </property>
    209             <property name="whatsThis" >
    210              <string>If checked, show the Mini ToolBar at the top of the screen, rather than in its default position at the bottom of the screen.</string>
    211             </property>
    212             <property name="text" >
    213              <string>Show at &amp;Top of Screen</string>
    214             </property>
    215             <property name="checked" >
    216              <bool>false</bool>
    217             </property>
    218            </widget>
    219           </item>
    220172         </layout>
    221173        </widget>
     
    279231 </customwidgets>
    280232 <resources/>
    281  <connections>
    282   <connection>
    283    <sender>mCbShowToolBar</sender>
    284    <signal>toggled(bool)</signal>
    285    <receiver>mCbToolBarAlignment</receiver>
    286    <slot>setEnabled(bool)</slot>
    287    <hints>
    288     <hint type="sourcelabel">
    289      <x>195</x>
    290      <y>50</y>
    291     </hint>
    292     <hint type="destinationlabel">
    293      <x>196</x>
    294      <y>72</y>
    295     </hint>
    296    </hints>
    297   </connection>
    298  </connections>
     233 <connections/>
    299234</ui>
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