[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://github.com/monich/harbour-swissclock.git</param>
<param name="branch">master</param>
- <param name="revision">ac13428</param>
+ <param name="revision">145a913</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/.gitignore
^
|
@@ -1,3 +1,3 @@
build
-harbour-swissclock.pro.user
+harbour-swissclock.pro.user*
translations/*.qm
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/harbour-swissclock.desktop
^
|
@@ -6,5 +6,8 @@
Icon=harbour-swissclock
Exec=harbour-swissclock
+[X-Sailjail]
+Permissions=
+
[X-HarbourBackup]
BackupConfigList=/apps/harbour-swissclock/
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/harbour-swissclock.pro
^
|
@@ -61,7 +61,7 @@
settings/*.qml \
settings/harbour-$${NAME}.json \
icons/harbour-$${NAME}.svg \
- harbour-$${NAME}.desktop \
+ *.desktop \
translations/*.ts \
rpm/*-$${NAME}.spec
@@ -92,12 +92,6 @@
INSTALLS += settings_qml settings_json
}
-# Desktop file
-equals(PREFIX, "openrepos") {
- desktop.extra = sed s/harbour/openrepos/g harbour-$${NAME}.desktop > $${TARGET}.desktop
- desktop.CONFIG += no_check_exist
-}
-
# Translations
TRANSLATION_IDBASED=-idbased
TRANSLATION_SOURCES = \
|
[-]
[+]
|
Added |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/openrepos-swissclock.desktop
^
|
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Type=Application
+X-Nemo-Application-Type=silica-qt5
+Name=Swiss Clock
+Icon=openrepos-swissclock
+Exec=openrepos-swissclock
+
+[X-Sailjail]
+Sandboxing=Disabled
+
+[X-HarbourBackup]
+BackupConfigList=/apps/openrepos-swissclock/
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/settings/settings.qml
^
|
@@ -1,6 +1,6 @@
/*
+ * Copyright (C) 2016-2023 Slava Monich <slava@monich.com>
* Copyright (C) 2016-2019 Jolla Ltd.
- * Copyright (C) 2016-2019 Slava Monich <slava@monich.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -68,9 +68,28 @@
width: parent.width
PageHeader {
- //: Settings page header
- //% "Swiss Clock"
- title: qsTrId("swissclock-settings-page_header")
+ id: pageHeader
+
+ rightMargin: Theme.horizontalPageMargin + (appIcon.visible ? (height - appIcon.padding) : 0)
+ title: applicationName ? applicationName : "Swiss Clock"
+ description: applicationName ?
+ //: Settings page header description (app version)
+ //% "Version %1"
+ qsTrId("swissclock-settings-version").arg("1.0.10") : ""
+
+ Image {
+ id: appIcon
+
+ readonly property int padding: Theme.paddingLarge
+ readonly property int size: pageHeader.height - 2 * padding
+ x: pageHeader.width - width - Theme.horizontalPageMargin
+ y: padding
+ width: size
+ height: size
+ sourceSize: Qt.size(size,size)
+ source: applicationIcon ? applicationIcon : ""
+ visible: appIcon.status === Image.Ready
+ }
}
ComboBox {
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/src/ClockRenderer.cpp
^
|
@@ -1,6 +1,6 @@
/*
+ * Copyright (C) 2014-2023 Slava Monich <slava@monich.com>
* Copyright (C) 2014-2016 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -8,15 +8,15 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * - Neither the name of Jolla Ltd nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -35,8 +35,15 @@
#include "ClockDebug.h"
#include <qmath.h>
+#include <QSGSimpleTextureNode>
#include <QSGFlatColorMaterial>
+class ClockRenderer::ImageNode: public QSGSimpleTextureNode {
+public:
+ ImageNode(QQuickWindow* aWindow, qreal aX, qreal aY, QImage aImage);
+ ~ImageNode();
+};
+
ClockRenderer::ImageNode::ImageNode(
QQuickWindow* aWindow,
qreal aX,
@@ -72,16 +79,13 @@
}
}
-QMatrix4x4
-ClockRenderer::nodeMatrix(
+qreal
+ClockRenderer::nodeAngle(
NodeType aType,
- const QSize& aSize,
const QTime& aTime)
{
- qreal a;
-
if (aType == NodeSec) {
- a = 6 * (aTime.second() + aTime.msec()/1000.0) - 90;
+ return 6 * (aTime.second() + aTime.msec()/1000.0);
} else {
QTime t;
if (aTime.second() == 0) {
@@ -91,16 +95,23 @@
t = QTime(aTime.hour(), aTime.minute(), 0);
}
if (aType == NodeHour) {
- a = 30*(t.hour() + (t.minute() + t.second()/60.0)/60) - 90;
+ return 30*(t.hour() + (t.minute() + t.second()/60.0)/60);
} else {
- a = 6*(t.minute() + (t.second() + t.msec()/1000.0)/60) - 90;
+ return 6*(t.minute() + (t.second() + t.msec()/1000.0)/60);
}
}
+}
+QMatrix4x4
+ClockRenderer::nodeMatrix(
+ NodeType aType,
+ const QSize& aSize,
+ const QTime& aTime)
+{
qreal dx = aSize.width()/2;
qreal dy = aSize.height()/2;
return QMatrix4x4(QTransform::fromTranslate(dx, dy).
- rotate(a).translate(-dx, -dy));
+ rotate(nodeAngle(aType, aTime) - 90).translate(-dx, -dy));
}
QSGGeometry*
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/src/ClockRenderer.h
^
|
@@ -1,6 +1,6 @@
/*
+ * Copyright (C) 2014-2023 Slava Monich <slava@monich.com>
* Copyright (C) 2014-2016 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -8,15 +8,15 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * - Neither the name of Jolla Ltd nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -44,7 +44,6 @@
#include <QQuickWindow>
#include <QMatrix4x4>
#include <QSGGeometryNode>
-#include <QSGSimpleTextureNode>
#define QUICK_CLOCK_MIN_UPDATE_INTERVAL_DISPLAY_ON (15)
#define QUICK_CLOCK_MIN_UPDATE_INTERVAL_DISPLAY_OFF (200)
@@ -53,22 +52,20 @@
class ClockRenderer
{
-public:
- class ImageNode: public QSGSimpleTextureNode {
- public:
- ImageNode(QQuickWindow* aWindow, qreal aX, qreal aY, QImage aImage);
- ~ImageNode();
- };
+ class ImageNode;
+public:
enum NodeType {
NodeHour,
NodeMin,
NodeSec
};
-public:
virtual ~ClockRenderer();
+ // Hand angle (in degrees, starting from top of the clock)
+ virtual qreal nodeAngle(NodeType, const QTime&);
+
// Raster interface
virtual void paintDialPlate(QPainter* aPainter, const QSize& aSize,
ClockTheme* aTheme, bool aDrawBackground) = 0;
@@ -78,13 +75,13 @@
const QTime& aTime, ClockTheme* aTheme) = 0;
// Optimized interface
- virtual int msecUntilNextUpdate(NodeType aType, const QTime& aTime);
virtual void initNode(QSGTransformNode* aTxNode, NodeType aType,
QQuickWindow* aWindow, const QSizeF& aSize, ClockTheme* aTheme) = 0;
- virtual QMatrix4x4 nodeMatrix(NodeType aType, const QSize& aSize,
+ virtual int msecUntilNextUpdate(NodeType aType, const QTime& aTime);
+ QMatrix4x4 nodeMatrix(NodeType aType, const QSize& aSize,
const QTime& aTime);
- QString id() const { return iId; }
+ const QString id() const { return iId; }
// Utilities
static QSGGeometry* rectGeometry(const QRectF& aRect);
@@ -117,7 +114,7 @@
ClockRenderer(QString aId) : iId(aId) {}
private:
- QString iId;
+ const QString iId;
};
inline QSGNode* ClockRenderer::circleNode(const QPointF& aCenter,
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/src/ClockRendererDeutscheBahn.cpp
^
|
@@ -1,6 +1,6 @@
/*
+ * Copyright (C) 2014-2023 Slava Monich <slava@monich.com>
* Copyright (C) 2014-2016 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -8,15 +8,15 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * - Neither the name of Jolla Ltd nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -41,28 +41,26 @@
class DeutscheBahn : public ClockRenderer
{
public:
- virtual void paintDialPlate(QPainter* aPainter, const QSize& aSize,
- ClockTheme* aTheme, bool aDrawBackground);
- virtual void paintHourMinHands(QPainter* aPainter, const QSize& aSize,
- const QTime& aTime, ClockTheme* aTheme);
- virtual void paintSecHand(QPainter* aPainter, const QSize& aSize,
- const QTime& aTime, ClockTheme* aTheme);
- virtual void initNode(QSGTransformNode* aTxNode, NodeType aType,
- QQuickWindow* aWindow, const QSizeF& aSize, ClockTheme* aTheme);
-
- void initHour(QSGTransformNode* aTxNode, const QSizeF& aSize,
- ClockTheme* aTheme);
- void initMin(QSGTransformNode* aTxNode, const QSizeF& aSize,
- ClockTheme* aTheme);
- void initSec(QSGTransformNode* aTxNode, const QSizeF& aSize,
- ClockTheme* aTheme);
+ void paintDialPlate(QPainter*, const QSize&, ClockTheme* aTheme,
+ bool aDrawBackground) Q_DECL_OVERRIDE;
+ void paintHourMinHands(QPainter* aPainter, const QSize& aSize,
+ const QTime& aTime, ClockTheme* aTheme) Q_DECL_OVERRIDE;
+ void paintSecHand(QPainter* aPainter, const QSize& aSize,
+ const QTime& aTime, ClockTheme* aTheme) Q_DECL_OVERRIDE;
+ void initNode(QSGTransformNode* aTxNode, NodeType aType,
+ QQuickWindow* aWindow, const QSizeF& aSize,
+ ClockTheme* aTheme) Q_DECL_OVERRIDE;
+
+ void initHour(QSGTransformNode*, const QSizeF&, ClockTheme*);
+ void initMin(QSGTransformNode*, const QSizeF&, ClockTheme*);
+ void initSec(QSGTransformNode*, const QSizeF&, ClockTheme*);
static void paintHand(QPainter* aPainter, const QRectF& aRect,
qreal aAngle, const QBrush& aBrush, qreal aX = 0.0, qreal aY = 0.0);
DeutscheBahn() : ClockRenderer(DEUTSCHE_BAHN),
iSecondHandColor(255,32,32) {}
- QColor iSecondHandColor;
+ const QColor iSecondHandColor;
};
ClockRenderer*
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/src/ClockRendererHelsinkiMetro.cpp
^
|
@@ -1,6 +1,6 @@
/*
+ * Copyright (C) 2014-2023 Slava Monich <slava@monich.com>
* Copyright (C) 2014-2016 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -8,15 +8,15 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * - Neither the name of Jolla Ltd nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -43,31 +43,30 @@
{
public:
HelsinkiMetro();
- virtual ~HelsinkiMetro();
- virtual void paintDialPlate(QPainter* aPainter, const QSize& aSize,
- ClockTheme* aTheme, bool aDrawBackground);
- virtual void paintHourMinHands(QPainter* aPainter, const QSize& aSize,
- const QTime& aTime, ClockTheme* aTheme);
- virtual void paintSecHand(QPainter* aPainter, const QSize& aSize,
- const QTime& aTime, ClockTheme* aTheme);
- virtual void initNode(QSGTransformNode* aTxNode, NodeType aType,
- QQuickWindow* aWindow, const QSizeF& aSize, ClockTheme* aTheme);
-
- void initHour(QSGTransformNode* aTxNode, const QSizeF& aSize,
- ClockTheme* aTheme);
- void initMin(QSGTransformNode* aTxNode, const QSizeF& aSize,
- ClockTheme* aTheme);
- void initSec(QSGTransformNode* aTxNode, QQuickWindow* aWindow,
- const QSizeF& aSize);
- static QSGNode* handNode(const QRectF& aRect, const QColor& aColor);
+ ~HelsinkiMetro() Q_DECL_OVERRIDE;
+
+ void paintDialPlate(QPainter* aPainter, const QSize& aSize,
+ ClockTheme* aTheme, bool aDrawBackground) Q_DECL_OVERRIDE;
+ void paintHourMinHands(QPainter* aPainter, const QSize& aSize,
+ const QTime& aTime, ClockTheme* aTheme) Q_DECL_OVERRIDE;
+ void paintSecHand(QPainter* aPainter, const QSize& aSize,
+ const QTime& aTime, ClockTheme* aTheme) Q_DECL_OVERRIDE;
+ void initNode(QSGTransformNode* aTxNode, NodeType aType,
+ QQuickWindow* aWindow, const QSizeF& aSize,
+ ClockTheme* aTheme) Q_DECL_OVERRIDE;
+
+ void initHour(QSGTransformNode*, const QSizeF&, ClockTheme*);
+ void initMin(QSGTransformNode*, const QSizeF&, ClockTheme*);
+ void initSec(QSGTransformNode*, QQuickWindow*, const QSizeF&);
+
+ static QSGNode* handNode(const QRectF&, const QColor&);
static void paintHand(QPainter* aPainter, const QRectF& aRect,
- qreal aAngle, const QBrush& aBrush,
- qreal aX = 0.0, qreal aY = 0.0);
+ qreal aAngle, const QBrush& aBrush, qreal aX = 0.0, qreal aY = 0.0);
- QColor iSecondHandColor;
- QBrush iSecondHandBrush;
- QBrush iBlack;
- QBrush iWhite;
+ const QColor iSecondHandColor;
+ const QBrush iSecondHandBrush;
+ const QBrush iBlack;
+ const QBrush iWhite;
QPolygonF iPolygon;
QSizeF iSize;
QQuickWindow* iWindow;
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/src/ClockRendererSwissRailroad.cpp
^
|
@@ -1,6 +1,6 @@
/*
+ * Copyright (C) 2014-2023 Slava Monich <slava@monich.com>
* Copyright (C) 2014-2016 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -8,15 +8,15 @@
* modification, are permitted provided that the following conditions
* are met:
*
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * - Neither the name of Jolla Ltd nor the names of its contributors
- * may be used to endorse or promote products derived from this
- * software without specific prior written permission.
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the names of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -34,37 +34,40 @@
#include "ClockRenderer.h"
#include "ClockDebug.h"
-#include <math.h>
+#include <qmath.h>
const QString ClockRenderer::SWISS_RAILROAD("SwissRailroad");
class SwissRailroad : public ClockRenderer
{
public:
+ // It takes about 58.5 seconds to circle the face
+ enum { SECOND_HAND_FULL_CIRCLE_MS = 58500 };
+
SwissRailroad();
- virtual void paintDialPlate(QPainter* aPainter, const QSize& aSize,
- ClockTheme* aTheme, bool aDrawBackground);
- virtual void paintHourMinHands(QPainter* aPainter, const QSize& aSize,
- const QTime& aTime, ClockTheme* aTheme);
- virtual void paintSecHand(QPainter* aPainter, const QSize& aSize,
- const QTime& aTime, ClockTheme* aTheme);
- virtual void initNode(QSGTransformNode* aTxNode, NodeType aType,
- QQuickWindow* aWindow, const QSizeF& aSize, ClockTheme* aTheme);
-
- void initHour(QSGTransformNode* aTxNode, const QSizeF& aSize,
- ClockTheme* aTheme);
- void initMin(QSGTransformNode* aTxNode, const QSizeF& aSize,
- ClockTheme* aTheme);
- void initSec(QSGTransformNode* aTxNode, QQuickWindow* aWindow,
- const QSizeF& aSize);
+
+ qreal nodeAngle(NodeType aType, const QTime& aTime) Q_DECL_OVERRIDE;
+ void paintDialPlate(QPainter* aPainter, const QSize& aSize,
+ ClockTheme* aTheme, bool aDrawBackground) Q_DECL_OVERRIDE;
+ void paintHourMinHands(QPainter* aPainter, const QSize& aSize,
+ const QTime& aTime, ClockTheme* aTheme) Q_DECL_OVERRIDE;
+ void paintSecHand(QPainter* aPainter, const QSize& aSize,
+ const QTime& aTime, ClockTheme* aTheme) Q_DECL_OVERRIDE;
+ void initNode(QSGTransformNode* aTxNode, NodeType aType,
+ QQuickWindow* aWindow, const QSizeF& aSize,
+ ClockTheme* aTheme) Q_DECL_OVERRIDE;
+ int msecUntilNextUpdate(NodeType aType, const QTime& aTime) Q_DECL_OVERRIDE;
+
+ void initHour(QSGTransformNode*, const QSizeF&, ClockTheme*);
+ void initMin(QSGTransformNode*, const QSizeF&, ClockTheme*);
+ void initSec(QSGTransformNode*, QQuickWindow*, const QSizeF&);
static void paintHand(QPainter* aPainter, const QRectF& aRect,
- qreal aAngle, const QBrush& aBrush,
- qreal aX = 0.0, qreal aY = 0.0);
+ qreal aAngle, const QBrush& aBrush, qreal aX = 0.0, qreal aY = 0.0);
- QColor iSecondHandColor;
- QBrush iSecondHandBrush;
- QBrush iBlack;
- QBrush iWhite;
+ const QColor iSecondHandColor;
+ const QBrush iSecondHandBrush;
+ const QBrush iBlack;
+ const QBrush iWhite;
};
ClockRenderer*
@@ -82,6 +85,43 @@
{
}
+int
+SwissRailroad::msecUntilNextUpdate(
+ NodeType aType,
+ const QTime& aTime)
+{
+ if (aType == NodeSec) {
+ const int msec = aTime.second() * 1000 + aTime.msec();
+ return (msec > SECOND_HAND_FULL_CIRCLE_MS) ?
+ qMax(60000 - msec, QUICK_CLOCK_MIN_UPDATE_INTERVAL) :
+ QUICK_CLOCK_MIN_UPDATE_INTERVAL;
+ } else {
+ return ClockRenderer::msecUntilNextUpdate(aType, aTime);
+ }
+}
+
+qreal
+SwissRailroad::nodeAngle(
+ NodeType aType,
+ const QTime& aTime)
+{
+ if (aType == NodeSec) {
+ // It takes about 58.5 seconds to circle the face; then the hand
+ // pauses briefly at the top of the clock
+ const int msec = aTime.second() * 1000 + aTime.msec();
+ if (msec <= SECOND_HAND_FULL_CIRCLE_MS) {
+ return (360.0 * msec)/SECOND_HAND_FULL_CIRCLE_MS;
+ } else {
+ return 0.0;
+ }
+ } else if (aType == NodeMin && aTime.second() == 0) {
+ const qreal x = aTime.msec()/222.0;
+ return 6*(aTime.minute() - qExp(-1.5 * x) * qCos(2 * M_PI * x));
+ } else {
+ return ClockRenderer::nodeAngle(aType, aTime);
+ }
+}
+
void
SwissRailroad::paintDialPlate(
QPainter* aPainter,
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/translations/harbour-swissclock-hu.ts
^
|
@@ -18,10 +18,10 @@
<extracomment>Label for Deutsche Bahn clock style</extracomment>
<translation>Német vasút</translation>
</message>
- <message id="swissclock-settings-page_header">
- <source>Swiss Clock</source>
- <extracomment>Settings page header</extracomment>
- <translation>Svájci óra</translation>
+ <message id="swissclock-settings-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation type="unfinished">Verzió %1</translation>
</message>
<message id="swissclock-settings-dial_plate">
<source>Dial plate</source>
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/translations/harbour-swissclock-nl.ts
^
|
@@ -18,10 +18,10 @@
<extracomment>Label for Deutsche Bahn clock style</extracomment>
<translation>Deutsche Bahn</translation>
</message>
- <message id="swissclock-settings-page_header">
- <source>Swiss Clock</source>
- <extracomment>Settings page header</extracomment>
- <translation>Zwitserse klok</translation>
+ <message id="swissclock-settings-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation type="unfinished">Versie 1</translation>
</message>
<message id="swissclock-settings-dial_plate">
<source>Dial plate</source>
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/translations/harbour-swissclock-ru.ts
^
|
@@ -18,10 +18,10 @@
<extracomment>Label for Deutsche Bahn clock style</extracomment>
<translation>Германия</translation>
</message>
- <message id="swissclock-settings-page_header">
- <source>Swiss Clock</source>
- <extracomment>Settings page header</extracomment>
- <translation>Swiss Clock</translation>
+ <message id="swissclock-settings-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Версия %1</translation>
</message>
<message id="swissclock-settings-dial_plate">
<source>Dial plate</source>
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/translations/harbour-swissclock-sv.ts
^
|
@@ -18,10 +18,10 @@
<extracomment>Label for Deutsche Bahn clock style</extracomment>
<translation>Deutsche Bahn</translation>
</message>
- <message id="swissclock-settings-page_header">
- <source>Swiss Clock</source>
- <extracomment>Settings page header</extracomment>
- <translation>Swiss Clock</translation>
+ <message id="swissclock-settings-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Version %1</translation>
</message>
<message id="swissclock-settings-dial_plate">
<source>Dial plate</source>
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-swissclock-1.0.10.tar.bz2/translations/harbour-swissclock.ts
^
|
@@ -18,10 +18,10 @@
<extracomment>Label for Deutsche Bahn clock style</extracomment>
<translation>Deutsche Bahn</translation>
</message>
- <message id="swissclock-settings-page_header">
- <source>Swiss Clock</source>
- <extracomment>Settings page header</extracomment>
- <translation>Swiss Clock</translation>
+ <message id="swissclock-settings-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Version %1</translation>
</message>
<message id="swissclock-settings-dial_plate">
<source>Dial plate</source>
|