Changeset 68190 in vbox
- Timestamp:
- Jul 31, 2017 10:25:22 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r67837 r68190 111 111 #ifdef VBOX_WS_MAC 112 112 /* Make sure each action notifies it's parent about hovering: */ 113 connect(this, SIGNAL(hovered()), parent(), SLOT(sltActionHovered())); 114 #endif /* VBOX_WS_MAC */ 113 connect(this, &UIAction::hovered, 114 static_cast<UIActionPool*>(parent()), &UIActionPool::sltActionHovered); 115 #endif 115 116 } 116 117 … … 230 231 { 231 232 /* Prepare menu: */ 232 connect(menu(), SIGNAL(aboutToShow()),233 parent(), SLOT(sltHandleMenuPrepare()));233 connect(menu(), &UIMenu::aboutToShow, 234 actionPool(), &UIActionPool::sltHandleMenuPrepare); 234 235 } 235 236 } … … 395 396 { 396 397 /* Prepare menu: */ 397 connect(m_pMenu, SIGNAL(aboutToShow()),398 parent(), SLOT(sltHandleMenuPrepare()));398 connect(m_pMenu, &UIMenu::aboutToShow, 399 actionPool(), &UIActionPool::sltHandleMenuPrepare); 399 400 /* Show menu: */ 400 401 showMenu(); … … 1156 1157 /* 'Application' menu connections: */ 1157 1158 #ifdef RT_OS_DARWIN 1158 connect(action(UIActionIndex_M_Application_S_About), SIGNAL(triggered()),1159 &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection);1159 connect(action(UIActionIndex_M_Application_S_About), &UIAction::triggered, 1160 &msgCenter(), &UIMessageCenter::sltShowHelpAboutDialog, Qt::UniqueConnection); 1160 1161 #endif /* RT_OS_DARWIN */ 1161 1162 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 1162 connect(action(UIActionIndex_M_Application_S_NetworkAccessManager), SIGNAL(triggered()),1163 gNetworkManager, SLOT(show()), Qt::UniqueConnection);1164 connect(action(UIActionIndex_M_Application_S_CheckForUpdates), SIGNAL(triggered()),1165 gUpdateManager, SLOT(sltForceCheck()), Qt::UniqueConnection);1163 connect(action(UIActionIndex_M_Application_S_NetworkAccessManager), &UIAction::triggered, 1164 gNetworkManager, &UINetworkManager::show, Qt::UniqueConnection); 1165 connect(action(UIActionIndex_M_Application_S_CheckForUpdates), &UIAction::triggered, 1166 gUpdateManager, &UIUpdateManager::sltForceCheck, Qt::UniqueConnection); 1166 1167 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 1167 connect(action(UIActionIndex_M_Application_S_ResetWarnings), SIGNAL(triggered()),1168 &msgCenter(), SLOT(sltResetSuppressedMessages()), Qt::UniqueConnection);1168 connect(action(UIActionIndex_M_Application_S_ResetWarnings), &UIAction::triggered, 1169 &msgCenter(), &UIMessageCenter::sltResetSuppressedMessages, Qt::UniqueConnection); 1169 1170 1170 1171 /* 'Help' menu connections: */ 1171 connect(action(UIActionIndex_Simple_Contents), SIGNAL(triggered()),1172 &msgCenter(), SLOT(sltShowHelpHelpDialog()), Qt::UniqueConnection);1173 connect(action(UIActionIndex_Simple_WebSite), SIGNAL(triggered()),1174 &msgCenter(), SLOT(sltShowHelpWebDialog()), Qt::UniqueConnection);1175 connect(action(UIActionIndex_Simple_BugTracker), SIGNAL(triggered()),1176 &msgCenter(), SLOT(sltShowBugTracker()), Qt::UniqueConnection);1177 connect(action(UIActionIndex_Simple_Forums), SIGNAL(triggered()),1178 &msgCenter(), SLOT(sltShowForums()), Qt::UniqueConnection);1179 connect(action(UIActionIndex_Simple_Oracle), SIGNAL(triggered()),1180 &msgCenter(), SLOT(sltShowOracle()), Qt::UniqueConnection);1172 connect(action(UIActionIndex_Simple_Contents), &UIAction::triggered, 1173 &msgCenter(), &UIMessageCenter::sltShowHelpHelpDialog, Qt::UniqueConnection); 1174 connect(action(UIActionIndex_Simple_WebSite), &UIAction::triggered, 1175 &msgCenter(), &UIMessageCenter::sltShowHelpWebDialog, Qt::UniqueConnection); 1176 connect(action(UIActionIndex_Simple_BugTracker), &UIAction::triggered, 1177 &msgCenter(), &UIMessageCenter::sltShowBugTracker, Qt::UniqueConnection); 1178 connect(action(UIActionIndex_Simple_Forums), &UIAction::triggered, 1179 &msgCenter(), &UIMessageCenter::sltShowForums, Qt::UniqueConnection); 1180 connect(action(UIActionIndex_Simple_Oracle), &UIAction::triggered, 1181 &msgCenter(), &UIMessageCenter::sltShowOracle, Qt::UniqueConnection); 1181 1182 #ifndef RT_OS_DARWIN 1182 connect(action(UIActionIndex_Simple_About), SIGNAL(triggered()),1183 &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection);1183 connect(action(UIActionIndex_Simple_About), &UIAction::triggered, 1184 &msgCenter(), &UIMessageCenter::sltShowHelpAboutDialog, Qt::UniqueConnection); 1184 1185 #endif /* !RT_OS_DARWIN */ 1185 1186 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r64715 r68190 460 460 virtual QList<QMenu*> menus() const = 0; 461 461 462 p rotectedslots:462 public slots: 463 463 464 464 /** Handles menu prepare. */ 465 465 void sltHandleMenuPrepare(); 466 467 /** Loads keyboard shortcuts of action-pool into shortcuts-pool. */468 void sltApplyShortcuts() { updateShortcuts(); }469 466 470 467 #ifdef VBOX_WS_MAC 471 468 /** Handles action hovered signal. */ 472 469 void sltActionHovered(); 473 #endif /* VBOX_WS_MAC */ 470 #endif 471 472 protected slots: 473 474 /** Loads keyboard shortcuts of action-pool into shortcuts-pool. */ 475 void sltApplyShortcuts() { updateShortcuts(); } 474 476 475 477 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIAnimationFramework.cpp
r68165 r68190 85 85 m_pStateStart = new QState(m_pAnimationMachine); 86 86 m_pStateStart->assignProperty(parent(), "AnimationState", QString("Start")); 87 connect(m_pStateStart, SIGNAL(propertiesAssigned()), this, SIGNAL(sigStateEnteredStart()));87 connect(m_pStateStart, &QState::propertiesAssigned, this, &UIAnimation::sigStateEnteredStart); 88 88 /* Create 'final' state: */ 89 89 m_pStateFinal = new QState(m_pAnimationMachine); 90 90 m_pStateFinal->assignProperty(parent(), "AnimationState", QString("Final")); 91 connect(m_pStateFinal, SIGNAL(propertiesAssigned()), this, SIGNAL(sigStateEnteredFinal()));91 connect(m_pStateFinal, &QState::propertiesAssigned, this, &UIAnimation::sigStateEnteredFinal); 92 92 93 93 /* Prepare 'forward' animation: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDesktopWidgetWatchdog.cpp
r64651 r68190 405 405 406 406 /* Listen for screen signals: */ 407 connect(pHostScreen, SIGNAL(geometryChanged(const QRect &)),408 this, SLOT(sltHandleHostScreenResized(const QRect &)));409 connect(pHostScreen, SIGNAL(availableGeometryChanged(const QRect &)),410 this, SLOT(sltHandleHostScreenWorkAreaResized(const QRect &)));407 connect(pHostScreen, &QScreen::geometryChanged, 408 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenResized); 409 connect(pHostScreen, &QScreen::availableGeometryChanged, 410 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenWorkAreaResized); 411 411 412 412 # ifdef VBOX_WS_X11 … … 424 424 425 425 /* Forget about screen signals: */ 426 disconnect(pHostScreen, SIGNAL(geometryChanged(const QRect &)),427 this, SLOT(sltHandleHostScreenResized(const QRect &)));428 disconnect(pHostScreen, SIGNAL(availableGeometryChanged(const QRect &)),429 this, SLOT(sltHandleHostScreenWorkAreaResized(const QRect &)));426 disconnect(pHostScreen, &QScreen::geometryChanged, 427 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenResized); 428 disconnect(pHostScreen, &QScreen::availableGeometryChanged, 429 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenWorkAreaResized); 430 430 431 431 # ifdef VBOX_WS_X11 … … 513 513 /* Prepare connections: */ 514 514 #if QT_VERSION < 0x050000 515 connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(sltHandleHostScreenCountChanged(int))); 516 connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(sltHandleHostScreenResized(int))); 517 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(sltHandleHostScreenWorkAreaResized(int))); 515 connect(QApplication::desktop(), &QDesktopWidget::screenCountChanged, 516 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenCountChanged); 517 connect(QApplication::desktop(), &QDesktopWidget::resized, 518 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenResized); 519 connect(QApplication::desktop(), &QDesktopWidget::workAreaResized, 520 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenWorkAreaResized); 518 521 #else /* QT_VERSION >= 0x050000 */ 519 connect(qApp, SIGNAL(screenAdded(QScreen *)), this, SLOT(sltHostScreenAdded(QScreen *))); 520 connect(qApp, SIGNAL(screenRemoved(QScreen *)), this, SLOT(sltHostScreenRemoved(QScreen *))); 522 connect(qApp, &QGuiApplication::screenAdded, 523 this, &UIDesktopWidgetWatchdog::sltHostScreenAdded); 524 connect(qApp, &QGuiApplication::screenRemoved, 525 this, &UIDesktopWidgetWatchdog::sltHostScreenRemoved); 521 526 foreach (QScreen *pHostScreen, qApp->screens()) 522 527 { 523 connect(pHostScreen, SIGNAL(geometryChanged(const QRect &)),524 this, SLOT(sltHandleHostScreenResized(const QRect &)));525 connect(pHostScreen, SIGNAL(availableGeometryChanged(const QRect &)),526 this, SLOT(sltHandleHostScreenWorkAreaResized(const QRect &)));528 connect(pHostScreen, &QScreen::geometryChanged, 529 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenResized); 530 connect(pHostScreen, &QScreen::availableGeometryChanged, 531 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenWorkAreaResized); 527 532 } 528 533 #endif /* QT_VERSION >= 0x050000 */ … … 538 543 /* Cleanup connections: */ 539 544 #if QT_VERSION < 0x050000 540 disconnect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(sltHandleHostScreenCountChanged(int))); 541 disconnect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(sltHandleHostScreenResized(int))); 542 disconnect(QApplication::desktop(), SIGNAL(workAreaResized(int)), this, SLOT(sltHandleHostScreenWorkAreaResized(int))); 545 disconnect(QApplication::desktop(), &QDesktopWidget::screenCountChanged, 546 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenCountChanged); 547 disconnect(QApplication::desktop(), &QDesktopWidget::resized, 548 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenResized); 549 disconnect(QApplication::desktop(), &QDesktopWidget::workAreaResized, 550 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenWorkAreaResized); 543 551 #else /* QT_VERSION >= 0x050000 */ 544 disconnect(qApp, SIGNAL(screenAdded(QScreen *)), this, SLOT(sltHostScreenAdded(QScreen *))); 545 disconnect(qApp, SIGNAL(screenRemoved(QScreen *)), this, SLOT(sltHostScreenRemoved(QScreen *))); 552 disconnect(qApp, &QGuiApplication::screenAdded, 553 this, &UIDesktopWidgetWatchdog::sltHostScreenAdded); 554 disconnect(qApp, &QGuiApplication::screenRemoved, 555 this, &UIDesktopWidgetWatchdog::sltHostScreenRemoved); 546 556 foreach (QScreen *pHostScreen, qApp->screens()) 547 557 { 548 disconnect(pHostScreen, SIGNAL(geometryChanged(const QRect &)),549 this, SLOT(sltHandleHostScreenResized(const QRect &)));550 disconnect(pHostScreen, SIGNAL(availableGeometryChanged(const QRect &)),551 this, SLOT(sltHandleHostScreenWorkAreaResized(const QRect &)));558 disconnect(pHostScreen, &QScreen::geometryChanged, 559 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenResized); 560 disconnect(pHostScreen, &QScreen::availableGeometryChanged, 561 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenWorkAreaResized); 552 562 } 553 563 #endif /* QT_VERSION >= 0x050000 */ … … 598 608 599 609 /* Connect worker listener: */ 600 connect(pWorker, SIGNAL(sigHostScreenAvailableGeometryCalculated(int, QRect)),601 this, SLOT(sltHandleHostScreenAvailableGeometryCalculated(int, QRect)));610 connect(pWorker, &UIInvisibleWindow::sigHostScreenAvailableGeometryCalculated, 611 this, &UIDesktopWidgetWatchdog::sltHandleHostScreenAvailableGeometryCalculated); 602 612 603 613 /* Place worker to corresponding host-screen: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r67969 r68190 2804 2804 UIDownloaderUserManual *pDl = UIDownloaderUserManual::create(); 2805 2805 /* After downloading finished => show User Manual: */ 2806 connect(pDl, SIGNAL(sigDownloadFinished(const QString&)), this, SLOT(sltShowUserManual(const QString&)));2806 connect(pDl, &UIDownloaderUserManual::sigDownloadFinished, this, &UIMessageCenter::sltShowUserManual); 2807 2807 /* Start downloading: */ 2808 2808 pDl->start(); … … 2875 2875 /* Prepare interthread connection: */ 2876 2876 qRegisterMetaType<MessageType>(); 2877 // Won't go until we are supporting C++11 or at least variadic templates everywhere. 2878 // connect(this, &UIMessageCenter::sigToShowMessageBox, 2879 // this, &UIMessageCenter::sltShowMessageBox, 2877 2880 connect(this, SIGNAL(sigToShowMessageBox(QWidget*, MessageType, 2878 2881 const QString&, const QString&, -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIModalWindowManager.cpp
r62493 r68190 211 211 /* Register passed-window as the new 'top' in iterated-window-stack: */ 212 212 iteratedWindowStack << pWindow; 213 connect(pWindow, SIGNAL(destroyed(QObject*)), this, SLOT(sltRemoveFromStack(QObject*)));213 connect(pWindow, &QWidget::destroyed, this, &UIModalWindowManager::sltRemoveFromStack); 214 214 return; 215 215 } … … 226 226 QList<QWidget*> newWindowStack(QList<QWidget*>() << pWindow); 227 227 m_windows << newWindowStack; 228 connect(pWindow, SIGNAL(destroyed(QObject*)), this, SLOT(sltRemoveFromStack(QObject*)));228 connect(pWindow, &QWidget::destroyed, this, &UIModalWindowManager::sltRemoveFromStack); 229 229 } 230 230 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp
r66569 r68190 282 282 pPopupStack = m_stacks[strPopupStackID] = new UIPopupStack(strPopupStackID, m_stackOrientations[strPopupStackID]); 283 283 /* Attach popup-stack connections: */ 284 connect(pPopupStack, SIGNAL(sigPopupPaneDone(QString, int)), this, SLOT(sltPopupPaneDone(QString, int)));285 connect(pPopupStack, SIGNAL(sigRemove(QString)), this, SLOT(sltRemovePopupStack(QString)));284 connect(pPopupStack, &UIPopupStack::sigPopupPaneDone, this, &UIPopupCenter::sltPopupPaneDone); 285 connect(pPopupStack, &UIPopupStack::sigRemove, this, &UIPopupCenter::sltRemovePopupStack); 286 286 } 287 287 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIShortcutPool.cpp
r62493 r68190 241 241 { 242 242 /* Connect to extra-data signals: */ 243 connect(gEDataManager, SIGNAL(sigSelectorUIShortcutChange()), this, SLOT(sltReloadSelectorShortcuts())); 244 connect(gEDataManager, SIGNAL(sigRuntimeUIShortcutChange()), this, SLOT(sltReloadMachineShortcuts())); 243 connect(gEDataManager, &UIExtraDataManager::sigSelectorUIShortcutChange, 244 this, &UIShortcutPool::sltReloadSelectorShortcuts); 245 connect(gEDataManager, &UIExtraDataManager::sigRuntimeUIShortcutChange, 246 this, &UIShortcutPool::sltReloadMachineShortcuts); 245 247 } 246 248 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIThreadPool.cpp
r62493 r68190 166 166 167 167 /* Prepare task: */ 168 connect(pTask, SIGNAL(sigComplete(UITask*)),169 this, SLOT(sltHandleTaskComplete(UITask*)), Qt::QueuedConnection);168 connect(pTask, &UITask::sigComplete, 169 this, &UIThreadPool::sltHandleTaskComplete, Qt::QueuedConnection); 170 170 171 171 /* Lock initially: */ … … 190 190 /* Prepare the new worker: */ 191 191 UIThreadWorker *pWorker = new UIThreadWorker(this, idxFirstUnused); 192 connect(pWorker, SIGNAL(sigFinished(UIThreadWorker*)),193 this, SLOT(sltHandleWorkerFinished(UIThreadWorker*)), Qt::QueuedConnection);192 connect(pWorker, &UIThreadWorker::sigFinished, 193 this, &UIThreadPool::sltHandleWorkerFinished, Qt::QueuedConnection); 194 194 m_workers[idxFirstUnused] = pWorker; 195 195 ++m_cWorkers; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r67854 r68190 3527 3527 { 3528 3528 /* Make sure QApplication cleanup us on exit: */ 3529 connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(cleanup()));3529 connect(qApp, &QGuiApplication::aboutToQuit, this, &VBoxGlobal::cleanup); 3530 3530 /* Make sure we handle host OS session shutdown as well: */ 3531 connect(qApp, SIGNAL(commitDataRequest(QSessionManager &)),3532 this, SLOT(sltHandleCommitDataRequest(QSessionManager &)));3531 connect(qApp, &QGuiApplication::commitDataRequest, 3532 this, &VBoxGlobal::sltHandleCommitDataRequest); 3533 3533 3534 3534 #ifdef VBOX_WS_MAC … … 3608 3608 3609 3609 /* Watch for the VBoxSVC availability changes: */ 3610 connect(gVBoxEvents, SIGNAL(sigVBoxSVCAvailabilityChange(bool)),3611 this, SLOT(sltHandleVBoxSVCAvailabilityChange(bool)));3610 connect(gVBoxEvents, &UIVirtualBoxEventHandler::sigVBoxSVCAvailabilityChange, 3611 this, &VBoxGlobal::sltHandleVBoxSVCAvailabilityChange); 3612 3612 3613 3613 /* Prepare thread-pool instance: */ … … 3621 3621 retranslateUi(); 3622 3622 3623 connect(gEDataManager, SIGNAL(sigLanguageChange(QString)),3624 this, SLOT(sltGUILanguageChange(QString)));3623 connect(gEDataManager, &UIExtraDataManager::sigLanguageChange, 3624 this, &VBoxGlobal::sltGUILanguageChange); 3625 3625 3626 3626 qApp->installEventFilter (this); … … 3930 3930 { 3931 3931 /* Prepare medium-enumerator: */ 3932 connect(m_pMediumEnumerator, SIGNAL(sigMediumCreated(const QString&)),3933 this, SIGNAL(sigMediumCreated(const QString&)));3934 connect(m_pMediumEnumerator, SIGNAL(sigMediumDeleted(const QString&)),3935 this, SIGNAL(sigMediumDeleted(const QString&)));3936 connect(m_pMediumEnumerator, SIGNAL(sigMediumEnumerationStarted()),3937 this, SIGNAL(sigMediumEnumerationStarted()));3938 connect(m_pMediumEnumerator, SIGNAL(sigMediumEnumerated(const QString&)),3939 this, SIGNAL(sigMediumEnumerated(const QString&)));3940 connect(m_pMediumEnumerator, SIGNAL(sigMediumEnumerationFinished()),3941 this, SIGNAL(sigMediumEnumerationFinished()));3932 connect(m_pMediumEnumerator, &UIMediumEnumerator::sigMediumCreated, 3933 this, &VBoxGlobal::sigMediumCreated); 3934 connect(m_pMediumEnumerator, &UIMediumEnumerator::sigMediumDeleted, 3935 this, &VBoxGlobal::sigMediumDeleted); 3936 connect(m_pMediumEnumerator, &UIMediumEnumerator::sigMediumEnumerationStarted, 3937 this, &VBoxGlobal::sigMediumEnumerationStarted); 3938 connect(m_pMediumEnumerator, &UIMediumEnumerator::sigMediumEnumerated, 3939 this, &VBoxGlobal::sigMediumEnumerated); 3940 connect(m_pMediumEnumerator, &UIMediumEnumerator::sigMediumEnumerationFinished, 3941 this, &VBoxGlobal::sigMediumEnumerationFinished); 3942 3942 } 3943 3943 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxUtils.h
r67535 r68190 38 38 : QObject(pParent), m_strName(strName) {} 39 39 40 p rivateslots:40 public slots: 41 41 42 42 /** Assigns property value. */
Note:
See TracChangeset
for help on using the changeset viewer.