[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://github.com/monich/harbour-logger</param>
<param name="branch">master</param>
- <param name="revision">9ad9eb9</param>
+ <param name="revision">6ddf232</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/harbour-lib.pro
^
|
@@ -26,6 +26,7 @@
src/HarbourBase32.cpp \
src/HarbourBase45.cpp \
src/HarbourClipboard.cpp \
+ src/HarbourColorEditorModel.cpp \
src/HarbourDisplayBlanking.cpp \
src/HarbourJson.cpp \
src/HarbourLib.cpp \
@@ -59,6 +60,7 @@
include/HarbourBase32.h \
include/HarbourBase45.h \
include/HarbourClipboard.h \
+ include/HarbourColorEditorModel.h \
include/HarbourDebug.h \
include/HarbourDisplayBlanking.h \
include/HarbourJson.h \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/include/HarbourAztecCodeGenerator.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
- * Copyright (C) 2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2019-2021 Jolla Ltd.
+ * Copyright (C) 2019-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -11,8 +11,8 @@
* 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
+ * 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
@@ -39,25 +39,42 @@
class HarbourAztecCodeGenerator : public QObject {
Q_OBJECT
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+ Q_PROPERTY(int ecLevel READ ecLevel WRITE setEcLevel NOTIFY ecLevelChanged)
Q_PROPERTY(QString code READ code NOTIFY codeChanged)
Q_PROPERTY(bool running READ running NOTIFY runningChanged)
+ Q_ENUMS(ECLevel)
public:
+ enum ECLevel {
+ ECLevelDefault = -1,
+ ECLevelLowest = 5,
+ ECLevelLow = 10,
+ ECLevelMedium = 23,
+ ECLevelHigh = 36,
+ ECLevelVeryHigh = 50,
+ ECLevelHighest = 95,
+ ECLevelCount
+ };
+
HarbourAztecCodeGenerator(QObject* aParent = Q_NULLPTR);
QString text() const;
void setText(QString aValue);
+ int ecLevel() const;
+ void setEcLevel(int aValue);
+
QString code() const;
bool running() const;
- static QByteArray generate(QString aText);
+ static QByteArray generate(QString aText, int aEcLevel = ECLevelDefault);
// Callback for qmlRegisterSingletonType<HarbourAztecCodeGenerator>
static QObject* createSingleton(QQmlEngine* aEngine, QJSEngine* aScript);
Q_SIGNALS:
void textChanged();
+ void ecLevelChanged();
void codeChanged();
void runningChanged();
|
[-]
[+]
|
Added |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/include/HarbourColorEditorModel.h
^
|
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2021 Jolla Ltd.
+ * Copyright (C) 2021 Slava Monich <slava.monich@jolla.com>
+ *
+ * You may use this file under the terms of the BSD license as follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef HARBOUR_COLOR_EDITOR_MODEL_H
+#define HARBOUR_COLOR_EDITOR_MODEL_H
+
+#include <QList>
+#include <QColor>
+#include <QAbstractListModel>
+
+class HarbourColorEditorModel : public QAbstractListModel
+{
+ Q_OBJECT
+ Q_PROPERTY(QStringList colors READ getColors WRITE setColors NOTIFY colorsChanged)
+ Q_PROPERTY(int dragPos READ getDragPos WRITE setDragPos NOTIFY dragPosChanged)
+ Q_ENUMS(ItemType)
+
+public:
+ enum ItemType {
+ ColorItem,
+ TrashedItem,
+ AddItem
+ };
+
+ HarbourColorEditorModel(QObject* aParent = Q_NULLPTR);
+
+ QStringList getColors() const;
+ void setColors(QStringList aColors);
+
+ int getDragPos() const;
+ void setDragPos(int pos);
+
+ Q_INVOKABLE void addColor(QColor aColor);
+ Q_INVOKABLE int indexOf(QColor aColor) const;
+
+ // QAbstractListModel
+ QHash<int,QByteArray> roleNames() const Q_DECL_OVERRIDE;
+ int rowCount(const QModelIndex& aParent) const Q_DECL_OVERRIDE;
+ QVariant data(const QModelIndex& aIndex, int aRole) const Q_DECL_OVERRIDE;
+
+Q_SIGNALS:
+ void colorsChanged();
+ void dragPosChanged();
+
+private:
+ class Private;
+ Private* iPrivate;
+};
+
+#endif // HARBOUR_COLOR_EDITOR_MODEL_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/include/HarbourProcessState.h
^
|
@@ -44,6 +44,7 @@
Q_OBJECT
Q_DISABLE_COPY(HarbourProcessState)
Q_PROPERTY(bool jailedApp READ isJailedApp CONSTANT)
+ Q_PROPERTY(bool privileged READ isPrivileged CONSTANT)
public:
explicit HarbourProcessState(QObject* aParent = Q_NULLPTR);
@@ -52,6 +53,7 @@
static QObject* createSingleton(QQmlEngine* aEngine, QJSEngine* aScript);
static bool isJailedApp();
+ static bool isPrivileged();
};
#endif // HARBOUR_PROCESS_STATE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/include/HarbourQrCodeGenerator.h
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
- * Copyright (C) 2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2019-2021 Jolla Ltd.
+ * Copyright (C) 2019-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -39,26 +39,43 @@
class HarbourQrCodeGenerator : public QObject {
Q_OBJECT
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+ Q_PROPERTY(int ecLevel READ ecLevel WRITE setEcLevel NOTIFY ecLevelChanged)
Q_PROPERTY(QString code READ code NOTIFY codeChanged)
Q_PROPERTY(QString qrcode READ code NOTIFY codeChanged)
Q_PROPERTY(bool running READ running NOTIFY runningChanged)
+ Q_ENUMS(ECLevel)
public:
+ enum ECLevel {
+ ECLevelDefault = -1,
+ ECLevelLowest = 0,
+ ECLevel_L = ECLevelLowest,
+ ECLevel_M,
+ ECLevel_Q,
+ ECLevel_H,
+ ECLevelHighest = ECLevel_H,
+ ECLevelCount
+ };
+
HarbourQrCodeGenerator(QObject* aParent = Q_NULLPTR);
QString text() const;
void setText(QString aValue);
+ ECLevel ecLevel() const;
+ void setEcLevel(int aValue);
+
QString code() const;
bool running() const;
- static QByteArray generate(QString aText);
+ static QByteArray generate(QString aText, ECLevel aEcLevel = ECLevelDefault);
// Callback for qmlRegisterSingletonType<HarbourQrCodeGenerator>
static QObject* createSingleton(QQmlEngine* aEngine, QJSEngine* aScript);
Q_SIGNALS:
void textChanged();
+ void ecLevelChanged();
void codeChanged();
void runningChanged();
|
[-]
[+]
|
Added |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/qml/HarbourColorEditorDialog.qml
^
|
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2021 Jolla Ltd.
+ * Copyright (C) 2021 Slava Monich <slava.monich@jolla.com>
+ *
+ * You may use this file under the terms of the BSD license as follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+Dialog {
+ id: thisDialog
+
+ readonly property color selectedColor: sampleItem.color
+ property color initialColor: Theme.highlightColor
+ property string acceptText: "Add color"
+ property alias hueSliderText: hueSlider.label // "Color"
+ property alias brightnessSliderText: brightnessSlider.label // "Brightness"
+ property string hexNotationText: "Hex notation"
+
+ canAccept: hexText.acceptableInput
+ forwardNavigation: !hueItem.pressed
+ backNavigation: !hueItem.pressed
+
+ DialogHeader {
+ id: header
+
+ acceptText: forwardNavigation ?
+ (thisDialog.acceptText ? thisDialog.acceptText : defaultAcceptText) : ""
+ }
+
+ Component.onCompleted: hexText.text = initialColor.toString().substr(1)
+
+ // Otherwise width is changing with a delay, causing visible layout changes
+ onIsLandscapeChanged: width = isLandscape ? Screen.height : Screen.width
+
+ SilicaFlickable {
+ clip: true
+ interactive: !hueItem.pressed
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: header.bottom
+ bottom: parent.bottom
+ }
+
+ HarbourColorHueItem {
+ id: hueItem
+
+ x: Theme.horizontalPageMargin
+ width: parent.width - 2 * x
+ anchors {
+ top: parent.top
+ bottom: toolPanel.top
+ bottomMargin: Theme.paddingSmall
+ }
+ brightness: brightnessSlider.sliderValue
+ onTapped: hueSlider.value = h
+ }
+
+ Column {
+ id: toolPanel
+
+ width: parent.width
+ anchors.bottom: parent.bottom
+
+ Slider {
+ id: hueSlider
+
+ width: parent.width
+ leftMargin: Theme.horizontalPageMargin
+ rightMargin: Theme.horizontalPageMargin
+ minimumValue: 0
+ maximumValue: 1
+ value: 1
+ label: "Color"
+ opacity: (y + parent.y >= 0) ? 1 : 0
+ onSliderValueChanged: hexText.updateText()
+ }
+
+ Slider {
+ id: brightnessSlider
+
+ width: parent.width
+ leftMargin: Theme.horizontalPageMargin
+ rightMargin: Theme.horizontalPageMargin
+ label: "Brightness"
+ minimumValue: 0
+ maximumValue: 1
+ value: 1
+ opacity: (y + parent.y >= 0) ? 1 : 0
+ onSliderValueChanged: hexText.updateText()
+ }
+
+ Item {
+ x: Theme.horizontalPageMargin
+ width: parent.width - 2 * x
+ height: hexText.height
+ Row {
+ spacing: Theme.paddingSmall
+
+ Label {
+ id: hexLabel
+
+ y: hexText.textTopMargin
+ text: "#"
+ font.pixelSize: Theme.fontSizeLarge
+ }
+
+ Item {
+ readonly property int maxWidth: toolPanel.width - 2 * Theme.horizontalPageMargin - hexLabel.width - parent.spacing - Theme.paddingLarge - sample.width
+ width: Math.min(Math.max(textLabelTemplate.implicitWidth, Theme.itemSizeHuge), maxWidth)
+ height: hexText.height
+
+ Label {
+ id: textLabelTemplate
+
+ // Same text as hexText.label
+ text: hexNotationText
+ font.pixelSize: Theme.fontSizeSmall
+ opacity: 0
+ }
+
+ TextField {
+ id: hexText
+
+ property int ignoreTextUpdates // to avoid binding loops
+ property color tmpColor
+
+ font.pixelSize: Theme.fontSizeLarge
+ width: parent.width
+ textLeftMargin: 0
+ textRightMargin: 0
+ label: hexNotationText
+ validator: RegExpValidator { regExp: /^[0-9a-fA-F]{6}$/ }
+ inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
+ EnterKey.iconSource: "image://theme/icon-m-enter-close"
+ EnterKey.onClicked: hexText.focus = false
+
+ onTextChanged: {
+ if (!ignoreTextUpdates && acceptableInput) {
+ tmpColor = "#" + text
+ ignoreTextUpdates++
+ brightnessSlider.value = hueItem.getV(tmpColor)
+ hueSlider.value = hueItem.getH(tmpColor)
+ ignoreTextUpdates--
+ }
+ }
+
+ onActiveFocusChanged: {
+ if (!activeFocus && !acceptableInput) {
+ updateText()
+ }
+ }
+
+ function updateText() {
+ if (!ignoreTextUpdates) {
+ ignoreTextUpdates++
+ var s = hueItem.getColor(hueSlider.sliderValue).toString()
+ text = (s.length > 0 && s.charAt(0) === '#') ? s.substr(1) : s
+ ignoreTextUpdates--
+ }
+ }
+ }
+ }
+ }
+
+ MouseArea {
+ id: sample
+
+ y: Theme.paddingLarge
+ width: 2 * height
+ height: hexText.height - 2 * Theme.paddingLarge
|
[-]
[+]
|
Added |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/qml/HarbourColorHueItem.qml
^
|
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2021 Jolla Ltd.
+ * Copyright (C) 2021 Slava Monich <slava.monich@jolla.com>
+ *
+ * You may use this file under the terms of the BSD license as follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+Rectangle {
+ id: thisItem
+
+ color: "black"
+ property alias brightness: mouseArea.opacity
+ property alias pressed: mouseArea.pressed
+
+ readonly property color color0: "#ffffff" // 1.0
+ readonly property color color1: "#ff0000" // colorStop7
+ readonly property color color2: "#ff00ff" // colorStop6
+ readonly property color color3: "#0000ff" // colorStop5
+ readonly property color color4: "#00ffff" // colorStop4
+ readonly property color color5: "#00ff00" // colorStop3
+ readonly property color color6: "#ffff00" // colorStop2
+ readonly property color color7: "#ff0000" // colorStop1
+ readonly property color color8: "#ffffff" // 0.0
+
+ readonly property real colorStop1: 0.125
+ readonly property real colorStop2: 0.250
+ readonly property real colorStop3: 0.375
+ readonly property real colorStop4: 0.500
+ readonly property real colorStop5: 0.625
+ readonly property real colorStop6: 0.750
+ readonly property real colorStop7: 0.875
+ readonly property real hueLast: colorStop7
+ readonly property real hueRange: hueLast - colorStop1
+
+ signal tapped(var h)
+
+ function getColor(h) {
+ if (h < colorStop4) {
+ if (h > colorStop3) {
+ // colorStop3..colorStop4
+ return averageColor(color3, color4, (h - colorStop3)/(colorStop4 - colorStop3), brightness)
+ } else if (h > colorStop2) {
+ // colorStop2..colorStop3
+ return averageColor(color2, color3, (h - colorStop2)/(colorStop3 - colorStop2), brightness)
+ } else if (h > colorStop1) {
+ // colorStop1..colorStop2
+ return averageColor(color1, color2, (h - colorStop1)/(colorStop2 - colorStop1), brightness)
+ } else if (h > 0) {
+ // 0..colorStop1
+ return averageColor(color0, color1, h/colorStop1, brightness)
+ } else {
+ return adjustColor(color0, brightness)
+ }
+ } else {
+ if (h < colorStop5) {
+ // colorStop4..colorStop5
+ return averageColor(color4, color5, (h - colorStop4)/(colorStop5 - colorStop4), brightness)
+ } else if (h < colorStop6) {
+ // colorStop5..colorStop6
+ return averageColor(color5, color6, (h - colorStop5)/(colorStop6 - colorStop5), brightness)
+ } else if (h < colorStop7) {
+ // colorStop6..colorStop7
+ return averageColor(color6, color7, (h - colorStop6)/(colorStop7 - colorStop6), brightness)
+ } else if (h < 1) {
+ // colorStop7..1
+ return averageColor(color7, color8, (h - colorStop7)/(1 - colorStop7), brightness)
+ } else {
+ return adjustColor(color8, brightness)
+ }
+ }
+ }
+
+ function averageColor(c1,c2,h,v) {
+ return Qt.rgba((c1.r + (c2.r - c1.r) * h) * v,
+ (c1.g + (c2.g - c1.g) * h) * v,
+ (c1.b + (c2.b - c1.b) * h) * v, 1)
+ }
+
+ function adjustColor(c,v) {
+ return Qt.rgba(c.r * v, c.g * v, c.b * v, 1)
+ }
+
+ function getV(c) {
+ return Math.max(c.r, c.g, c.b)
+ }
+
+ function getH(c) {
+ var max = Math.max(c.r, c.g, c.b)
+ var min = Math.min(c.r, c.g, c.b)
+ var chroma = max - min
+ if (chroma === 0) {
+ return 0
+ } else {
+ if (max === c.r) {
+ return hueLast - (c.g - c.b)/chroma/6 * hueRange
+ } else if (max === c.g) {
+ return hueLast - (2 + (c.b - c.r)/chroma)/6 * hueRange
+ } else {
+ return hueLast - (4 + (c.r - c.g)/chroma)/6 * hueRange
+ }
+ }
+ }
+
+ MouseArea {
+ id: mouseArea
+
+ width: parent.height
+ height: parent.width
+ anchors.centerIn: parent
+ rotation: -90
+
+ ShaderEffectSource {
+ anchors.fill: parent
+ sourceItem: Rectangle {
+ width: mouseArea.width
+ height: mouseArea.height
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: color0 }
+ GradientStop { position: colorStop1; color: color1 }
+ GradientStop { position: colorStop2; color: color2 }
+ GradientStop { position: colorStop3; color: color3 }
+ GradientStop { position: colorStop4; color: color4 }
+ GradientStop { position: colorStop5; color: color5 }
+ GradientStop { position: colorStop6; color: color6 }
+ GradientStop { position: colorStop7; color: color7 }
+ GradientStop { position: 1.0; color: color8 }
+ }
+ }
+ }
+ // mouseY/height because we are rotated
+ onClicked: thisItem.tapped(mouseY/height)
+ onPositionChanged: thisItem.tapped(mouseY/height)
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/qml/HarbourColorPickerDialog.qml
^
|
@@ -0,0 +1,321 @@
+/*
+ * Copyright (C) 2021 Jolla Ltd.
+ * Copyright (C) 2021 Slava Monich <slava.monich@jolla.com>
+ *
+ * You may use this file under the terms of the BSD license as follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+Dialog {
+ id: thisDialog
+
+ property color color
+ property alias colorModel: grid.model // HarbourColorEditorModel
+
+ // Localizable strings
+ property alias resetColorsMenuText: resetColorsMenuItem.text // "Reset colors"
+ property string acceptText: "Select color"
+ property string addColorAcceptText: "Add color"
+ property string addColorHueSliderText: "Color"
+ property string addColorBrightnessSliderText: "Brightness"
+ property string addColorHexNotationText: "Hex notation"
+
+ forwardNavigation: false
+
+ signal resetColors()
+
+ // Constants used by HarbourColorEditorModel
+ readonly property int itemTypeColor: 0
+ readonly property int itemTypeTrash: 1
+ readonly property int itemTypeAdd: 2
+
+ SilicaGridView {
+ id: grid
+
+ cellWidth: Math.floor(width/cellsPerRow)
+ cellHeight: cellWidth
+ anchors.fill: parent
+
+ VerticalScrollDecorator {}
+
+ PullDownMenu {
+ MenuItem {
+ id: resetColorsMenuItem
+
+ text: "Reset colors"
+ onClicked: thisDialog.resetColors()
+ }
+ }
+
+ property Item dragItem
+ property int pageHeaderHeight
+ readonly property int cellsPerRow: Math.floor(width / Theme.itemSizeHuge)
+
+ header: DialogHeader {
+ dialog: thisDialog
+ acceptText: thisDialog.acceptText
+ spacing: 0
+ Component.onCompleted: grid.pageHeaderHeight = height
+ onHeightChanged: grid.pageHeaderHeight = height
+ }
+
+ delegate: MouseArea {
+ id: colorDelegate
+
+ width: grid.cellWidth
+ height: grid.cellHeight
+
+ drag.target: dragging ? colorItem : null
+ drag.axis: Drag.XandYAxis
+
+ readonly property bool highlighted: (pressed && containsMouse)
+ readonly property bool dragging: grid.dragItem === colorDelegate
+ readonly property int index: model.index
+
+ Rectangle {
+ id: colorItem
+
+ width: grid.cellWidth
+ height: grid.cellHeight
+ color: model.color
+ scale: !colorDelegate.dragging ? 1 : isTrashed ? 0.8 : 1.1
+ opacity: isTrashed ? 0.8 : 1
+ layer.enabled: colorDelegate.highlighted || colorDelegate.dragging || scale > 1
+ layer.effect: HarbourPressEffect { source: colorItem }
+
+ readonly property bool isTrashed: model.itemType === itemTypeTrash
+ property real returnX
+ property real returnY
+ property bool snappingBack
+
+ Behavior on opacity { FadeAnimation { } }
+ Behavior on scale {
+ NumberAnimation {
+ easing.type: Easing.InQuad
+ duration: 150
+ }
+ }
+
+ Image {
+ anchors.centerIn: parent
+ source: opacity ? ("image://theme/graphic-close-app?" + deriveColor(model.color)) : ""
+ sourceSize: Qt.size(Theme.iconSizeLarge, Theme.iconSizeLarge)
+ opacity: (model.itemType === itemTypeTrash) ? 0.8 : 0
+ visible: opacity > 0
+ Behavior on opacity { FadeAnimation { } }
+
+ function deriveColor(color) {
+ var gray = 0.299 * color.r + 0.587 * color.g + 0.114 *color.b
+ var v = (gray > 0.5) ? 0 : 1
+ return Qt.rgba(v, v, v, color.a)
+ }
+ }
+
+ states: [
+ State {
+ name: "dragging"
+ when: colorDelegate.dragging
+ ParentChange {
+ target: colorItem
+ parent: grid
+ x: colorDelegate.mapToItem(grid, 0, 0).x
+ y: colorDelegate.mapToItem(grid, 0, 0).y
+ }
+ },
+ State {
+ name: "snappingBack"
+ when: !colorDelegate.dragging && colorItem.snappingBack
+ ParentChange {
+ target: colorItem
+ parent: grid
+ x: colorItem.returnX
+ y: colorItem.returnY
+ }
+ },
+ State {
+ name: "idle"
+ when: !colorDelegate.dragging && !colorItem.snappingBack
+ ParentChange {
+ target: colorItem
+ parent: colorDelegate
+ x: 0
+ y: 0
+ }
+ }
+ ]
+
+ transitions: [
+ Transition {
+ to: "snappingBack"
+ SequentialAnimation {
+ SmoothedAnimation {
+ properties: "x,y"
+ duration: 150
+ }
+ ScriptAction { script: colorItem.snappingBack = false }
+ }
+ },
+ Transition {
+ to: "idle"
+ ScriptAction { script: colorModel.dragPos = -1 }
+ }
+ ]
+
+ Connections {
+ target: colorDelegate.dragging ? colorItem : null
+ onXChanged: colorItem.updateDragPos()
+ onYChanged: colorItem.scrollAndUpdateDragPos()
+ }
+
+ Connections {
+ target: colorDelegate.dragging ? grid : null
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/src/HarbourAztecCodeGenerator.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
- * Copyright (C) 2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2019-2021 Jolla Ltd.
+ * Copyright (C) 2019-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -11,8 +11,8 @@
* 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
+ * 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
@@ -48,22 +48,25 @@
class HarbourAztecCodeGenerator::Task : public HarbourTask {
Q_OBJECT
public:
- Task(QThreadPool* aPool, QString aText);
+ Task(QThreadPool* aPool, QString aText, int aEcLevel);
void performTask() Q_DECL_OVERRIDE;
public:
QString iText;
QString iCode;
+ int iEcLevel;
};
-HarbourAztecCodeGenerator::Task::Task(QThreadPool* aPool, QString aText) :
+HarbourAztecCodeGenerator::Task::Task(QThreadPool* aPool, QString aText,
+ int aEcLevel) :
HarbourTask(aPool),
- iText(aText)
+ iText(aText),
+ iEcLevel(aEcLevel)
{
}
void HarbourAztecCodeGenerator::Task::performTask()
{
- QByteArray bytes(generate(iText));
+ QByteArray bytes(generate(iText, iEcLevel));
if (!bytes.isEmpty()) {
iCode = HarbourBase32::toBase32(bytes);
}
@@ -82,6 +85,10 @@
HarbourAztecCodeGenerator* parentObject() const;
void setText(QString aValue);
+ void setEcLevel(int aValue);
+ void regenerate();
+
+ static int realEcLevel(int aEcLevel);
public Q_SLOTS:
void onTaskDone();
@@ -89,6 +96,7 @@
public:
QThreadPool* iThreadPool;
Task* iTask;
+ int iEcLevel;
QString iText;
QString iCode;
};
@@ -96,7 +104,8 @@
HarbourAztecCodeGenerator::Private::Private(HarbourAztecCodeGenerator* aParent) :
QObject(aParent),
iThreadPool(new QThreadPool(this)),
- iTask(Q_NULLPTR)
+ iTask(Q_NULLPTR),
+ iEcLevel(ECLevelDefault)
{
// Serialize the tasks:
iThreadPool->setMaxThreadCount(1);
@@ -112,19 +121,45 @@
return qobject_cast<HarbourAztecCodeGenerator*>(parent());
}
+int HarbourAztecCodeGenerator::Private::realEcLevel(int aEcLevel)
+{
+ return (aEcLevel == ECLevelDefault) ? AZTEC_CORRECTION_DEFAULT :
+ (aEcLevel < ECLevelLowest) ? ECLevelLowest :
+ (aEcLevel > ECLevelHighest) ? ECLevelHighest :
+ aEcLevel;
+}
+
void HarbourAztecCodeGenerator::Private::setText(QString aText)
{
if (iText != aText) {
iText = aText;
- HarbourAztecCodeGenerator* obj = parentObject();
- const bool wasRunning = (iTask != Q_NULLPTR);
- if (iTask) iTask->release(this);
- iTask = new Task(iThreadPool, aText);
- iTask->submit(this, SLOT(onTaskDone()));
- Q_EMIT obj->textChanged();
- if (!wasRunning) {
- Q_EMIT obj->runningChanged();
+ regenerate();
+ Q_EMIT parentObject()->textChanged();
+ }
+}
+
+void HarbourAztecCodeGenerator::Private::setEcLevel(int aValue)
+{
+ const int level = (aValue == ECLevelDefault) ? ECLevelDefault : realEcLevel(aValue);
+ if (iEcLevel != level) {
+ const int prevRealLevel = realEcLevel(iEcLevel);
+ iEcLevel = level;
+ HDEBUG(level);
+ if (realEcLevel(level) != prevRealLevel) {
+ regenerate();
}
+ Q_EMIT parentObject()->ecLevelChanged();
+ }
+}
+
+void HarbourAztecCodeGenerator::Private::regenerate()
+{
+ const bool wasRunning = (iTask != Q_NULLPTR);
+ if (iTask) iTask->release(this);
+ iTask = new Task(iThreadPool, iText, iEcLevel);
+ iTask->submit(this, SLOT(onTaskDone()));
+ if (!wasRunning) {
+ Q_EMIT parentObject()->runningChanged();
}
}
@@ -169,6 +204,16 @@
iPrivate->setText(aValue);
}
+int HarbourAztecCodeGenerator::ecLevel() const
+{
+ return iPrivate->iEcLevel;
+}
+
+void HarbourAztecCodeGenerator::setEcLevel(int aValue)
+{
+ iPrivate->setEcLevel(aValue);
+}
+
QString HarbourAztecCodeGenerator::code() const
{
return iPrivate->iCode;
@@ -179,12 +224,12 @@
return iPrivate->iTask != Q_NULLPTR;
}
-QByteArray HarbourAztecCodeGenerator::generate(QString aText)
+QByteArray HarbourAztecCodeGenerator::generate(QString aText, int aEcLevel)
{
HDEBUG(aText);
QByteArray in(aText.toUtf8()), out;
AztecSymbol* aztec = aztec_encode_inv(in.constData(), in.size(),
- AZTEC_CORRECTION_DEFAULT);
+ Private::realEcLevel(aEcLevel));
if (aztec) {
const int bytesPerRow = (aztec->size + 7) / 8;
out.reserve(bytesPerRow * aztec->size);
|
[-]
[+]
|
Added |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/src/HarbourColorEditorModel.cpp
^
|
@@ -0,0 +1,298 @@
+/*
+ * Copyright (C) 2021 Jolla Ltd.
+ * Copyright (C) 2021 Slava Monich <slava.monich@jolla.com>
+ *
+ * You may use this file under the terms of the BSD license as follows:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "HarbourColorEditorModel.h"
+#include "HarbourDebug.h"
+
+// ==========================================================================
+// HarbourColorEditorModel::Private
+// ==========================================================================
+
+class HarbourColorEditorModel::Private
+{
+public:
+ enum ModelRole {
+ ColorRole = Qt::UserRole,
+ ItemTypeRole
+ };
+
+ Private();
+
+ bool resetDragPos();
+ QStringList getColors() const;
+ QList<QColor> makeColors(const QStringList& aColors, bool* aChanged) const;
+ QVariant data(int aRow, ModelRole aRole) const;
+
+public:
+ int iDragPos;
+ int iDragStartPos;
+ QList<QColor> iColors;
+ const QColor iAddColor;
+};
+
+HarbourColorEditorModel::Private::Private() :
+ iDragPos(-1),
+ iDragStartPos(-1),
+ iAddColor(0, 0, 0, 0)
+{
+}
+
+bool HarbourColorEditorModel::Private::resetDragPos()
+{
+ if (iDragPos >= 0) {
+ iDragPos = -1;
+ iDragStartPos = -1;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+QStringList HarbourColorEditorModel::Private::getColors() const
+{
+ const int n = iColors.count();
+ QStringList colors;
+ colors.reserve(n);
+ for (int i = 0; i < n; i++) {
+ colors.append(iColors.at(i).name());
+ }
+ return colors;
+}
+
+QList<QColor> HarbourColorEditorModel::Private::makeColors(const QStringList& aColors, bool* aChanged) const
+{
+ const int n = aColors.count();
+ *aChanged = iColors.count() != n;
+ QList<QColor> newColors;
+ newColors.reserve(n);
+ for (int i = 0; i < n; i++) {
+ const QColor c(aColors.at(i));
+ newColors.append(c);
+ if (!*aChanged && iColors.at(i) != c) {
+ *aChanged = true;
+ }
+ }
+ return newColors;
+}
+
+QVariant HarbourColorEditorModel::Private::data(int aRow, ModelRole aRole) const
+{
+ const int n = iColors.count();
+ if (aRow >= 0 && aRow <= n) {
+ switch (aRole) {
+ case ColorRole:
+ if (iDragPos >= 0) {
+ if (aRow == iDragPos) {
+ // This includes the item dragged outside
+ return iColors.at(iDragStartPos);
+ } else {
+ if (iDragPos == n && aRow == (n - 1)) {
+ // When item is dragged outside, it becomes
+ // the last one and shifts the "add" item.
+ return iAddColor;
+ } else if (aRow >= iDragStartPos && aRow < iDragPos) {
+ return iColors.at(aRow + 1);
+ } else if (aRow > iDragPos && aRow <= iDragStartPos) {
+ return iColors.at(aRow - 1);
+ }
+ }
+ }
+ return (aRow == n) ? iAddColor : iColors.at(aRow);
+ case ItemTypeRole:
+ if (iDragPos == n) {
+ // Item is dragged outside
+ return (aRow == n) ? TrashedItem :
+ (aRow == (n - 1)) ? AddItem : ColorItem;
+ } else {
+ return (aRow == n) ? AddItem : ColorItem;
+ }
+ }
+ }
+ return QVariant();
+}
+
+// ==========================================================================
+// HarbourColorEditorModel::Private
+// ==========================================================================
+
+HarbourColorEditorModel::HarbourColorEditorModel(QObject* aParent) :
+ QAbstractListModel(aParent),
+ iPrivate(new Private)
+{
+}
+
+QHash<int,QByteArray> HarbourColorEditorModel::roleNames() const
+{
+ QHash<int,QByteArray> roles;
+ roles.insert(Private::ColorRole, "color");
+ roles.insert(Private::ItemTypeRole, "itemType");
+ return roles;
+}
+
+int HarbourColorEditorModel::rowCount(const QModelIndex&) const
+{
+ return iPrivate->iColors.count() + 1;
+}
+
+QVariant HarbourColorEditorModel::data(const QModelIndex& aIndex, int aRole) const
+{
+ return iPrivate->data(aIndex.row(), (Private::ModelRole)aRole);
+}
+
+QStringList HarbourColorEditorModel::getColors() const
+{
+ return iPrivate->getColors();
+}
+
+void HarbourColorEditorModel::setColors(QStringList aColors)
+{
+ bool changed;
+ const QList<QColor> prevColors(iPrivate->iColors);
+ const QList<QColor> newColors(iPrivate->makeColors(aColors, &changed));
+ if (changed) {
+ const int prevCount = prevColors.count();
+ const int newCount = newColors.count();
+ const QVector<int> colorRole(1, Private::ColorRole);
+ if (newCount < prevCount) {
+ beginRemoveRows(QModelIndex(), newCount + 1, prevCount);
+ iPrivate->iColors = newColors;
+ endRemoveRows();
+ } else if (newCount > prevCount) {
+ beginInsertRows(QModelIndex(), prevCount + 1, newCount);
+ iPrivate->iColors = newColors;
+ endInsertRows();
+ } else {
+ iPrivate->iColors = newColors;
+ }
+ // Change the colors
+ int rangeStart = -1;
+ const int n = qMin(prevCount, newCount);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/src/HarbourPluginLoader.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2017-2020 Jolla Ltd.
- * Copyright (C) 2017-2020 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2017-2021 Jolla Ltd.
+ * Copyright (C) 2017-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -78,6 +78,24 @@
// sym,ret,name,args
#define QMLTYPE_FUNCTIONS(f) \
+ f("_ZN12QQmlMetaType7qmlTypeERK7QStringii", \
+ QQmlType*, qmlType, (QString const&, int, int)) \
+ f("_ZNK8QQmlType23propertyValueSourceCastEv", \
+ int, propertyValueSourceCast, (QQmlType*)) \
+ f("_ZNK8QQmlType10createSizeEv", \
+ int, createSize, (QQmlType*)) \
+ f("_ZNK8QQmlType10metaObjectEv", \
+ const QMetaObject*, metaObject, (QQmlType*)) \
+ f("_ZNK8QQmlType16parserStatusCastEv", \
+ int, parserStatusCast, (QQmlType*)) \
+ f("_ZNK8QQmlType28propertyValueInterceptorCastEv", \
+ int, propertyValueInterceptorCast, (QQmlType*)) \
+ f("_ZNK8QQmlType6typeIdEv", \
+ int, typeId, (QQmlType*)) \
+ f("_ZNK8QQmlType14createFunctionEv", \
+ QQmlType::CreateFunc, createFunction, (QQmlType*)) \
+ f("_ZNK8QQmlType11qListTypeIdEv", \
+ int, qListTypeId, (QQmlType*)) \
f("_ZNK8QQmlType26attachedPropertiesFunctionEv", \
QQmlAttachedPropertiesFunc, AttachedPropertiesFunctionProc,(QQmlType*)) \
f("_ZNK8QQmlType22attachedPropertiesTypeEv", \
@@ -100,8 +118,8 @@
int parserStatusCast() const;
int propertyValueSourceCast() const;
int propertyValueInterceptorCast() const;
- QQmlAttachedPropertiesFunc attachedPropertiesFunction(QQmlEnginePrivate *engine) const;
- const QMetaObject *attachedPropertiesType(QQmlEnginePrivate *engine) const;
+ // attachedPropertiesFunction
+ // attachedPropertiesType
};
// PRIVATE QT API!
@@ -219,8 +237,10 @@
HarbourPluginLoader::Private::qmlType(
QString aName)
{
- QString fullName(iModule + '/' + aName);
- QQmlType* type = QQmlMetaType::qmlType(fullName, iMajor, iMinor);
+ const QString fullName(iModule + '/' + aName);
+ QQmlType* type = gLibQt5Qml.iSym.fn.qmlType ?
+ gLibQt5Qml.iSym.fn.qmlType(fullName, iMajor, iMinor) :
+ Q_NULLPTR;
if (!type) {
HWARN("Failed to load" << fullName);
}
@@ -259,7 +279,15 @@
int aMajor,
int aMinor)
{
- if (aType && iEngine) {
+ if (aType && iEngine &&
+ gLibQt5Qml.iSym.fn.typeId &&
+ gLibQt5Qml.iSym.fn.qListTypeId &&
+ gLibQt5Qml.iSym.fn.createSize &&
+ gLibQt5Qml.iSym.fn.createFunction &&
+ gLibQt5Qml.iSym.fn.metaObject &&
+ gLibQt5Qml.iSym.fn.parserStatusCast &&
+ gLibQt5Qml.iSym.fn.propertyValueSourceCast &&
+ gLibQt5Qml.iSym.fn.propertyValueInterceptorCast) {
// Get around the ABI break in Qt 5.6
QQmlAttachedPropertiesFunc attachedPropertiesFunction =
gLibQt5Qml.iSym.fn.AttachedPropertiesFunctionProc ?
@@ -275,21 +303,21 @@
NULL;
QQmlPrivate::RegisterType type = {
0, // int version;
- aType->typeId(), // int typeId;
- aType->qListTypeId(), // int listId;
- aType->createSize(), // int objectSize;
- aType->createFunction(), // void (*create)(void *);
+ gLibQt5Qml.iSym.fn.typeId(aType), // int typeId;
+ gLibQt5Qml.iSym.fn.qListTypeId(aType), // int listId;
+ gLibQt5Qml.iSym.fn.createSize(aType), // int objectSize;
+ gLibQt5Qml.iSym.fn.createFunction(aType), // void (*create)(void *);
QString(), // QString noCreationReason;
aModule, // const char *uri;
aMajor, // int versionMajor;
aMinor, // int versionMinor;
aQmlName, // const char *elementName;
- aType->metaObject(), // const QMetaObject *metaObject;
+ gLibQt5Qml.iSym.fn.metaObject(aType), // const QMetaObject *metaObject;
attachedPropertiesFunction,
attachedPropertiesMetaObject,
- aType->parserStatusCast(), // int parserStatusCast;
- aType->propertyValueSourceCast(), // int valueSourceCast;
- aType->propertyValueInterceptorCast(), // int valueInterceptorCast;
+ gLibQt5Qml.iSym.fn.parserStatusCast(aType), // int parserStatusCast;
+ gLibQt5Qml.iSym.fn.propertyValueSourceCast(aType), // int valueSourceCast;
+ gLibQt5Qml.iSym.fn.propertyValueInterceptorCast(aType), // int valueInterceptorCast;
Q_NULLPTR, // QObject *(*extensionObjectCreate)(QObject *);
Q_NULLPTR, // const QMetaObject *extensionMetaObject;
Q_NULLPTR, // QQmlCustomParser *customParser;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/src/HarbourProcessState.cpp
^
|
@@ -35,6 +35,8 @@
#include "HarbourDebug.h"
#include <unistd.h>
+#include <grp.h>
+#include <sys/types.h>
HarbourProcessState::HarbourProcessState(QObject* aParent) :
QObject(aParent)
@@ -56,13 +58,42 @@
// We could additionally check that /proc contains only our and
// parent pids, if ppid check becomes not reliable enough.
if (processJailed < 0) {
- if (getppid() == 1) {
- HWARN("We are jailed!");
- processJailed = 1;
- } else{
- HDEBUG("Cool, we are free!");
- processJailed = 0;
+ bool simulate = false;
+ const char* var = "HARBOUR_JAIL_STATE";
+ processJailed = QString(qgetenv(var)).toInt(&simulate);
+ if (!simulate || processJailed < 0) {
+ if (getppid() == 1) {
+ HWARN("We are jailed!");
+ processJailed = 1;
+ } else{
+ HDEBUG("Cool, we are free!");
+ processJailed = 0;
+ }
+ } else {
+ HWARN(var << processJailed);
}
}
return processJailed > 0;
}
+
+bool HarbourProcessState::isPrivileged()
+{
+ static gid_t privilegedGid = 0;
+
+ if (!privilegedGid) {
+ const struct group* gr = getgrnam("privileged");
+
+ if (gr) {
+ privilegedGid = gr->gr_gid;
+ HDEBUG("privileged =" << privilegedGid);
+ }
+ }
+ const gid_t egid = getegid();
+ if (egid == privilegedGid) {
+ HDEBUG("Yes, we are privileged :)");
+ return true;
+ } else {
+ HDEBUG("Oops, we are not privileged :(");
+ return false;
+ }
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/harbour-lib/src/HarbourQrCodeGenerator.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
- * Copyright (C) 2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2019-2021 Jolla Ltd.
+ * Copyright (C) 2019-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
@@ -11,8 +11,8 @@
* 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
+ * 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
@@ -45,25 +45,31 @@
// HarbourQrCodeGenerator::Task
// ==========================================================================
-class HarbourQrCodeGenerator::Task : public HarbourTask {
+class HarbourQrCodeGenerator::Task : public HarbourTask
+{
Q_OBJECT
+
public:
- Task(QThreadPool* aPool, QString aText);
+ Task(QThreadPool* aPool, QString aText, ECLevel aEcLevel);
void performTask() Q_DECL_OVERRIDE;
+
public:
QString iText;
QString iCode;
+ ECLevel iEcLevel;
};
-HarbourQrCodeGenerator::Task::Task(QThreadPool* aPool, QString aText) :
+HarbourQrCodeGenerator::Task::Task(QThreadPool* aPool, QString aText,
+ ECLevel aEcLevel) :
HarbourTask(aPool),
- iText(aText)
+ iText(aText),
+ iEcLevel(aEcLevel)
{
}
void HarbourQrCodeGenerator::Task::performTask()
{
- QByteArray bytes(generate(iText));
+ QByteArray bytes(generate(iText, iEcLevel));
if (!bytes.isEmpty()) {
iCode = HarbourBase32::toBase32(bytes);
}
@@ -73,7 +79,8 @@
// HarbourQrCodeGenerator::Private
// ==========================================================================
-class HarbourQrCodeGenerator::Private : public QObject {
+class HarbourQrCodeGenerator::Private : public QObject
+{
Q_OBJECT
public:
@@ -82,6 +89,10 @@
HarbourQrCodeGenerator* parentObject() const;
void setText(QString aValue);
+ void setEcLevel(int aValue);
+ void regenerate();
+
+ static QRecLevel realEcLevel(ECLevel aEcLevel);
public Q_SLOTS:
void onTaskDone();
@@ -89,6 +100,7 @@
public:
QThreadPool* iThreadPool;
Task* iTask;
+ ECLevel iEcLevel;
QString iText;
QString iCode;
};
@@ -96,7 +108,8 @@
HarbourQrCodeGenerator::Private::Private(HarbourQrCodeGenerator* aParent) :
QObject(aParent),
iThreadPool(new QThreadPool(this)),
- iTask(Q_NULLPTR)
+ iTask(Q_NULLPTR),
+ iEcLevel(ECLevelDefault)
{
// Serialize the tasks:
iThreadPool->setMaxThreadCount(1);
@@ -104,6 +117,7 @@
HarbourQrCodeGenerator::Private::~Private()
{
+ if (iTask) iTask->release();
iThreadPool->waitForDone();
}
@@ -112,19 +126,52 @@
return qobject_cast<HarbourQrCodeGenerator*>(parent());
}
+QRecLevel HarbourQrCodeGenerator::Private::realEcLevel(ECLevel aEcLevel)
+{
+ switch (aEcLevel) {
+ case ECLevel_L: return QR_ECLEVEL_L;
+ case ECLevel_M: return QR_ECLEVEL_M;
+ case ECLevel_Q: return QR_ECLEVEL_Q;
+ case ECLevel_H: return QR_ECLEVEL_H;
+ case ECLevelDefault:
+ case ECLevelCount:
+ break;
+ }
+ return QR_ECLEVEL_M; // default
+}
+
void HarbourQrCodeGenerator::Private::setText(QString aText)
{
if (iText != aText) {
iText = aText;
- HarbourQrCodeGenerator* obj = parentObject();
- const bool wasRunning = (iTask != Q_NULLPTR);
- if (iTask) iTask->release(this);
- iTask = new Task(iThreadPool, aText);
- iTask->submit(this, SLOT(onTaskDone()));
- Q_EMIT obj->textChanged();
- if (!wasRunning) {
- Q_EMIT obj->runningChanged();
+ regenerate();
+ Q_EMIT parentObject()->textChanged();
+ }
+}
+
+void HarbourQrCodeGenerator::Private::setEcLevel(int aValue)
+{
+ const ECLevel level = (aValue < ECLevelDefault) ? ECLevelDefault :
+ (aValue > ECLevelHighest) ? ECLevelHighest : (ECLevel)aValue;
+ if (iEcLevel != level) {
+ const QRecLevel prevRealLevel = realEcLevel(iEcLevel);
+ iEcLevel = level;
+ if (realEcLevel(level) != prevRealLevel) {
+ regenerate();
}
+ Q_EMIT parentObject()->ecLevelChanged();
+ }
+}
+
+void HarbourQrCodeGenerator::Private::regenerate()
+{
+ HarbourQrCodeGenerator* obj = parentObject();
+ const bool wasRunning = (iTask != Q_NULLPTR);
+ if (iTask) iTask->release();
+ iTask = new Task(iThreadPool, iText, iEcLevel);
+ iTask->submit(this, SLOT(onTaskDone()));
+ if (!wasRunning) {
+ Q_EMIT obj->runningChanged();
}
}
@@ -156,7 +203,7 @@
// Callback for qmlRegisterSingletonType<HarbourQrCodeGenerator>
QObject* HarbourQrCodeGenerator::createSingleton(QQmlEngine* aEngine, QJSEngine*)
{
- return new HarbourQrCodeGenerator(aEngine);
+ return new HarbourQrCodeGenerator(); // Singleton doesn't need a parent
}
QString HarbourQrCodeGenerator::text() const
@@ -169,6 +216,16 @@
iPrivate->setText(aValue);
}
+HarbourQrCodeGenerator::ECLevel HarbourQrCodeGenerator::ecLevel() const
+{
+ return iPrivate->iEcLevel;
+}
+
+void HarbourQrCodeGenerator::setEcLevel(int aValue)
+{
+ iPrivate->setEcLevel(aValue);
+}
+
QString HarbourQrCodeGenerator::code() const
{
return iPrivate->iCode;
@@ -179,10 +236,11 @@
return iPrivate->iTask != Q_NULLPTR;
}
-QByteArray HarbourQrCodeGenerator::generate(QString aText)
+QByteArray HarbourQrCodeGenerator::generate(QString aText, ECLevel aEcLevel)
{
QByteArray in(aText.toUtf8()), out;
- QRcode* code = QRcode_encodeString(in.constData(), 0, QR_ECLEVEL_M, QR_MODE_8, true);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/logger/logger.pro
^
|
@@ -59,12 +59,14 @@
src/LoggerSettings.h
SOURCES += \
+ $${HARBOUR_LIB_SRC}/HarbourProcessState.cpp \
$${HARBOUR_LIB_SRC}/HarbourSigChildHandler.cpp \
$${HARBOUR_LIB_SRC}/HarbourSystemInfo.cpp \
$${HARBOUR_LIB_SRC}/HarbourTransferMethodInfo.cpp \
$${HARBOUR_LIB_SRC}/HarbourTransferMethodsModel.cpp
HEADERS += \
+ $${HARBOUR_LIB_INCLUDE}/HarbourProcessState.h \
$${HARBOUR_LIB_INCLUDE}/HarbourSigChildHandler.h \
$${HARBOUR_LIB_INCLUDE}/HarbourSystemInfo.h \
$${HARBOUR_LIB_INCLUDE}/HarbourTransferMethodInfo.h \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/logger/qml/pages/LogPage.qml
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2020 Jolla Ltd.
- * Copyright (C) 2016-2020 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2021 Jolla Ltd.
+ * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -39,9 +39,10 @@
id: thisView
property alias pullDownMenuActive: menu.active
-
property var logModel: LogModel
readonly property string fontFamily: "Monospace"
+ property bool complainedAboutBeingUnprivileged
+
clip: true
function packAndShare() {
@@ -56,8 +57,16 @@
function connected() {
connectTimer.stop()
- //% "Connected."
- logModel.add(qsTrId("logger-logpage-msg-connected"))
+ if (ProcessState.privileged) {
+ //: Log entry
+ //% "Connected."
+ logModel.add(qsTrId("logger-logpage-msg-connected"))
+ } else if (!complainedAboutBeingUnprivileged) {
+ complainedAboutBeingUnprivileged = true
+ //: Log entry
+ //% "This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!"
+ logModel.add(qsTrId("logger-logpage-msg-unprivileged"))
+ }
}
Component.onCompleted: {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/logger/settings/settings.qml
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2017 Jolla Ltd.
- * Contact: Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2021 Jolla Ltd.
+ * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -13,9 +13,9 @@
* 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 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.
+ * 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 LIMITED TO, THE
@@ -35,8 +35,13 @@
import org.nemomobile.configuration 1.0
Page {
- id: page
readonly property string rootPath: "/apps/" + appName() + "/"
+ property alias title: pageHeader.title
+ property bool inApp
+
+ // jolla-settings expects these properties:
+ property var applicationName
+ property var applicationIcon
// Deduce package name from the path
function appName() {
@@ -59,9 +64,28 @@
width: parent.width
PageHeader {
- //: Page header
- //% "Logger"
- title: qsTrId("logger-settings-page-header")
+ id: pageHeader
+
+ rightMargin: Theme.horizontalPageMargin + (appIcon.visible ? (height - appIcon.padding) : 0)
+ title: applicationName ? applicationName : qsTrId(appName() + "-app_name")
+ description: applicationName ?
+ //: Settings page header description (app version)
+ //% "Version %1"
+ qsTrId("logger-settings-page-header-version").arg("1.0.19") :
+ ""
+
+ 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
+ }
}
SectionHeader {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/logger/src/LoggerMain.cpp
^
|
@@ -39,6 +39,7 @@
#include "LoggerCategoryFilterModel.h"
#include "HarbourDebug.h"
+#include "HarbourProcessState.h"
#include "HarbourSystemInfo.h"
#include "HarbourSigChildHandler.h"
#include "HarbourTransferMethodsModel.h"
@@ -221,6 +222,7 @@
context->setContextProperty("CategoryModel", categoryModel);
context->setContextProperty("CategoryFilterModel", filterModel);
context->setContextProperty("TransferMethodsModel", transferModel);
+ context->setContextProperty("ProcessState", new HarbourProcessState(iApp));
context->setContextProperty("SystemInfo", new HarbourSystemInfo(iApp));
context->setContextProperty("AppName", iFullAppName);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/nfc/harbour-logger-nfc.desktop
^
|
@@ -1,7 +1,10 @@
[Desktop Entry]
Type=Application
Name=NFC Logger
-Name[ru]=Журнал NFC
+Name[ru]=NFC лог
X-Nemo-Application-Type=silica-qt5
Icon=harbour-logger-nfc
Exec=harbour-logger-nfc
+
+[X-HarbourBackup]
+BackupConfigList=/apps/harbour-logger-nfc/
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/nfc/nfc.pro
^
|
@@ -49,7 +49,7 @@
OTHER_FILES += \
icons/harbour-$${NAME}.svg \
- harbour-$${NAME}.desktop \
+ *.desktop \
qml/*.qml \
privileges/* \
translations/*.ts
@@ -89,7 +89,6 @@
settings_json.CONFIG += no_check_exist
settings_qml.files = $${LOGGER_LIB_DIR}/settings/settings.qml
settings_qml.path = /usr/share/$${TARGET}/settings/
- settings_qml.extra = sed -i s/harbour-logger-conf/$${TARGET}/g $$eval(settings_qml.files)
INSTALLS += settings_qml settings_json
}
@@ -98,12 +97,6 @@
privileges.path = /usr/share/mapplauncherd/privileges.d/
INSTALLS += privileges
-# Desktop file
-openrepos {
- desktop.extra = sed s/harbour/openrepos/g harbour-$${NAME}.desktop > $${TARGET}.desktop
- desktop.CONFIG += no_check_exist
-}
-
# Icons
ICON_SIZES = 86 108 128 172 256
for(s, ICON_SIZES) {
@@ -121,6 +114,7 @@
# Translations
TRANSLATION_IDBASED=-idbased
TRANSLATION_SOURCES = \
+ $${_PRO_FILE_PWD_}/src \
$${_PRO_FILE_PWD_}/qml \
$${LOGGER_LIB_DIR}/qml \
$${LOGGER_LIB_DIR}/settings
|
[-]
[+]
|
Added |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/nfc/openrepos-logger-nfc.desktop
^
|
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Type=Application
+Name=NFC Logger
+Name[ru]=NFC лог
+X-Nemo-Application-Type=silica-qt5
+Icon=openrepos-logger-nfc
+Exec=openrepos-logger-nfc
+
+[X-HarbourBackup]
+BackupConfigList=/apps/openrepos-logger-nfc/
+
+[X-Sailjail]
+Sandboxing=Disabled
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/nfc/src/main.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2019 Jolla Ltd.
- * Copyright (C) 2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2019-2021 Jolla Ltd.
+ * Copyright (C) 2019-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -32,6 +32,35 @@
#include "LoggerMain.h"
+#include <QQuickView>
+
+#define SUPER LoggerMain
+
+class NfcLogger: public SUPER
+{
+ Q_OBJECT
+
+public:
+ NfcLogger(int* aArgc, char** aArgv, QStringList aPackages);
+
+protected:
+ void setupView(QQuickView* aView) Q_DECL_OVERRIDE;
+};
+
+NfcLogger::NfcLogger(int* aArgc, char** aArgv, QStringList aPackages) :
+ SUPER(aArgc, aArgv, "org.sailfishos.nfc.daemon", aPackages, "nfc",
+ "qml/main.qml")
+{
+}
+
+void NfcLogger::setupView(QQuickView* aView)
+{
+ //: Settings page title (app name)
+ //% "NFC Logger"
+ aView->setTitle(qtTrId("openrepos-logger-nfc-app_name"));
+ SUPER::setupView(aView);
+}
+
Q_DECL_EXPORT int main(int argc, char* argv[])
{
QStringList packages;
@@ -42,6 +71,7 @@
packages.append("nfcd");
packages.append("nfcd-binder-plugin");
packages.append("pn54x-binder-plugin");
- return LoggerMain(&argc, argv, "org.sailfishos.nfc.daemon", packages,
- "nfc", "qml/main.qml").run();
+ return NfcLogger(&argc, argv, packages).run();
}
+
+#include "main.moc"
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/nfc/translations/harbour-logger-nfc-pl.ts
^
|
@@ -23,8 +23,17 @@
<source>Log</source>
<translation>Logi NFC</translation>
</message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <extracomment>Log entry</extracomment>
+ <translation type="unfinished">Ta aplikacja powinna działać w trybie uprzywilejowanym, ale wydaje się, że tak nie jest. Najprawdopodobniej problem tkwi w piaskownicy, chociaż mogą być inne przyczyny.
+
+W każdym razie aplikacja najprawdopodobniej nie będzie działać w tej formie :(
+</translation>
+ </message>
<message id="logger-logpage-msg-connected">
<source>Connected.</source>
+ <extracomment>Log entry</extracomment>
<translation>Połączono</translation>
</message>
<message id="logger-logpage-msg-connect-error">
@@ -42,7 +51,7 @@
<message id="logger-logpage-hint-jump_to_bottom">
<source>Jump to the end of the log to see the most recent messages and follow new messages in real time</source>
<extracomment>Hint text, displayed on long tap</extracomment>
- <translation type="unfinished">Przejdź do ostatniej wiadomości i śledź nowe w czasie rzeczywistym</translation>
+ <translation>Przejdź do ostatniej wiadomości i śledź nowe wiadomości w czasie rzeczywistym</translation>
</message>
<message id="logger-categories-title">
<source>Log categories</source>
@@ -110,12 +119,17 @@
<message id="logger-sharepage-broken">
<source>In-app sharing is not available for this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder.</source>
<extracomment>Info label displayed instead of sharing method list</extracomment>
- <translation type="unfinished">Niestety w tej wersji Sailfish OS nic tak łatwego do udostępnienia nie zadziała. Możesz zapisać plik tar w dokumentach, a następnie sam wymyślić, co z nim zrobić.</translation>
+ <translation>Niestety w tej wersji Sailfish OS udostępnianie nie działa. Użyj menu wysuwanego, aby zapisać plik tar w katalogu dokumenty.</translation>
</message>
- <message id="logger-settings-page-header">
- <source>Logger</source>
- <extracomment>Page header</extracomment>
- <translation>Logi NFC</translation>
+ <message id="openrepos-logger-nfc-app_name">
+ <source>NFC Logger</source>
+ <extracomment>Settings page title (app name)</extracomment>
+ <translation>NFC Logger</translation>
+ </message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Wersja %1</translation>
</message>
<message id="logger-settings-section-header-display">
<source>Display</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/nfc/translations/harbour-logger-nfc-ru.ts
^
|
@@ -23,8 +23,17 @@
<source>Log</source>
<translation>Журнал NFC</translation>
</message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <extracomment>Log entry</extracomment>
+ <translation>Это приложение должно работать в привилегированном режиме, но кажется это не так. Скорее всего проблема в песочнице, хотя могут быть и другие причины.
+
+Как бы то ни было, в таком виде приложение скорее всего работать не будет :(
+</translation>
+ </message>
<message id="logger-logpage-msg-connected">
<source>Connected.</source>
+ <extracomment>Log entry</extracomment>
<translation>Соединение установлено.</translation>
</message>
<message id="logger-logpage-msg-connect-error">
@@ -112,10 +121,15 @@
<extracomment>Info label displayed instead of sharing method list</extracomment>
<translation>Увы, но в этой версии Sailfish OS ничего так просто расшарить не получится. Вы можете сохранить тарбол в документы, а дальше разбирайтесь сами, что с ним делать.</translation>
</message>
- <message id="logger-settings-page-header">
- <source>Logger</source>
- <extracomment>Page header</extracomment>
- <translation>Журнал NFC</translation>
+ <message id="openrepos-logger-nfc-app_name">
+ <source>NFC Logger</source>
+ <extracomment>Settings page title (app name)</extracomment>
+ <translation>NFC лог</translation>
+ </message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Версия %1</translation>
</message>
<message id="logger-settings-section-header-display">
<source>Display</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/nfc/translations/harbour-logger-nfc.ts
^
|
@@ -23,8 +23,17 @@
<source>Log</source>
<translation>NFC log</translation>
</message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <extracomment>Log entry</extracomment>
+ <translation>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one.
+
+Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!
+</translation>
+ </message>
<message id="logger-logpage-msg-connected">
<source>Connected.</source>
+ <extracomment>Log entry</extracomment>
<translation>Connected to NFC service.</translation>
</message>
<message id="logger-logpage-msg-connect-error">
@@ -112,11 +121,16 @@
<extracomment>Info label displayed instead of sharing method list</extracomment>
<translation>In-app sharing is not available for this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder.</translation>
</message>
- <message id="logger-settings-page-header">
- <source>Logger</source>
- <extracomment>Page header</extracomment>
+ <message id="openrepos-logger-nfc-app_name">
+ <source>NFC Logger</source>
+ <extracomment>Settings page title (app name)</extracomment>
<translation>NFC Logger</translation>
</message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Version %1</translation>
+ </message>
<message id="logger-settings-section-header-display">
<source>Display</source>
<extracomment>Section header</extracomment>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/harbour-logger-ofono.desktop
^
|
@@ -1,7 +1,10 @@
[Desktop Entry]
Type=Application
Name=Ofono Log
-Name[ru]=Журнал ofono
+Name[ru]=Ofono лог
X-Nemo-Application-Type=silica-qt5
Icon=harbour-logger-ofono
Exec=harbour-logger-ofono
+
+[X-HarbourBackup]
+BackupConfigList=/apps/harbour-logger-ofono/
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/ofono.pro
^
|
@@ -51,7 +51,7 @@
OTHER_FILES += \
icons/harbour-$${NAME}.svg \
- harbour-$${NAME}.desktop \
+ *.desktop \
qml/*.qml \
privileges/* \
translations/*.ts
@@ -107,7 +107,6 @@
settings_json.CONFIG += no_check_exist
settings_qml.files = $${LOGGER_LIB_DIR}/settings/settings.qml
settings_qml.path = /usr/share/$${TARGET}/settings/
- settings_qml.extra = sed -i s/harbour-logger-conf/$${TARGET}/g $$eval(settings_qml.files)
INSTALLS += settings_qml settings_json
}
@@ -116,12 +115,6 @@
privileges.path = /usr/share/mapplauncherd/privileges.d/
INSTALLS += privileges
-# Desktop file
-openrepos {
- desktop.extra = sed s/harbour/openrepos/g harbour-$${NAME}.desktop > $${TARGET}.desktop
- desktop.CONFIG += no_check_exist
-}
-
# Icons
ICON_SIZES = 86 108 128 172 256
for(s, ICON_SIZES) {
@@ -139,6 +132,7 @@
# Translations
TRANSLATION_IDBASED=-idbased
TRANSLATION_SOURCES = \
+ $${_PRO_FILE_PWD_}/src \
$${_PRO_FILE_PWD_}/qml \
$${LOGGER_LIB_DIR}/qml \
$${LOGGER_LIB_DIR}/settings
|
[-]
[+]
|
Added |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/openrepos-logger-ofono.desktop
^
|
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Type=Application
+Name=Ofono Log
+Name[ru]=Ofono лог
+X-Nemo-Application-Type=silica-qt5
+Icon=openrepos-logger-ofono
+Exec=openrepos-logger-ofono
+
+[X-HarbourBackup]
+BackupConfigList=/apps/openrepos-logger-ofono/
+
+[X-Sailjail]
+Sandboxing=Disabled
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/src/main.cpp
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016-2019 Jolla Ltd.
- * Copyright (C) 2016-2019 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2016-2021 Jolla Ltd.
+ * Copyright (C) 2016-2021 Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -46,10 +46,12 @@
#define SUPER LoggerMain
-class OfonoLogger: public SUPER {
+class OfonoLogger: public SUPER
+{
Q_OBJECT
Q_PROPERTY(bool mobileDataBroken READ mobileDataBroken NOTIFY mobileDataBrokenChanged)
Q_PROPERTY(bool mobileDataDisabled READ mobileDataDisabled NOTIFY mobileDataDisabledChanged)
+
static const QString AUTO;
public:
@@ -244,6 +246,9 @@
void OfonoLogger::setupView(QQuickView* aView)
{
QQmlContext* context = aView->rootContext();
+ //: Settings page title (app name)
+ //% "Ofono Log"
+ aView->setTitle(qtTrId("openrepos-logger-ofono-app_name"));
context->setContextProperty("OfonoLogger", this);
SUPER::setupView(aView);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/translations/harbour-logger-ofono-nl.ts
^
|
@@ -33,8 +33,15 @@
<source>Log</source>
<translation>Ofono-log</translation>
</message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <oldsource>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one.\n\nWhatever the reason is, logs will be unavailable. Sorry for the inconvenience!</oldsource>
+ <extracomment>Log entry</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
<message id="logger-logpage-msg-connected">
<source>Connected.</source>
+ <extracomment>Log entry</extracomment>
<translation>Verbonden met ofono.</translation>
</message>
<message id="logger-logpage-msg-connect-error">
@@ -122,10 +129,15 @@
<extracomment>Info label displayed instead of sharing method list</extracomment>
<translation type="unfinished">In-app delen is niet beschikbaar voor deze versie van Sailfish OS. Gebruik het katrolmenu om tarball op te slaan in de documentenmap.</translation>
</message>
- <message id="logger-settings-page-header">
- <source>Logger</source>
- <extracomment>Page header</extracomment>
- <translation>Ofono-logger</translation>
+ <message id="openrepos-logger-ofono-app_name">
+ <source>Ofono Log</source>
+ <extracomment>Settings page title (app name)</extracomment>
+ <translation>Ofono Log</translation>
+ </message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation type="unfinished">Versie %1</translation>
</message>
<message id="logger-settings-section-header-display">
<source>Display</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/translations/harbour-logger-ofono-pl.ts
^
|
@@ -33,8 +33,17 @@
<source>Log</source>
<translation>Logi Ofono</translation>
</message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <extracomment>Log entry</extracomment>
+ <translation type="unfinished">Ta aplikacja powinna działać w trybie uprzywilejowanym, ale wydaje się, że tak nie jest. Najprawdopodobniej problem tkwi w piaskownicy, chociaż mogą być inne przyczyny.
+
+W każdym razie aplikacja najprawdopodobniej nie będzie działać w tej formie :(
+</translation>
+ </message>
<message id="logger-logpage-msg-connected">
<source>Connected.</source>
+ <extracomment>Log entry</extracomment>
<translation>Połączono z Ofono</translation>
</message>
<message id="logger-logpage-msg-connect-error">
@@ -122,10 +131,15 @@
<extracomment>Info label displayed instead of sharing method list</extracomment>
<translation type="unfinished">Niestety w tej wersji Sailfish OS nic tak łatwego do udostępnienia nie zadziała. Możesz zapisać plik tar w dokumentach, a następnie sam wymyślić, co z nim zrobić.</translation>
</message>
- <message id="logger-settings-page-header">
- <source>Logger</source>
- <extracomment>Page header</extracomment>
- <translation>Logger</translation>
+ <message id="openrepos-logger-ofono-app_name">
+ <source>Ofono Log</source>
+ <extracomment>Settings page title (app name)</extracomment>
+ <translation>Ofono Log</translation>
+ </message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Wersja %1</translation>
</message>
<message id="logger-settings-section-header-display">
<source>Display</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/translations/harbour-logger-ofono-ru.ts
^
|
@@ -33,8 +33,17 @@
<source>Log</source>
<translation>Журнал ofono</translation>
</message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <extracomment>Log entry</extracomment>
+ <translation>Это приложение должно работать в привилегированном режиме, но кажется это не так. Скорее всего проблема в песочнице, хотя могут быть и другие причины.
+
+Как бы то ни было, в таком виде приложение скорее всего работать не будет :(
+</translation>
+ </message>
<message id="logger-logpage-msg-connected">
<source>Connected.</source>
+ <extracomment>Log entry</extracomment>
<translation>Соединение установлено.</translation>
</message>
<message id="logger-logpage-msg-connect-error">
@@ -122,10 +131,15 @@
<extracomment>Info label displayed instead of sharing method list</extracomment>
<translation>Увы, но в этой версии Sailfish OS ничего так просто расшарить не получится. Вы можете сохранить тарбол в документы, а дальше разбирайтесь сами, что с ним делать.</translation>
</message>
- <message id="logger-settings-page-header">
- <source>Logger</source>
- <extracomment>Page header</extracomment>
- <translation>Журнал ofono</translation>
+ <message id="openrepos-logger-ofono-app_name">
+ <source>Ofono Log</source>
+ <extracomment>Settings page title (app name)</extracomment>
+ <translation>Ofono лог</translation>
+ </message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Версия %1</translation>
</message>
<message id="logger-settings-section-header-display">
<source>Display</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/translations/harbour-logger-ofono-sv.ts
^
|
@@ -33,8 +33,15 @@
<source>Log</source>
<translation>Logg</translation>
</message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <oldsource>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one.\n\nWhatever the reason is, logs will be unavailable. Sorry for the inconvenience!</oldsource>
+ <extracomment>Log entry</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
<message id="logger-logpage-msg-connected">
<source>Connected.</source>
+ <extracomment>Log entry</extracomment>
<translation>Ansluten.</translation>
</message>
<message id="logger-logpage-msg-connect-error">
@@ -122,10 +129,15 @@
<extracomment>Info label displayed instead of sharing method list</extracomment>
<translation type="unfinished">Delning i appen är inte tillgänglig för den här versionen av Sailfish OS. Använd remskivmenyn för att spara tarball i dokumentmappen.</translation>
</message>
- <message id="logger-settings-page-header">
- <source>Logger</source>
- <extracomment>Page header</extracomment>
- <translation>Datalogger</translation>
+ <message id="openrepos-logger-ofono-app_name">
+ <source>Ofono Log</source>
+ <extracomment>Settings page title (app name)</extracomment>
+ <translation>Ofono Log</translation>
+ </message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Version %1</translation>
</message>
<message id="logger-settings-section-header-display">
<source>Display</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/translations/harbour-logger-ofono-zh_CN.ts
^
|
@@ -33,8 +33,15 @@
<source>Log</source>
<translation>日志</translation>
</message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <oldsource>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one.\n\nWhatever the reason is, logs will be unavailable. Sorry for the inconvenience!</oldsource>
+ <extracomment>Log entry</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
<message id="logger-logpage-msg-connected">
<source>Connected.</source>
+ <extracomment>Log entry</extracomment>
<translation>已连接。</translation>
</message>
<message id="logger-logpage-msg-connect-error">
@@ -122,10 +129,15 @@
<extracomment>Info label displayed instead of sharing method list</extracomment>
<translation type="unfinished">此版本的 Sailfish OS 无法进行应用内共享。 使用滑轮菜单将 tarball 保存到文档文件夹。</translation>
</message>
- <message id="logger-settings-page-header">
- <source>Logger</source>
- <extracomment>Page header</extracomment>
- <translation>日志生成器</translation>
+ <message id="openrepos-logger-ofono-app_name">
+ <source>Ofono Log</source>
+ <extracomment>Settings page title (app name)</extracomment>
+ <translation>Ofono Log</translation>
+ </message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation type="unfinished">版本 %1</translation>
</message>
<message id="logger-settings-section-header-display">
<source>Display</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-logger-ofono-1.0.19.tar.bz2/ofono/translations/harbour-logger-ofono.ts
^
|
@@ -33,8 +33,17 @@
<source>Log</source>
<translation>Ofono log</translation>
</message>
+ <message id="logger-logpage-msg-unprivileged">
+ <source>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one. Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!</source>
+ <extracomment>Log entry</extracomment>
+ <translation>This application must be run in a privileged mode but apparently it's not. Sandboxing is the most likely reason for that, albeit not the only one.
+
+Whatever the reason is, logs will be unavailable. Sorry for the inconvenience!
+</translation>
+ </message>
<message id="logger-logpage-msg-connected">
<source>Connected.</source>
+ <extracomment>Log entry</extracomment>
<translation>Connected to ofono.</translation>
</message>
<message id="logger-logpage-msg-connect-error">
@@ -122,11 +131,16 @@
<extracomment>Info label displayed instead of sharing method list</extracomment>
<translation>In-app sharing is not available for this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder.</translation>
</message>
- <message id="logger-settings-page-header">
- <source>Logger</source>
- <extracomment>Page header</extracomment>
+ <message id="openrepos-logger-ofono-app_name">
+ <source>Ofono Log</source>
+ <extracomment>Settings page title (app name)</extracomment>
<translation>Ofono Log</translation>
</message>
+ <message id="logger-settings-page-header-version">
+ <source>Version %1</source>
+ <extracomment>Settings page header description (app version)</extracomment>
+ <translation>Version %1</translation>
+ </message>
<message id="logger-settings-section-header-display">
<source>Display</source>
<extracomment>Section header</extracomment>
|