Changeset 68348 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 9, 2017 11:41:22 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r68342 r68348 193 193 { 194 194 /* Create direct (sync) connections for signals of main listener: */ 195 connect(m_pQtListener->getWrapped(), SIGNAL(sigExtraDataCanChange(QString, QString, QString, bool&, QString&)),196 this, SLOT(sltPreprocessExtraDataCanChange(QString, QString, QString, bool&, QString&)),195 connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigExtraDataCanChange, 196 this, &UIExtraDataEventHandler::sltPreprocessExtraDataCanChange, 197 197 Qt::DirectConnection); 198 connect(m_pQtListener->getWrapped(), SIGNAL(sigExtraDataChange(QString, QString, QString)),199 this, SLOT(sltPreprocessExtraDataChange(QString, QString, QString)),198 connect(m_pQtListener->getWrapped(), &UIMainEventListener::sigExtraDataChange, 199 this, &UIExtraDataEventHandler::sltPreprocessExtraDataChange, 200 200 Qt::DirectConnection); 201 201 } … … 476 476 /** @} */ 477 477 478 public slots: 479 480 /** @name General 481 * @{ */ 482 /** Handles extra-data map acknowledging. */ 483 void sltExtraDataMapAcknowledging(QString strID); 484 /** Handles extra-data change. */ 485 void sltExtraDataChange(QString strID, QString strKey, QString strValue); 486 /** @} */ 487 478 488 private slots: 479 489 … … 482 492 /** Handles machine (un)registration. */ 483 493 void sltMachineRegistered(QString strID, bool fAdded); 484 /** Handles extra-data map acknowledging. */485 void sltExtraDataMapAcknowledging(QString strID);486 /** Handles extra-data change. */487 void sltExtraDataChange(QString strID, QString strKey, QString strValue);488 494 /** @} */ 489 495 … … 1007 1013 { 1008 1014 /* Configure key-editor property setter: */ 1009 connect(pEditorKey, SIGNAL(editTextChanged(const QString&)),1010 pKeyPropertySetter, SLOT(sltAssignProperty(const QString&)));1015 connect(pEditorKey, &QComboBox::editTextChanged, 1016 pKeyPropertySetter, &QObjectPropertySetter::sltAssignProperty); 1011 1017 } 1012 1018 /* Create key-editor validator: */ … … 1015 1021 { 1016 1022 /* Configure key-editor validator: */ 1017 connect(pEditorKey, SIGNAL(editTextChanged(const QString&)),1018 pKeyValidator, SLOT(sltValidate(QString)));1023 connect(pEditorKey, &QComboBox::editTextChanged, 1024 pKeyValidator, &QObjectValidator::sltValidate); 1019 1025 /* Add key-editor validator into dialog validator group: */ 1020 1026 pValidatorGroup->addObjectValidator(pKeyValidator); … … 1041 1047 { 1042 1048 /* Configure value-editor property setter: */ 1043 connect(pEditorValue, SIGNAL(textEdited(const QString&)),1044 pValuePropertySetter, SLOT(sltAssignProperty(const QString&)));1049 connect(pEditorValue, &QLineEdit::textEdited, 1050 pValuePropertySetter, &QObjectPropertySetter::sltAssignProperty); 1045 1051 } 1046 1052 /* Create value-editor validator: */ … … 1049 1055 { 1050 1056 /* Configure value-editor validator: */ 1051 connect(pEditorValue, SIGNAL(textEdited(const QString&)),1052 pValueValidator, SLOT(sltValidate(QString)));1057 connect(pEditorValue, &QLineEdit::textEdited, 1058 pValueValidator, &QObjectValidator::sltValidate); 1053 1059 /* Add value-editor validator into dialog validator group: */ 1054 1060 pValidatorGroup->addObjectValidator(pValueValidator); … … 1071 1077 pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(pValidatorGroup->result()); 1072 1078 pButtonBox->button(QDialogButtonBox::Cancel)->setShortcut(Qt::Key_Escape); 1073 connect(pValidatorGroup, SIGNAL(sigValidityChange(bool)),1074 pButtonBox->button(QDialogButtonBox::Ok), SLOT(setEnabled(bool)));1075 connect(pButtonBox, SIGNAL(accepted()), pInputDialog, SLOT(accept()));1076 connect(pButtonBox, SIGNAL(rejected()), pInputDialog, SLOT(reject()));1079 connect(pValidatorGroup, &QObjectValidatorGroup::sigValidityChange, 1080 pButtonBox->button(QDialogButtonBox::Ok), &QPushButton::setEnabled); 1081 connect(pButtonBox, &QIDialogButtonBox::accepted, pInputDialog, &QIDialog::accept); 1082 connect(pButtonBox, &QIDialogButtonBox::rejected, pInputDialog, &QIDialog::reject); 1077 1083 /* Add button-box into main-layout: */ 1078 1084 pMainLayout->addWidget(pButtonBox); … … 1365 1371 { 1366 1372 /* Prepare connections: */ 1367 connect(gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)),1368 this, SLOT(sltMachineRegistered(QString, bool)));1373 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigMachineRegistered, 1374 this, &UIExtraDataManagerWindow::sltMachineRegistered); 1369 1375 } 1370 1376 … … 1383 1389 ":/edata_add_disabled_22px.png", ":/edata_add_disabled_16px.png")); 1384 1390 m_pActionAdd->setShortcut(QKeySequence("Ctrl+T")); 1385 connect(m_pActionAdd, SIGNAL(triggered(bool)), this, SLOT(sltAdd()));1391 connect(m_pActionAdd, &QAction::triggered, this, &UIExtraDataManagerWindow::sltAdd); 1386 1392 } 1387 1393 /* Create 'Del' action: */ … … 1393 1399 ":/edata_remove_disabled_22px.png", ":/edata_remove_disabled_16px.png")); 1394 1400 m_pActionDel->setShortcut(QKeySequence("Ctrl+R")); 1395 connect(m_pActionDel, SIGNAL(triggered(bool)), this, SLOT(sltDel()));1401 connect(m_pActionDel, &QAction::triggered, this, &UIExtraDataManagerWindow::sltDel); 1396 1402 } 1397 1403 … … 1407 1413 ":/edata_load_disabled_22px.png", ":/edata_load_disabled_16px.png")); 1408 1414 m_pActionLoad->setShortcut(QKeySequence("Ctrl+L")); 1409 connect(m_pActionLoad, SIGNAL(triggered(bool)), this, SLOT(sltLoad()));1415 connect(m_pActionLoad, &QAction::triggered, this, &UIExtraDataManagerWindow::sltLoad); 1410 1416 } 1411 1417 /* Create 'Save' action: */ … … 1417 1423 ":/edata_save_disabled_22px.png", ":/edata_save_disabled_16px.png")); 1418 1424 m_pActionSave->setShortcut(QKeySequence("Ctrl+S")); 1419 connect(m_pActionSave, SIGNAL(triggered(bool)), this, SLOT(sltSave()));1425 connect(m_pActionSave, &QAction::triggered, this, &UIExtraDataManagerWindow::sltSave); 1420 1426 } 1421 1427 } … … 1506 1512 preparePaneData(); 1507 1513 /* Link chooser and data panes: */ 1508 connect(m_pViewOfChooser->selectionModel(), 1509 SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), 1510 this, SLOT(sltChooserHandleCurrentChanged(const QModelIndex&))); 1511 connect(m_pViewOfChooser->selectionModel(), 1512 SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), 1513 this, SLOT(sltChooserHandleSelectionChanged(const QItemSelection&, const QItemSelection&))); 1514 connect(m_pViewOfData->selectionModel(), 1515 SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), 1516 this, SLOT(sltDataHandleSelectionChanged(const QItemSelection&, const QItemSelection&))); 1517 connect(m_pModelSourceOfData, SIGNAL(itemChanged(QStandardItem*)), 1518 this, SLOT(sltDataHandleItemChanged(QStandardItem*))); 1514 connect(m_pViewOfChooser->selectionModel(), &QItemSelectionModel::currentChanged, 1515 this, &UIExtraDataManagerWindow::sltChooserHandleCurrentChanged); 1516 connect(m_pViewOfChooser->selectionModel(), &QItemSelectionModel::selectionChanged, 1517 this, &UIExtraDataManagerWindow::sltChooserHandleSelectionChanged); 1518 connect(m_pViewOfData->selectionModel(), &QItemSelectionModel::selectionChanged, 1519 this, &UIExtraDataManagerWindow::sltDataHandleSelectionChanged); 1520 connect(m_pModelSourceOfData, &QStandardItemModel::itemChanged, 1521 this, &UIExtraDataManagerWindow::sltDataHandleItemChanged); 1519 1522 /* Make sure chooser have current-index if possible: */ 1520 1523 makeSureChooserHaveCurrentIndexIfPossible(); … … 1539 1542 /* Configure chooser-filter: */ 1540 1543 m_pFilterOfChooser->setPlaceholderText("Search.."); 1541 connect(m_pFilterOfChooser, SIGNAL(textChanged(const QString&)),1542 this, SLOT(sltChooserApplyFilter(const QString&)));1544 connect(m_pFilterOfChooser, &QLineEdit::textChanged, 1545 this, &UIExtraDataManagerWindow::sltChooserApplyFilter); 1543 1546 /* Add chooser-filter into layout: */ 1544 1547 pLayout->addWidget(m_pFilterOfChooser); … … 1604 1607 /* Configure data-filter: */ 1605 1608 m_pFilterOfData->setPlaceholderText("Search.."); 1606 connect(m_pFilterOfData, SIGNAL(textChanged(const QString&)),1607 this, SLOT(sltDataApplyFilter(const QString&)));1609 connect(m_pFilterOfData, &QLineEdit::textChanged, 1610 this, &UIExtraDataManagerWindow::sltDataApplyFilter); 1608 1611 /* Add data-filter into layout: */ 1609 1612 pLayout->addWidget(m_pFilterOfData); … … 1636 1639 m_pViewOfData->setSelectionMode(QAbstractItemView::ExtendedSelection); 1637 1640 m_pViewOfData->setSelectionBehavior(QAbstractItemView::SelectRows); 1638 connect(m_pViewOfData, SIGNAL(customContextMenuRequested(const QPoint&)),1639 this, SLOT(sltDataHandleCustomContextMenuRequested(const QPoint&)));1641 connect(m_pViewOfData, &QTableView::customContextMenuRequested, 1642 this, &UIExtraDataManagerWindow::sltDataHandleCustomContextMenuRequested); 1640 1643 QHeaderView *pVHeader = m_pViewOfData->verticalHeader(); 1641 1644 QHeaderView *pHHeader = m_pViewOfData->horizontalHeader(); … … 1662 1665 m_pButtonBox->setStandardButtons(QDialogButtonBox::Help | QDialogButtonBox::Close); 1663 1666 m_pButtonBox->button(QDialogButtonBox::Close)->setShortcut(Qt::Key_Escape); 1664 connect(m_pButtonBox, SIGNAL(helpRequested()), &msgCenter(), SLOT(sltShowHelpHelpDialog()));1665 connect(m_pButtonBox, SIGNAL(rejected()), this, SLOT(close()));1667 connect(m_pButtonBox, &QIDialogButtonBox::helpRequested, &msgCenter(), &UIMessageCenter::sltShowHelpHelpDialog); 1668 connect(m_pButtonBox, &QIDialogButtonBox::rejected, this, &UIExtraDataManagerWindow::close); 1666 1669 /* Add button-box into main layout: */ 1667 1670 m_pMainLayout->addWidget(m_pButtonBox); … … 4340 4343 { 4341 4344 /* Create queued (async) connections for signals of event proxy object: */ 4342 connect(m_pHandler, SIGNAL(sigExtraDataChange(QString, QString, QString)),4343 this, SLOT(sltExtraDataChange(QString, QString, QString)),4345 connect(m_pHandler, &UIExtraDataEventHandler::sigExtraDataChange, 4346 this, &UIExtraDataManager::sltExtraDataChange, 4344 4347 Qt::QueuedConnection); 4345 4348 } … … 4379 4382 m_pWindow = new UIExtraDataManagerWindow; 4380 4383 /* Configure window connections: */ 4381 connect(this, SIGNAL(sigExtraDataMapAcknowledging(QString)),4382 m_pWindow, SLOT(sltExtraDataMapAcknowledging(QString)));4383 connect(this, SIGNAL(sigExtraDataChange(QString, QString, QString)),4384 m_pWindow, SLOT(sltExtraDataChange(QString, QString, QString)));4384 connect(this, &UIExtraDataManager::sigExtraDataMapAcknowledging, 4385 m_pWindow, &UIExtraDataManagerWindow::sltExtraDataMapAcknowledging); 4386 connect(this, &UIExtraDataManager::sigExtraDataChange, 4387 m_pWindow, &UIExtraDataManagerWindow::sltExtraDataChange); 4385 4388 } 4386 4389 /* Show and raise window: */
Note:
See TracChangeset
for help on using the changeset viewer.