Changeset 47133 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 14, 2013 2:03:06 PM (11 years ago)
- 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 7 7 8 8 /* 9 * Copyright (C) 2006-201 2Oracle Corporation9 * Copyright (C) 2006-2013 Oracle Corporation 10 10 * 11 11 * This file is part of VirtualBox Open Source Edition (OSE), as … … 18 18 */ 19 19 20 /* Local includes*/20 /* GUI includes: */ 21 21 #include "UIGlobalSettingsUpdate.h" 22 22 #include "VBoxGlobal.h" … … 31 31 32 32 /* Setup connections: */ 33 connect(m_p EnableUpdateCheckbox, SIGNAL(toggled(bool)), this, SLOT(sltUpdaterToggled(bool)));34 connect(m_p UpdatePeriodCombo, SIGNAL(activated(int)), this, SLOT(sltPeriodActivated()));35 connect(m_p UpdateFilterStableRadio, SIGNAL(toggled(bool)), this, SLOT(sltBranchToggled()));36 connect(m_p UpdateFilterEveryRadio, SIGNAL(toggled(bool)), this, SLOT(sltBranchToggled()));37 connect(m_p UpdateFilterBetasRadio, 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())); 38 38 39 39 /* Apply language settings: */ … … 64 64 { 65 65 /* Apply internal variables data to QWidget(s): */ 66 m_p EnableUpdateCheckbox->setChecked(m_cache.m_fCheckEnabled);67 if (m_p EnableUpdateCheckbox->isChecked())66 m_pCheckBoxUpdate->setChecked(m_cache.m_fCheckEnabled); 67 if (m_pCheckBoxUpdate->isChecked()) 68 68 { 69 m_p UpdatePeriodCombo->setCurrentIndex(m_cache.m_periodIndex);69 m_pComboBoxUpdatePeriod->setCurrentIndex(m_cache.m_periodIndex); 70 70 if (m_cache.m_branchIndex == VBoxUpdateData::BranchWithBetas) 71 m_p UpdateFilterBetasRadio->setChecked(true);71 m_pRadioUpdateFilterBetas->setChecked(true); 72 72 else if (m_cache.m_branchIndex == VBoxUpdateData::BranchAllRelease) 73 m_p UpdateFilterEveryRadio->setChecked(true);73 m_pRadioUpdateFilterEvery->setChecked(true); 74 74 else 75 m_p UpdateFilterStableRadio->setChecked(true);75 m_pRadioUpdateFilterStable->setChecked(true); 76 76 } 77 77 m_pUpdateDateText->setText(m_cache.m_strDate); 78 sltUpdaterToggled(m_cache.m_fCheckEnabled); 78 79 79 /* Reset settings altering flag: */80 /* Mark page as *not changed*: */ 80 81 m_fChanged = false; 81 82 } … … 111 112 void UIGlobalSettingsUpdate::setOrderAfter(QWidget *pWidget) 112 113 { 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); 118 120 } 119 121 … … 123 125 Ui::UIGlobalSettingsUpdate::retranslateUi(this); 124 126 125 /* Retranslate m_p UpdatePeriodCombocombobox: */126 int iCurrenIndex = m_p UpdatePeriodCombo->currentIndex();127 m_p UpdatePeriodCombo->clear();127 /* Retranslate m_pComboBoxUpdatePeriod combobox: */ 128 int iCurrenIndex = m_pComboBoxUpdatePeriod->currentIndex(); 129 m_pComboBoxUpdatePeriod->clear(); 128 130 VBoxUpdateData::populate(); 129 m_p UpdatePeriodCombo->insertItems(0, VBoxUpdateData::list());130 m_p UpdatePeriodCombo->setCurrentIndex(iCurrenIndex == -1 ? 0 : iCurrenIndex);131 m_pComboBoxUpdatePeriod->insertItems(0, VBoxUpdateData::list()); 132 m_pComboBoxUpdatePeriod->setCurrentIndex(iCurrenIndex == -1 ? 0 : iCurrenIndex); 131 133 } 132 134 133 135 void UIGlobalSettingsUpdate::sltUpdaterToggled(bool fEnabled) 134 136 { 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); 147 139 148 140 /* Update time of next check: */ … … 152 144 if (!fEnabled) 153 145 { 154 m_pLastChosenRadio = m_p UpdateFilterBetasRadio->isChecked() ? m_pUpdateFilterBetasRadio:155 m_p UpdateFilterEveryRadio->isChecked() ? m_pUpdateFilterEveryRadio : m_pUpdateFilterStableRadio;146 m_pLastChosenRadio = m_pRadioUpdateFilterBetas->isChecked() ? m_pRadioUpdateFilterBetas : 147 m_pRadioUpdateFilterEvery->isChecked() ? m_pRadioUpdateFilterEvery : m_pRadioUpdateFilterStable; 156 148 } 157 149 … … 175 167 VBoxUpdateData::PeriodType UIGlobalSettingsUpdate::periodType() const 176 168 { 177 VBoxUpdateData::PeriodType result = m_p EnableUpdateCheckbox->isChecked() ?178 (VBoxUpdateData::PeriodType)m_p UpdatePeriodCombo->currentIndex() : VBoxUpdateData::PeriodNever;169 VBoxUpdateData::PeriodType result = m_pCheckBoxUpdate->isChecked() ? 170 (VBoxUpdateData::PeriodType)m_pComboBoxUpdatePeriod->currentIndex() : VBoxUpdateData::PeriodNever; 179 171 return result == VBoxUpdateData::PeriodUndefined ? VBoxUpdateData::Period1Day : result; 180 172 } … … 182 174 VBoxUpdateData::BranchType UIGlobalSettingsUpdate::branchType() const 183 175 { 184 if (m_p UpdateFilterBetasRadio->isChecked())176 if (m_pRadioUpdateFilterBetas->isChecked()) 185 177 return VBoxUpdateData::BranchWithBetas; 186 else if (m_p UpdateFilterEveryRadio->isChecked())178 else if (m_pRadioUpdateFilterEvery->isChecked()) 187 179 return VBoxUpdateData::BranchAllRelease; 188 180 else -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.h
r44528 r47133 6 6 7 7 /* 8 * Copyright (C) 2006-201 2Oracle Corporation8 * Copyright (C) 2006-2013 Oracle Corporation 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #define __UIGlobalSettingsUpdate_h__ 21 21 22 /* Local includes*/22 /* GUI includes: */ 23 23 #include "UISettingsPage.h" 24 24 #include "UIGlobalSettingsUpdate.gen.h" … … 60 60 void saveFromCacheTo(QVariant &data); 61 61 62 /* Navigation stuff: */62 /* Helper: Navigation stuff: */ 63 63 void setOrderAfter(QWidget *pWidget); 64 64 65 /* Translation stuff: */65 /* Helper: Translation stuff: */ 66 66 void retranslateUi(); 67 67 68 68 private slots: 69 69 70 /* Various helper slots: */70 /* Handlers: */ 71 71 void sltUpdaterToggled(bool fEnabled); 72 72 void sltPeriodActivated(); … … 79 79 VBoxUpdateData::BranchType branchType() const; 80 80 81 /* Last chosen radio-button: */81 /* Variables: */ 82 82 QRadioButton *m_pLastChosenRadio; 83 84 /* Editnes flag: */85 83 bool m_fChanged; 86 84 … … 90 88 91 89 #endif // __UIGlobalSettingsUpdate_h__ 92 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsUpdate.ui
r43106 r47133 3 3 VBox frontends: Qt4 GUI ("VirtualBox"): 4 4 5 Copyright (C) 2008-201 2Oracle Corporation5 Copyright (C) 2008-2013 Oracle Corporation 6 6 7 7 This file is part of VirtualBox Open Source Edition (OSE), as … … 15 15 <class>UIGlobalSettingsUpdate</class> 16 16 <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>25 17 <layout class="QGridLayout"> 26 18 <property name="margin"> 27 19 <number>0</number> 28 20 </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>&Check for updates</string> 28 </property> 29 </widget> 30 </item> 31 <item row="1" column="0"> 30 32 <spacer> 31 33 <property name="orientation"> … … 37 39 <property name="sizeHint"> 38 40 <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>&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> 69 42 <height>0</height> 70 43 </size> … … 72 45 </spacer> 73 46 </item> 74 <item row="1" column="2"> 75 <widget class="QLabel" name="m_pUpdatePeriodLabel"> 76 <property name="text"> 77 <string>&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>&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><p>Choose this if you only wish to be notified about stable updates to VirtualBox.</p></string> 123 </property> 124 <property name="text"> 125 <string>&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><p>Choose this if you wish to be notified about all new VirtualBox releases.</p></string> 133 </property> 134 <property name="text"> 135 <string>&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><p>Choose this to be notified about all new VirtualBox releases and pre-release versions of VirtualBox.</p></string> 143 </property> 144 <property name="text"> 145 <string>All new releases and &pre-releases</string> 146 </property> 147 </widget> 148 </item> 149 </layout> 85 150 </widget> 86 151 </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><p>Choose this if you only wish to be notified about stable updates to VirtualBox.</p></string> 153 </property> 154 <property name="text"> 155 <string>&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><p>Choose this if you wish to be notified about all new VirtualBox releases.</p></string> 163 </property> 164 <property name="text"> 165 <string>&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><p>Choose this to be notified about all new VirtualBox releases and pre-release versions of VirtualBox.</p></string> 173 </property> 174 <property name="text"> 175 <string>All new releases and &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"> 180 153 <spacer> 181 154 <property name="orientation">
Note:
See TracChangeset
for help on using the changeset viewer.