VirtualBox

Changeset 47133 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 14, 2013 2:03:06 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: Global preferences: *Update* page cleanup/rework.

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

Legend:

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

    r44528 r47133  
    77
    88/*
    9  * Copyright (C) 2006-2012 Oracle Corporation
     9 * Copyright (C) 2006-2013 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    1818 */
    1919
    20 /* Local includes */
     20/* GUI includes: */
    2121#include "UIGlobalSettingsUpdate.h"
    2222#include "VBoxGlobal.h"
     
    3131
    3232    /* Setup connections: */
    33     connect(m_pEnableUpdateCheckbox, SIGNAL(toggled(bool)), this, SLOT(sltUpdaterToggled(bool)));
    34     connect(m_pUpdatePeriodCombo, SIGNAL(activated(int)), this, SLOT(sltPeriodActivated()));
    35     connect(m_pUpdateFilterStableRadio, SIGNAL(toggled(bool)), this, SLOT(sltBranchToggled()));
    36     connect(m_pUpdateFilterEveryRadio, SIGNAL(toggled(bool)), this, SLOT(sltBranchToggled()));
    37     connect(m_pUpdateFilterBetasRadio, SIGNAL(toggled(bool)), this, SLOT(sltBranchToggled()));
     33    connect(m_pCheckBoxUpdate, SIGNAL(toggled(bool)), this, SLOT(sltUpdaterToggled(bool)));
     34    connect(m_pComboBoxUpdatePeriod, SIGNAL(activated(int)), this, SLOT(sltPeriodActivated()));
     35    connect(m_pRadioUpdateFilterStable, SIGNAL(toggled(bool)), this, SLOT(sltBranchToggled()));
     36    connect(m_pRadioUpdateFilterEvery, SIGNAL(toggled(bool)), this, SLOT(sltBranchToggled()));
     37    connect(m_pRadioUpdateFilterBetas, SIGNAL(toggled(bool)), this, SLOT(sltBranchToggled()));
    3838
    3939    /* Apply language settings: */
     
    6464{
    6565    /* Apply internal variables data to QWidget(s): */
    66     m_pEnableUpdateCheckbox->setChecked(m_cache.m_fCheckEnabled);
    67     if (m_pEnableUpdateCheckbox->isChecked())
     66    m_pCheckBoxUpdate->setChecked(m_cache.m_fCheckEnabled);
     67    if (m_pCheckBoxUpdate->isChecked())
    6868    {
    69         m_pUpdatePeriodCombo->setCurrentIndex(m_cache.m_periodIndex);
     69        m_pComboBoxUpdatePeriod->setCurrentIndex(m_cache.m_periodIndex);
    7070        if (m_cache.m_branchIndex == VBoxUpdateData::BranchWithBetas)
    71             m_pUpdateFilterBetasRadio->setChecked(true);
     71            m_pRadioUpdateFilterBetas->setChecked(true);
    7272        else if (m_cache.m_branchIndex == VBoxUpdateData::BranchAllRelease)
    73             m_pUpdateFilterEveryRadio->setChecked(true);
     73            m_pRadioUpdateFilterEvery->setChecked(true);
    7474        else
    75             m_pUpdateFilterStableRadio->setChecked(true);
     75            m_pRadioUpdateFilterStable->setChecked(true);
    7676    }
    7777    m_pUpdateDateText->setText(m_cache.m_strDate);
     78    sltUpdaterToggled(m_cache.m_fCheckEnabled);
    7879
    79     /* Reset settings altering flag: */
     80    /* Mark page as *not changed*: */
    8081    m_fChanged = false;
    8182}
     
    111112void UIGlobalSettingsUpdate::setOrderAfter(QWidget *pWidget)
    112113{
    113     setTabOrder(pWidget, m_pEnableUpdateCheckbox);
    114     setTabOrder(m_pEnableUpdateCheckbox, m_pUpdatePeriodCombo);
    115     setTabOrder(m_pUpdatePeriodCombo, m_pUpdateFilterStableRadio);
    116     setTabOrder(m_pUpdateFilterStableRadio, m_pUpdateFilterEveryRadio);
    117     setTabOrder(m_pUpdateFilterEveryRadio, m_pUpdateFilterBetasRadio);
     114    /* Configure navigation: */
     115    setTabOrder(pWidget, m_pCheckBoxUpdate);
     116    setTabOrder(m_pCheckBoxUpdate, m_pComboBoxUpdatePeriod);
     117    setTabOrder(m_pComboBoxUpdatePeriod, m_pRadioUpdateFilterStable);
     118    setTabOrder(m_pRadioUpdateFilterStable, m_pRadioUpdateFilterEvery);
     119    setTabOrder(m_pRadioUpdateFilterEvery, m_pRadioUpdateFilterBetas);
    118120}
    119121
     
    123125    Ui::UIGlobalSettingsUpdate::retranslateUi(this);
    124126
    125     /* Retranslate m_pUpdatePeriodCombo combobox: */
    126     int iCurrenIndex = m_pUpdatePeriodCombo->currentIndex();
    127     m_pUpdatePeriodCombo->clear();
     127    /* Retranslate m_pComboBoxUpdatePeriod combobox: */
     128    int iCurrenIndex = m_pComboBoxUpdatePeriod->currentIndex();
     129    m_pComboBoxUpdatePeriod->clear();
    128130    VBoxUpdateData::populate();
    129     m_pUpdatePeriodCombo->insertItems (0, VBoxUpdateData::list());
    130     m_pUpdatePeriodCombo->setCurrentIndex(iCurrenIndex == -1 ? 0 : iCurrenIndex);
     131    m_pComboBoxUpdatePeriod->insertItems(0, VBoxUpdateData::list());
     132    m_pComboBoxUpdatePeriod->setCurrentIndex(iCurrenIndex == -1 ? 0 : iCurrenIndex);
    131133}
    132134
    133135void UIGlobalSettingsUpdate::sltUpdaterToggled(bool fEnabled)
    134136{
    135     /* Enable/disable the sub-widgets depending on activity status: */
    136     m_pUpdatePeriodLabel->setEnabled(fEnabled);
    137     m_pUpdatePeriodCombo->setEnabled(fEnabled);
    138     m_pUpdateDateLabel->setEnabled(fEnabled);
    139     m_pUpdateDateText->setEnabled(fEnabled);
    140     m_pUpdateFilterLabel->setEnabled(fEnabled);
    141     m_pUpdateFilterStableRadio->setEnabled(fEnabled);
    142     m_pUpdateFilterEveryRadio->setEnabled(fEnabled);
    143     m_pUpdateFilterBetasRadio->setEnabled(fEnabled);
    144     m_pUpdateFilterStableRadio->setAutoExclusive(fEnabled);
    145     m_pUpdateFilterEveryRadio->setAutoExclusive(fEnabled);
    146     m_pUpdateFilterBetasRadio->setAutoExclusive(fEnabled);
     137    /* Update activity status: */
     138    m_pContainerUpdate->setEnabled(fEnabled);
    147139
    148140    /* Update time of next check: */
     
    152144    if (!fEnabled)
    153145    {
    154         m_pLastChosenRadio = m_pUpdateFilterBetasRadio->isChecked() ? m_pUpdateFilterBetasRadio :
    155                              m_pUpdateFilterEveryRadio->isChecked() ? m_pUpdateFilterEveryRadio : m_pUpdateFilterStableRadio;
     146        m_pLastChosenRadio = m_pRadioUpdateFilterBetas->isChecked() ? m_pRadioUpdateFilterBetas :
     147                             m_pRadioUpdateFilterEvery->isChecked() ? m_pRadioUpdateFilterEvery : m_pRadioUpdateFilterStable;
    156148    }
    157149
     
    175167VBoxUpdateData::PeriodType UIGlobalSettingsUpdate::periodType() const
    176168{
    177     VBoxUpdateData::PeriodType result = m_pEnableUpdateCheckbox->isChecked() ?
    178         (VBoxUpdateData::PeriodType)m_pUpdatePeriodCombo->currentIndex() : VBoxUpdateData::PeriodNever;
     169    VBoxUpdateData::PeriodType result = m_pCheckBoxUpdate->isChecked() ?
     170        (VBoxUpdateData::PeriodType)m_pComboBoxUpdatePeriod->currentIndex() : VBoxUpdateData::PeriodNever;
    179171    return result == VBoxUpdateData::PeriodUndefined ? VBoxUpdateData::Period1Day : result;
    180172}
     
    182174VBoxUpdateData::BranchType UIGlobalSettingsUpdate::branchType() const
    183175{
    184     if (m_pUpdateFilterBetasRadio->isChecked())
     176    if (m_pRadioUpdateFilterBetas->isChecked())
    185177        return VBoxUpdateData::BranchWithBetas;
    186     else if (m_pUpdateFilterEveryRadio->isChecked())
     178    else if (m_pRadioUpdateFilterEvery->isChecked())
    187179        return VBoxUpdateData::BranchAllRelease;
    188180    else
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.h

    r44528 r47133  
    66
    77/*
    8  * Copyright (C) 2006-2012 Oracle Corporation
     8 * Copyright (C) 2006-2013 Oracle Corporation
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2020#define __UIGlobalSettingsUpdate_h__
    2121
    22 /* Local includes */
     22/* GUI includes: */
    2323#include "UISettingsPage.h"
    2424#include "UIGlobalSettingsUpdate.gen.h"
     
    6060    void saveFromCacheTo(QVariant &data);
    6161
    62     /* Navigation stuff: */
     62    /* Helper: Navigation stuff: */
    6363    void setOrderAfter(QWidget *pWidget);
    6464
    65     /* Translation stuff: */
     65    /* Helper: Translation stuff: */
    6666    void retranslateUi();
    6767
    6868private slots:
    6969
    70     /* Various helper slots: */
     70    /* Handlers: */
    7171    void sltUpdaterToggled(bool fEnabled);
    7272    void sltPeriodActivated();
     
    7979    VBoxUpdateData::BranchType branchType() const;
    8080
    81     /* Last chosen radio-button: */
     81    /* Variables: */
    8282    QRadioButton *m_pLastChosenRadio;
    83 
    84     /* Editnes flag: */
    8583    bool m_fChanged;
    8684
     
    9088
    9189#endif // __UIGlobalSettingsUpdate_h__
    92 
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.ui

    r43106 r47133  
    33 VBox frontends: Qt4 GUI ("VirtualBox"):
    44
    5  Copyright (C) 2008-2012 Oracle Corporation
     5 Copyright (C) 2008-2013 Oracle Corporation
    66
    77 This file is part of VirtualBox Open Source Edition (OSE), as
     
    1515 <class>UIGlobalSettingsUpdate</class>
    1616 <widget class="QWidget" name="UIGlobalSettingsUpdate">
    17   <property name="geometry">
    18    <rect>
    19     <x>0</x>
    20     <y>0</y>
    21     <width>300</width>
    22     <height>150</height>
    23    </rect>
    24   </property>
    2517  <layout class="QGridLayout">
    2618   <property name="margin">
    2719    <number>0</number>
    2820   </property>
    29    <item row="0" column="0">
     21   <item row="0" column="0" colspan="2">
     22    <widget class="QCheckBox" name="m_pCheckBoxUpdate">
     23     <property name="whatsThis">
     24      <string>When checked, the application will periodically connect to the VirtualBox website and check whether a new VirtualBox version is available.</string>
     25     </property>
     26     <property name="text">
     27      <string>&amp;Check for updates</string>
     28     </property>
     29    </widget>
     30   </item>
     31   <item row="1" column="0">
    3032    <spacer>
    3133     <property name="orientation">
     
    3739     <property name="sizeHint">
    3840      <size>
    39        <width>40</width>
    40        <height>20</height>
    41       </size>
    42      </property>
    43     </spacer>
    44    </item>
    45    <item row="0" column="1" colspan="4">
    46     <widget class="QCheckBox" name="m_pEnableUpdateCheckbox">
    47      <property name="whatsThis">
    48       <string>When checked, the application will periodically connect to the VirtualBox website and check whether a new VirtualBox version is available.</string>
    49      </property>
    50      <property name="text">
    51       <string>&amp;Check for updates</string>
    52      </property>
    53      <property name="checked">
    54       <bool>true</bool>
    55      </property>
    56     </widget>
    57    </item>
    58    <item row="1" column="1" rowspan="2">
    59     <spacer>
    60      <property name="orientation">
    61       <enum>Qt::Horizontal</enum>
    62      </property>
    63      <property name="sizeType">
    64       <enum>QSizePolicy::Fixed</enum>
    65      </property>
    66      <property name="sizeHint">
    67       <size>
    68        <width>16</width>
     41       <width>20</width>
    6942       <height>0</height>
    7043      </size>
     
    7245    </spacer>
    7346   </item>
    74    <item row="1" column="2">
    75     <widget class="QLabel" name="m_pUpdatePeriodLabel">
    76      <property name="text">
    77       <string>&amp;Once per:</string>
    78      </property>
    79      <property name="alignment">
    80       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    81      </property>
    82      <property name="buddy">
    83       <cstring>m_pUpdatePeriodCombo</cstring>
    84      </property>
     47   <item row="1" column="1">
     48    <widget class="QWidget" name="m_pContainerUpdate">
     49     <layout class="QGridLayout" name="m_pContainerLayoutUpdate">
     50      <property name="margin">
     51       <number>0</number>
     52      </property>
     53      <item row="0" column="0">
     54       <widget class="QLabel" name="m_pUpdatePeriodLabel">
     55        <property name="text">
     56         <string>&amp;Once per:</string>
     57        </property>
     58        <property name="alignment">
     59         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     60        </property>
     61        <property name="buddy">
     62         <cstring>m_pComboBoxUpdatePeriod</cstring>
     63        </property>
     64       </widget>
     65      </item>
     66      <item row="0" column="1">
     67       <layout class="QHBoxLayout">
     68        <item>
     69         <widget class="QComboBox" name="m_pComboBoxUpdatePeriod">
     70          <property name="whatsThis">
     71           <string>Specifies how often the new version check should be performed. Note that if you want to completely disable this check, just clear the above check box.</string>
     72          </property>
     73          <property name="sizePolicy">
     74           <sizepolicy vsizetype="Fixed" hsizetype="Minimum">
     75            <horstretch>0</horstretch>
     76            <verstretch>0</verstretch>
     77           </sizepolicy>
     78          </property>
     79         </widget>
     80        </item>
     81        <item>
     82         <spacer>
     83          <property name="orientation">
     84           <enum>Qt::Horizontal</enum>
     85          </property>
     86          <property name="sizeHint">
     87           <size>
     88            <width>0</width>
     89            <height>0</height>
     90           </size>
     91          </property>
     92         </spacer>
     93        </item>
     94       </layout>
     95      </item>
     96      <item row="1" column="0">
     97       <widget class="QLabel" name="m_pUpdateDateLabel">
     98        <property name="text">
     99         <string>Next Check:</string>
     100        </property>
     101        <property name="alignment">
     102         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     103        </property>
     104       </widget>
     105      </item>
     106      <item row="1" column="1">
     107       <widget class="QLabel" name="m_pUpdateDateText"/>
     108      </item>
     109      <item row="2" column="0">
     110       <widget class="QLabel" name="m_pUpdateFilterLabel">
     111        <property name="text">
     112         <string>Check for:</string>
     113        </property>
     114        <property name="alignment">
     115         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     116        </property>
     117       </widget>
     118      </item>
     119      <item row="2" column="1">
     120       <widget class="QRadioButton" name="m_pRadioUpdateFilterStable">
     121        <property name="whatsThis">
     122         <string>&lt;p>Choose this if you only wish to be notified about stable updates to VirtualBox.&lt;/p></string>
     123        </property>
     124        <property name="text">
     125         <string>&amp;Stable release versions</string>
     126        </property>
     127       </widget>
     128      </item>
     129      <item row="3" column="1">
     130       <widget class="QRadioButton" name="m_pRadioUpdateFilterEvery">
     131        <property name="whatsThis">
     132         <string>&lt;p>Choose this if you wish to be notified about all new VirtualBox releases.&lt;/p></string>
     133        </property>
     134        <property name="text">
     135         <string>&amp;All new releases</string>
     136        </property>
     137       </widget>
     138      </item>
     139      <item row="4" column="1">
     140       <widget class="QRadioButton" name="m_pRadioUpdateFilterBetas">
     141        <property name="whatsThis">
     142         <string>&lt;p>Choose this to be notified about all new VirtualBox releases and pre-release versions of VirtualBox.&lt;/p></string>
     143        </property>
     144        <property name="text">
     145         <string>All new releases and &amp;pre-releases</string>
     146        </property>
     147       </widget>
     148      </item>
     149     </layout>
    85150    </widget>
    86151   </item>
    87    <item row="1" column="3">
    88     <widget class="QComboBox" name="m_pUpdatePeriodCombo">
    89      <property name="whatsThis">
    90       <string>Specifies how often the new version check should be performed. Note that if you want to completely disable this check, just clear the above check box.</string>
    91      </property>
    92     </widget>
    93    </item>
    94    <item row="1" column="4">
    95     <spacer>
    96      <property name="orientation">
    97       <enum>Qt::Horizontal</enum>
    98      </property>
    99      <property name="sizeHint">
    100       <size>
    101        <width>0</width>
    102        <height>0</height>
    103       </size>
    104      </property>
    105     </spacer>
    106    </item>
    107    <item row="2" column="2">
    108     <widget class="QLabel" name="m_pUpdateDateLabel">
    109      <property name="sizePolicy">
    110       <sizepolicy vsizetype="Preferred" hsizetype="Preferred">
    111        <horstretch>0</horstretch>
    112        <verstretch>0</verstretch>
    113       </sizepolicy>
    114      </property>
    115      <property name="text">
    116       <string>Next Check:</string>
    117      </property>
    118      <property name="alignment">
    119       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    120      </property>
    121     </widget>
    122    </item>
    123    <item row="2" column="3" colspan="2">
    124     <widget class="QLabel" name="m_pUpdateDateText">
    125      <property name="sizePolicy">
    126       <sizepolicy vsizetype="Preferred" hsizetype="Expanding">
    127        <horstretch>0</horstretch>
    128        <verstretch>0</verstretch>
    129       </sizepolicy>
    130      </property>
    131     </widget>
    132    </item>
    133    <item row="3" column="2">
    134     <widget class="QLabel" name="m_pUpdateFilterLabel">
    135      <property name="sizePolicy">
    136       <sizepolicy vsizetype="Preferred" hsizetype="Preferred">
    137        <horstretch>0</horstretch>
    138        <verstretch>0</verstretch>
    139       </sizepolicy>
    140      </property>
    141      <property name="text">
    142       <string>Check for:</string>
    143      </property>
    144      <property name="alignment">
    145       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    146      </property>
    147     </widget>
    148    </item>
    149    <item row="3" column="3" colspan="2">
    150     <widget class="QRadioButton" name="m_pUpdateFilterStableRadio">
    151      <property name="whatsThis">
    152       <string>&lt;p>Choose this if you only wish to be notified about stable updates to VirtualBox.&lt;/p></string>
    153      </property>
    154      <property name="text">
    155       <string>&amp;Stable release versions</string>
    156      </property>
    157     </widget>
    158    </item>
    159    <item row="4" column="3" colspan="2">
    160     <widget class="QRadioButton" name="m_pUpdateFilterEveryRadio">
    161      <property name="whatsThis">
    162       <string>&lt;p>Choose this if you wish to be notified about all new VirtualBox releases.&lt;/p></string>
    163      </property>
    164      <property name="text">
    165       <string>&amp;All new releases</string>
    166      </property>
    167     </widget>
    168    </item>
    169    <item row="5" column="3" colspan="2">
    170     <widget class="QRadioButton" name="m_pUpdateFilterBetasRadio">
    171      <property name="whatsThis">
    172       <string>&lt;p>Choose this to be notified about all new VirtualBox releases and pre-release versions of VirtualBox.&lt;/p></string>
    173      </property>
    174      <property name="text">
    175       <string>All new releases and &amp;pre-releases</string>
    176      </property>
    177     </widget>
    178    </item>
    179    <item row="6" column="1" colspan="4">
     152   <item row="2" column="0" colspan="2">
    180153    <spacer>
    181154     <property name="orientation">
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