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 | connect(action, SIGNAL(triggered(bool)), SLOT(toggleStretch())); | ||
155 | actionCollection()->setDefaultShortcut(action, QKeySequence::SelectAll); | 155 | actionCollection()->setDefaultShortcut(action, QKeySequence::SelectAll); | ||
156 | action->setIcon(QIcon::fromTheme("transform-move")); | 156 | action->setIcon(QIcon::fromTheme("transform-move")); | ||
157 | 157 | | |||
158 | action = KStandardAction::close(this, SLOT(close()), actionCollection()); | 158 | action = KStandardAction::close(this, SLOT(close()), actionCollection()); | ||
159 | action->setIcon(QIcon::fromTheme("window-close")); | 159 | action->setIcon(QIcon::fromTheme("window-close")); | ||
160 | 160 | | |||
161 | action = KStandardAction::copy(this, SLOT(copyFITS()), actionCollection()); | 161 | action = KStandardAction::copy(this, SLOT(copyFITS()), actionCollection()); | ||
162 | action->setIcon(QIcon::fromTheme("edit-copy")); | 162 | action->setIcon(QIcon::fromTheme("edit-copy")); | ||
▲ Show 20 Lines • Show All 497 Lines • ▼ Show 20 Line(s) | |||||
660 | void FITSViewer::statFITS() | 660 | void FITSViewer::statFITS() | ||
661 | { | 661 | { | ||
662 | if (fitsTabs.empty()) | 662 | if (fitsTabs.empty()) | ||
663 | return; | 663 | return; | ||
664 | 664 | | |||
665 | fitsTabs[fitsTabWidget->currentIndex()]->statFITS(); | 665 | fitsTabs[fitsTabWidget->currentIndex()]->statFITS(); | ||
666 | } | 666 | } | ||
667 | 667 | | |||
668 | void FITSViewer::stretchFITS() | | |||
669 | { | | |||
670 | applyFilter(FITS_AUTO_STRETCH); | | |||
671 | } | | |||
672 | | ||||
673 | void FITSViewer::rotateCW() | 668 | void FITSViewer::rotateCW() | ||
674 | { | 669 | { | ||
675 | applyFilter(FITS_ROTATE_CW); | 670 | applyFilter(FITS_ROTATE_CW); | ||
676 | } | 671 | } | ||
677 | 672 | | |||
678 | void FITSViewer::rotateCCW() | 673 | void FITSViewer::rotateCCW() | ||
679 | { | 674 | { | ||
680 | applyFilter(FITS_ROTATE_CCW); | 675 | applyFilter(FITS_ROTATE_CCW); | ||
▲ Show 20 Lines • Show All 305 Lines • ▼ Show 20 Line(s) | 975 | { | |||
986 | qApp->processEvents(); | 981 | qApp->processEvents(); | ||
987 | fitsTabs[fitsTabWidget->currentIndex()]->getHistogram()->applyFilter(static_cast<FITSScale>(ftype)); | 982 | fitsTabs[fitsTabWidget->currentIndex()]->getHistogram()->applyFilter(static_cast<FITSScale>(ftype)); | ||
988 | qApp->processEvents(); | 983 | qApp->processEvents(); | ||
989 | fitsTabs[fitsTabWidget->currentIndex()]->getView()->updateFrame(); | 984 | fitsTabs[fitsTabWidget->currentIndex()]->getView()->updateFrame(); | ||
990 | QApplication::restoreOverrideCursor(); | 985 | QApplication::restoreOverrideCursor(); | ||
991 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | 986 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | ||
992 | } | 987 | } | ||
993 | 988 | | |||
989 | void FITSViewer::toggleStretch() | ||||
990 | { | ||||
991 | if (fitsTabs.empty()) | ||||
992 | return; | ||||
993 | | ||||
994 | QApplication::setOverrideCursor(Qt::WaitCursor); | ||||
995 | updateStatusBar(i18n("Processing toggle stretch"), FITS_MESSAGE); | ||||
996 | qApp->processEvents(); | ||||
997 | fitsTabs[fitsTabWidget->currentIndex()]->getView()->toggleStretch(); | ||||
998 | QApplication::restoreOverrideCursor(); | ||||
999 | updateStatusBar(i18n("Ready."), FITS_MESSAGE); | ||||
1000 | } | ||||
1001 | | ||||
994 | FITSView *FITSViewer::getView(int fitsUID) | 1002 | FITSView *FITSViewer::getView(int fitsUID) | ||
995 | { | 1003 | { | ||
996 | FITSTab *tab = fitsMap.value(fitsUID); | 1004 | FITSTab *tab = fitsMap.value(fitsUID); | ||
997 | 1005 | | |||
998 | if (tab) | 1006 | if (tab) | ||
999 | return tab->getView(); | 1007 | return tab->getView(); | ||
1000 | 1008 | | |||
1001 | return nullptr; | 1009 | return nullptr; | ||
Show All 14 Lines |