VirtualBox

Ignore:
Timestamp:
Nov 10, 2010 9:02:39 AM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: Global settings / General page refactoring.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/global
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.cpp

    r33882 r33926  
    2525#include "VBoxGlobal.h"
    2626
     27/* General page constructor: */
    2728UIGlobalSettingsGeneral::UIGlobalSettingsGeneral()
    2829{
    29     /* Apply UI decorations */
    30     Ui::UIGlobalSettingsGeneral::setupUi (this);
     30    /* Apply UI decorations: */
     31    Ui::UIGlobalSettingsGeneral::setupUi(this);
    3132
    3233#ifndef VBOX_GUI_WITH_SYSTRAY
    33     mCbCheckTrayIcon->hide();
    34     mWtSpacer1->hide();
     34    m_pEnableTrayIconCheckbox->hide();
     35    m_pSpacerWidget1->hide();
    3536#endif /* !VBOX_GUI_WITH_SYSTRAY */
    3637#ifndef Q_WS_MAC
    37     mCbCheckPresentationMode->hide();
    38     mWtSpacer2->hide();
     38    m_pEnablePresentationModeCheckbox->hide();
     39    m_pSpacerWidget2->hide();
    3940#endif /* !Q_WS_MAC */
    4041//#ifndef Q_WS_WIN /* Checkbox hidden for now! */
    41     mCbDisableHostScreenSaver->hide();
    42     mWtSpacer3->hide();
     42    m_pDisableHostScreenSaverCheckbox->hide();
     43    m_pSpacerWidget3->hide();
    4344//#endif /* !Q_WS_WIN */
    4445
    45     if (mCbCheckTrayIcon->isHidden() &&
    46         mCbCheckPresentationMode->isHidden() &&
    47         mCbDisableHostScreenSaver->isHidden())
    48         mLnSeparator2->hide();
     46    /* If all checkboxes hidden, hide separator too: */
     47    if (m_pEnableTrayIconCheckbox->isHidden() &&
     48        m_pEnablePresentationModeCheckbox->isHidden() &&
     49        m_pDisableHostScreenSaverCheckbox->isHidden())
     50        m_pLineSeparator2->hide();
    4951
    50     mPsMach->setHomeDir (vboxGlobal().virtualBox().GetHomeFolder());
    51     mPsVRDP->setHomeDir (vboxGlobal().virtualBox().GetHomeFolder());
    52     mPsVRDP->setMode (VBoxFilePathSelectorWidget::Mode_File_Open);
     52    /* Setup widgets: */
     53    m_pMachineFolderSelector->setHomeDir(vboxGlobal().virtualBox().GetHomeFolder());
     54    m_pVRDPLibNameSelector->setHomeDir(vboxGlobal().virtualBox().GetHomeFolder());
     55    m_pVRDPLibNameSelector->setMode(VBoxFilePathSelectorWidget::Mode_File_Open);
    5356
    54     /* Applying language settings */
     57    /* Apply language settings: */
    5558    retranslateUi();
    5659}
     
    8184{
    8285    /* Fetch from cache: */
    83     mPsMach->setPath(m_cache.m_strDefaultMachineFolder);
    84     mPsVRDP->setPath(m_cache.m_strVRDEAuthLibrary);
    85     mCbCheckTrayIcon->setChecked(m_cache.m_fTrayIconEnabled);
     86    m_pMachineFolderSelector->setPath(m_cache.m_strDefaultMachineFolder);
     87    m_pVRDPLibNameSelector->setPath(m_cache.m_strVRDEAuthLibrary);
     88    m_pEnableTrayIconCheckbox->setChecked(m_cache.m_fTrayIconEnabled);
    8689#ifdef Q_WS_MAC
    87     mCbCheckPresentationMode->setChecked(m_cache.m_fPresentationModeEnabled);
     90    m_pEnablePresentationModeCheckbox->setChecked(m_cache.m_fPresentationModeEnabled);
    8891#endif /* Q_WS_MAC */
    89     mCbDisableHostScreenSaver->setChecked(m_cache.m_fHostScreenSaverDisables);
     92    m_pDisableHostScreenSaverCheckbox->setChecked(m_cache.m_fHostScreenSaverDisables);
    9093}
    9194
     
    9598{
    9699    /* Upload to cache: */
    97     m_cache.m_strDefaultMachineFolder = mPsMach->path();
    98     m_cache.m_strVRDEAuthLibrary = mPsVRDP->path();
    99     m_cache.m_fTrayIconEnabled = mCbCheckTrayIcon->isChecked();
     100    m_cache.m_strDefaultMachineFolder = m_pMachineFolderSelector->path();
     101    m_cache.m_strVRDEAuthLibrary = m_pVRDPLibNameSelector->path();
     102    m_cache.m_fTrayIconEnabled = m_pEnableTrayIconCheckbox->isChecked();
    100103#ifdef Q_WS_MAC
    101     m_cache.m_fPresentationModeEnabled = mCbCheckPresentationMode->isChecked();
     104    m_cache.m_fPresentationModeEnabled = m_pEnablePresentationModeCheckbox->isChecked();
    102105#endif /* Q_WS_MAC */
    103     m_cache.m_fHostScreenSaverDisables = mCbDisableHostScreenSaver->isChecked();
     106    m_cache.m_fHostScreenSaverDisables = m_pDisableHostScreenSaverCheckbox->isChecked();
    104107}
    105108
     
    112115
    113116    /* Save from cache: */
    114     if (m_properties.isOk() && mPsMach->isModified())
     117    if (m_properties.isOk() && m_pMachineFolderSelector->isModified())
    115118        m_properties.SetDefaultMachineFolder(m_cache.m_strDefaultMachineFolder);
    116     if (m_properties.isOk() && mPsVRDP->isModified())
     119    if (m_properties.isOk() && m_pVRDPLibNameSelector->isModified())
    117120        m_properties.SetVRDEAuthLibrary(m_cache.m_strVRDEAuthLibrary);
    118121    m_settings.setTrayIconEnabled(m_cache.m_fTrayIconEnabled);
     
    126129}
    127130
    128 void UIGlobalSettingsGeneral::setOrderAfter (QWidget *aWidget)
     131/* Navigation stuff: */
     132void UIGlobalSettingsGeneral::setOrderAfter(QWidget *pWidget)
    129133{
    130     setTabOrder (aWidget, mPsMach);
    131     setTabOrder (mPsMach, mPsVRDP);
    132     setTabOrder (mPsVRDP, mCbCheckTrayIcon);
    133     setTabOrder (mCbCheckTrayIcon, mCbCheckPresentationMode);
    134     setTabOrder (mCbCheckPresentationMode, mCbDisableHostScreenSaver);
     134    setTabOrder(pWidget, m_pMachineFolderSelector);
     135    setTabOrder(m_pMachineFolderSelector, m_pVRDPLibNameSelector);
     136    setTabOrder(m_pVRDPLibNameSelector, m_pEnableTrayIconCheckbox);
     137    setTabOrder(m_pEnableTrayIconCheckbox, m_pEnablePresentationModeCheckbox);
     138    setTabOrder(m_pEnablePresentationModeCheckbox, m_pDisableHostScreenSaverCheckbox);
    135139}
    136140
     141/* Translation stuff: */
    137142void UIGlobalSettingsGeneral::retranslateUi()
    138143{
    139     /* Translate uic generated strings */
    140     Ui::UIGlobalSettingsGeneral::retranslateUi (this);
     144    /* Translate uic generated strings: */
     145    Ui::UIGlobalSettingsGeneral::retranslateUi(this);
    141146
    142     mPsMach->setWhatsThis (tr ("Displays the path to the default virtual "
    143                                "machine folder. This folder is used, if not "
    144                                "explicitly specified otherwise, when creating "
    145                                "new virtual machines."));
    146     mPsVRDP->setWhatsThis (tr ("Displays the path to the library that "
    147                                "provides authentication for Remote Display "
    148                                "(VRDP) clients."));
     147    m_pMachineFolderSelector->setWhatsThis(tr("Displays the path to the default virtual "
     148                                              "machine folder. This folder is used, if not "
     149                                              "explicitly specified otherwise, when creating "
     150                                              "new virtual machines."));
     151    m_pVRDPLibNameSelector->setWhatsThis(tr("Displays the path to the library that "
     152                                            "provides authentication for Remote Display "
     153                                            "(VRDP) clients."));
    149154}
    150155
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.h

    r33882 r33926  
    2020#define __UIGlobalSettingsGeneral_h__
    2121
     22/* Local includes */
    2223#include "UISettingsPage.h"
    2324#include "UIGlobalSettingsGeneral.gen.h"
     
    3637
    3738/* Global settings / General page: */
    38 class UIGlobalSettingsGeneral : public UISettingsPageGlobal,
    39                               public Ui::UIGlobalSettingsGeneral
     39class UIGlobalSettingsGeneral : public UISettingsPageGlobal, public Ui::UIGlobalSettingsGeneral
    4040{
    4141    Q_OBJECT;
     
    4343public:
    4444
     45    /* Constructor: */
    4546    UIGlobalSettingsGeneral();
    4647
     
    6162    void saveFromCacheTo(QVariant &data);
    6263
     64    /* Navigation stuff: */
    6365    void setOrderAfter (QWidget *aWidget);
    6466
     67    /* Translation stuff: */
    6568    void retranslateUi();
    6669
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsGeneral.ui

    r33882 r33926  
    1 <?xml version="1.0" encoding="UTF-8"?>
    21<ui version="4.0">
    32 <comment>
    4  VBox frontends: Qt4 GUI (&quot;VirtualBox&quot;):
     3 VBox frontends: Qt4 GUI ("VirtualBox"):
    54
    65     Copyright (C) 2008-2010 Oracle Corporation
     
    2928   </property>
    3029   <item row="0" column="0" colspan="2">
    31     <widget class="QLabel" name="mLbMach">
     30    <widget class="QLabel" name="m_pMachineFolderLabel">
    3231     <property name="text">
    3332      <string>Default &amp;Machine Folder:</string>
     
    3736     </property>
    3837     <property name="buddy">
    39       <cstring>mPsMach</cstring>
     38      <cstring>m_pMachineFolderSelector</cstring>
    4039     </property>
    4140    </widget>
    4241   </item>
    4342   <item row="0" column="2">
    44     <widget class="VBoxFilePathSelectorWidget" name="mPsMach">
     43    <widget class="VBoxFilePathSelectorWidget" name="m_pMachineFolderSelector">
    4544     <property name="sizePolicy">
    4645      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     
    5251   </item>
    5352   <item row="1" column="0" colspan="3">
    54     <widget class="Line" name="mLnSeparator">
     53    <widget class="Line" name="m_pLineSeparator1">
    5554     <property name="orientation">
    5655      <enum>Qt::Horizontal</enum>
     
    5958   </item>
    6059   <item row="2" column="0" colspan="2">
    61     <widget class="QLabel" name="mLbVRDP">
     60    <widget class="QLabel" name="m_pVRDPLibLabel">
    6261     <property name="text">
    6362      <string>V&amp;RDP Authentication Library:</string>
     
    6766     </property>
    6867     <property name="buddy">
    69       <cstring>mPsVRDP</cstring>
     68      <cstring>m_pVRDPLibNameSelector</cstring>
    7069     </property>
    7170    </widget>
    7271   </item>
    7372   <item row="2" column="2">
    74     <widget class="VBoxFilePathSelectorWidget" name="mPsVRDP">
     73    <widget class="VBoxFilePathSelectorWidget" name="m_pVRDPLibNameSelector">
    7574     <property name="sizePolicy">
    7675      <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
     
    8281   </item>
    8382   <item row="3" column="0" colspan="3">
    84     <widget class="Line" name="mLnSeparator2">
     83    <widget class="Line" name="m_pLineSeparator2">
    8584     <property name="orientation">
    8685      <enum>Qt::Horizontal</enum>
     
    8988   </item>
    9089   <item row="4" column="0">
    91     <widget class="QWidget" name="mWtSpacer1">
     90    <widget class="QWidget" name="m_pSpacerWidget1">
    9291     <property name="sizePolicy">
    9392      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
     
    102101   </item>
    103102   <item row="4" column="1" colspan="2">
    104     <widget class="QCheckBox" name="mCbCheckTrayIcon">
     103    <widget class="QCheckBox" name="m_pEnableTrayIconCheckbox">
    105104     <property name="whatsThis">
    106105      <string>When checked, the application will provide an icon with the context menu in the system tray.</string>
     
    115114   </item>
    116115   <item row="5" column="0">
    117     <widget class="QWidget" name="mWtSpacer2">
     116    <widget class="QWidget" name="m_pSpacerWidget2">
    118117     <property name="sizePolicy">
    119118      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
     
    128127   </item>
    129128   <item row="5" column="1" colspan="2">
    130     <widget class="QCheckBox" name="mCbCheckPresentationMode">
     129    <widget class="QCheckBox" name="m_pEnablePresentationModeCheckbox">
    131130     <property name="text">
    132131      <string>&amp;Auto show Dock and Menubar in fullscreen</string>
     
    135134   </item>
    136135   <item row="6" column="0">
    137     <widget class="QWidget" name="mWtSpacer3">
     136    <widget class="QWidget" name="m_pSpacerWidget3">
    138137     <property name="sizePolicy">
    139138      <sizepolicy hsizetype="Fixed" vsizetype="Minimum">
     
    148147   </item>
    149148   <item row="6" column="1" colspan="2">
    150     <widget class="QCheckBox" name="mCbDisableHostScreenSaver">
     149    <widget class="QCheckBox" name="m_pDisableHostScreenSaverCheckbox">
    151150     <property name="whatsThis">
    152151      <string>When checked, the host screen saver will be disabled whenever a virtual machine is running.</string>
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