summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Fedoskin <afedoskin3@gmail.com>2016-09-19 20:14:52 (GMT)
committerArtem Fedoskin <afedoskin3@gmail.com>2016-09-19 20:14:52 (GMT)
commitb32c941735317a4380ea615ef173ec25646db7d9 (patch)
tree2e500901866dc3bdc8ba046c85eac5d9ceefec8f
parente4a68ef24de0e94d64d1438dc7a42b316df2ad71 (diff)
Final commit before merging to master. Added comments to the rest of
SkyNodes, basic nodes and dialogs. Adopted KStars Lite way of searching to regular KStars.
-rw-r--r--CMakeLists.txt2
-rw-r--r--kstars/CMakeLists.txt74
-rw-r--r--kstars/auxiliary/skyobjectlistmodel.cpp (renamed from kstars/kstarslite/dialogs/skyobjectlistmodel.cpp)33
-rw-r--r--kstars/auxiliary/skyobjectlistmodel.h (renamed from kstars/kstarslite/dialogs/skyobjectlistmodel.h)16
-rw-r--r--kstars/dialogs/finddialog.cpp117
-rw-r--r--kstars/dialogs/finddialog.h3
-rw-r--r--kstars/kstarslite/dialogs/detaildialoglite.h42
-rw-r--r--kstars/kstarslite/dialogs/finddialoglite.cpp6
-rw-r--r--kstars/kstarslite/dialogs/finddialoglite.h23
-rw-r--r--kstars/kstarslite/dialogs/locationdialoglite.h4
-rw-r--r--kstars/kstarslite/qml/constants/Constants.qml10
-rw-r--r--kstars/kstarslite/qml/dialogs/DetailsDialog.qml10
-rw-r--r--kstars/kstarslite/qml/dialogs/FindDialog.qml10
-rw-r--r--kstars/kstarslite/qml/dialogs/LocationDialog.qml10
-rw-r--r--kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml10
-rw-r--r--kstars/kstarslite/qml/dialogs/helpers/DetailsItem.qml10
-rw-r--r--kstars/kstarslite/qml/dialogs/helpers/LocationEdit.qml10
-rw-r--r--kstars/kstarslite/qml/dialogs/helpers/LocationLoading.qml10
-rw-r--r--kstars/kstarslite/qml/dialogs/menus/DetailsLinkMenu.qml10
-rw-r--r--kstars/kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml10
-rw-r--r--kstars/kstarslite/qml/indi/DevicePanel.qml10
-rw-r--r--kstars/kstarslite/qml/indi/INDIControlPanel.qml10
-rw-r--r--kstars/kstarslite/qml/indi/ImagePreview.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/KSButtonSwitch.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/KSButtonsSwitchRow.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/KSCheckBox.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/KSComboBox.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/KSINDIText.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/KSINDITextField.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/KSLed.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/Led.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/MotionControl.qml10
-rw-r--r--kstars/kstarslite/qml/indi/modules/Property.qml10
-rw-r--r--kstars/kstarslite/qml/main.qml10
-rw-r--r--kstars/kstarslite/qml/modules/BottomMenu.qml10
-rw-r--r--kstars/kstarslite/qml/modules/KSListView.qml10
-rw-r--r--kstars/kstarslite/qml/modules/KSPage.qml10
-rw-r--r--kstars/kstarslite/qml/modules/KSTab.qml10
-rw-r--r--kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml10
-rw-r--r--kstars/kstarslite/qml/modules/Splash.qml10
-rw-r--r--kstars/kstarslite/qml/modules/TimePage.qml10
-rw-r--r--kstars/kstarslite/qml/modules/TopMenu.qml10
-rw-r--r--kstars/kstarslite/qml/modules/helpers/BottomMenuButton.qml10
-rw-r--r--kstars/kstarslite/qml/modules/helpers/KSMenuItem.qml10
-rw-r--r--kstars/kstarslite/qml/modules/helpers/TelescopeControl.qml10
-rw-r--r--kstars/kstarslite/qml/modules/helpers/TimeSpinBox.qml10
-rw-r--r--kstars/kstarslite/qml/modules/helpers/TopMenuButton.qml10
-rw-r--r--kstars/kstarslite/qml/modules/menus/ContextMenu.qml10
-rw-r--r--kstars/kstarslite/qml/modules/popups/ColorSchemePopup.qml10
-rw-r--r--kstars/kstarslite/qml/modules/popups/FOVPopup.qml10
-rw-r--r--kstars/kstarslite/qml/modules/popups/ProjectionsPopup.qml10
-rw-r--r--kstars/kstarslite/qml/modules/tutorial/TutorialExitPopup.qml10
-rw-r--r--kstars/kstarslite/qml/modules/tutorial/TutorialPane.qml10
-rw-r--r--kstars/kstarslite/qml/modules/tutorial/TutorialPopup.qml10
-rw-r--r--kstars/kstarslite/qml/modules/tutorial/TutorialStep1.qml10
-rw-r--r--kstars/kstarslite/qml/modules/tutorial/TutorialStep2.qml10
-rw-r--r--kstars/kstarslite/qml/modules/tutorial/TutorialStep3.qml10
-rw-r--r--kstars/kstarslite/qml/modules/tutorial/TutorialStep4.qml11
-rw-r--r--kstars/kstarslite/qml/modules/tutorial/TutorialStep5.qml10
-rw-r--r--kstars/kstarslite/skyitems/rootnode.h6
-rw-r--r--kstars/kstarslite/skyitems/satellitesitem.cpp1
-rw-r--r--kstars/kstarslite/skyitems/skynodes/dsosymbolnode.h2
-rw-r--r--kstars/kstarslite/skyitems/skynodes/guidelabelnode.h2
-rw-r--r--kstars/kstarslite/skyitems/skynodes/horizonnode.h3
-rw-r--r--kstars/kstarslite/skyitems/skynodes/labelnode.cpp4
-rw-r--r--kstars/kstarslite/skyitems/skynodes/labelnode.h68
-rw-r--r--kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.cpp3
-rw-r--r--kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.h23
-rw-r--r--kstars/kstarslite/skyitems/skynodes/nodes/linenode.cpp2
-rw-r--r--kstars/kstarslite/skyitems/skynodes/nodes/linenode.h21
-rw-r--r--kstars/kstarslite/skyitems/skynodes/nodes/pointnode.h4
-rw-r--r--kstars/kstarslite/skyitems/skynodes/nodes/polynode.cpp2
-rw-r--r--kstars/kstarslite/skyitems/skynodes/nodes/polynode.h30
-rw-r--r--kstars/kstarslite/skyitems/skynodes/nodes/rectnode.h9
-rw-r--r--kstars/kstarslite/skyitems/skynodes/planetmoonsnode.h29
-rw-r--r--kstars/kstarslite/skyitems/skynodes/planetnode.h20
-rw-r--r--kstars/kstarslite/skyitems/skynodes/satellitenode.cpp11
-rw-r--r--kstars/kstarslite/skyitems/skynodes/satellitenode.h29
-rw-r--r--kstars/kstarslite/skyitems/skynodes/skynode.h2
-rw-r--r--kstars/kstarslite/skyitems/skynodes/skypolygonnode.cpp1
-rw-r--r--kstars/kstarslite/skyitems/skynodes/skypolygonnode.h21
-rw-r--r--kstars/kstarslite/skyitems/skynodes/skytexturenode.cpp15
-rw-r--r--kstars/kstarslite/skyitems/skynodes/skytexturenode.h15
-rw-r--r--kstars/kstarslite/skyitems/skynodes/supernovanode.cpp43
-rw-r--r--kstars/kstarslite/skyitems/skynodes/supernovanode.h21
-rw-r--r--kstars/kstarsliteinit.cpp1
86 files changed, 884 insertions, 315 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8276311..db04478 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -163,7 +163,7 @@ add_subdirectory(datahandlers)
if(NOT BUILD_KSTARS_LITE)
enable_testing(true)
- add_subdirectory(Tests)
+ #add_subdirectory(Tests)
endif(NOT BUILD_KSTARS_LITE)
install(FILES org.kde.kstars.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index bfd7a4e..f085c59 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -132,37 +132,38 @@ if (INDI_FOUND)
ekos/guide/rcalibration.ui
)
- set(ekos_SRCS
- ekos/ekos.cpp
- ekos/schedulerjob.cpp
- ekos/scheduler.cpp
- ekos/mosaic.cpp
- ekos/ekosmanager.cpp
- ekos/capture.cpp
- ekos/sequencejob.cpp
- ekos/focus.cpp
- ekos/guide.cpp
- ekos/phd2.cpp
- ekos/align.cpp
- ekos/mount.cpp
- ekos/dome.cpp
- ekos/weather.cpp
- ekos/dustcap.cpp
- ekos/astrometryparser.cpp
- ekos/offlineastrometryparser.cpp
- ekos/onlineastrometryparser.cpp
- ekos/remoteastrometryparser.cpp
- ekos/profileeditor.cpp
- ekos/opsekos.cpp
- ekos/QProgressIndicator.cpp
- ekos/guide/common.cpp
- ekos/guide/gmath.cpp
- ekos/guide/guider.cpp
- ekos/guide/matr.cpp
- ekos/guide/rcalibration.cpp
- ekos/guide/scroll_graph.cpp
- ekos/guide/vect.cpp
- )
+ set(ekos_SRCS
+ ekos/ekos.cpp
+ ekos/schedulerjob.cpp
+ ekos/scheduler.cpp
+ ekos/mosaic.cpp
+ ekos/ekosmanager.cpp
+ ekos/capture.cpp
+ ekos/sequencejob.cpp
+ ekos/focus.cpp
+ ekos/guide.cpp
+ ekos/phd2.cpp
+ ekos/align.cpp
+ ekos/mount.cpp
+ ekos/dome.cpp
+ ekos/weather.cpp
+ ekos/dustcap.cpp
+ ekos/darklibrary.cpp
+ ekos/astrometryparser.cpp
+ ekos/offlineastrometryparser.cpp
+ ekos/onlineastrometryparser.cpp
+ ekos/remoteastrometryparser.cpp
+ ekos/profileeditor.cpp
+ ekos/opsekos.cpp
+ ekos/QProgressIndicator.cpp
+ ekos/guide/common.cpp
+ ekos/guide/gmath.cpp
+ ekos/guide/guider.cpp
+ ekos/guide/matr.cpp
+ ekos/guide/rcalibration.cpp
+ ekos/guide/scroll_graph.cpp
+ ekos/guide/vect.cpp
+ )
endif(CFITSIO_FOUND)
endif(BUILD_KSTARS_LITE)
@@ -540,6 +541,10 @@ if(NOT BUILD_KSTARS_LITE)
LIST(APPEND libkstarscomponents_SRCS
skycomponents/notifyupdatesui.cpp
)
+else(NOT BUILD_KSTARS_LITE)
+ set(libkstarstools_SRCS
+ tools/nameresolver.cpp
+ )
endif(NOT BUILD_KSTARS_LITE)
set(kstars_skyobjects_SRCS
@@ -588,6 +593,7 @@ set(kstars_extra_SRCS
auxiliary/filedownloader.cpp
auxiliary/kspaths.cpp
auxiliary/QRoundProgressBar.cpp
+ auxiliary/skyobjectlistmodel.cpp
time/simclock.cpp
time/kstarsdatetime.cpp
time/timezonerule.cpp
@@ -598,10 +604,6 @@ set(kstars_extra_SRCS
skypainter.cpp
)
-set(libkstarstools_SRCS
- tools/nameresolver.cpp
- )
-
if(NOT BUILD_KSTARS_LITE)
LIST(APPEND kstars_extra_SRCS
auxiliary/imageviewer.cpp
@@ -645,7 +647,6 @@ if(BUILD_KSTARS_LITE)
kstarslite/dialogs/detaildialoglite.cpp
kstarslite/dialogs/finddialoglite.cpp
kstarslite/dialogs/locationdialoglite.cpp
- kstarslite/dialogs/skyobjectlistmodel.cpp
#RootNode
kstarslite/skyitems/rootnode.cpp
kstarslite/skyitems/skyopacitynode.cpp
@@ -679,7 +680,6 @@ if(BUILD_KSTARS_LITE)
kstarslite/skyitems/skynodes/horizonnode.cpp
kstarslite/skyitems/skynodes/labelnode.cpp
kstarslite/skyitems/skynodes/guidelabelnode.cpp
- kstarslite/skyitems/skynodes/skytexturenode.cpp
kstarslite/skyitems/skynodes/deepskynode.cpp
kstarslite/skyitems/skynodes/dsosymbolnode.cpp
kstarslite/skyitems/skynodes/skypolygonnode.cpp
diff --git a/kstars/kstarslite/dialogs/skyobjectlistmodel.cpp b/kstars/auxiliary/skyobjectlistmodel.cpp
index 61463c0..539839e 100644
--- a/kstars/kstarslite/dialogs/skyobjectlistmodel.cpp
+++ b/kstars/auxiliary/skyobjectlistmodel.cpp
@@ -25,16 +25,25 @@ SkyObjectListModel::SkyObjectListModel(QObject *parent)
QHash<int, QByteArray> SkyObjectListModel::roleNames() const {
QHash<int, QByteArray> roles;
- roles[NameRole] = "name";
+ roles[Qt::DisplayRole] = "name";
roles[SkyObjectRole] = "skyobject";
return roles;
}
+int SkyObjectListModel::indexOf(QString objectName) const {
+ for(int i = 0; i < skyObjects.size(); ++i) {
+ if(skyObjects[i].first == objectName) {
+ return i;
+ }
+ }
+ return -1;
+}
+
QVariant SkyObjectListModel::data(const QModelIndex &index, int role) const {
if(!index.isValid()) {
return QVariant();
}
- if(role == NameRole) {
+ if(role == Qt::DisplayRole) {
return QVariant(skyObjects[index.row()].first);
} else if(role == SkyObjectRole) {
return qVariantFromValue((void *) skyObjects[index.row()].second);
@@ -42,20 +51,20 @@ QVariant SkyObjectListModel::data(const QModelIndex &index, int role) const {
return QVariant();
}
+QStringList SkyObjectListModel::filter(QRegExp regEx) {
+ QStringList filteredList;
+ for(int i = 0; i < skyObjects.size(); ++i) {
+ if(regEx.exactMatch(skyObjects[i].first)) {
+ filteredList.append(skyObjects[i].first);
+ }
+ }
+ return filteredList;
+}
+
void SkyObjectListModel::setSkyObjectsList(QVector<QPair<QString, const SkyObject *>> sObjects) {
emit beginResetModel();
skyObjects = sObjects;
- /*foreach(SkyObject *s, sObjects) {
- QString name = s->name();
- if ( ! name.isEmpty() ) {
- skyObjects.append(QPair<QString, SkyObject *>(name, s));
- }
- QString longname = s->longname();
- if ( ! longname.isEmpty() && longname != name) {
- skyObjects.append(QPair<QString, SkyObject *>(longname, s));
- }
- }*/
emit endResetModel();
}
diff --git a/kstars/kstarslite/dialogs/skyobjectlistmodel.h b/kstars/auxiliary/skyobjectlistmodel.h
index 6c0d314..fbb1aae 100644
--- a/kstars/kstarslite/dialogs/skyobjectlistmodel.h
+++ b/kstars/auxiliary/skyobjectlistmodel.h
@@ -34,8 +34,7 @@ class SkyObjectListModel : public QAbstractListModel {
Q_OBJECT
public:
enum DemoRoles {
- NameRole = Qt::UserRole + 1,
- SkyObjectRole
+ SkyObjectRole = Qt::UserRole + 1,
};
explicit SkyObjectListModel(QObject *parent = 0);
@@ -45,6 +44,19 @@ public:
virtual QHash<int, QByteArray> roleNames() const;
+ /**
+ * @return index of object from skyObjects with name objectName. -1 if object with such
+ * name was not found
+ */
+ int indexOf(QString objectName) const;
+
+ /**
+ * @short filter
+ * @param regEx
+ * @return
+ */
+ QStringList filter(QRegExp regEx);
+
void setSkyObjectsList(QVector<QPair<QString, const SkyObject *>> sObjects);
private:
diff --git a/kstars/dialogs/finddialog.cpp b/kstars/dialogs/finddialog.cpp
index 86f6a4e..f0c8c36 100644
--- a/kstars/dialogs/finddialog.cpp
+++ b/kstars/dialogs/finddialog.cpp
@@ -25,6 +25,7 @@
#include "skycomponents/syncedcatalogcomponent.h"
#include "skycomponents/skymapcomposite.h"
#include "tools/nameresolver.h"
+#include "skyobjectlistmodel.h"
#include <KMessageBox>
@@ -83,11 +84,15 @@ FindDialog::FindDialog( QWidget* parent ) :
ui->FilterType->setCurrentIndex(0); // show all types of objects
- fModel = new QStringListModel( this );
- sortModel = new QSortFilterProxyModel( ui->SearchList );
+ fModel = new SkyObjectListModel( this );
+ sortModel = new QSortFilterProxyModel(ui->SearchList);
sortModel->setFilterCaseSensitivity( Qt::CaseInsensitive );
- ui->SearchList->setModel( sortModel );
sortModel->setSourceModel( fModel );
+ sortModel->setSortRole(Qt::DisplayRole);
+ sortModel->setFilterRole(Qt::DisplayRole);
+ sortModel->setDynamicSortFilter(true);
+ sortModel->sort( 0 );
+
ui->SearchList->setModel( sortModel );
// Connect signals to slots
@@ -128,26 +133,26 @@ void FindDialog::initSelection() {
switch ( ui->FilterType->currentIndex() ) {
case 0: //All objects, choose Andromeda galaxy
{
- QModelIndex qmi = fModel->index( fModel->stringList().indexOf( i18n("Andromeda Galaxy") ) );
+ QModelIndex qmi = fModel->index( fModel->indexOf( i18n("Andromeda Galaxy") ) );
selectItem = sortModel->mapFromSource( qmi );
break;
}
case 1: //Stars, choose Aldebaran
{
- QModelIndex qmi = fModel->index( fModel->stringList().indexOf( i18n("Aldebaran") ) );
+ QModelIndex qmi = fModel->index( fModel->indexOf( i18n("Aldebaran") ) );
selectItem = sortModel->mapFromSource( qmi );
break;
}
case 2: //Solar system or Asteroids, choose Aaltje
case 9:
{
- QModelIndex qmi = fModel->index( fModel->stringList().indexOf( i18n("Aaltje") ) );
+ QModelIndex qmi = fModel->index( fModel->indexOf( i18n("Aaltje") ) );
selectItem = sortModel->mapFromSource( qmi );
break;
}
case 8: //Comets, choose 'Aarseth-Brewington (1989 W1)'
{
- QModelIndex qmi = fModel->index( fModel->stringList().indexOf( i18n("Aarseth-Brewington (1989 W1)") ) );
+ QModelIndex qmi = fModel->index( fModel->indexOf( i18n("Aarseth-Brewington (1989 W1)") ) );
selectItem = sortModel->mapFromSource( qmi );
break;
}
@@ -171,68 +176,68 @@ void FindDialog::filterByType() {
switch ( ui->FilterType->currentIndex() ) {
case 0: // All object types
- {
- QStringList allObjects;
- foreach( int type, data->skyComposite()->objectNames().keys() )
- allObjects += data->skyComposite()->objectNames( type );
- fModel->setStringList( allObjects );
- break;
+ {
+ QVector<QPair<QString, const SkyObject *>> allObjects;
+ foreach( int type, data->skyComposite()->objectLists().keys() ) {
+ allObjects.append(data->skyComposite()->objectLists(SkyObject::TYPE(type)));
}
+ fModel->setSkyObjectsList( allObjects );
+ break;
+ }
case 1: //Stars
- {
- QStringList starObjects;
- starObjects += data->skyComposite()->objectNames( SkyObject::STAR );
- starObjects += data->skyComposite()->objectNames( SkyObject::CATALOG_STAR );
- fModel->setStringList( starObjects );
- break;
- }
+ {
+ QVector<QPair<QString, const SkyObject *>> starObjects;
+ starObjects.append(data->skyComposite()->objectLists(SkyObject::STAR));
+ starObjects.append(data->skyComposite()->objectLists(SkyObject::CATALOG_STAR));
+ fModel->setSkyObjectsList( starObjects );
+ break;
+ }
case 2: //Solar system
- {
- QStringList ssObjects;
- ssObjects += data->skyComposite()->objectNames( SkyObject::PLANET );
- ssObjects += data->skyComposite()->objectNames( SkyObject::COMET );
- ssObjects += data->skyComposite()->objectNames( SkyObject::ASTEROID );
- ssObjects += data->skyComposite()->objectNames( SkyObject::MOON );
- ssObjects += i18n("Sun");
- fModel->setStringList( ssObjects );
- break;
- }
+ {
+ QVector<QPair<QString, const SkyObject *>> ssObjects;
+ ssObjects.append(data->skyComposite()->objectLists(SkyObject::PLANET));
+ ssObjects.append(data->skyComposite()->objectLists(SkyObject::COMET));
+ ssObjects.append(data->skyComposite()->objectLists(SkyObject::ASTEROID));
+ ssObjects.append(data->skyComposite()->objectLists(SkyObject::MOON));
+
+ fModel->setSkyObjectsList(ssObjects);
+ break;
+ }
case 3: //Open Clusters
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::OPEN_CLUSTER ) );
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::OPEN_CLUSTER ) );
break;
- case 4: //Open Clusters
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::GLOBULAR_CLUSTER ) );
+ case 4: //Globular Clusters
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::GLOBULAR_CLUSTER ) );
break;
case 5: //Gaseous nebulae
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::GASEOUS_NEBULA ) );
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::GASEOUS_NEBULA ) );
break;
case 6: //Planetary nebula
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::PLANETARY_NEBULA ) );
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::PLANETARY_NEBULA ) );
break;
case 7: //Galaxies
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::GALAXY ) );
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::GALAXY ) );
break;
case 8: //Comets
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::COMET ) );
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::COMET ) );
break;
case 9: //Asteroids
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::ASTEROID ) );
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::ASTEROID ) );
break;
case 10: //Constellations
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::CONSTELLATION ) );
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::CONSTELLATION ) );
break;
case 11: //Supernovae
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::SUPERNOVA ) );
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::SUPERNOVA ) );
break;
case 12: //Satellites
- fModel->setStringList( data->skyComposite()->objectNames( SkyObject::SATELLITE ) );
+ fModel->setSkyObjectsList( data->skyComposite()->objectLists( SkyObject::SATELLITE ) );
break;
}
}
void FindDialog::filterList() {
- QString SearchText;
- SearchText = processSearchText();
+ QString SearchText = processSearchText();
sortModel->setFilterFixedString( SearchText );
ui->InternetSearchButton->setText( i18n( "or search the internet for %1", SearchText ) );
filterByType();
@@ -240,11 +245,11 @@ void FindDialog::filterList() {
//Select the first item in the list that begins with the filter string
if ( !SearchText.isEmpty() ) {
- QStringList mItems = fModel->stringList().filter( QRegExp( '^'+SearchText, Qt::CaseInsensitive ) );
+ QStringList mItems = fModel->filter( QRegExp( '^'+SearchText, Qt::CaseInsensitive ) );
mItems.sort();
if ( mItems.size() ) {
- QModelIndex qmi = fModel->index( fModel->stringList().indexOf( mItems[0] ) );
+ QModelIndex qmi = fModel->index( fModel->indexOf( mItems[0] ) );
QModelIndex selectItem = sortModel->mapFromSource( qmi );
if ( selectItem.isValid() ) {
@@ -265,24 +270,8 @@ void FindDialog::filterList() {
SkyObject* FindDialog::selectedObject() const {
QModelIndex i = ui->SearchList->currentIndex();
- SkyObject *obj = 0;
- if ( i.isValid() ) {
- QString ObjName = i.data().toString();
- obj = KStarsData::Instance()->skyComposite()->findByName( ObjName );
- }
- if( !obj ) {
- QString stext = ui->SearchBox->text();
- if( stext.startsWith( QLatin1String( "HD" ) ) ) {
- stext.remove( "HD" );
- bool ok;
- int HD = stext.toInt( &ok );
- // Looks like the user is looking for a HD star
- if( ok ) {
- obj = StarComponent::Instance()->findByHDIndex( HD );
- }
- }
- }
- return obj;
+ QVariant sObj = sortModel->data(sortModel->index(i.row(), 0), SkyObjectListModel::SkyObjectRole);
+ return (SkyObject *) sObj.value<void *>();
}
void FindDialog::enqueueSearch() {
@@ -353,6 +342,7 @@ void FindDialog::finishProcessing( SkyObject *selObj, bool resolve ) {
QString message = i18n( "No object named %1 found.", ui->SearchBox->text() );
KMessageBox::sorry( 0, message, i18n( "Bad object name" ) );
} else {
+ selObj->updateCoordsNow(KStarsData::Instance()->updateNum());
accept();
}
}
@@ -389,7 +379,6 @@ void FindDialog::slotDetails()
dd->exec();
delete dd;
}
-
}
diff --git a/kstars/dialogs/finddialog.h b/kstars/dialogs/finddialog.h
index 35e60a9..dc64e87 100644
--- a/kstars/dialogs/finddialog.h
+++ b/kstars/dialogs/finddialog.h
@@ -27,6 +27,7 @@
class QTimer;
class QStringListModel;
class QSortFilterProxyModel;
+class SkyObjectListModel;
class FindDialogUI : public QFrame, public Ui::FindDialog {
Q_OBJECT
@@ -121,7 +122,7 @@ private:
void filterByType();
FindDialogUI* ui;
- QStringListModel *fModel;
+ SkyObjectListModel *fModel;
QSortFilterProxyModel* sortModel;
QTimer* timer;
bool listFiltered;
diff --git a/kstars/kstarslite/dialogs/detaildialoglite.h b/kstars/kstarslite/dialogs/detaildialoglite.h
index bb66452..c3f374e 100644
--- a/kstars/kstarslite/dialogs/detaildialoglite.h
+++ b/kstars/kstarslite/dialogs/detaildialoglite.h
@@ -26,7 +26,9 @@ class QSortFilterProxyModel;
class SkyObjectListModel;
/** @class DetalDialogLite
- * A backend of details dialog declared in QML.
+ * A backend of details dialog declared in QML. Members of this class are the properties that are used
+ * in QML. Whenever user clicks on some object the properties are updated with the info about this object
+ * and Details dialog in QML is updated automatically as we use property binding there.
*
* @short Backend for Object details dialog in QML
* @author Artem Fedoskin, Jason Harris, Jasem Mutlaq
@@ -57,7 +59,6 @@ class DetailDialogLite : public QObject {
Q_PROPERTY(QString period MEMBER m_period NOTIFY periodChanged)
//Position
-
Q_PROPERTY(QString decLabel MEMBER m_decLabel NOTIFY decLabelChanged )
Q_PROPERTY(QString dec MEMBER m_dec NOTIFY decChanged )
@@ -92,12 +93,12 @@ public:
explicit DetailDialogLite();
/**
- * @short initialize connects SkyMapLite's signals to proper slots
+ * @short Connect SkyMapLite's signals to proper slots
*/
void initialize();
/**
- * @short setupThumbnail sets thumbnail to SkyMapLite::clickedObjectLite's thumbnail (if any)
+ * @short Set thumbnail to SkyMapLite::clickedObjectLite's thumbnail (if any)
*/
void setupThumbnail();
@@ -107,9 +108,21 @@ public:
*/
Q_INVOKABLE void addLink(QString url, QString desc, bool isImageLink);
+ /**
+ * @short Remove link from user's database
+ * @param itemIndex - index of a link
+ * @param isImage - true if it is a link on image, false if it is an info link
+ */
Q_INVOKABLE void removeLink(int itemIndex, bool isImage);
- Q_INVOKABLE void editLink(int itemIndex, bool isImage, QString desc, QString url);
+ /**
+ * @short Edit link's description and URL
+ * @param itemIndex - index of a link
+ * @param isImage - true if it is a link on image, false if it is an info link
+ * @param desc - new description
+ * @param url - new URL
+ */
+ void editLink(int itemIndex, bool isImage, QString desc, QString url);
/** Update the local info_url and image_url files
@param type The URL type. 0 for Info Links, 1 for Images.
@@ -131,16 +144,25 @@ public:
* @return URL to user added object image
*/
Q_INVOKABLE QString getImageURL(int index);
-
+public slots:
/**
- * @short viewResource checks for validity of url and opens it in device default browser
+ * @short Update properties that are shown on "General" tab
*/
- //Q_INVOKABLE void viewResource(int itemIndex, bool isImage);
-
-public slots:
void createGeneralTab();
+
+ /**
+ * @short Update properties that are shown on "Position" tab
+ */
void createPositionTab();
+
+ /**
+ * @short Update properties that are shown on "Log" tab
+ */
void createLogTab();
+
+ /**
+ * @short Update properties that are shown on "Links" tab
+ */
void createLinksTab();
/**
diff --git a/kstars/kstarslite/dialogs/finddialoglite.cpp b/kstars/kstarslite/dialogs/finddialoglite.cpp
index 36d9000..8cd1522 100644
--- a/kstars/kstarslite/dialogs/finddialoglite.cpp
+++ b/kstars/kstarslite/dialogs/finddialoglite.cpp
@@ -56,8 +56,8 @@ FindDialogLite::FindDialogLite( ) :
m_sortModel = new QSortFilterProxyModel(this);
m_sortModel->setFilterCaseSensitivity( Qt::CaseInsensitive );
m_sortModel->setSourceModel( fModel );
- m_sortModel->setSortRole(SkyObjectListModel::NameRole);
- m_sortModel->setFilterRole(SkyObjectListModel::NameRole);
+ m_sortModel->setSortRole(Qt::DisplayRole);
+ m_sortModel->setFilterRole(Qt::DisplayRole);
m_sortModel->setDynamicSortFilter(true);
KStarsLite::Instance()->qmlEngine()->rootContext()->setContextProperty("SortModel", m_sortModel);
m_sortModel->sort( 0 );
@@ -177,7 +177,7 @@ bool FindDialogLite::isInList(QString searchQuery) {
int size = m_sortModel->rowCount(m_sortModel->index(0,0));
QString stripped = searchQuery.remove(" ");
for(int i = 0; i < size; ++i) {
- QString s = m_sortModel->data(m_sortModel->index(i,0), SkyObjectListModel::NameRole).toString();
+ QString s = m_sortModel->data(m_sortModel->index(i,0), Qt::DisplayRole).toString();
if(s == searchQuery || s.remove(" ") == stripped) {
return true;
}
diff --git a/kstars/kstarslite/dialogs/finddialoglite.h b/kstars/kstarslite/dialogs/finddialoglite.h
index e708de9..61a7db5 100644
--- a/kstars/kstarslite/dialogs/finddialoglite.h
+++ b/kstars/kstarslite/dialogs/finddialoglite.h
@@ -25,6 +25,13 @@ class QSortFilterProxyModel;
class SkyObjectListModel;
/** @class FindDialogLite
+ * The way we are searching for the object is as follows:
+ * Each SkyComponent in addition to QStringList of names holds QVector<QPair<QString, const SkyObject *>>.
+ * SkyObjectListModel is a class that holds SkyObjects together with their names (name and longname).
+ * Whenever user searches for an object we sort list of SkyObjects through QSortFilterProxyModel. The reason
+ * for this way of searching is that we don't need to search for an object again, as it was done previously.
+ * Instead of this, user directly selects the object in search results.
+ *
* @short Backend for "Find Object" dialog in QML
* @author Artem Fedoskin, Jason Harris
* @version 1.0
@@ -35,13 +42,22 @@ class FindDialogLite : public QObject {
//true if m_searchQuery is already in sorted list of object names
Q_PROPERTY(bool isResolveEnabled READ getIsResolveEnabled WRITE setIsResolveEnabled NOTIFY isResolveEnabledChanged)
public:
+ /**
+ * @short Constructor. Initialize m_filterModel with object types and initialize m_sortModel with instance of SkyObjectListModel
+ */
explicit FindDialogLite();
/** Destructor */
virtual ~FindDialogLite();
+ /**
+ * @short Open context menu for object with given index from m_sortModel
+ */
Q_INVOKABLE void selectObject(int index);
+ /**
+ * @return list of object types
+ */
QStringList getFilterModel() { return m_filterModel; }
/** @short pre-filter the list of objects according to the
@@ -50,7 +66,8 @@ public:
Q_INVOKABLE void filterByType(uint typeIndex);
/**
- * @short searches for the object in internet (adopted to KStars Lite FindDialog::finishProcessing()
+ * @short searches for the object in internet (adopted to KStars Lite version of
+ * FindDialog::finishProcessing()
*/
Q_INVOKABLE void resolveInInternet(QString searchQuery);
@@ -59,10 +76,10 @@ public:
*/
Q_INVOKABLE bool isInList(QString searchQuery);
- /** Getter for queryInList **/
+ /** Getter for isResolveEnabled **/
bool getIsResolveEnabled() { return m_isResolveEnabled; }
- /** Setter for queryInList **/
+ /** Setter for isResolveEnabled **/
void setIsResolveEnabled(bool isResolveEnabled);
signals:
void filterModelChanged();
diff --git a/kstars/kstarslite/dialogs/locationdialoglite.h b/kstars/kstarslite/dialogs/locationdialoglite.h
index 92c2583..ab6b300 100644
--- a/kstars/kstarslite/dialogs/locationdialoglite.h
+++ b/kstars/kstarslite/dialogs/locationdialoglite.h
@@ -1,11 +1,11 @@
-/***************************************************************************
+/** *************************************************************************
locationialoglite.h - K Desktop Planetarium
-------------------
begin : Sun Aug 21 2016
copyright : (C) 2016 by Artem Fedoskin
email : afedoskin3@gmail.com
***************************************************************************/
-/***************************************************************************
+/** *************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
diff --git a/kstars/kstarslite/qml/constants/Constants.qml b/kstars/kstarslite/qml/constants/Constants.qml
index 7e845ed..e7b45b0 100644
--- a/kstars/kstarslite/qml/constants/Constants.qml
+++ b/kstars/kstarslite/qml/constants/Constants.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
pragma Singleton
import QtQuick 2.7
import QtQuick.Window 2.2
diff --git a/kstars/kstarslite/qml/dialogs/DetailsDialog.qml b/kstars/kstarslite/qml/dialogs/DetailsDialog.qml
index 15efa00..2c1113b 100644
--- a/kstars/kstarslite/qml/dialogs/DetailsDialog.qml
+++ b/kstars/kstarslite/qml/dialogs/DetailsDialog.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Window 2.2
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/dialogs/FindDialog.qml b/kstars/kstarslite/qml/dialogs/FindDialog.qml
index f0970d6..421b86e 100644
--- a/kstars/kstarslite/qml/dialogs/FindDialog.qml
+++ b/kstars/kstarslite/qml/dialogs/FindDialog.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/dialogs/LocationDialog.qml b/kstars/kstarslite/qml/dialogs/LocationDialog.qml
index ce97e1b..eeb2129 100644
--- a/kstars/kstarslite/qml/dialogs/LocationDialog.qml
+++ b/kstars/kstarslite/qml/dialogs/LocationDialog.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml b/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml
index 44af6f6..94e8151 100644
--- a/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml
+++ b/kstars/kstarslite/qml/dialogs/helpers/DetailsAddLink.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.7
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/dialogs/helpers/DetailsItem.qml b/kstars/kstarslite/qml/dialogs/helpers/DetailsItem.qml
index 78a0f4c..072df11 100644
--- a/kstars/kstarslite/qml/dialogs/helpers/DetailsItem.qml
+++ b/kstars/kstarslite/qml/dialogs/helpers/DetailsItem.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/dialogs/helpers/LocationEdit.qml b/kstars/kstarslite/qml/dialogs/helpers/LocationEdit.qml
index 986ab4d..fbfc80a 100644
--- a/kstars/kstarslite/qml/dialogs/helpers/LocationEdit.qml
+++ b/kstars/kstarslite/qml/dialogs/helpers/LocationEdit.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.7
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/dialogs/helpers/LocationLoading.qml b/kstars/kstarslite/qml/dialogs/helpers/LocationLoading.qml
index 6f5a8c8..63384b3 100644
--- a/kstars/kstarslite/qml/dialogs/helpers/LocationLoading.qml
+++ b/kstars/kstarslite/qml/dialogs/helpers/LocationLoading.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.7
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/dialogs/menus/DetailsLinkMenu.qml b/kstars/kstarslite/qml/dialogs/menus/DetailsLinkMenu.qml
index 75dcc34..948ddd0 100644
--- a/kstars/kstarslite/qml/dialogs/menus/DetailsLinkMenu.qml
+++ b/kstars/kstarslite/qml/dialogs/menus/DetailsLinkMenu.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.7
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml b/kstars/kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml
index 5a25986..0986cd2 100644
--- a/kstars/kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml
+++ b/kstars/kstarslite/qml/dialogs/menus/LocationsGeoMenu.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.7
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/indi/DevicePanel.qml b/kstars/kstarslite/qml/indi/DevicePanel.qml
index 9d62397..143c656 100644
--- a/kstars/kstarslite/qml/indi/DevicePanel.qml
+++ b/kstars/kstarslite/qml/indi/DevicePanel.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Window 2.2
import "../modules"
diff --git a/kstars/kstarslite/qml/indi/INDIControlPanel.qml b/kstars/kstarslite/qml/indi/INDIControlPanel.qml
index 1c34cb5..84ad6b5 100644
--- a/kstars/kstarslite/qml/indi/INDIControlPanel.qml
+++ b/kstars/kstarslite/qml/indi/INDIControlPanel.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/indi/ImagePreview.qml b/kstars/kstarslite/qml/indi/ImagePreview.qml
index 3c494f9..bf8a013 100644
--- a/kstars/kstarslite/qml/indi/ImagePreview.qml
+++ b/kstars/kstarslite/qml/indi/ImagePreview.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Window 2.2
import "../modules"
diff --git a/kstars/kstarslite/qml/indi/modules/KSButtonSwitch.qml b/kstars/kstarslite/qml/indi/modules/KSButtonSwitch.qml
index 895e93b..4dd5c96 100644
--- a/kstars/kstarslite/qml/indi/modules/KSButtonSwitch.qml
+++ b/kstars/kstarslite/qml/indi/modules/KSButtonSwitch.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/indi/modules/KSButtonsSwitchRow.qml b/kstars/kstarslite/qml/indi/modules/KSButtonsSwitchRow.qml
index 77033fb..1836381 100644
--- a/kstars/kstarslite/qml/indi/modules/KSButtonsSwitchRow.qml
+++ b/kstars/kstarslite/qml/indi/modules/KSButtonsSwitchRow.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Controls 1.4
import QtQuick.Window 2.2
diff --git a/kstars/kstarslite/qml/indi/modules/KSCheckBox.qml b/kstars/kstarslite/qml/indi/modules/KSCheckBox.qml
index 2f9d5a8..a2ab7eb 100644
--- a/kstars/kstarslite/qml/indi/modules/KSCheckBox.qml
+++ b/kstars/kstarslite/qml/indi/modules/KSCheckBox.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/indi/modules/KSComboBox.qml b/kstars/kstarslite/qml/indi/modules/KSComboBox.qml
index 82f059a..2155077 100644
--- a/kstars/kstarslite/qml/indi/modules/KSComboBox.qml
+++ b/kstars/kstarslite/qml/indi/modules/KSComboBox.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/indi/modules/KSINDIText.qml b/kstars/kstarslite/qml/indi/modules/KSINDIText.qml
index 162b439..f58fd09 100644
--- a/kstars/kstarslite/qml/indi/modules/KSINDIText.qml
+++ b/kstars/kstarslite/qml/indi/modules/KSINDIText.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.2
diff --git a/kstars/kstarslite/qml/indi/modules/KSINDITextField.qml b/kstars/kstarslite/qml/indi/modules/KSINDITextField.qml
index d482d3d..6697a24 100644
--- a/kstars/kstarslite/qml/indi/modules/KSINDITextField.qml
+++ b/kstars/kstarslite/qml/indi/modules/KSINDITextField.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Layouts 1.2
import "../../constants" 1.0
diff --git a/kstars/kstarslite/qml/indi/modules/KSLed.qml b/kstars/kstarslite/qml/indi/modules/KSLed.qml
index 924f8ad..3f2a6bf 100644
--- a/kstars/kstarslite/qml/indi/modules/KSLed.qml
+++ b/kstars/kstarslite/qml/indi/modules/KSLed.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/indi/modules/Led.qml b/kstars/kstarslite/qml/indi/modules/Led.qml
index daeeedf..a762d7a 100644
--- a/kstars/kstarslite/qml/indi/modules/Led.qml
+++ b/kstars/kstarslite/qml/indi/modules/Led.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import "../../constants" 1.0
diff --git a/kstars/kstarslite/qml/indi/modules/MotionControl.qml b/kstars/kstarslite/qml/indi/modules/MotionControl.qml
index 845e608..e1e65ea 100644
--- a/kstars/kstarslite/qml/indi/modules/MotionControl.qml
+++ b/kstars/kstarslite/qml/indi/modules/MotionControl.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Layouts 1.2
diff --git a/kstars/kstarslite/qml/indi/modules/Property.qml b/kstars/kstarslite/qml/indi/modules/Property.qml
index 64cfe75..bdc1b73 100644
--- a/kstars/kstarslite/qml/indi/modules/Property.qml
+++ b/kstars/kstarslite/qml/indi/modules/Property.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Layouts 1.2
diff --git a/kstars/kstarslite/qml/main.qml b/kstars/kstarslite/qml/main.qml
index 2995f64..e6b9c05 100644
--- a/kstars/kstarslite/qml/main.qml
+++ b/kstars/kstarslite/qml/main.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/BottomMenu.qml b/kstars/kstarslite/qml/modules/BottomMenu.qml
index 6e9eb66..982bd94 100644
--- a/kstars/kstarslite/qml/modules/BottomMenu.qml
+++ b/kstars/kstarslite/qml/modules/BottomMenu.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/KSListView.qml b/kstars/kstarslite/qml/modules/KSListView.qml
index 73e0748..caf931e 100644
--- a/kstars/kstarslite/qml/modules/KSListView.qml
+++ b/kstars/kstarslite/qml/modules/KSListView.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/KSPage.qml b/kstars/kstarslite/qml/modules/KSPage.qml
index e5315d3..581608e 100644
--- a/kstars/kstarslite/qml/modules/KSPage.qml
+++ b/kstars/kstarslite/qml/modules/KSPage.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/modules/KSTab.qml b/kstars/kstarslite/qml/modules/KSTab.qml
index f611f72..8c4effc 100644
--- a/kstars/kstarslite/qml/modules/KSTab.qml
+++ b/kstars/kstarslite/qml/modules/KSTab.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml b/kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml
index 884c537..dc0fcff 100644
--- a/kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml
+++ b/kstars/kstarslite/qml/modules/SkyMapLiteWrapper.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Controls 2.0
import "../constants" 1.0
diff --git a/kstars/kstarslite/qml/modules/Splash.qml b/kstars/kstarslite/qml/modules/Splash.qml
index 6b16b9d..35069bb 100644
--- a/kstars/kstarslite/qml/modules/Splash.qml
+++ b/kstars/kstarslite/qml/modules/Splash.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Window 2.2
import "../constants"
diff --git a/kstars/kstarslite/qml/modules/TimePage.qml b/kstars/kstarslite/qml/modules/TimePage.qml
index b030c14..2103cff 100644
--- a/kstars/kstarslite/qml/modules/TimePage.qml
+++ b/kstars/kstarslite/qml/modules/TimePage.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.6
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/modules/TopMenu.qml b/kstars/kstarslite/qml/modules/TopMenu.qml
index ebbfece..672cdf9 100644
--- a/kstars/kstarslite/qml/modules/TopMenu.qml
+++ b/kstars/kstarslite/qml/modules/TopMenu.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/helpers/BottomMenuButton.qml b/kstars/kstarslite/qml/modules/helpers/BottomMenuButton.qml
index ae7969d..21e0397 100644
--- a/kstars/kstarslite/qml/modules/helpers/BottomMenuButton.qml
+++ b/kstars/kstarslite/qml/modules/helpers/BottomMenuButton.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
import "../../constants/" 1.0
diff --git a/kstars/kstarslite/qml/modules/helpers/KSMenuItem.qml b/kstars/kstarslite/qml/modules/helpers/KSMenuItem.qml
index a1c2aaf..941ae21 100644
--- a/kstars/kstarslite/qml/modules/helpers/KSMenuItem.qml
+++ b/kstars/kstarslite/qml/modules/helpers/KSMenuItem.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
import "../../constants/" 1.0
diff --git a/kstars/kstarslite/qml/modules/helpers/TelescopeControl.qml b/kstars/kstarslite/qml/modules/helpers/TelescopeControl.qml
index dc58de6..1bfff98 100644
--- a/kstars/kstarslite/qml/modules/helpers/TelescopeControl.qml
+++ b/kstars/kstarslite/qml/modules/helpers/TelescopeControl.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
diff --git a/kstars/kstarslite/qml/modules/helpers/TimeSpinBox.qml b/kstars/kstarslite/qml/modules/helpers/TimeSpinBox.qml
index dd5a5e2..2b00f6f 100644
--- a/kstars/kstarslite/qml/modules/helpers/TimeSpinBox.qml
+++ b/kstars/kstarslite/qml/modules/helpers/TimeSpinBox.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.6
import "../../constants" 1.0
diff --git a/kstars/kstarslite/qml/modules/helpers/TopMenuButton.qml b/kstars/kstarslite/qml/modules/helpers/TopMenuButton.qml
index 1482f17..1fdf804 100644
--- a/kstars/kstarslite/qml/modules/helpers/TopMenuButton.qml
+++ b/kstars/kstarslite/qml/modules/helpers/TopMenuButton.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.6
import QtQuick.Controls 2.0
import QtGraphicalEffects 1.0
diff --git a/kstars/kstarslite/qml/modules/menus/ContextMenu.qml b/kstars/kstarslite/qml/modules/menus/ContextMenu.qml
index 251db3f..38b2720 100644
--- a/kstars/kstarslite/qml/modules/menus/ContextMenu.qml
+++ b/kstars/kstarslite/qml/modules/menus/ContextMenu.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.7
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/modules/popups/ColorSchemePopup.qml b/kstars/kstarslite/qml/modules/popups/ColorSchemePopup.qml
index afc8c1e..2b92c01 100644
--- a/kstars/kstarslite/qml/modules/popups/ColorSchemePopup.qml
+++ b/kstars/kstarslite/qml/modules/popups/ColorSchemePopup.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.6
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/modules/popups/FOVPopup.qml b/kstars/kstarslite/qml/modules/popups/FOVPopup.qml
index afb7abd..9cfc7d2 100644
--- a/kstars/kstarslite/qml/modules/popups/FOVPopup.qml
+++ b/kstars/kstarslite/qml/modules/popups/FOVPopup.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.6
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/modules/popups/ProjectionsPopup.qml b/kstars/kstarslite/qml/modules/popups/ProjectionsPopup.qml
index ee0a0d6..3a4ec47 100644
--- a/kstars/kstarslite/qml/modules/popups/ProjectionsPopup.qml
+++ b/kstars/kstarslite/qml/modules/popups/ProjectionsPopup.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick.Controls 2.0
import QtQuick 2.6
import QtQuick.Layouts 1.1
diff --git a/kstars/kstarslite/qml/modules/tutorial/TutorialExitPopup.qml b/kstars/kstarslite/qml/modules/tutorial/TutorialExitPopup.qml
index bb2f2e7..b68a945 100644
--- a/kstars/kstarslite/qml/modules/tutorial/TutorialExitPopup.qml
+++ b/kstars/kstarslite/qml/modules/tutorial/TutorialExitPopup.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/tutorial/TutorialPane.qml b/kstars/kstarslite/qml/modules/tutorial/TutorialPane.qml
index 894cb83..8b3737b 100644
--- a/kstars/kstarslite/qml/modules/tutorial/TutorialPane.qml
+++ b/kstars/kstarslite/qml/modules/tutorial/TutorialPane.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/tutorial/TutorialPopup.qml b/kstars/kstarslite/qml/modules/tutorial/TutorialPopup.qml
index 4b944c9..7546c53 100644
--- a/kstars/kstarslite/qml/modules/tutorial/TutorialPopup.qml
+++ b/kstars/kstarslite/qml/modules/tutorial/TutorialPopup.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/tutorial/TutorialStep1.qml b/kstars/kstarslite/qml/modules/tutorial/TutorialStep1.qml
index 274bba6..f1bd6b0 100644
--- a/kstars/kstarslite/qml/modules/tutorial/TutorialStep1.qml
+++ b/kstars/kstarslite/qml/modules/tutorial/TutorialStep1.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/tutorial/TutorialStep2.qml b/kstars/kstarslite/qml/modules/tutorial/TutorialStep2.qml
index 7801332..97b5bed 100644
--- a/kstars/kstarslite/qml/modules/tutorial/TutorialStep2.qml
+++ b/kstars/kstarslite/qml/modules/tutorial/TutorialStep2.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/tutorial/TutorialStep3.qml b/kstars/kstarslite/qml/modules/tutorial/TutorialStep3.qml
index 188fdf5..3a2dd15 100644
--- a/kstars/kstarslite/qml/modules/tutorial/TutorialStep3.qml
+++ b/kstars/kstarslite/qml/modules/tutorial/TutorialStep3.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/tutorial/TutorialStep4.qml b/kstars/kstarslite/qml/modules/tutorial/TutorialStep4.qml
index 7e4edf5..f7ef28c 100644
--- a/kstars/kstarslite/qml/modules/tutorial/TutorialStep4.qml
+++ b/kstars/kstarslite/qml/modules/tutorial/TutorialStep4.qml
@@ -1,4 +1,13 @@
-
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/qml/modules/tutorial/TutorialStep5.qml b/kstars/kstarslite/qml/modules/tutorial/TutorialStep5.qml
index b20d640..e86b555 100644
--- a/kstars/kstarslite/qml/modules/tutorial/TutorialStep5.qml
+++ b/kstars/kstarslite/qml/modules/tutorial/TutorialStep5.qml
@@ -1,3 +1,13 @@
+// Copyright (C) 2016 Artem Fedoskin <afedoskin3@gmail.com>
+/***************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+***************************************************************************/
+
import QtQuick 2.7
import QtQuick.Controls 2.0
diff --git a/kstars/kstarslite/skyitems/rootnode.h b/kstars/kstarslite/skyitems/rootnode.h
index cd2e4c1..93be1f9 100644
--- a/kstars/kstarslite/skyitems/rootnode.h
+++ b/kstars/kstarslite/skyitems/rootnode.h
@@ -58,6 +58,12 @@ class TelescopeSymbolsItem;
* A QSGClipNode derived class used as a container for holding pointers to nodes and for clipping.
* Upon construction RootNode generates all textures that are used by PointNode.
*
+ * KStars Lite has the following hierarchy:
+ * 1. RootNode - the parent of all nodes that also acts as a clipping node
+ * 2. SkyItem derived nodes that acts like SkyComponent in regular KStars
+ * 3. SkyNode derived nodes that represent SkyObjects (similar to SkyComponent::draw())
+ * 4. Simple nodes like EllipseNode or PointNode that draw basic geometry and stars
+ *
* @short A container for nodes that holds collection of textures for stars and provides clipping
* @author Artem Fedoskin
* @version 1.0
diff --git a/kstars/kstarslite/skyitems/satellitesitem.cpp b/kstars/kstarslite/skyitems/satellitesitem.cpp
index ef993b5..b4475ca 100644
--- a/kstars/kstarslite/skyitems/satellitesitem.cpp
+++ b/kstars/kstarslite/skyitems/satellitesitem.cpp
@@ -31,6 +31,7 @@ SatellitesItem::SatellitesItem(SatellitesComponent *satComp, RootNode *rootNode)
:SkyItem(LabelsItem::label_t::SATELLITE_LABEL, rootNode), m_satComp(satComp)
{
recreateList();
+ Options::setDrawSatellitesLikeStars(false);
}
void SatellitesItem::update() {
diff --git a/kstars/kstarslite/skyitems/skynodes/dsosymbolnode.h b/kstars/kstarslite/skyitems/skynodes/dsosymbolnode.h
index b3d7ab4..e854d98 100644
--- a/kstars/kstarslite/skyitems/skynodes/dsosymbolnode.h
+++ b/kstars/kstarslite/skyitems/skynodes/dsosymbolnode.h
@@ -154,7 +154,7 @@ public:
DSOSymbolNode(DeepSkyObject *skyObject, QColor color = QColor());
/**
- * @short Changes position and rotation angloe of the symbol
+ * @short Changes position and rotation angle of the symbol
* @param pos - new position
* @param positionangle - rotation angle
*/
diff --git a/kstars/kstarslite/skyitems/skynodes/guidelabelnode.h b/kstars/kstarslite/skyitems/skynodes/guidelabelnode.h
index eea5a12..80da23b 100644
--- a/kstars/kstarslite/skyitems/skynodes/guidelabelnode.h
+++ b/kstars/kstarslite/skyitems/skynodes/guidelabelnode.h
@@ -27,7 +27,7 @@ class QSGSimpleTextureNode;
class SkyLabeler;
/** @class GuideLabelNode
- * Currnently this class is not used anywhere.
+ * Currently this class is not used anywhere.
*
*@author Artem Fedoskin
*@version 1.0
diff --git a/kstars/kstarslite/skyitems/skynodes/horizonnode.h b/kstars/kstarslite/skyitems/skynodes/horizonnode.h
index 92bb613..681473f 100644
--- a/kstars/kstarslite/skyitems/skynodes/horizonnode.h
+++ b/kstars/kstarslite/skyitems/skynodes/horizonnode.h
@@ -20,7 +20,8 @@
class PolyNode;
/** @class HorizonNode
- * @short This node is a parent of nodes that comprise horizon and both filled and non-filled ground
+ * @short This node acts as a parent of nodes that comprise horizon and both filled and non-filled
+ * ground
*
* @version 1.0
* @author Artem Fedoskin
diff --git a/kstars/kstarslite/skyitems/skynodes/labelnode.cpp b/kstars/kstarslite/skyitems/skynodes/labelnode.cpp
index cb11efd..80a5621 100644
--- a/kstars/kstarslite/skyitems/skynodes/labelnode.cpp
+++ b/kstars/kstarslite/skyitems/skynodes/labelnode.cpp
@@ -1,7 +1,7 @@
/** *************************************************************************
- pointsourcenode.cpp - K Desktop Planetarium
+ labelnode.cpp - K Desktop Planetarium
-------------------
- begin : 16/06/2016
+ begin : 09/06/2016
copyright : (C) 2016 by Artem Fedoskin
email : afedoskin3@gmail.com
***************************************************************************/
diff --git a/kstars/kstarslite/skyitems/skynodes/labelnode.h b/kstars/kstarslite/skyitems/skynodes/labelnode.h
index 2a31677..3ca3af6 100644
--- a/kstars/kstarslite/skyitems/skynodes/labelnode.h
+++ b/kstars/kstarslite/skyitems/skynodes/labelnode.h
@@ -24,53 +24,56 @@ class SkyMapLite;
class PointNode;
class QSGSimpleTextureNode;
class SkyLabeler;
-
-/** @class LabelNode
- *
- * A SkyNode derived class used for displaying PointNode with coordinates provided by SkyObject.
- *
- *@short A SkyNode derived class that represents stars and objects that are drawn as stars
- *@author Artem Fedoskin
- *@version 1.0
- */
-
class RootNode;
+ /** @class LabelNode
+ *
+ *@short A SkyNode derived class used for displaying labels
+ *@author Artem Fedoskin
+ *@version 1.0
+ */
+
class LabelNode : public SkyNode {
public:
/**
- * @short Constructor
- * @param skyObject pointer to SkyObject that has to be displayed on SkyMapLite
- * @param parentNode pointer to the top parent node, which holds texture cache
- * @param spType spectral class of PointNode
- * @param size initial size of PointNode
+ * @short Constructor. Use name of skyObject as a text
+ * @param skyObject - target object, for which this label is created.
+ * @param type - type of label (corresponds to type of SkyObject)
*/
LabelNode(SkyObject * skyObject, LabelsItem::label_t type);
- /** does the same as above function but with QString instead of skyObject **/
+ /**
+ * @short Constructor. Use string parameter name as a text
+ * @param skyObject - text of label
+ * @param type - type of label (corresponds to type of SkyObject)
+ */
LabelNode(QString name, LabelsItem::label_t type);
+ /**
+ * @short Destructor.
+ */
virtual ~LabelNode();
- void initialize();
-
/**
- * @short changePos changes the position m_point
- * @param pos new position
+ * @short Convenience function to not to repeat the same code in 2 constructors. Set parameters of label
+ * based on its type
*/
- virtual void changePos(QPointF pos) override;
+ void initialize();
/**
- * @short setLabelPos sets the position of label with the given offset from SkyObject's position and
- * makes the label visible if it was hidden
- * @param pos position of label
+ * @short Changes position of the label
+ * @param pos - new position
*/
- void setLabelPos(QPointF pos);
+ virtual void changePos(QPointF pos) override;
inline QString name() { return m_name; }
inline LabelsItem::label_t labelType() { return m_labelType; }
+ /**
+ * @short Create texture from label's name
+ * @param color - color of the label
+ */
void createTexture(QColor color = QColor());
/**
@@ -78,9 +81,22 @@ public:
*/
inline bool zoomFont() { return m_zoomFont; }
+ /**
+ * @short set the position of label with the given offset from SkyObject's position and
+ * makes the label visible if it was hidden
+ * @warning Keep mind that to update labels position, you should first set it with setLabelPos()
+ * and then call update()
+ * @param pos position of label
+ */
+ void setLabelPos(QPointF pos);
+
+ /**
+ * @short Update position of label according to labelPos and recreate texture if label's size
+ * depends on zoom level
+ */
void update();
- QPointF labelPos;
+ QPointF labelPos;
private:
QString m_name;
QSGSimpleTextureNode *m_textTexture;
diff --git a/kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.cpp b/kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.cpp
index bf01d60..337bfc2 100644
--- a/kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.cpp
+++ b/kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.cpp
@@ -24,7 +24,7 @@
EllipseNode::EllipseNode(QColor color, int width)
:m_geometryNode(new QSGGeometryNode), m_geometry(0),
m_material(new QSGFlatColorMaterial), m_width(-1), m_height(-1), m_x(-1),
- m_y(-1), m_fillMode(false)
+ m_y(-1)
{
m_geometry = new QSGGeometry (QSGGeometry::defaultAttributes_Point2D(),0);
m_geometry->allocate(60);
@@ -40,7 +40,6 @@ EllipseNode::EllipseNode(QColor color, int width)
setLineWidth(width);
appendChildNode(m_geometryNode);
- //updateGeometry(0,0,0,0,m_fillMode); //Initialize ellipse to 0 width/height and coordinates
}
void EllipseNode::setColor(QColor color) {
diff --git a/kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.h b/kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.h
index 0aa8178..9ddb6c7 100644
--- a/kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.h
+++ b/kstars/kstarslite/skyitems/skynodes/nodes/ellipsenode.h
@@ -1,7 +1,7 @@
/** *************************************************************************
polynode.h - K Desktop Planetarium
-------------------
- begin : 28/05/2016
+ begin : 22/06/2016
copyright : (C) 2016 by Artem Fedoskin
email : afedoskin3@gmail.com
***************************************************************************/
@@ -15,18 +15,14 @@
***************************************************************************/
#ifndef ELLIPSENODE_H_
#define ELLIPSENODE_H_
-//#include "../../skyopacitynode.h"
#include <QSGNode>
#include <QColor>
-/** @class PolyNode
+/** @class EllipseNode
*
- * A QSGOpacityNode derived class used for representing stars and planets as stars. Upon
- * construction loads the texture of star cached in parentNode
- *
- *@short QSGOpacityNode derived class that represents stars and planets using cached QSGTexture
- *@author Artem Fedoskin
- *@version 1.0
+ * @short QSGTransformNode derrived node used to draw ellipses
+ * @author Artem Fedoskin
+ * @version 1.0
*/
class QSGGeometryNode;
@@ -39,9 +35,12 @@ public:
void setColor(QColor color);
void setLineWidth(int width);
- void setFillMode(bool fillMode) { m_fillMode = fillMode; }
-
+ /**
+ * @short Redraw ellipse with the given width, height and positions (x,y)
+ * @param filled - if true the ellipse will be filled with color
+ */
void updateGeometry(float x, float y, int width, int height, bool filled);
+
private:
QSGGeometryNode *m_geometryNode;
QSGGeometry *m_geometry;
@@ -52,8 +51,6 @@ private:
float m_x;
float m_y;
-
- bool m_fillMode;
};
#endif
diff --git a/kstars/kstarslite/skyitems/skynodes/nodes/linenode.cpp b/kstars/kstarslite/skyitems/skynodes/nodes/linenode.cpp
index 0462092..81b56ff 100644
--- a/kstars/kstarslite/skyitems/skynodes/nodes/linenode.cpp
+++ b/kstars/kstarslite/skyitems/skynodes/nodes/linenode.cpp
@@ -1,7 +1,7 @@
/** *************************************************************************
linenode.cpp - K Desktop Planetarium
-------------------
- begin : 05/05/2016
+ begin : 05/06/2016
copyright : (C) 2016 by Artem Fedoskin
email : afedoskin3@gmail.com
***************************************************************************/
diff --git a/kstars/kstarslite/skyitems/skynodes/nodes/linenode.h b/kstars/kstarslite/skyitems/skynodes/nodes/linenode.h
index b5dbedf..4a3c338 100644
--- a/kstars/kstarslite/skyitems/skynodes/nodes/linenode.h
+++ b/kstars/kstarslite/skyitems/skynodes/nodes/linenode.h
@@ -1,7 +1,7 @@
/** *************************************************************************
linenode.h - K Desktop Planetarium
-------------------
- begin : 05/05/2016
+ begin : 05/06/2016
copyright : (C) 2016 by Artem Fedoskin
email : afedoskin3@gmail.com
***************************************************************************/
@@ -26,28 +26,23 @@ class SkipList;
/** @class LineNode
*
- * A QSGGeometryNode derived class used for representing stars and planets as stars. Upon
- * construction loads the texture of star cached in parentNode
*
- *@short QSGOpacityNode derived class that represents stars and planets using cached QSGTexture
+ *@short SkyOpacityNode derived class that draws lines from LineList
*@author Artem Fedoskin
*@version 1.0
*/
class LineNode : public SkyOpacityNode {
+
public:
/**
* @short Constructor
- * @param spType spectral type
- * @param parentNode pointer to the top parent node, which holds texture cache
- * @param size initial size of LineNode
+ * @param lineList - lines that have to be drawn
+ * @param skipList - lines that have to be skipped
+ * @param drawStyle - not used currently
*/
LineNode(LineList *lineList, SkipList *skipList, QColor color, int width, Qt::PenStyle drawStyle);
virtual ~LineNode();
- /**
- * @short setSize update size of LineNode with the given parameter
- * @param size new size of LineNode
- */
void setColor(QColor color);
void setWidth(int width);
@@ -55,7 +50,11 @@ public:
void setStyle(QColor color, int width, Qt::PenStyle drawStyle);
+ /**
+ * @short Update lines based on the visibility of line segments in m_lineList
+ */
void updateGeometry();
+
inline LineList *lineList() { return m_lineList; }
private:
QSGGeometryNode *m_geometryNode;
diff --git a/kstars/kstarslite/skyitems/skynodes/nodes/pointnode.h b/kstars/kstarslite/skyitems/skynodes/nodes/pointnode.h
index e6f5863..14290d8 100644
--- a/kstars/kstarslite/skyitems/skynodes/nodes/pointnode.h
+++ b/kstars/kstarslite/skyitems/skynodes/nodes/pointnode.h
@@ -23,10 +23,10 @@ class SkyMapLite;
/** @class PointNode
*
- * A QSGOpacityNode derived class used for representing stars and planets as stars. Upon
+ * A SkyOpacityNode derived class used for representing stars and planets as stars. Upon
* construction loads the texture of star cached in parentNode
*
- *@short QSGOpacityNode derived class that represents stars and planets using cached QSGTexture
+ *@short SkyOpacityNode derived class that represents stars and planets using cached QSGTexture
*@author Artem Fedoskin
*@version 1.0
*/
diff --git a/kstars/kstarslite/skyitems/skynodes/nodes/polynode.cpp b/kstars/kstarslite/skyitems/skynodes/nodes/polynode.cpp
index cec2879..5d224a4 100644
--- a/kstars/kstarslite/skyitems/skynodes/nodes/polynode.cpp
+++ b/kstars/kstarslite/skyitems/skynodes/nodes/polynode.cpp
@@ -1,7 +1,7 @@
/** *************************************************************************
polynode.cpp - K Desktop Planetarium
-------------------
- begin : 28/05/2016
+ begin : 28/06/2016
copyright : (C) 2016 by Artem Fedoskin
email : afedoskin3@gmail.com
***************************************************************************/
diff --git a/kstars/kstarslite/skyitems/skynodes/nodes/polynode.h b/kstars/kstarslite/skyitems/skynodes/nodes/polynode.h
index 9cdd747..f78dbff 100644
--- a/kstars/kstarslite/skyitems/skynodes/nodes/polynode.h
+++ b/kstars/kstarslite/skyitems/skynodes/nodes/polynode.h
@@ -1,7 +1,7 @@
/** *************************************************************************
polynode.h - K Desktop Planetarium
-------------------
- begin : 28/05/2016
+ begin : 28/06/2016
copyright : (C) 2016 by Artem Fedoskin
email : afedoskin3@gmail.com
***************************************************************************/
@@ -17,15 +17,13 @@
#define POLYNODE_H_
#include "../../skyopacitynode.h"
-/** @class PolyNode
- *
- * A QSGOpacityNode derived class used for representing stars and planets as stars. Upon
- * construction loads the texture of star cached in parentNode
- *
- *@short QSGOpacityNode derived class that represents stars and planets using cached QSGTexture
- *@author Artem Fedoskin
- *@version 1.0
- */
+ /** @class PolyNode
+ *
+ * @short A SkyOpacityNode derived class used for drawing of polygons (both filled and non-filled)
+ *
+ * @author Artem Fedoskin
+ * @version 1.0
+ */
class QSGGeometryNode;
class QSGGeometry;
@@ -33,11 +31,23 @@ class QSGFlatColorMaterial;
class PolyNode : public SkyOpacityNode {
public:
+ /**
+ * @short Constructor. Initialize geometry and material
+ */
PolyNode();
void setColor(QColor color);
+
+ /**
+ * @short Set thickness of border line
+ */
void setLineWidth(int width);
+ /**
+ * @short Update the geometry of polygon
+ * @param polygon - polygon that needs to be drawn
+ * @param filled - true if it should be filled
+ */
void updateGeometry(const QPolygonF &polygon, bool filled);
private:
QSGGeometryNode *m_geometryNode;
diff --git a/kstars/kstarslite/skyitems/skynodes/nodes/rectnode.h b/kstars/kstarslite/skyitems/skynodes/nodes/rectnode.h
index 161edf4..dc970b3 100644
--- a/kstars/kstarslite/skyitems/skynodes/nodes/rectnode.h
+++ b/kstars/kstarslite/skyitems/skynodes/nodes/rectnode.h
@@ -18,12 +18,9 @@
/** @class RectNode
*
- * A QSGGeometryNode derived node that encapsulates everything needed for drawing both filled and
- * non-filled rectangles
- *
- *@short QSGGeometryNode derived class that draws filled and non-filled rectangles
- *@author Artem Fedoskin
- *@version 1.0
+ * @short QSGGeometryNode derived class that draws filled and non-filled rectangles
+ * @author Artem Fedoskin
+ * @version 1.0
*/
#include <QColor>
#include <QSGGeometryNode>
diff --git a/kstars/kstarslite/skyitems/skynodes/planetmoonsnode.h b/kstars/kstarslite/skyitems/skynodes/planetmoonsnode.h
index c99d72e..31db896 100644
--- a/kstars/kstarslite/skyitems/skynodes/planetmoonsnode.h
+++ b/kstars/kstarslite/skyitems/skynodes/planetmoonsnode.h
@@ -25,18 +25,18 @@ class PointSourceNode;
class KSPlanetBase;
class QSGSimpleTextureNode;
-/** @class PlanetMoonsNode
- *
- * A SkyNode derived class used as a container for displaying a planet with its moons (if any). Unlike
- * PlanetMoons derived from SkyComponent PlanetMoonsNode represents both planet and moons. Ths PlanetNode
- * shouldn't be instantiated outside of this class (exception is AsteroidsItem). Although all SkyNodes
- * are "movable" objects (they change transform matrix to move across the SkyMapLite) this class is
- * just a container that provides z-order for moons and planets that change their positions on their own.
- *
- *@short A container for planets and moons that provides z-order.
- *@author Artem Fedoskin
- *@version 1.0
- */
+ /** @class PlanetMoonsNode
+ *
+ * A SkyNode derived class used as a container for displaying a planet with its moons (if any). Unlike
+ * PlanetMoons derived from SkyComponent PlanetMoonsNode represents both planet and moons. Ths PlanetNode
+ * shouldn't be instantiated outside of this class (exception is AsteroidsItem). Although all SkyNodes
+ * are "movable" objects (they change transform matrix to move across the SkyMapLite) this class is
+ * just a container that provides z-order for moons and planets that change their positions on their own.
+ *
+ *@short A container for planets and moons that provides z-order.
+ *@author Artem Fedoskin
+ *@version 1.0
+ */
class PlanetMoonsNode : public SkyNode {
public:
@@ -64,11 +64,6 @@ public:
* @short Hides both planet and its moons
*/
virtual void hide() override;
- /**
- * @note PlanetMoonsNode is not meant to be moved. PlanetNode and PointSourceNodes handle this on
- * their own.
- */
- //virtual void changePos(QPointF pos) { }
/**
* Update position of moons if planet has them. To allow z-ordering we need to change the structure
diff --git a/kstars/kstarslite/skyitems/skynodes/planetnode.h b/kstars/kstarslite/skyitems/skynodes/planetnode.h
index 5fefc72..565052d 100644
--- a/kstars/kstarslite/skyitems/skynodes/planetnode.h
+++ b/kstars/kstarslite/skyitems/skynodes/planetnode.h
@@ -26,16 +26,16 @@ class PointNode;
class LabelNode;
#include "../labelsitem.h"
-/** @class PlanetNode
- *
- * A SkyNode derived class used as a container for holding two other nodes: PointNode
- * and QSGSimpleTextureNode(displays object as image) that are displayed depending according to the
- * conditions (zoom level, user options)
- *
- *@short A container for PointNode and QSGSimpleTextureNode used for displaying some solar system objects
- *@author Artem Fedoskin
- *@version 1.0
- */
+ /** @class PlanetNode
+ *
+ * A SkyNode derived class used as a container for holding two other nodes: PointNode
+ * and QSGSimpleTextureNode(displays object as image) that are displayed depending according to the
+ * conditions (zoom level, user options)
+ *
+ *@short A container for PointNode and QSGSimpleTextureNode used for displaying some solar system objects
+ *@author Artem Fedoskin
+ *@version 1.0
+ */
class PlanetNode : public SkyNode {
public:
diff --git a/kstars/kstarslite/skyitems/skynodes/satellitenode.cpp b/kstars/kstarslite/skyitems/skynodes/satellitenode.cpp
index be32388..a223883 100644
--- a/kstars/kstarslite/skyitems/skynodes/satellitenode.cpp
+++ b/kstars/kstarslite/skyitems/skynodes/satellitenode.cpp
@@ -37,17 +37,17 @@ void SatelliteNode::initLines() {
delete m_point;
m_point = 0;
}
-
if(!m_lines) {
m_lines = new QSGGeometryNode;
- m_opacity->appendChildNode(m_lines);
m_geometry = new QSGGeometry (QSGGeometry::defaultAttributes_Point2D(),0);
m_lines->setGeometry(m_geometry);
m_lines->setFlag(QSGNode::OwnsGeometry);
+ m_geometry->setDrawingMode(GL_LINES);
m_material = new QSGFlatColorMaterial;
m_lines->setOpaqueMaterial(m_material);
m_lines->setFlag(QSGNode::OwnsMaterial);
+ addChildNode(m_lines);
m_geometry->allocate(8);
QSGGeometry::Point2D * vertex = m_geometry->vertexDataAsPoint2D();
@@ -56,6 +56,9 @@ void SatelliteNode::initLines() {
vertex[2].set( 0.5, -0.5); vertex[3].set(0.5,0.5);
vertex[4].set( 0.5, 0.5); vertex[5].set(-0.5,0.5);
vertex[6].set( -0.5, 0.5); vertex[7].set(-0.5,-0.5);
+
+ m_lines->markDirty(QSGNode::DirtyGeometry);
+ m_lines->markDirty(QSGNode::DirtyMaterial);
}
}
@@ -66,7 +69,7 @@ void SatelliteNode::initPoint() {
}
if(!m_point) {
m_point = new PointNode(m_rootNode, 'B', 3.5);
- m_opacity->appendChildNode(m_point);
+ addChildNode(m_point);
}
}
@@ -88,7 +91,7 @@ void SatelliteNode::update() {
}
show();
- if ( true ) {
+ if ( Options::drawSatellitesLikeStars() ) {
initPoint();
} else {
QColor color;
diff --git a/kstars/kstarslite/skyitems/skynodes/satellitenode.h b/kstars/kstarslite/skyitems/skynodes/satellitenode.h
index 29c8732..a23ac00 100644
--- a/kstars/kstarslite/skyitems/skynodes/satellitenode.h
+++ b/kstars/kstarslite/skyitems/skynodes/satellitenode.h
@@ -23,18 +23,37 @@ class PointNode;
class QSGFlatColorMaterial;
class LabelNode;
-/** @class SatelliteNode
- *
- *@version 1.0
- */
+ /** @class SatelliteNode
+ *
+ *@short A SkyNode derived class that represents satellite
+ *@author Artem Fedoskin
+ *@version 1.0
+ */
class SatelliteNode : public SkyNode {
public:
+ /**
+ * @short Constructor.
+ * @param sat - satellite that is represented by this node
+ * @param rootNode - pointer to the top parent node
+ */
SatelliteNode(Satellite* sat, RootNode *rootNode);
- void update();
+ /**
+ * @short Update position and visibility of satellite.
+ * We also check user settings (Options::drawSatellitesLikeStars()) and based on that draw satellite
+ * either like star or with lines
+ */
+ virtual void update() override;
virtual void hide() override;
+
+ /**
+ * @short Initialize m_lines (if not already) to draw satellite with lines
+ */
void initLines();
+ /**
+ * @short Initialize m_point (if not already) to draw satellite as a star
+ */
void initPoint();
void changePos(QPointF pos);
diff --git a/kstars/kstarslite/skyitems/skynodes/skynode.h b/kstars/kstarslite/skyitems/skynodes/skynode.h
index 9e1727a..7a5ed17 100644
--- a/kstars/kstarslite/skyitems/skynodes/skynode.h
+++ b/kstars/kstarslite/skyitems/skynodes/skynode.h
@@ -49,7 +49,7 @@ public:
* @return pointer to current projector of SkyMapLite
*/
- // All children nodes allocated on heap are deleted automatically
+ // All children nodes allocated on heap are deleted when parent is destroyed
virtual ~SkyNode() { }
inline const Projector* projector() { return SkyMapLite::Instance()->projector(); }
diff --git a/kstars/kstarslite/skyitems/skynodes/skypolygonnode.cpp b/kstars/kstarslite/skyitems/skynodes/skypolygonnode.cpp
index ca35a01..979fe9c 100644
--- a/kstars/kstarslite/skyitems/skynodes/skypolygonnode.cpp
+++ b/kstars/kstarslite/skyitems/skynodes/skypolygonnode.cpp
@@ -53,7 +53,6 @@ void SkyPolygonNode::update(bool forceClip) {
return;
}
-
SkyPoint* pLast = points->last();
QPointF oLast = m_proj->toScreen( pLast, true, &isVisibleLast );
// & with the result of checkVisibility to clip away things below horizon
diff --git a/kstars/kstarslite/skyitems/skynodes/skypolygonnode.h b/kstars/kstarslite/skyitems/skynodes/skypolygonnode.h
index 5f57936..46b6bdb 100644
--- a/kstars/kstarslite/skyitems/skynodes/skypolygonnode.h
+++ b/kstars/kstarslite/skyitems/skynodes/skypolygonnode.h
@@ -19,18 +19,31 @@
class PolyNode;
-/** @class HorizonNode
- *
- *@version 1.0
- */
+ /** @class SkyPolygonNode
+ *
+ * @short A SkyNode derived class that represents polygon (either filled or non-filled)
+ * One of the applications of this class is drawing of Milky Way.
+ * @author Artem Fedoskin
+ * @version 1.0
+ */
class SkyPolygonNode : public SkyNode {
public:
+ /**
+ * @short Constructor.
+ * @param list - Used of lines that comprise polygon
+ */
SkyPolygonNode(LineList* list);
+ /**
+ * @short Update position and visibility of this polygon.
+ * @note This is not an overridden function because it requires a parameter
+ * @param forceClip - true if a polygon should be clipped
+ */
void update(bool forceClip = true);
virtual void hide() override;
LineList *lineList() { return m_list; }
+
void setColor(QColor color);
private:
LineList *m_list;
diff --git a/kstars/kstarslite/skyitems/skynodes/skytexturenode.cpp b/kstars/kstarslite/skyitems/skynodes/skytexturenode.cpp
deleted file mode 100644
index c30cca6..0000000
--- a/kstars/kstarslite/skyitems/skynodes/skytexturenode.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-/** *************************************************************************
- skytexturenode.cpp - K Desktop Planetarium
- -------------------
- begin : 20/05/2016
- copyright : (C) 2016 by Artem Fedoskin
- email : afedoskin3@gmail.com
- ***************************************************************************/
-/** *************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
diff --git a/kstars/kstarslite/skyitems/skynodes/skytexturenode.h b/kstars/kstarslite/skyitems/skynodes/skytexturenode.h
deleted file mode 100644
index 7d032c2..0000000
--- a/kstars/kstarslite/skyitems/skynodes/skytexturenode.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/** *************************************************************************
- skytexturenode.h - K Desktop Planetarium
- -------------------
- begin : 20/05/2016
- copyright : (C) 2016 by Artem Fedoskin
- email : afedoskin3@gmail.com
- ***************************************************************************/
-/** *************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
diff --git a/kstars/kstarslite/skyitems/skynodes/supernovanode.cpp b/kstars/kstarslite/skyitems/skynodes/supernovanode.cpp
index d723849..75f21c4 100644
--- a/kstars/kstarslite/skyitems/skynodes/supernovanode.cpp
+++ b/kstars/kstarslite/skyitems/skynodes/supernovanode.cpp
@@ -29,7 +29,26 @@ SupernovaNode::SupernovaNode(Supernova *snova)
}
-void SupernovaNode::init(QColor color) {
+void SupernovaNode::update() {
+ KStarsData *data = KStarsData::Instance();
+ const Projector *m_proj = SkyMapLite::Instance()->projector();
+ if( !m_proj->checkVisibility(m_snova) ) {
+ hide();
+ return;
+ }
+
+ bool visible = false;
+ QPointF pos = m_proj->toScreen(m_snova,true,&visible);
+ //qDebug()<<"sup->ra() = "<<(sup->ra()).toHMSString()<<"sup->dec() = "<<sup->dec().toDMSString();
+ //qDebug()<<"pos = "<<pos<<"m_proj->onScreen(pos) = "<<m_proj->onScreen(pos);
+ if( !visible || !m_proj->onScreen(pos) ) {
+ hide();
+ return;
+ }
+
+ QColor color = data->colorScheme()->colorNamed("SupernovaColor");
+
+ //Initialize m_lines if not already done
if(!m_lines) {
m_lines = new QSGGeometryNode;
m_geometry = new QSGGeometry (QSGGeometry::defaultAttributes_Point2D(),0);
@@ -52,31 +71,9 @@ void SupernovaNode::init(QColor color) {
m_material->setColor(color);
m_lines->markDirty(QSGNode::DirtyMaterial);
}
-}
-
-void SupernovaNode::update() {
- KStarsData *data = KStarsData::Instance();
- const Projector *m_proj = SkyMapLite::Instance()->projector();
- if( !m_proj->checkVisibility(m_snova) ) {
- hide();
- return;
- }
-
- bool visible = false;
- QPointF pos = m_proj->toScreen(m_snova,true,&visible);
- //qDebug()<<"sup->ra() = "<<(sup->ra()).toHMSString()<<"sup->dec() = "<<sup->dec().toDMSString();
- //qDebug()<<"pos = "<<pos<<"m_proj->onScreen(pos) = "<<m_proj->onScreen(pos);
- if( !visible || !m_proj->onScreen(pos) ) {
- hide();
- return;
- }
-
- QColor color = data->colorScheme()->colorNamed("SupernovaColor");
- init(color);
changePos(pos);
- //qDebug()<<"Here"<<endl;
return;
}
diff --git a/kstars/kstarslite/skyitems/skynodes/supernovanode.h b/kstars/kstarslite/skyitems/skynodes/supernovanode.h
index eeae94f..2949ada 100644
--- a/kstars/kstarslite/skyitems/skynodes/supernovanode.h
+++ b/kstars/kstarslite/skyitems/skynodes/supernovanode.h
@@ -22,18 +22,25 @@ class Supernova;
class PointNode;
class QSGFlatColorMaterial;
-/** @class SupernovaNode
- *
- *@version 1.0
- */
+ /** @class SupernovaNode
+ *
+ * @short A SkyNode derived class that represents supernova
+ * @author Artem Fedoskin
+ * @version 1.0
+ */
class SupernovaNode : public SkyNode {
public:
+ /**
+ * @short Constructor.
+ * @param snova - pointer to supernova that needs to be represented by this node
+ */
SupernovaNode(Supernova *snova);
- void update();
-
- void init(QColor color);
+ /**
+ * @short Update position and visibility of supernova. Initialize m_lines if not already done
+ */
+ virtual void update() override;
void changePos(QPointF pos);
diff --git a/kstars/kstarsliteinit.cpp b/kstars/kstarsliteinit.cpp
index fc12543..4f47c83 100644
--- a/kstars/kstarsliteinit.cpp
+++ b/kstars/kstarsliteinit.cpp
@@ -52,6 +52,7 @@ void KStarsLite::datainitFinished() {
Options::setShowHorizon(true);
Options::setShowEcliptic(true);
Options::setAutoSelectGrid(false);
+ Options::setShowSatellites(true);
// Options::setHideGrids(false);
// Options::setShowEquatorialGrid(true);
// Options::setShowHorizontalGrid(true);