Changeset View
Changeset View
Standalone View
Standalone View
kstars/fitsviewer/fitsviewer.cpp
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | 87 | #endif | |||
---|---|---|---|---|---|
144 | connect(action, SIGNAL(triggered(bool)), SLOT(headerFITS())); | 144 | connect(action, SIGNAL(triggered(bool)), SLOT(headerFITS())); | ||
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"); | | |||
153 | action->setText(i18n("Toggle Auto stretch")); | | |||
154 | action->setCheckable(true); | | |||
155 | connect(action, SIGNAL(triggered(bool)), SLOT(toggleStretch())); | | |||
156 | actionCollection()->setDefaultShortcut(action, QKeySequence::SelectAll); | | |||
157 | action->setIcon(QIcon::fromTheme("transform-move")); | | |||
158 | | ||||
159 | action = KStandardAction::close(this, SLOT(close()), actionCollection()); | 152 | action = KStandardAction::close(this, SLOT(close()), actionCollection()); | ||
160 | action->setIcon(QIcon::fromTheme("window-close")); | 153 | action->setIcon(QIcon::fromTheme("window-close")); | ||
161 | 154 | | |||
162 | action = KStandardAction::copy(this, SLOT(copyFITS()), actionCollection()); | 155 | action = KStandardAction::copy(this, SLOT(copyFITS()), actionCollection()); | ||
163 | action->setIcon(QIcon::fromTheme("edit-copy")); | 156 | action->setIcon(QIcon::fromTheme("edit-copy")); | ||
164 | 157 | | |||
165 | action = KStandardAction::zoomIn(this, SLOT(ZoomIn()), actionCollection()); | 158 | action = KStandardAction::zoomIn(this, SLOT(ZoomIn()), actionCollection()); | ||
166 | action->setIcon(QIcon::fromTheme("zoom-in")); | 159 | action->setIcon(QIcon::fromTheme("zoom-in")); | ||
▲ Show 20 Lines • Show All 226 Lines • ▼ Show 20 Line(s) | 368 | break; | |||
393 | tab->setUID(fitsID); | 386 | tab->setUID(fitsID); | ||
394 | 387 | | |||
395 | led.setColor(Qt::green); | 388 | led.setColor(Qt::green); | ||
396 | 389 | | |||
397 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | 390 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | ||
398 | 391 | | |||
399 | tab->getView()->setCursorMode(FITSView::dragCursor); | 392 | tab->getView()->setCursorMode(FITSView::dragCursor); | ||
400 | 393 | | |||
401 | updateButtonStatus("image_stretch", i18n("Toggle Auto stretch"), tab->getView()->isImageStretched()); | | |||
402 | | ||||
403 | updateWCSFunctions(); | 394 | updateWCSFunctions(); | ||
404 | 395 | | |||
405 | return true; | 396 | return true; | ||
406 | } | 397 | } | ||
407 | 398 | | |||
408 | void FITSViewer::addFITS(const QUrl &imageName, FITSMode mode, FITSScale filter, const QString &previewText, bool silent) | 399 | void FITSViewer::addFITS(const QUrl &imageName, FITSMode mode, FITSScale filter, const QString &previewText, bool silent) | ||
409 | { | 400 | { | ||
410 | led.setColor(Qt::yellow); | 401 | led.setColor(Qt::yellow); | ||
▲ Show 20 Lines • Show All 180 Lines • ▼ Show 20 Line(s) | 549 | { | |||
591 | updateStatusBar("", FITS_WCS); | 582 | updateStatusBar("", FITS_WCS); | ||
592 | connect(view,&FITSView::starProfileWindowClosed, this, &FITSViewer::starProfileButtonOff); | 583 | connect(view,&FITSView::starProfileWindowClosed, this, &FITSViewer::starProfileButtonOff); | ||
593 | updateButtonStatus("toggle_3D_graph", i18n("View 3D Graph"), getCurrentView()->isStarProfileShown()); | 584 | updateButtonStatus("toggle_3D_graph", i18n("View 3D Graph"), getCurrentView()->isStarProfileShown()); | ||
594 | updateButtonStatus("view_crosshair", i18n("Cross Hairs"), getCurrentView()->isCrosshairShown()); | 585 | updateButtonStatus("view_crosshair", i18n("Cross Hairs"), getCurrentView()->isCrosshairShown()); | ||
595 | updateButtonStatus("view_eq_grid", i18n("Equatorial Gridines"), getCurrentView()->isEQGridShown()); | 586 | updateButtonStatus("view_eq_grid", i18n("Equatorial Gridines"), getCurrentView()->isEQGridShown()); | ||
596 | updateButtonStatus("view_objects", i18n("Objects in Image"), getCurrentView()->areObjectsShown()); | 587 | updateButtonStatus("view_objects", i18n("Objects in Image"), getCurrentView()->areObjectsShown()); | ||
597 | updateButtonStatus("view_pixel_grid", i18n("Pixel Gridlines"), getCurrentView()->isPixelGridShown()); | 588 | updateButtonStatus("view_pixel_grid", i18n("Pixel Gridlines"), getCurrentView()->isPixelGridShown()); | ||
598 | 589 | | |||
599 | fprintf(stderr, "Updating button status to %s\n", getCurrentView()->isImageStretched() ? "true" : "false"); | | |||
600 | updateButtonStatus("image_stretch", i18n("Toggle Auto stretch"), getCurrentView()->isImageStretched()); | | |||
601 | updateScopeButton(); | 590 | updateScopeButton(); | ||
602 | updateWCSFunctions(); | 591 | updateWCSFunctions(); | ||
603 | } | 592 | } | ||
604 | 593 | | |||
605 | void FITSViewer::starProfileButtonOff() | 594 | void FITSViewer::starProfileButtonOff() | ||
606 | { | 595 | { | ||
607 | updateButtonStatus("toggle_3D_graph", i18n("View 3D Graph"), false); | 596 | updateButtonStatus("toggle_3D_graph", i18n("View 3D Graph"), false); | ||
608 | } | 597 | } | ||
▲ Show 20 Lines • Show All 378 Lines • ▼ Show 20 Line(s) | 970 | { | |||
987 | qApp->processEvents(); | 976 | qApp->processEvents(); | ||
988 | fitsTabs[fitsTabWidget->currentIndex()]->getHistogram()->applyFilter(static_cast<FITSScale>(ftype)); | 977 | fitsTabs[fitsTabWidget->currentIndex()]->getHistogram()->applyFilter(static_cast<FITSScale>(ftype)); | ||
989 | qApp->processEvents(); | 978 | qApp->processEvents(); | ||
990 | fitsTabs[fitsTabWidget->currentIndex()]->getView()->updateFrame(); | 979 | fitsTabs[fitsTabWidget->currentIndex()]->getView()->updateFrame(); | ||
991 | QApplication::restoreOverrideCursor(); | 980 | QApplication::restoreOverrideCursor(); | ||
992 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | 981 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | ||
993 | } | 982 | } | ||
994 | 983 | | |||
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 | | ||||
1012 | FITSView *FITSViewer::getView(int fitsUID) | 984 | FITSView *FITSViewer::getView(int fitsUID) | ||
1013 | { | 985 | { | ||
1014 | FITSTab *tab = fitsMap.value(fitsUID); | 986 | FITSTab *tab = fitsMap.value(fitsUID); | ||
1015 | 987 | | |||
1016 | if (tab) | 988 | if (tab) | ||
1017 | return tab->getView(); | 989 | return tab->getView(); | ||
1018 | 990 | | |||
1019 | return nullptr; | 991 | return nullptr; | ||
Show All 14 Lines |