Changeset 88100 in vbox
- Timestamp:
- Mar 12, 2021 1:17:47 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r87699 r88100 5 5 6 6 /* 7 * Copyright (C) 2006-202 0Oracle Corporation7 * Copyright (C) 2006-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 21 21 #include <QFileInfo> 22 22 #include <QLocale> 23 #include <QProcess> 23 24 #include <QThread> 24 #include <QProcess>25 25 #ifdef VBOX_WS_MAC 26 26 # include <QPushButton> … … 31 31 #include "UICommon.h" 32 32 #include "UIConverter.h" 33 #include "UIErrorString.h" 34 #include "UIExtraDataManager.h" 33 35 #include "UIHelpBrowserDialog.h" 36 #include "UIHostComboEditor.h" 37 #include "UIIconPool.h" 38 #include "UIMedium.h" 34 39 #include "UIMessageCenter.h" 40 #include "UIModalWindowManager.h" 35 41 #include "UIProgressDialog.h" 36 #include " UIErrorString.h"42 #include "VBoxAboutDlg.h" 37 43 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 38 44 # include "UINetworkRequestManager.h" 39 45 # include "UINetworkRequestManagerWindow.h" 40 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 41 #include "UIModalWindowManager.h" 42 #include "UIExtraDataManager.h" 43 #include "UIMedium.h" 46 #endif 44 47 #ifdef VBOX_OSE 45 48 # include "UIDownloaderUserManual.h" 46 #endif /* VBOX_OSE */ 47 #include "VBoxAboutDlg.h" 48 #include "UIHostComboEditor.h" 49 #endif 49 50 #ifdef VBOX_WS_MAC 50 51 # include "VBoxUtils-darwin.h" … … 55 56 56 57 /* COM includes: */ 58 #include "CAppliance.h" 57 59 #include "CAudioAdapter.h" 58 60 #include "CBooleanFormValue.h" … … 63 65 #include "CCloudProvider.h" 64 66 #include "CCloudProviderManager.h" 67 #include "CConsole.h" 65 68 #include "CDHCPServer.h" 69 #include "CExtPack.h" 70 #include "CExtPackFile.h" 71 #include "CExtPackManager.h" 66 72 #include "CForm.h" 67 73 #include "CGraphicsAdapter.h" 74 #include "CHostNetworkInterface.h" 75 #include "CMachine.h" 76 #include "CMediumAttachment.h" 77 #include "CMediumFormat.h" 68 78 #include "CNATEngine.h" 69 79 #include "CNATNetwork.h" … … 75 85 #include "CStorageController.h" 76 86 #include "CStringFormValue.h" 77 #include "CConsole.h"78 #include "CMachine.h"79 87 #include "CSystemProperties.h" 80 #include "CVirtualBoxErrorInfo.h"81 #include "CMediumAttachment.h"82 #include "CMediumFormat.h"83 #include "CAppliance.h"84 #include "CExtPack.h"85 #include "CExtPackManager.h"86 #include "CExtPackFile.h"87 #include "CHostNetworkInterface.h"88 88 #include "CUnattended.h" 89 89 #include "CVFSExplorer.h" 90 #include "CVirtualBoxErrorInfo.h" 90 91 #include "CVirtualSystemDescription.h" 91 92 #include "CVirtualSystemDescriptionForm.h" 92 93 #ifdef VBOX_WITH_DRAG_AND_DROP 93 # include "CGuest.h"94 94 # include "CDnDSource.h" 95 95 # include "CDnDTarget.h" 96 #endif /* VBOX_WITH_DRAG_AND_DROP */ 96 # include "CGuest.h" 97 #endif 97 98 98 99 /* Other VBox includes: */ 100 #include <iprt/errcore.h> 99 101 #include <iprt/param.h> 100 102 #include <iprt/path.h> 101 102 #include <iprt/errcore.h>103 103 104 104 … … 365 365 int cMinDuration /* = 2000 */) 366 366 { 367 /* Prepare result: */ 368 bool fRc = false; 369 370 /* Gather suitable dialog parent: */ 371 QWidget *pDlgParent = windowManager().realParentWindow(pParent ? pParent : windowManager().mainWindowShown()); 372 AssertPtrReturn(pDlgParent, fRc); 373 367 374 /* Prepare pixmap: */ 368 QPixmap *pPixmap = NULL;375 QPixmap pixmap; 369 376 if (!strImage.isEmpty()) 370 p Pixmap = new QPixmap(strImage);377 pixmap = UIIconPool::iconSet(strImage).pixmap(pDlgParent->windowHandle(), QSize(90, 90)); 371 378 372 379 /* Create progress-dialog: */ 373 QWidget *pDlgParent = windowManager().realParentWindow(pParent ? pParent : windowManager().mainWindowShown()); 374 QPointer<UIProgressDialog> pProgressDlg = new UIProgressDialog(progress, strTitle, pPixmap, cMinDuration, pDlgParent); 375 windowManager().registerNewParent(pProgressDlg, pDlgParent); 376 377 /* Run the dialog with the 350 ms refresh interval. */ 378 pProgressDlg->run(350); 379 380 /* Make sure progress-dialog still valid: */ 381 bool fRc; 380 QPointer<UIProgressDialog> pProgressDlg = new UIProgressDialog(progress, strTitle, &pixmap, cMinDuration, pDlgParent); 382 381 if (pProgressDlg) 383 382 { 384 /* Delete progress-dialog: */ 385 delete pProgressDlg; 386 387 fRc = true; 383 /* Register it as new parent: */ 384 windowManager().registerNewParent(pProgressDlg, pDlgParent); 385 386 /* Run the dialog with the 350 ms refresh interval. */ 387 pProgressDlg->run(350); 388 389 /* Make sure progress-dialog still valid: */ 390 if (pProgressDlg) 391 { 392 /* Delete progress-dialog: */ 393 delete pProgressDlg; 394 fRc = true; 395 } 388 396 } 389 else 390 fRc = false; 391 392 /* Cleanup pixmap: */ 393 if (pPixmap) 394 delete pPixmap; 395 397 398 /* Return result: */ 396 399 return fRc; 397 400 }
Note:
See TracChangeset
for help on using the changeset viewer.