From 5e02bcd17c7d636a10cc70055fc87af942ea8dd0 Mon Sep 17 00:00:00 2001
From: Gene Payne
Expand arrow entries to browse assets in this OpenSpace installation. Enable checkbox to include an asset. Those assets highlighted in red are present in the profile but do not exist in this OpenSpace installation.
", nullptr)); #endif // QT_CONFIG(tooltip) varName->setText(QCoreApplication::translate("assets", "Modify Name", nullptr)); - label->setText(QCoreApplication::translate("assets", "Optional variable name", nullptr)); + label->setText(QCoreApplication::translate("assets", "Variable Name", nullptr)); } // retranslateUi }; diff --git a/apps/OpenSpace/ext/launcher/src/deltatimes.cpp b/apps/OpenSpace/ext/launcher/src/deltatimes.cpp index f664c158f3..7d58076c06 100644 --- a/apps/OpenSpace/ext/launcher/src/deltatimes.cpp +++ b/apps/OpenSpace/ext/launcher/src/deltatimes.cpp @@ -269,12 +269,11 @@ void deltaTimes::keyPressEvent(QKeyEvent *evt) if(evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) { if (_editModeNewItem) { saveDeltaTimeValue(); - return; } else { addDeltaTimeValue(); - return; } + return; } QDialog::keyPressEvent(evt); diff --git a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp index def1581db8..1632299c48 100644 --- a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp +++ b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp @@ -17,7 +17,7 @@ LauncherWindow::LauncherWindow(std::string basePath, bool profileEnabled, , ui(new Ui::LauncherWindow) , _fileAccess_profiles(".profile", {"./"}, true, false) , _fileAccess_winConfigs(".xml", {"./"}, true, false) - , _filesystemAccess(".asset", {"scene", "global", "customization", "examples"}, + , _filesystemAccess(".asset", {"scene", "global", "customization", "examples", "util"}, true, true) , _basePath(QString::fromUtf8(basePath.c_str())) , _profileChangeAllowed(profileEnabled) diff --git a/apps/OpenSpace/ext/launcher/src/osmodules.cpp b/apps/OpenSpace/ext/launcher/src/osmodules.cpp index d08757912c..5f56f8d04d 100644 --- a/apps/OpenSpace/ext/launcher/src/osmodules.cpp +++ b/apps/OpenSpace/ext/launcher/src/osmodules.cpp @@ -94,6 +94,7 @@ void osmodules::listItemAdded(void) { ui->line_module->setText(QString(_data.back().name.c_str())); ui->line_loaded->setText(QString(_data.back().loadedInstruction.c_str())); ui->line_notLoaded->setText(QString(_data.back().notLoadedInstruction.c_str())); + ui->line_module->setFocus(Qt::OtherFocusReason); _editModeNewItem = true; } @@ -119,7 +120,7 @@ void osmodules::listItemSave(void) { } void osmodules::listItemCancelSave(void) { - listItemSelected(); + //listItemSelected(); transitionFromEditMode(); if (_editModeNewItem) { if (_data.size() > 0) { @@ -133,23 +134,24 @@ void osmodules::listItemCancelSave(void) { void osmodules::listItemRemove(void) { if (ui->list->count() > 0) { - if (ui->list->count() == 1) { - //Special case where last remaining item is being removed (QListWidget does - // not like the final item being removed so instead clear it & leave it) - _data.at(0) = kBlank; - ui->list->item(0)->setText(""); - } - else { - int index = ui->list->currentRow(); - if (index >= 0 && index < ui->list->count()) { - delete ui->list->takeItem(index); - if (_data.size() > 0) { - _data.erase(_data.begin() + index); + if (ui->list->currentRow() >= 0 && ui->list->currentRow() < ui->list->count()) { + if (ui->list->count() == 1) { + //Special case where last remaining item is being removed (QListWidget does + // not like the final item being removed so instead clear it & leave it) + _data.at(0) = kBlank; + ui->list->item(0)->setText(""); + } + else { + int index = ui->list->currentRow(); + if (index >= 0 && index < ui->list->count()) { + delete ui->list->takeItem(index); + if (_data.size() > 0) { + _data.erase(_data.begin() + index); + } } } } } - ui->list->clearSelection(); transitionFromEditMode(); } @@ -174,6 +176,7 @@ void osmodules::transitionFromEditMode(void) { editBoxDisabled(true); ui->label_module->setText("Module"); + //ui->list->clearSelection(); } void osmodules::editBoxDisabled(bool disabled) { @@ -205,8 +208,18 @@ osmodules::~osmodules() { void osmodules::keyPressEvent(QKeyEvent *evt) { - if(evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) + if(evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) { + if (_editModeNewItem) { + listItemSave(); + } return; + } + else if(evt->key() == Qt::Key_Escape) { + if (_editModeNewItem) { + listItemCancelSave(); + } + return; + } QDialog::keyPressEvent(evt); } diff --git a/apps/OpenSpace/ext/launcher/src/properties.cpp b/apps/OpenSpace/ext/launcher/src/properties.cpp index ed567bb361..e886119c7a 100644 --- a/apps/OpenSpace/ext/launcher/src/properties.cpp +++ b/apps/OpenSpace/ext/launcher/src/properties.cpp @@ -92,6 +92,7 @@ void properties::listItemAdded(void) { ui->combo_command->setCurrentIndex(0); ui->line_property->setText(QString(_data.back().name.c_str())); ui->line_value->setText(QString(_data.back().value.c_str())); + ui->combo_command->setFocus(Qt::OtherFocusReason); _editModeNewItem = true; } @@ -152,23 +153,24 @@ void properties::listItemCancelSave(void) { void properties::listItemRemove(void) { if (ui->list->count() > 0) { - if (ui->list->count() == 1) { - //Special case where last remaining item is being removed (QListWidget does - // not like the final item being removed so instead clear it & leave it) - _data.at(0) = kBlank; - ui->list->item(0)->setText(""); - } - else { - int index = ui->list->currentRow(); - if (index >= 0 && index < ui->list->count()) { - delete ui->list->takeItem(index); - if (_data.size() > 0) { - _data.erase(_data.begin() + index); + if (ui->list->currentRow() >= 0 && ui->list->currentRow() < ui->list->count()) { + if (ui->list->count() == 1) { + //Special case where last remaining item is being removed (QListWidget does + // not like the final item being removed so instead clear it & leave it) + _data.at(0) = kBlank; + ui->list->item(0)->setText(""); + } + else { + int index = ui->list->currentRow(); + if (index >= 0 && index < ui->list->count()) { + delete ui->list->takeItem(index); + if (_data.size() > 0) { + _data.erase(_data.begin() + index); + } } } } } - ui->list->clearSelection(); transitionFromEditMode(); } @@ -254,8 +256,18 @@ properties::~properties() { void properties::keyPressEvent(QKeyEvent *evt) { - if(evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) + if(evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) { + if (_editModeNewItem) { + listItemSave(); + } return; + } + else if(evt->key() == Qt::Key_Escape) { + if (_editModeNewItem) { + listItemCancelSave(); + } + return; + } QDialog::keyPressEvent(evt); } diff --git a/include/openspace/engine/configuration.h b/include/openspace/engine/configuration.h index 86a5fab814..a88e0fc5d4 100644 --- a/include/openspace/engine/configuration.h +++ b/include/openspace/engine/configuration.h @@ -46,6 +46,7 @@ struct Configuration { std::string sgctConfigNameInitialized; std::string asset; std::string profile; + std::vector