Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #99626 Preferences obey nativeDialogs setting in .ini #2406

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions mscore/pathlistdialog.cpp
Expand Up @@ -18,6 +18,7 @@
//=============================================================================

#include "pathlistdialog.h"
#include "preferences.h"

namespace Ms {

Expand All @@ -41,8 +42,12 @@ PathListDialog::PathListDialog(QWidget* parent)

void PathListDialog::addClicked()
{
QString newPath = QFileDialog::getExistingDirectory (this, tr("Choose a directory"),
QString("%1/%2").arg(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).arg(QCoreApplication::applicationName()));
QString newPath = QFileDialog::getExistingDirectory(
this,
tr("Choose a directory"),
QString("%1/%2").arg(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).arg(QCoreApplication::applicationName()),
QFileDialog::ShowDirsOnly | (preferences.nativeDialogs ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog)
);
if (!newPath.isEmpty()) {
newPath = QDir(newPath).absolutePath();
if(files->findItems(newPath, Qt::MatchExactly).size() == 0)
Expand Down
27 changes: 19 additions & 8 deletions mscore/preferences.cpp
Expand Up @@ -1144,7 +1144,9 @@ void PreferenceDialog::selectInstrumentList1()
this,
tr("Choose Instrument List"),
instrumentList1->text(),
tr("Instrument List (*.xml)")
tr("Instrument List (*.xml)"),
0,
preferences.nativeDialogs ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog
);
if (!s.isNull())
instrumentList1->setText(s);
Expand All @@ -1160,7 +1162,9 @@ void PreferenceDialog::selectInstrumentList2()
this,
tr("Choose Instrument List"),
instrumentList2->text(),
tr("Instrument List (*.xml)")
tr("Instrument List (*.xml)"),
0,
preferences.nativeDialogs ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog
);
if (!s.isNull())
instrumentList2->setText(s);
Expand All @@ -1176,7 +1180,9 @@ void PreferenceDialog::selectStartWith()
this,
tr("Choose Starting Score"),
sessionScore->text(),
tr("MuseScore Files (*.mscz *.mscx);;All (*)")
tr("MuseScore Files (*.mscz *.mscx);;All (*)"),
0,
preferences.nativeDialogs ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog
);
if (!s.isNull())
sessionScore->setText(s);
Expand Down Expand Up @@ -1604,7 +1610,8 @@ void PreferenceDialog::selectScoresDirectory()
QString s = QFileDialog::getExistingDirectory(
this,
tr("Choose Score Folder"),
myScores->text()
myScores->text(),
QFileDialog::ShowDirsOnly | (preferences.nativeDialogs ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog)
);
if (!s.isNull())
myScores->setText(s);
Expand All @@ -1619,7 +1626,8 @@ void PreferenceDialog::selectStylesDirectory()
QString s = QFileDialog::getExistingDirectory(
this,
tr("Choose Style Folder"),
myStyles->text()
myStyles->text(),
QFileDialog::ShowDirsOnly | (preferences.nativeDialogs ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog)
);
if (!s.isNull())
myStyles->setText(s);
Expand All @@ -1634,7 +1642,8 @@ void PreferenceDialog::selectTemplatesDirectory()
QString s = QFileDialog::getExistingDirectory(
this,
tr("Choose Template Folder"),
myTemplates->text()
myTemplates->text(),
QFileDialog::ShowDirsOnly | (preferences.nativeDialogs ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog)
);
if (!s.isNull())
myTemplates->setText(s);
Expand All @@ -1649,7 +1658,8 @@ void PreferenceDialog::selectPluginsDirectory()
QString s = QFileDialog::getExistingDirectory(
this,
tr("Choose Plugin Folder"),
myPlugins->text()
myPlugins->text(),
QFileDialog::ShowDirsOnly | (preferences.nativeDialogs ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog)
);
if (!s.isNull())
myPlugins->setText(s);
Expand All @@ -1664,7 +1674,8 @@ void PreferenceDialog::selectImagesDirectory()
QString s = QFileDialog::getExistingDirectory(
this,
tr("Choose Image Folder"),
myImages->text()
myImages->text(),
QFileDialog::ShowDirsOnly | (preferences.nativeDialogs ? QFileDialog::Options() : QFileDialog::DontUseNativeDialog)
);
if (!s.isNull())
myImages->setText(s);
Expand Down