summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander V. Wolf <aw@altspu.ru>2022-01-24 13:49:45 +0700
committerAlexander V. Wolf <aw@altspu.ru>2022-01-24 13:49:45 +0700
commit967d239c5a39c7b17220246f038471ad186c7244 (patch)
treebd526c367a741d3741a6e568c00afcdf6682fc4c
parent6114e33c643f1779454f7e85169f617525765e72 (diff)
Fixed jumping to position in search window (fix #2205)
-rw-r--r--src/gui/AngleSpinBox.cpp15
-rw-r--r--src/gui/SearchDialog.cpp5
2 files changed, 9 insertions, 11 deletions
diff --git a/src/gui/AngleSpinBox.cpp b/src/gui/AngleSpinBox.cpp
index 9c6513986e..7e48a06d53 100644
--- a/src/gui/AngleSpinBox.cpp
+++ b/src/gui/AngleSpinBox.cpp
@@ -97,7 +97,7 @@ AngleSpinBox::AngleSpinboxSection AngleSpinBox::getCurrentSection() const
}
cPosMin = cPosMax;
- cPosMax = str.indexOf(QRegularExpression(QString("[dh%1]").arg(QChar(176))), 0)+1;
+ cPosMax = str.indexOf(QRegularExpression("[dh°]"), 0)+1;
if (cursorPos >= cPosMin && cursorPos <= cPosMax) {
return SectionDegreesHours;
}
@@ -237,12 +237,12 @@ double AngleSpinBox::stringToDouble(QString input, QValidator::State* state, Pre
input = input.mid(1);
}
- QRegularExpression dmsRx("^\\s*(\\d+)\\s*[d\\x00b0](\\s*(\\d+(\\.\\d*)?)\\s*[m'](\\s*(\\d+(\\.\\d*)?)\\s*[s\"]\\s*)?)?$",
+ QRegularExpression dmsRx("^\\s*(\\d+)\\s*[d°](\\s*(\\d+(\\.\\d*)?)\\s*[m'](\\s*(\\d+(\\.\\d*)?)\\s*[s\"]\\s*)?)?$",
QRegularExpression::CaseInsensitiveOption);
QRegularExpression hmsRx("^\\s*(\\d+)\\s*h(\\s*(\\d+(\\.\\d*)?)\\s*[m'](\\s*(\\d+(\\.\\d*)?)\\s*[s\"]\\s*)?)?$",
QRegularExpression::CaseInsensitiveOption);
QRegularExpression decRx("^(\\d+(\\.\\d*)?)(\\s*[\\x00b0]\\s*)?$");
- QRegularExpression badRx("[^hdms0-9 \\x00b0'\"\\.]", QRegularExpression::CaseInsensitiveOption);
+ QRegularExpression badRx("[^hdms0-9 °'\"\\.]", QRegularExpression::CaseInsensitiveOption);
QRegularExpressionMatch dmsMatch=dmsRx.match(input);
QRegularExpressionMatch hmsMatch=hmsRx.match(input);
QRegularExpressionMatch decMatch=decRx.match(input);
@@ -424,8 +424,8 @@ void AngleSpinBox::formatText(void)
lineEdit()->setText(QString("%1%2d %3m %4s")
.arg(signInd).arg(d).arg(m).arg(s, 0, 'f', decimalPlaces, ' '));
else
- lineEdit()->setText(QString("%1%2%3 %4' %5\"")
- .arg(signInd).arg(d).arg(QChar(176)).arg(m)
+ lineEdit()->setText(QString("%1%2° %4' %5\"")
+ .arg(signInd).arg(d).arg(m)
.arg(s, 0, 'f', decimalPlaces, ' '));
break;
}
@@ -479,10 +479,9 @@ void AngleSpinBox::formatText(void)
signInd = negativePrefix(currentPrefixType);
}
- lineEdit()->setText(QString("%1%2%3")
+ lineEdit()->setText(QString("%1%2°")
.arg(signInd)
- .arg(fmod(angle * 180.0 / M_PI, 360.0), 0, 'f', decimalPlaces, ' ')
- .arg(QChar(176)));
+ .arg(fmod(angle * 180.0 / M_PI, 360.0), 0, 'f', decimalPlaces, ' '));
break;
}
default:
diff --git a/src/gui/SearchDialog.cpp b/src/gui/SearchDialog.cpp
index 9915b4fe24..dff3d0c931 100644
--- a/src/gui/SearchDialog.cpp
+++ b/src/gui/SearchDialog.cpp
@@ -660,8 +660,7 @@ void SearchDialog::manualPositionChanged()
searchListModel->clearValues();
StelCore* core = StelApp::getInstance().getCore();
StelMovementMgr* mvmgr = GETSTELMODULE(StelMovementMgr);
- Vec3d pos;
- Vec3d aimUp;
+ Vec3d pos;
double spinLong=ui->AxisXSpinBox->valueRadians();
double spinLat=ui->AxisYSpinBox->valueRadians();
@@ -669,7 +668,7 @@ void SearchDialog::manualPositionChanged()
// However, if those are identical, we have a problem when we want to look right into the pole. (e.g. zenith), which requires a special up vector.
// aimUp depends on MovementMgr::MountMode mvmgr->mountMode!
mvmgr->setViewUpVector(Vec3d(0., 0., 1.));
- aimUp=mvmgr->getViewUpVectorJ2000();
+ Vec3d aimUp = mvmgr->getViewUpVectorJ2000();
StelMovementMgr::MountMode mountMode=mvmgr->getMountMode();
switch (getCurrentCoordinateSystem())