From c7ddf47b3a4f35eedf36b7cc0e97760a56d7daff Mon Sep 17 00:00:00 2001 From: Robert Lancaster Date: Tue, 20 Oct 2020 16:30:09 -0400 Subject: [PATCH] Fixing a bug in the getAstrometryDataDirs function. Adding descriptions for the profiles --- kstars/auxiliary/ksutils.cpp | 4 ++-- kstars/ekos/align/optionsprofileeditor.cpp | 7 ++++++- kstars/ekos/align/optionsprofileeditor.ui | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/kstars/auxiliary/ksutils.cpp b/kstars/auxiliary/ksutils.cpp index 288c1a3d7..9b2b35796 100644 --- a/kstars/auxiliary/ksutils.cpp +++ b/kstars/auxiliary/ksutils.cpp @@ -1488,8 +1488,8 @@ QStringList getAstrometryDataDirs() } else { - //This removes directories that do not exist. - optionsDataDir.remove(optionsDataDirs.at(dir)); + //This removes directories that do not exist from the list. + optionsDataDirs.removeAt(dir); dir--; updated = true; } diff --git a/kstars/ekos/align/optionsprofileeditor.cpp b/kstars/ekos/align/optionsprofileeditor.cpp index ac8281873..705092e7b 100644 --- a/kstars/ekos/align/optionsprofileeditor.cpp +++ b/kstars/ekos/align/optionsprofileeditor.cpp @@ -80,6 +80,8 @@ OptionsProfileEditor::OptionsProfileEditor(QWidget *parent, bool showSolveOption astrometryOptions->setVisible(false); connect(m_ConfigDialog->button(QDialogButtonBox::Apply), SIGNAL(clicked()), SLOT(slotApply())); connect(m_ConfigDialog->button(QDialogButtonBox::Ok), SIGNAL(clicked()), SLOT(slotApply())); + + loadOptionsProfile(); } void OptionsProfileEditor::connectOptionsProfileComboBox() @@ -136,6 +138,7 @@ SSolver::Parameters OptionsProfileEditor::getSettingsFromUI() { SSolver::Parameters params; params.listName = "Custom"; + params.description = description->toPlainText(); //These are to pass the parameters to the internal sextractor params.apertureShape = (SSolver::Shape) apertureShape->currentIndex(); params.kron_fact = kron_fact->text().toDouble(); @@ -178,6 +181,8 @@ SSolver::Parameters OptionsProfileEditor::getSettingsFromUI() void OptionsProfileEditor::sendSettingsToUI(SSolver::Parameters a) { + + description->setText(a.description); //Sextractor Settings apertureShape->setCurrentIndex(a.apertureShape); @@ -327,7 +332,7 @@ void OptionsProfileEditor::slotApply() int index = optionsProfile->currentIndex(); SSolver::Parameters currentParams = getSettingsFromUI(); SSolver::Parameters savedParams = optionsList.at(index); - if(!(currentParams == savedParams)) + if(!(currentParams == savedParams) || currentParams.description != savedParams.description) { currentParams.listName = savedParams.listName; optionsList.replace(index, currentParams); diff --git a/kstars/ekos/align/optionsprofileeditor.ui b/kstars/ekos/align/optionsprofileeditor.ui index 6074ce889..fcf7b6b82 100644 --- a/kstars/ekos/align/optionsprofileeditor.ui +++ b/kstars/ekos/align/optionsprofileeditor.ui @@ -7,7 +7,7 @@ 0 0 589 - 684 + 733 @@ -119,6 +119,19 @@ + + + + + 16777215 + 50 + + + + Description of the selected profile + + + -- GitLab