18 #include "ui_QmitkFileWriterOptionsDialog.h"
31 bool hasOptions =
false;
32 int selectedIndex = 0;
36 for (std::vector<mitk::FileWriterSelector::Item>::const_reverse_iterator iter = m_WriterItems.rbegin(),
37 iterEnd = m_WriterItems.rend();
41 ui->m_WriterComboBox->addItem(QString::fromStdString(iter->GetDescription()));
48 if (iter->GetServiceId() == selectedWriterId)
53 ui->m_WriterComboBox->setCurrentIndex(selectedIndex);
57 ui->m_OptionsBox->setVisible(
false);
60 if (m_WriterItems.size() < 2)
62 ui->m_WriterLabel->setVisible(
false);
63 ui->m_WriterComboBox->setVisible(
false);
64 ui->m_FilePathLabel->setText(QString(
"File: %1").arg(QString::fromStdString(saveInfo.
m_Path)));
68 ui->m_FilePathLabel->setText(QString(
"for %1").arg(QString::fromStdString(saveInfo.
m_Path)));
71 this->setWindowTitle(
"File writing options");
81 return ui->m_ReuseOptionsCheckBox->isChecked();
86 const int index = m_WriterItems.size() - ui->m_WriterComboBox->currentIndex() - 1;
87 m_WriterItems[index].GetWriter()->SetOptions(
88 qobject_cast<QmitkFileReaderWriterOptionsWidget *>(ui->m_StackedOptionsWidget->currentWidget())->GetOptions());
FileWriterSelector m_WriterSelector
Contains a set of IFileWriter objects.
long GetSelectedId() const
bool ReuseOptions() const
bool Select(const std::string &mimeType)
std::map< std::string, us::Any > Options
Options for reading or writing data.
std::string GetName() const
MimeType m_MimeType
The selected mime-type, used to restrict results from FileWriterSelector.
std::vector< Item > Get(const std::string &mimeType) const
Get a sorted list of file writer info objects.
virtual void accept() override
~QmitkFileWriterOptionsDialog()
std::string m_Path
The path to write the BaseData object to.
QmitkFileWriterOptionsDialog(mitk::IOUtil::SaveInfo &saveInfo, QWidget *parent=0)