Commit 5a45a75d authored by Artem Fedoskin's avatar Artem Fedoskin
Browse files

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)
parent bad8ee29
......@@ -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/)
......
<?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>
......@@ -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)
......@@ -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)
......@@ -3,4 +3,4 @@ IncludeFiles=qpoint.h
ClassName=Options
Singleton=yes
Mutators=true
GenerateProperties=true
#GenerateProperties=true
......@@ -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
}
......@@ -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)
......
......@@ -16,7 +16,9 @@
***************************************************************************/
#include "imageviewer.h"
#ifndef KSTARS_LITE
#include "kstars.h"
#endif
#include <QFont>
#include <QPainter>
......@@ -32,16 +34,20 @@
#include <QFileDialog>