commas break things in filters; slightly better behaviour for export dialog
parent
9ed8d6039d
commit
ff4ffaac61
|
@ -43,8 +43,8 @@ namespace {
|
|||
const QString FileOps::Filter::project = qs("Xybrid project (*.xyp);;All files (*)");
|
||||
const QString FileOps::Filter::node = qs("Xybrid node (*.xyn);;All files (*)");
|
||||
|
||||
const QString FileOps::Filter::audioIn = qs("Audio files (*.mp3, *.ogg, *.flac, *.wav);;MPEG Layer 3 (*.mp3);;All files (*)");
|
||||
const QString FileOps::Filter::audioOut = qs("Audio files (*.mp3, *.flac);;MPEG Layer 3 (*.mp3);;FLAC (*.flac)"); // only supported formats
|
||||
const QString FileOps::Filter::audioIn = qs("Audio files (*.mp3 *.ogg *.flac *.wav);;MPEG Layer 3 (*.mp3);;All files (*)");
|
||||
const QString FileOps::Filter::audioOut = qs("Audio files (*.mp3 *.flac);;MPEG Layer 3 (*.mp3);;FLAC (*.flac)"); // only supported formats
|
||||
|
||||
QString FileOps::showOpenDialog(QWidget* parent, const QString& caption, const QString& directory, const QString& filter) {
|
||||
QFileDialog dlg(parent, caption, directory, filter);
|
||||
|
@ -52,8 +52,8 @@ QString FileOps::showOpenDialog(QWidget* parent, const QString& caption, const Q
|
|||
dlg.setFileMode(QFileDialog::ExistingFile);
|
||||
dlg.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
if (!dlg.exec()) return QString(); // canceled
|
||||
auto sf = dlg.selectedFiles();
|
||||
return sf[0];
|
||||
auto sf = dlg.selectedFiles().at(0);
|
||||
return sf;
|
||||
}
|
||||
|
||||
QString FileOps::showSaveAsDialog(QWidget* parent, const QString& caption, const QString& directory, const QString& filter, const QString& suffix) {
|
||||
|
@ -63,8 +63,8 @@ QString FileOps::showSaveAsDialog(QWidget* parent, const QString& caption, const
|
|||
dlg.setFileMode(QFileDialog::AnyFile);
|
||||
dlg.setAcceptMode(QFileDialog::AcceptSave);
|
||||
if (!dlg.exec()) return QString(); // canceled
|
||||
auto sf = dlg.selectedFiles();
|
||||
return sf[0];
|
||||
auto sf = dlg.selectedFiles().at(0);
|
||||
return sf;
|
||||
}
|
||||
|
||||
bool FileOps::saveProject(std::shared_ptr<Project> project, QString fileName) {
|
||||
|
|
|
@ -649,8 +649,8 @@ void MainWindow::menuFileExportAs() {
|
|||
QString saveDir = Config::Directories::projects;
|
||||
if (!project->fileName.isEmpty()) {
|
||||
QFileInfo f(project->fileName);
|
||||
saveDir = f.dir().filePath(f.baseName());
|
||||
}
|
||||
saveDir = f.dir().filePath(f.baseName()).append(".mp3");
|
||||
} else saveDir = saveDir.append("/untitled.mp3");
|
||||
if (auto fileName = FileOps::showSaveAsDialog(this, "Save project as...", saveDir, FileOps::Filter::audioOut, "mp3"); !fileName.isEmpty()) {
|
||||
project->exportFileName = fileName;
|
||||
audioEngine->render(project, project->exportFileName);
|
||||
|
|
Loading…
Reference in New Issue