18 #include "ui_QmitkFileReaderOptionsDialog.h"
31 bool hasOptions =
false;
32 int selectedIndex = 0;
35 for (std::vector<mitk::FileReaderSelector::Item>::const_reverse_iterator iter = m_ReaderItems.rbegin(),
36 iterEnd = m_ReaderItems.rend();
40 ui->m_ReaderComboBox->addItem(QString::fromStdString(iter->GetDescription()));
47 if (iter->GetServiceId() == selectedReaderId)
52 ui->m_ReaderComboBox->setCurrentIndex(selectedIndex);
56 ui->m_OptionsBox->setVisible(
false);
59 if (m_ReaderItems.size() < 2)
61 ui->m_ReaderLabel->setVisible(
false);
62 ui->m_ReaderComboBox->setVisible(
false);
63 ui->m_FilePathLabel->setText(QString(
"File: %1").arg(QString::fromStdString(loadInfo.
m_Path)));
67 ui->m_FilePathLabel->setText(QString(
"for %1").arg(QString::fromStdString(loadInfo.
m_Path)));
70 this->setWindowTitle(
"File reading options");
80 return ui->m_ReuseOptionsCheckBox->isChecked();
85 const int index = m_ReaderItems.size() - ui->m_ReaderComboBox->currentIndex() - 1;
86 m_ReaderItems[index].GetReader()->SetOptions(
87 qobject_cast<QmitkFileReaderWriterOptionsWidget *>(ui->m_StackedOptionsWidget->currentWidget())->GetOptions());
std::vector< Item > Get() const
Get a sorted list of file reader items.
bool Select(const Item &item)
std::map< std::string, us::Any > Options
Options for reading or writing data.
virtual void accept() override
long GetSelectedId() const
bool ReuseOptions() const
~QmitkFileReaderOptionsDialog()
QmitkFileReaderOptionsDialog(mitk::IOUtil::LoadInfo &loadInfo, QWidget *parent=0)
FileReaderSelector m_ReaderSelector