Commit 1dd3381f authored by Robert Lancaster's avatar Robert Lancaster Committed by Jasem Mutlaq

This patch includes the previous 2. It also modifies the first screen of whats...

This patch includes the previous 2. It also modifies the first screen of whats interesting and adds Messier objects to the list. As a part of that, I also had to add a way to identify that the object was below the horizon.
parent 83430ff8
......@@ -30,12 +30,16 @@ ModelManager::ModelManager(ObsConditions * obs)
m_ConModel = new SkyObjListModel();
m_ClustModel = new SkyObjListModel();
m_NebModel = new SkyObjListModel();
m_MessierModel = new SkyObjListModel();
m_SharplessModel = new SkyObjListModel();
m_InitObjects[Star_Model] = QList<SkyObject *>();
m_InitObjects[Galaxy_Model] = QList<SkyObject *>();
m_InitObjects[Constellation_Model] = QList<SkyObject *>();
m_InitObjects[Cluster_Model] = QList<SkyObject *>();
m_InitObjects[Nebula_Model] = QList<SkyObject *>();
m_InitObjects[Messier_Model] = QList<SkyObject *>();
m_InitObjects[Sharpless_Model] = QList<SkyObject *>();
updateModels(obs);
}
......@@ -47,6 +51,8 @@ ModelManager::~ModelManager()
delete m_ConModel;
delete m_ClustModel;
delete m_NebModel;
delete m_MessierModel;
delete m_SharplessModel;
}
void ModelManager::updateModels(ObsConditions * obs)
......@@ -148,6 +154,21 @@ void ModelManager::updateModels(ObsConditions * obs)
m_PlanetsModel->addSkyObject(new SkyObjItem(so));
}
}
for(int i=1;i<=110;i++)
{
SkyObject * o;
if ((o = data->skyComposite()->findByName("M " + QString::number(i))))
m_MessierModel->addSkyObject(new SkyObjItem(o));
}
/**
for(int i=1;i<=350;i++)
{
SkyObject * o;
if ((o = data->skyComposite()->findByName("Sh2 " + QString::number(i))))
m_SharplessModel->addSkyObject(new SkyObjItem(o));
}
**/
}
void ModelManager::resetModels()
......@@ -158,6 +179,8 @@ void ModelManager::resetModels()
m_GalModel->resetModel();
m_ClustModel->resetModel();
m_NebModel->resetModel();
m_MessierModel->resetModel();
m_SharplessModel->resetModel();
}
SkyObjListModel * ModelManager::returnModel(int type)
......@@ -176,6 +199,10 @@ SkyObjListModel * ModelManager::returnModel(int type)
return m_ClustModel;
case 5: //Nebula type
return m_NebModel;
case 6: //Messier Objects
return m_MessierModel;
case 7: //Sharpless Objects
return m_SharplessModel;
default:
return 0;
}
......
......@@ -34,7 +34,7 @@ class ModelManager
* \enum ModelType
* \brief Model type for different types of sky-objects.
*/
enum ModelType {Planet_Model, Star_Model, Constellation_Model, Galaxy_Model, Cluster_Model, Nebula_Model};
enum ModelType {Planet_Model, Star_Model, Constellation_Model, Galaxy_Model, Cluster_Model, Nebula_Model, Messier_Model, Sharpless_Model};
/**
* \brief Constructor - Creates models for different sky-object types.
......@@ -66,7 +66,7 @@ class ModelManager
private:
ObsConditions * m_ObsConditions;
SkyObjListModel * m_PlanetsModel, *m_StarsModel, *m_GalModel, *m_ConModel, *m_ClustModel, *m_NebModel;
SkyObjListModel * m_PlanetsModel, *m_StarsModel, *m_GalModel, *m_ConModel, *m_ClustModel, *m_NebModel, *m_MessierModel, *m_SharplessModel;
QHash< ModelType, QList <SkyObject *> > m_InitObjects;
};
......
......@@ -63,7 +63,7 @@ Rectangle {
x: 0
y: 31
width: parent.width
height: 351
height: 500
Rectangle {
id: background
......@@ -87,6 +87,24 @@ Rectangle {
color: "black"
}
}
Item {
id: nakedEyeItem
width: nakedEyeText.width
height: nakedEyeText.height
anchors{
verticalCenterOffset: -180
horizontalCenterOffset: 0
centerIn: parent
}
CategoryTitle {
id: nakedEyeText
color: "yellow"
title: xi18n("Naked-Eye Objects")
anchors.centerIn: parent
}
}
Item {
id: planetItem
......@@ -178,7 +196,7 @@ Rectangle {
Item {
id: dsoContainer
y: 172
height: 166
height: 200
anchors {
right: parent.right
rightMargin: 35
......@@ -192,24 +210,16 @@ Rectangle {
height: dsoText.height
anchors {
verticalCenterOffset: -54
verticalCenterOffset: -30
horizontalCenterOffset: 0
centerIn: parent
}
CategoryTitle {
id: dsoText
color: "yellow"
title: xi18n("Deep-sky Objects")
anchors.centerIn: parent
MouseArea {
id: dsoMouseArea
hoverEnabled: true
anchors.fill: parent
onEntered: container.state = "dsoAreaEntered"
onClicked: container.state = "dsoAreaClicked"
}
}
}
......@@ -220,7 +230,7 @@ Rectangle {
height: galText.height
anchors {
verticalCenterOffset: -4
verticalCenterOffset: 26
horizontalCenterOffset: -77
centerIn: parent
}
......@@ -228,7 +238,6 @@ Rectangle {
CategoryTitle {
id: galText
color: disabledColor
title: xi18n("Galaxies")
anchors {
centerIn: parent
......@@ -237,8 +246,7 @@ Rectangle {
MouseArea {
id: galMouseArea
enabled: false
hoverEnabled: false
hoverEnabled: true
anchors.fill: parent
onEntered: container.state = "galAreaEntered"
onClicked: {
......@@ -256,7 +264,7 @@ Rectangle {
height: nebText.height
anchors {
verticalCenterOffset: 52
verticalCenterOffset: 82
horizontalCenterOffset: -17
centerIn: parent
}
......@@ -264,14 +272,12 @@ Rectangle {
CategoryTitle {
id: nebText
color: disabledColor
title: xi18n("Nebulae")
anchors.centerIn: parent
MouseArea {
id: nebMouseArea
enabled: false
hoverEnabled: false
hoverEnabled: true
anchors.fill: parent
onEntered: container.state = "nebAreaEntered"
onClicked: {
......@@ -289,7 +295,7 @@ Rectangle {
height: clustText.height
anchors {
verticalCenterOffset: 8
verticalCenterOffset: 38
horizontalCenterOffset: 69
centerIn: parent
}
......@@ -297,14 +303,12 @@ Rectangle {
CategoryTitle {
id: clustText
color: disabledColor
title: xi18n("Clusters")
anchors.centerIn: parent
MouseArea {
id: clustMouseArea
enabled: false
hoverEnabled: false
hoverEnabled: true
anchors.fill: parent
onEntered: container.state = "clustAreaEntered"
onClicked: {
......@@ -314,6 +318,83 @@ Rectangle {
}
}
}
Item {
id: catalogsItem
width: catalogText.width
height: catalogText.height
anchors{
verticalCenterOffset: 130
horizontalCenterOffset: 0
centerIn: parent
}
CategoryTitle {
id: catalogText
color: "yellow"
title: xi18n("Explore Catalogs")
anchors.centerIn: parent
}
}
Item {
id: messierItem
width: messierText.width
height: messierText.height
anchors {
verticalCenterOffset: 160
horizontalCenterOffset: 69
centerIn: parent
}
opacity: categoryTitleOpacity
CategoryTitle {
id: messierText
title: xi18n("Messier Objects")
anchors.centerIn: parent
MouseArea {
id: messierMouseArea
hoverEnabled: true
anchors.fill: parent
onEntered: container.state = "messierAreaEntered"
onClicked: {
viewsRow.categorySelected(6)
container.state = "dsoTypeSelected"
}
}
}
}
// Item {
// id: sh2Item
//
// width: sh2Text.width
// height: sh2Text.height
//
// anchors {
// verticalCenterOffset: 190
// horizontalCenterOffset: 69
// centerIn: parent
// }
// opacity: categoryTitleOpacity
//
// CategoryTitle {
// id: sh2Text
// title: xi18n("Sharpless Objects")
// anchors.centerIn: parent
//
// MouseArea {
// id: sh2MouseArea
// hoverEnabled: true
// anchors.fill: parent
// onEntered: container.state = "sh2AreaEntered"
// onClicked: {
// viewsRow.categorySelected(7)
// container.state = "dsoTypeSelected"
// }
// }
// }
// }
}
} //end of categoryView
......@@ -491,9 +572,9 @@ Rectangle {
right: parent.right
rightMargin: 10
}
textFormat: Text.RichText
width: parent.width
height: 16
color: "#f7f7ac"
text: xi18n("text")
horizontalAlignment: Text.AlignRight
font{
......@@ -568,32 +649,18 @@ Rectangle {
clip: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width
textFormat: Text.RichText
font{
family: "Cantarell"
pixelSize: 13
}
}
Text {
id: descSrcText
objectName: "descSrcTextObj"
color: "#18885f"
text: xi18n("Source: ")
clip: true
horizontalAlignment: Text.AlignRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
width: parent.width
onLinkActivated: Qt.openUrlExternally(link)
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
font{
family: "Cantarell"
pixelSize: 13
italic: true
} //font
} //text
}
} //column
} //item
} //flickable
......@@ -914,6 +981,12 @@ Rectangle {
onExited: slewButton.color = "white"
onClicked: slewButton.slewButtonClicked()
}
CheckBox {
id: autoCenter
objectName: "autoCenterCheckbox"
x: 100
checked: true
}
}
Text {
......@@ -1059,7 +1132,7 @@ Rectangle {
}
} else if (container.state == "dsoTypeSelected") {
if (!skyObjView.flipped) {
container.state = "dsoAreaClicked"
container.state = "base"
} else if (skyObjView.flipped) {
skyObjView.flipped = false
}
......@@ -1196,11 +1269,10 @@ Rectangle {
}
},
State {
name: "dsoAreaClicked"
name: "galAreaEntered"
PropertyChanges {
target: dsoText
state:"selected"
state: "selectedNoBold"
}
PropertyChanges {
......@@ -1217,6 +1289,11 @@ Rectangle {
target: clustItem
opacity: 1
}
PropertyChanges {
target: messierItem
opacity: 1
}
PropertyChanges {
target: planetItem
......@@ -1234,35 +1311,37 @@ Rectangle {
}
PropertyChanges {
target: clustMouseArea
hoverEnabled: true
enabled: true
target: galText
state: "selected"
color: activeColor
}
PropertyChanges {
target: galMouseArea
target: clustMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: nebMouseArea
target: messierMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: dsoMouseArea
hoverEnabled: false
target: galMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: dsoContainer
y: 160
target: nebMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: galText
target: nebText
color: activeColor
}
......@@ -1270,14 +1349,9 @@ Rectangle {
target: clustText
color: activeColor
}
PropertyChanges {
target: nebText
color: activeColor
}
},
State {
name: "galAreaEntered"
name: "nebAreaEntered"
PropertyChanges {
target: dsoText
state: "selectedNoBold"
......@@ -1297,6 +1371,11 @@ Rectangle {
target: clustItem
opacity: 1
}
PropertyChanges {
target: messierItem
opacity: 1
}
PropertyChanges {
target: planetItem
......@@ -1314,29 +1393,20 @@ Rectangle {
}
PropertyChanges {
target: dsoMouseArea
hoverEnabled: false
}
PropertyChanges {
target: galText
target: nebText
state: "selected"
color: activeColor
}
PropertyChanges {
target: dsoContainer
y: 160
}
PropertyChanges {
target: clustMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: galMouseArea
target: messierMouseArea
hoverEnabled: true
enabled: true
}
......@@ -1348,7 +1418,13 @@ Rectangle {
}
PropertyChanges {
target: nebText
target: galMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: galText
color: activeColor
}
......@@ -1358,7 +1434,7 @@ Rectangle {
}
},
State {
name: "nebAreaEntered"
name: "clustAreaEntered"
PropertyChanges {
target: dsoText
state: "selectedNoBold"
......@@ -1378,6 +1454,11 @@ Rectangle {
target: clustItem
opacity: 1
}
PropertyChanges {
target: messierItem
opacity: 1
}
PropertyChanges {
target: planetItem
......@@ -1395,51 +1476,47 @@ Rectangle {
}
PropertyChanges {
target: dsoMouseArea
hoverEnabled: false
}
PropertyChanges {
target: nebText
target: clustText
state: "selected"
color: activeColor
}
PropertyChanges {
target: dsoContainer
y: 160
target: clustMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: clustMouseArea
target: messierMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: nebMouseArea
target: galMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: galMouseArea
target: nebMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: galText
target: nebText
color: activeColor
}
PropertyChanges {
target: clustText
target: galText
color: activeColor
}
},
State {
name: "clustAreaEntered"
name: "messierAreaEntered"
PropertyChanges {
target: dsoText
state: "selectedNoBold"
......@@ -1459,6 +1536,10 @@ Rectangle {
target: clustItem
opacity: 1
}
PropertyChanges {
target: messierItem
opacity: 1
}
PropertyChanges {
target: planetItem
......@@ -1476,23 +1557,18 @@ Rectangle {
}
PropertyChanges {
target: dsoMouseArea
hoverEnabled: false
}
PropertyChanges {
target: clustText
target: messierText
state: "selected"
color: activeColor
}
PropertyChanges {
target: dsoContainer
y: 160
PropertyChanges {
target: clustMouseArea
hoverEnabled: true
enabled: true
}
PropertyChanges {
target: clustMouseArea
target: messierMouseArea
hoverEnabled: true
enabled: true
}
......@@ -1574,6 +1650,11 @@ Rectangle {
target: clustItem