Changeset View
Changeset View
Standalone View
Standalone View
kstars/fitsviewer/fitsviewer.cpp
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Line(s) | 87 | #endif | |||
---|---|---|---|---|---|
145 | 145 | | |||
146 | action = actionCollection()->addAction("fits_debayer"); | 146 | action = actionCollection()->addAction("fits_debayer"); | ||
147 | actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::Key_D)); | 147 | actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::Key_D)); | ||
148 | action->setIcon(QIcon::fromTheme("view-preview")); | 148 | action->setIcon(QIcon::fromTheme("view-preview")); | ||
149 | action->setText(i18n("Debayer...")); | 149 | action->setText(i18n("Debayer...")); | ||
150 | connect(action, SIGNAL(triggered(bool)), SLOT(debayerFITS())); | 150 | connect(action, SIGNAL(triggered(bool)), SLOT(debayerFITS())); | ||
151 | 151 | | |||
152 | action = actionCollection()->addAction("image_stretch"); | 152 | action = actionCollection()->addAction("image_stretch"); | ||
153 | action->setText(i18n("Auto stretch")); | 153 | action->setText(i18n("Toggle Auto stretch")); | ||
154 | connect(action, SIGNAL(triggered(bool)), SLOT(stretchFITS())); | 154 | action->setCheckable(true); | ||
155 | connect(action, SIGNAL(triggered(bool)), SLOT(toggleStretch())); | ||||
155 | actionCollection()->setDefaultShortcut(action, QKeySequence::SelectAll); | 156 | actionCollection()->setDefaultShortcut(action, QKeySequence::SelectAll); | ||
156 | action->setIcon(QIcon::fromTheme("transform-move")); | 157 | action->setIcon(QIcon::fromTheme("transform-move")); | ||
157 | 158 | | |||
158 | action = KStandardAction::close(this, SLOT(close()), actionCollection()); | 159 | action = KStandardAction::close(this, SLOT(close()), actionCollection()); | ||
159 | action->setIcon(QIcon::fromTheme("window-close")); | 160 | action->setIcon(QIcon::fromTheme("window-close")); | ||
160 | 161 | | |||
161 | action = KStandardAction::copy(this, SLOT(copyFITS()), actionCollection()); | 162 | action = KStandardAction::copy(this, SLOT(copyFITS()), actionCollection()); | ||
162 | action->setIcon(QIcon::fromTheme("edit-copy")); | 163 | action->setIcon(QIcon::fromTheme("edit-copy")); | ||
▲ Show 20 Lines • Show All 229 Lines • ▼ Show 20 Line(s) | 375 | break; | |||
392 | tab->setUID(fitsID); | 393 | tab->setUID(fitsID); | ||
393 | 394 | | |||
394 | led.setColor(Qt::green); | 395 | led.setColor(Qt::green); | ||
395 | 396 | | |||
396 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | 397 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | ||
397 | 398 | | |||
398 | tab->getView()->setCursorMode(FITSView::dragCursor); | 399 | tab->getView()->setCursorMode(FITSView::dragCursor); | ||
399 | 400 | | |||
401 | updateButtonStatus("image_stretch", i18n("Toggle Auto stretch"), tab->getView()->isImageStretched()); | ||||
402 | | ||||
400 | updateWCSFunctions(); | 403 | updateWCSFunctions(); | ||
401 | 404 | | |||
402 | return true; | 405 | return true; | ||
403 | } | 406 | } | ||
404 | 407 | | |||
405 | void FITSViewer::addFITS(const QUrl &imageName, FITSMode mode, FITSScale filter, const QString &previewText, bool silent) | 408 | void FITSViewer::addFITS(const QUrl &imageName, FITSMode mode, FITSScale filter, const QString &previewText, bool silent) | ||
406 | { | 409 | { | ||
407 | led.setColor(Qt::yellow); | 410 | led.setColor(Qt::yellow); | ||
▲ Show 20 Lines • Show All 179 Lines • ▼ Show 20 Line(s) | 558 | { | |||
587 | 590 | | |||
588 | updateStatusBar("", FITS_WCS); | 591 | updateStatusBar("", FITS_WCS); | ||
589 | connect(view,&FITSView::starProfileWindowClosed, this, &FITSViewer::starProfileButtonOff); | 592 | connect(view,&FITSView::starProfileWindowClosed, this, &FITSViewer::starProfileButtonOff); | ||
590 | updateButtonStatus("toggle_3D_graph", i18n("View 3D Graph"), getCurrentView()->isStarProfileShown()); | 593 | updateButtonStatus("toggle_3D_graph", i18n("View 3D Graph"), getCurrentView()->isStarProfileShown()); | ||
591 | updateButtonStatus("view_crosshair", i18n("Cross Hairs"), getCurrentView()->isCrosshairShown()); | 594 | updateButtonStatus("view_crosshair", i18n("Cross Hairs"), getCurrentView()->isCrosshairShown()); | ||
592 | updateButtonStatus("view_eq_grid", i18n("Equatorial Gridines"), getCurrentView()->isEQGridShown()); | 595 | updateButtonStatus("view_eq_grid", i18n("Equatorial Gridines"), getCurrentView()->isEQGridShown()); | ||
593 | updateButtonStatus("view_objects", i18n("Objects in Image"), getCurrentView()->areObjectsShown()); | 596 | updateButtonStatus("view_objects", i18n("Objects in Image"), getCurrentView()->areObjectsShown()); | ||
594 | updateButtonStatus("view_pixel_grid", i18n("Pixel Gridlines"), getCurrentView()->isPixelGridShown()); | 597 | updateButtonStatus("view_pixel_grid", i18n("Pixel Gridlines"), getCurrentView()->isPixelGridShown()); | ||
598 | | ||||
599 | fprintf(stderr, "Updating button status to %s\n", getCurrentView()->isImageStretched() ? "true" : "false"); | ||||
600 | updateButtonStatus("image_stretch", i18n("Toggle Auto stretch"), getCurrentView()->isImageStretched()); | ||||
595 | updateScopeButton(); | 601 | updateScopeButton(); | ||
596 | updateWCSFunctions(); | 602 | updateWCSFunctions(); | ||
597 | } | 603 | } | ||
598 | 604 | | |||
599 | void FITSViewer::starProfileButtonOff() | 605 | void FITSViewer::starProfileButtonOff() | ||
600 | { | 606 | { | ||
601 | updateButtonStatus("toggle_3D_graph", i18n("View 3D Graph"), false); | 607 | updateButtonStatus("toggle_3D_graph", i18n("View 3D Graph"), false); | ||
602 | } | 608 | } | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | |||||
660 | void FITSViewer::statFITS() | 666 | void FITSViewer::statFITS() | ||
661 | { | 667 | { | ||
662 | if (fitsTabs.empty()) | 668 | if (fitsTabs.empty()) | ||
663 | return; | 669 | return; | ||
664 | 670 | | |||
665 | fitsTabs[fitsTabWidget->currentIndex()]->statFITS(); | 671 | fitsTabs[fitsTabWidget->currentIndex()]->statFITS(); | ||
666 | } | 672 | } | ||
667 | 673 | | |||
668 | void FITSViewer::stretchFITS() | | |||
669 | { | | |||
670 | applyFilter(FITS_AUTO_STRETCH); | | |||
671 | } | | |||
672 | | ||||
673 | void FITSViewer::rotateCW() | 674 | void FITSViewer::rotateCW() | ||
674 | { | 675 | { | ||
675 | applyFilter(FITS_ROTATE_CW); | 676 | applyFilter(FITS_ROTATE_CW); | ||
676 | } | 677 | } | ||
677 | 678 | | |||
678 | void FITSViewer::rotateCCW() | 679 | void FITSViewer::rotateCCW() | ||
679 | { | 680 | { | ||
680 | applyFilter(FITS_ROTATE_CCW); | 681 | applyFilter(FITS_ROTATE_CCW); | ||
▲ Show 20 Lines • Show All 305 Lines • ▼ Show 20 Line(s) | 981 | { | |||
986 | qApp->processEvents(); | 987 | qApp->processEvents(); | ||
987 | fitsTabs[fitsTabWidget->currentIndex()]->getHistogram()->applyFilter(static_cast<FITSScale>(ftype)); | 988 | fitsTabs[fitsTabWidget->currentIndex()]->getHistogram()->applyFilter(static_cast<FITSScale>(ftype)); | ||
988 | qApp->processEvents(); | 989 | qApp->processEvents(); | ||
989 | fitsTabs[fitsTabWidget->currentIndex()]->getView()->updateFrame(); | 990 | fitsTabs[fitsTabWidget->currentIndex()]->getView()->updateFrame(); | ||
990 | QApplication::restoreOverrideCursor(); | 991 | QApplication::restoreOverrideCursor(); | ||
991 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | 992 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | ||
992 | } | 993 | } | ||
993 | 994 | | |||
995 | void FITSViewer::toggleStretch() | ||||
996 | { | ||||
997 | if (fitsTabs.empty()) | ||||
998 | return; | ||||
999 | | ||||
1000 | QApplication::setOverrideCursor(Qt::WaitCursor); | ||||
1001 | updateStatusBar(i18n("Processing toggle stretch"), FITS_MESSAGE); | ||||
1002 | qApp->processEvents(); | ||||
1003 | fitsTabs[fitsTabWidget->currentIndex()]->getView()->toggleStretch(); | ||||
1004 | | ||||
1005 | updateButtonStatus("image_stretch", i18n("Toggle Auto stretch"), | ||||
1006 | getCurrentView()->isImageStretched()); | ||||
1007 | | ||||
1008 | QApplication::restoreOverrideCursor(); | ||||
1009 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | ||||
1010 | } | ||||
1011 | | ||||
994 | FITSView *FITSViewer::getView(int fitsUID) | 1012 | FITSView *FITSViewer::getView(int fitsUID) | ||
995 | { | 1013 | { | ||
996 | FITSTab *tab = fitsMap.value(fitsUID); | 1014 | FITSTab *tab = fitsMap.value(fitsUID); | ||
997 | 1015 | | |||
998 | if (tab) | 1016 | if (tab) | ||
999 | return tab->getView(); | 1017 | return tab->getView(); | ||
1000 | 1018 | | |||
1001 | return nullptr; | 1019 | return nullptr; | ||
Show All 14 Lines |