Changeset 73783 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 20, 2018 11:41:59 AM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.cpp
r73780 r73783 678 678 void UIHostNetworkManagerWidget::prepare() 679 679 { 680 /* Prepare this: */ 681 prepareThis(); 680 /* Prepare actions: */ 681 prepareActions(); 682 /* Prepare widgets: */ 683 prepareWidgets(); 682 684 683 685 /* Load settings: */ … … 689 691 /* Load host networks: */ 690 692 loadHostNetworks(); 691 }692 693 void UIHostNetworkManagerWidget::prepareThis()694 {695 /* Prepare actions: */696 prepareActions();697 /* Prepare widget: */698 prepareWidgets();699 693 } 700 694 … … 726 720 #endif 727 721 728 /* Prepare toolbar : */722 /* Prepare toolbar, if requested: */ 729 723 if (m_fShowToolbar) 730 724 prepareToolBar(); … … 746 740 m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric)); 747 741 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 742 748 743 /* Add toolbar actions: */ 749 744 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Network_S_Create)); … … 753 748 // m_pToolBar->addSeparator(); 754 749 // m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Network_S_Refresh)); 750 755 751 #ifdef VBOX_WS_MAC 756 752 /* Check whether we are embedded into a stack: */ -
trunk/src/VBox/Frontends/VirtualBox/src/hostnetwork/UIHostNetworkManager.h
r73738 r73783 125 125 /** Prepares all. */ 126 126 void prepare(); 127 /** Prepares this. */128 void prepareThis();129 127 /** Prepares actions. */ 130 128 void prepareActions(); -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.cpp
r73780 r73783 418 418 void UIVMLogViewerWidget::prepare() 419 419 { 420 /* Create main layout: */421 m_pMainLayout = new QVBoxLayout(this);422 423 420 /* Prepare stuff: */ 424 421 prepareActions(); 425 if (m_fShowToolbar) 426 prepareToolBar(); 422 /* Prepare widgets: */ 427 423 prepareWidgets(); 428 424 /* Load settings: */ 429 425 loadSettings(); 430 426 427 /* Apply language settings: */ 428 retranslateUi(); 429 431 430 /* Reading log files: */ 432 431 sltRefresh(); 433 434 /* Loading language constants: */ 435 retranslateUi(); 436 432 /* Setup escape shortcut: */ 437 433 manageEscapeShortCut(); 438 434 } … … 440 436 void UIVMLogViewerWidget::prepareActions() 441 437 { 442 /* Con figure 'Find' action: */438 /* Connect actions: */ 443 439 connect(m_pActionPool->action(UIActionIndex_M_LogViewer_T_Find), &QAction::toggled, 444 440 this, &UIVMLogViewerWidget::sltPanelActionToggled); 445 446 /* Configure 'Filter' action: */447 441 connect(m_pActionPool->action(UIActionIndex_M_LogViewer_T_Filter), &QAction::toggled, 448 442 this, &UIVMLogViewerWidget::sltPanelActionToggled); 449 450 /* Configure 'Bookmark' action: */451 443 connect(m_pActionPool->action(UIActionIndex_M_LogViewer_T_Bookmark), &QAction::toggled, 452 444 this, &UIVMLogViewerWidget::sltPanelActionToggled); 453 454 /* Configure 'Settings' action: */455 445 connect(m_pActionPool->action(UIActionIndex_M_LogViewer_T_Settings), &QAction::toggled, 456 446 this, &UIVMLogViewerWidget::sltPanelActionToggled); 457 458 /* Configure 'Refresh' action: */459 447 connect(m_pActionPool->action(UIActionIndex_M_LogViewer_S_Refresh), &QAction::triggered, 460 448 this, &UIVMLogViewerWidget::sltRefresh); 461 462 /* Configure 'Save' action: */463 449 connect(m_pActionPool->action(UIActionIndex_M_LogViewer_S_Save), &QAction::triggered, 464 450 this, &UIVMLogViewerWidget::sltSave); 451 } 452 453 void UIVMLogViewerWidget::prepareWidgets() 454 { 455 /* Create main layout: */ 456 m_pMainLayout = new QVBoxLayout(this); 457 if (m_pMainLayout) 458 { 459 /* Configure layout: */ 460 m_pMainLayout->setContentsMargins(0, 0, 0, 0); 461 #ifdef VBOX_WS_MAC 462 m_pMainLayout->setSpacing(10); 463 #else 464 m_pMainLayout->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2); 465 #endif 466 467 /* Prepare toolbar, if requested: */ 468 if (m_fShowToolbar) 469 prepareToolBar(); 470 471 /* Create VM Log-Viewer container: */ 472 m_pTabWidget = new QITabWidget; 473 if (m_pTabWidget) 474 { 475 /* Add into layout: */ 476 m_pMainLayout->addWidget(m_pTabWidget); 477 } 478 479 /* Create VM Log-Viewer search-panel: */ 480 m_pSearchPanel = new UIVMLogViewerSearchPanel(0, this); 481 if (m_pSearchPanel) 482 { 483 /* Configure panel: */ 484 installEventFilter(m_pSearchPanel); 485 m_pSearchPanel->hide(); 486 connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHighlightingUpdated, 487 this, &UIVMLogViewerWidget::sltSearchResultHighLigting); 488 m_panelActionMap.insert(m_pSearchPanel, m_pActionPool->action(UIActionIndex_M_LogViewer_T_Find)); 489 490 /* Add into layout: */ 491 m_pMainLayout->addWidget(m_pSearchPanel); 492 } 493 494 /* Create VM Log-Viewer filter-panel: */ 495 m_pFilterPanel = new UIVMLogViewerFilterPanel(0, this); 496 if (m_pFilterPanel) 497 { 498 /* Configure panel: */ 499 installEventFilter(m_pFilterPanel); 500 m_pFilterPanel->hide(); 501 connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigFilterApplied, 502 this, &UIVMLogViewerWidget::sltFilterApplied); 503 m_panelActionMap.insert(m_pFilterPanel, m_pActionPool->action(UIActionIndex_M_LogViewer_T_Filter)); 504 505 /* Add into layout: */ 506 m_pMainLayout->addWidget(m_pFilterPanel); 507 } 508 509 /* Create VM Log-Viewer bookmarks-panel: */ 510 m_pBookmarksPanel = new UIVMLogViewerBookmarksPanel(0, this); 511 if (m_pBookmarksPanel) 512 { 513 /* Configure panel: */ 514 m_pBookmarksPanel->hide(); 515 connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteBookmark, 516 this, &UIVMLogViewerWidget::sltDeleteBookmark); 517 connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteAllBookmarks, 518 this, &UIVMLogViewerWidget::sltDeleteAllBookmarks); 519 connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigBookmarkSelected, 520 this, &UIVMLogViewerWidget::gotoBookmark); 521 m_panelActionMap.insert(m_pBookmarksPanel, m_pActionPool->action(UIActionIndex_M_LogViewer_T_Bookmark)); 522 523 /* Add into layout: */ 524 m_pMainLayout->addWidget(m_pBookmarksPanel); 525 } 526 527 /* Create VM Log-Viewer settings-panel: */ 528 m_pSettingsPanel = new UIVMLogViewerSettingsPanel(0, this); 529 if (m_pSettingsPanel) 530 { 531 /* Configure panel: */ 532 m_pSettingsPanel->hide(); 533 m_pSettingsPanel->setShowLineNumbers(m_bShowLineNumbers); 534 m_pSettingsPanel->setWrapLines(m_bWrapLines); 535 m_pSettingsPanel->setFontSizeInPoints(m_font.pointSize()); 536 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigShowLineNumbers, this, &UIVMLogViewerWidget::sltShowLineNumbers); 537 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigWrapLines, this, &UIVMLogViewerWidget::sltWrapLines); 538 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigChangeFontSizeInPoints, this, &UIVMLogViewerWidget::sltFontSizeChanged); 539 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigChangeFont, this, &UIVMLogViewerWidget::sltChangeFont); 540 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigResetToDefaults, this, &UIVMLogViewerWidget::sltResetSettingsToDefault); 541 m_panelActionMap.insert(m_pSettingsPanel, m_pActionPool->action(UIActionIndex_M_LogViewer_T_Settings)); 542 543 /* Add into layout: */ 544 m_pMainLayout->addWidget(m_pSettingsPanel); 545 } 546 } 465 547 } 466 548 … … 491 573 { 492 574 /* Add into layout: */ 493 layout()->addWidget(m_pToolBar);575 m_pMainLayout->addWidget(m_pToolBar); 494 576 } 495 577 #else … … 497 579 m_pMainLayout->addWidget(m_pToolBar); 498 580 #endif 499 }500 }501 502 void UIVMLogViewerWidget::prepareWidgets()503 {504 /* Configure layout: */505 layout()->setContentsMargins(0, 0, 0, 0);506 #ifdef VBOX_WS_MAC507 layout()->setSpacing(10);508 #else509 layout()->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 2);510 #endif511 512 /* Create VM Log-Viewer container: */513 m_pTabWidget = new QITabWidget;514 if (m_pTabWidget)515 {516 /* Add into layout: */517 m_pMainLayout->addWidget(m_pTabWidget);518 }519 520 /* Create VM Log-Viewer search-panel: */521 m_pSearchPanel = new UIVMLogViewerSearchPanel(0, this);522 if (m_pSearchPanel)523 {524 /* Configure VM Log-Viewer search-panel: */525 installEventFilter(m_pSearchPanel);526 m_pSearchPanel->hide();527 connect(m_pSearchPanel, &UIVMLogViewerSearchPanel::sigHighlightingUpdated,528 this, &UIVMLogViewerWidget::sltSearchResultHighLigting);529 m_panelActionMap.insert(m_pSearchPanel, m_pActionPool->action(UIActionIndex_M_LogViewer_T_Find));530 531 /* Add into layout: */532 m_pMainLayout->addWidget(m_pSearchPanel);533 }534 535 /* Create VM Log-Viewer filter-panel: */536 m_pFilterPanel = new UIVMLogViewerFilterPanel(0, this);537 if (m_pFilterPanel)538 {539 /* Configure VM Log-Viewer filter-panel: */540 installEventFilter(m_pFilterPanel);541 m_pFilterPanel->hide();542 connect(m_pFilterPanel, &UIVMLogViewerFilterPanel::sigFilterApplied,543 this, &UIVMLogViewerWidget::sltFilterApplied);544 m_panelActionMap.insert(m_pFilterPanel, m_pActionPool->action(UIActionIndex_M_LogViewer_T_Filter));545 546 /* Add into layout: */547 m_pMainLayout->addWidget(m_pFilterPanel);548 }549 550 m_pBookmarksPanel = new UIVMLogViewerBookmarksPanel(0, this);551 if (m_pBookmarksPanel)552 {553 /* Configure VM Log-Viewer bookmarks-panel: */554 m_pBookmarksPanel->hide();555 connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteBookmark,556 this, &UIVMLogViewerWidget::sltDeleteBookmark);557 connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigDeleteAllBookmarks,558 this, &UIVMLogViewerWidget::sltDeleteAllBookmarks);559 connect(m_pBookmarksPanel, &UIVMLogViewerBookmarksPanel::sigBookmarkSelected,560 this, &UIVMLogViewerWidget::gotoBookmark);561 m_panelActionMap.insert(m_pBookmarksPanel, m_pActionPool->action(UIActionIndex_M_LogViewer_T_Bookmark));562 563 /* Add into layout: */564 m_pMainLayout->addWidget(m_pBookmarksPanel);565 }566 567 m_pSettingsPanel = new UIVMLogViewerSettingsPanel(0, this);568 if (m_pSettingsPanel)569 {570 /* Configure VM Log-Viewer settings-panel: */571 m_pSettingsPanel->hide();572 m_pSettingsPanel->setShowLineNumbers(m_bShowLineNumbers);573 m_pSettingsPanel->setWrapLines(m_bWrapLines);574 m_pSettingsPanel->setFontSizeInPoints(m_font.pointSize());575 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigShowLineNumbers, this, &UIVMLogViewerWidget::sltShowLineNumbers);576 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigWrapLines, this, &UIVMLogViewerWidget::sltWrapLines);577 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigChangeFontSizeInPoints, this, &UIVMLogViewerWidget::sltFontSizeChanged);578 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigChangeFont, this, &UIVMLogViewerWidget::sltChangeFont);579 connect(m_pSettingsPanel, &UIVMLogViewerSettingsPanel::sigResetToDefaults, this, &UIVMLogViewerWidget::sltResetSettingsToDefault);580 m_panelActionMap.insert(m_pSettingsPanel, m_pActionPool->action(UIActionIndex_M_LogViewer_T_Settings));581 582 /* Add into layout: */583 m_pMainLayout->addWidget(m_pSettingsPanel);584 581 } 585 582 } -
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerWidget.h
r73697 r73783 136 136 /** Prepares actions. */ 137 137 void prepareActions(); 138 /** Prepares widgets. */ 139 void prepareWidgets(); 138 140 /** Prepares toolbar. */ 139 141 void prepareToolBar(); 140 /** Prepares widgets. */141 void prepareWidgets();142 142 /** Loads settings. */ 143 143 void loadSettings(); -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
r73780 r73783 675 675 void UIMediumManagerWidget::prepare() 676 676 { 677 /* Prepare this: */ 678 prepareThis(); 677 /* Prepare connections: */ 678 prepareConnections(); 679 /* Prepare actions: */ 680 prepareActions(); 681 /* Prepare widgets: */ 682 prepareWidgets(); 679 683 680 684 /* Load settings: */ … … 697 701 sltHandleMediumEnumerationFinish(); 698 702 } 699 }700 701 void UIMediumManagerWidget::prepareThis()702 {703 /* Prepare connections: */704 prepareConnections();705 /* Prepare actions: */706 prepareActions();707 /* Prepare central-widget: */708 prepareWidgets();709 703 } 710 704 … … 762 756 #endif 763 757 764 /* Prepare toolbar : */758 /* Prepare toolbar, if requested: */ 765 759 if (m_fShowToolbar) 766 760 prepareToolBar(); … … 782 776 m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric)); 783 777 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 778 784 779 /* Add toolbar actions: */ 785 780 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Medium_S_Add)); -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.h
r73734 r73783 203 203 /** Prepares all. */ 204 204 void prepare(); 205 /** Prepares this. */206 void prepareThis();207 205 /** Prepares connections. */ 208 206 void prepareConnections(); -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp
r73676 r73783 1165 1165 void UISnapshotPane::prepare() 1166 1166 { 1167 /* Create read-write locker: */ 1168 m_pLockReadWrite = new QReadWriteLock; 1169 1170 /* Create pixmaps: */ 1171 m_pIconSnapshotOffline = new QIcon(UIIconPool::iconSet(":/snapshot_offline_16px.png")); 1172 m_pIconSnapshotOnline = new QIcon(UIIconPool::iconSet(":/snapshot_online_16px.png")); 1173 1174 /* Create timer: */ 1175 m_pTimerUpdateAge = new QTimer; 1176 AssertPtrReturnVoid(m_pTimerUpdateAge); 1177 { 1178 /* Configure timer: */ 1179 m_pTimerUpdateAge->setSingleShot(true); 1180 connect(m_pTimerUpdateAge, &QTimer::timeout, this, &UISnapshotPane::sltUpdateSnapshotsAge); 1181 } 1182 1183 /* Prepare connections: */ 1184 prepareConnections(); 1185 /* Prepare actions: */ 1186 prepareActions(); 1187 /* Prepare widgets: */ 1188 prepareWidgets(); 1189 1190 /* Load settings: */ 1191 loadSettings(); 1192 1193 /* Apply language settings: */ 1194 retranslateUi(); 1195 } 1196 1197 void UISnapshotPane::prepareConnections() 1198 { 1167 1199 /* Configure Main event connections: */ 1168 1200 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineDataChange, … … 1180 1212 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigSnapshotRestore, 1181 1213 this, &UISnapshotPane::sltHandleSnapshotRestore); 1182 1183 /* Create read-write locker: */ 1184 m_pLockReadWrite = new QReadWriteLock; 1185 1186 /* Create pixmaps: */ 1187 m_pIconSnapshotOffline = new QIcon(UIIconPool::iconSet(":/snapshot_offline_16px.png")); 1188 m_pIconSnapshotOnline = new QIcon(UIIconPool::iconSet(":/snapshot_online_16px.png")); 1189 1190 /* Create timer: */ 1191 m_pTimerUpdateAge = new QTimer; 1192 AssertPtrReturnVoid(m_pTimerUpdateAge); 1193 { 1194 /* Configure timer: */ 1195 m_pTimerUpdateAge->setSingleShot(true); 1196 connect(m_pTimerUpdateAge, &QTimer::timeout, this, &UISnapshotPane::sltUpdateSnapshotsAge); 1197 } 1198 1199 /* Prepare widgets: */ 1200 prepareWidgets(); 1201 1202 /* Load settings: */ 1203 loadSettings(); 1204 1205 /* Apply language settings: */ 1206 retranslateUi(); 1214 } 1215 1216 void UISnapshotPane::prepareActions() 1217 { 1218 /* Connect actions: */ 1219 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Take), &UIAction::triggered, 1220 this, &UISnapshotPane::sltTakeSnapshot); 1221 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Delete), &UIAction::triggered, 1222 this, &UISnapshotPane::sltDeleteSnapshot); 1223 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Restore), &UIAction::triggered, 1224 this, &UISnapshotPane::sltRestoreSnapshot); 1225 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_T_Properties), &UIAction::toggled, 1226 this, &UISnapshotPane::sltToggleSnapshotDetailsVisibility); 1227 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Clone), &UIAction::triggered, 1228 this, &UISnapshotPane::sltCloneSnapshot); 1207 1229 } 1208 1230 … … 1242 1264 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 1243 1265 1244 /* Add Take Snapshot action: */1266 /* Add toolbar actions: */ 1245 1267 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Take)); 1246 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Take), &UIAction::triggered,1247 this, &UISnapshotPane::sltTakeSnapshot);1248 1249 /* Add Delete Snapshot action: */1250 1268 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Delete)); 1251 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Delete), &UIAction::triggered,1252 this, &UISnapshotPane::sltDeleteSnapshot);1253 1254 1269 m_pToolBar->addSeparator(); 1255 1256 /* Add Restore Snapshot action: */1257 1270 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Restore)); 1258 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Restore), &UIAction::triggered,1259 this, &UISnapshotPane::sltRestoreSnapshot);1260 1261 /* Add Show Snapshot Details action: */1262 1271 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Snapshot_T_Properties)); 1263 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_T_Properties), &UIAction::toggled,1264 this, &UISnapshotPane::sltToggleSnapshotDetailsVisibility);1265 1266 1272 m_pToolBar->addSeparator(); 1267 1268 /* Add Clone Snapshot action: */1269 1273 m_pToolBar->addAction(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Clone)); 1270 connect(m_pActionPool->action(UIActionIndexST_M_Snapshot_S_Clone), &UIAction::triggered,1271 this, &UISnapshotPane::sltCloneSnapshot);1272 1274 1273 1275 /* Add into layout: */ -
trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.h
r73676 r73783 144 144 /** Prepares all. */ 145 145 void prepare(); 146 /** Prepares connections. */ 147 void prepareConnections(); 148 /** Prepares actions. */ 149 void prepareActions(); 146 150 /** Prepares widgets. */ 147 151 void prepareWidgets();
Note:
See TracChangeset
for help on using the changeset viewer.