summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Fedoskin <afedoskin3@gmail.com>2016-05-16 12:14:38 (GMT)
committerArtem Fedoskin <afedoskin3@gmail.com>2016-05-16 12:14:38 (GMT)
commit5a45a75d35a29ffad1cb579df46a1c73e92e2265 (patch)
tree28680444a076e5a7630d97048fdefd2942d37a17
parentbad8ee292438a94f4bc535d5fe7f6bc0c72b91b8 (diff)
Setup KStars Lite build for Android. Except for a pair of classes, only
those classes that KStars Lite uses are left. QML files are now installed and used from platforms application data directory. Works well on desktop but on Android shows black screen (probably QML files can't be loaded. Need to investigate this further)
-rw-r--r--CMakeLists.txt7
-rw-r--r--apk/AndroidManifest.xml37
-rw-r--r--apk/res/drawable/kstars.pngbin0 -> 8834 bytes
-rw-r--r--datahandlers/CMakeLists.txt2
-rw-r--r--kstars/CMakeLists.txt363
-rw-r--r--kstars/Options.kcfgc2
-rw-r--r--kstars/auxiliary/colorscheme.cpp38
-rw-r--r--kstars/auxiliary/fov.cpp4
-rw-r--r--kstars/auxiliary/imageviewer.cpp48
-rw-r--r--kstars/auxiliary/ksfilereader.cpp2
-rw-r--r--kstars/kstarsdata.cpp27
-rw-r--r--kstars/kstarsdata.h15
-rw-r--r--kstars/kstarslite.cpp24
-rw-r--r--kstars/kstarslite.h2
-rw-r--r--kstars/kstarslite/qml/CMakeLists.txt21
-rw-r--r--kstars/kstarslite/qml/constants/qmldir1
-rw-r--r--kstars/kstarslite/qml/modules/images/CMakeLists.txt13
-rw-r--r--kstars/kstarslite/qml/modules/images/hdpi/CMakeLists.txt4
-rw-r--r--kstars/kstarslite/qml/modules/images/hdpi/icons/CMakeLists.txt24
-rw-r--r--kstars/kstarslite/qml/modules/images/ldpi/CMakeLists.txt4
-rw-r--r--kstars/kstarslite/qml/modules/images/ldpi/icons/CMakeLists.txt24
-rw-r--r--kstars/kstarslite/qml/modules/images/mdpi/CMakeLists.txt4
-rw-r--r--kstars/kstarslite/qml/modules/images/mdpi/icons/CMakeLists.txt24
-rw-r--r--kstars/kstarslite/qml/modules/images/xhdpi/CMakeLists.txt4
-rw-r--r--kstars/kstarslite/qml/modules/images/xhdpi/icons/CMakeLists.txt24
-rw-r--r--kstars/kstarslite/qml/modules/images/xxhdpi/CMakeLists.txt4
-rw-r--r--kstars/kstarslite/qml/modules/images/xxhdpi/icons/CMakeLists.txt24
-rw-r--r--kstars/kstarslite/qml/modules/images/xxxhdpi/CMakeLists.txt4
-rw-r--r--kstars/kstarslite/qml/modules/images/xxxhdpi/icons/CMakeLists.txt24
-rw-r--r--kstars/main.cpp22
-rw-r--r--kstars/skycomponents/artificialhorizoncomponent.cpp4
-rw-r--r--kstars/skycomponents/asteroidscomponent.cpp16
-rw-r--r--kstars/skycomponents/catalogcomponent.cpp4
-rw-r--r--kstars/skycomponents/cometscomponent.cpp16
-rw-r--r--kstars/skycomponents/constellationartcomponent.cpp5
-rw-r--r--kstars/skycomponents/constellationboundarylines.cpp7
-rw-r--r--kstars/skycomponents/constellationlines.cpp5
-rw-r--r--kstars/skycomponents/constellationnamescomponent.cpp9
-rw-r--r--kstars/skycomponents/deepskycomponent.cpp11
-rw-r--r--kstars/skycomponents/deepstarcomponent.cpp6
-rw-r--r--kstars/skycomponents/ecliptic.cpp4
-rw-r--r--kstars/skycomponents/equator.cpp4
-rw-r--r--kstars/skycomponents/equatorialcoordinategrid.cpp11
-rw-r--r--kstars/skycomponents/flagcomponent.cpp10
-rw-r--r--kstars/skycomponents/horizoncomponent.cpp4
-rw-r--r--kstars/skycomponents/horizontalcoordinategrid.cpp7
-rw-r--r--kstars/skycomponents/linelistindex.cpp2
-rw-r--r--kstars/skycomponents/linelistlabel.cpp4
-rw-r--r--kstars/skycomponents/listcomponent.cpp4
-rw-r--r--kstars/skycomponents/milkyway.cpp7
-rw-r--r--kstars/skycomponents/planetmoonscomponent.cpp2
-rw-r--r--kstars/skycomponents/satellitescomponent.cpp12
-rw-r--r--kstars/skycomponents/skycomponent.h2
-rw-r--r--kstars/skycomponents/skylabeler.cpp4
-rw-r--r--kstars/skycomponents/skymapcomposite.cpp20
-rw-r--r--kstars/skycomponents/skymesh.cpp6
-rw-r--r--kstars/skycomponents/solarsystemcomposite.cpp7
-rw-r--r--kstars/skycomponents/solarsystemlistcomponent.cpp2
-rw-r--r--kstars/skycomponents/starcomponent.cpp8
-rw-r--r--kstars/skycomponents/supernovaecomponent.cpp9
-rw-r--r--kstars/skycomponents/targetlistcomponent.cpp2
-rw-r--r--kstars/skymap.cpp22
-rw-r--r--kstars/skyobjects/deepskyobject.cpp4
-rw-r--r--kstars/skyobjects/ksmoon.cpp4
-rw-r--r--kstars/skyobjects/satellite.cpp4
-rw-r--r--kstars/skyobjects/skyobject.cpp6
-rw-r--r--kstars/skyobjects/starobject.cpp5
-rw-r--r--kstars/skyobjects/supernova.cpp4
-rw-r--r--kstars/skyobjects/trailobject.cpp7
-rw-r--r--kstars/texturemanager.cpp6
-rw-r--r--kstars/time/simclock.cpp2
-rw-r--r--kstars/time/simclock.h14
72 files changed, 804 insertions, 284 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 631a844..83a074d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,6 @@ set (KStars_VERSION_REVISION 0)
option(BUILD_KSTARS_LITE "Build KStars Lite" OFF)
if(BUILD_KSTARS_LITE)
add_definitions(-DKSTARS_LITE)
- include_directories("/opt/android/kde/install/include/KF5")
endif(BUILD_KSTARS_LITE)
# minimal requirements
cmake_minimum_required (VERSION 2.8.12 FATAL_ERROR)
@@ -124,8 +123,10 @@ add_subdirectory(doc)
add_subdirectory(kstars)
add_subdirectory(datahandlers)
-enable_testing(true)
-add_subdirectory(Tests)
+if(NOT BUILD_KSTARS_LITE)
+ enable_testing(true)
+ add_subdirectory(Tests)
+endif(NOT BUILD_KSTARS_LITE)
install(FILES org.kde.kstars.appdata.xml DESTINATION ${KDE_INSTALL_DATAROOTDIR}/appdata/)
diff --git a/apk/AndroidManifest.xml b/apk/AndroidManifest.xml
new file mode 100644
index 0000000..bd76aa4
--- /dev/null
+++ b/apk/AndroidManifest.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.0.3" package="org.kde.hellokandroid" android:installLocation="auto" android:versionCode="7">
+ <application android:name="org.qtproject.qt5.android.bindings.QtApplication"
+ android:label="KStars Lite"
+ android:icon="@drawable/kde">
+ <activity android:name="org.qtproject.qt5.android.bindings.QtActivity"
+ android:label="KStars Lite"
+ android:screenOrientation="unspecified"
+ android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
+ <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
+ <meta-data android:name="android.app.repository" android:value="default"/>
+ <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
+ <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
+ <!-- Deploy Qt libs as part of package -->
+ <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
+ <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
+ <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
+ <!-- Run with local libs -->
+ <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
+ <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
+ <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
+ <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
+ <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
+ <!-- Messages maps -->
+ <meta-data android:name="android.app.ministro_not_found_msg" android:value="@string/ministro_not_found_msg"/>
+ <meta-data android:name="android.app.ministro_needed_msg" android:value="@string/ministro_needed_msg"/>
+ <meta-data android:name="android.app.fatal_error_msg" android:value="@string/fatal_error_msg"/>
+ </activity>
+ </application>
+ <supports-screens android:anyDensity="true" android:normalScreens="true" android:smallScreens="true" android:largeScreens="true"/>
+ <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19"/>
+</manifest>
diff --git a/apk/res/drawable/kstars.png b/apk/res/drawable/kstars.png
new file mode 100644
index 0000000..fccb40b
--- /dev/null
+++ b/apk/res/drawable/kstars.png
Binary files differ
diff --git a/datahandlers/CMakeLists.txt b/datahandlers/CMakeLists.txt
index a7bd664..59ec65c 100644
--- a/datahandlers/CMakeLists.txt
+++ b/datahandlers/CMakeLists.txt
@@ -22,6 +22,6 @@ add_library(LibKSDataHandlers STATIC ${LibKSDataHandlers_SRCS})
if(BUILD_KSTARS_LITE)
target_link_libraries(LibKSDataHandlers KF5::I18n Qt5::Sql Qt5::Core Qt5::Gui)
else(BUILD_KSTARS_LITE)
- target_link_libraries(LibKSDataHandlers KF5::WidgetsAddons Qt5::Sql Qt5::Core Qt5::Gui)
+ target_link_libraries(LibKSDataHandlers KF5::WidgetsAddons KF5::I18n Qt5::Sql Qt5::Core Qt5::Gui)
endif(BUILD_KSTARS_LITE)
diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index 187044b..d6833fe 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -4,7 +4,9 @@ add_subdirectory( htmesh )
if (${KF5_VERSION} VERSION_EQUAL 5.18.0 OR ${KF5_VERSION} VERSION_GREATER 5.18.0)
SET(HAVE_KF5WIT 1)
-add_subdirectory( tools/whatsinteresting/qml)
+if(NOT BUILD_KSTARS_LITE)
+ add_subdirectory( tools/whatsinteresting/qml)
+endif(NOT BUILD_KSTARS_LITE)
else()
SET(HAVE_KF5WIT 0)
endif()
@@ -303,8 +305,6 @@ if(NOT BUILD_KSTARS_LITE)
widgets/unitspinboxwidget.ui
)
- set( kstars_KCFG_SRCS Options.kcfgc )
-
set(kstars_options_SRCS
options/opsadvanced.cpp
options/opscatalog.cpp
@@ -409,8 +409,7 @@ if(NOT BUILD_KSTARS_LITE)
)
endif(NOT BUILD_KSTARS_LITE)
-#Built for both KStars and KStars Lite
-
+set( kstars_KCFG_SRCS Options.kcfgc )
set(libkstarscomponents_SRCS
skycomponents/skylabeler.cpp
skycomponents/highpmstarlist.cpp
@@ -453,8 +452,13 @@ set(libkstarscomponents_SRCS
skycomponents/culturelist.cpp
skycomponents/flagcomponent.cpp
skycomponents/targetlistcomponent.cpp
- skycomponents/notifyupdatesui.cpp
)
+if(NOT BUILD_KSTARS_LITE)
+ set(libkstarscomponents_SRCS
+ ${libkstarscomponents_SRCS}
+ skycomponents/notifyupdatesui.cpp
+ )
+endif(NOT BUILD_KSTARS_LITE)
set(kstars_skyobjects_SRCS
skyobjects/constellationsart.cpp
@@ -488,82 +492,53 @@ set(kstars_projection_SRCS
projections/equirectangularprojector.cpp
)
-if(BUILD_KSTARS_LITE)
- set(kstars_extra_SRCS
- auxiliary/colorscheme.cpp
- auxiliary/dms.cpp
- auxiliary/fov.cpp
- auxiliary/geolocation.cpp
- auxiliary/imageviewer.cpp
- auxiliary/ksfilereader.cpp
- auxiliary/ksuserdb.cpp
- auxiliary/thumbnailpicker.cpp
- auxiliary/thumbnaileditor.cpp
- auxiliary/binfilehelper.cpp
- auxiliary/imageexporter.cpp
- auxiliary/ksutils.cpp
- auxiliary/ksdssimage.cpp
- auxiliary/ksdssdownloader.cpp
- auxiliary/kswizard.cpp
- auxiliary/qcustomplot.cpp
- auxiliary/profileinfo.cpp
- time/simclock.cpp
- time/kstarsdatetime.cpp
- time/timezonerule.cpp
- kstarsdbus.cpp
- ksnumbers.cpp
- kspopupmenu.cpp
- ksalmanac.cpp
- kstarsactions.cpp
- kstarsdata.cpp
- skymap.cpp
- skymapdrawabstract.cpp
- skymapqdraw.cpp
- skymapevents.cpp
- skypainter.cpp
- skyqpainter.cpp
- texturemanager.cpp
+set(kstars_extra_SRCS
+ auxiliary/colorscheme.cpp
+ auxiliary/dms.cpp
+ auxiliary/fov.cpp
+ auxiliary/geolocation.cpp
+ auxiliary/ksfilereader.cpp
+ auxiliary/ksuserdb.cpp
+ auxiliary/binfilehelper.cpp
+ auxiliary/ksutils.cpp
+ auxiliary/ksdssimage.cpp
+ auxiliary/ksdssdownloader.cpp
+ auxiliary/qcustomplot.cpp
+ auxiliary/profileinfo.cpp
+ auxiliary/filedownloader.cpp
+ time/simclock.cpp
+ time/kstarsdatetime.cpp
+ time/timezonerule.cpp
+ #to minimize number of indef KSTARS_LITE
+ skypainter.cpp
+ ksnumbers.cpp
+ kstarsdata.cpp
+ texturemanager.cpp
)
-else(BUILD_KSTARS_LITE)
+
+if(NOT BUILD_KSTARS_LITE)
set(kstars_extra_SRCS
- auxiliary/colorscheme.cpp
- auxiliary/dms.cpp
- auxiliary/fov.cpp
- auxiliary/geolocation.cpp
- auxiliary/imageviewer.cpp
- auxiliary/ksfilereader.cpp
- auxiliary/ksuserdb.cpp
- auxiliary/thumbnailpicker.cpp
- auxiliary/thumbnaileditor.cpp
- auxiliary/binfilehelper.cpp
- auxiliary/imageexporter.cpp
- auxiliary/ksutils.cpp
- auxiliary/ksdssimage.cpp
- auxiliary/ksdssdownloader.cpp
- auxiliary/kswizard.cpp
- auxiliary/qcustomplot.cpp
- auxiliary/profileinfo.cpp
- time/simclock.cpp
- time/kstarsdatetime.cpp
- time/timezonerule.cpp
- kstarsdbus.cpp
- ksnumbers.cpp
- kspopupmenu.cpp
- ksalmanac.cpp
- kstarsactions.cpp
- kstarsdata.cpp
- kstarsinit.cpp
- kstars.cpp
- kstarssplash.cpp
- skymap.cpp
- skymapdrawabstract.cpp
- skymapqdraw.cpp
- skymapevents.cpp
- skypainter.cpp
- skyqpainter.cpp
- texturemanager.cpp
- )
-endif(BUILD_KSTARS_LITE)
+ ${kstars_extra_SRCS}
+ auxiliary/imageviewer.cpp
+ auxiliary/thumbnailpicker.cpp
+ auxiliary/thumbnaileditor.cpp
+ auxiliary/imageexporter.cpp
+ auxiliary/kswizard.cpp
+ kstarsdbus.cpp
+ kspopupmenu.cpp
+ ksalmanac.cpp
+ kstarsactions.cpp
+ kstarsinit.cpp
+ kstars.cpp
+ kstarssplash.cpp
+ skymap.cpp
+ skymapdrawabstract.cpp
+ skymapqdraw.cpp
+ skymapevents.cpp
+ skyqpainter.cpp
+ )
+
+endif(NOT BUILD_KSTARS_LITE)
if(BUILD_KSTARS_LITE)
set(kstarslite_SRCS
@@ -593,99 +568,62 @@ if(BUILD_KSTARS_LITE)
kstarslite/qml/modules/helpers/TopMenuButton.qml
kstarslite/qml/modules/Splash.qml
)
+ add_subdirectory(kstarslite/qml)
ADD_CUSTOM_TARGET(kstarsliteqml SOURCES ${kstarsliteqml_SRCS})
endif(BUILD_KSTARS_LITE)
-set(kstars_extra_SRCS
- auxiliary/colorscheme.cpp
- auxiliary/dms.cpp
- auxiliary/fov.cpp
- auxiliary/geolocation.cpp
- auxiliary/imageviewer.cpp
- auxiliary/ksfilereader.cpp
- auxiliary/ksuserdb.cpp
- auxiliary/thumbnailpicker.cpp
- auxiliary/thumbnaileditor.cpp
- auxiliary/binfilehelper.cpp
- auxiliary/imageexporter.cpp
- auxiliary/ksutils.cpp
- auxiliary/ksdssimage.cpp
- auxiliary/ksdssdownloader.cpp
- auxiliary/kswizard.cpp
- auxiliary/qcustomplot.cpp
- auxiliary/profileinfo.cpp
- auxiliary/filedownloader.cpp
- time/simclock.cpp
- time/kstarsdatetime.cpp
- time/timezonerule.cpp
- kstarsdbus.cpp
- ksnumbers.cpp
- kspopupmenu.cpp
- ksalmanac.cpp
- kstarsactions.cpp
- kstarsdata.cpp
- kstarsinit.cpp
- kstars.cpp
- kstarssplash.cpp
- skymap.cpp
- skymapdrawabstract.cpp
- skymapqdraw.cpp
- skymapevents.cpp
- skypainter.cpp
- skyqpainter.cpp
- texturemanager.cpp
-)
-
-set(oal_SRCS
- oal/log.cpp
- oal/observer.cpp
- oal/site.cpp
- oal/session.cpp
- oal/scope.cpp
- oal/eyepiece.cpp
- oal/filter.cpp
- oal/observation.cpp
- oal/lens.cpp
- oal/equipmentwriter.cpp
- oal/observeradd.cpp
- oal/execute.cpp
-)
+if(NOT BUILD_KSTARS_LITE)
+ set(oal_SRCS
+ oal/log.cpp
+ oal/observer.cpp
+ oal/site.cpp
+ oal/session.cpp
+ oal/scope.cpp
+ oal/eyepiece.cpp
+ oal/filter.cpp
+ oal/observation.cpp
+ oal/lens.cpp
+ oal/equipmentwriter.cpp
+ oal/observeradd.cpp
+ oal/execute.cpp
+ )
-set(printing_SRCS
- printing/detailstable.cpp
- printing/finderchart.cpp
- printing/foveditordialog.cpp
- printing/fovsnapshot.cpp
- printing/kstarsdocument.cpp
- printing/legend.cpp
- printing/loggingform.cpp
- printing/printingwizard.cpp
- printing/pwizchartconfig.cpp
- printing/pwizchartcontents.cpp
- printing/pwizfovbrowse.cpp
- printing/pwizfovconfig.cpp
- printing/pwizfovmanual.cpp
- printing/pwizfovsh.cpp
- printing/pwizfovtypeselection.cpp
- printing/pwizobjectselection.cpp
- printing/pwizprint.cpp
- printing/shfovexporter.cpp
- printing/simplefovexporter.cpp
-)
+ set(printing_SRCS
+ printing/detailstable.cpp
+ printing/finderchart.cpp
+ printing/foveditordialog.cpp
+ printing/fovsnapshot.cpp
+ printing/kstarsdocument.cpp
+ printing/legend.cpp
+ printing/loggingform.cpp
+ printing/printingwizard.cpp
+ printing/pwizchartconfig.cpp
+ printing/pwizchartcontents.cpp
+ printing/pwizfovbrowse.cpp
+ printing/pwizfovconfig.cpp
+ printing/pwizfovmanual.cpp
+ printing/pwizfovsh.cpp
+ printing/pwizfovtypeselection.cpp
+ printing/pwizobjectselection.cpp
+ printing/pwizprint.cpp
+ printing/shfovexporter.cpp
+ printing/simplefovexporter.cpp
+ )
-set(printingui_SRCS
- printing/foveditordialog.ui
- printing/pwizchartconfig.ui
- printing/pwizchartcontents.ui
- printing/pwizfovbrowse.ui
- printing/pwizfovconfig.ui
- printing/pwizfovmanual.ui
- printing/pwizfovsh.ui
- printing/pwizfovtypeselection.ui
- printing/pwizobjectselection.ui
- printing/pwizprint.ui
- printing/pwizwelcome.ui
-)
+ set(printingui_SRCS
+ printing/foveditordialog.ui
+ printing/pwizchartconfig.ui
+ printing/pwizchartcontents.ui
+ printing/pwizfovbrowse.ui
+ printing/pwizfovconfig.ui
+ printing/pwizfovmanual.ui
+ printing/pwizfovsh.ui
+ printing/pwizfovtypeselection.ui
+ printing/pwizobjectselection.ui
+ printing/pwizprint.ui
+ printing/pwizwelcome.ui
+ )
+endif(NOT BUILD_KSTARS_LITE)
set(kstars_SRCS ${indi_SRCS} ${fits_SRCS} ${ekos_SRCS} ${onlineparser_SRCS}
${libkstarswidgets_SRCS} ${libkstarscomponents_SRCS} ${libkstarstools_SRCS}
@@ -694,37 +632,37 @@ set(kstars_SRCS ${indi_SRCS} ${fits_SRCS} ${ekos_SRCS} ${onlineparser_SRCS}
${printing_SRCS} ${kstarslite_SRCS} ${kstarslite_RESOURCE}
)
-if(NOT BUILD_KSTARS_LITE)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.xml kstars.h KStars)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.SimClock.xml simclock.h SimClock)
-endif(NOT BUILD_KSTARS_LITE)
+kconfig_add_kcfg_files(kstars_SRCS ${kstars_KCFG_SRCS})
-if (INDI_FOUND)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.INDI.xml indi/indidbus.h INDIDBus)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.xml ekos/ekosmanager.h EkosManager)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Capture.xml ekos/capture.h Ekos::Capture)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Focus.xml ekos/focus.h Ekos::Focus)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Guide.xml ekos/guide.h Ekos::Guide)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Align.xml ekos/align.h Ekos::Align)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Mount.xml ekos/mount.h Ekos::Mount)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Dome.xml ekos/dome.h Ekos::Dome)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Weather.xml ekos/weather.h Ekos::Weather)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.DustCap.xml ekos/dustcap.h Ekos::DustCap)
-qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Scheduler.xml ekos/scheduler.h Ekos::Scheduler)
-endif(INDI_FOUND)
+if(NOT BUILD_KSTARS_LITE)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.xml kstars.h KStars)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.SimClock.xml simclock.h SimClock)
-kconfig_add_kcfg_files(kstars_SRCS ${kstars_KCFG_SRCS})
+ if (INDI_FOUND)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.INDI.xml indi/indidbus.h INDIDBus)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.xml ekos/ekosmanager.h EkosManager)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Capture.xml ekos/capture.h Ekos::Capture)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Focus.xml ekos/focus.h Ekos::Focus)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Guide.xml ekos/guide.h Ekos::Guide)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Align.xml ekos/align.h Ekos::Align)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Mount.xml ekos/mount.h Ekos::Mount)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Dome.xml ekos/dome.h Ekos::Dome)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Weather.xml ekos/weather.h Ekos::Weather)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.DustCap.xml ekos/dustcap.h Ekos::DustCap)
+ qt5_add_dbus_adaptor(kstars_SRCS org.kde.kstars.Ekos.Scheduler.xml ekos/scheduler.h Ekos::Scheduler)
+ endif(INDI_FOUND)
-ki18n_wrap_ui(kstars_SRCS
- ${indiui_SRCS} ${ui_SRCS} ${fitsui_SRCS} ${ekosui_SRCS} ${xplanetui_SRCS} ${kstars_optionsui_SRCS} ${kstars_dialogsui_SRCS}
- ${printingui_SRCS}
- auxiliary/thumbnailpicker.ui
- auxiliary/thumbnaileditor.ui
- oal/observeradd.ui
- oal/equipmentwriter.ui
- oal/execute.ui
- skycomponents/notifyupdatesui.ui
-)
+ ki18n_wrap_ui(kstars_SRCS
+ ${indiui_SRCS} ${ui_SRCS} ${fitsui_SRCS} ${ekosui_SRCS} ${xplanetui_SRCS} ${kstars_optionsui_SRCS} ${kstars_dialogsui_SRCS}
+ ${printingui_SRCS}
+ auxiliary/thumbnailpicker.ui
+ auxiliary/thumbnaileditor.ui
+ oal/observeradd.ui
+ oal/equipmentwriter.ui
+ oal/execute.ui
+ skycomponents/notifyupdatesui.ui
+ )
+endif(NOT BUILD_KSTARS_LITE)
add_executable(kstars main.cpp)
add_library( KStarsLib STATIC ${kstars_SRCS})
@@ -789,23 +727,26 @@ endif (WCSLIB_FOUND)
target_link_libraries(kstars KStarsLib)
+
install(TARGETS kstars ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
-if(NOT BUILD_KSTARS_LITE)
########### install files ###############
-ecm_install_icons(${KDE_INSTALL_ICONDIR})
-install( PROGRAMS org.kde.kstars.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
+
install( FILES kstars.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR} )
install( FILES kstars.knsrc DESTINATION ${KDE_INSTALL_CONFDIR} )
-if (INDI_FOUND)
-install( FILES kstarsui-indi.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars RENAME kstarsui.rc)
-else (INDI_FOUND)
-install( FILES kstarsui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars )
-endif(INDI_FOUND)
-
-install( FILES fitsviewer.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars )
-if (WIN32)
- install( FILES kstarsui-win.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars )
-endif (WIN32)
-install(FILES kstars.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
-endif(NOT BUILD_KSTARS_LITE)
+ecm_install_icons(${KDE_INSTALL_ICONDIR})
+
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
+ install( PROGRAMS org.kde.kstars.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
+ if (INDI_FOUND)
+ install( FILES kstarsui-indi.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars RENAME kstarsui.rc)
+ else (INDI_FOUND)
+ install( FILES kstarsui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars )
+ endif(INDI_FOUND)
+
+ install( FILES fitsviewer.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars )
+ if (WIN32)
+ install( FILES kstarsui-win.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kstars )
+ endif (WIN32)
+ install(FILES kstars.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
+endif(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
diff --git a/kstars/Options.kcfgc b/kstars/Options.kcfgc
index a38d2ad..106bd12 100644
--- a/kstars/Options.kcfgc
+++ b/kstars/Options.kcfgc
@@ -3,4 +3,4 @@ IncludeFiles=qpoint.h
ClassName=Options
Singleton=yes
Mutators=true
-GenerateProperties=true
+#GenerateProperties=true
diff --git a/kstars/auxiliary/colorscheme.cpp b/kstars/auxiliary/colorscheme.cpp
index 47da657..81be0b0 100644
--- a/kstars/auxiliary/colorscheme.cpp
+++ b/kstars/auxiliary/colorscheme.cpp
@@ -24,7 +24,10 @@
#include <kconfig.h>
#include <QDebug>
#include <KLocalizedString>
+
+#ifndef KSTARS_LITE
#include <KMessageBox>
+#endif
#include <kconfiggroup.h>
#include <KSharedConfig>
@@ -33,7 +36,11 @@
#include "ksutils.h"
#include "Options.h"
#include "skyobjects/starobject.h"
+#ifdef KSTARS_LITE
+#include "skymaplite.h"
+#else
#include "skyqpainter.h"
+#endif
ColorScheme::ColorScheme() : FileName() {
//Each color has two names associated with it. The KeyName is its
@@ -237,7 +244,11 @@ bool ColorScheme::save( const QString &name ) {
if ( file.exists() || !file.open( QIODevice::ReadWrite | QIODevice::Append ) ) {
QString message = i18n( "Local color scheme file could not be opened.\nScheme cannot be recorded." );
- KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) );
+ #ifndef KSTARS_LITE
+ KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) );
+ #else
+ qDebug() << message << i18n( "Could Not Open File" );
+ #endif
return false;
} else {
QTextStream stream( &file );
@@ -252,7 +263,11 @@ bool ColorScheme::save( const QString &name ) {
if ( !file.open( QIODevice::ReadWrite | QIODevice::Append ) ) {
QString message = i18n( "Local color scheme index file could not be opened.\nScheme cannot be recorded." );
- KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) );
+ #ifndef KSTARS_LITE
+ KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) );
+ #else
+ qDebug() << message << i18n( "Could Not Open File" );
+ #endif
return false;
} else {
QTextStream stream( &file );
@@ -261,7 +276,11 @@ bool ColorScheme::save( const QString &name ) {
}
} else {
QString message = i18n( "Invalid filename requested.\nScheme cannot be recorded." );
- KMessageBox::sorry( 0, message, i18n( "Invalid Filename" ) );
+ #ifndef KSTARS_LITE
+ KMessageBox::sorry( 0, message, i18n( "Could Not Open File" ) );
+ #else
+ qDebug() << message << i18n( "Invalid Filename" );
+ #endif
return false;
}
@@ -295,13 +314,22 @@ void ColorScheme::saveToConfig() {
void ColorScheme::setStarColorMode( int mode ) {
StarColorMode = mode;
Options::setStarColorMode( mode );
+ //TODO Change textures after color mode was changed
+#ifdef KSTARS_LITE
+ //SkyMapLite::Instance()->initStarImages();
+#else
SkyQPainter::initStarImages();
+#endif
}
void ColorScheme::setStarColorIntensity( int intens ) {
StarColorIntensity = intens;
Options::setStarColorIntensity( intens );
+#ifdef KSTARS_LITE
+ //SkyMapLite::Instance()->initStarImages();
+#else
SkyQPainter::initStarImages();
+#endif
}
void ColorScheme::setStarColorModeIntensity( int mode, int intens) {
@@ -309,5 +337,9 @@ void ColorScheme::setStarColorModeIntensity( int mode, int intens) {
StarColorIntensity = intens;
Options::setStarColorMode( mode );
Options::setStarColorIntensity( intens );
+#ifdef KSTARS_LITE
+ //SkyMapLite::Instance()->initStarImages();
+#else
SkyQPainter::initStarImages();
+#endif
}
diff --git a/kstars/auxiliary/fov.cpp b/kstars/auxiliary/fov.cpp
index cefc2f4..07c6eaf 100644
--- a/kstars/auxiliary/fov.cpp
+++ b/kstars/auxiliary/fov.cpp
@@ -17,7 +17,9 @@
#include "fov.h"
#include "Options.h"
+#ifndef KSTARS_LITE
#include "kstars.h"
+#endif
#include "kstarsdata.h"
#include "geolocation.h"
#include "skymap.h"
@@ -66,6 +68,7 @@ FOV::FOV()
}
void FOV::draw( QPainter &p, float zoomFactor ) {
+#ifndef KSTARS_LITE
p.setPen( QColor( color() ) );
p.setBrush( Qt::NoBrush );
@@ -147,6 +150,7 @@ void FOV::draw( QPainter &p, float zoomFactor ) {
}
p.restore();
+#endif
}
void FOV::draw(QPainter &p, float x, float y)
diff --git a/kstars/auxiliary/imageviewer.cpp b/kstars/auxiliary/imageviewer.cpp
index ed942a1..dd9247f 100644
--- a/kstars/auxiliary/imageviewer.cpp
+++ b/kstars/auxiliary/imageviewer.cpp
@@ -16,7 +16,9 @@
***************************************************************************/
#include "imageviewer.h"
+#ifndef KSTARS_LITE
#include "kstars.h"
+#endif
#include <QFont>
#include <QPainter>
@@ -32,16 +34,20 @@
#include <QFileDialog>
#include <QStatusBar>
+#ifndef KSTARS_LITE
+#include <KMessageBox>
#include <KJobUiDelegate>
+#endif
//#include <KIO/CopyJob>
#include <KLocalizedString>
-#include <KMessageBox>
ImageLabel::ImageLabel( QWidget *parent ) : QFrame( parent )
{
+ #ifndef KSTARS_LITE
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
setFrameStyle( QFrame::StyledPanel | QFrame::Plain );
setLineWidth( 2 );
+ #endif
}
ImageLabel::~ImageLabel()
@@ -49,18 +55,23 @@ ImageLabel::~ImageLabel()
void ImageLabel::setImage( const QImage &img )
{
+ #ifndef KSTARS_LITE
m_Image = img;
pix = QPixmap::fromImage(m_Image);
+ #endif
}
void ImageLabel::invertPixels()
{
+ #ifndef KSTARS_LITE
m_Image.invertPixels();
pix = QPixmap::fromImage(m_Image.scaled(width(), height(), Qt::KeepAspectRatio));
+ #endif
}
void ImageLabel::paintEvent (QPaintEvent*)
{
+ #ifndef KSTARS_LITE
QPainter p;
p.begin( this );
int x = 0;
@@ -68,10 +79,12 @@ void ImageLabel::paintEvent (QPaintEvent*)
x = (width() - pix.width())/2;
p.drawPixmap( x, 0, pix );
p.end();
+ #endif
}
void ImageLabel::resizeEvent(QResizeEvent *event)
{
+ #ifndef KSTARS_LITE
int w=pix.width();
int h=pix.height();
@@ -79,6 +92,7 @@ void ImageLabel::resizeEvent(QResizeEvent *event)
return;
pix = QPixmap::fromImage(m_Image.scaled(event->size(), Qt::KeepAspectRatio));
+ #endif
}
ImageViewer::ImageViewer (const QString &caption, QWidget *parent):
@@ -86,7 +100,9 @@ ImageViewer::ImageViewer (const QString &caption, QWidget *parent):
fileIsImage(false),
downloadJob(0)
{
+ #ifndef KSTARS_LITE
init(caption, QString());
+ #endif
}
ImageViewer::ImageViewer (const QUrl &url, const QString &capText, QWidget *parent) :
@@ -94,6 +110,7 @@ ImageViewer::ImageViewer (const QUrl &url, const QString &capText, QWidget *pare
m_ImageUrl(url),
fileIsImage(false)
{
+ #ifndef KSTARS_LITE
init(url.fileName(), capText);
// check URL
@@ -113,10 +130,12 @@ ImageViewer::ImageViewer (const QUrl &url, const QString &capText, QWidget *pare
}// we just need the name and delete the tempfile from disc; if we don't do it, a dialog will be show
loadImageFromURL();
+ #endif
}
void ImageViewer::init(QString caption, QString capText)
{
+ #ifndef KSTARS_LITE
setAttribute( Qt::WA_DeleteOnClose, true );
setModal( false );
setWindowTitle( i18n( "KStars image viewer: %1", caption ) );
@@ -168,9 +187,11 @@ void ImageViewer::init(QString caption, QString capText)
QFont capFont = m_Caption->font();
capFont.setPointSize( capFont.pointSize() - 2 );
m_Caption->setFont( capFont );
+ #endif
}
ImageViewer::~ImageViewer() {
+ #ifndef KSTARS_LITE
/*if ( downloadJob ) {
// close job quietly, without emitting a result
downloadJob->kill( KJob::Quietly );
@@ -178,10 +199,12 @@ ImageViewer::~ImageViewer() {
}*/
QApplication::restoreOverrideCursor();
+ #endif
}
void ImageViewer::loadImageFromURL()
{
+ #ifndef KSTARS_LITE
QUrl saveURL = QUrl::fromLocalFile(file.fileName() );
if (!saveURL.isValid())
@@ -196,10 +219,12 @@ void ImageViewer::loadImageFromURL()
connect(&downloadJob, SIGNAL(error(QString)), this, SLOT(downloadError(QString)));
downloadJob.get(m_ImageUrl);
+ #endif
}
void ImageViewer::downloadReady ()
{
+ #ifndef KSTARS_LITE
QApplication::restoreOverrideCursor();
if (file.open(QFile::WriteOnly))
@@ -217,22 +242,29 @@ void ImageViewer::downloadReady ()
}
else
KMessageBox::error(0, file.errorString(), i18n("Image Viewer"));
+ #endif
}
void ImageViewer::downloadError(const QString &errorString)
{
+ #ifndef KSTARS_LITE
QApplication::restoreOverrideCursor();
KMessageBox::error(this, errorString);
+ #endif
}
bool ImageViewer::loadImage(const QString &filename)
{
+ #ifndef KSTARS_LITE
file.setFileName(filename);
return showImage();
+ #endif
+ return false;
}
bool ImageViewer::showImage()
{
+ #ifndef KSTARS_LITE
QImage image;
if( !image.load( file.fileName() ))
@@ -280,10 +312,13 @@ bool ImageViewer::showImage()
update();
return true;
+ #endif
+ return false;
}
void ImageViewer::saveFileToDisc()
{
+#ifndef KSTARS_LITE
QFileDialog dialog;
dialog.selectFile(m_ImageUrl.fileName().remove(m_ImageUrl.path()));
dialog.setFileMode(QFileDialog::AnyFile);
@@ -304,6 +339,7 @@ void ImageViewer::saveFileToDisc()
}
saveFile (newURL);
}
+#endif
}
void ImageViewer::saveFile (QUrl &url)
@@ -318,16 +354,24 @@ void ImageViewer::saveFile (QUrl &url)
//if (KIO::file_copy(tmpURL, url)->exec() == false)
{
QString text = i18n ("Saving of the image %1 failed.", url.toString());
- KMessageBox::error (this, text);
+ #ifndef KSTARS_LITE
+ KMessageBox::error (this, text);
+ #else
+ qDebug() << text;
+ #endif
}
+ #ifndef KSTARS_LITE
else
KStars::Instance()->statusBar()->showMessage(i18n ("Saved image to %1", url.toString()));
+ #endif
}
void ImageViewer::invertColors() {
+ #ifndef KSTARS_LITE
// Invert colors
m_View->invertPixels();
m_View->update();
+ #endif
}
diff --git a/kstars/auxiliary/ksfilereader.cpp b/kstars/auxiliary/ksfilereader.cpp
index 42a7030..139552d 100644
--- a/kstars/auxiliary/ksfilereader.cpp
+++ b/kstars/auxiliary/ksfilereader.cpp
@@ -22,7 +22,9 @@
#include <QFile>
#include <QDebug>
+#ifndef KSTARS_LITE
#include "kstars.h"
+#endif
#include "kstarsdata.h"
#include "ksutils.h"
diff --git a/kstars/kstarsdata.cpp b/kstars/kstarsdata.cpp
index d77fd59..1b2e8d6 100644
--- a/kstars/kstarsdata.cpp
+++ b/kstars/kstarsdata.cpp
@@ -31,33 +31,38 @@
#include "Options.h"
#include "dms.h"
#include "fov.h"
-#include "skymap.h"
#include "ksutils.h"
#include "ksfilereader.h"
#include "ksnumbers.h"
#include "skyobjects/skyobject.h"
#include "skycomponents/supernovaecomponent.h"
#include "skycomponents/skymapcomposite.h"
-#include "oal/execute.h"
#include "simclock.h"
#include "timezonerule.h"
+#ifndef KSTARS_LITE
+#include "skymap.h"
+#include "oal/execute.h"
#include "imageexporter.h"
#include "observinglist.h"
+#include "dialogs/detaildialog.h"
+#endif
#include <config-kstars.h>
-#include "dialogs/detaildialog.h"
namespace {
- #ifndef KSTARS_LITE
// Report fatal error during data loading to user
// Calls QApplication::exit
void fatalErrorMessage(QString fname) {
+ #ifndef KSTARS_LITE
+
KMessageBox::sorry(0, i18n("The file %1 could not be found. "
"KStars cannot run properly without this file. "
"KStars searches for this file in following locations:\n\n\t"
"%2\n\n"
"It appears that your setup is broken.", fname, QStandardPaths::standardLocations( QStandardPaths::DataLocation ).join("\n\t") ),
i18n( "Critical File Not Found: %1", fname )); // FIXME: Must list locations depending on file type
+ #endif
+ qDebug() << i18n( "Critical File Not Found: %1", fname );
qApp->exit(1);
}
@@ -65,6 +70,7 @@ namespace {
// whether he wants to continue.
// Calls QApplication::exit if he don't
bool nonFatalErrorMessage(QString fname) {
+ #ifndef KSTARS_LITE
int res = KMessageBox::warningContinueCancel(0,
i18n("The file %1 could not be found. "
"KStars can still run without this file. "
@@ -76,8 +82,9 @@ namespace {
if( res != KMessageBox::Continue )
qApp->exit(1);
return res == KMessageBox::Continue;
+ #endif
+ return true;
}
-#endif
}
KStarsData* KStarsData::pinstance = 0;
@@ -103,9 +110,11 @@ KStarsData::KStarsData() :
m_Geo(dms(0), dms(0)),
m_ksuserdb(),
m_catalogdb(),
+ #ifndef KSTARS_LITE
m_ObservingList(0),
m_Execute(0),
m_ImageExporter(0),
+ #endif
temporaryTrail( false ),
//locale( new KLocale( "kstars" ) ),
m_preUpdateID(0), m_updateID(0),
@@ -124,11 +133,12 @@ KStarsData::~KStarsData() {
Q_ASSERT( pinstance );
//delete locale;
+#ifndef KSTARS_LITE
delete m_LogObject;
delete m_Execute;
delete m_ObservingList;
delete m_ImageExporter;
-
+#endif
qDeleteAll( geoList );
qDeleteAll( ADVtreeList );
@@ -179,9 +189,10 @@ bool KStarsData::initialize() {
skyComposite()->supernovaeComponent()->slotTriggerDataFileUpdate();
}
+ #ifndef KSTARS_LITE
//Initialize Observing List
m_ObservingList = new ObservingList();
-
+ #endif
readUserLog();
readADVTreeData();
@@ -713,6 +724,7 @@ bool KStarsData::readADVTreeData()
//there is no KStars object, so none of the DBus functions can be called
//directly.
bool KStarsData::executeScript( const QString &scriptname, SkyMap *map ) {
+#ifndef KSTARS_LITE
int cmdCount(0);
QFile f( scriptname );
@@ -1009,6 +1021,7 @@ bool KStarsData::executeScript( const QString &scriptname, SkyMap *map ) {
} //end while
if ( cmdCount ) return true;
+#endif
return false;
}
diff --git a/kstars/kstarsdata.h b/kstars/kstarsdata.h
index ec3b3b5..00a835c 100644
--- a/kstars/kstarsdata.h
+++ b/kstars/kstarsdata.h
@@ -53,7 +53,18 @@ class FOV;
class ObservingList;
class TimeZoneRule;
-struct ADVTreeData;
+
+#ifdef KSTARS_LITE
+//Will go away when details window will be implemented in KStars Lite
+struct ADVTreeData
+{
+ QString Name;
+ QString Link;
+ int Type;
+};
+#else
+class ADVTreeData;
+#endif
/** @class KStarsData
@@ -340,8 +351,8 @@ private:
KSUserDB m_ksuserdb;
CatalogDB m_catalogdb;
ColorScheme CScheme;
- ObservingList *m_ObservingList;
#ifndef KSTARS_LITE
+ ObservingList *m_ObservingList;
OAL::Log *m_LogObject;
Execute *m_Execute;
ImageExporter *m_ImageExporter;
diff --git a/kstars/kstarslite.cpp b/kstars/kstarslite.cpp
index 0e41612..252f3b9 100644
--- a/kstars/kstarslite.cpp
+++ b/kstars/kstarslite.cpp
@@ -18,6 +18,7 @@
#include "skymaplite.h"
#include "kstarsdata.h"
#include <QQmlContext>
+#include <QApplication>
#include "Options.h"
#include "ksutils.h"
@@ -33,9 +34,19 @@ KStarsLite::KStarsLite( bool doSplash, bool startClock, const QString &startDate
else
KSUtils::Logging::UseDefault();
+ m_KStarsData = KStarsData::Create();
+ Q_ASSERT( m_KStarsData );
+
+ //Make instance of KStarsLite and KStarsData available to QML
+ m_Engine.rootContext()->setContextProperty("KStarsLite", this);
+ m_Engine.rootContext()->setContextProperty("KStarsData", m_KStarsData);
+
+ m_Engine.rootContext()->setContextProperty("Options", Options::self());
+
//Register SkyMapLite for use within QML
qmlRegisterType<SkyMapLite>("skymaplite",1,0,"SkyMapLite");
- QString main = QString(SOURCE_DIR) + "/kstars/kstarslite/qml/main.qml";
+ QString main = QStandardPaths::locate(QStandardPaths::AppDataLocation, "kstarslite/qml/main.qml");
+ //QString main = QString(SOURCE_DIR) + "/kstars/kstarslite/qml/main.qml";
m_Engine.load(QUrl(main));
Q_ASSERT_X(m_Engine.rootObjects().size(),"loading root object of main.qml",
@@ -45,15 +56,6 @@ KStarsLite::KStarsLite( bool doSplash, bool startClock, const QString &startDate
QQuickItem* skyMapLiteWrapper = m_RootObject->findChild<QQuickItem*>("skyMapLiteWrapper");
- m_KStarsData = KStarsData::Create();
- Q_ASSERT( m_KStarsData );
-
- //Make instance of KStarsLite and KStarsData available to QML
- m_Engine.rootContext()->setContextProperty("KStarsLite", this);
- m_Engine.rootContext()->setContextProperty("KStarsData", m_KStarsData);
-
- m_Engine.rootContext()->setContextProperty("Options", Options::self());
-
//Set Geographic Location from Options
m_KStarsData->setLocationFromOptions();
@@ -81,7 +83,7 @@ KStarsLite::KStarsLite( bool doSplash, bool startClock, const QString &startDate
if ( startClock ) StartClockRunning = Options::runClock();
// Setup splash screen
- if ( !doSplash ) {
+ if ( doSplash ) {
showSplash();
} else {
connect( m_KStarsData, SIGNAL( progressText(QString) ), m_KStarsData, SLOT( slotConsoleMessage(QString) ) );
diff --git a/kstars/kstarslite.h b/kstars/kstarslite.h
index 0e62534..83d3550 100644
--- a/kstars/kstarslite.h
+++ b/kstars/kstarslite.h
@@ -19,7 +19,7 @@
#include <config-kstars.h>
#include <QString>
-#include <QQmlApplicationEngine>
+#include <QtQml/QQmlApplicationEngine>
#include <QPalette>
// forward declaration is enough. We only need pointers
diff --git a/kstars/kstarslite/qml/CMakeLists.txt b/kstars/kstarslite/qml/CMakeLists.txt
new file mode 100644
index 0000000..727868e
--- /dev/null
+++ b/kstars/kstarslite/qml/CMakeLists.txt
@@ -0,0 +1,21 @@
+#install_files
+install( FILES main.qml
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml )
+
+install( FILES constants/Constants.qml
+ constants/qmldir
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/constants )
+
+install( FILES modules/BottomMenu.qml
+ modules/ContextDrawer.qml
+ modules/GlobalDrawer.qml
+ modules/Splash.qml
+ modules/TopMenu.qml
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules )
+
+install( FILES modules/helpers/DrawerColorScheme.qml
+ modules/helpers/DrawerElem.qml
+ modules/helpers/TopMenuButton.qml
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/helpers )
+
+add_subdirectory(modules/images)
diff --git a/kstars/kstarslite/qml/constants/qmldir b/kstars/kstarslite/qml/constants/qmldir
new file mode 100644
index 0000000..f430ddb
--- /dev/null
+++ b/kstars/kstarslite/qml/constants/qmldir
@@ -0,0 +1 @@
+singleton num 1.0 Constants.qml
diff --git a/kstars/kstarslite/qml/modules/images/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/CMakeLists.txt
new file mode 100644
index 0000000..fe7c6b7
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/CMakeLists.txt
@@ -0,0 +1,13 @@
+#install_files
+install( FILES kstars.png
+ shadow.png
+ SkyMap.png
+ SkyMap-port.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images )
+
+add_subdirectory(hdpi)
+add_subdirectory(ldpi)
+add_subdirectory(mdpi)
+add_subdirectory(xhdpi)
+add_subdirectory(xxhdpi)
+add_subdirectory(xxxhdpi)
diff --git a/kstars/kstarslite/qml/modules/images/hdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/hdpi/CMakeLists.txt
new file mode 100644
index 0000000..d2cac7e
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/hdpi/CMakeLists.txt
@@ -0,0 +1,4 @@
+install( FILES arrow_down.png
+ arrow_up.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/hdpi )
+add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/hdpi/icons/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/hdpi/icons/CMakeLists.txt
new file mode 100644
index 0000000..d01f418
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/hdpi/icons/CMakeLists.txt
@@ -0,0 +1,24 @@
+install( FILES applications-system.png
+ arrow-down-double.png
+ arrow-down.png
+ arrow-right.png
+ arrow-up-double.png
+ arrow-up.png
+ color-management.png
+ compass.png
+ games-config-custom.png
+ media-playback-pause.png
+ media-playback-start.png
+ media-skip-backward.png
+ media-skip-forward.png
+ sc-actions-kstars_cbound.png
+ sc-actions-kstars_clines.png
+ sc-actions-kstars_cnames.png
+ sc-actions-kstars_deepsky.png
+ sc-actions-kstars_grid.png
+ sc-actions-kstars_horizon.png
+ sc-actions-kstars_mw.png
+ sc-actions-kstars_planets.png
+ sc-actions-kstars_stars.png
+ system-search.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/hdpi/icons )
diff --git a/kstars/kstarslite/qml/modules/images/ldpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/ldpi/CMakeLists.txt
new file mode 100644
index 0000000..640dcdb
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/ldpi/CMakeLists.txt
@@ -0,0 +1,4 @@
+install( FILES arrow_down.png
+ arrow_up.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/ldpi )
+add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/ldpi/icons/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/ldpi/icons/CMakeLists.txt
new file mode 100644
index 0000000..d728901
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/ldpi/icons/CMakeLists.txt
@@ -0,0 +1,24 @@
+install( FILES applications-system.png
+ arrow-down-double.png
+ arrow-down.png
+ arrow-right.png
+ arrow-up-double.png
+ arrow-up.png
+ color-management.png
+ compass.png
+ games-config-custom.png
+ media-playback-pause.png
+ media-playback-start.png
+ media-skip-backward.png
+ media-skip-forward.png
+ sc-actions-kstars_cbound.png
+ sc-actions-kstars_clines.png
+ sc-actions-kstars_cnames.png
+ sc-actions-kstars_deepsky.png
+ sc-actions-kstars_grid.png
+ sc-actions-kstars_horizon.png
+ sc-actions-kstars_mw.png
+ sc-actions-kstars_planets.png
+ sc-actions-kstars_stars.png
+ system-search.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/ldpi/icons )
diff --git a/kstars/kstarslite/qml/modules/images/mdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/mdpi/CMakeLists.txt
new file mode 100644
index 0000000..d9a8f97
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/mdpi/CMakeLists.txt
@@ -0,0 +1,4 @@
+install( FILES arrow_down.png
+ arrow_up.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/mdpi )
+add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/mdpi/icons/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/mdpi/icons/CMakeLists.txt
new file mode 100644
index 0000000..daff161
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/mdpi/icons/CMakeLists.txt
@@ -0,0 +1,24 @@
+install( FILES applications-system.png
+ arrow-down-double.png
+ arrow-down.png
+ arrow-right.png
+ arrow-up-double.png
+ arrow-up.png
+ color-management.png
+ compass.png
+ games-config-custom.png
+ media-playback-pause.png
+ media-playback-start.png
+ media-skip-backward.png
+ media-skip-forward.png
+ sc-actions-kstars_cbound.png
+ sc-actions-kstars_clines.png
+ sc-actions-kstars_cnames.png
+ sc-actions-kstars_deepsky.png
+ sc-actions-kstars_grid.png
+ sc-actions-kstars_horizon.png
+ sc-actions-kstars_mw.png
+ sc-actions-kstars_planets.png
+ sc-actions-kstars_stars.png
+ system-search.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/mdpi/icons )
diff --git a/kstars/kstarslite/qml/modules/images/xhdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/xhdpi/CMakeLists.txt
new file mode 100644
index 0000000..e632760
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/xhdpi/CMakeLists.txt
@@ -0,0 +1,4 @@
+install( FILES arrow_down.png
+ arrow_up.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/xhdpi )
+add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/xhdpi/icons/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/xhdpi/icons/CMakeLists.txt
new file mode 100644
index 0000000..5c047df
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/xhdpi/icons/CMakeLists.txt
@@ -0,0 +1,24 @@
+install( FILES applications-system.png
+ arrow-down-double.png
+ arrow-down.png
+ arrow-right.png
+ arrow-up-double.png
+ arrow-up.png
+ color-management.png
+ compass.png
+ games-config-custom.png
+ media-playback-pause.png
+ media-playback-start.png
+ media-skip-backward.png
+ media-skip-forward.png
+ sc-actions-kstars_cbound.png
+ sc-actions-kstars_clines.png
+ sc-actions-kstars_cnames.png
+ sc-actions-kstars_deepsky.png
+ sc-actions-kstars_grid.png
+ sc-actions-kstars_horizon.png
+ sc-actions-kstars_mw.png
+ sc-actions-kstars_planets.png
+ sc-actions-kstars_stars.png
+ system-search.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/xdpi/icons )
diff --git a/kstars/kstarslite/qml/modules/images/xxhdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/xxhdpi/CMakeLists.txt
new file mode 100644
index 0000000..b702761
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/xxhdpi/CMakeLists.txt
@@ -0,0 +1,4 @@
+install( FILES arrow_down.png
+ arrow_up.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/xxhdpi )
+add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/xxhdpi/icons/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/xxhdpi/icons/CMakeLists.txt
new file mode 100644
index 0000000..148ce57
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/xxhdpi/icons/CMakeLists.txt
@@ -0,0 +1,24 @@
+install( FILES applications-system.png
+ arrow-down-double.png
+ arrow-down.png
+ arrow-right.png
+ arrow-up-double.png
+ arrow-up.png
+ color-management.png
+ compass.png
+ games-config-custom.png
+ media-playback-pause.png
+ media-playback-start.png
+ media-skip-backward.png
+ media-skip-forward.png
+ sc-actions-kstars_cbound.png
+ sc-actions-kstars_clines.png
+ sc-actions-kstars_cnames.png
+ sc-actions-kstars_deepsky.png
+ sc-actions-kstars_grid.png
+ sc-actions-kstars_horizon.png
+ sc-actions-kstars_mw.png
+ sc-actions-kstars_planets.png
+ sc-actions-kstars_stars.png
+ system-search.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/xxhdpi/icons )
diff --git a/kstars/kstarslite/qml/modules/images/xxxhdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/xxxhdpi/CMakeLists.txt
new file mode 100644
index 0000000..5810dcf
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/xxxhdpi/CMakeLists.txt
@@ -0,0 +1,4 @@
+install( FILES arrow_down.png
+ arrow_up.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/xxxhdpi )
+add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/xxxhdpi/icons/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/xxxhdpi/icons/CMakeLists.txt
new file mode 100644
index 0000000..cd1be9f
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/xxxhdpi/icons/CMakeLists.txt
@@ -0,0 +1,24 @@
+install( FILES applications-system.png
+ arrow-down-double.png
+ arrow-down.png
+ arrow-right.png
+ arrow-up-double.png
+ arrow-up.png
+ color-management.png
+ compass.png
+ games-config-custom.png
+ media-playback-pause.png
+ media-playback-start.png
+ media-skip-backward.png
+ media-skip-forward.png
+ sc-actions-kstars_cbound.png
+ sc-actions-kstars_clines.png
+ sc-actions-kstars_cnames.png
+ sc-actions-kstars_deepsky.png
+ sc-actions-kstars_grid.png
+ sc-actions-kstars_horizon.png
+ sc-actions-kstars_mw.png
+ sc-actions-kstars_planets.png
+ sc-actions-kstars_stars.png
+ system-search.png
+ DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/xxxhdpi/icons )
diff --git a/kstars/main.cpp b/kstars/main.cpp
index c846403..4fac9a1 100644
--- a/kstars/main.cpp
+++ b/kstars/main.cpp
@@ -18,17 +18,20 @@
#include <QDebug>
#include <QPixmap>
-#include <QCommandLineParser>
-#include <QCommandLineOption>
+
+#include <QApplication>
#ifdef KSTARS_LITE
#include "kstarslite.h"
-#include "skymap.h"
#include <KLocalizedString>
#else
+#include <QCommandLineParser>
+#include <QCommandLineOption>
+
#include <KAboutData>
#include <KCrash>
#include "kstars.h"
+#include "skymap.h"
#endif
#include "kstarsdata.h"
@@ -39,8 +42,6 @@
#include "Options.h"
-
-
static const char description[] =
I18N_NOOP("Desktop Planetarium");
static const char notice[] =
@@ -51,14 +52,12 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.setApplicationVersion(KSTARS_VERSION);
- #ifndef KSTARS_LITE
/**
* enable high dpi support
*/
app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
-
+ #ifndef KSTARS_LITE
KCrash::initialize();
-
KLocalizedString::setApplicationDomain("kstars");
KAboutData aboutData( "kstars", i18n("KStars"), KSTARS_VERSION, i18n(description), KAboutLicense::GPL,
@@ -224,11 +223,12 @@ int main(int argc, char *argv[])
qWarning() << i18n( "Using CPU date/time instead." ) ;
datestring.clear();
}
+#endif
// Create writable data dir if it does not exist
QDir writableDir;
writableDir.mkdir(QStandardPaths::writableLocation(QStandardPaths::DataLocation));
-
+#ifndef KSTARS_LITE
KStars::createInstance( true, ! parser.isSet( "paused" ), datestring );
// no session.. just start up normally
@@ -247,7 +247,9 @@ int main(int argc, char *argv[])
}
}
#else
- KStarsLite::createInstance( true, ! parser.isSet( "paused" ), datestring );
+ //KStarsLite::createInstance( true, ! parser.isSet( "paused" ), datestring );
+ //TODO decide wheter KStars Lite should have command line parser
+ KStarsLite::createInstance( true );
#endif
QObject::connect(qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()));
diff --git a/kstars/skycomponents/artificialhorizoncomponent.cpp b/kstars/skycomponents/artificialhorizoncomponent.cpp
index 583477a..fdde7de 100644
--- a/kstars/skycomponents/artificialhorizoncomponent.cpp
+++ b/kstars/skycomponents/artificialhorizoncomponent.cpp
@@ -20,7 +20,11 @@
#include "polylist.h"
#include "skymesh.h"
+#ifndef KSTARS_LITE
+#include "skymap.h"
+#endif
#include "skypainter.h"
+
#include "projections/projector.h"
ArtificialHorizonEntity::ArtificialHorizonEntity()
diff --git a/kstars/skycomponents/asteroidscomponent.cpp b/kstars/skycomponents/asteroidscomponent.cpp
index 25f19f5..726ab45 100644
--- a/kstars/skycomponents/asteroidscomponent.cpp
+++ b/kstars/skycomponents/asteroidscomponent.cpp
@@ -30,7 +30,9 @@
#include "solarsystemcomposite.h"
#include "skycomponent.h"
#include "skylabeler.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skypainter.h"
#include "Options.h"
#include "skyobjects/ksasteroid.h"
@@ -191,6 +193,8 @@ void AsteroidsComponent::loadData()
void AsteroidsComponent::draw( SkyPainter *skyp )
{
+ Q_UNUSED(skyp)
+#ifndef KSTARS_LITE
if ( ! selected() ) return;
bool hideLabels = ! Options::showAsteroidNames() ||
@@ -224,6 +228,7 @@ void AsteroidsComponent::draw( SkyPainter *skyp )
SkyLabeler::AddLabel( ast, SkyLabeler::ASTEROID_LABEL );
}
+#endif
}
SkyObject* AsteroidsComponent::objectNearest( SkyPoint *p, double &maxrad ) {
@@ -278,15 +283,20 @@ void AsteroidsComponent::downloadReady()
// Reload asteroids
loadData();
-
+#ifdef KSTARS_LITE
+ KStarsLite::Instance();
+#else
KStars::Instance()->data()->setFullTimeUpdate();
-
+#endif
downloadJob->deleteLater();
}
void AsteroidsComponent::downloadError(const QString &errorString)
{
+#ifndef KSTARS_LITE
KMessageBox::error(0, i18n("Error downloading asteroids data: %1", errorString));
-
+#else
+ qDebug() << i18n("Error downloading asteroids data: %1", errorString);
+#endif
downloadJob->deleteLater();
}
diff --git a/kstars/skycomponents/catalogcomponent.cpp b/kstars/skycomponents/catalogcomponent.cpp
index b3ced22..c60411f 100644
--- a/kstars/skycomponents/catalogcomponent.cpp
+++ b/kstars/skycomponents/catalogcomponent.cpp
@@ -19,7 +19,9 @@
#include <QDebug>
#include <KLocalizedString>
+#ifndef KSTARS_LITE
#include <KMessageBox>
+#endif
#include <QDir>
#include <QFile>
#include <QPixmap>
@@ -28,7 +30,9 @@
#include "Options.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skypainter.h"
#include "skyobjects/starobject.h"
#include "skyobjects/deepskyobject.h"
diff --git a/kstars/skycomponents/cometscomponent.cpp b/kstars/skycomponents/cometscomponent.cpp
index a696368..2183984 100644
--- a/kstars/skycomponents/cometscomponent.cpp
+++ b/kstars/skycomponents/cometscomponent.cpp
@@ -30,7 +30,9 @@
#include "ksutils.h"
#include "kstarsdata.h"
#include "ksfilereader.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skylabeler.h"
#include "skypainter.h"
#include "projections/projector.h"
@@ -175,6 +177,8 @@ void CometsComponent::loadData() {
void CometsComponent::draw( SkyPainter *skyp )
{
+ Q_UNUSED(skyp)
+#ifndef KSTARS_LITE
if( !selected() || Options::zoomFactor() < 10*MINZOOM )
return;
@@ -197,6 +201,7 @@ void CometsComponent::draw( SkyPainter *skyp )
SkyLabeler::AddLabel( com, SkyLabeler::COMET_LABEL );
}
}
+#endif
}
void CometsComponent::updateDataFile()
@@ -237,14 +242,21 @@ void CometsComponent::downloadReady()
// Reload asteroids
loadData();
+#ifdef KSTARS_LITE
+ KStarsLite::Instance()->data()->setFullTimeUpdate();
+#else
KStars::Instance()->data()->setFullTimeUpdate();
+#endif
downloadJob->deleteLater();
}
void CometsComponent::downloadError(const QString &errorString)
{
- KMessageBox::error(0, i18n("Error downloading comets data: %1", errorString));
-
+#ifndef KSTARS_LITE
+ KMessageBox::error(0, i18n("Error downloading asteroids data: %1", errorString));
+#else
+ qDebug() << i18n("Error downloading comets data: %1", errorString);
+#endif
downloadJob->deleteLater();
}
diff --git a/kstars/skycomponents/constellationartcomponent.cpp b/kstars/skycomponents/constellationartcomponent.cpp
index 18da288..bd9296f 100644
--- a/kstars/skycomponents/constellationartcomponent.cpp
+++ b/kstars/skycomponents/constellationartcomponent.cpp
@@ -18,7 +18,9 @@
#include "constellationartcomponent.h"
#include "constellationsart.h"
#include "auxiliary/ksfilereader.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "culturelist.h"
#include "projections/projector.h"
@@ -100,7 +102,7 @@ void ConstellationArtComponent::showList()
}
void ConstellationArtComponent::draw(SkyPainter *skyp){
-
+ #ifndef KSTARS_LITE
if(Options::showConstellationArt() && SkyMap::IsSlewing() == false)
{
for(int i =0; i<records; i++)
@@ -108,4 +110,5 @@ void ConstellationArtComponent::draw(SkyPainter *skyp){
}
//Loops through the QList containing all data required to draw constellations.
+ #endif
}
diff --git a/kstars/skycomponents/constellationboundarylines.cpp b/kstars/skycomponents/constellationboundarylines.cpp
index a092f4e..d6f4188 100644
--- a/kstars/skycomponents/constellationboundarylines.cpp
+++ b/kstars/skycomponents/constellationboundarylines.cpp
@@ -27,7 +27,9 @@
#include "Options.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skyobjects/skyobject.h"
#include "ksfilereader.h"
@@ -147,8 +149,13 @@ ConstellationBoundaryLines::ConstellationBoundaryLines( SkyComposite *parent )
bool ConstellationBoundaryLines::selected()
{
+#ifndef KSTARS_LITE
return Options::showCBounds() &&
! ( Options::hideOnSlew() && Options::hideCBounds() && SkyMap::IsSlewing() );
+#else
+ return Options::showCBounds() && //TODO: Implement isSlewing in KStars Lite if needed
+ ! ( Options::hideOnSlew() && Options::hideCBounds() );
+#endif
}
void ConstellationBoundaryLines::preDraw( SkyPainter* skyp )
diff --git a/kstars/skycomponents/constellationlines.cpp b/kstars/skycomponents/constellationlines.cpp
index 67dc045..9e75714 100644
--- a/kstars/skycomponents/constellationlines.cpp
+++ b/kstars/skycomponents/constellationlines.cpp
@@ -115,8 +115,13 @@ ConstellationLines::ConstellationLines( SkyComposite *parent, CultureList* cultu
bool ConstellationLines::selected()
{
+#ifndef KSTARS_LITE
return Options::showCLines() &&
! ( Options::hideOnSlew() && Options::hideCLines() && SkyMap::IsSlewing() );
+#else
+ return Options::showCLines() && //TODO: Implement isSlewing in KStars Lite if needed
+ ! ( Options::hideOnSlew() && Options::hideCLines() );
+#endif
}
void ConstellationLines::preDraw( SkyPainter* skyp )
diff --git a/kstars/skycomponents/constellationnamescomponent.cpp b/kstars/skycomponents/constellationnamescomponent.cpp
index f6e20c7..78f9843 100644
--- a/kstars/skycomponents/constellationnamescomponent.cpp
+++ b/kstars/skycomponents/constellationnamescomponent.cpp
@@ -19,7 +19,9 @@
#include <QTextStream>
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skyobjects/skyobject.h"
#include "skycomponents/culturelist.h"
#include "Options.h"
@@ -95,8 +97,13 @@ ConstellationNamesComponent::~ConstellationNamesComponent()
bool ConstellationNamesComponent::selected()
{
+#ifndef KSTARS_LITE
return Options::showCNames() &&
!( Options::hideOnSlew() && Options::hideCNames() && SkyMap::IsSlewing() );
+#else
+ return Options::showCNames() &&
+ !( Options::hideOnSlew() && Options::hideCNames() );
+#endif
}
// Don't precess the location of the names
@@ -112,6 +119,7 @@ void ConstellationNamesComponent::update( KSNumbers* )
void ConstellationNamesComponent::draw( SkyPainter *skyp )
{
Q_UNUSED(skyp);
+#ifndef KSTARS_LITE
if ( ! selected() )
return;
@@ -140,4 +148,5 @@ void ConstellationNamesComponent::draw( SkyPainter *skyp )
}
skyLabeler->resetFont();
+#endif
}
diff --git a/kstars/skycomponents/deepskycomponent.cpp b/kstars/skycomponents/deepskycomponent.cpp
index b782d94..70e52de 100644
--- a/kstars/skycomponents/deepskycomponent.cpp
+++ b/kstars/skycomponents/deepskycomponent.cpp
@@ -27,7 +27,9 @@
#include "dms.h"
#include "ksfilereader.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skylabel.h"
#include "skylabeler.h"
#include "Options.h"
@@ -369,6 +371,7 @@ void DeepSkyComponent::draw( SkyPainter *skyp )
bool drawFlag;
+#ifndef KSTARS_LITE
drawFlag = Options::showMessier() &&
! ( Options::hideOnSlew() && Options::hideMessier() && SkyMap::IsSlewing() );
@@ -388,11 +391,13 @@ void DeepSkyComponent::draw( SkyPainter *skyp )
! ( Options::hideOnSlew() && Options::hideOther() && SkyMap::IsSlewing() );
drawDeepSkyCatalog( skyp, drawFlag, &m_OtherIndex, "NGCColor" );
+#endif
}
void DeepSkyComponent::drawDeepSkyCatalog( SkyPainter *skyp, bool drawObject,
DeepSkyIndex* dsIndex, const QString& colorString, bool drawImage)
{
+#ifndef KSTARS_LITE
if ( ! ( drawObject || drawImage ) ) return;
SkyMap *map = SkyMap::Instance();
@@ -465,6 +470,9 @@ void DeepSkyComponent::drawDeepSkyCatalog( SkyPainter *skyp, bool drawObject,
}
}
}
+#else
+ Q_UNUSED(skyp)
+#endif
}
void DeepSkyComponent::addLabel( const QPointF& p, DeepSkyObject *obj )
@@ -477,6 +485,7 @@ void DeepSkyComponent::addLabel( const QPointF& p, DeepSkyObject *obj )
void DeepSkyComponent::drawLabels()
{
+#ifndef KSTARS_LITE
if ( m_hideLabels ) return;
SkyLabeler *labeler = SkyLabeler::Instance();
@@ -493,7 +502,7 @@ void DeepSkyComponent::drawLabels()
}
list->clear();
}
-
+#endif
}
diff --git a/kstars/skycomponents/deepstarcomponent.cpp b/kstars/skycomponents/deepstarcomponent.cpp
index 71cf037..976f6c0 100644
--- a/kstars/skycomponents/deepstarcomponent.cpp
+++ b/kstars/skycomponents/deepstarcomponent.cpp
@@ -29,7 +29,9 @@
#include "Options.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skyobjects/starobject.h"
#include "skymesh.h"
#include "binfilehelper.h"
@@ -173,6 +175,7 @@ void DeepStarComponent::update( KSNumbers * )
// TODO: Optimize draw, if it is worth it.
void DeepStarComponent::draw( SkyPainter *skyp ) {
+#ifndef KSTARS_LITE
if ( !fileOpened ) return;
SkyMap *map = SkyMap::Instance();
@@ -303,7 +306,8 @@ void DeepStarComponent::draw( SkyPainter *skyp ) {
}
m_skyMesh->inDraw( false );
-
+#endif
+ Q_UNUSED(skyp)
}
bool DeepStarComponent::openDataFile() {
diff --git a/kstars/skycomponents/ecliptic.cpp b/kstars/skycomponents/ecliptic.cpp
index c385e08..d4d862f 100644
--- a/kstars/skycomponents/ecliptic.cpp
+++ b/kstars/skycomponents/ecliptic.cpp
@@ -19,7 +19,9 @@
#include "ksnumbers.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skyobjects/skypoint.h"
#include "dms.h"
#include "Options.h"
@@ -80,6 +82,7 @@ void Ecliptic::draw( SkyPainter *skyp )
}
void Ecliptic::drawCompassLabels() {
+#ifndef KSTARS_LITE
const Projector* proj = SkyMap::Instance()->projector();
KStarsData* data = KStarsData::Instance();
SkyLabeler* skyLabeler = SkyLabeler::Instance();
@@ -104,4 +107,5 @@ void Ecliptic::drawCompassLabels() {
skyLabeler->drawGuideLabel( cpoint, label, 0.0 );
}
}
+#endif
}
diff --git a/kstars/skycomponents/equator.cpp b/kstars/skycomponents/equator.cpp
index ee12d54..a8fee43 100644
--- a/kstars/skycomponents/equator.cpp
+++ b/kstars/skycomponents/equator.cpp
@@ -19,7 +19,9 @@
#include "ksnumbers.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skyobjects/skypoint.h"
#include "dms.h"
#include "Options.h"
@@ -81,6 +83,7 @@ void Equator::draw( SkyPainter *skyp )
}
void Equator::drawCompassLabels() {
+#ifndef KSTARS_LITE
QString label;
const Projector *proj = SkyMap::Instance()->projector();
@@ -101,4 +104,5 @@ void Equator::drawCompassLabels() {
skyLabeler->drawGuideLabel( cpoint, label, 0.0 );
}
}
+#endif
}
diff --git a/kstars/skycomponents/equatorialcoordinategrid.cpp b/kstars/skycomponents/equatorialcoordinategrid.cpp
index e28b69b..d872fe6 100644
--- a/kstars/skycomponents/equatorialcoordinategrid.cpp
+++ b/kstars/skycomponents/equatorialcoordinategrid.cpp
@@ -23,7 +23,9 @@
#include "Options.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "linelist.h"
#include "dms.h"
@@ -94,13 +96,20 @@ bool EquatorialCoordinateGrid::selected()
if ( Options::autoSelectGrid() )
return( ! Options::useAltAz() );
else
+#ifndef KSTARS_LITE
return( Options::showEquatorialGrid() &&
- ! ( Options::hideOnSlew() && Options::hideGrids() && SkyMap::IsSlewing() ) );
+ ! ( Options::hideOnSlew() && Options::hideGrids() && SkyMap::IsSlewing() ) );
+#else
+ return( Options::showEquatorialGrid() &&
+ ! ( Options::hideOnSlew() && Options::hideGrids() ) );
+#endif
}
void EquatorialCoordinateGrid::preDraw( SkyPainter* skyp )
{
+#ifndef KSTARS_LITE
KStarsData *data = KStarsData::Instance();
QColor color = data->colorScheme()->colorNamed( "EquatorialGridColor" );
skyp->setPen( QPen( QBrush( color ), 1, Qt::DotLine ) );
+#endif
}
diff --git a/kstars/skycomponents/flagcomponent.cpp b/kstars/skycomponents/flagcomponent.cpp
index b87d623..06ab8e8 100644
--- a/kstars/skycomponents/flagcomponent.cpp
+++ b/kstars/skycomponents/flagcomponent.cpp
@@ -26,7 +26,11 @@
#include "Options.h"
#include "kstarsdata.h"
+#ifdef KSTARS_LITE
+#include "skymaplite.h"
+#else
#include "skymap.h"
+#endif
#include "skyobjects/skypoint.h"
#include "ksfilereader.h"
#include "skypainter.h"
@@ -183,7 +187,9 @@ void FlagComponent::remove( int index ) {
m_LabelColors.removeAt( index );
// request SkyMap update
+#ifndef KSTARS_LITE
SkyMap::Instance()->forceUpdate();
+#endif
}
void FlagComponent::updateFlag( int index, SkyPoint *flagPoint, QString epoch, QString image, QString label, QColor labelColor ) {
@@ -271,7 +277,11 @@ QList<QImage> FlagComponent::imageList() {
QList<int> FlagComponent::getFlagsNearPix ( SkyPoint *point, int pixelRadius )
{
+#ifdef KSTARS_LITE
+ const Projector *proj = SkyMapLite::Instance()->projector();
+#else
const Projector *proj = SkyMap::Instance()->projector();
+#endif
QPointF pos = proj->toScreen(point);
QList<int> retVal;
diff --git a/kstars/skycomponents/horizoncomponent.cpp b/kstars/skycomponents/horizoncomponent.cpp
index 2d0004c..20158c1 100644
--- a/kstars/skycomponents/horizoncomponent.cpp
+++ b/kstars/skycomponents/horizoncomponent.cpp
@@ -23,7 +23,9 @@
#include "Options.h"
#include "kstarsdata.h"
#include "ksnumbers.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skyobjects/skypoint.h"
#include "dms.h"
#include "skylabeler.h"
@@ -446,6 +448,7 @@ void HorizonComponent::draw( SkyPainter *skyp )
}
void HorizonComponent::drawCompassLabels() {
+#ifndef KSTARS_LITE
SkyPoint c;
QPointF cpoint;
bool visible;
@@ -482,4 +485,5 @@ void HorizonComponent::drawCompassLabels() {
skyLabeler->drawGuideLabel( cpoint, name[i], 0.0 );
}
}
+#endif
}
diff --git a/kstars/skycomponents/horizontalcoordinategrid.cpp b/kstars/skycomponents/horizontalcoordinategrid.cpp
index ef60a22..05687a5 100644
--- a/kstars/skycomponents/horizontalcoordinategrid.cpp
+++ b/kstars/skycomponents/horizontalcoordinategrid.cpp
@@ -23,7 +23,9 @@
#include "Options.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "linelist.h"
#include "dms.h"
@@ -98,8 +100,13 @@ bool HorizontalCoordinateGrid::selected()
if ( Options::autoSelectGrid() )
return( Options::useAltAz() );
else
+#ifndef KSTARS_LITE
return( Options::showHorizontalGrid() &&
! ( Options::hideOnSlew() && Options::hideGrids() && SkyMap::IsSlewing() ) );
+#else
+ return( Options::showHorizontalGrid() &&
+ ! ( Options::hideOnSlew() && Options::hideGrids() ) );
+#endif
}
void HorizontalCoordinateGrid::preDraw( SkyPainter* skyp )
diff --git a/kstars/skycomponents/linelistindex.cpp b/kstars/skycomponents/linelistindex.cpp
index 263fb4e..f6ccad0 100644
--- a/kstars/skycomponents/linelistindex.cpp
+++ b/kstars/skycomponents/linelistindex.cpp
@@ -41,7 +41,9 @@
#include "Options.h"
#include "kstarsdata.h"
#include "skyobjects/skyobject.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skymesh.h"
#include "linelist.h"
diff --git a/kstars/skycomponents/linelistlabel.cpp b/kstars/skycomponents/linelistlabel.cpp
index 0be66e4..e2114e4 100644
--- a/kstars/skycomponents/linelistlabel.cpp
+++ b/kstars/skycomponents/linelistlabel.cpp
@@ -20,7 +20,9 @@
#include "linelistlabel.h"
#include "Options.h"
#include "skyobjects/skypoint.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skylabeler.h"
#include "linelist.h"
#include "projections/projector.h"
@@ -91,6 +93,7 @@ void LineListLabel::updateLabelCandidates( qreal x, qreal y, LineList* lineList,
void LineListLabel::draw()
{
+#ifndef KSTARS_LITE
const Projector *proj = SkyMap::Instance()->projector();
double comfyAngle = 40.0; // the first valid candidate with an angle
@@ -166,6 +169,7 @@ void LineListLabel::draw()
}
m_skyLabeler->drawGuideLabel( o[best], m_text, a[best] );
+#endif
}
diff --git a/kstars/skycomponents/listcomponent.cpp b/kstars/skycomponents/listcomponent.cpp
index c2b2040..72b8973 100644
--- a/kstars/skycomponents/listcomponent.cpp
+++ b/kstars/skycomponents/listcomponent.cpp
@@ -20,7 +20,9 @@
#include <QList>
#include "kstarsdata.h"
-#include "skymap.h"
+#ifndef KSTARS_LITE
+#include "skymap.h"
+#endif
#include "skyobjects/skyobject.h"
ListComponent::ListComponent( SkyComposite *parent ) :
diff --git a/kstars/skycomponents/milkyway.cpp b/kstars/skycomponents/milkyway.cpp
index cee697c..ae09eea 100644
--- a/kstars/skycomponents/milkyway.cpp
+++ b/kstars/skycomponents/milkyway.cpp
@@ -24,7 +24,9 @@
#include <KLocalizedString>
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skyobjects/skypoint.h"
#include "dms.h"
#include "Options.h"
@@ -62,8 +64,13 @@ SkipList* MilkyWay::skipList( LineList* lineList ) {
bool MilkyWay::selected()
{
+#ifndef KSTARS_LITE
return Options::showMilkyWay() &&
! ( Options::hideOnSlew() && Options::hideMilkyWay() && SkyMap::IsSlewing() );
+#else
+ return Options::showMilkyWay() &&
+ ! ( Options::hideOnSlew() && Options::hideMilkyWay() );
+#endif
}
void MilkyWay::draw( SkyPainter *skyp )
diff --git a/kstars/skycomponents/planetmoonscomponent.cpp b/kstars/skycomponents/planetmoonscomponent.cpp
index d23c129..f12ecdf 100644
--- a/kstars/skycomponents/planetmoonscomponent.cpp
+++ b/kstars/skycomponents/planetmoonscomponent.cpp
@@ -23,7 +23,9 @@
#include "skyobjects/jupitermoons.h"
#include "skyobjects/ksplanetbase.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skyobjects/skypoint.h"
#include "skyobjects/trailobject.h"
#include "dms.h"
diff --git a/kstars/skycomponents/satellitescomponent.cpp b/kstars/skycomponents/satellitescomponent.cpp
index 6842933..68f6cca 100644
--- a/kstars/skycomponents/satellitescomponent.cpp
+++ b/kstars/skycomponents/satellitescomponent.cpp
@@ -23,7 +23,9 @@
#include <QNetworkAccessManager>
#include <QNetworkReply>
+#ifndef KSTARS_LITE
#include <KJobUiDelegate>
+#endif
#include <KLocalizedString>
#include "satellitegroup.h"
@@ -159,14 +161,22 @@ void SatellitesComponent::updateTLEs()
}
else
{
+ #ifndef KSTARS_LITE
KMessageBox::error(0, file.errorString());
+ #else
+ qDebug() << file.errorString();
+ #endif
return;
}
}
else
{
- KMessageBox::error(0, response->errorString());
+ #ifndef KSTARS_LITE
+ KMessageBox::error(0, response->errorString());
+ #else
+ qDebug() << response->errorString();
+ #endif
return;
}
}
diff --git a/kstars/skycomponents/skycomponent.h b/kstars/skycomponents/skycomponent.h
index 51d7081..cf84c14 100644
--- a/kstars/skycomponents/skycomponent.h
+++ b/kstars/skycomponents/skycomponent.h
@@ -21,6 +21,8 @@
#include <QDebug>
#include "typedef.h"
+//TODO Find a more appropriate place to include kstarslite.h
+#include "../kstarslite.h"
class QString;
diff --git a/kstars/skycomponents/skylabeler.cpp b/kstars/skycomponents/skylabeler.cpp
index 50b984a..425e75e 100644
--- a/kstars/skycomponents/skylabeler.cpp
+++ b/kstars/skycomponents/skylabeler.cpp
@@ -24,7 +24,9 @@
#include "Options.h"
#include "kstarsdata.h" // MINZOOM
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "projections/projector.h"
//---------------------------------------------------------------------------//
@@ -210,6 +212,7 @@ void SkyLabeler::getMargins( const QString& text, float *left,
void SkyLabeler::reset( SkyMap* skyMap )
{
+#ifndef KSTARS_LITE
// ----- Set up Projector ---
m_proj = skyMap->projector();
// ----- Set up Painter -----
@@ -271,6 +274,7 @@ void SkyLabeler::reset( SkyMap* skyMap )
for (int i = 0; i < labelList.size(); i++) {
labelList[ i ].clear();
}
+#endif
}
void SkyLabeler::draw(QPainter& p)
diff --git a/kstars/skycomponents/skymapcomposite.cpp b/kstars/skycomponents/skymapcomposite.cpp
index 3e372ca..586225e 100644
--- a/kstars/skycomponents/skymapcomposite.cpp
+++ b/kstars/skycomponents/skymapcomposite.cpp
@@ -22,7 +22,9 @@
#include "Options.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skyobjects/starobject.h"
#include "skyobjects/deepskyobject.h"
#include "skyobjects/ksplanet.h"
@@ -50,9 +52,9 @@
#include "constellationartcomponent.h"
#include "kscomet.h"
#include "ksasteroid.h"
+#ifndef KSTARS_LITE
#include "observinglist.h"
-#ifndef KSTARS_LITE
#include "flagcomponent.h"
#endif
@@ -107,8 +109,8 @@ SkyMapComposite::SkyMapComposite(SkyComposite *parent ) :
addComponent( m_SolarSystem = new SolarSystemComposite( this ), 2);
- addComponent( m_ObservingList = new TargetListComponent( this , 0, QPen(),
- &Options::obsListSymbol, &Options::obsListText ), 120 );
+ //addComponent( m_ObservingList = new TargetListComponent( this , 0, QPen(),
+ // &Options::obsListSymbol, &Options::obsListText ), 120 );
addComponent( m_StarHopRouteList = new TargetListComponent( this , 0, QPen() ), 130 );
addComponent( m_Satellites = new SatellitesComponent( this ), 7 );
addComponent( m_Supernovae = new SupernovaeComponent( this ), 7 );
@@ -157,7 +159,9 @@ SkyMapComposite::~SkyMapComposite()
delete m_skyLabeler; // These are on the heap to avoid header file hell.
delete m_skyMesh;
delete m_Cultures;
+ #ifndef KSTARS_LITE
delete m_Flags;
+ #endif
}
void SkyMapComposite::update(KSNumbers *num )
@@ -215,6 +219,8 @@ void SkyMapComposite::updateMoons(KSNumbers *num )
//should appear "behind" others should be drawn first.
void SkyMapComposite::draw( SkyPainter *skyp )
{
+#ifndef KSTARS_LITE
+
SkyMap *map = SkyMap::Instance();
KStarsData *data = KStarsData::Instance();
@@ -347,6 +353,7 @@ void SkyMapComposite::draw( SkyPainter *skyp )
p->draw( *psky, NO_PRECESS_BUF );
}
*/
+#endif
}
@@ -554,12 +561,14 @@ void SkyMapComposite::removeCustomCatalog( const QString &name ) {
}
void SkyMapComposite::reloadCLines( ) {
+#ifndef KSTARS_LITE
Q_ASSERT( !SkyMapDrawAbstract::drawLock() );
SkyMapDrawAbstract::setDrawLock( true ); // This is not (yet) multithreaded, so I think we don't have to worry about overwriting the state of an existing lock --asimha
delete m_CLines;
m_CLines = 0;
m_CLines = new ConstellationLines( this, m_Cultures );
SkyMapDrawAbstract::setDrawLock( false );
+#endif
}
void SkyMapComposite::reloadCNames( ) {
@@ -576,15 +585,18 @@ void SkyMapComposite::reloadCNames( ) {
}
void SkyMapComposite::reloadConstellationArt(){
+#ifndef KSTARS_LITE
Q_ASSERT( !SkyMapDrawAbstract::drawLock() );
SkyMapDrawAbstract::setDrawLock( true );
delete m_ConstellationArt;
m_ConstellationArt=0;
m_ConstellationArt = new ConstellationArtComponent( this, m_Cultures );
SkyMapDrawAbstract::setDrawLock( false );
+#endif
}
void SkyMapComposite::reloadDeepSky() {
+#ifndef KSTARS_LITE
Q_ASSERT( !SkyMapDrawAbstract::drawLock() );
// Deselect object if selected! If not deselected then InfoBox tries to
@@ -612,7 +624,7 @@ void SkyMapComposite::reloadDeepSky() {
);
}
SkyMapDrawAbstract::setDrawLock(false);
-
+#endif
}
diff --git a/kstars/skycomponents/skymesh.cpp b/kstars/skycomponents/skymesh.cpp
index d0e3ecb..fcba111 100644
--- a/kstars/skycomponents/skymesh.cpp
+++ b/kstars/skycomponents/skymesh.cpp
@@ -28,7 +28,9 @@
// these are just for the draw routine:
#include <QPainter>
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
QMap<int, SkyMesh *> SkyMesh::pinstances;
int SkyMesh::defaultLevel = -1;
@@ -339,7 +341,7 @@ const IndexHash& SkyMesh::indexPoly( const QPolygonF* points )
// purpose. -- asimha
void SkyMesh::draw(QPainter &psky, MeshBufNum_t bufNum)
{
-
+#ifndef KSTARS_LITE
SkyMap* map = SkyMap::Instance();
KStarsData* data = KStarsData::Instance();
@@ -366,7 +368,7 @@ void SkyMesh::draw(QPainter &psky, MeshBufNum_t bufNum)
TrixelNumberString.setNum( trixel );
psky.drawText( (q1 + q2 + q3 ) / 3.0, TrixelNumberString );
}
-
+#endif
}
const SkyRegion& SkyMesh::skyRegion( const SkyPoint& _p1, const SkyPoint& _p2 )
diff --git a/kstars/skycomponents/solarsystemcomposite.cpp b/kstars/skycomponents/solarsystemcomposite.cpp
index ba6da20..a327321 100644
--- a/kstars/skycomponents/solarsystemcomposite.cpp
+++ b/kstars/skycomponents/solarsystemcomposite.cpp
@@ -25,7 +25,9 @@
#include "skycomponent.h"
#include "Options.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "kstarsdata.h"
#include "ksnumbers.h"
#include "skyobjects/ksplanet.h"
@@ -68,8 +70,13 @@ SolarSystemComposite::~SolarSystemComposite()
bool SolarSystemComposite::selected()
{
+#ifndef KSTARS_LITE
return Options::showSolarSystem() &&
!( Options::hideOnSlew() && Options::hidePlanets() && SkyMap::IsSlewing() );
+#else
+ return Options::showSolarSystem() &&
+ !( Options::hideOnSlew() && Options::hidePlanets() );
+#endif
}
void SolarSystemComposite::update( KSNumbers *num )
diff --git a/kstars/skycomponents/solarsystemlistcomponent.cpp b/kstars/skycomponents/solarsystemlistcomponent.cpp
index 1050435..820259a 100644
--- a/kstars/skycomponents/solarsystemlistcomponent.cpp
+++ b/kstars/skycomponents/solarsystemlistcomponent.cpp
@@ -25,7 +25,9 @@
#include "skyobjects/ksplanet.h"
#include "skyobjects/ksplanetbase.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
SolarSystemListComponent::SolarSystemListComponent( SolarSystemComposite *p ) :
ListComponent( p ),
diff --git a/kstars/skycomponents/starcomponent.cpp b/kstars/skycomponents/starcomponent.cpp
index 975b4a1..03cfee1 100644
--- a/kstars/skycomponents/starcomponent.cpp
+++ b/kstars/skycomponents/starcomponent.cpp
@@ -26,7 +26,9 @@
#include "kstarsdata.h"
#include "skymap.h"
#include "skyobjects/starobject.h"
+#ifndef KSTARS_LITE
#include "skyqpainter.h"
+#endif
#include "skypainter.h"
#include "skymesh.h"
@@ -74,7 +76,11 @@ StarComponent::StarComponent(SkyComposite *parent )
loadStaticData();
// Load any deep star catalogs that are available
loadDeepStarCatalogs();
+#ifdef KSTARS_LITE
+ //SkyMapLite::Instance()->initStarImages();
+#else
SkyQPainter::initStarImages();
+#endif
}
StarComponent::~StarComponent() {
@@ -229,6 +235,7 @@ float StarComponent::zoomMagnitudeLimit() {
void StarComponent::draw( SkyPainter *skyp )
{
+#ifndef KSTARS_LITE
if( !selected() )
return;
@@ -325,6 +332,7 @@ void StarComponent::draw( SkyPainter *skyp )
for( int i =0; i < m_DeepStarComponents.size(); ++i ) {
m_DeepStarComponents.at( i )->draw( skyp );
}
+#endif
}
void StarComponent::addLabel( const QPointF& p, StarObject *star )
diff --git a/kstars/skycomponents/supernovaecomponent.cpp b/kstars/skycomponents/supernovaecomponent.cpp
index 7b0932c..aa06892 100644
--- a/kstars/skycomponents/supernovaecomponent.cpp
+++ b/kstars/skycomponents/supernovaecomponent.cpp
@@ -16,7 +16,9 @@
***************************************************************************/
#include "supernovaecomponent.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "skypainter.h"
#include "skymesh.h"
#include "skylabeler.h"
@@ -198,6 +200,7 @@ void SupernovaeComponent::draw(SkyPainter *skyp)
void SupernovaeComponent::notifyNewSupernovae()
{
+#ifndef KSTARS_LITE
//qDebug()<<"New Supernovae discovered";
QList<SkyObject*> latestList;
foreach (SkyObject * so, latest)
@@ -221,6 +224,7 @@ void SupernovaeComponent::notifyNewSupernovae()
}
// if (!latest.empty())
// KMessageBox::informationList(0, i18n("New Supernovae discovered!"), latestList, i18n("New Supernovae discovered!"));
+#endif
}
@@ -253,9 +257,14 @@ void SupernovaeComponent::slotDataFileUpdateFinished( int exitCode, QProcess::Ex
errmsg = i18n( "Python process that updates the supernova information failed with error code %1. This could likely be because the computer is not connected to the internet or because the server containing supernova information is not responding.", QString::number( exitCode ) );
break;
}
+ #ifndef KSTARS_LITE
if( KStars::Instance() && SkyMap::Instance() ) // Displaying a message box causes entry of control into the Qt event loop. Can lead to segfault if we are checking for supernovae alerts during initialization!
KMessageBox::sorry( 0, errmsg, i18n("Supernova information update failed") );
// FIXME: There should be a better way to check if KStars is fully initialized. Maybe we should have a static boolean in the KStars class. --asimha
+ #else
+ if( KStarsLite::Instance() && SkyMapLite::Instance() ) // Displaying a message box causes entry of control into the Qt event loop. Can lead to segfault if we are checking for supernovae alerts during initialization!
+ qDebug() << errmsg << i18n("Supernova information update failed");
+ #endif
}
else {
//qDebug()<<"HERE";
diff --git a/kstars/skycomponents/targetlistcomponent.cpp b/kstars/skycomponents/targetlistcomponent.cpp
index 36dfe44..7890df3 100644
--- a/kstars/skycomponents/targetlistcomponent.cpp
+++ b/kstars/skycomponents/targetlistcomponent.cpp
@@ -16,7 +16,9 @@
***************************************************************************/
#include "targetlistcomponent.h"
+#ifndef KSTARS_LITE
#include "skymap.h"
+#endif
#include "Options.h"
TargetListComponent::TargetListComponent( SkyComposite *parent ) : SkyComponent( parent ) {
diff --git a/kstars/skymap.cpp b/kstars/skymap.cpp
index f9e8311..ab7a8e9 100644
--- a/kstars/skymap.cpp
+++ b/kstars/skymap.cpp
@@ -138,7 +138,7 @@ SkyMap* SkyMap::Instance( )
return pinstance;
}
-SkyMap::SkyMap() :
+SkyMap::SkyMap() :
QGraphicsView( KStars::Instance() ),
computeSkymap(true), rulerMode(false),
data( KStarsData::Instance() ), pmenu(0),
@@ -160,7 +160,7 @@ SkyMap::SkyMap() :
setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
- setStyleSheet( "QGraphicsView { border-style: none; }" );
+ setStyleSheet( "QGraphicsView { border-style: none; }" );
setMouseTracking (true); //Generate MouseMove events!
midMouseButtonDown = false;
@@ -231,7 +231,7 @@ SkyMap::SkyMap() :
m_SkyMapDraw = new SkyMapQDraw( this );
m_SkyMapDraw->setMouseTracking( true );
#endif
-
+
m_SkyMapDraw->setParent( this->viewport() );
m_SkyMapDraw->show();
@@ -298,7 +298,7 @@ SkyMap::~SkyMap() {
Options::setShadeFocusBox( m_objBox->shaded() );
Options::setStickyFocusBox( m_objBox->sticky() );
Options::setShowFocusBox( m_objBox->isVisibleTo(m_iboxes) );
-
+
//store focus values in Options
//If not tracking and using Alt/Az coords, stor the Alt/Az coordinates
if ( Options::useAltAz() && ! Options::isTracking() ) {
@@ -355,7 +355,7 @@ void SkyMap::slotTransientLabel() {
//Slots
void SkyMap::setClickedObject( SkyObject *o ) {
- ClickedObject = o;
+ ClickedObject = o;
}
void SkyMap::setFocusObject( SkyObject *o ) {
@@ -516,7 +516,7 @@ void SkyMap::beginRulerMode( bool starHopRuler ) {
starHopDefineMode = starHopRuler;
AngularRuler.clear();
- //If the cursor is near a SkyObject, reset the AngularRuler's
+ //If the cursor is near a SkyObject, reset the AngularRuler's
//start point to the position of the SkyObject
double maxrad = 1000.0/Options::zoomFactor();
SkyObject *so = data->skyComposite()->objectNearest( clickedPoint(), maxrad );
@@ -843,7 +843,7 @@ void SkyMap::setDestinationAltAz( const dms &alt, const dms &az) {
emit destinationChanged();
}
-void SkyMap::setClickedPoint( SkyPoint *f ) {
+void SkyMap::setClickedPoint( SkyPoint *f ) {
ClickedPoint = *f;
}
@@ -942,11 +942,11 @@ void SkyMap::slewFocus() {
//switch directions to go the short way around the celestial sphere, if necessary.
dX = KSUtils::reduceAngle(dX, -180.0, 180.0);
r = sqrt( dX*dX + dY*dY );
-
+
//Modify step according to a cosine-shaped profile
//centered on the midpoint of the slew
//NOTE: don't allow the full range from -PI/2 to PI/2
- //because the slew will never reach the destination as
+ //because the slew will never reach the destination as
//the speed approaches zero at the end!
double t = dms::PI*(r - 0.5*r0)/(1.05*r0);
step = cos(t)*maxstep;
@@ -1017,7 +1017,7 @@ void SkyMap::forceUpdate( bool now )
m_SkyMapDraw->repaint();
else
m_SkyMapDraw->update();
-
+
}
float SkyMap::fov() {
@@ -1166,7 +1166,7 @@ void SkyMap::startXplanet( const QString & outputFile ) {
// Add some options
*xplanetProc << Options::xplanetPath()
- << "-body" << clickedObject()->name().toLower()
+ << "-body" << clickedObject()->name().toLower()
<< "-geometry" << Options::xplanetWidth() + 'x' + Options::xplanetHeight()
<< "-date" << year + month + day + '.' + hour + minute + seconde
<< "-glare" << Options::xplanetGlare()
diff --git a/kstars/skyobjects/deepskyobject.cpp b/kstars/skyobjects/deepskyobject.cpp
index cb9941a..1478194 100644
--- a/kstars/skyobjects/deepskyobject.cpp
+++ b/kstars/skyobjects/deepskyobject.cpp
@@ -29,7 +29,9 @@
#include "kstarsdata.h"
#include "ksutils.h"
#include "dms.h"
+#ifndef KSTARS_LITE
#include "kspopupmenu.h"
+#endif
#include "Options.h"
#include "skymap.h"
#include "texturemanager.h"
@@ -77,7 +79,9 @@ DeepSkyObject* DeepSkyObject::clone() const
}
void DeepSkyObject::initPopupMenu( KSPopupMenu *pmenu ) {
+#ifndef KSTARS_LITE
pmenu->createDeepSkyObjectMenu( this );
+#endif
}
float DeepSkyObject::e() const {
diff --git a/kstars/skyobjects/ksmoon.cpp b/kstars/skyobjects/ksmoon.cpp
index 623d172..6fea7e2 100644
--- a/kstars/skyobjects/ksmoon.cpp
+++ b/kstars/skyobjects/ksmoon.cpp
@@ -32,7 +32,9 @@
#include "ksutils.h"
#include "kssun.h"
#include "kstarsdata.h"
+#ifndef KSTARS_LITE
#include "kspopupmenu.h"
+#endif
#include "skycomponents/skymapcomposite.h"
#include "texturemanager.h"
@@ -285,7 +287,9 @@ QString KSMoon::phaseName() const {
}
void KSMoon::initPopupMenu( KSPopupMenu* pmenu ) {
+#ifndef KSTARS_LITE
pmenu->createMoonMenu( this );
+#endif
}
SkyObject::UID KSMoon::getUID() const
diff --git a/kstars/skyobjects/satellite.cpp b/kstars/skyobjects/satellite.cpp
index 9a466fc..a2daea2 100644
--- a/kstars/skyobjects/satellite.cpp
+++ b/kstars/skyobjects/satellite.cpp
@@ -28,7 +28,9 @@
#include "skymapcomposite.h"
#include "kssun.h"
#include "Options.h"
+#ifndef KSTARS_LITE
#include "kspopupmenu.h"
+#endif
// Define some constants
// WGS-72 constants
@@ -1244,7 +1246,9 @@ void Satellite::setSelected( bool selected )
}
void Satellite::initPopupMenu( KSPopupMenu *pmenu ) {
+#ifndef KSTARS_LITE
pmenu->createSatelliteMenu( this );
+#endif
}
double Satellite::velocity()
diff --git a/kstars/skyobjects/skyobject.cpp b/kstars/skyobjects/skyobject.cpp
index 61da7db..167c012 100644
--- a/kstars/skyobjects/skyobject.cpp
+++ b/kstars/skyobjects/skyobject.cpp
@@ -29,7 +29,9 @@
#include "starobject.h" //needed in saveUserLog()
#include "ksnumbers.h"
+#ifndef KSTARS_LITE
#include "kspopupmenu.h"
+#endif
#include "dms.h"
#include "geolocation.h"
#include "kstarsdatetime.h"
@@ -83,12 +85,16 @@ SkyObject* SkyObject::clone() const
SkyObject::~SkyObject() {}
void SkyObject::showPopupMenu( KSPopupMenu *pmenu, const QPoint &pos ) {
+#ifndef KSTARS_LITE
initPopupMenu( pmenu );
pmenu->popup( pos );
+#endif
}
void SkyObject::initPopupMenu( KSPopupMenu *pmenu ) {
+#ifndef KSTARS_LITE
pmenu->createEmptyMenu( this );
+#endif
}
void SkyObject::setLongName( const QString &longname ) {
diff --git a/kstars/skyobjects/starobject.cpp b/kstars/skyobjects/starobject.cpp
index 1683999..bb53b0a 100644
--- a/kstars/skyobjects/starobject.cpp
+++ b/kstars/skyobjects/starobject.cpp
@@ -26,7 +26,9 @@
#include <QPixmap>
#include <QDebug>
+#ifndef KSTARS_LITE
#include "kspopupmenu.h"
+#endif
#include "ksnumbers.h"
#include "kstarsdata.h"
#include "kstarsdatetime.h"
@@ -244,9 +246,10 @@ void StarObject::setNames( QString name, QString name2 ) {
lname = gname();
setLongName(lname);
}
-
void StarObject::initPopupMenu( KSPopupMenu *pmenu ) {
+#ifndef KSTARS_LITE
pmenu->createStarMenu( this );
+#endif
}
void StarObject::updateCoords( const KSNumbers *num, bool , const dms*, const dms*, bool ) {
diff --git a/kstars/skyobjects/supernova.cpp b/kstars/skyobjects/supernova.cpp
index 5a6e893..e24db2e 100644
--- a/kstars/skyobjects/supernova.cpp
+++ b/kstars/skyobjects/supernova.cpp
@@ -18,7 +18,9 @@
#include "supernova.h"
#include <typeinfo>
+#ifndef KSTARS_LITE
#include "kspopupmenu.h"
+#endif
Supernova::Supernova(dms ra, dms dec, const QString& date ,float m, const QString& serialNo,
const QString& type, const QString& hostGalaxy, const QString& offset,
@@ -43,5 +45,7 @@ Supernova* Supernova::clone() const
void Supernova::initPopupMenu(KSPopupMenu* pmenu)
{
+#ifndef KSTARS_LITE
pmenu->createSupernovaMenu(this);
+#endif
}
diff --git a/kstars/skyobjects/trailobject.cpp b/kstars/skyobjects/trailobject.cpp
index 1375303..df1fe52 100644
--- a/kstars/skyobjects/trailobject.cpp
+++ b/kstars/skyobjects/trailobject.cpp
@@ -19,7 +19,9 @@
#include "kstarsdata.h"
#include "skymap.h"
+#ifndef KSTARS_LITE
#include "kspopupmenu.h"
+#endif
#include "skycomponents/skylabeler.h"
#include "skypainter.h"
#include "projections/projector.h"
@@ -54,7 +56,9 @@ void TrailObject::updateTrail( dms *LST, const dms *lat ) {
}
void TrailObject::initPopupMenu( KSPopupMenu *pmenu ) {
+#ifndef KSTARS_LITE
pmenu->createPlanetMenu( this );
+#endif
}
void TrailObject::addToTrail( const QString &label ) {
@@ -94,6 +98,7 @@ void TrailObject::clearTrailsExcept(SkyObject* o) {
}
void TrailObject::drawTrail(SkyPainter* skyp) const {
+#ifndef KSTARS_LITE
if( !Trail.size() )
return;
@@ -117,5 +122,5 @@ void TrailObject::drawTrail(SkyPainter* skyp) const {
labeler->drawGuideLabel( pt, m_TrailLabels[i - 1], 0.0 );
}
}
-
+#endif
}
diff --git a/kstars/texturemanager.cpp b/kstars/texturemanager.cpp
index 5c8843c..eb3caaf 100644
--- a/kstars/texturemanager.cpp
+++ b/kstars/texturemanager.cpp
@@ -19,9 +19,13 @@
*/
#include "texturemanager.h"
+#ifdef KSTARS_LITE
+#include <QStandardPaths>
+#include <QImage>
+#else
#include "skymap.h"
#include "kstars.h"
-
+#endif
#ifdef HAVE_OPENGL
diff --git a/kstars/time/simclock.cpp b/kstars/time/simclock.cpp
index 87f389f..1bb5c99 100644
--- a/kstars/time/simclock.cpp
+++ b/kstars/time/simclock.cpp
@@ -20,8 +20,8 @@
#include <QDebug>
#include <KLocalizedString>
-#include "kstars.h"
#ifndef KSTARS_LITE
+#include "kstars.h"
#include "simclockadaptor.h"
#endif
diff --git a/kstars/time/simclock.h b/kstars/time/simclock.h
index 7ba29d9..cda48d4 100644
--- a/kstars/time/simclock.h
+++ b/kstars/time/simclock.h
@@ -88,7 +88,21 @@ public Q_SLOTS:
/** DBUS function to set scale of simclock. */
Q_SCRIPTABLE Q_NOREPLY void setClockScale(float s);
+ #else
+ // Define non-DBUS versions of functions above for use within KStarsLite
+ /** Function to stop the SimClock. */
+ void stop();
+
+ /** Function to start the SimClock. */
+ void start();
+
+ /** Function to set the time of the SimClock. */
+ void setUTC(const KStarsDateTime &newtime);
+
+ /** Function to set scale of simclock. */
+ void setClockScale(float s);
#endif
+
/** Respond to the QTimer::timeout signal */
void tick();