Commit 2deccef0 authored by sankhesh's avatar sankhesh
Browse files

BUG: Issue 2240. Added mount Volumes to sidebar

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21519 3bd1e089-480b-0410-8dfb-8563597acbee
parent eb062212
......@@ -55,7 +55,7 @@ QStringList qSlicerFileDialog::nameFilters(qSlicerIO::IOFileType fileType)
{
QStringList filters;
QStringList extensions;
QList<qSlicerFileReader*> readers =
QList<qSlicerFileReader*> readers =
qSlicerApplication::application()->ioManager()->readers(fileType);
foreach(const qSlicerFileReader* reader, readers)
{
......@@ -205,6 +205,15 @@ bool qSlicerStandardFileDialog::exec(const qSlicerIO::IOProperties& ioProperties
fileDialog, SLOT(setAcceptButtonEnable(bool)));
fileDialog->setAcceptButtonEnable(optionsWidget->isValid());
}
// Workaround for Mac to show mounted volumes.
// See issue #2240
#ifdef Q_WS_MAC
QList<QUrl> sidebarUrls = ioManager->favorites();
sidebarUrls.append(QUrl::fromLocalFile("/Volumes"));
fileDialog->setSidebarUrls(sidebarUrls);
#endif
// we do not delete options now as it is still useful later (even if there is
// no UI.) they are the options of the reader, UI or not.
bool res = fileDialog->exec();
......@@ -259,6 +268,14 @@ QStringList qSlicerStandardFileDialog::getOpenFileName(
ioProperties);
qSlicerIOManager* ioManager = qSlicerApplication::application()->ioManager();
// Workaround for Mac to show mounted volumes.
// See issue #2240
#ifdef Q_WS_MAC
QList<QUrl> sidebarUrls = ioManager->favorites();
sidebarUrls.append(QUrl::fromLocalFile("/Volumes"));
fileDialog->setSidebarUrls(sidebarUrls);
#endif
if(fileDialog->exec() == QDialog::Accepted)
{
files = fileDialog->selectedFiles();
......@@ -279,6 +296,14 @@ QString qSlicerStandardFileDialog::getExistingDirectory(
ioProperties);
qSlicerIOManager* ioManager = qSlicerApplication::application()->ioManager();
// Workaround for Mac to show mounted volumes.
// See issue #2240
#ifdef Q_WS_MAC
QList<QUrl> sidebarUrls = ioManager->favorites();
sidebarUrls.append(QUrl::fromLocalFile("/Volumes"));
fileDialog->setSidebarUrls(sidebarUrls);
#endif
if (fileDialog->exec() == QDialog::Accepted)
{
directory = fileDialog->selectedFiles().value(0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment