Skip to content

Commit 8f03734

Browse files
committed
Force Qt for always use the Widget based version of the file dialog. Solves problem with only .cr2 files being shown with a *.cr2 filter.
1 parent afbfc79 commit 8f03734

File tree

9 files changed

+42
-6
lines changed

9 files changed

+42
-6
lines changed

DeepSkyStacker/BatchStacking.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ namespace DSS
181181
QSettings settings;
182182
static const QString settingKey = QStringLiteral("Folders/ListFolder");
183183
const QString& baseDir = settings.value(settingKey, QString()).toString();
184-
auto files = QFileDialog::getOpenFileNames(this, QString(), baseDir, OUTPUTLIST_FILTERS.join(QStringLiteral(";;")));
184+
//
185+
// Always use non-native dialog for consistency
186+
//
187+
auto files = QFileDialog::getOpenFileNames(this, QString(), baseDir, OUTPUTLIST_FILTERS.join(QStringLiteral(";;")), nullptr, QFileDialog::DontUseNativeDialog);
185188

186189
const auto& filePaths = getFilePaths();
187190
QStringList pathsToAdd;

DeepSkyStacker/ExplorerBar.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,11 @@ namespace DSS
570570
QString extension("settings");
571571
bool fileLoaded(false);
572572

573+
//
574+
// Always use the Qt Widget file dialog for consistency
575+
//
576+
fileDialog.setOption(QFileDialog::DontUseNativeDialog, true);
577+
//
573578
// Read the DSSLive setting file from the folder %AppData%/DeepSkyStacker/DeepSkyStacker5
574579
// create the directory to avoid surprises
575580
directory = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
@@ -617,6 +622,11 @@ namespace DSS
617622
QString extension("settings");
618623
bool fileSaved(false);
619624

625+
//
626+
// Always use the Qt Widget file dialog for consistency
627+
//
628+
fileDialog.setOption(QFileDialog::DontUseNativeDialog, true);
629+
620630
// Save the DSSLive setting file from the folder %AppData%/DeepSkyStacker/DeepSkyStacker5
621631
// create the directory to avoid surprises
622632
directory = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);

DeepSkyStacker/OutputTab.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ namespace DSS
135135
QString dir = QFileDialog::getExistingDirectory(this, tr("Select Output Folder", "IDS_SELECTOUTPUTFOLDER"),
136136
QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first(),
137137
QFileDialog::ShowDirsOnly
138-
| QFileDialog::DontResolveSymlinks);
138+
| QFileDialog::DontResolveSymlinks
139+
| QFileDialog::DontUseNativeDialog); // Always use non-native dialog for consistency
139140

140141
if (dir.length() > 0)
141142
{

DeepSkyStacker/ProcessingDlg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,11 @@ namespace DSS
401401
QString strTitle;
402402
fs::path file;
403403

404+
//
405+
// Always use the Qt Widget file dialog for consistency
406+
//
407+
fileDialog.setOption(QFileDialog::DontUseNativeDialog, true);
408+
404409
DSS::OldProgressDlg dlg{ DeepSkyStacker::instance() };
405410

406411
timer.stop();

DeepSkyStacker/StackSettings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ namespace DSS
200200
QFileDialog::getExistingDirectory(this, tr("Select Temporary Files Folder", "IDS_RECAP_SELECTTEMPFOLDER"),
201201
ui->tempFilesFolder->text(),
202202
QFileDialog::ShowDirsOnly
203-
| QFileDialog::DontResolveSymlinks);
203+
| QFileDialog::DontResolveSymlinks
204+
| QFileDialog::DontUseNativeDialog); // Use Qt dialog for consistency across platforms
204205

205206
if (dir.length() > 0)
206207
{

DeepSkyStacker/StackingDlg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,11 @@ namespace DSS
15541554
uint filterIndex = 0;
15551555
QString strTitle;
15561556

1557+
//
1558+
// Always use the Qt Widget file dialog for consistency
1559+
//
1560+
fileDialog.setOption(QFileDialog::DontUseNativeDialog, true);
1561+
15571562
bool checked{ true }; // Automatically check all frames
15581563
switch (type)
15591564
{

DeepSkyStacker/StarMaskDlg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ namespace DSS
213213
dlg.selectNameFilter(filter);
214214
dlg.setAcceptMode(QFileDialog::AcceptSave);
215215

216+
//
217+
// Always use the Qt Widget file dialog for consistency
218+
//
219+
dlg.setOption(QFileDialog::DontUseNativeDialog, true);
220+
216221
//
217222
// display the dialogue
218223
//

DeepSkyStackerLive/DeepSkyStackerLive.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,9 @@ bool DeepSkyStackerLive::setMonitoredFolder([[maybe_unused]] const QString& link
880880
tr("Select the folder to be monitored", "IDS_SELECTMONITOREDFOLDER"),
881881
startDir,
882882
QFileDialog::ShowDirsOnly
883-
| QFileDialog::DontResolveSymlinks);
883+
| QFileDialog::DontResolveSymlinks
884+
| QFileDialog::DontUseNativeDialog); // Use Qt dialog for consistency across platforms
885+
884886
if (!dir.isEmpty())
885887
{
886888
settings.setValue("MonitoredFolder", dir);

DeepSkyStackerLive/settingstab.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ namespace DSS
356356
tr("Select Warning File Folder", "IDS_SELECTWARNINGFOLDER"),
357357
QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first(),
358358
QFileDialog::ShowDirsOnly
359-
| QFileDialog::DontResolveSymlinks);
359+
| QFileDialog::DontResolveSymlinks
360+
| QFileDialog::DontUseNativeDialog); // Use Qt dialog for consistency across platforms
361+
360362
if (!dir.isEmpty())
361363
{
362364
strWarnFileFolder = dir;
@@ -375,7 +377,9 @@ namespace DSS
375377
tr("Select Stacked Image Output Folder", "IDS_SELECTSTACKEDFOLDER"),
376378
QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first(),
377379
QFileDialog::ShowDirsOnly
378-
| QFileDialog::DontResolveSymlinks);
380+
| QFileDialog::DontResolveSymlinks
381+
| QFileDialog::DontUseNativeDialog); // Use Qt dialog for consistency across platforms
382+
379383
if (!dir.isEmpty())
380384
{
381385
strStackedOutputFolder = dir;

0 commit comments

Comments
 (0)