diff --git a/kstars/fitsviewer/fitsview.cpp b/kstars/fitsviewer/fitsview.cpp index a96c61e1f00aa634ad256e9305afe39d3235c076..d9c86d867e89d48a20e238d0c3c3da8276e54d26 100644 --- a/kstars/fitsviewer/fitsview.cpp +++ b/kstars/fitsviewer/fitsview.cpp @@ -1151,6 +1151,7 @@ void FITSView::toggleEQGrid() if(image_frame) updateFrame(); } + void FITSView::toggleObjects() { showObjects=!showObjects; @@ -1159,6 +1160,13 @@ void FITSView::toggleObjects() } +void FITSView::toggleStars() +{ + toggleStars(!markStars); + if(image_frame) + updateFrame(); +} + void FITSView::togglePixelGrid() { showPixelGrid=!showPixelGrid; @@ -1442,6 +1450,9 @@ void FITSView::createFloatingToolBar() action = floatingToolBar->addAction(QIcon::fromTheme("kstars_grid", QIcon(":/icons/breeze/default/kstars_grid.svg")), i18n("Show Equatorial Gridlines"), this, SLOT(toggleEQGrid())); action->setCheckable(true); + action = floatingToolBar->addAction(QIcon::fromTheme("kstars_stars", QIcon(":/icons/breeze/default/kstars_stars.svg")), i18n("Detect Stars in Image"), this, SLOT(toggleStars())); + action->setCheckable(true); + action = floatingToolBar->addAction(QIcon::fromTheme("help-hint", QIcon(":/icons/breeze/default/help-hint.svg")), i18n("Show Objects in Image"), this, SLOT(toggleObjects())); action->setCheckable(true); @@ -1522,3 +1533,19 @@ bool FITSView::isTelescopeActive() return false; #endif } + +void FITSView::setStarsEnabled(bool enable) +{ + markStars = enable; + if (floatingToolBar) + { + foreach(QAction *action, floatingToolBar->actions()) + { + if (action->text() == i18n("Detect Stars in Image")) + { + action->setChecked(markStars); + break; + } + } + } +} diff --git a/kstars/fitsviewer/fitsview.h b/kstars/fitsviewer/fitsview.h index f8e6862d266bfd6d60dddebb4eedbebd986b98ae..1481d896793c4bf3f591dee3c090140804c775e4 100644 --- a/kstars/fitsviewer/fitsview.h +++ b/kstars/fitsviewer/fitsview.h @@ -140,10 +140,7 @@ class FITSView : public QScrollArea // Star Detection int findStars(StarAlgorithm algorithm = ALGORITHM_CENTROID); void toggleStars(bool enable); - void setStarsEnabled(bool enable) - { - markStars = enable; - } + void setStarsEnabled(bool enable); // FITS Mode void updateMode(FITSMode mode); @@ -195,6 +192,9 @@ protected: void togglePixelGrid(); void toggleCrosshair(); + // Stars + void toggleStars(); + void centerTelescope(); void processPointSelection(int x, int y); @@ -235,11 +235,11 @@ protected: double maxPixel, minPixel; bool firstLoad; - bool markStars; + bool markStars=false; bool showCrosshair=false; bool showObjects=false; bool showEQGrid=false; - bool showPixelGrid=false; + bool showPixelGrid=false; bool starsSearched=false; QPointF getPointForGridLabel();