Changeset 80913 in vbox
- Timestamp:
- Sep 20, 2019 6:03:25 AM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.cpp
r80554 r80913 47 47 prepareObjects(); 48 48 retranslateUi(); 49 createTableItems();50 49 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineDataChange, 51 50 this, &UIInformationConfiguration::sltMachineDataChanged); … … 54 53 void UIInformationConfiguration::sltMachineDataChanged() 55 54 { 56 resetTable();57 55 createTableItems(); 58 56 } … … 69 67 m_strUSBTitle = QApplication::translate("UIVMInformationDialog", "USB"); 70 68 m_strSharedFoldersTitle = QApplication::translate("UIVMInformationDialog", "Shared Folders"); 69 createTableItems(); 71 70 } 72 71 … … 75 74 if (!m_pTableWidget) 76 75 return; 76 resetTable(); 77 77 QFontMetrics fontMetrics(m_pTableWidget->font()); 78 78 QTextDocument textDocument; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp
r80772 r80913 102 102 void createInfoRows(); 103 103 void updateUpTime(); 104 104 void updateTitleRow(); 105 105 106 106 /** Searches the table for the @p item of enmLine and replaces its text. if not found inserts a new … … 108 108 void updateInfoRow(InfoRow enmLine, const QString &strColumn0, const QString &strColumn1); 109 109 QString screenResolution(int iScreenId); 110 /** Creates to QTableWidgetItems of t ye @enmInfoRow using the @p strLabel and @p strInfo and inserts it110 /** Creates to QTableWidgetItems of the @enmInfoRow using the @p strLabel and @p strInfo and inserts it 111 111 * to the row @p iRow. If @p iRow is -1 then the items inserted to the end of the table. */ 112 112 void insertInfoRow(InfoRow enmInfoRow, const QString& strLabel, const QString &strInfo, int iRow = -1); … … 244 244 , m_iMinimumWidth(0) 245 245 , m_pTimer(0) 246 247 246 { 248 247 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); … … 266 265 267 266 retranslateUi(); 268 /* Add the title row: */269 QTableWidgetItem *pTitleItem = new QTableWidgetItem(UIIconPool::iconSet(":/state_running_16px.png"), m_strTableTitle, InfoRow_Title);270 QFont titleFont(font());271 titleFont.setBold(true);272 pTitleItem->setFont(titleFont);273 insertRow(0);274 setItem(0, 0, pTitleItem);275 /* Make the API calls and populate the table: */276 createInfoRows();277 267 computeMinimumWidth(); 278 268 } … … 298 288 m_strNotSet = QApplication::translate("UIVMInformationDialog", "not set"); 299 289 m_strNotDetected = QApplication::translate("UIVMInformationDialog", "Not Detected"); 290 291 /* Make the API calls and populate the table: */ 292 createInfoRows(); 300 293 } 301 294 … … 312 305 void UIRuntimeInfoWidget::insertInfoRow(InfoRow enmInfoRow, const QString& strLabel, const QString &strInfo, int iRow /* = -1 */) 313 306 { 314 int iMargin = 0.2 * qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin);315 307 int iNewRow = rowCount(); 316 308 if (iRow != -1 && iRow <= iNewRow) … … 319 311 setItem(iNewRow, 0, new QTableWidgetItem(strLabel, enmInfoRow)); 320 312 setItem(iNewRow, 1, new QTableWidgetItem(strInfo, enmInfoRow)); 313 int iMargin = 0.2 * qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin); 321 314 setRowHeight(iNewRow, 2 * iMargin + m_iFontHeight); 322 315 } … … 398 391 } 399 392 393 void UIRuntimeInfoWidget::updateTitleRow() 394 { 395 /* Add the title row always as 0th row: */ 396 QTableWidgetItem *pTitleItem = new QTableWidgetItem(UIIconPool::iconSet(":/state_running_16px.png"), m_strTableTitle, InfoRow_Title); 397 QFont titleFont(font()); 398 titleFont.setBold(true); 399 pTitleItem->setFont(titleFont); 400 if (rowCount() < 1) 401 insertRow(0); 402 setItem(0, 0, pTitleItem); 403 } 404 400 405 void UIRuntimeInfoWidget::updateGAsVersion() 401 406 { … … 460 465 void UIRuntimeInfoWidget::createInfoRows() 461 466 { 467 clear(); 468 setRowCount(0); 469 setColumnCount(2); 470 updateTitleRow(); 462 471 updateScreenInfo(); 463 472 updateUpTime(); … … 649 658 m_strResetActionLabel = QApplication::translate("UIVMInformationDialog", "Reset"); 650 659 m_strPieChartToggleActionLabel = QApplication::translate("UIVMInformationDialog", "Show Pie Chart"); 660 update(); 651 661 } 652 662 … … 1234 1244 } 1235 1245 } 1246 sltTimeout(); 1236 1247 } 1237 1248
Note:
See TracChangeset
for help on using the changeset viewer.