18#include "importexportdialog.h"
19#include "ui_importexportdialog.h"
21#include <QDialogButtonBox>
22#include "filedialog.h"
24ImportExportDialog::ImportExportDialog(
QWidget* parent, Mode eMode, FileType eFileType) :
QDialog(parent)
27 mFileType = eFileType;
29 ui =
new Ui::ImportExportDialog;
31 hidePreviewGroupBox(
true);
35 setWindowFlags(eFlags);
38ImportExportDialog::~ImportExportDialog()
48QString ImportExportDialog::getFilePath()
const
58QString ImportExportDialog::getAbsolutePath()
61 return info.absolutePath();
64void ImportExportDialog::hideInstructionsLabel(
bool hide)
66 ui->instructionsLabel->setHidden(
hide);
69void ImportExportDialog::setInstructionsLabel(
const QString& text)
71 ui->instructionsLabel->setText(text);
74void ImportExportDialog::setOkButtonEnabled(
const bool enabled)
79void ImportExportDialog::init()
92 ui->fileEdit->setText(
"\"" + m_filePaths.
first() +
"\"");
94 emit filePathsChanged(m_filePaths);
97QGroupBox* ImportExportDialog::getOptionsGroupBox()
99 return ui->optionsGroupBox;
102void ImportExportDialog::hideOptionsGroupBox(
bool hide)
104 ui->optionsGroupBox->setHidden(
hide);
107void ImportExportDialog::hidePreviewGroupBox(
bool hide)
109 ui->previewGroupBox->setHidden(
hide);
112QGroupBox* ImportExportDialog::getPreviewGroupBox()
114 return ui->previewGroupBox;
117void ImportExportDialog::setFileExtension(
const QString& extension)
119 for (
int i = 0; i < m_filePaths.
size(); i++)
122 m_filePaths.
replace(i, info.path() +
"/" + info.completeBaseName() +
"." +
extension);
124 ui->fileEdit->setText(
"\"" + m_filePaths.
join(
"\" \"") +
"\"");
126 emit filePathsChanged(m_filePaths);
129void ImportExportDialog::browse()
135 if (mFileType == FileType::IMAGE_SEQUENCE)
154 m_filePaths = filePaths;
155 ui->fileEdit->setText(
"\"" + filePaths.
join(
"\" \"") +
"\"");
157 emit filePathsChanged(m_filePaths);
static QString getLastSavePath(FileType fileType)
Retrieves the last used save path for a given file type.
static QStringList getOpenFileNames(QWidget *parent, FileType fileType, const QString &caption=QString())
Shows a file dialog which allows the user to select multiple files to open.
static QString getSaveFileName(QWidget *parent, FileType fileType, const QString &caption=QString())
Shows a file dialog which allows the user to select a file save path.
static QString getOpenFileName(QWidget *parent, FileType fileType, const QString &caption=QString())
Shows a file dialog which allows the user to select a file to open.
static QString getLastOpenPath(FileType fileType)
Retrieves the last opened file of a given type.
QWidget * extension() const const
const T & at(int i) const const
bool isEmpty() const const
void replace(int i, const T &value)
QString join(const QString &separator) const const