Commit b70a9414 authored by Robert Lancaster's avatar Robert Lancaster Committed by Jasem Mutlaq

This patch will add the tracking feature option to Whats Interesting that I...

This patch will add the tracking feature option to Whats Interesting that I mentioned before as well as clarifying the auto center feature a bit.
parent 4f15bc70
......@@ -978,7 +978,7 @@ Rectangle {
verticalAlignment: Text.AlignVCenter
color: "white"
text: xi18n("Center in Map")
text: xi18n("Center in Map \n")
font {
underline: true
family: "Cantarell"
......@@ -996,14 +996,37 @@ Rectangle {
onExited: centerButton.color = (nightVision.state == "active") ? "red" : "white"
onClicked: centerButton.centerButtonClicked()
}
Text {
text: xi18n(" Auto Track ")
color: "white"
font {
family: "Cantarell"
pixelSize: 14
}
y: 15
}
CheckBox {
id: autoCenter
objectName: "autoCenterCheckbox"
x: 100
x: 37
y: 15
checked: true
}
CheckBox {
id: autoTrack
objectName: "autoTrackCheckbox"
x: 97
y: 15
checked: false
onClicked: centerButton.centerButtonClicked()
}
}
Text {
id: slewTelescopeButton
objectName: "slewTelescopeButtonObj"
......
......@@ -111,6 +111,9 @@ WIView::WIView(QWidget * parent) : QWidget(parent), m_CurrentObjectListName(-1)
m_CenterButtonObj = m_BaseObj->findChild<QQuickItem *>("centerButtonObj");
connect(m_CenterButtonObj, SIGNAL(centerButtonClicked()), this, SLOT(onCenterButtonClicked()));
autoCenterCheckbox = m_DetailsViewObj->findChild<QObject *>("autoCenterCheckbox");
autoTrackCheckbox = m_DetailsViewObj->findChild<QObject *>("autoTrackCheckbox");
m_SlewTelescopeButtonObj = m_BaseObj->findChild<QQuickItem *>("slewTelescopeButtonObj");
connect(m_SlewTelescopeButtonObj, SIGNAL(slewTelescopeButtonClicked()), this, SLOT(onSlewTelescopeButtonClicked()));
......@@ -280,11 +283,12 @@ void WIView::onCenterButtonClicked()
///Center map on selected sky-object
SkyObject * so = m_CurSoItem->getSkyObject();
KStars * kstars = KStars::Instance();
if (so != 0)
if (so)
{
kstars->map()->setFocusPoint(so);
kstars->map()->setFocusObject(so);
kstars->map()->setDestination(*kstars->map()->focusPoint());
Options::setIsTracking(autoTrackCheckbox->property("checked")==true);
}
}
......@@ -491,7 +495,7 @@ void WIView::loadDetailsView(SkyObjItem * soitem, int index)
QObject * posTextObj = m_DetailsViewObj->findChild<QObject *>("posTextObj");
QObject * detailImage = m_DetailsViewObj->findChild<QObject *>("detailImage");
QObject * detailsTextObj = m_DetailsViewObj->findChild<QObject *>("detailsTextObj");
QObject * autoCenterCheckBox = m_DetailsViewObj->findChild<QObject *>("autoCenterCheckbox");
sonameObj->setProperty("text", soitem->getDescName());
posTextObj->setProperty("text", soitem->getPosition());
......@@ -517,7 +521,7 @@ void WIView::loadDetailsView(SkyObjItem * soitem, int index)
QString details = summary + "<BR>" + sbText + "<BR>" + magText + "<BR>" + sizeText;
detailsTextObj->setProperty("text", details);
if(autoCenterCheckBox->property("checked")==true){
if(autoCenterCheckbox->property("checked")==true){
QTimer::singleShot(500, this, SLOT(onCenterButtonClicked()));
}
......
......@@ -151,9 +151,9 @@ class WIView : public QWidget
private:
QQuickItem * m_BaseObj, *m_ViewsRowObj, *m_CategoryTitle, *m_SoListObj, *m_DetailsViewObj, *m_skyObjView, *m_ContainerObj, *m_ProgressBar, *m_loadingMessage,
*m_NextObj, *m_PrevObj, *m_CenterButtonObj, *m_SlewTelescopeButtonObj, *m_DetailsButtonObj, * inspectIconObj, * visibleIconObj, * favoriteIconObj;
*m_NextObj, *m_PrevObj, *m_CenterButtonObj, *m_SlewTelescopeButtonObj, *m_DetailsButtonObj, * inspectIconObj, * visibleIconObj, * favoriteIconObj;
QQmlContext * m_Ctxt;
QObject * infoBoxText, * descTextObj, * nightVision;
QObject * infoBoxText, * descTextObj, * nightVision, *autoTrackCheckbox, *autoCenterCheckbox;
QQuickView * m_BaseView;
ObsConditions * m_Obs = nullptr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment