[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc.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">cbfc05d</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.tar.bz2/harbour-lib/src/HarbourSystemInfo.cpp
^
|
@@ -44,6 +44,7 @@
#include <QFile>
#include <QTextStream>
+#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
@@ -255,7 +256,7 @@
argv[5] = NULL;
while ((dup2(fds[1], STDOUT_FILENO) == -1) && (errno == EINTR));
execvp(argv[0], (char**)argv);
- exit(1);
+ abort();
}
close(fds[1]);
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/logger/logger.pro
^
|
@@ -5,8 +5,10 @@
CONFIG += sailfishapp link_pkgconfig
PKGCONFIG += mlite5 gio-2.0 gio-unix-2.0 glib-2.0
-QMAKE_CXXFLAGS += -Wno-unused-parameter -Wno-psabi
-QMAKE_CFLAGS += -Wno-unused-parameter
+WARNINGS = -Wall -Wno-unused-parameter -Wno-deprecated-declarations
+EXTRA_CFLAGS = $$WARNINGS -fvisibility=hidden
+QMAKE_CXXFLAGS += $$EXTRA_CFLAGS
+QMAKE_CFLAGS += $$EXTRA_CFLAGS
HARBOUR_LIB_DIR = $$_PRO_FILE_PWD_/../harbour-lib
HARBOUR_LIB_SRC = $${HARBOUR_LIB_DIR}/src
@@ -26,8 +28,13 @@
LIBDBUSLOG_CLIENT_INCLUDE = $${LIBDBUSLOG_CLIENT}/include
CONFIG(debug, debug|release) {
- DEFINES += HARBOUR_DEBUG=1
- DEFINES += DEBUG=1
+ QMAKE_CXXFLAGS_DEBUG *= -O0
+ QMAKE_CFLAGS_DEBUG *= -O0
+ DEFINES += DEBUG HARBOUR_DEBUG
+} else {
+ EXTRA_RELEASE_CFLAGS = -fPIC -flto -ffat-lto-objects
+ QMAKE_CXXFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_CFLAGS += $$EXTRA_RELEASE_CFLAGS
}
openrepos {
@@ -59,12 +66,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:openrepos-logger-nfc-1.0.21.tar.bz2/logger/qml/pages/CoverPage.qml
^
|
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2016 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
@@ -32,11 +32,14 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
+
import "logger.js" as Logger
+import "../harbour"
CoverBackground {
id: cover
- allowResize: true
+
+ readonly property bool _privileged: ProcessState.privileged
Label {
id: title
@@ -55,18 +58,19 @@
}
ListView {
id: list
+
+ visible: _privileged
anchors {
top: title.bottom
left: parent.left
right: parent.right
- bottom: parent.bottom
leftMargin: Theme.paddingMedium
rightMargin: Theme.paddingSmall
- bottomMargin: Theme.itemSizeSmall
}
+ height: Math.min(contentHeight, parent.height - y - Theme.itemSizeSmall/cover.parent.scale)
+ verticalLayoutDirection: ListView.BottomToTop
model: LogModel
- onCountChanged: positioner.start()
- onHeightChanged: scrollToEnd()
+ clip: true
delegate: Label {
text: messageText
width: parent.width
@@ -74,22 +78,10 @@
truncationMode: TruncationMode.Fade
font.pixelSize: Theme.fontSizeTiny
}
- function scrollToEnd() {
- if (count > 1) {
- // FsIoLog model has one extra item at the end
- positionViewAtIndex(count - 2, ListView.End)
- }
- }
- Timer {
- // positionViewAtXxx() doesn't work directly from onCountChanged
- id: positioner
- interval: 0
- onTriggered: list.scrollToEnd()
- }
}
OpacityRampEffect {
- enabled: !list.atYBeginning
+ enabled: list.contentHeight > list.height
sourceItem: list
parent: cover
direction: OpacityRamp.BottomToTop
@@ -97,7 +89,18 @@
offset: 1 - 1 / slope
}
+ HarbourHighlightIcon {
+ visible: !_privileged
+ x: Theme.paddingLarge
+ anchors.verticalCenter: parent.verticalCenter
+ source: "images/shrug.svg"
+ sourceSize.width: cover.width - 2 * x
+ highlightColor: Theme.highlightColor
+ smooth: true
+ }
+
CoverActionList {
+ enabled: _privileged
CoverAction {
iconSource: "image://theme/icon-cover-cancel"
onTriggered: list.model.clear()
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.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:
*
@@ -32,6 +32,8 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
+import org.nemomobile.notifications 1.0
+
import "logger.js" as Logger
import "../harbour"
@@ -39,9 +41,10 @@
id: thisView
property alias pullDownMenuActive: menu.active
-
property var logModel: LogModel
readonly property string fontFamily: "Monospace"
+ property bool complainedAboutBeingUnprivileged
+
clip: true
function packAndShare() {
@@ -54,10 +57,32 @@
SharePage {}
}
+ Notification {
+ id: clipboardNotification
+
+ //: Pop-up notification
+ //% "Copied to clipboard"
+ previewBody: qsTrId("logger-notification-copied_to_clipboard")
+ expireTimeout: 2000
+ Component.onCompleted: {
+ if ("icon" in clipboardNotification) {
+ clipboardNotification.icon = "icon-s-clipboard"
+ }
+ }
+ }
+
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: {
@@ -143,9 +168,10 @@
}
}
- delegate: Item {
+ delegate: BackgroundItem {
width: parent.width
height: textLabel.height
+ enabled: timeLabel.text.length > 0 || textLabel.text.length > 0
readonly property color textColor: Logger.textColor(messageType, messageLevel)
Label {
@@ -176,6 +202,12 @@
rightMargin: Theme.horizontalPageMargin
}
}
+
+ onPressAndHold: {
+ Clipboard.text = (timeLabel.text.length > 0) ?
+ (timeLabel.text + " " + textLabel.text) : textLabel.text
+ clipboardNotification.publish()
+ }
}
VerticalScrollDecorator {}
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/logger/qml/pages/SharePage.qml
^
|
@@ -44,7 +44,7 @@
property var logSaver: LogSaver
property var shareModel: TransferMethodsModel // Context property
readonly property string _sharingApiVersion: SystemInfo.packageVersion("declarative-transferengine-qt5")
- readonly property bool _sharingBroken: SystemInfo.compareVersions(_sharingApiVersion, "0.4.0") >= 0 // QML API break
+ readonly property bool _sharingBroken: !_sharingApiVersion || SystemInfo.compareVersions(_sharingApiVersion, "0.4.0") >= 0 // QML API break
readonly property bool _readyToShare: !logSaver.packing && !logSaver.saving && !minWaitTimer.running
// For the page slide animation to kick in, the initial value of
@@ -125,7 +125,7 @@
InfoLabel {
id: sharingBrokenInfo
//: Info label displayed instead of sharing method list
- //% "In-app sharing is not available for this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder."
+ //% "In-app sharing is not available in this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder."
text: qsTrId("logger-sharepage-broken")
}
Item {
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.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.21") :
+ ""
+
+ 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:openrepos-logger-nfc-1.0.21.tar.bz2/logger/src/LoggerCategoryModel.cpp
^
|
@@ -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
@@ -45,6 +45,7 @@
DBusLogClient* aClient, QObject* aParent) : SUPER(aParent),
iSettings(aSettings),
iClient(dbus_log_client_ref(aClient)),
+ iDefaultLevel(DBUSLOG_LEVEL_UNDEFINED),
iHaveDefaults(false)
{
memset(iClientSignals, 0, sizeof(iClientSignals));
@@ -161,6 +162,13 @@
dbus_log_client_disable_pattern(iClient, "*", NULL, NULL);
}
+void LoggerCategoryModel::restoreLogLevel() const
+{
+ if (iDefaultLevel != DBUSLOG_LEVEL_UNDEFINED) {
+ dbus_log_client_set_default_level(iClient, iDefaultLevel, NULL, NULL);
+ }
+}
+
void LoggerCategoryModel::resetCategories(QList<LoggerCategory> aCategories)
{
GStrV* enable = NULL;
@@ -281,6 +289,10 @@
iCategories.insert(cat->id, LoggerCategory(cat));
}
endResetModel();
+ // Save the log level so that we can restore it on exit
+ if (iDefaultLevel == DBUSLOG_LEVEL_UNDEFINED) {
+ iDefaultLevel = iClient->default_level;
+ }
// Make sure that verbose logging is enabled. The default is often
// DEBUG which turns off e.g. RIL data dump in ofono
if (iClient->default_level < DBUSLOG_LEVEL_VERBOSE) {
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/logger/src/LoggerCategoryModel.h
^
|
@@ -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
@@ -67,6 +67,7 @@
int count() const;
bool isConnected() const;
bool haveDefaults() const;
+ void restoreLogLevel() const;
LoggerCategory loggerCategoryAt(int aRow) const;
void resetCategories(QList<LoggerCategory> aCategories);
@@ -115,6 +116,7 @@
DBusLogClient* iClient;
gulong iClientSignals[DBusLogClientSignalCount];
QHash<guint32,LoggerCategory> iCategories;
+ DBUSLOG_LEVEL iDefaultLevel;
bool iHaveDefaults;
};
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/logger/src/LoggerLogSaver.cpp
^
|
@@ -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:
*
@@ -37,6 +37,7 @@
#include <QFileInfo>
#include <QDir>
+#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
@@ -150,6 +151,7 @@
// Child
execlp("tar", "tar", "-czf", qPrintable(iArchivePath), "-C",
qPrintable(iTempDir.path()), qPrintable(iArchiveName), NULL);
+ abort();
}
Q_EMIT archivePathChanged();
}
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.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"
@@ -49,9 +50,10 @@
#include <QtQuick>
#include <QtQml>
-#include <fcntl.h>
+#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
+#include <fcntl.h>
#include <sys/fsuid.h>
#undef signals
@@ -123,6 +125,7 @@
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
execvp(aExe, (char**)aArgv);
+ abort();
}
close(fd);
HDEBUG(pid << qPrintable(aOut));
@@ -221,6 +224,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);
@@ -231,6 +235,7 @@
int ret = iApp->exec();
if (logSettings->autoResetLogging()) {
+ categoryModel->restoreLogLevel();
categoryModel->reset();
}
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.tar.bz2/nfc/nfc.pro
^
|
@@ -20,16 +20,19 @@
QT += dbus
WARNINGS = -Wall -Wno-unused-parameter -Wno-deprecated-declarations
-QMAKE_CXXFLAGS += $$WARNINGS -Wno-psabi
-QMAKE_CFLAGS += $$WARNINGS
+EXTRA_CFLAGS = $$WARNINGS -fvisibility=hidden
+QMAKE_CXXFLAGS += $$EXTRA_CFLAGS
+QMAKE_CFLAGS += $$EXTRA_CFLAGS
CONFIG(debug, debug|release) {
- QMAKE_CXXFLAGS_DEBUG *= -O0
- QMAKE_CFLAGS_DEBUG *= -O0
-}
-
-CONFIG(debug, debug|release) {
- DEFINES += HARBOUR_DEBUG=1
+ QMAKE_CXXFLAGS_DEBUG *= -O0
+ QMAKE_CFLAGS_DEBUG *= -O0
+ DEFINES += DEBUG HARBOUR_DEBUG
+} else {
+ EXTRA_RELEASE_CFLAGS = -fPIC -flto -ffat-lto-objects
+ QMAKE_CXXFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_CFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_LFLAGS += -fPIC -flto
}
# Directories
@@ -49,7 +52,7 @@
OTHER_FILES += \
icons/harbour-$${NAME}.svg \
- harbour-$${NAME}.desktop \
+ *.desktop \
qml/*.qml \
privileges/* \
translations/*.ts
@@ -89,7 +92,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,22 +100,19 @@
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) {
icon_target = icon$${s}
icon_dir = icons/$${s}x$${s}
- $${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
openrepos {
- $${icon_target}.extra = cp $${icon_dir}/harbour-$${NAME}.png $$eval($${icon_target}.files)
$${icon_target}.CONFIG += no_check_exist
+ $${icon_target}.files = $${OUT_PWD}/$${icon_dir}/$${TARGET}.png
+ $${icon_target}.extra = mkdir -p \"$${OUT_PWD}/$${icon_dir}\" && \
+ cp \"$${_PRO_FILE_PWD_}/$${icon_dir}/harbour-$${NAME}.png\" \"$${OUT_PWD}/$${icon_dir}/$${TARGET}.png\"
+ } else {
+ $${icon_target}.files = $${icon_dir}/$${TARGET}.png
}
INSTALLS += $${icon_target}
}
@@ -121,6 +120,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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.tar.bz2/nfc/translations/harbour-logger-nfc-pl.ts
^
|
@@ -11,6 +11,11 @@
<source>Swipe left to configure log categories</source>
<translation>Przesuń w lewo aby skonfigurować kategorie logów</translation>
</message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation>Skopiowane do schowka</translation>
+ </message>
<message id="logger-logpage-pm-clear-log">
<source>Clear log</source>
<translation>Wyczyść logi</translation>
@@ -23,8 +28,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 +56,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>
@@ -108,14 +122,19 @@
<translation>Proszę czekać</translation>
</message>
<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>
+ <source>In-app sharing is not available in 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:openrepos-logger-nfc-1.0.21.tar.bz2/nfc/translations/harbour-logger-nfc-ru.ts
^
|
@@ -11,6 +11,11 @@
<source>Swipe left to configure log categories</source>
<translation>Там справа что-то есть</translation>
</message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation>Скопировано в буфер обмена</translation>
+ </message>
<message id="logger-logpage-pm-clear-log">
<source>Clear log</source>
<translation>Очистить журнал</translation>
@@ -23,8 +28,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">
@@ -108,14 +122,19 @@
<translation>Секундочку</translation>
</message>
<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>
+ <source>In-app sharing is not available in 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>Увы, но в этой версии 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:openrepos-logger-nfc-1.0.21.tar.bz2/nfc/translations/harbour-logger-nfc.ts
^
|
@@ -11,6 +11,11 @@
<source>Swipe left to configure log categories</source>
<translation>Swipe left to configure log categories</translation>
</message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation>Copied to clipboard</translation>
+ </message>
<message id="logger-logpage-pm-clear-log">
<source>Clear log</source>
<translation>Clear log</translation>
@@ -23,8 +28,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">
@@ -108,15 +122,20 @@
<translation>Please wait</translation>
</message>
<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>
+ <source>In-app sharing is not available in 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>In-app sharing is not available for this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder.</translation>
+ <translation>In-app sharing is not available in 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:openrepos-logger-nfc-1.0.21.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:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/ofono.pro
^
|
@@ -20,16 +20,20 @@
QT += dbus
WARNINGS = -Wall -Wno-unused-parameter -Wno-deprecated-declarations
-QMAKE_CXXFLAGS += $$WARNINGS -Wno-psabi
-QMAKE_CFLAGS += $$WARNINGS
+EXTRA_CFLAGS = $$WARNINGS -fvisibility=hidden
+DEFINES += QOFONOEXT_EXPORT=Q_DECL_HIDDEN
+QMAKE_CXXFLAGS += $$EXTRA_CFLAGS
+QMAKE_CFLAGS += $$EXTRA_CFLAGS
CONFIG(debug, debug|release) {
- QMAKE_CXXFLAGS_DEBUG *= -O0
- QMAKE_CFLAGS_DEBUG *= -O0
-}
-
-CONFIG(debug, debug|release) {
- DEFINES += HARBOUR_DEBUG=1
+ QMAKE_CXXFLAGS_DEBUG *= -O0
+ QMAKE_CFLAGS_DEBUG *= -O0
+ DEFINES += DEBUG HARBOUR_DEBUG
+} else {
+ EXTRA_RELEASE_CFLAGS = -fPIC -flto -ffat-lto-objects
+ QMAKE_CXXFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_CFLAGS += $$EXTRA_RELEASE_CFLAGS
+ QMAKE_LFLAGS += -fPIC -flto
}
# Directories
@@ -51,7 +55,7 @@
OTHER_FILES += \
icons/harbour-$${NAME}.svg \
- harbour-$${NAME}.desktop \
+ *.desktop \
qml/*.qml \
privileges/* \
translations/*.ts
@@ -107,7 +111,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,22 +119,19 @@
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) {
icon_target = icon$${s}
icon_dir = icons/$${s}x$${s}
- $${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
openrepos {
- $${icon_target}.extra = cp $${icon_dir}/harbour-$${NAME}.png $$eval($${icon_target}.files)
$${icon_target}.CONFIG += no_check_exist
+ $${icon_target}.files = $${OUT_PWD}/$${icon_dir}/$${TARGET}.png
+ $${icon_target}.extra = mkdir -p \"$${OUT_PWD}/$${icon_dir}\" && \
+ cp \"$${_PRO_FILE_PWD_}/$${icon_dir}/harbour-$${NAME}.png\" \"$${OUT_PWD}/$${icon_dir}/$${TARGET}.png\"
+ } else {
+ $${icon_target}.files = $${icon_dir}/$${TARGET}.png
}
INSTALLS += $${icon_target}
}
@@ -139,6 +139,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:openrepos-logger-nfc-1.0.21.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
|
[-]
[+]
|
Added |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/LICENSE.LGPL
^
|
@@ -0,0 +1,12 @@
+Copyright (C) 2015-2021 Jolla Ltd.
+Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/README
^
|
@@ -1,4 +1,5 @@
qofono-ext
-=========
+==========
-A library for accessing nemomobile specific ofono extensions, and a declarative plugin for it.
+A library for accessing Sailfish OS specific ofono extensions,
+and a declarative plugin for it.
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/libqofonoext.pro
^
|
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
SUBDIRS += src plugin
-OTHER_FILES += rpm/libqofonoext.spec README
+OTHER_FILES += rpm/libqofonoext.spec LICENSE.LGPL README
src.target = src-target
plugin.depends = src-target
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/plugins.qmltypes
^
|
@@ -52,6 +52,7 @@
Property { name: "rssnr"; type: "int"; isReadonly: true }
Property { name: "cqi"; type: "int"; isReadonly: true }
Property { name: "timingAdvance"; type: "int"; isReadonly: true }
+ Property { name: "signalLevelDbm"; type: "int"; isReadonly: true }
Signal {
name: "propertyChanged"
Parameter { name: "name"; type: "string" }
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextdeclarativeplugin.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextdeclarativeplugin.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextmodemlistmodel.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextmodemlistmodel.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextsimlistmodel.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2018 Jolla Ltd.
-** Contact: slava.monich@jolla.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/plugin/qofonoextsimlistmodel.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2018 Jolla Ltd.
-** Contact: slava.monich@jolla.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/rpm/libqofonoext.spec
^
|
@@ -1,19 +1,27 @@
Name: libqofonoext
Summary: A library of Qt bindings for ofono extensions
-Version: 1.0.25
+Version: 1.0.28
Release: 1
-Group: System/Libraries
License: LGPLv2
-URL: https://git.sailfishos.org/mer-core/libqofonoext
+URL: https://github.com/sailfishos/libgofonoext
Source0: %{name}-%{version}.tar.bz2
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
-Requires: libqofono-qt5 >= 0.87
+
+%define libqofono_version 0.101
+
+BuildRequires: pkgconfig
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Quick)
-BuildRequires: pkgconfig(qofono-qt5) >= 0.87
+BuildRequires: pkgconfig(qofono-qt5) >= %{libqofono_version}
+
+# license macro requires rpm >= 4.11
+BuildRequires: pkgconfig(rpm)
+%define license_support %(pkg-config --exists 'rpm >= 4.11'; echo $?)
+
+Requires: libqofono-qt5 >= %{libqofono_version}
+Requires(post): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
%{!?qtc_qmake5:%define qtc_qmake5 %qmake5}
%{!?qtc_make:%define qtc_make make}
@@ -23,7 +31,6 @@
%package declarative
Summary: Declarative plugin for %{name}
-Group: Development/Tools
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}
@@ -32,7 +39,6 @@
%package devel
Summary: Development files for %{name}
-Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}
@@ -57,6 +63,9 @@
%files
%defattr(-,root,root,-)
%{_libdir}/%{name}.so.*
+%if %{license_support} == 0
+%license LICENSE.LGPL
+%endif
%files declarative
%defattr(-,root,root,-)
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoext.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoext_p.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 Jolla Ltd.
-** Contact: slava.monich@jollamobile.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoext_types.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 Jolla Ltd.
-** Contact: slava.monich@jollamobile.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -18,10 +18,12 @@
#include <QtCore>
-#if defined(QOFONOEXT_LIBRARY)
-# define QOFONOEXT_EXPORT Q_DECL_EXPORT
-#else
-# define QOFONOEXT_EXPORT Q_DECL_IMPORT
-#endif
+#ifndef QOFONOEXT_EXPORT
+# if defined(QOFONOEXT_LIBRARY)
+# define QOFONOEXT_EXPORT Q_DECL_EXPORT
+# else
+# define QOFONOEXT_EXPORT Q_DECL_IMPORT
+# endif
+#endif // QOFONOEXT_EXPORT
#endif // QOFONOEXT_TYPES_H
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcell.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -17,9 +17,13 @@
#include "qofonoextcellinfo.h"
#include "qofonoext_p.h"
-static const QString kTypeGsm("gsm");
-static const QString kTypeWcdma("wcdma");
-static const QString kTypeLte("lte");
+namespace {
+ const QString kTypeGsm("gsm");
+ const QString kTypeWcdma("wcdma");
+ const QString kTypeLte("lte");
+
+ const QString kMethodGetAll("GetAll");
+}
#define CELL_PROPERTIES(p) \
p(mcc) p(mnc) p(signalStrength) p(lac) p(cid) p(arfcn) p(bsic) \
@@ -44,10 +48,10 @@
"org.nemomobile.ofono.Cell", OFONO_BUS, aParent) {}
public Q_SLOTS: // METHODS
- QDBusPendingCall GetInterfaceVersion()
- { return asyncCall("GetInterfaceVersion"); }
- QDBusPendingCall GetAll()
- { return asyncCall("GetAll"); }
+ QDBusPendingCall GetAllAsync()
+ { return asyncCall(kMethodGetAll); }
+ QDBusMessage GetAllSync()
+ { return call(kMethodGetAll); }
Q_SIGNALS: // SIGNALS
void PropertyChanged(QString aName, QDBusVariant aValue);
@@ -78,29 +82,45 @@
static const PropertyDesc Properties[PropertyCount];
+ typedef QDBusPendingReply <
+ int, // 0. version
+ QString, // 1. type
+ bool, // 2. registered
+ QVariantMap> // 3. properties
+ GetAllReply;
+
Private(QString aPath, QOfonoExtCell* aParent);
+ void getAllSyncInit();
+
static int value(Private* aThis, Property aProperty);
static Type typeFromString(QString aType);
static Property propertyFromString(QString aProperty);
+ static int getRssiDbm(int aSignalStrength);
+ static int inRange(int aValue, int aRangeMin, int aRangeMax);
private:
- void getAll();
+ QOfonoExtCell* cell();
+ void getAllAsync();
+ bool pathValid();
+ bool updateSignalLevelDbm();
+ void handleGetAllReply(GetAllReply aReply, bool aEmitSignals);
+
+public Q_SLOTS:
+ void updateAllAsync();
private Q_SLOTS:
- void onCellsChanged();
void onGetAllFinished(QDBusPendingCallWatcher* aWatcher);
void onPropertyChanged(QString aName, QDBusVariant aValue);
void onRegisteredChanged(bool aRegistered);
public:
bool iValid;
- bool iFixedPath;
bool iRegistered;
int iProperties[PropertyCount];
+ int iSignalLevelDbm;
QOfonoExtCell::Type iType;
private:
- QOfonoExtCell* iParent;
QDBusPendingCallWatcher* iPendingGetAll;
QSharedPointer<QOfonoExtCellInfo> iCellInfo;
};
@@ -113,11 +133,10 @@
QOfonoExtCell::Private::Private(QString aPath, QOfonoExtCell* aParent) :
QOfonoExtCellProxy(aPath, aParent),
iValid(false),
- iFixedPath(false),
iRegistered(false),
+ iSignalLevelDbm(InvalidValue),
iType(UNKNOWN),
- iParent(aParent),
- iPendingGetAll(NULL)
+ iPendingGetAll(Q_NULLPTR)
{
// Extract modem path from the cell path, e.g. "/ril_0/cell_0" => "/ril_0"
iCellInfo = QOfonoExtCellInfo::instance(aPath.left(aPath.lastIndexOf('/')));
@@ -132,11 +151,15 @@
SLOT(onRegisteredChanged(bool)));
connect(iCellInfo.data(),
SIGNAL(cellsChanged()),
- SLOT(onCellsChanged()));
+ SLOT(updateAllAsync()));
connect(iCellInfo.data(),
SIGNAL(validChanged()),
- SLOT(onCellsChanged()));
- onCellsChanged();
+ SLOT(updateAllAsync()));
+}
+
+inline QOfonoExtCell* QOfonoExtCell::Private::cell()
+{
+ return qobject_cast<QOfonoExtCell*>(parent());
}
QOfonoExtCell::Type QOfonoExtCell::Private::typeFromString(QString aType)
@@ -162,29 +185,56 @@
return aThis ? aThis->iProperties[aProperty] : InvalidValue;
}
-void QOfonoExtCell::Private::onCellsChanged()
+bool QOfonoExtCell::Private::pathValid()
{
- bool pathValid = iCellInfo->valid() && iCellInfo->cells().contains(path());
- if (pathValid) {
+ return iCellInfo->valid() && iCellInfo->cells().contains(path());
+}
+
+void QOfonoExtCell::Private::updateAllAsync()
+{
+ if (pathValid()) {
if (!iValid && !iPendingGetAll) {
- getAll();
+ getAllAsync();
}
} else {
if (iPendingGetAll) {
delete iPendingGetAll;
- iPendingGetAll = NULL;
+ iPendingGetAll = Q_NULLPTR;
}
if (iValid) {
iValid = false;
- Q_EMIT iParent->validChanged();
+ Q_EMIT cell()->validChanged();
}
}
}
-void QOfonoExtCell::Private::getAll()
+int QOfonoExtCell::Private::getRssiDbm(int aValue)
+{
+ // Range for RSSI in ASU (0-31, 99) as defined in TS 27.007 8.69
+ return (aValue < 0 || aValue > 31) ? InvalidValue : (-113 + (2 * aValue));
+}
+
+int QOfonoExtCell::Private::inRange(int aValue, int aMin, int aMax)
+{
+ return (aValue < aMin || aValue > aMax) ? InvalidValue : aValue;
+}
+
+void QOfonoExtCell::Private::getAllSyncInit()
+{
+ if (iPendingGetAll) {
+ delete iPendingGetAll;
+ iPendingGetAll = NULL;
+ }
+ GetAllReply reply(GetAllSync());
+ if (!reply.isError()) {
+ handleGetAllReply(reply, false);
+ }
+}
+
+void QOfonoExtCell::Private::getAllAsync()
{
delete iPendingGetAll;
- iPendingGetAll = new QDBusPendingCallWatcher(GetAll(), this);
+ iPendingGetAll = new QDBusPendingCallWatcher(GetAllAsync(), this);
connect(iPendingGetAll,
SIGNAL(finished(QDBusPendingCallWatcher*)),
SLOT(onGetAllFinished(QDBusPendingCallWatcher*)));
@@ -192,63 +242,77 @@
void QOfonoExtCell::Private::onGetAllFinished(QDBusPendingCallWatcher* aWatcher)
{
- QDBusPendingReply <
- int, // 0. version
- QString, // 1. type
- bool, // 2. registered
- QVariantMap> // 3. properties
- reply(*aWatcher);
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcell.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -44,6 +44,7 @@
Q_PROPERTY(int rssnr READ rssnr NOTIFY rssnrChanged)
Q_PROPERTY(int cqi READ cqi NOTIFY cqiChanged)
Q_PROPERTY(int timingAdvance READ timingAdvance NOTIFY timingAdvanceChanged)
+ Q_PROPERTY(int signalLevelDbm READ signalLevelDbm NOTIFY signalLevelDbmChanged)
Q_ENUMS(Type)
Q_ENUMS(Constants)
@@ -60,7 +61,8 @@
InvalidValue = INT_MAX
};
- explicit QOfonoExtCell(QObject* aParent = NULL);
+ explicit QOfonoExtCell(QObject* aParent = Q_NULLPTR);
+ QOfonoExtCell(QString aPath, bool aMayBlock); // Since 1.0.27
QOfonoExtCell(QString aPath);
~QOfonoExtCell();
@@ -75,6 +77,7 @@
int mcc() const;
int mnc() const;
int signalStrength() const;
+ int signalLevelDbm() const;
// GSM:
int arfcn() const;
@@ -124,6 +127,7 @@
void rssnrChanged();
void cqiChanged();
void timingAdvanceChanged();
+ void signalLevelDbmChanged();
void propertyChanged(QString name, int value);
void removed();
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcellinfo.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -18,6 +18,8 @@
#include <qofonomodem.h>
+static const QString kMethodGetCells("GetCells");
+
typedef QMap<QString,QWeakPointer<QOfonoExtCellInfo> > QOfonoExtCellInfoMap;
Q_GLOBAL_STATIC(QOfonoExtCellInfoMap, sharedInstances)
@@ -39,10 +41,10 @@
OFONO_BUS, aParent) {}
public Q_SLOTS: // METHODS
- QDBusPendingCall GetInterfaceVersion()
- { return asyncCall("GetInterfaceVersion"); }
- QDBusPendingCall GetCells()
- { return asyncCall("GetCells"); }
+ QDBusPendingCall GetCellsAsync()
+ { return asyncCall(kMethodGetCells); }
+ QDBusMessage GetCellsSync()
+ { return call(kMethodGetCells); }
Q_SIGNALS: // SIGNALS
void CellsAdded(QList<QDBusObjectPath> aPaths);
@@ -63,13 +65,18 @@
Private(QOfonoExtCellInfo* aParent);
QString modemPath() const;
void setModemPath(QString aPath);
+ void setModemPathSyncInit(QString aPath);
private:
- void getCells();
+ void getCellsSyncInit();
+ void getCellsAsync();
void invalidate();
+ void setModemPath(QString aPath, QSharedPointer<QOfonoModem> aModem, void (Private::*aGetCells)());
+ void checkInterfacePresence(void (Private::*getCellsFn)());
+ static QStringList getPaths(const QList<QDBusObjectPath> aPaths);
private Q_SLOTS:
- void checkInterfacePresence();
+ void onModemChanged();
void onGetCellsFinished(QDBusPendingCallWatcher* aWatcher);
void onCellsAdded(QList<QDBusObjectPath> aCells);
void onCellsRemoved(QList<QDBusObjectPath> aCells);
@@ -94,38 +101,68 @@
{
}
-QString QOfonoExtCellInfo::Private::modemPath() const
+inline QString QOfonoExtCellInfo::Private::modemPath() const
{
return iModem.isNull() ? QString() : iModem->objectPath();
}
-void QOfonoExtCellInfo::Private::setModemPath(QString aPath)
+inline void QOfonoExtCellInfo::Private::setModemPath(QString aPath)
+{
+ setModemPath(aPath, QOfonoModem::instance(aPath), &Private::getCellsAsync);
+}
+
+inline void QOfonoExtCellInfo::Private::setModemPathSyncInit(QString aPath)
+{
+ setModemPath(aPath, QOfonoModem::instance(aPath, true), &Private::getCellsSyncInit);
+}
+
+void QOfonoExtCellInfo::Private::setModemPath(QString aPath,
+ QSharedPointer<QOfonoModem> aModem, void (Private::*aGetCells)())
{
// Caller has checked the the path has actually changed
invalidate();
if (aPath.isEmpty()) {
- iModem.clear();
+ if (iModem) {
+ iModem->disconnect(this);
+ iModem.clear();
+ }
} else {
if (iModem) iModem->disconnect(this);
- iModem = QOfonoModem::instance(aPath);
+ iModem = aModem;
connect(iModem.data(),
SIGNAL(validChanged(bool)),
- SLOT(checkInterfacePresence()));
+ SLOT(onModemChanged()));
connect(iModem.data(),
SIGNAL(interfacesChanged(QStringList)),
- SLOT(checkInterfacePresence()));
- checkInterfacePresence();
+ SLOT(onModemChanged()));
+ checkInterfacePresence(aGetCells);
}
}
-void QOfonoExtCellInfo::Private::getCells()
+void QOfonoExtCellInfo::Private::getCellsAsync()
{
- connect(new QDBusPendingCallWatcher(iProxy->GetCells(), iProxy),
+ connect(new QDBusPendingCallWatcher(iProxy->GetCellsAsync(), iProxy),
SIGNAL(finished(QDBusPendingCallWatcher*)),
SLOT(onGetCellsFinished(QDBusPendingCallWatcher*)));
}
-void QOfonoExtCellInfo::Private::checkInterfacePresence()
+void QOfonoExtCellInfo::Private::getCellsSyncInit()
+{
+ QDBusPendingReply<QList<QDBusObjectPath> > reply(iProxy->GetCellsSync());
+ if (!reply.isError()) {
+ iCells = getPaths(reply.value());
+ iValid = true;
+ } else {
+ // Repeat call asynchronously on timeout
+ QDBusError error(reply.error());
+ qWarning() << error;
+ if (QOfonoExt::isTimeout(error)) {
+ getCellsAsync();
+ }
+ }
+}
+
+void QOfonoExtCellInfo::Private::checkInterfacePresence(void (Private::*aGetCells)())
{
if (iModem && iModem->isValid() &&
iModem->interfaces().contains(QOfonoExtCellInfoProxy::INTERFACE)) {
@@ -138,7 +175,7 @@
connect(iProxy,
SIGNAL(CellsRemoved(QList<QDBusObjectPath>)),
SLOT(onCellsRemoved(QList<QDBusObjectPath>)));
- getCells();
+ (this->*aGetCells)();
} else {
invalidate();
}
@@ -160,22 +197,29 @@
}
}
+QStringList QOfonoExtCellInfo::Private::getPaths(const QList<QDBusObjectPath> aPaths)
+{
+ QStringList list;
+ const int n = aPaths.count();
+ for (int i = 0; i < n; i++) {
+ list.append(aPaths.at(i).path());
+ }
+ list.sort();
+ return list;
+}
+
void QOfonoExtCellInfo::Private::onGetCellsFinished(QDBusPendingCallWatcher* aWatcher)
{
QDBusPendingReply<QList<QDBusObjectPath> > reply(*aWatcher);
if (reply.isError()) {
// Repeat the call on timeout
- qWarning() << reply.error();
- if (QOfonoExt::isTimeout(reply.error())) {
- getCells();
+ QDBusError error(reply.error());
+ qWarning() << error;
+ if (QOfonoExt::isTimeout(error)) {
+ getCellsAsync();
}
} else {
- QList<QDBusObjectPath> pathList = reply.value();
- QStringList list;
- for (int i=0; i<pathList.count(); i++) {
- list.append(pathList.at(i).path());
- }
- list.sort();
+ const QStringList list(getPaths(reply.value()));
if (iCells != list) {
iCells = list;
Q_EMIT iParent->cellsChanged();
@@ -188,6 +232,11 @@
aWatcher->deleteLater();
}
+void QOfonoExtCellInfo::Private::onModemChanged()
+{
+ checkInterfacePresence(&Private::getCellsAsync);
+}
+
void QOfonoExtCellInfo::Private::onCellsAdded(QList<QDBusObjectPath> aCells)
{
QStringList cells;
@@ -230,17 +279,35 @@
{
}
+QOfonoExtCellInfo::QOfonoExtCellInfo(QString aModemPath, QObject* aParent) : // Since 1.0.27
+ QObject(aParent),
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcellinfo.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
@@ -26,11 +26,13 @@
Q_PROPERTY(QStringList cells READ cells NOTIFY cellsChanged)
public:
- explicit QOfonoExtCellInfo(QObject* aParent = NULL);
+ explicit QOfonoExtCellInfo(QObject* aParent = Q_NULLPTR);
+ QOfonoExtCellInfo(QString aModemPath, QObject* aParent = Q_NULLPTR); // Blocks (since 1.0.27)
~QOfonoExtCellInfo();
// Shared instance(s) for C++ use
static QSharedPointer<QOfonoExtCellInfo> instance(QString aModemPath);
+ static QSharedPointer<QOfonoExtCellInfo> instance(QString aModemPath, bool aMayBlock); // Since 1.0.27
QString modemPath() const;
void setModemPath(QString aModemPath);
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcellwatcher.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextcellwatcher.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextmodemmanager.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextmodemmanager.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015-2017 Jolla Ltd.
-** Contact: Slava Monich <slava.monich@jolla.com>
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextsiminfo.cpp
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016-2017 Jolla Ltd.
-** Contact: slava.monich@jolla.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/qofonoextsiminfo.h
^
|
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2016 Jolla Ltd.
-** Contact: slava.monich@jolla.com
+** Copyright (C) 2015-2021 Jolla Ltd.
+** Copyright (C) 2015-2021 Slava Monich <slava.monich@jolla.com>
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/src/libqofonoext/src/version.pri
^
|
@@ -1 +1 @@
-VERSION = 1.0.25
+VERSION = 1.0.28
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.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);
}
@@ -257,6 +262,8 @@
packages.append("libgrilio");
packages.append("libgrilio-binder");
packages.append("ofono");
+ packages.append("ofono-binder-plugin");
+ packages.append("ofono-ril-plugin");
packages.append("ofono-ril-binder-plugin");
return OfonoLogger(&argc, argv, packages).run();
}
|
[-]
[+]
|
Changed |
_service:tar_git:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/translations/harbour-logger-ofono-nl.ts
^
|
@@ -9,7 +9,12 @@
</message>
<message id="logger-mainpage-swipe-left-hint">
<source>Swipe left to configure log categories</source>
- <translation>Swipe left to configure log categories</translation>
+ <translation type="unfinished">Veeg naar links om logcategorieën te configureren</translation>
+ </message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation type="unfinished">Gekopieerd naar het klembord</translation>
</message>
<message id="ofono-logger-pm-fix-mobile-data">
<source>Fix mobile data</source>
@@ -33,8 +38,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">
@@ -118,14 +130,19 @@
<translation>Even geduld</translation>
</message>
<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>
+ <source>In-app sharing is not available in 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">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:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/translations/harbour-logger-ofono-pl.ts
^
|
@@ -11,6 +11,11 @@
<source>Swipe left to configure log categories</source>
<translation>Przesuń w lewo aby skonfigurować kategorie logów</translation>
</message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation>Skopiowane do schowka</translation>
+ </message>
<message id="ofono-logger-pm-fix-mobile-data">
<source>Fix mobile data</source>
<extracomment>Pull-down menu item</extracomment>
@@ -33,8 +38,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">
@@ -118,14 +132,19 @@
<translation>Proszę czekać</translation>
</message>
<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>
+ <source>In-app sharing is not available in 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>
</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:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/translations/harbour-logger-ofono-ru.ts
^
|
@@ -11,6 +11,11 @@
<source>Swipe left to configure log categories</source>
<translation>Там справа что-то есть</translation>
</message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation>Скопировано в буфер обмена</translation>
+ </message>
<message id="ofono-logger-pm-fix-mobile-data">
<source>Fix mobile data</source>
<extracomment>Pull-down menu item</extracomment>
@@ -33,8 +38,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">
@@ -118,14 +132,19 @@
<translation>Секундочку</translation>
</message>
<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>
+ <source>In-app sharing is not available in 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>Увы, но в этой версии 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:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/translations/harbour-logger-ofono-sv.ts
^
|
@@ -11,6 +11,11 @@
<source>Swipe left to configure log categories</source>
<translation>Svep vänster för att konfigurera loggkategorier</translation>
</message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation>Kopierat till urklipp</translation>
+ </message>
<message id="ofono-logger-pm-fix-mobile-data">
<source>Fix mobile data</source>
<extracomment>Pull-down menu item</extracomment>
@@ -33,8 +38,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">
@@ -118,14 +130,19 @@
<translation>Vänta</translation>
</message>
<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>
+ <source>In-app sharing is not available in 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">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:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/translations/harbour-logger-ofono-zh_CN.ts
^
|
@@ -11,6 +11,11 @@
<source>Swipe left to configure log categories</source>
<translation>向左滑动即可配置日志分类</translation>
</message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation>复制到剪贴板</translation>
+ </message>
<message id="ofono-logger-pm-fix-mobile-data">
<source>Fix mobile data</source>
<extracomment>Pull-down menu item</extracomment>
@@ -33,8 +38,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">
@@ -118,14 +130,19 @@
<translation>等稍等</translation>
</message>
<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>
+ <source>In-app sharing is not available in 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">此版本的 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:openrepos-logger-nfc-1.0.21.tar.bz2/ofono/translations/harbour-logger-ofono.ts
^
|
@@ -11,6 +11,11 @@
<source>Swipe left to configure log categories</source>
<translation>Swipe left to configure log categories</translation>
</message>
+ <message id="logger-notification-copied_to_clipboard">
+ <source>Copied to clipboard</source>
+ <extracomment>Pop-up notification</extracomment>
+ <translation>Copied to clipboard</translation>
+ </message>
<message id="ofono-logger-pm-fix-mobile-data">
<source>Fix mobile data</source>
<extracomment>Pull-down menu item</extracomment>
@@ -33,8 +38,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">
@@ -118,15 +132,20 @@
<translation>Please wait</translation>
</message>
<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>
+ <source>In-app sharing is not available in 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>In-app sharing is not available for this version of Sailfish OS. Use the pulley menu to save tarball to the documents folder.</translation>
+ <translation>In-app sharing is not available in 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>
|