summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-08-17 05:16:41 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-08-17 05:16:41 (GMT)
commitf9fdbbbcff8e1a3908cb9f9eee25afbfbbf3b7e9 (patch)
treed4cf35995442a0b167c47b12442650db1ed6d0ce
parentc6f15b3a1f416c20f377c774ec8f7a7638c63435 (diff)
Rename "Misc" to "_Internet_Resolved" and allow showing/hiding it.
+ Call the fake catalog for internet-resolved objects as "_Internet_Resolved". The prefix "_" has the dual purpose of making it look "internal", and making it appear at the end of the sorted list of catalog names in the settings dialog. The name is more meaningful to the user. Also, we hold this name in a string that is initialized in the constructor, as it is used in multiple places -- makes it easy to change, but we should refrain from doing so as it will result in a junk catalog remaining in the skycomponent database. + Allow enabling / disabling the "_Internet_Resolved" catalog like any other catalog in the settings dialog. This is different from enabling/disabling resolution, which is controlled by a checkbox below (introduced in one of the previous commits)
-rw-r--r--kstars/skycomponents/skymapcomposite.cpp15
-rw-r--r--kstars/skycomponents/skymapcomposite.h1
-rw-r--r--kstars/skycomponents/syncedcatalogcomponent.cpp5
-rw-r--r--kstars/skycomponents/syncedcatalogcomponent.h2
4 files changed, 12 insertions, 11 deletions
diff --git a/kstars/skycomponents/skymapcomposite.cpp b/kstars/skycomponents/skymapcomposite.cpp
index 5df7bad..82bf686 100644
--- a/kstars/skycomponents/skymapcomposite.cpp
+++ b/kstars/skycomponents/skymapcomposite.cpp
@@ -93,14 +93,17 @@ SkyMapComposite::SkyMapComposite(SkyComposite *parent ) :
addComponent( m_ArtificialHorizon = new ArtificialHorizonComponent(this), 110);
+ m_internetResolvedCat = "_Internet_Resolved";
+ addComponent( m_miscObjectComponent = new SyncedCatalogComponent( this, m_internetResolvedCat, true, 0 ), 6 );
m_CustomCatalogs = new SkyComposite( this );
QStringList allcatalogs = Options::showCatalogNames();
for ( int i=0; i < allcatalogs.size(); ++ i ) {
+ if( allcatalogs.at(i) == m_internetResolvedCat ) // This is a special catalog
+ continue;
m_CustomCatalogs->addComponent(
- new CatalogComponent( this, allcatalogs.at(i), false, i ), 6
+ new CatalogComponent( this, allcatalogs.at(i), false, i ), 6 // FIXME: Should this be 6 or 5? See SkyMapComposite::reloadDeepSky()
);
}
- addComponent( m_miscObjectComponent = new SyncedCatalogComponent( this, "Misc", true, 0 ), 6 );
addComponent( m_SolarSystem = new SolarSystemComposite( this ), 2);
addComponent( m_Flags = new FlagComponent( this ), 4);
@@ -582,15 +585,15 @@ void SkyMapComposite::reloadDeepSky() {
m_CustomCatalogs = new SkyComposite( this );
QStringList allcatalogs = Options::showCatalogNames();
for ( int i=0; i < allcatalogs.size(); ++ i ) {
+ if( allcatalogs.at(i) == m_internetResolvedCat ) // This is a special catalog
+ continue;
m_CustomCatalogs->addComponent(
- new CatalogComponent( this, allcatalogs.at(i), false, i ), 5
+ new CatalogComponent( this, allcatalogs.at(i), false, i ), 5 // FIXME: Should this be 6 or 5? See SkyMapComposite::SkyMapComposite()
);
}
delete m_miscObjectComponent;
- addComponent( m_miscObjectComponent = new SyncedCatalogComponent( this, "Misc", true, 0 ), 6 );
+ addComponent( m_miscObjectComponent = new SyncedCatalogComponent( this, m_internetResolvedCat, true, 0 ), 6 );
SkyMapDrawAbstract::setDrawLock(false);
-
-
}
diff --git a/kstars/skycomponents/skymapcomposite.h b/kstars/skycomponents/skymapcomposite.h
index b02e9f0..3070af1 100644
--- a/kstars/skycomponents/skymapcomposite.h
+++ b/kstars/skycomponents/skymapcomposite.h
@@ -242,6 +242,7 @@ private:
QList<SkyObject*> m_LabeledObjects;
QHash<int, QStringList> m_ObjectNames;
QHash<QString, QString> m_ConstellationNames;
+ QString m_internetResolvedCat; // Holds the name of the internet resolved catalog
};
#endif
diff --git a/kstars/skycomponents/syncedcatalogcomponent.cpp b/kstars/skycomponents/syncedcatalogcomponent.cpp
index a79bd49..cc46d0a 100644
--- a/kstars/skycomponents/syncedcatalogcomponent.cpp
+++ b/kstars/skycomponents/syncedcatalogcomponent.cpp
@@ -20,6 +20,7 @@
#include "syncedcatalogcomponent.h"
#include "catalogdb.h"
#include "kstarsdata.h"
+#include "Options.h"
/* KDE Includes */
@@ -104,7 +105,3 @@ DeepSkyObject *SyncedCatalogComponent::addObject( CatalogEntryData catalogEntry
qDebug() << "Added new SkyObject " << newObj->name() << " to synced catalog " << m_catName << " which now contains " << m_ObjectList.count() << " objects.";
return newObj;
}
-
-bool SyncedCatalogComponent::selected() {
- return true; // Always selected for now.
-}
diff --git a/kstars/skycomponents/syncedcatalogcomponent.h b/kstars/skycomponents/syncedcatalogcomponent.h
index bfecb8e..9bf4851 100644
--- a/kstars/skycomponents/syncedcatalogcomponent.h
+++ b/kstars/skycomponents/syncedcatalogcomponent.h
@@ -58,7 +58,7 @@ class SyncedCatalogComponent : public CatalogComponent {
virtual void loadData() { _loadData( false ); }
- virtual bool selected();
+ // virtual bool selected();
private:
int m_catId;