forked from qt-creator/qt-creator
Provide parent to getOpenFileName() and getSaveFileName()
Change-Id: I839de363f426a57a522700df39e4f3b4ebfbb7ea Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
namespace DiffEditor {
|
||||
namespace Internal {
|
||||
@@ -82,13 +83,13 @@ void DiffEditorPlugin::extensionsInitialized()
|
||||
|
||||
void DiffEditorPlugin::diff()
|
||||
{
|
||||
QString fileName1 = QFileDialog::getOpenFileName(0,
|
||||
QString fileName1 = QFileDialog::getOpenFileName(Core::ICore::dialogParent(),
|
||||
tr("Select First File for Diff"),
|
||||
QString());
|
||||
if (fileName1.isNull())
|
||||
return;
|
||||
|
||||
QString fileName2 = QFileDialog::getOpenFileName(0,
|
||||
QString fileName2 = QFileDialog::getOpenFileName(Core::ICore::dialogParent(),
|
||||
tr("Select Second File for Diff"),
|
||||
QString());
|
||||
if (fileName2.isNull())
|
||||
|
||||
@@ -529,7 +529,7 @@ void FakeVimOptionPage::setPlainStyle()
|
||||
|
||||
void FakeVimOptionPage::openVimRc()
|
||||
{
|
||||
const QString fileName = QFileDialog::getOpenFileName();
|
||||
const QString fileName = QFileDialog::getOpenFileName(Core::ICore::dialogParent());
|
||||
if (!fileName.isNull())
|
||||
m_ui.lineEditVimRcPath->setText(fileName);
|
||||
}
|
||||
|
||||
@@ -216,8 +216,8 @@ void GeneralSettingsPage::importBookmarks()
|
||||
{
|
||||
m_ui->errorLabel->setVisible(false);
|
||||
|
||||
QString fileName = QFileDialog::getOpenFileName(0, tr("Import Bookmarks"),
|
||||
QDir::currentPath(), tr("Files (*.xbel)"));
|
||||
QString fileName = QFileDialog::getOpenFileName(Core::ICore::dialogParent(),
|
||||
tr("Import Bookmarks"), QDir::currentPath(), tr("Files (*.xbel)"));
|
||||
|
||||
if (fileName.isEmpty())
|
||||
return;
|
||||
@@ -238,8 +238,8 @@ void GeneralSettingsPage::exportBookmarks()
|
||||
{
|
||||
m_ui->errorLabel->setVisible(false);
|
||||
|
||||
QString fileName = QFileDialog::getSaveFileName(0, tr("Save File"),
|
||||
QLatin1String("untitled.xbel"), tr("Files (*.xbel)"));
|
||||
QString fileName = QFileDialog::getSaveFileName(Core::ICore::dialogParent(),
|
||||
tr("Save File"), QLatin1String("untitled.xbel"), tr("Files (*.xbel)"));
|
||||
|
||||
QLatin1String suffix(".xbel");
|
||||
if (!fileName.endsWith(suffix))
|
||||
|
||||
@@ -1038,8 +1038,8 @@ void ProjectExplorerPlugin::loadAction()
|
||||
dir = isProject ? fn : QFileInfo(fn).absolutePath();
|
||||
}
|
||||
|
||||
QString filename = QFileDialog::getOpenFileName(0, tr("Load Project"),
|
||||
dir,
|
||||
QString filename = QFileDialog::getOpenFileName(Core::ICore::dialogParent(),
|
||||
tr("Load Project"), dir,
|
||||
d->m_projectFilterString);
|
||||
if (filename.isEmpty())
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user