Formatting changes based on feedback, improved delta times data entry

This commit is contained in:
Gene Payne
2020-09-26 20:59:02 -06:00
parent ff1d84f80b
commit c01024132b
5 changed files with 18 additions and 6 deletions

View File

@@ -73,7 +73,7 @@ public:
void retranslateUi(QDialog *assets)
{
assets->setWindowTitle(QCoreApplication::translate("assets", "Dialog", nullptr));
assets->setWindowTitle(QCoreApplication::translate("assets", "Select assets to include", nullptr));
#if QT_CONFIG(tooltip)
treeView->setToolTip(QCoreApplication::translate("assets", "<html><head/><body><p>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.</p></body></html>", nullptr));
#endif // QT_CONFIG(tooltip)

View File

@@ -88,7 +88,7 @@ public:
#if QT_CONFIG(tooltip)
line_node->setToolTip(QCoreApplication::translate("markNodes", "<html><head/><body><p>Name of scenegraph node to add to list of &quot;interesting&quot; nodes</p></body></html>", nullptr));
#endif // QT_CONFIG(tooltip)
button_add->setText(QCoreApplication::translate("markNodes", "Add New", nullptr));
button_add->setText(QCoreApplication::translate("markNodes", "Add", nullptr));
} // retranslateUi
};

View File

@@ -83,7 +83,7 @@ public:
time->setWindowTitle(QCoreApplication::translate("time", "Time", nullptr));
label_relative->setText(QCoreApplication::translate("time", "Relative Time:", nullptr));
#if QT_CONFIG(tooltip)
line_relative->setToolTip(QCoreApplication::translate("time", "<html><head/><body><p>String for relative time to actual (e.g. &quot;-1d&quot; for back 1 day)</p></body></html>", nullptr));
line_relative->setToolTip(QCoreApplication::translate("time", "<html><head/><body><p>String for relative time from actual (e.g. &quot;-1d&quot; for back 1 day, &quot;now&quot; for current time, &quot;+2w&quot; for forward 2 weeks)</p></body></html>", nullptr));
#endif // QT_CONFIG(tooltip)
#if QT_CONFIG(tooltip)
combo_type->setToolTip(QCoreApplication::translate("time", "<html><head/><body><p>Types: Absolute defined time or Relative to actual time</p></body></html>", nullptr));

View File

@@ -12,7 +12,7 @@ assets::assets(openspace::Profile* imported, const std::string reportAssets, QWi
: QDialog(parent)
, ui(new Ui::assets)
, _imported(imported)
, _assetTreeModel(tr("Asset"), tr("Enabled"), tr("Var Name"))
, _assetTreeModel(tr("Asset"), tr("Enabled"), tr("Variable Name"))
{
ui->setupUi(this);

View File

@@ -141,6 +141,7 @@ void deltaTimes::addDeltaTimeValue() {
ui->listWidget->addItem(new QListWidgetItem(messageAddValue));
}
ui->listWidget->setCurrentRow(ui->listWidget->count() - 1);
ui->line_seconds->setFocus(Qt::OtherFocusReason);
_editModeNewItem = true;
}
@@ -215,6 +216,7 @@ void deltaTimes::transitionToEditMode(void) {
ui->button_save->setDisabled(false);
ui->buttonBox->setDisabled(true);
ui->line_seconds->setFocus(Qt::OtherFocusReason);
editBoxDisabled(false);
}
@@ -226,6 +228,7 @@ void deltaTimes::transitionFromEditMode(void) {
ui->button_save->setDisabled(true);
ui->buttonBox->setDisabled(false);
ui->button_add->setFocus(Qt::OtherFocusReason);
editBoxDisabled(true);
ui->label_adjust->setText("<font color='black'>Set Delta Time</font>");
}
@@ -263,7 +266,16 @@ deltaTimes::~deltaTimes() {
void deltaTimes::keyPressEvent(QKeyEvent *evt)
{
if(evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return)
return;
if(evt->key() == Qt::Key_Enter || evt->key() == Qt::Key_Return) {
if (_editModeNewItem) {
saveDeltaTimeValue();
return;
}
else {
addDeltaTimeValue();
return;
}
}
QDialog::keyPressEvent(evt);
}