Skip to content

Commit

Permalink
Initial commit, largely unusable
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentRevest committed Feb 19, 2018
0 parents commit a11d924
Show file tree
Hide file tree
Showing 82 changed files with 7,474 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Makefile
*.o
moc_*.cpp
qrc_*.cpp
documentation.list
*.qm
*.pro.user
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "starfishd/libwatchfish"]
path = starfishd/libwatchfish
url = https://git.javispedro.com/libwatchfish.git
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Starfish
A SailfishOS synchronization client for [AsteroidOS](http://asteroidos.org/). Forked from [Rockpool](https://github.com/abranson/rockpool).
88 changes: 88 additions & 0 deletions icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions rpm/starfish.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
Name: starfish

%{!?qtc_qmake:%define qtc_qmake %qmake}
%{!?qtc_qmake5:%define qtc_qmake5 %qmake5}
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Support for AsteroidOS watches in SailfishOS
Version: 1.0
Release: 1
Group: Qt/Qt
License: GPL3
URL: http://asteroidos.org/
Source0: %{name}-%{version}.tar.xz
Requires: systemd-user-session-targets
Requires: nemo-qml-plugin-dbus-qt5
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Bluetooth)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Location)
BuildRequires: pkgconfig(qt5-boostable)
BuildRequires: pkgconfig(mpris-qt5)
BuildRequires: pkgconfig(timed-qt5)
BuildRequires: pkgconfig(mlite5)
BuildRequires: pkgconfig(sailfishapp) >= 0.0.10
BuildRequires: pkgconfig(icu-i18n)
BuildRequires: desktop-file-utils

%description
Support for AsteroidOS watches in SailfishOS.

%prep
%setup -q -n %{name}-%{version}

%build

%qtc_qmake5 \
VERSION='%{version}-%{release}'

%qtc_make %{?_smp_mflags}

%install
rm -rf %{buildroot}
%qmake5_install

mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants
ln -s ../starfishd.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/

desktop-file-install --delete-original \
--dir %{buildroot}%{_datadir}/applications \
%{buildroot}%{_datadir}/applications/*.desktop

%post
grep -q "^/usr/bin/starfishd" /usr/share/mapplauncherd/privileges || echo "/usr/bin/starfishd,cehlmnpu" >> /usr/share/mapplauncherd/privileges
su nemo -c 'systemctl --user daemon-reload'
su nemo -c 'systemctl --user try-restart starfishd.service'
update-desktop-database

%files
%defattr(-,root,root,-)
%{_bindir}
%{_datadir}/%{name}/qml
%{_datadir}/%{name}/translations
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/86x86/apps/%{name}.png
%{_datadir}/icons/hicolor/108x108/apps/%{name}.png
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png
%{_libdir}/systemd/user/%{name}d.service
%{_libdir}/systemd/user/user-session.target.wants/%{name}d.service
5 changes: 5 additions & 0 deletions starfish.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
TEMPLATE = subdirs
SUBDIRS = starfish starfishd
OTHER_FILES += \
README.md \
rpm/starfish.spec
1 change: 1 addition & 0 deletions starfish/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/starfish
50 changes: 50 additions & 0 deletions starfish/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2018 - Florent Revest <[email protected]>
* 2016 - Andrew Branson <[email protected]>
* Ruslan N. Marchenko <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include <QtQuick>

#include <sailfishapp.h>

#include "servicecontrol.h"
#include "watches.h"
#include "watch.h"

int main(int argc, char *argv[])
{
QScopedPointer<const QGuiApplication> app(SailfishApp::application(argc, argv));
app->setApplicationName("starfish");
app->setOrganizationName("asteroidos");

QTranslator i18n;
i18n.load("starfish_" + QLocale::system().name(), "/usr/share/starfish/translations");
app->installTranslator(&i18n);

qmlRegisterUncreatableType<Watch>("Starfish", 1, 0, "Watch", "Get them from the model");
qmlRegisterType<Watches>("Starfish", 1, 0, "Watches");
qmlRegisterType<ServiceControl>("Starfish", 1, 0, "ServiceController");

QScopedPointer<QQuickView> view(SailfishApp::createView());
view->rootContext()->setContextProperty("version", QStringLiteral(VERSION));

view->setSource(SailfishApp::pathTo("qml/starfish.qml"));
view->show();

return app->exec();
}

60 changes: 60 additions & 0 deletions starfish/qml/cover/CoverPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (C) 2018 - Florent Revest <[email protected]>
* 2016 - Andrew Branson <[email protected]>
* Ruslan N. Marchenko <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 2.0
import Sailfish.Silica 1.0

CoverBackground {
property var watch: null

Image {
fillMode: Image.PreserveAspectCrop
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: label.top
source: "image://theme/icon-m-watch"
}

Label {
id: label
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: state.top
anchors.bottomMargin: Theme.paddingSmall
text: (watch && watch.name) ? watch.name : qsTr("Watch")
}

Label {
id: state
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.verticalCenter
color: Theme.highlightColor
text: (watch && watch.connected) ? qsTr("connected") : qsTr("disconnected")
}
onStatusChanged: {if(status===Cover.Activating) watch = starfish.getCurWatch()}

CoverActionList {
id: coverAction
enabled: (watch && !watch.connected)

CoverAction {
iconSource: "image://theme/icon-cover-sync"
onTriggered: watch.reconnect();
}
}
}

86 changes: 86 additions & 0 deletions starfish/qml/pages/InfoPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* Copyright (C) 2018 - Florent Revest <[email protected]>
* 2016 - Andrew Branson <[email protected]>
* Ruslan N. Marchenko <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 2.2
import Sailfish.Silica 1.0

Page {

SilicaFlickable {
anchors.fill: parent
contentHeight: contentColumn.height + Theme.paddingSmall
anchors.margins: Theme.paddingLarge

Column {
id: contentColumn
width: parent.width
height: childrenRect.height
spacing: Theme.paddingLarge

PageHeader {
title: "About Starfish"
}

Row {
width: parent.width
spacing: Theme.paddingLarge
anchors.margins: Theme.paddingLarge

Image {
source: "qrc:///starfish.png"
height: Theme.iconSizeLarge
width: height
}

Label {
text: qsTr("Version %1").arg(version)
font.pixelSize: Theme.fontSizeLarge
}
}

Separator {
width: parent.width
color: Theme.secondaryHighlightColor
}

Label {
width: parent.width
text: qsTr("Legal")
font.bold: true
}

Label {
width: parent.width
font.pixelSize: Theme.fontSizeSmall
text: "This program is free software: you can redistribute it and/or modify "
+ "it under the terms of the GNU General Public License as published "
+ "by the Free Software Foundation, version 3 of the License.<br>"
+ "This program is distributed in the hope that it will be useful, "
+ "but WITHOUT ANY WARRANTY; without even the implied warranty of "
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the "
+ "GNU General Public License for more details.<br>"
+ "You should have received a copy of the GNU General Public License "
+ "along with this program. If not, see <a href=\"http://www.gnu.org/"
+ "licenses/\">http://www.gnu.org/licenses</a>."
wrapMode: Text.WordWrap
}
}
}
}

Loading

0 comments on commit a11d924

Please sign in to comment.