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