summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-10-02 10:23:46 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-10-02 12:35:58 (GMT)
commitf5a4b8cce5fe6d2aaead5da6a6f2abbb7c4123c3 (patch)
tree2b83bef98ca447ae7787d990df7da957d4deccca
parent5f9bd2ef3b6609f3e2c5854c3da5da4a13854482 (diff)
Show some basic info about the object in a easy-to-access label
-rw-r--r--kstars/tools/observinglist.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/kstars/tools/observinglist.cpp b/kstars/tools/observinglist.cpp
index 38fa936..ddfc13b 100644
--- a/kstars/tools/observinglist.cpp
+++ b/kstars/tools/observinglist.cpp
@@ -512,6 +512,7 @@ void ObservingList::slotNewSelection() {
QModelIndexList selectedItems;
QString newName;
SkyObject *o;
+ QString labelText;
ui->DeleteImage->setEnabled( false );
selectedItems = getActiveSortModel()->mapSelectionToSource( getActiveView()->selectionModel()->selection() ).indexes();
@@ -603,12 +604,25 @@ void ObservingList::slotNewSelection() {
setDefaultImage();
ui->dssMetadataLabel->setText( i18n( "No image available. Click on the placeholder image to download one." ) );
}
+ QString cname = KStarsData::Instance()->skyComposite()->constellationBoundary()->constellationName( o );
+ if ( o->type() != SkyObject::CONSTELLATION ) {
+ labelText = "<b>";
+ if ( o->type() == SkyObject::PLANET )
+ labelText += o->translatedName();
+ else
+ labelText += o->name();
+ if ( std::isfinite( o->mag() ) && o->mag() <= 30. )
+ labelText += ":</b> " + i18nc("%1 magnitude of object, %2 type of sky object (planet, asteroid etc), %3 name of a constellation", "%1 mag %2 in %3", o->mag(), o->typeName().toLower(), cname );
+ else
+ labelText += ":</b> " + i18nc("%1 type of sky object (planet, asteroid etc), %2 name of a constellation", "%1 in %2", o->typeName(), cname );
+ }
}
else
{
setDefaultImage();
qDebug() << "Object " << newName << " not found in list.";
}
+ ui->quickInfoLabel->setText( labelText );
} else {
if ( selectedItems.size() == 0 ) {//Nothing selected
//Disable buttons
@@ -638,6 +652,7 @@ void ObservingList::slotNewSelection() {
//Clear the user log text box.
saveCurrentUserLog();
ui->NotesEdit->setPlainText("");
+ ui->quickInfoLabel->setText( QString() );
}
}
}