Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
cmake_minimum_required(VERSION 3.0.0)
project(telescope C CXX)

# Automatically create moc files
set(CMAKE_AUTOMOC ON)

find_package(Qt5Core REQUIRED)
find_package(Qt5Qml REQUIRED)
find_package(Qt5Quick REQUIRED)
find_package(Qt5QuickControls2 REQUIRED)

execute_process(
COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
OUTPUT_VARIABLE ARCH_TRIPLET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")

set(PROJECT_NAME "telescope")
set(FULL_PROJECT_NAME "telescope.asteroidos")
set(DATA_DIR /)
set(DESKTOP_FILE_NAME ${PROJECT_NAME}.desktop)

# This command figures out the minimum SDK framework for use in the manifest
# file via the environment variable provided by Clickable or sets a default value otherwise.
if(DEFINED ENV{SDK_FRAMEWORK})
set(CLICK_FRAMEWORK "$ENV{SDK_FRAMEWORK}")
else()
set(CLICK_FRAMEWORK "ubuntu-sdk-20.04")
endif()

# This figures out the target architecture for use in the manifest file.
if(DEFINED ENV{ARCH})
set(CLICK_ARCH "$ENV{ARCH}")
else()
execute_process(
COMMAND dpkg-architecture -qDEB_HOST_ARCH
OUTPUT_VARIABLE CLICK_ARCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()

configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${PROJECT_NAME}.apparmor DESTINATION ${DATA_DIR})
install(FILES asteroidsyncserviced.apparmor DESTINATION ${DATA_DIR})
install(FILES assets/icon.svg assets/icon.png DESTINATION assets)

# Translations
file(GLOB_RECURSE I18N_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/po qml/*.qml qml/*.js)
list(APPEND I18N_SRC_FILES ${DESKTOP_FILE_NAME}.in.h)

find_program(INTLTOOL_MERGE intltool-merge)
if(NOT INTLTOOL_MERGE)
message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package")
endif()
find_program(INTLTOOL_EXTRACT intltool-extract)
if(NOT INTLTOOL_EXTRACT)
message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")
endif()

add_custom_target(${DESKTOP_FILE_NAME} ALL
COMMENT "Merging translations into ${DESKTOP_FILE_NAME}..."
COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${CMAKE_SOURCE_DIR}/${DESKTOP_FILE_NAME}.in ${DESKTOP_FILE_NAME}
COMMAND sed -i 's/${PROJECT_NAME}-//g' ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME}
)

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DATA_DIR})

add_subdirectory(po)
add_subdirectory(app)
add_subdirectory(asteroidsyncservice)

# Make source files visible in qtcreator
file(GLOB_RECURSE PROJECT_SRC_FILES
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
qml/*.qml
qml/*.js
app/*
asteroidsyncservice/*
*.json
*.json.in
*.apparmor
*.desktop.in
)

add_custom_target(${PROJECT_NAME}_FILES ALL SOURCES ${PROJECT_SRC_FILES})
5 changes: 5 additions & 0 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
qt5_add_resources(QT_RESOURCES app.qrc)
add_executable(${PROJECT_NAME} main.cpp ${QT_RESOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS_RELEASE -s)
target_link_libraries(${PROJECT_NAME} Qt5::Gui Qt5::Qml Qt5::Quick Qt5::QuickControls2)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
4 changes: 2 additions & 2 deletions app/qml/components/ExpandableListItem.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Lomiri.Components 1.3

ListItem {
id: expandableListItem
Expand Down Expand Up @@ -45,7 +45,7 @@ ListItem {
rotation: expandableListItem.expansion.expanded ? 180 : 0

Behavior on rotation {
UbuntuNumberAnimation {}
LomiriNumberAnimation {}
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions app/qml/components/InfoBar.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Lomiri.Components 1.3

Rectangle {
id: infoBar
Expand Down Expand Up @@ -49,14 +49,14 @@ Rectangle {
SequentialAnimation {
id: animaDestroy

UbuntuNumberAnimation {
LomiriNumberAnimation {
target: infoBar.anchors
property: "bottomMargin"
to: -infoBar.height
duration: 500; easing.type: Easing.InOutCirc
}

UbuntuNumberAnimation {
LomiriNumberAnimation {
target: infoBar
property: "opacity"
to: 0
Expand All @@ -66,10 +66,10 @@ Rectangle {


Behavior on opacity {
UbuntuNumberAnimation { duration: 500; easing.type: Easing.InOutCirc }
LomiriNumberAnimation { duration: 500; easing.type: Easing.InOutCirc }
}

Behavior on anchors.bottomMargin {
UbuntuNumberAnimation { duration: 500; easing.type: Easing.InOutCirc }
LomiriNumberAnimation { duration: 500; easing.type: Easing.InOutCirc }
}
}
2 changes: 1 addition & 1 deletion app/qml/components/NotificationServiceItem.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Lomiri.Components 1.3
import "../components"

Item {
Expand Down
2 changes: 1 addition & 1 deletion app/qml/components/StandardListItem.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick 2.4
import Ubuntu.Components 1.3
import Lomiri.Components 1.3

ListItem {
id: listItem
Expand Down
4 changes: 2 additions & 2 deletions app/qml/pages/ExportPage.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.9
import Ubuntu.Components 1.3
import Ubuntu.Content 1.3
import Lomiri.Components 1.3
import Lomiri.Content 1.3
import "../components"

Page {
Expand Down
8 changes: 4 additions & 4 deletions app/qml/pages/InfoPage.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3
import Lomiri.Components 1.3

Page {

Expand Down Expand Up @@ -33,7 +33,7 @@ Page {
anchors.top: header.bottom
width:parent.width

UbuntuShape {
LomiriShape {
width: units.gu(15); height: units.gu(15)
anchors.horizontalCenter: parent.horizontalCenter
radius: "medium"
Expand All @@ -53,7 +53,7 @@ Page {

Label {
width: parent.width
color: UbuntuColors.ash
color: LomiriColors.ash
horizontalAlignment: Text.AlignHCenter
text: i18n.tr("Version ") + "0.0.7"
}
Expand All @@ -67,7 +67,7 @@ Page {

Label {
width: parent.width
linkColor: UbuntuColors.orange
linkColor: LomiriColors.orange
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
//TRANSLATORS: Please make sure the URLs are correct
Expand Down
2 changes: 1 addition & 1 deletion app/qml/pages/LoadingPage.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3
import Lomiri.Components 1.3

Page {
id: root
Expand Down
2 changes: 1 addition & 1 deletion app/qml/pages/LocationPicker.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3
import Lomiri.Components 1.3

Page {

Expand Down
2 changes: 1 addition & 1 deletion app/qml/pages/MainMenuPage.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import QtQuick 2.4
import QtQuick.Controls.Suru 2.2
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3
import Lomiri.Components 1.3
import "../components"

Page {
Expand Down
4 changes: 2 additions & 2 deletions app/qml/pages/ScreenshotPage.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3
import Ubuntu.Content 1.3
import Lomiri.Components 1.3
import Lomiri.Content 1.3

Page {
id: scrShot
Expand Down
2 changes: 1 addition & 1 deletion app/qml/pages/WatchesPage.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import QtQuick 2.4
import QtQuick.Controls.Suru 2.2
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3
import Lomiri.Components 1.3

Page {
id: watchesPage
Expand Down
2 changes: 1 addition & 1 deletion app/qml/pages/WeatherSettingsDialog.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.4
import QtQuick.Layouts 1.1
import Ubuntu.Components 1.3
import Lomiri.Components 1.3

Page {

Expand Down
2 changes: 1 addition & 1 deletion app/qml/telescope.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtQuick 2.4
import QtQuick.Controls.Suru 2.2
import Ubuntu.Components 1.3
import Lomiri.Components 1.3
import org.asteroid.syncservice 1.0
import "controller"

Expand Down
2 changes: 1 addition & 1 deletion asteroidsyncservice
Submodule asteroidsyncservice updated 52 files
+1 −1 .gitmodules
+41 −0 CMakeLists.txt
+61 −12 README.md
+0 −5 asteroidsyncservice.pro
+22 −0 asteroidsyncservice/CMakeLists.txt
+0 −49 asteroidsyncservice/asteroidsyncservice.pro
+2 −1 asteroidsyncservice/platforms/sailfishos/servicecontrol.h
+22 −13 asteroidsyncservice/platforms/ubuntutouch/servicecontrol.cpp
+0 −5 asteroidsyncservice/starfish.pri
+1 −7 asteroidsyncservice/syncservice_plugin.cpp
+1 −1 asteroidsyncservice/syncservice_plugin.h
+0 −5 asteroidsyncservice/telescope.pri
+10 −4 asteroidsyncservice/watch.cpp
+3 −1 asteroidsyncservice/watch.h
+26 −0 asteroidsyncservice_config.h.in
+63 −0 asteroidsyncserviced/CMakeLists.txt
+12 −0 asteroidsyncserviced/asteroidsync.service.in
+0 −45 asteroidsyncserviced/asteroidsyncserviced.pro
+0 −26 asteroidsyncserviced/bluez/bluez_adapter1.cpp
+0 −66 asteroidsyncserviced/bluez/bluez_adapter1.h
+0 −26 asteroidsyncserviced/bluez/bluez_agentmanager1.cpp
+0 −68 asteroidsyncserviced/bluez/bluez_agentmanager1.h
+0 −26 asteroidsyncserviced/bluez/bluez_device1.cpp
+0 −85 asteroidsyncserviced/bluez/bluez_device1.h
+32 −14 asteroidsyncserviced/bluez/bluezclient.cpp
+13 −15 asteroidsyncserviced/bluez/bluezclient.h
+31 −0 asteroidsyncserviced/bluez/bluezclient_p.h
+0 −1 asteroidsyncserviced/bluez/dbus-shared.h
+0 −16 asteroidsyncserviced/bluez/org.bluez.AgentManager1.xml
+57 −9 asteroidsyncserviced/dbusinterface.cpp
+2 −2 asteroidsyncserviced/dbusinterface.h
+1 −1 asteroidsyncserviced/harbour-asteroidsyncserviced.service
+1 −1 asteroidsyncserviced/libasteroid
+1 −1 asteroidsyncserviced/libwatchfish
+5 −15 asteroidsyncserviced/main.cpp
+13 −13 asteroidsyncserviced/platforms/sailfishos/platform.cpp
+10 −10 asteroidsyncserviced/platforms/sailfishos/platform.h
+41 −25 asteroidsyncserviced/platforms/ubuntutouch/platform.cpp
+11 −9 asteroidsyncserviced/platforms/ubuntutouch/platform.h
+0 −11 asteroidsyncserviced/starfish.pri
+0 −5 asteroidsyncserviced/telescope.pri
+1 −1 asteroidsyncserviced/watchesmanager.cpp
+3 −3 asteroidsyncserviced/watchesmanager.h
+37 −0 doc/01_intro.md
+45 −0 doc/02_architecture.md
+18 −0 doc/03_dbus.md
+23 −0 doc/99_glossary.md
+37 −0 doc/CMakeLists.txt
+1 −0 doc/asteroid-logo.svg
+2,485 −0 doc/doxygen.conf.in
+7 −7 rpm/asteroidsyncservice.spec
+0 −2 version.pri
2 changes: 1 addition & 1 deletion asteroidsyncserviced.apparmor
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"content_exchange_source"
],
"template": "unconfined",
"policy_version": 16.04
"policy_version": 20.04
}
8 changes: 4 additions & 4 deletions clickable.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
clickable_minimum_required: 7.1.2
builder: qmake
clickable_minimum_required: 8.0.0
builder: cmake
kill: telescope
build_args: CONFIG+=telescope
make_jobs: 2
build_args: -DUBUNTU_TOUCH_PLATFORM=ON
make_jobs: 1
ignore_review_warnings: true

2 changes: 1 addition & 1 deletion manifest.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
},
"version": "0.0.7",
"maintainer": "Stefan Weng <[email protected]>",
"framework" : "ubuntu-sdk-16.04.5"
"framework" : "ubuntu-sdk-20.04"
}

36 changes: 36 additions & 0 deletions po/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
include(FindGettext)
find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)

set(DOMAIN ${FULL_PROJECT_NAME})
set(POT_FILE ${DOMAIN}.pot)
file(GLOB PO_FILES *.po)

# Creates the .pot file containing the translations template
add_custom_target(${POT_FILE} ALL
COMMENT "Generating translation template"
COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini
--srcdir=${CMAKE_SOURCE_DIR} ${DESKTOP_FILE_NAME}.in

COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
-D ${CMAKE_CURRENT_SOURCE_DIR}
-D ${CMAKE_CURRENT_BINARY_DIR}
--from-code=UTF-8
--c++ --qt --language=javascript --add-comments=TRANSLATORS
--keyword=tr --keyword=tr:1,2 --keyword=ctr:1c,2 --keyword=dctr:2c,3 --keyword=N_ --keyword=_
--keyword=dtr:2 --keyword=dtr:2,3 --keyword=tag --keyword=tag:1c,2
--package-name='${DOMAIN}'
--sort-by-file
${I18N_SRC_FILES}
# COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}
)

# Builds the binary translations catalog for each language
# it finds source translations (*.po) for
foreach(PO_FILE ${PO_FILES})
get_filename_component(LANG ${PO_FILE} NAME_WE)
gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/share/locale/${LANG}/LC_MESSAGES)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
DESTINATION ${INSTALL_DIR}
RENAME ${DOMAIN}.mo)
endforeach(PO_FILE)
2 changes: 1 addition & 1 deletion telescope.apparmor
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"accounts"
],
"template": "unconfined",
"policy_version": 16.04
"policy_version": 20.04
}
2 changes: 1 addition & 1 deletion telescope.desktop.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Exec=env QML2_IMPORT_PATH=usr/lib/$${ARCH_TRIPLET}/qt5/qml telescope
Icon=assets/icon.svg
Terminal=false
Type=Application
X-Ubuntu-Touch=true
X-Lomiri-Touch=true
45 changes: 0 additions & 45 deletions telescope.pro

This file was deleted.

2 changes: 0 additions & 2 deletions version.pri

This file was deleted.