Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/freesurfer/freesurfer into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoopes committed Mar 8, 2021
2 parents 76e1968 + 9523d9a commit f91d63e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions freeview/DialogLoadVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ void DialogLoadVolume::UpdateLUT()

void DialogLoadVolume::OnOpen()
{
QString fn = ui->comboBoxFilenames->currentText().trimmed();
if (fn == "current folder")
fn = QDir::currentPath();
else
fn = QFileInfo(fn).absolutePath();
QStringList filenames = QFileDialog::getOpenFileNames( this, "Select volume files",
MainWindow::AutoSelectLastDir( m_strLastDir, "mri" ),
fn, // MainWindow::AutoSelectLastDir( m_strLastDir, "mri" ),
"Volume files (*.mgz *.mgh *.nii *.nii.gz *.img *.mnc);;All files (*)");
if ( !filenames.isEmpty() )
{
Expand Down Expand Up @@ -96,6 +101,7 @@ void DialogLoadVolume::SetRecentFiles( const QStringList& filenames )
{
fns[i] = MyUtils::Win32PathProof(fns[i]);
}
fns.insert(0, "current folder");
ui->comboBoxFilenames->clear();
ui->comboBoxFilenames->addItems( fns );
if ( !filenames.isEmpty() )
Expand Down Expand Up @@ -184,7 +190,7 @@ QString DialogLoadVolume::GetLUT()

void DialogLoadVolume::OnOK()
{
if ( GetVolumeFileNames().isEmpty() )
if ( GetVolumeFileNames().isEmpty() || ui->comboBoxFilenames->currentText().trimmed() == "current folder")
{
QMessageBox::warning( this, "Error", "Please specify volume file to load.");
return;
Expand Down

0 comments on commit f91d63e

Please sign in to comment.