- Timestamp:
- Oct 18, 2024 3:33:27 PM (6 weeks ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/editors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIUpdateSettingsEditor.cpp
r106061 r106482 40 40 UIUpdateSettingsEditor::UIUpdateSettingsEditor(QWidget *pParent /* = 0 */) 41 41 : UIEditor(pParent, true /* show in basic mode? */) 42 , m_pRadioButtonGroup(0) 42 43 , m_pCheckBox(0) 43 44 , m_pWidgetUpdateSettings(0) … … 46 47 , m_pLabelUpdateDate(0) 47 48 , m_pFieldUpdateDate(0) 48 , m_pLabelUpdateFilter(0)49 , m_pRadioButtonGroup(0)50 49 { 51 50 prepare(); … … 69 68 void UIUpdateSettingsEditor::sltRetranslateUI() 70 69 { 70 /* Translate branch widgets: */ 71 if (m_mapRadioButtons.value(KUpdateChannel_Stable)) 72 { 73 m_mapRadioButtons.value(KUpdateChannel_Stable)->setText(tr("&Stable Release Versions")); 74 m_mapRadioButtons.value(KUpdateChannel_Stable)->setToolTip(tr("When chosen, you will be notified " 75 "about stable updates to VirtualBox.")); 76 } 77 if (m_mapRadioButtons.value(KUpdateChannel_All)) 78 { 79 m_mapRadioButtons.value(KUpdateChannel_All)->setText(tr("&All New Releases")); 80 m_mapRadioButtons.value(KUpdateChannel_All)->setToolTip(tr("When chosen, you will be notified " 81 "about all new VirtualBox releases.")); 82 } 83 if (m_mapRadioButtons.value(KUpdateChannel_WithBetas)) 84 { 85 m_mapRadioButtons.value(KUpdateChannel_WithBetas)->setText(tr("All New Releases and &Pre-Releases")); 86 m_mapRadioButtons.value(KUpdateChannel_WithBetas)->setToolTip(tr("When chosen, you will be notified " 87 "about all new VirtualBox releases and " 88 "pre-release versions of VirtualBox.")); 89 } 90 if (m_mapRadioButtons.value(KUpdateChannel_WithTesting)) 91 { 92 m_mapRadioButtons.value(KUpdateChannel_WithTesting)->setText(tr("All New Releases, &Pre-Releases and Testing Builds")); 93 m_mapRadioButtons.value(KUpdateChannel_WithTesting)->setToolTip(tr("When chosen, you will be notified " 94 "about all new VirtualBox releases, " 95 "pre-release versions and testing builds of " 96 "VirtualBox.")); 97 } 98 71 99 /* Translate check-box: */ 72 100 if (m_pCheckBox) … … 91 119 if (m_pLabelUpdateDate) 92 120 m_pLabelUpdateDate->setText(tr("Next Check:")); 93 if (m_pLabelUpdateFilter)94 m_pLabelUpdateFilter->setText(tr("Check for:"));95 96 /* Translate branch widgets: */97 if (m_mapRadioButtons.value(KUpdateChannel_Stable))98 {99 m_mapRadioButtons.value(KUpdateChannel_Stable)->setText(tr("&Stable Release Versions"));100 m_mapRadioButtons.value(KUpdateChannel_Stable)->setToolTip(tr("When chosen, you will be notified "101 "about stable updates to VirtualBox."));102 }103 if (m_mapRadioButtons.value(KUpdateChannel_All))104 {105 m_mapRadioButtons.value(KUpdateChannel_All)->setText(tr("&All New Releases"));106 m_mapRadioButtons.value(KUpdateChannel_All)->setToolTip(tr("When chosen, you will be notified "107 "about all new VirtualBox releases."));108 }109 if (m_mapRadioButtons.value(KUpdateChannel_WithBetas))110 {111 m_mapRadioButtons.value(KUpdateChannel_WithBetas)->setText(tr("All New Releases and &Pre-Releases"));112 m_mapRadioButtons.value(KUpdateChannel_WithBetas)->setToolTip(tr("When chosen, you will be notified "113 "about all new VirtualBox releases and "114 "pre-release versions of VirtualBox."));115 }116 if (m_mapRadioButtons.value(KUpdateChannel_WithTesting))117 {118 m_mapRadioButtons.value(KUpdateChannel_WithTesting)->setText(tr("All New Releases, &Pre-Releases and Testing Builds"));119 m_mapRadioButtons.value(KUpdateChannel_WithTesting)->setToolTip(tr("When chosen, you will be notified "120 "about all new VirtualBox releases, "121 "pre-release versions and testing builds of "122 "VirtualBox."));123 }124 121 } 125 122 … … 170 167 { 171 168 pLayout->setContentsMargins(0, 0, 0, 0); 172 pLayout->setRowStretch(2, 1); 169 pLayout->setColumnStretch(1, 1); 170 171 /* Prepare radio-button group: */ 172 m_pRadioButtonGroup = new QButtonGroup(m_pWidgetUpdateSettings); 173 if (m_pRadioButtonGroup) 174 { 175 /* Prepare 'update to "stable"' radio-button: */ 176 m_mapRadioButtons[KUpdateChannel_Stable] = new QRadioButton(m_pWidgetUpdateSettings); 177 if (m_mapRadioButtons.value(KUpdateChannel_Stable)) 178 { 179 m_mapRadioButtons.value(KUpdateChannel_Stable)->setVisible(false); 180 m_pRadioButtonGroup->addButton(m_mapRadioButtons.value(KUpdateChannel_Stable)); 181 pLayout->addWidget(m_mapRadioButtons.value(KUpdateChannel_Stable), 0, 0, 1, 2); 182 } 183 /* Prepare 'update to "all release"' radio-button: */ 184 m_mapRadioButtons[KUpdateChannel_All] = new QRadioButton(m_pWidgetUpdateSettings); 185 if (m_mapRadioButtons.value(KUpdateChannel_All)) 186 { 187 m_mapRadioButtons.value(KUpdateChannel_All)->setVisible(false); 188 m_pRadioButtonGroup->addButton(m_mapRadioButtons.value(KUpdateChannel_All)); 189 pLayout->addWidget(m_mapRadioButtons.value(KUpdateChannel_All), 1, 0, 1, 2); 190 } 191 /* Prepare 'update to "with betas"' radio-button: */ 192 m_mapRadioButtons[KUpdateChannel_WithBetas] = new QRadioButton(m_pWidgetUpdateSettings); 193 if (m_mapRadioButtons.value(KUpdateChannel_WithBetas)) 194 { 195 m_mapRadioButtons.value(KUpdateChannel_WithBetas)->setVisible(false); 196 m_pRadioButtonGroup->addButton(m_mapRadioButtons.value(KUpdateChannel_WithBetas)); 197 pLayout->addWidget(m_mapRadioButtons.value(KUpdateChannel_WithBetas), 2, 0, 1, 2); 198 } 199 /* Prepare 'update to "with testing"' radio-button: */ 200 m_mapRadioButtons[KUpdateChannel_WithTesting] = new QRadioButton(m_pWidgetUpdateSettings); 201 if (m_mapRadioButtons.value(KUpdateChannel_WithTesting)) 202 { 203 m_mapRadioButtons.value(KUpdateChannel_WithTesting)->setVisible(false); 204 m_pRadioButtonGroup->addButton(m_mapRadioButtons.value(KUpdateChannel_WithTesting)); 205 pLayout->addWidget(m_mapRadioButtons.value(KUpdateChannel_WithTesting), 3, 0, 1, 2); 206 } 207 } 173 208 174 209 /* Prepare update check-box: */ 175 210 m_pCheckBox = new QCheckBox(this); 176 211 if (m_pCheckBox) 177 pLayout->addWidget(m_pCheckBox, 0, 0, 1, 2);212 pLayout->addWidget(m_pCheckBox, 4, 0, 1, 2); 178 213 179 214 /* Prepare 20-px shifting spacer: */ 180 215 QSpacerItem *pSpacerItem = new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum); 181 216 if (pSpacerItem) 182 pLayout->addItem(pSpacerItem, 1, 0);217 pLayout->addItem(pSpacerItem, 5, 0); 183 218 184 219 /* Prepare update settings widget: */ … … 227 262 pLayoutUpdateSettings->addWidget(m_pFieldUpdateDate, 1, 1); 228 263 } 229 230 /* Prepare update date label: */ 231 m_pLabelUpdateFilter = new QLabel(m_pWidgetUpdateSettings); 232 if (m_pLabelUpdateFilter) 233 { 234 m_pLabelUpdateFilter->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 235 pLayoutUpdateSettings->addWidget(m_pLabelUpdateFilter, 2, 0); 236 } 237 /* Prepare radio-button group: */ 238 m_pRadioButtonGroup = new QButtonGroup(m_pWidgetUpdateSettings); 239 if (m_pRadioButtonGroup) 240 { 241 /* Prepare 'update to "stable"' radio-button: */ 242 m_mapRadioButtons[KUpdateChannel_Stable] = new QRadioButton(m_pWidgetUpdateSettings); 243 if (m_mapRadioButtons.value(KUpdateChannel_Stable)) 244 { 245 m_mapRadioButtons.value(KUpdateChannel_Stable)->setVisible(false); 246 m_pRadioButtonGroup->addButton(m_mapRadioButtons.value(KUpdateChannel_Stable)); 247 pLayoutUpdateSettings->addWidget(m_mapRadioButtons.value(KUpdateChannel_Stable), 2, 1); 248 } 249 /* Prepare 'update to "all release"' radio-button: */ 250 m_mapRadioButtons[KUpdateChannel_All] = new QRadioButton(m_pWidgetUpdateSettings); 251 if (m_mapRadioButtons.value(KUpdateChannel_All)) 252 { 253 m_mapRadioButtons.value(KUpdateChannel_All)->setVisible(false); 254 m_pRadioButtonGroup->addButton(m_mapRadioButtons.value(KUpdateChannel_All)); 255 pLayoutUpdateSettings->addWidget(m_mapRadioButtons.value(KUpdateChannel_All), 3, 1); 256 } 257 /* Prepare 'update to "with betas"' radio-button: */ 258 m_mapRadioButtons[KUpdateChannel_WithBetas] = new QRadioButton(m_pWidgetUpdateSettings); 259 if (m_mapRadioButtons.value(KUpdateChannel_WithBetas)) 260 { 261 m_mapRadioButtons.value(KUpdateChannel_WithBetas)->setVisible(false); 262 m_pRadioButtonGroup->addButton(m_mapRadioButtons.value(KUpdateChannel_WithBetas)); 263 pLayoutUpdateSettings->addWidget(m_mapRadioButtons.value(KUpdateChannel_WithBetas), 4, 1); 264 } 265 /* Prepare 'update to "with testing"' radio-button: */ 266 m_mapRadioButtons[KUpdateChannel_WithTesting] = new QRadioButton(m_pWidgetUpdateSettings); 267 if (m_mapRadioButtons.value(KUpdateChannel_WithTesting)) 268 { 269 m_mapRadioButtons.value(KUpdateChannel_WithTesting)->setVisible(false); 270 m_pRadioButtonGroup->addButton(m_mapRadioButtons.value(KUpdateChannel_WithTesting)); 271 pLayoutUpdateSettings->addWidget(m_mapRadioButtons.value(KUpdateChannel_WithTesting), 5, 1); 272 } 273 } 274 } 275 276 pLayout->addWidget(m_pWidgetUpdateSettings, 1, 1); 264 } 265 266 pLayout->addWidget(m_pWidgetUpdateSettings, 5, 1); 277 267 } 278 268 } … … 320 310 if (m_pComboUpdatePeriod) 321 311 m_pComboUpdatePeriod->setCurrentIndex(m_guiValue.updatePeriod()); 322 if (m_mapRadioButtons.value(m_guiValue.updateChannel()))323 m_mapRadioButtons.value(m_guiValue.updateChannel())->setChecked(true);324 312 } 325 313 314 if (m_mapRadioButtons.value(m_guiValue.updateChannel())) 315 m_mapRadioButtons.value(m_guiValue.updateChannel())->setChecked(true); 316 326 317 sltHandleUpdateToggle(m_pCheckBox->isChecked()); 327 318 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIUpdateSettingsEditor.h
r106061 r106482 99 99 /** @name Widgets 100 100 * @{ */ 101 /** Holds the radio button group instance. */ 102 QButtonGroup *m_pRadioButtonGroup; 103 /** Holds the radio button map instance. */ 104 QMap<KUpdateChannel, QAbstractButton*> m_mapRadioButtons; 105 101 106 /** Holds the update check-box instance. */ 102 107 QCheckBox *m_pCheckBox; … … 111 116 /** Holds the update date field instance. */ 112 117 QLabel *m_pFieldUpdateDate; 113 /** Holds the update filter label instance. */114 QLabel *m_pLabelUpdateFilter;115 116 /** Holds the radio button group instance. */117 QButtonGroup *m_pRadioButtonGroup;118 /** Holds the radio button map instance. */119 QMap<KUpdateChannel, QAbstractButton*> m_mapRadioButtons;120 118 /** @} */ 121 119 };
Note:
See TracChangeset
for help on using the changeset viewer.