- Timestamp:
- Oct 21, 2024 11:20:06 AM (6 weeks ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r106554 r106556 31 31 #include <QDateTime> 32 32 #include <QDir> 33 #include <QEventLoop> 33 34 #include <QFileInfo> 34 35 #include <QImageWriter> … … 314 315 foreach(UIMachineWindow *pMachineWindow, machineWindows()) 315 316 pMachineWindow->sendMachineViewSizeHint(); 317 } 318 319 void UIMachineLogic::openNetworkSettingsDialogTheModalWay() 320 { 321 /* Open VM settings : Network page: */ 322 openSettingsDialog("#network", QString(), true /* app modal */); 323 /* Create event loop to listen to VM settings dialog destroy signal: */ 324 QEventLoop loop; 325 connect(m_settings.value(UIAdvancedSettingsDialog::Type_Machine), 326 &QObject::destroyed, &loop, &QEventLoop::quit); 327 /* Execute loop finally: */ 328 loop.exec(); 316 329 } 317 330 … … 2908 2921 2909 2922 void UIMachineLogic::openPreferencesDialog(const QString &strCategory /* = QString() */, 2910 const QString &strControl /* = QString() */) 2923 const QString &strControl /* = QString() */, 2924 bool fAppModal /* = false */) 2911 2925 { 2912 2926 /* Do not process if window(s) missed! */ … … 2920 2934 strCategory, 2921 2935 strControl); 2936 if (fAppModal) 2937 m_settings.value(UIAdvancedSettingsDialog::Type_Machine)->setWindowModality(Qt::ApplicationModal); 2922 2938 connect(m_settings.value(UIAdvancedSettingsDialog::Type_Global), &UIAdvancedSettingsDialog::sigClose, 2923 2939 this, &UIMachineLogic::sltClosePreferencesDialog); … … 2935 2951 2936 2952 void UIMachineLogic::openSettingsDialog(const QString &strCategory /* = QString() */, 2937 const QString &strControl /* = QString()*/) 2953 const QString &strControl /* = QString()*/, 2954 bool fAppModal /* = false */) 2938 2955 { 2939 2956 /* Do not process if window(s) missed! */ … … 2949 2966 strCategory, 2950 2967 strControl); 2968 if (fAppModal) 2969 m_settings.value(UIAdvancedSettingsDialog::Type_Machine)->setWindowModality(Qt::ApplicationModal); 2951 2970 connect(m_settings.value(UIAdvancedSettingsDialog::Type_Machine), &UIAdvancedSettingsDialog::sigClose, 2952 2971 this, &UIMachineLogic::sltCloseSettingsDialog); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r106554 r106556 108 108 virtual void sendMachineWindowsSizeHints(); 109 109 110 /* Wrapper to open Machine settings / Network page:*/111 void openNetworkSettingsDialog () { sltOpenSettingsDialogNetwork(); }110 /** Opens Machine settings / Network page the modal way. */ 111 void openNetworkSettingsDialogTheModalWay(); 112 112 113 113 #ifdef VBOX_WS_MAC … … 359 359 * @param fAppModal Brings whether dialog should be app modal. */ 360 360 void openPreferencesDialog(const QString &strCategory = QString(), 361 const QString &strControl = QString()); 361 const QString &strControl = QString(), 362 bool fAppModal = false); 362 363 363 364 /** Opens VM settings dialog. … … 366 367 * @param fAppModal Brings whether dialog should be app modal. */ 367 368 void openSettingsDialog(const QString &strCategory = QString(), 368 const QString &strControl = QString()); 369 const QString &strControl = QString(), 370 bool fAppModal = false); 369 371 370 372 /* Helpers: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r106312 r106556 2801 2801 { 2802 2802 if (msgCenter().warnAboutNetworkInterfaceNotFound(machineName(), failedInterfaceNames.join(", "))) 2803 machineLogic()->openNetworkSettingsDialog ();2803 machineLogic()->openNetworkSettingsDialogTheModalWay(); 2804 2804 else 2805 2805 {
Note:
See TracChangeset
for help on using the changeset viewer.