Changeset 55276 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 15, 2015 11:11:36 AM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.cpp
r55264 r55276 1 /* $Id$ */1 /* $Id$ */ 2 2 /** @file 3 3 * VBox Qt GUI - UISettingsSerializer class implementation. … … 181 181 , m_pages(pages) 182 182 , m_pSerializer(0) 183 , m_pLabelOperationProgress(0) 184 , m_pBarOperationProgress(0) 183 185 { 184 186 /* Prepare: */ … … 230 232 AssertPtrReturnVoid(pLayoutTop); 231 233 { 232 /* Create pixmap la bel: */233 Q Label *pLabelPixmap = new QLabel;234 AssertPtrReturnVoid(pLa belPixmap);234 /* Create pixmap layout: */ 235 QVBoxLayout *pLayoutPixmap = new QVBoxLayout; 236 AssertPtrReturnVoid(pLayoutPixmap); 235 237 { 236 /* Configure label: */ 237 const QIcon icon = UIIconPool::iconSet(":/progress_settings_90px.png"); 238 pLabelPixmap->setPixmap(icon.pixmap(icon.availableSizes().first())); 239 /* Add label into layout: */ 240 pLayoutTop->addWidget(pLabelPixmap); 238 /* Create pixmap label: */ 239 QLabel *pLabelPixmap = new QLabel; 240 AssertPtrReturnVoid(pLabelPixmap); 241 { 242 /* Configure label: */ 243 const QIcon icon = UIIconPool::iconSet(":/progress_settings_90px.png"); 244 pLabelPixmap->setPixmap(icon.pixmap(icon.availableSizes().first())); 245 /* Add label into layout: */ 246 pLayoutPixmap->addWidget(pLabelPixmap); 247 } 248 /* Add stretch: */ 249 pLayoutPixmap->addStretch(); 250 /* Add layout into parent: */ 251 pLayoutTop->addLayout(pLayoutPixmap); 241 252 } 242 253 /* Create progress layout: */ 243 QVBoxLayout *pLayoutProgress = new QVBoxLayout (this);254 QVBoxLayout *pLayoutProgress = new QVBoxLayout; 244 255 AssertPtrReturnVoid(pLayoutProgress); 245 256 { 246 /* Create progress label: */247 m_pLabel Progress = new QLabel;248 AssertPtrReturnVoid(m_pLabel Progress);257 /* Create operation progress label: */ 258 m_pLabelOperationProgress = new QLabel; 259 AssertPtrReturnVoid(m_pLabelOperationProgress); 249 260 { 250 261 /* Add label into layout: */ 251 pLayoutProgress->addWidget(m_pLabel Progress);262 pLayoutProgress->addWidget(m_pLabelOperationProgress); 252 263 } 253 /* Create progress bar: */254 m_pBar Progress = new QProgressBar;255 AssertPtrReturnVoid(m_pBar Progress);264 /* Create operation progress bar: */ 265 m_pBarOperationProgress = new QProgressBar; 266 AssertPtrReturnVoid(m_pBarOperationProgress); 256 267 { 257 268 /* Configure progress bar: */ 258 m_pBar Progress->setMinimumWidth(200);259 m_pBar Progress->setMaximum(m_pSerializer->pageCount() + 1);260 m_pBar Progress->setMinimum(0);261 m_pBar Progress->setValue(0);262 connect(m_pBar Progress, SIGNAL(valueChanged(int)),269 m_pBarOperationProgress->setMinimumWidth(300); 270 m_pBarOperationProgress->setMaximum(m_pSerializer->pageCount() + 1); 271 m_pBarOperationProgress->setMinimum(0); 272 m_pBarOperationProgress->setValue(0); 273 connect(m_pBarOperationProgress, SIGNAL(valueChanged(int)), 263 274 this, SLOT(sltProgressValueChanged(int))); 264 275 /* Add bar into layout: */ 265 pLayoutProgress->addWidget(m_pBar Progress);276 pLayoutProgress->addWidget(m_pBarOperationProgress); 266 277 } 267 278 /* Add stretch: */ … … 278 289 void UISettingsSerializerProgress::retranslateUi() 279 290 { 280 /* Translate progress label: */281 AssertPtrReturnVoid(m_pLabel Progress);291 /* Translate operation progress label: */ 292 AssertPtrReturnVoid(m_pLabelOperationProgress); 282 293 switch (m_pSerializer->direction()) 283 294 { 284 case UISettingsSerializer::Load: m_pLabel Progress->setText(tr("Loading Settings...")); break;285 case UISettingsSerializer::Save: m_pLabel Progress->setText(tr("Saving Settings...")); break;295 case UISettingsSerializer::Load: m_pLabelOperationProgress->setText(tr("Loading Settings...")); break; 296 case UISettingsSerializer::Save: m_pLabelOperationProgress->setText(tr("Saving Settings...")); break; 286 297 } 287 298 } … … 307 318 { 308 319 /* Advance the serialize progress bar: */ 309 AssertPtrReturnVoid(m_pBar Progress);310 m_pBar Progress->setValue(m_pBarProgress->value() + 1);320 AssertPtrReturnVoid(m_pBarOperationProgress); 321 m_pBarOperationProgress->setValue(m_pBarOperationProgress->value() + 1); 311 322 } 312 323 313 324 void UISettingsSerializerProgress::sltProgressValueChanged(int iValue) 314 325 { 315 AssertPtrReturnVoid(m_pBar Progress);316 if (iValue == m_pBar Progress->maximum())326 AssertPtrReturnVoid(m_pBarOperationProgress); 327 if (iValue == m_pBarOperationProgress->maximum()) 317 328 hide(); 318 329 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.h
r55263 r55276 192 192 UISettingsSerializer *m_pSerializer; 193 193 194 /** Holds the progress label. */195 QLabel *m_pLabel Progress;196 /** Holds the progress bar. */197 QProgressBar *m_pBar Progress;194 /** Holds the operation progress label. */ 195 QLabel *m_pLabelOperationProgress; 196 /** Holds the operation progress bar. */ 197 QProgressBar *m_pBarOperationProgress; 198 198 }; 199 199
Note:
See TracChangeset
for help on using the changeset viewer.