- Timestamp:
- Jun 9, 2017 8:17:05 AM (8 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.cpp
r67277 r67306 319 319 , m_pTabWidget(0) 320 320 , m_pLayoutOptions(0) 321 , m_pLabelTaken(0), m_pLabelTakenText(0)322 321 , m_pLabelName(0), m_pEditorName(0) 323 322 , m_pLabelThumbnail(0) … … 385 384 m_pTabWidget->setTabText(1, tr("D&etails")); 386 385 m_pLabelName->setText(tr("&Name:")); 387 m_pLabelTaken->setText(tr("Taken:"));388 386 m_pLabelDescription->setText(tr("&Description:")); 389 387 … … 498 496 AssertPtrReturnVoid(m_pLayoutOptions); 499 497 { 500 /* Create taken label: */501 m_pLabelTaken = new QLabel;502 AssertPtrReturnVoid(m_pLabelTaken);503 {504 /* Configure label: */505 m_pLabelTaken->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);506 507 /* Add into layout: */508 m_pLayoutOptions->addWidget(m_pLabelTaken, 0, 0);509 }510 /* Create taken text: */511 m_pLabelTakenText = new QLabel;512 AssertPtrReturnVoid(m_pLabelTakenText);513 {514 /* Configure label: */515 QSizePolicy policy(QSizePolicy::Expanding, QSizePolicy::Minimum);516 policy.setHorizontalStretch(1);517 m_pLabelTakenText->setSizePolicy(policy);518 519 /* Add into layout: */520 m_pLayoutOptions->addWidget(m_pLabelTakenText, 0, 1);521 }522 523 498 /* Create name label: */ 524 499 m_pLabelName = new QLabel; … … 529 504 530 505 /* Add into layout: */ 531 m_pLayoutOptions->addWidget(m_pLabelName, 1, 0);506 m_pLayoutOptions->addWidget(m_pLabelName, 0, 0); 532 507 } 533 508 /* Create name editor: */ … … 544 519 545 520 /* Add into layout: */ 546 m_pLayoutOptions->addWidget(m_pEditorName, 1, 1);521 m_pLayoutOptions->addWidget(m_pEditorName, 0, 1); 547 522 } 548 523 … … 675 650 m_pStackedLayout->setCurrentWidget(m_pTabWidget); 676 651 677 /* Calculate snapshot timestamp info: */678 QDateTime timestamp;679 timestamp.setTime_t(m_comSnapshot.GetTimeStamp() / 1000);680 bool fDateTimeToday = timestamp.date() == QDate::currentDate();681 QString dateTime = fDateTimeToday ? timestamp.time().toString(Qt::LocalDate) : timestamp.toString(Qt::LocalDate);682 m_pLabelTakenText->setText(dateTime);683 684 652 /* Read snapshot display contents: */ 685 653 CMachine comMachine = m_comSnapshot.GetMachine(); … … 709 677 m_pLabelThumbnail->setHidden(true); 710 678 711 m_pLayoutOptions->removeWidget(m_pLabelTakenText);712 679 m_pLayoutOptions->removeWidget(m_pEditorName); 713 m_pLayoutOptions->addWidget(m_pLabelTakenText, 0, 1, 1, 2); 714 m_pLayoutOptions->addWidget(m_pEditorName, 1, 1, 1, 2); 680 m_pLayoutOptions->addWidget(m_pEditorName, 0, 1, 1, 2); 715 681 } 716 682 else … … 722 688 Qt::SmoothTransformation)); 723 689 724 m_pLayoutOptions->removeWidget(m_pLabelTakenText);725 690 m_pLayoutOptions->removeWidget(m_pEditorName); 726 m_pLayoutOptions->addWidget(m_pLabelTakenText, 0, 1); 727 m_pLayoutOptions->addWidget(m_pEditorName, 1, 1); 691 m_pLayoutOptions->addWidget(m_pEditorName, 0, 1); 728 692 729 693 m_pLayoutOptions->removeWidget(m_pLabelThumbnail); … … 737 701 m_pStackedLayout->setCurrentWidget(m_pEmptyWidget); 738 702 739 /* Clear snapshot timestamp info: */740 m_pLabelTakenText->clear();741 742 703 // TODO: Check whether layout manipulations are really 743 704 // necessary, they looks a bit dangerous to me.. … … 749 710 750 711 m_pLayoutOptions->removeWidget(m_pEditorName); 751 m_pLayoutOptions->removeWidget(m_pLabelTakenText); 752 m_pLayoutOptions->addWidget(m_pLabelTakenText, 0, 1, 1, 2); 753 m_pLayoutOptions->addWidget(m_pEditorName, 1, 1, 1, 2); 712 m_pLayoutOptions->addWidget(m_pEditorName, 0, 1, 1, 2); 754 713 } 755 714 } -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotDetailsWidget.h
r67277 r67306 155 155 QGridLayout *m_pLayoutOptions; 156 156 157 /** Holds the taken label instance. */158 QLabel *m_pLabelTaken;159 /** Holds the taken text instance. */160 QLabel *m_pLabelTakenText;161 162 157 /** Holds the name label instance. */ 163 158 QLabel *m_pLabelName;
Note:
See TracChangeset
for help on using the changeset viewer.