Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Feb 26, 2024
1 parent 31ee36b commit 4ce5719
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/SearchDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ void SearchDialog::createDialogContent()
connect(ui->AxisXSpinBox, SIGNAL(valueChanged()), this, SLOT(manualPositionChanged()));
connect(ui->AxisYSpinBox, SIGNAL(valueChanged()), this, SLOT(manualPositionChanged()));
connect(ui->goPushButton, SIGNAL(clicked(bool)), this, SLOT(manualPositionChanged()));
// following the current direction of FOV
connect(GETSTELMODULE(StelMovementMgr), SIGNAL(currentDirectionChanged()), this, SLOT(setCenterOfScreenCoordinates()));
setCenterOfScreenCoordinates();

Expand Down Expand Up @@ -680,6 +681,7 @@ void SearchDialog::setCenterOfScreenCoordinates()
projector->unProject(centerScreen[0], centerScreen[1], centerPos);
double spinLong, spinLat;

// Getting coordinates (in radians) of position of the center of the screen
switch (getCurrentCoordinateSystem())
{
case equatorialJ2000:
Expand Down Expand Up @@ -724,12 +726,15 @@ void SearchDialog::setCenterOfScreenCoordinates()
}
}

// disable following the changes of spinbox
ui->AxisXSpinBox->blockSignals(true);
ui->AxisYSpinBox->blockSignals(true);

// set coordinates in spinboxes
ui->AxisXSpinBox->setRadians(spinLong);
ui->AxisYSpinBox->setRadians(spinLat);

// restore following the changes of spinbox
ui->AxisXSpinBox->blockSignals(false);
ui->AxisYSpinBox->blockSignals(false);
}
Expand Down
1 change: 1 addition & 0 deletions src/gui/SearchDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ private slots:
//! Clear recent list's data
void recentSearchClearDataClicked();

//! Setting coordinates of the center of screen in spinboxes (following axes of current coordinate system)
void setCenterOfScreenCoordinates();

private:
Expand Down

0 comments on commit 4ce5719

Please sign in to comment.