forked from pool/virtualbox
c59a91288f
- Fix additional mouse control dialog issues. - Forward Hans-Peter Jansen's fixes. OBS-URL: https://build.opensuse.org/request/show/855487 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=580
124 lines
7.5 KiB
Diff
124 lines
7.5 KiB
Diff
Index: VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp
|
|
===================================================================
|
|
--- VirtualBox-6.1.16.orig/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp
|
|
+++ VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsExtension.cpp
|
|
@@ -16,6 +16,7 @@
|
|
*/
|
|
|
|
/* Qt includes: */
|
|
+#include <QApplication>
|
|
#include <QHeaderView>
|
|
#include <QMenu>
|
|
#ifdef VBOX_WS_WIN
|
|
@@ -295,7 +296,7 @@ void UIGlobalSettingsExtension::sltAddPa
|
|
extensions << QString("*.%1").arg(VBoxExtPackFileExts[i]);
|
|
const QString strFilter = tr("Extension package files (%1)").arg(extensions.join(" "));
|
|
|
|
- const QStringList fileNames = QIFileDialog::getOpenFileNames(strBaseFolder, strFilter, this, strTitle, 0, true, true);
|
|
+ const QStringList fileNames = QIFileDialog::getOpenFileNames(strBaseFolder, strFilter, QApplication::activeWindow(), strTitle, 0, true, true);
|
|
|
|
QString strFilePath;
|
|
if (!fileNames.isEmpty())
|
|
Index: VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp
|
|
===================================================================
|
|
--- VirtualBox-6.1.16.orig/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp
|
|
+++ VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp
|
|
@@ -397,10 +397,10 @@ void UIFilePathSelector::selectPath()
|
|
switch (m_enmMode)
|
|
{
|
|
case Mode_File_Open:
|
|
- strSelPath = QIFileDialog::getOpenFileName(strInitDir, m_strFileDialogFilters, parentWidget(), m_strFileDialogTitle); break;
|
|
+ strSelPath = QIFileDialog::getOpenFileName(strInitDir, m_strFileDialogFilters, QApplication::activeWindow(), m_strFileDialogTitle); break;
|
|
case Mode_File_Save:
|
|
{
|
|
- strSelPath = QIFileDialog::getSaveFileName(strInitDir, m_strFileDialogFilters, parentWidget(), m_strFileDialogTitle);
|
|
+ strSelPath = QIFileDialog::getSaveFileName(strInitDir, m_strFileDialogFilters, QApplication::activeWindow(), m_strFileDialogTitle);
|
|
if (!strSelPath.isEmpty() && QFileInfo(strSelPath).suffix().isEmpty())
|
|
{
|
|
if (m_strFileDialogDefaultSaveExtension.isEmpty())
|
|
@@ -411,7 +411,7 @@ void UIFilePathSelector::selectPath()
|
|
break;
|
|
}
|
|
case Mode_Folder:
|
|
- strSelPath = QIFileDialog::getExistingDirectory(strInitDir, parentWidget(), m_strFileDialogTitle); break;
|
|
+ strSelPath = QIFileDialog::getExistingDirectory(strInitDir, QApplication::activeWindow(), m_strFileDialogTitle); break;
|
|
}
|
|
|
|
/* Do nothing if nothing chosen: */
|
|
Index: VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/widgets/UIEmptyFilePathSelector.cpp
|
|
===================================================================
|
|
--- VirtualBox-6.1.16.orig/src/VBox/Frontends/VirtualBox/src/widgets/UIEmptyFilePathSelector.cpp
|
|
+++ VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/widgets/UIEmptyFilePathSelector.cpp
|
|
@@ -232,16 +232,16 @@ void UIEmptyFilePathSelector::choose()
|
|
switch (mMode)
|
|
{
|
|
case UIEmptyFilePathSelector::Mode_File_Open:
|
|
- path = QIFileDialog::getOpenFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle); break;
|
|
+ path = QIFileDialog::getOpenFileName (initDir, mFileFilters, QApplication::activeWindow(), mFileDialogTitle); break;
|
|
case UIEmptyFilePathSelector::Mode_File_Save:
|
|
{
|
|
- path = QIFileDialog::getSaveFileName (initDir, mFileFilters, parentWidget(), mFileDialogTitle);
|
|
+ path = QIFileDialog::getSaveFileName (initDir, mFileFilters, QApplication::activeWindow(), mFileDialogTitle);
|
|
if (!path.isEmpty() && QFileInfo (path).suffix().isEmpty())
|
|
path = QString ("%1.%2").arg (path).arg (mDefaultSaveExt);
|
|
break;
|
|
}
|
|
case UIEmptyFilePathSelector::Mode_Folder:
|
|
- path = QIFileDialog::getExistingDirectory (initDir, parentWidget(), mFileDialogTitle); break;
|
|
+ path = QIFileDialog::getExistingDirectory (initDir, QApplication::activeWindow(), mFileDialogTitle); break;
|
|
}
|
|
if (path.isEmpty())
|
|
return;
|
|
Index: VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
|
|
===================================================================
|
|
--- VirtualBox-6.1.16.orig/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
|
|
+++ VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/medium/UIMediumSelector.cpp
|
|
@@ -438,7 +438,7 @@ void UIMediumSelector::sltButtonLeaveEmp
|
|
|
|
void UIMediumSelector::sltAddMedium()
|
|
{
|
|
- QUuid uMediumID = uiCommon().openMediumWithFileOpenDialog(m_enmMediumType, this, m_strMachineFolder);
|
|
+ QUuid uMediumID = uiCommon().openMediumWithFileOpenDialog(m_enmMediumType, QApplication::activeWindow(), m_strMachineFolder);
|
|
if (uMediumID.isNull())
|
|
return;
|
|
repopulateTreeWidget();
|
|
Index: VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
|
|
===================================================================
|
|
--- VirtualBox-6.1.16.orig/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
|
|
+++ VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
|
|
@@ -3197,7 +3197,7 @@ void UICommon::updateMachineStorage(cons
|
|
}
|
|
else if (target.type == UIMediumTarget::UIMediumTargetType_WithFileDialog)
|
|
{
|
|
- uMediumID = openMediumWithFileOpenDialog(target.mediumType, windowManager().mainWindowShown(),
|
|
+ uMediumID = openMediumWithFileOpenDialog(target.mediumType, QApplication::activeWindow(),
|
|
strMachineFolder, false /* fUseLastFolder */);
|
|
}
|
|
else if(target.type == UIMediumTarget::UIMediumTargetType_CreateAdHocVISO)
|
|
Index: VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
|
|
===================================================================
|
|
--- VirtualBox-6.1.16.orig/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
|
|
+++ VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/medium/UIMediumManager.cpp
|
|
@@ -486,7 +486,7 @@ void UIMediumManagerWidget::sltHandleMac
|
|
void UIMediumManagerWidget::sltAddMedium()
|
|
{
|
|
QString strDefaultMachineFolder = uiCommon().virtualBox().GetSystemProperties().GetDefaultMachineFolder();
|
|
- uiCommon().openMediumWithFileOpenDialog(currentMediumType(), this,
|
|
+ uiCommon().openMediumWithFileOpenDialog(currentMediumType(), QApplication::activeWindow(),
|
|
strDefaultMachineFolder, true /* use most recent medium folder */);
|
|
}
|
|
|
|
Index: VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
|
|
===================================================================
|
|
--- VirtualBox-6.1.16.orig/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
|
|
+++ VirtualBox-6.1.16/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
|
|
@@ -3958,7 +3958,7 @@ void UIMachineSettingsStorage::sltChoose
|
|
{
|
|
const QString strMachineFolder(QFileInfo(m_strMachineSettingsFilePath).absolutePath());
|
|
|
|
- QUuid uMediumId = uiCommon().openMediumWithFileOpenDialog(m_pMediumIdHolder->type(), this, strMachineFolder);
|
|
+ QUuid uMediumId = uiCommon().openMediumWithFileOpenDialog(m_pMediumIdHolder->type(), QApplication::activeWindow(), strMachineFolder);
|
|
if (uMediumId.isNull())
|
|
return;
|
|
m_pMediumIdHolder->setId(uMediumId);
|