- Timestamp:
- Dec 11, 2023 3:07:59 PM (10 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
-
extensions/QIManagerDialog.cpp (modified) (1 diff)
-
runtime/UIMachineLogic.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIManagerDialog.cpp
r99946 r102571 57 57 void QIManagerDialogFactory::cleanup(QIManagerDialog *&pDialog) 58 58 { 59 pDialog->cleanup(); 60 pDialog->deleteLater(); 61 pDialog = 0; 59 if (pDialog) 60 { 61 pDialog->cleanup(); 62 delete pDialog; 63 pDialog = 0; 64 } 62 65 } 63 66 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r102556 r102571 1677 1677 void UIMachineLogic::sltShowFileManagerDialog() 1678 1678 { 1679 if (!activeMachineWindow()) 1680 return; 1681 1682 /* Create a file manager only if we don't have one already: */ 1683 if (m_pFileManagerDialog) 1684 { 1685 m_pFileManagerDialog->activateWindow(); 1686 m_pFileManagerDialog->raise(); 1687 return; 1688 } 1689 1690 QIManagerDialog *pFileManagerDialog; 1691 UIFileManagerDialogFactory dialogFactory(actionPool(), uiCommon().managedVMUuid(), uimachine()->machineName()); 1692 dialogFactory.prepare(pFileManagerDialog, activeMachineWindow()); 1693 if (pFileManagerDialog) 1694 { 1695 m_pFileManagerDialog = pFileManagerDialog; 1696 1697 /* Show instance: */ 1698 pFileManagerDialog->show(); 1699 pFileManagerDialog->setWindowState(pFileManagerDialog->windowState() & ~Qt::WindowMinimized); 1700 pFileManagerDialog->activateWindow(); 1701 pFileManagerDialog->raise(); 1702 connect(pFileManagerDialog, &QIManagerDialog::sigClose, 1679 /* Do not process if window(s) missed! */ 1680 if ( !isMachineWindowsCreated() 1681 || !activeMachineWindow()) 1682 return; 1683 1684 /* Create instance if not yet created: */ 1685 if (!m_pFileManagerDialog) 1686 { 1687 UIFileManagerDialogFactory(actionPool(), uiCommon().managedVMUuid(), uimachine()->machineName()) 1688 .prepare(m_pFileManagerDialog, activeMachineWindow()); 1689 connect(m_pFileManagerDialog, &QIManagerDialog::sigClose, 1703 1690 this, &UIMachineLogic::sltCloseFileManagerDialog); 1704 1691 } 1692 1693 /* Expose instance: */ 1694 UIDesktopWidgetWatchdog::restoreWidget(m_pFileManagerDialog); 1705 1695 } 1706 1696 1707 1697 void UIMachineLogic::sltCloseFileManagerDialog() 1708 1698 { 1709 if (!m_pFileManagerDialog) 1710 return; 1711 1712 QIManagerDialog* pDialog = m_pFileManagerDialog; 1713 /* Set the m_pFileManagerDialog to NULL before closing the dialog. or we will have redundant deletes*/ 1714 m_pFileManagerDialog = 0; 1715 pDialog->close(); 1716 UIFileManagerDialogFactory().cleanup(pDialog); 1699 UIFileManagerDialogFactory().cleanup(m_pFileManagerDialog); 1717 1700 } 1718 1701 1719 1702 void UIMachineLogic::sltShowLogDialog() 1720 1703 { 1721 if (!activeMachineWindow()) 1722 return; 1723 1724 /* Create a logviewer only if we don't have one already */ 1725 if (m_pLogViewerDialog) 1726 return; 1727 1728 QIManagerDialog *pLogViewerDialog; 1729 UIVMLogViewerDialogFactory dialogFactory(actionPool(), uiCommon().managedVMUuid(), uimachine()->machineName()); 1730 dialogFactory.prepare(pLogViewerDialog, activeMachineWindow()); 1731 if (pLogViewerDialog) 1732 { 1733 m_pLogViewerDialog = pLogViewerDialog; 1734 1735 /* Show instance: */ 1736 pLogViewerDialog->show(); 1737 pLogViewerDialog->setWindowState(pLogViewerDialog->windowState() & ~Qt::WindowMinimized); 1738 pLogViewerDialog->activateWindow(); 1739 connect(pLogViewerDialog, &QIManagerDialog::sigClose, 1704 /* Do not process if window(s) missed! */ 1705 if ( !isMachineWindowsCreated() 1706 || !activeMachineWindow()) 1707 return; 1708 1709 /* Create instance if not yet created: */ 1710 if (!m_pLogViewerDialog) 1711 { 1712 UIVMLogViewerDialogFactory(actionPool(), uiCommon().managedVMUuid(), uimachine()->machineName()) 1713 .prepare(m_pLogViewerDialog, activeMachineWindow()); 1714 connect(m_pLogViewerDialog, &QIManagerDialog::sigClose, 1740 1715 this, &UIMachineLogic::sltCloseLogDialog); 1741 1716 } 1717 1718 /* Expose instance: */ 1719 UIDesktopWidgetWatchdog::restoreWidget(m_pLogViewerDialog); 1742 1720 } 1743 1721 1744 1722 void UIMachineLogic::sltCloseLogDialog() 1745 1723 { 1746 if (!m_pLogViewerDialog) 1747 return; 1748 1749 QIManagerDialog* pDialog = m_pLogViewerDialog; 1750 /* Set the m_pLogViewerDialog to NULL before closing the dialog. or we will have redundant deletes*/ 1751 m_pLogViewerDialog = 0; 1752 pDialog->close(); 1753 UIVMLogViewerDialogFactory().cleanup(pDialog); 1724 UIVMLogViewerDialogFactory().cleanup(m_pLogViewerDialog); 1754 1725 } 1755 1726 … … 2032 2003 { 2033 2004 /* Do not process if window(s) missed! */ 2034 if (!isMachineWindowsCreated()) 2005 if ( !isMachineWindowsCreated() 2006 || !activeMachineWindow()) 2035 2007 return; 2036 2008 … … 2415 2387 void UIMachineLogic::sltShowGuestControlConsoleDialog() 2416 2388 { 2417 if (!activeMachineWindow()) 2418 return; 2419 2420 /* Create the dialog only if we don't have one already */ 2421 if (m_pProcessControlDialog) 2422 return; 2423 2424 QIManagerDialog *pProcessControlDialog; 2425 UIGuestProcessControlDialogFactory dialogFactory; 2426 dialogFactory.prepare(pProcessControlDialog, activeMachineWindow()); 2427 if (pProcessControlDialog) 2428 { 2429 m_pProcessControlDialog = pProcessControlDialog; 2430 2431 /* Show instance: */ 2432 pProcessControlDialog->show(); 2433 pProcessControlDialog->setWindowState(pProcessControlDialog->windowState() & ~Qt::WindowMinimized); 2434 pProcessControlDialog->activateWindow(); 2435 connect(pProcessControlDialog, &QIManagerDialog::sigClose, 2389 /* Do not process if window(s) missed! */ 2390 if ( !isMachineWindowsCreated() 2391 || !activeMachineWindow()) 2392 return; 2393 2394 /* Create instance if not yet created: */ 2395 if (!m_pProcessControlDialog) 2396 { 2397 UIGuestProcessControlDialogFactory().prepare(m_pProcessControlDialog, activeMachineWindow()); 2398 connect(m_pProcessControlDialog, &QIManagerDialog::sigClose, 2436 2399 this, &UIMachineLogic::sltCloseGuestControlConsoleDialog); 2437 2400 } 2401 2402 /* Expose instance: */ 2403 UIDesktopWidgetWatchdog::restoreWidget(m_pProcessControlDialog); 2438 2404 } 2439 2405 2440 2406 void UIMachineLogic::sltCloseGuestControlConsoleDialog() 2441 2407 { 2442 if (!m_pProcessControlDialog) 2443 return; 2444 2445 QIManagerDialog* pDialog = m_pProcessControlDialog; 2446 /* Set the m_pLogViewerDialog to NULL before closing the dialog. or we will have redundant deletes*/ 2447 m_pProcessControlDialog = 0; 2448 pDialog->close(); 2449 UIGuestProcessControlDialogFactory().cleanup(pDialog); 2408 UIGuestProcessControlDialogFactory().cleanup(m_pProcessControlDialog); 2450 2409 } 2451 2410 #endif /* VBOX_WITH_DEBUGGER_GUI */
Note:
See TracChangeset
for help on using the changeset viewer.

