[kde-doc-english] [kstars] kstars/tools: In the Eyepiece View feature, let the user select the FOV to use
Akarsh Simha
akarsh at kde.org
Wed Jan 6 08:57:49 UTC 2016
Git commit 088081626967cd1e6416def2bd097634d4e5e4ba by Akarsh Simha.
Committed on 06/01/2016 at 05:22.
Pushed by asimha into branch 'master'.
In the Eyepiece View feature, let the user select the FOV to use
A input dialog is first shown, which asks the user to select one of
the visible FOVs to use as a FOV for the eyepiece view. The user also
has the option of trying to determine it from the image (accurate if
image has metadata, will be "random" otherwise)
GUI:
M +19 -1 kstars/tools/observinglist.cpp
http://commits.kde.org/kstars/088081626967cd1e6416def2bd097634d4e5e4ba
diff --git a/kstars/tools/observinglist.cpp b/kstars/tools/observinglist.cpp
index ffa7086..1490d24 100644
--- a/kstars/tools/observinglist.cpp
+++ b/kstars/tools/observinglist.cpp
@@ -44,6 +44,7 @@
#include "oal/oal.h"
#include "oal/execute.h"
#include "tools/eyepiecefield.h"
+#include "fov.h"
#include <config-kstars.h>
@@ -73,6 +74,7 @@
#include <QStandardPaths>
#include <QTextEdit>
#include <QLineEdit>
+#include <QInputDialog>
#include <cstdio>
@@ -674,7 +676,23 @@ void ObservingList::slotEyepieceView() {
imagePath = CurrentImagePath;
else if( QFile::exists( CurrentTempPath ) )
imagePath = CurrentTempPath;
- m_epf->showEyepieceField( currentObject(), 0, imagePath ); // FIXME: Use FOV symbols etc.
+
+ KStarsData *data = KStarsData::Instance();
+ bool ok = true;
+ const FOV *fov;
+ if( !data->getVisibleFOVs().isEmpty() ) {
+ // Ask the user to choose from a list of available FOVs.
+ int index;
+ const FOV *f;
+ QMap< QString, const FOV * > nameToFovMap;
+ foreach( f, data->getVisibleFOVs() ) {
+ nameToFovMap.insert( f->name(), f );
+ }
+ nameToFovMap.insert( i18n("Attempt to determine from image"), 0 );
+ fov = nameToFovMap[ QInputDialog::getItem( this, i18n("Eyepiece View: Choose a field-of-view"), i18n("FOV to render eyepiece view for:"), nameToFovMap.uniqueKeys(), 0, false, &ok ) ];
+ }
+ if( ok )
+ m_epf->showEyepieceField( currentObject(), fov, imagePath );
}
void ObservingList::slotAVT() {
More information about the kde-doc-english
mailing list