From 1fc678a92900bd8e8b8119a3fa489c278abddc61 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 7 Apr 2017 15:29:09 -0700 Subject: [PATCH] add placeholder text, set export folder from FBX if not set --- tools/oven/src/ui/ModelBakeWidget.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/oven/src/ui/ModelBakeWidget.cpp b/tools/oven/src/ui/ModelBakeWidget.cpp index a3fd874306..eb4f792c33 100644 --- a/tools/oven/src/ui/ModelBakeWidget.cpp +++ b/tools/oven/src/ui/ModelBakeWidget.cpp @@ -41,6 +41,7 @@ void ModelBakeWidget::setupUI() { QLabel* modelFileLabel = new QLabel("Model File"); _modelLineEdit = new QLineEdit; + _modelLineEdit->setPlaceholderText("File or URL"); QPushButton* chooseFileButton = new QPushButton("Browse..."); connect(chooseFileButton, &QPushButton::clicked, this, &ModelBakeWidget::chooseFileButtonClicked); @@ -100,7 +101,14 @@ void ModelBakeWidget::chooseFileButtonClicked() { if (!selectedFile.isEmpty()) { // set the contents of the model file text box to be the path to the selected file _modelLineEdit->setText(selectedFile); - _modelStartDirectory.set(QDir(selectedFile).absolutePath()); + + auto directoryOfModel = QFileInfo(selectedFile).absolutePath(); + + // save the directory containing this model so we can default to it next time we show the file dialog + _modelStartDirectory.set(directoryOfModel); + + // if our output directory is not yet set, set it to the directory of this model + _outputDirLineEdit->setText(directoryOfModel); } }