Use native dialog on all platforms except Linux.
We have a bug with native dialog on Linux that's why we cannot use it. --HG-- branch : develop
This commit is contained in:
parent
911a85d79b
commit
d8c3a0ac81
|
@ -972,8 +972,11 @@ void TMainWindow::ImportDataFromCSV()
|
||||||
const QString filters = tr("Comma-Separated Values") + QLatin1String(" (*.csv)");
|
const QString filters = tr("Comma-Separated Values") + QLatin1String(" (*.csv)");
|
||||||
const QString suffix("csv");
|
const QString suffix("csv");
|
||||||
|
|
||||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Import from CSV"), QDir::homePath(), filters, nullptr,
|
QString fileName = QFileDialog::getOpenFileName(this, tr("Import from CSV"), QDir::homePath(), filters, nullptr
|
||||||
QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
|
@ -148,7 +148,10 @@ void PreferencesPathPage::EditPath()
|
||||||
const QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), path,
|
const QString dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"), path,
|
||||||
QFileDialog::ShowDirsOnly
|
QFileDialog::ShowDirsOnly
|
||||||
| QFileDialog::DontResolveSymlinks
|
| QFileDialog::DontResolveSymlinks
|
||||||
| QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
| QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if (dir.isEmpty())
|
if (dir.isEmpty())
|
||||||
{
|
{
|
||||||
if (usedNotExistedDir)
|
if (usedNotExistedDir)
|
||||||
|
|
|
@ -837,8 +837,11 @@ void DialogPatternProperties::InitImage()
|
||||||
void DialogPatternProperties::ChangeImage()
|
void DialogPatternProperties::ChangeImage()
|
||||||
{
|
{
|
||||||
const QString filter = tr("Images") + QLatin1String(" (*.png *.jpg *.jpeg *.bmp)");
|
const QString filter = tr("Images") + QLatin1String(" (*.png *.jpg *.jpeg *.bmp)");
|
||||||
const QString fileName = QFileDialog::getOpenFileName(this, tr("Image for pattern"), QString(), filter, nullptr,
|
const QString fileName = QFileDialog::getOpenFileName(this, tr("Image for pattern"), QString(), filter, nullptr
|
||||||
QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if (not fileName.isEmpty())
|
if (not fileName.isEmpty())
|
||||||
{
|
{
|
||||||
QImage image;
|
QImage image;
|
||||||
|
@ -879,8 +882,11 @@ void DialogPatternProperties::SaveImage()
|
||||||
QByteArray ba = QByteArray::fromBase64(byteArray);
|
QByteArray ba = QByteArray::fromBase64(byteArray);
|
||||||
const QString extension = QLatin1String(".") + doc->GetImageExtension();
|
const QString extension = QLatin1String(".") + doc->GetImageExtension();
|
||||||
QString filter = tr("Images") + QLatin1String(" (*") + extension + QLatin1String(")");
|
QString filter = tr("Images") + QLatin1String(" (*") + extension + QLatin1String(")");
|
||||||
QString filename = QFileDialog::getSaveFileName(this, tr("Save File"), tr("untitled"), filter, &filter,
|
QString filename = QFileDialog::getSaveFileName(this, tr("Save File"), tr("untitled"), filter, &filter
|
||||||
QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if (not filename.isEmpty())
|
if (not filename.isEmpty())
|
||||||
{
|
{
|
||||||
if (not filename.endsWith(extension.toUpper()))
|
if (not filename.endsWith(extension.toUpper()))
|
||||||
|
|
|
@ -129,7 +129,10 @@ DialogSaveLayout::DialogSaveLayout(int count, Draw mode, const QString &fileName
|
||||||
const QString dir = QFileDialog::getExistingDirectory(this, tr("Select folder"), dirPath,
|
const QString dir = QFileDialog::getExistingDirectory(this, tr("Select folder"), dirPath,
|
||||||
QFileDialog::ShowDirsOnly
|
QFileDialog::ShowDirsOnly
|
||||||
| QFileDialog::DontResolveSymlinks
|
| QFileDialog::DontResolveSymlinks
|
||||||
| QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
| QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if (not dir.isEmpty())
|
if (not dir.isEmpty())
|
||||||
{// If paths equal the signal will not be called, we will do this manually
|
{// If paths equal the signal will not be called, we will do this manually
|
||||||
dir == ui->lineEditPath->text() ? PathChanged(dir) : ui->lineEditPath->setText(dir);
|
dir == ui->lineEditPath->text() ? PathChanged(dir) : ui->lineEditPath->setText(dir);
|
||||||
|
|
|
@ -1659,8 +1659,11 @@ void MainWindow::LoadIndividual()
|
||||||
usedNotExistedDir = directory.mkpath(".");
|
usedNotExistedDir = directory.mkpath(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter, nullptr,
|
const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter, nullptr
|
||||||
QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
if (not mPath.isEmpty())
|
if (not mPath.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -1697,8 +1700,11 @@ void MainWindow::LoadMultisize()
|
||||||
//Use standard path to multisize measurements
|
//Use standard path to multisize measurements
|
||||||
QString path = qApp->ValentinaSettings()->GetPathMultisizeMeasurements();
|
QString path = qApp->ValentinaSettings()->GetPathMultisizeMeasurements();
|
||||||
path = VCommonSettings::PrepareMultisizeTables(path);
|
path = VCommonSettings::PrepareMultisizeTables(path);
|
||||||
const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter, nullptr,
|
const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), path, filter, nullptr
|
||||||
QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
if (not mPath.isEmpty())
|
if (not mPath.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -2744,7 +2750,11 @@ bool MainWindow::SaveAs()
|
||||||
|
|
||||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save as"),
|
QString fileName = QFileDialog::getSaveFileName(this, tr("Save as"),
|
||||||
dir + QLatin1String("/") + tr("pattern") + QLatin1String(".val"),
|
dir + QLatin1String("/") + tr("pattern") + QLatin1String(".val"),
|
||||||
filters, nullptr, QFileDialog::DontUseNativeDialog);
|
filters, nullptr
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
auto RemoveTempDir = [usedNotExistedDir, dir]()
|
auto RemoveTempDir = [usedNotExistedDir, dir]()
|
||||||
{
|
{
|
||||||
|
@ -2935,8 +2945,11 @@ void MainWindow::Open()
|
||||||
dir = QFileInfo(files.first()).absolutePath();
|
dir = QFileInfo(files.first()).absolutePath();
|
||||||
}
|
}
|
||||||
qCDebug(vMainWindow, "Run QFileDialog::getOpenFileName: dir = %s.", qUtf8Printable(dir));
|
qCDebug(vMainWindow, "Run QFileDialog::getOpenFileName: dir = %s.", qUtf8Printable(dir));
|
||||||
const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), dir, filter, nullptr,
|
const QString filePath = QFileDialog::getOpenFileName(this, tr("Open file"), dir, filter, nullptr
|
||||||
QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if (filePath.isEmpty())
|
if (filePath.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -113,10 +113,16 @@ void VPE::VFileEditWidget::onToolButtonClicked()
|
||||||
{
|
{
|
||||||
QString filepath = (Directory ? QFileDialog::getExistingDirectory(nullptr, tr("Directory"), CurrentFilePath,
|
QString filepath = (Directory ? QFileDialog::getExistingDirectory(nullptr, tr("Directory"), CurrentFilePath,
|
||||||
QFileDialog::ShowDirsOnly
|
QFileDialog::ShowDirsOnly
|
||||||
| QFileDialog::DontUseNativeDialog)
|
#ifdef Q_OS_LINUX
|
||||||
|
| QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
)
|
||||||
: QFileDialog::getOpenFileName(nullptr, tr("Open File"), CurrentFilePath,
|
: QFileDialog::getOpenFileName(nullptr, tr("Open File"), CurrentFilePath,
|
||||||
FileDialogFilter, nullptr,
|
FileDialogFilter, nullptr
|
||||||
QFileDialog::DontUseNativeDialog));
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
));
|
||||||
if (filepath.isNull() == false)
|
if (filepath.isNull() == false)
|
||||||
{
|
{
|
||||||
setFile(filepath, true);
|
setFile(filepath, true);
|
||||||
|
|
|
@ -291,7 +291,11 @@ void DialogEditLabel::ExportTemplate()
|
||||||
|
|
||||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Export label template"),
|
QString fileName = QFileDialog::getSaveFileName(this, tr("Export label template"),
|
||||||
path + QLatin1String("/") + tr("template") + QLatin1String(".xml"),
|
path + QLatin1String("/") + tr("template") + QLatin1String(".xml"),
|
||||||
filters, nullptr, QFileDialog::DontUseNativeDialog);
|
filters, nullptr
|
||||||
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -340,8 +344,11 @@ void DialogEditLabel::ImportTemplate()
|
||||||
QString filter(tr("Label template") + QLatin1String(" (*.xml)"));
|
QString filter(tr("Label template") + QLatin1String(" (*.xml)"));
|
||||||
//Use standard path to label templates
|
//Use standard path to label templates
|
||||||
const QString path = VCommonSettings::PrepareLabelTemplates(qApp->Settings()->GetPathLabelTemplate());
|
const QString path = VCommonSettings::PrepareLabelTemplates(qApp->Settings()->GetPathLabelTemplate());
|
||||||
const QString fileName = QFileDialog::getOpenFileName(this, tr("Import template"), path, filter, nullptr,
|
const QString fileName = QFileDialog::getOpenFileName(this, tr("Import template"), path, filter, nullptr
|
||||||
QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -106,8 +106,11 @@ QString VAbstractMainWindow::CSVFilePath()
|
||||||
const QString suffix("csv");
|
const QString suffix("csv");
|
||||||
const QString path = QDir::homePath() + QLatin1String("/") + tr("values") + QLatin1String(".") + suffix;
|
const QString path = QDir::homePath() + QLatin1String("/") + tr("values") + QLatin1String(".") + suffix;
|
||||||
|
|
||||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Export to CSV"), path, filters, nullptr,
|
QString fileName = QFileDialog::getSaveFileName(this, tr("Export to CSV"), path, filters, nullptr
|
||||||
QFileDialog::DontUseNativeDialog);
|
#ifdef Q_OS_LINUX
|
||||||
|
, QFileDialog::DontUseNativeDialog
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
if (fileName.isEmpty())
|
if (fileName.isEmpty())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user