[-]
[+]
|
Changed |
_service:tar_git:glacier-settings.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/nemomobile-ux/glacier-settings.git</param>
<param name="branch">master</param>
- <param name="revision">e53f7d9baf37417e5563214fc5784620c40b5f48</param>
+ <param name="revision">5638974f811704107cdf6d9b8d27abcbcb619caf</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Deleted |
_service:tar_git:glacier-settings-0.0.10.tar.bz2/src/models/settingsproxymodel.cpp
^
|
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2017 Chupligin Sergey <neochapay@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#include "settingsproxymodel.h"
-#include "settingsmodel.h"
-
-#include <QSortFilterProxyModel>
-#include <QDebug>
-
-SettingsProxyModel::SettingsProxyModel(QObject *parent) :
- QSortFilterProxyModel(parent)
-{
- setSortRole(Qt::UserRole);
- setDynamicSortFilter(true);
-}
-
-QObject *SettingsProxyModel::model()
-{
- return sourceModel();
-}
-
-void SettingsProxyModel::setModel(QObject *model)
-{
- if(sourceModel() != model)
- {
- setSourceModel(qobject_cast<QAbstractListModel*>(model));
- emit modelChanged();
-
- sort(0);
- }
-}
-
-bool SettingsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
-{
- QJsonObject leftData = qobject_cast<SettingsModel*>(sourceModel())->data(left);
- QJsonObject rightData = qobject_cast<SettingsModel*>(sourceModel())->data(right);
-
- QString leftCategory = leftData.value("category").toString();
- QString rightCategory = rightData.value("category").toString();
-
- if(leftCategory == rightCategory)
- {
- QString leftName = leftData.value("name").toString();
- QString rightName = rightData.value("name").toString();
-
- return leftName > rightName;
- }
- return SettingsModel::compareCategories(leftCategory,rightCategory) > 0;
-}
-
-
|
[-]
[+]
|
Deleted |
_service:tar_git:glacier-settings-0.0.10.tar.bz2/src/models/settingsproxymodel.h
^
|
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2017 Chupligin Sergey <neochapay@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-#ifndef SETTINGSPROXYMODEL_H
-#define SETTINGSPROXYMODEL_H
-
-#include <QObject>
-#include <QSortFilterProxyModel>
-
-#include "settingsmodel.h"
-
-class SettingsProxyModel : public QSortFilterProxyModel
-{
- Q_OBJECT
- Q_PROPERTY(QObject* model READ model WRITE setModel NOTIFY modelChanged)
-public:
- explicit SettingsProxyModel(QObject *parent = 0);
- QObject* model();
- void setModel(QObject* model);
-
-signals:
- void modelChanged();
-
-private:
-
-protected:
- bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
-};
-
-#endif // SETTINGSPROXYMODEL_H
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/glacier-settings.desktop
^
|
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Settings
-Exec=/usr/bin/invoker --type=nemomobile -s glacier-settings
+Exec=/usr/bin/invoker --type=generic -s glacier-settings
Icon=/usr/share/glacier-settings/glacier-settings.png
X-Desktop-File-Install-Version=0.20
Name[ru]=Настройки
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/glacier-settings.privileges
^
|
@@ -1,2 +1,2 @@
# Tells invoker to run glacier-settings as nemo:privileged
-/usr/bin/glacier-settings,
+/usr/bin/glacier-settings,acehilmnprsu
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/glacier-settings.pro
^
|
@@ -7,15 +7,17 @@
SOURCES += \
src/main.cpp \
src/models/settingsmodel.cpp \
+ src/models/satellitemodel.cpp \
src/models/imagesmodel.cpp \
- src/models/settingsproxymodel.cpp
+
HEADERS += \
src/models/settingsmodel.h \
- src/models/imagesmodel.h \
- src/models/settingsproxymodel.h
+ src/models/satellitemodel.h \
+ src/models/imagesmodel.h
+
-QT += qml quick
+QT += qml quick positioning
OTHER_FILES +=rpm/glacier-settings.spec \
translations/*.ts \
@@ -62,6 +64,10 @@
qml/plugins/display/display.svg
displayplugin.path = /usr/share/glacier-settings/qml/plugins/display
+datetimeplugin.files = qml/plugins/datetime/*.qml \
+ qml/plugins/datetime/*.svg
+datetimeplugin.path = /usr/share/glacier-settings/qml/plugins/datetime
+
wifiplugin.files = qml/plugins/wifi/wifi.qml\
qml/plugins/wifi/WifiSettings.qml\
qml/plugins/wifi/WifiStatus.qml\
@@ -92,6 +98,28 @@
keyboardplugin.path = /usr/share/glacier-settings/qml/plugins/keyboard
+nfcplugin.files = qml/plugins/nfc/nfc.qml \
+ qml/plugins/nfc/nfc.svg
+
+nfcplugin.path = /usr/share/glacier-settings/qml/plugins/nfc
+
+usbplugin.files = qml/plugins/usb/usb.qml \
+ qml/plugins/usb/usb.svg
+
+usbplugin.path = /usr/share/glacier-settings/qml/plugins/usb
+
+devicelockplugin.files = qml/plugins/devicelock/devicelock.qml \
+ qml/plugins/devicelock/DeviceLockPad.qml\
+ qml/plugins/devicelock/devicelock.svg
+
+devicelockplugin.path = /usr/share/glacier-settings/qml/plugins/devicelock
+
+
+mobileplugin.files = qml/plugins/mobile/mobile.qml \
+ qml/plugins/mobile/mobile.svg
+
+mobileplugin.path = /usr/share/glacier-settings/qml/plugins/mobile
+
languageconfigs.files = configs/supported-languages/*
languageconfigs.path = /usr/share/jolla-supported-languages/
@@ -99,11 +127,16 @@
qml/plugins/bluez4/bluez4.json \
qml/plugins/developermode/developermode.json \
qml/plugins/display/display.json \
+ qml/plugins/datetime/datetime.json \
qml/plugins/wifi/wifi.json \
- qml/plugins/gps/gps.json\
- qml/plugins/language/language.json\
- qml/plugins/about/about.json\
- qml/plugins/keyboard/keyboard.json
+ qml/plugins/gps/gps.json \
+ qml/plugins/nfc/nfc.json \
+ qml/plugins/language/language.json \
+ qml/plugins/about/about.json \
+ qml/plugins/keyboard/keyboard.json \
+ qml/plugins/usb/usb.json \
+ qml/plugins/devicelock/devicelock.json \
+ qml/plugins/mobile/mobile.json
pluginconfigs.path = /usr/share/glacier-settings/plugins
@@ -119,6 +152,7 @@
bluez4plugin \
developermodeplugin \
displayplugin \
+ datetimeplugin \
wifiplugin \
gpsplugin\
languageplugin \
@@ -126,7 +160,11 @@
languageconfigs\
icon \
keyboardplugin \
- service
+ usbplugin \
+ devicelockplugin \
+ service \
+ mobileplugin \
+ nfcplugin
DISTFILES += \
qml/plugins/example/example.qml \
@@ -137,6 +175,7 @@
qml/plugins/developermode/developermode.json \
qml/plugins/display/display.qml \
qml/plugins/display/display.json \
+ qml/plugins/nfc.qml \
qml/plugins/wifi/wifi.qml \
qml/plugins/wifi/wifi.json \
qml/plugins/wifi/WifiSettings.qml \
@@ -160,4 +199,16 @@
qml/plugins/wifi/SavedStatus.qml \
qml/plugins/wifi/NetworkDelegate.qml \
qml/components/SettingsService.qml \
- data/org.nemomobile.qmlsettings.service
+ data/org.nemomobile.qmlsettings.service \
+ qml/plugins/datetime/datetime.qml \
+ qml/plugins/datetime/datetime.json \
+ qml/plugins/datetime/datetime.svg \
+ qml/plugins/usb/usb.json \
+ qml/plugins/usb/usb.qml \
+ qml/plugins/usb/usb.svg \
+ qml/plugins/mobile/mobile.qml \
+ qml/plugins/mobile/mobile.json \
+ qml/plugins/mobile/mobile.svg \
+ qml/plugins/nfc/nfc.qml \
+ qml/plugins/nfc/nfc.json \
+ qml/plugins/nfc/nfc.svg
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/components/QuickSettings.qml
^
|
@@ -144,6 +144,7 @@
QuickButton{
id: bluetoothButton
activated: bluetoothModel.powered && _adapter && _adapter.powered
+ visible: wifiNetworkingModel.available
icon: "../img/bluetooth.svg"
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/glacier-settings.qml
^
|
@@ -32,11 +32,9 @@
ApplicationWindow{
id: main
- SettingsProxyModel{
+ SettingsModel{
id: settingsModel
- model: SettingsModel{
- path: "/usr/share/glacier-settings/plugins/"
- }
+ path: "/usr/share/glacier-settings/plugins/"
}
SettingsService{
@@ -59,37 +57,84 @@
height: parent.height-tools.height
width: parent.width
- contentHeight: quickSettings.height+view.height
+ contentHeight: content.height
- QuickSettings{
- id: quickSettings
- anchors{
- top: parent.top
- topMargin: size.dp(20)
- }
- }
-
- ListView {
- id: view
+ Column {
+ id: content
width: parent.width
- height: view.contentHeight
+ spacing: size.dp(20)
- anchors{
- top: quickSettings.bottom
- topMargin: size.dp(20)
+ QuickSettings{
+ id: quickSettings
}
- clip: true
- model: settingsModel
- delegate: ListViewItemWithActions {
- label: title
- icon: "/usr/share/glacier-settings/qml/plugins/"+path+"/"+path+".svg"
- onClicked:{
- console.log(Qt.createComponent(Qt.resolvedUrl("plugins/"+path+"/"+path+".qml")).errorString())
- pageStack.push(Qt.resolvedUrl("plugins/"+path+"/"+path+".qml"))
+ Repeater {
+ id: view
+
+ model: settingsModel
+ delegate: Rectangle {
+ id: settingsListDelegate
+ height: sectionHeading.height+flow.height
+ width: mainArea.width
+ color: Theme.backgroundColor
+
+ Rectangle {
+ id: sectionHeading
+ width: parent.width
+ height: Theme.itemHeightMedium
+ color: Theme.backgroundColor
+
+ Text {
+ id: sectionText
+ text: title
+ font.capitalization: Font.AllUppercase
+ font.pixelSize: Theme.fontSizeSmall
+ color: Theme.textColor
+ anchors{
+ left: parent.left
+ leftMargin: Theme.itemSpacingSmall
+ verticalCenter: parent.verticalCenter
+ }
+ }
+
+ Rectangle{
+ id: line
+ height: size.ratio(1)
+ color: Theme.textColor
+ width: content.width-sectionText.width-Theme.itemHeightExtraSmall
+ anchors{
+ left: sectionText.right
+ leftMargin: Theme.itemSpacingSmall
+ verticalCenter: sectionText.verticalCenter
+ }
+ }
+ }
+
+ Flow{
+ id: flow
+ width: parent.width
+ anchors.top: sectionHeading.bottom
+ Repeater{
+ id: list
+ width: parent.width
+ height: isUiLandscape ?
+ Theme.itemHeightMedium*Math.ceil(items.length/2) :
+ Theme.itemHeightMedium*items.length
+ model: items
+
+ delegate: ListViewItemWithActions {
+ height: Theme.itemHeightMedium
+ width: isUiLandscape ? parent.width/2 : parent.width
+ label: modelData.title
+ icon: "/usr/share/glacier-settings/qml/plugins/"+modelData.path+"/"+modelData.path+".svg"
+ onClicked:{
+ pageStack.push(Qt.resolvedUrl("plugins/"+modelData.path+"/"+modelData.path+".qml"))
+ }
+ }
+ }
+ }
}
}
- section.property: "category"
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/bluez4/bluez4.qml
^
|
@@ -35,15 +35,40 @@
headerTools: HeaderToolsLayout {
id: header
showBackButton: true;
- title: qsTr("Bluetooth settings")
+ title: qsTr("Bluetooth")
}
- property QtObject _adapter: _bluetoothManager && _bluetoothManager.usableAdapter
property QtObject _bluetoothManager: BluezQt.Manager
+ property QtObject _adapter: _bluetoothManager.usableAdapter
TechnologyModel {
id: bluetoothModel
name: "bluetooth"
+
+ onPoweredChanged: {
+ bluetoothTimer.stop();
+ columnCheckBox.indeterminate = false
+ columnCheckBox.checked = bluetoothModel.powered
+
+ if(powered) {
+ _adapter.startDiscovery()
+ }
+ }
+ }
+
+ BluezQt.DevicesModel {
+ id: bluetoothDevicesModel
+ }
+
+
+ Timer{
+ id: bluetoothTimer
+ interval: 5000
+ repeat: false
+ onTriggered: {
+ columnCheckBox.indeterminate = false
+ columnCheckBox.checked = bluetoothModel.powered
+ }
}
SettingsColumn{
@@ -74,67 +99,49 @@
verticalCenter: nameLabel.verticalCenter
}
onClicked: {
- bluetoothModel.setPowered(columnCheckBox.checked)
+ bluetoothModel.powered = columnCheckBox.checked
+ columnCheckBox.indeterminate = true
+ bluetoothTimer.start()
}
}
}
- Rectangle {
- id: bluetoothName
- width: parent.width
- height: childrenRect.height
-
- visible: bluetoothModel.powered
-
- color: "transparent"
-
- Label {
- id: bluetoothNameLabel
- text: qsTr("Device name");
- anchors {
- left: parent.left
- }
- }
+ Label {
+ id: bluetoothNameLabel
+ text: qsTr("Device name");
+ font.bold: true
+ }
- TextField {
- id: bluetoothNameInput
- text: _adapter.name
+ TextField {
+ id: bluetoothNameInput
+ text: _adapter.name
- font.pointSize: Theme.label.pointSize
+ width: parent.width
- anchors {
- top: bluetoothNameLabel.bottom
- topMargin: size.dp(20)
- left: parent.left
- }
+ font.pixelSize: Theme.fontSizeLarge
- onEditingFinished: {
- if (_adapter) {
- var newName = text.length ? text : Ssu.DeviceInfo.displayName(Ssu.DeviceInfo.DeviceModel);
- if (_adapter.name != newName) {
- _adapter.name = newName
- } else {
- text = _adapter.name
- }
+ onEditingFinished: {
+ if (_adapter) {
+ var newName = text.length ? text : Ssu.DeviceInfo.displayName(Ssu.DeviceInfo.DeviceModel);
+ if (_adapter.name != newName) {
+ _adapter.name = newName
+ } else {
+ text = _adapter.name
}
}
}
}
- Rectangle {
- id: visible
+ Rectangle{
width: parent.width
height: childrenRect.height
-
- visible: bluetoothModel.powered
-
color: "transparent"
- Label {
+ Label{
id: visibilityLabel
text: qsTr("Visibility")
- anchors {
+ anchors{
left: parent.left
}
wrapMode: Text.Wrap
@@ -143,11 +150,11 @@
CheckBox {
id: visibilityCheckBox
-
- anchors {
- right: visible.right
+ checked: bluetoothModel.powered
+ anchors{
+ right: parent.right
+ verticalCenter: visibilityLabel.verticalCenter
}
-
onClicked: {
if (!_adapter) {
return;
@@ -156,5 +163,42 @@
}
}
}
+
+ Rectangle{
+ width: parent.width
+ height: childrenRect.height
+ color: "transparent"
+
+ Text{
+ id: aviableLabel
+ text: qsTr("Aviable devices:")
+ color: Theme.textColor
+ font.pixelSize: Theme.fontSizeLarge
+
+ anchors{
+ left: parent.left
+ }
+ }
+ }
+
+ Button{
+ id: startDiscovery
+ text: (_adapter.discovering) ? qsTr("Stop search") : qsTr("Search discovery")
+
+ onClicked: {
+ if (_adapter.discovering) {
+ _adapter.stopDiscovery()
+ } else {
+ _adapter.startDiscovery()
+ }
+ }
+ }
+ }
+
+ Connections{
+ target: _adapter
+ onDeviceFound: {
+ console.log("*** Remote device found:" + device)
+ }
}
}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/datetime/datetime.json
^
|
@@ -0,0 +1,5 @@
+{
+ "path": "datetime",
+ "category": "Personalization",
+ "title": "Date and time"
+}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/datetime/datetime.qml
^
|
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2018-2019 Chupligin Sergey <neochapay@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+import QtQuick 2.6
+
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Nemo 1.0
+
+import org.nemomobile.systemsettings 1.0
+import org.nemomobile.configuration 1.0
+
+import "../../components"
+
+Page {
+ id: listViewPage
+
+ property date currentDate: new Date()
+
+ headerTools: HeaderToolsLayout {
+ showBackButton: true;
+ title: qsTr("Date and time")
+ }
+
+ property var monthNames: ["January", "February", "March", "April", "May", "June",
+ "July", "August", "September", "October", "November", "December"
+ ]
+
+ DateTimeSettings{
+ id: dateTimeSettings
+ }
+
+ ListModel{
+ id: timeFormatModel
+ ListElement{name: qsTr("12h")}
+ ListElement{name: qsTr("24h")}
+ }
+
+ ConfigurationValue {
+ id: timeFormat
+ key: "/home/glacier/timeFormat"
+ defaultValue: 1 //24H
+ }
+
+ Component.onCompleted: {
+ timeFormatRoller.currentIndex = timeFormat.value
+ }
+
+
+ SettingsColumn{
+ Row{
+ id: dateView
+ width: parent.width
+
+ TimePicker{
+ id: timePicker
+ height: width
+ width: listViewPage.width/2
+
+ hours: currentDate.getHours()
+ minutes: currentDate.getMinutes()
+ }
+
+ Column{
+ id: dateLabel
+ width: parent.width/2
+
+ Text{
+ id: dayLabel
+ text: currentDate.getDate()
+ width: parent.width
+ height: timePicker.height/3
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: Theme.fontSizeExtraLarge
+ color: Theme.accentColor
+ }
+
+ Text {
+ id: monthLabel
+ text: monthNames[currentDate.getMonth()]
+ width: parent.width
+ height: timePicker.height/3
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ font.pixelSize: Theme.fontSizeExtraLarge
+ color: Theme.accentColor
+ }
+
+ Text {
+ id: yearLabel
+ text: currentDate.getFullYear()
+ width: parent.width
+ height: timePicker.height/3
+ verticalAlignment: Text.AlignVCenter
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: Theme.fontSizeExtraLarge
+ color: Theme.accentColor
+ }
+ }
+ }
+
+ GlacierRoller {
+ id: timeFormatRoller
+ width: parent.width
+
+ clip: true
+ model: timeFormatModel
+ label: qsTr("Time format")
+ delegate:GlacierRollerItem{
+ Text{
+ height: timeFormatRoller.itemHeight
+ verticalAlignment: Text.AlignVCenter
+ text: name
+ color: Theme.textColor
+ font.pixelSize: Theme.fontSizeMedium
+ font.bold: (timeFormatRoller.activated && timeFormatRoller.currentIndex === index)
+ }
+ }
+
+ onCurrentIndexChanged: {
+ if(timeFormat.value != currentIndex) {
+ timeFormat.value = currentIndex
+ }
+ }
+
+ }
+
+ CheckBox{
+ id: automaticTimeUpdateCheckbox
+ text: qsTr("Automatic time update")
+ checked: dateTimeSettings.automaticTimeUpdate
+ onClicked:{
+ dateTimeSettings.automaticTimeUpdate = automaticTimeUpdateCheckbox.checked
+ }
+ }
+
+ CheckBox{
+ id: automaticTimezoneUpdateCheckbox
+ text: qsTr("Automatic time zone update")
+ checked: dateTimeSettings.automaticTimezoneUpdate
+ onClicked:{
+ dateTimeSettings.automaticTimezoneUpdate = automaticTimezoneUpdateCheckbox.checked
+ }
+ }
+
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/datetime/datetime.svg
^
|
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M192 1664h288v-288h-288v288zm352 0h320v-288h-320v288zm-352-352h288v-320h-288v320zm352 0h320v-320h-320v320zm-352-384h288v-288h-288v288zm736 736h320v-288h-320v288zm-384-736h320v-288h-320v288zm768 736h288v-288h-288v288zm-384-352h320v-320h-320v320zm-352-864v-288q0-13-9.5-22.5t-22.5-9.5h-64q-13 0-22.5 9.5t-9.5 22.5v288q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5-9.5t9.5-22.5zm736 864h288v-320h-288v320zm-384-384h320v-288h-320v288zm384 0h288v-288h-288v288zm32-480v-288q0-13-9.5-22.5t-22.5-9.5h-64q-13 0-22.5 9.5t-9.5 22.5v288q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5-9.5t9.5-22.5zm384-64v1280q0 52-38 90t-90 38h-1408q-52 0-90-38t-38-90v-1280q0-52 38-90t90-38h128v-96q0-66 47-113t113-47h64q66 0 113 47t47 113v96h384v-96q0-66 47-113t113-47h64q66 0 113 47t47 113v96h128q52 0 90 38t38 90z" fill="#fff"/></svg>
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/devicelock/DeviceLockPad.qml
^
|
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2019 Chupligin Sergey <neochapay@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+import QtQuick 2.6
+
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Nemo 1.0
+import QtQuick.Controls.Styles.Nemo 1.0
+
+import org.nemomobile.systemsettings 1.0
+import org.nemomobile.devicelock 1.0
+
+import "../../components"
+
+Page {
+ id: deviceLockPadPage
+
+ property AuthenticationInput authenticationInput
+
+ headerTools: HeaderToolsLayout {
+ showBackButton: true;
+ title: qsTr("Enther code")
+ }
+
+ SettingsColumn {
+ anchors.fill: parent
+
+ TextField {
+ id: lockCodeField
+
+ width: parent.width
+
+ readOnly: true
+ echoMode: TextInput.PasswordEchoOnEdit
+ font.pixelSize: Theme.fontSizeMedium
+ }
+
+ Grid {
+ id: codePad
+ height: parent.height
+
+ columns: 3
+ Repeater {
+ model: ["1","2","3","4","5","6","7","8","9","<","0","OK"]
+ delegate:
+ Rectangle {
+ id:button
+ width: root.width/3 > root.height/4 ? root.height/4 : root.width/3
+ height: width
+
+ color: "transparent"
+
+ Text {
+ id: numLabel
+ text: modelData
+ font.pixelSize: Theme.fontSizeLarge
+ anchors.centerIn: parent
+ color: "white"
+ }
+
+ MouseArea{
+ anchors.fill: parent
+
+ onClicked: {
+ if (numLabel.text !== "<" && numLabel.text !== "OK") {
+ lockCodeField.insert(lockCodeField.cursorPosition, numLabel.text)
+ } else {
+ if (numLabel.text === "OK") {
+ authenticationInput.enterSecurityCode(lockCodeField.text)
+
+ } else if (numLabel.text === "<"){
+ lockCodeField.text = lockCodeField.text.slice(0, -1)
+ }
+ }
+ }
+
+ onPressAndHold: {
+ if (numLabel.text === "<"){
+ lockCodeField.text = ""
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Connections {
+ target: authenticationInput
+
+ onFeedback: displayFeedback(feedback, data)
+ onError: displayError(error)
+ }
+
+ function displayFeedback(feedback, data) {
+
+ switch(feedback) {
+
+ case AuthenticationInput.EnterSecurityCode:
+ console.log("Enter security code")
+ break
+
+ case AuthenticationInput.IncorrectSecurityCode:
+ console.log("Incorrect code")
+ if(authenticationInput.maximumAttempts !== -1) {
+ console.log("("+(authenticationInput.maximumAttempts-data.attemptsRemaining)+
+ "/"+authenticationInput.maximumAttempts+")")
+ }
+ break
+
+ case AuthenticationInput.TemporarilyLocked:
+ console.log("Temporarily locked")
+ }
+ }
+
+ function displayError(error) {
+ console.log("displayError "+error)
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/devicelock/devicelock.json
^
|
@@ -0,0 +1,5 @@
+{
+ "path": "devicelock",
+ "category": "Security",
+ "title": "Device lock"
+}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/devicelock/devicelock.qml
^
|
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2019 Chupligin Sergey <neochapay@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+import QtQuick 2.6
+
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Nemo 1.0
+import QtQuick.Controls.Styles.Nemo 1.0
+
+import org.nemomobile.systemsettings 1.0
+import org.nemomobile.devicelock 1.0
+
+import "../../components"
+
+Page {
+ id: deviceLockPage
+
+ property var token: undefined
+
+ headerTools: HeaderToolsLayout {
+ showBackButton: true;
+ title: qsTr("Device lock")
+ }
+
+ DeviceLockSettings{
+ id: lockSettings
+
+ authorization {
+ onChallengeExpired: {
+ console.log("EXP")
+ }
+ }
+ }
+
+ SecurityCodeSettings{
+ id: secCodeSettings
+
+ onChanged: {
+ token = authenticationToken
+ }
+ }
+
+ AuthenticationInput{
+ id: authInput
+
+ active: true
+ registered: true
+
+ onAuthenticationStarted: {
+ console.log("onAuthenticationStarted")
+ reset()
+ authInput.feedback(feedback, data)
+ }
+
+ onAuthenticationUnavailable: {
+ console.log("onAuthenticationUnavailable")
+ reset()
+ authInput.error(error, data)
+ }
+
+ onError: {
+ console.log("Error")
+ }
+
+ onAuthenticationEnded: {
+ console.log("Ended")
+ }
+
+ }
+
+ Component.onCompleted: {
+ authInput.authorize()
+ }
+
+ ListModel{
+ id: autoLockModel
+ ListElement{
+ name: qsTr("Newer")
+ time: -1
+ }
+ ListElement{
+ name: qsTr("Without delay")
+ time: 0
+ }
+ ListElement{
+ name: qsTr("1 min")
+ time: 1
+ }
+ ListElement{
+ name: qsTr("5 min")
+ time: 5
+ }
+ ListElement{
+ name: qsTr("10 min")
+ time: 10
+ }
+ ListElement{
+ name: qsTr("15 min")
+ time: 15
+ }
+ ListElement{
+ name: qsTr("30 min")
+ time: 30
+ }
+ ListElement{
+ name: qsTr("1 hour")
+ time: 60
+ }
+ }
+
+ SettingsColumn{
+ id: lockColumn
+
+ Rectangle{
+ id: useLockArea
+ width: parent.width
+ height: childrenRect.height
+ color: "transparent"
+
+ Label{
+ id: useLockLabel
+ text: qsTr("Enable device lock")
+ anchors{
+ left: parent.left
+ }
+ wrapMode: Text.Wrap
+ }
+
+ CheckBox {
+ id: useLockCheckBox
+ checked: false //fix it!
+ anchors{
+ right: parent.right
+ verticalCenter: useLockLabel.verticalCenter
+ }
+ onClicked:{
+ }
+ }
+ }
+
+ Rectangle{
+ id: showNotifyArea
+ width: parent.width
+ height: childrenRect.height
+ color: "transparent"
+
+ Label{
+ id: showNotifyLabel
+ text: qsTr("Show notify when device locked")
+ anchors{
+ left: parent.left
+ }
+ width: parent.width-showNotifyCheckBox.width
+ wrapMode: Text.Wrap
+ }
+
+ CheckBox {
+ id: showNotifyCheckBox
+ checked: lockSettings.showNotifications
+ anchors{
+ right: parent.right
+ verticalCenter: showNotifyLabel.verticalCenter
+ }
+ onClicked:{
+ lockSettings.showNotifications = showNotifyCheckBox.checked
+ }
+ }
+ }
+
+ GlacierRoller {
+ id: autoLockRoller
+ width: parent.width
+
+ clip: true
+ model: autoLockModel
+ label: qsTr("Auto lock device")
+
+ delegate: GlacierRollerItem{
+ Text{
+ height: autoLockRoller.itemHeight
+ verticalAlignment: Text.AlignVCenter
+ text: name
+ color: Theme.textColor
+ font.pixelSize: Theme.fontSizeMedium
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/devicelock/devicelock.svg
^
|
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z"/></svg>
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/gps/gps.qml
^
|
@@ -25,7 +25,9 @@
import QtQuick.Controls.Styles.Nemo 1.0
import MeeGo.Connman 0.2
+
import org.nemomobile.systemsettings 1.0
+import org.nemomobile.glacier.settings 1.0
import "../../components/"
@@ -35,7 +37,7 @@
headerTools: HeaderToolsLayout {
id: header
showBackButton: true;
- title: qsTr("Location settings")
+ title: qsTr("Location")
}
TechnologyModel {
@@ -43,6 +45,18 @@
name: "gps"
}
+ SatelliteModel {
+ id: satelliteModel
+ running: true
+ onErrorFound: {
+ console.error("Last Error: %1", "%1=error number").arg(code)
+ }
+
+ onSatelliteInfoAvailableChanged: {
+ console.log("Aviable:"+satelliteModel.rowCount())
+ }
+ }
+
LocationSettings {
id: locationSettings
}
@@ -83,29 +97,163 @@
Label{
id: latitudeLabel
- text: "<b>"+qsTr("Latitude")+"</b> : "+positionSource.position.coordinate.latitude
+ font.bold: true
+ text: qsTr("Latitude")+" : " + qsTr("unavailable")
visible: gpsModel.powered
}
Label{
id: longitudeLabel
- text: "<b>"+qsTr("Longitude")+"</b> : "+positionSource.position.coordinate.longitude
+ font.bold: true
+ text: qsTr("Longitude")+" : " + qsTr("unavailable")
visible: gpsModel.powered
}
Label{
id: sourceLabel
- text: "<b>"+qsTr("Source")+"</b> : "+printableMethod(positionSource.supportedPositioningMethods)
+ font.bold: true
+ text: qsTr("Source")+" : "+printableMethod(positionSource.supportedPositioningMethods)
visible: gpsModel.powered
}
+
+ Rectangle{
+ id: satView
+ width: parent.width
+ height: width
+ color: "transparent"
+ clip: true
+ visible: gpsModel.powered
+
+ Row {
+ property int rows: 13
+ spacing: satView.width/39
+
+ Rectangle {
+ id: scale
+ width: satView.width/13
+ height: satView.height
+ color: signalColor(100)
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: lawngreenRect.top
+ font.pixelSize: Theme.fontSizeTiny
+ text: "50"
+ }
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.top: parent.top
+ font.pixelSize: Theme.fontSizeTiny
+ text: "100"
+ }
+
+ Rectangle {
+ id: redRect
+ width: parent.width
+ color: signalColor(0)
+ height: parent.height*10/100
+ anchors.bottom: parent.bottom
+ Text {
+ id: strengthLabel
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ font.pixelSize: Theme.fontSizeTiny
+ text: "00"
+ }
+ }
+ Rectangle {
+ id: orangeRect
+ height: parent.height*10/100
+ anchors.bottom: redRect.top
+ width: parent.width
+ color: signalColor(10)
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ font.pixelSize: Theme.fontSizeTiny
+ text: "10"
+ }
+ }
+ Rectangle {
+ id: goldRect
+ height: parent.height*10/100
+ anchors.bottom: orangeRect.top
+ width: parent.width
+ color: signalColor(20)
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ font.pixelSize: Theme.fontSizeTiny
+ text: "20"
+ }
+ }
+ Rectangle {
+ id: yellowRect
+ height: parent.height*10/100
+ anchors.bottom: goldRect.top
+ width: parent.width
+ color: signalColor(30)
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ font.pixelSize: Theme.fontSizeTiny
+ text: "30"
+ }
+ }
+ Rectangle {
+ id: lawngreenRect
+ height: parent.height*10/100
+ anchors.bottom: yellowRect.top
+ width: parent.width
+ color: signalColor(40)
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ font.pixelSize: Theme.fontSizeTiny
+ text: "40"
+ }
+ }
+ }
+
+ Repeater {
+ id: repeater
+ model: satelliteModel
+ delegate: Rectangle {
+ height: satView.height
+ width: Theme.itemHeightExtraSmall
+ color: "transparent"
+
+ Rectangle {
+ anchors.bottom: parent.bottom
+ width: parent.width
+ height: parent.height*signalStrength/100
+ color: signalColor(signalStrength);
+ }
+
+ Text {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ text: satelliteIdentifier
+ font.pixelSize: Theme.fontSizeTiny
+ font.bold: isInUse
+ }
+ }
+ }
+ }
+ }
}
PositionSource {
id: positionSource
onPositionChanged: {
- latitudeLabel.text = positionSource.position.coordinate.latitude
- longitudeLabel.text = positionSource.position.coordinate.longitude
+ if(!isNaN(positionSource.position.coordinate.latitude)) {
+ latitudeLabel.text = qsTr("Latitude")+" : "+positionSource.position.coordinate.latitude
+ }
+ if(!isNaN(positionSource.position.coordinate.longitude)) {
+ longitudeLabel.text = qsTr("Longitude")+" : "+positionSource.position.coordinate.longitude
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/mobile/mobile.json
^
|
@@ -0,0 +1,5 @@
+{
+ "path": "mobile",
+ "category": "Network",
+ "title": "Mobile networks"
+}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/mobile/mobile.qml
^
|
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2019 Chupligin Sergey <neochapay@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+import QtQuick 2.6
+
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Nemo 1.0
+import QtQuick.Controls.Styles.Nemo 1.0
+
+import org.nemomobile.ofono 1.0
+
+import MeeGo.QOfono 0.2
+
+import "../../components"
+
+Page {
+ id: usbPage
+
+ headerTools: HeaderToolsLayout {
+ id: header
+ showBackButton: true;
+ title: qsTr("Mobile networks")
+ }
+
+ OfonoExtSimListModel {
+ id: simModel
+ }
+
+ OfonoModemListModel{
+ id: modemModel
+ }
+
+ ListView{
+ id: languageList
+ width: parent.width
+ height: parent.height
+
+ model: modemModel//simModel
+
+ clip: true
+
+ delegate: ListViewItemWithActions{
+ id: mFromList
+ label: path//serviceProviderName
+ description: model.enabled ? "Enabled" : "Disabled"
+ iconVisible: false
+ showNext: model.enabled
+
+ actions:[
+ ActionButton {
+ iconSource: "image://theme/power-off"
+ onClicked: {
+ if(model.enabled) {
+ model.enabled = false
+ } else {
+ model.enabled = true
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/mobile/mobile.svg
^
|
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M216 288h-48c-8.84 0-16 7.16-16 16v192c0 8.84 7.16 16 16 16h48c8.84 0 16-7.16 16-16V304c0-8.84-7.16-16-16-16zM88 384H40c-8.84 0-16 7.16-16 16v96c0 8.84 7.16 16 16 16h48c8.84 0 16-7.16 16-16v-96c0-8.84-7.16-16-16-16zm256-192h-48c-8.84 0-16 7.16-16 16v288c0 8.84 7.16 16 16 16h48c8.84 0 16-7.16 16-16V208c0-8.84-7.16-16-16-16zm128-96h-48c-8.84 0-16 7.16-16 16v384c0 8.84 7.16 16 16 16h48c8.84 0 16-7.16 16-16V112c0-8.84-7.16-16-16-16zM600 0h-48c-8.84 0-16 7.16-16 16v480c0 8.84 7.16 16 16 16h48c8.84 0 16-7.16 16-16V16c0-8.84-7.16-16-16-16z"/></svg>
\ No newline at end of file
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/nfc/nfc.json
^
|
@@ -0,0 +1,5 @@
+{
+ "path": "nfc",
+ "category": "Network",
+ "title": "NFC"
+}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/nfc/nfc.qml
^
|
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2019 Chupligin Sergey <neochapay@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+import QtQuick 2.6
+
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Nemo 1.0
+import QtQuick.Controls.Styles.Nemo 1.0
+
+import org.nemomobile.systemsettings 1.0
+
+import "../../components"
+
+Page {
+ id: nfcPage
+
+ headerTools: HeaderToolsLayout {
+ id: header
+ showBackButton: true;
+ title: qsTr("NFC")
+ }
+
+ NfcSettings{
+ id: nfcSettings
+ }
+
+ SettingsColumn{
+ id: nfcColumn
+
+ Rectangle{
+ id: nfcEnable
+ width: parent.width
+ height: childrenRect.height
+
+ color: "transparent"
+
+ Label {
+ id: nameLabel
+ text: qsTr("Enable NFC")
+ anchors {
+ left: nfcEnable.left
+ }
+ wrapMode: Text.Wrap
+ font.bold: true
+ }
+
+ CheckBox {
+ id: nfcCheckBox
+ checked: nfcSettings.enabled
+ anchors {
+ right: nfcEnable.right
+ verticalCenter: nameLabel.verticalCenter
+ }
+
+ onClicked: {
+ nfcSettings.enabled = nfcCheckBox.checked
+ }
+ }
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/nfc/nfc.svg
^
|
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="380"
+ height="380"
+ id="svg3857">
+ <defs
+ id="defs3859" />
+ <metadata
+ id="metadata3862">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="translate(18.744744,-692.27555)"
+ id="layer1">
+ <path
+ d="m 284.21468,1022.757 c -2.36296,-1.2007 -5.35898,-3.5883 -6.65783,-5.3057 -1.29884,-1.7175 -2.86582,-5.0183 -3.48217,-7.3352 -0.61635,-2.3169 -0.82036,-5.4669 -0.45335,-7 0.367,-1.5331 2.5852,-7.31564 4.92932,-12.85008 2.34413,-5.53445 6.30966,-16.42168 8.81232,-24.19384 2.50263,-7.77216 5.68779,-19.51888 7.07812,-26.10381 1.39033,-6.58494 3.26198,-17.74771 4.15922,-24.80617 1.02632,-8.07383 1.63138,-20.25121 1.63138,-32.83357 0,-12.44174 -0.60589,-24.76367 -1.60323,-32.6052 -0.88177,-6.93286 -2.50916,-17.05786 -3.61642,-22.5 -1.10726,-5.44214 -3.39978,-14.8448 -5.09447,-20.8948 -1.69471,-6.05 -6.06697,-18.42501 -9.71616,-27.50001 -4.91504,-12.22299 -6.62403,-17.68982 -6.59301,-21.09016 0.0271,-2.97109 0.84438,-5.88863 2.31701,-8.27141 1.25132,-2.02468 3.83994,-4.87478 5.75248,-6.33355 2.4575,-1.87442 5.05569,-2.78318 8.85902,-3.09859 2.95992,-0.24546 6.53881,-0.15587 7.95308,0.19909 1.41426,0.35496 4.31816,2.22349 6.45313,4.1523 2.81479,2.543 5.14833,6.39905 8.48986,14.02906 2.53447,5.78718 6.37466,15.64527 8.53375,21.90687 2.15909,6.2616 5.48542,17.59961 7.39184,25.19557 1.90642,7.59595 4.39676,19.43583 5.53409,26.31083 1.13733,6.875 2.52457,17.9 3.08277,24.5 0.55819,6.6 1.0149,18.3 1.0149,26 0,7.7 -0.45671,19.4 -1.0149,26 -0.5582,6.6 -1.94158,17.625 -3.07418,24.5 -1.1326,6.875 -3.77652,19.25 -5.87537,27.5 -2.09886,8.25 -5.93264,20.85 -8.51952,28 -2.58688,7.15001 -6.56912,16.81417 -8.84941,21.47577 -2.80442,5.7332 -5.36439,9.4341 -7.91134,11.4373 -2.95547,2.3246 -4.99882,3.0408 -9.5,3.33 -4.43482,0.2849 -6.70846,-0.1265 -10.03093,-1.8147 z m -62.8084,-26.95687 c -1.70757,-0.52435 -5.15879,-3.14938 -7.66938,-5.83339 -3.6078,-3.85705 -4.71528,-5.88419 -5.28302,-9.67016 -0.61747,-4.11762 -0.26352,-5.85555 2.52116,-12.37904 1.78171,-4.1739 5.19795,-13.23693 7.59165,-20.14007 2.3937,-6.90314 5.4843,-18.15314 6.868,-25 1.38371,-6.84686 3.02053,-18.89884 3.63738,-26.78216 0.83044,-10.61301 0.82886,-17.88061 -0.006,-28 -0.62022,-7.51668 -2.24043,-19.18664 -3.60048,-25.93326 -1.36004,-6.74662 -3.87193,-16.63436 -5.58197,-21.97275 -1.71004,-5.33839 -4.81801,-13.64614 -6.90662,-18.46165 -2.0886,-4.81551 -4.10611,-10.16077 -4.48335,-11.87834 -0.37767,-1.71952 -0.13028,-5.10732 0.55051,-7.53888 0.75675,-2.70284 2.75913,-5.93873 5.16151,-8.34111 2.1588,-2.1588 5.52652,-4.45361 7.48383,-5.09958 1.9573,-0.64597 5.58117,-0.94653 8.05304,-0.66792 2.69084,0.3033 6.15446,1.66881 8.63142,3.4029 2.88551,2.0201 5.12114,4.87538 7.38977,9.43803 1.78897,3.59794 5.069,11.36167 7.28896,17.25274 2.21996,5.89107 5.5551,16.65601 7.41142,23.92209 1.85632,7.26608 4.1916,18.38605 5.1895,24.71105 1.39912,8.86806 3.23591,14.60717 3.21226,33.5 -0.0262,20.89056 -1.79756,28.97994 -3.75563,40.43931 -1.263,7.39162 -3.78769,18.86662 -5.6104,25.5 -1.82272,6.63338 -5.1562,16.78569 -7.40774,22.56069 -2.25153,5.775 -5.33675,12.95951 -6.85604,15.96557 -1.76,3.48233 -4.2722,6.52675 -6.92335,8.39005 -2.88866,2.03022 -5.63496,3.02304 -8.98132,3.24685 -2.65118,0.17732 -6.21743,-0.10662 -7.925,-0.63097 z m -67.89533,-35.86972 c -1.65,-0.41497 -3.98976,-1.28629 -5.19947,-1.93627 -1.20971,-0.64999 -12.23471,-8.92621 -24.5,-18.3916 -12.26528,-9.46539 -31.300504,-24.16036 -42.300513,-32.6555 -11,-8.49514 -23.669,-17.84706 -28.15333,-20.78206 -4.48434,-2.93499 -8.87184,-5.33635 -9.75,-5.33635 -1.31613,0 -1.59528,1.27383 -1.58874,7.25 0.004,3.9875 1.12936,12.63998 2.5,19.22774 1.37064,6.58776 2.49207,15.10818 2.49207,18.93428 0,5.00813 -0.5842,8.16333 -2.08583,11.26528 -1.1472,2.36981 -3.41827,5.25753 -5.04682,6.41716 -1.62855,1.15963 -4.66216,2.33659 -6.74136,2.61547 -2.64178,0.35433 -5.00045,-0.1154 -7.83138,-1.55963 -2.22807,-1.13668 -5.89083,-4.15681 -8.13948,-6.7114 -2.24864,-2.55459 -4.99228,-7.06046 -6.09699,-10.01304 -1.1046996,-2.95259 -3.0186596,-9.99378 -4.2532393,-15.6471 -1.95185,-8.93779 -3.31344,-13.50602 -3.29551,-32.6359 0.0178,-19.01099 1.39853,-23.06943 3.34791,-32.14286 1.2407297,-5.775 3.3814093,-12.97367 4.7570693,-15.99705 1.37566,-3.02338 3.48769,-6.55364 4.69341,-7.84502 1.20572,-1.29138 3.40737,-2.9802 4.89256,-3.75294 1.48519,-0.77275 4.00989,-1.40499 5.61045,-1.40499 1.60057,0 4.61189,1.15485 6.69184,2.56634 2.07994,1.41149 15.75524,11.89488 30.38954,23.29641 14.63431,11.40154 37.407833,29.06903 50.607823,39.26109 13.19999,10.19206 25.43001,19.56928 27.1778,20.83828 1.7478,1.26899 3.8275,2.05795 4.62155,1.75325 0.86539,-0.33209 1.87505,-3.09 2.52044,-6.88469 0.5922,-3.48188 1.32422,-8.8781 1.62673,-11.99161 0.30251,-3.11351 0.0816,-10.2257 -0.49096,-15.80485 -0.57253,-5.57916 -2.12074,-14.28174 -3.44048,-19.33907 -1.31973,-5.05733 -3.79614,-12.56955 -5.50312,-16.69381 -1.70698,-4.12426 -3.59322,-10.42426 -4.19163,-14 -0.81468,-4.86808 -0.78805,-7.58921 0.10601,-10.8317 0.65671,-2.38169 2.65734,-5.92712 4.44586,-7.87873 2.72137,-2.96951 4.09629,-3.62951 8.42824,-4.04576 3.03592,-0.29171 6.42871,0.0213 8.20493,0.75708 1.66569,0.68995 5.26406,3.70048 7.99636,6.69005 2.73231,2.98958 6.50768,8.68052 8.38971,12.64653 1.88204,3.96601 4.99245,11.92474 6.91203,17.68606 1.91957,5.76132 4.32007,14.30013 5.33446,18.97513 1.43879,6.63098 2.91577,12.78776 2.91577,28 0,15.22951 -1.47603,21.3615 -2.91892,28 -1.01612,4.675 -2.96277,12.04627 -4.32589,16.3806 -1.36313,4.33432 -4.03945,11.30606 -5.94738,15.49273 -1.90793,4.18668 -4.45729,8.67191 -5.66524,9.96717 -1.20796,1.29527 -3.33646,3.17239 -4.73003,4.17139 -1.39358,0.99899 -4.09357,2.04766 -6,2.33036 -1.90643,0.28271 -4.81624,0.17449 -6.46624,-0.24047 z"
+ id="path3055"
+ style="fill:#000000;fill-opacity:1" />
+ </g>
+</svg>
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/usb/usb.json
^
|
@@ -0,0 +1,5 @@
+{
+ "path": "usb",
+ "category": "Network",
+ "title": "USB"
+}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/usb/usb.qml
^
|
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 2019 Chupligin Sergey <neochapay@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+import QtQuick 2.6
+
+import QtQuick.Controls 1.0
+import QtQuick.Controls.Nemo 1.0
+import QtQuick.Controls.Styles.Nemo 1.0
+
+import org.nemomobile.systemsettings 1.0
+
+import "../../components"
+
+Page {
+ id: usbPage
+
+ headerTools: HeaderToolsLayout {
+ id: header
+ showBackButton: true;
+ title: qsTr("USB")
+ }
+
+ USBSettings{
+ id: usbSettings
+
+ onSupportedModesChanged: {
+ for(var i = 0; i <= usbSettings.supportedModes.length; i++) {
+ if(usbSettings.supportedModes[i] === usbSettings.currentMode) {
+ usbModeRoller.currentIndex = i;
+ }
+ }
+ }
+
+ onCurrentModeChanged: {
+ currentModeLabel.text = qsTr("Current mode: ") + formatMode(usbSettings.currentMode)
+ }
+ }
+
+ Flickable{
+ width: parent.width
+ height: parent.height-size.dp(80)
+
+ clip: true
+ anchors{
+ top: parent.top
+ topMargin: size.dp(80)
+ left: parent.left
+ leftMargin: size.dp(20)
+ }
+
+ Column{
+ width: parent.width
+ spacing: Theme.itemSpacingMedium
+
+ Label{
+ id: currentModeLabel
+ text: qsTr("Current mode: ") + formatMode(usbSettings.currentMode)
+ }
+
+ GlacierRoller {
+ id: usbModeRoller
+ width: parent.width
+
+ clip: true
+ model: usbSettings.availableModes
+ label: qsTr("Select USB mode")
+ delegate: GlacierRollerItem{
+ id: item
+ Text{
+ height: usbModeRoller.itemHeight
+ verticalAlignment: Text.AlignVCenter
+ text: formatMode(modelData)
+ color: Theme.textColor
+ font.pixelSize: Theme.fontSizeMedium
+ font.bold: (usbModeRoller.activated && usbModeRoller.currentIndex === index)
+ }
+ }
+
+ onCurrentIndexChanged: {
+ usbSettings.currentMode = usbSettings.supportedModes[currentIndex]
+ }
+ }
+ }
+ }
+
+ function formatMode(mode) {
+ switch(mode) {
+ case "ask":
+ return qsTr("Always ask")
+ case "mtp_mode":
+ return qsTr("MTP")
+ case "charging_only":
+ return qsTr("Chagring only")
+ case "connection_sharing":
+ return qsTr("Connection sharing")
+ case "developer_mode":
+ return qsTr("Developer mode")
+ case "busy":
+ return qsTr("Busy")
+ default:
+ return mode
+ }
+ }
+}
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/usb/usb.svg
^
|
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M641.5 256c0 3.1-1.7 6.1-4.5 7.5L547.9 317c-1.4.8-2.8 1.4-4.5 1.4-1.4 0-3.1-.3-4.5-1.1-2.8-1.7-4.5-4.5-4.5-7.8v-35.6H295.7c25.3 39.6 40.5 106.9 69.6 106.9H392V354c0-5 3.9-8.9 8.9-8.9H490c5 0 8.9 3.9 8.9 8.9v89.1c0 5-3.9 8.9-8.9 8.9h-89.1c-5 0-8.9-3.9-8.9-8.9v-26.7h-26.7c-75.4 0-81.1-142.5-124.7-142.5H140.3c-8.1 30.6-35.9 53.5-69 53.5C32 327.3 0 295.3 0 256s32-71.3 71.3-71.3c33.1 0 61 22.8 69 53.5 39.1 0 43.9 9.5 74.6-60.4C255 88.7 273 95.7 323.8 95.7c7.5-20.9 27-35.6 50.4-35.6 29.5 0 53.5 23.9 53.5 53.5s-23.9 53.5-53.5 53.5c-23.4 0-42.9-14.8-50.4-35.6H294c-29.1 0-44.3 67.4-69.6 106.9h310.1v-35.6c0-3.3 1.7-6.1 4.5-7.8 2.8-1.7 6.4-1.4 8.9.3l89.1 53.5c2.8 1.1 4.5 4.1 4.5 7.2z"/></svg>
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/wifi/WifiSettings.qml
^
|
@@ -24,6 +24,7 @@
import QtQuick.Controls.Styles.Nemo 1.0
import MeeGo.Connman 0.2
+import Nemo.Dialogs 1.0
import "../../components"
@@ -67,6 +68,8 @@
onErrorReported: {
console.log("Got error from model: " + error);
+ failDialog.subLabelText = error;
+ failDialog.open();
}
}
@@ -74,21 +77,38 @@
networkingModel.networkName.text = modelData.name;
}
+ Spinner {
+ id: spinner
+ anchors.centerIn: parent
+ enabled: true;
+ visible: false;
+ }
+
SettingsColumn{
+ visible: !spinner.visible
+
+ Label{
+ id: currentModeLabel
+ text: qsTr("Password: ")
+ }
+
TextField{
id: passphrase
text: modelData.passphrase
+ echoMode: TextInput.Password
+ width: parent.width
}
Button{
id: connectButton
height: Theme.itemHeightSmall
+ width: parent.width
onClicked: {
modelData.passphrase = passphrase.text;
modelData.requestConnect();
networkingModel.networkName.text = modelData.name;
- pageStack.pop();
+ spinner.visible = true;
}
text: qsTr("Connect")
}
@@ -98,6 +118,31 @@
target: modelData
onConnectRequestFailed: {
console.log(error)
+ failDialog.subLabelText = error;
+ failDialog.open();
+ spinner.visible = false;
+ }
+
+ onConnectedChanged: {
+ if(connected) {
+ pageStack.pop();
+ spinner.visible = false;
+ }
+ }
+ }
+
+
+ Dialog{
+ id: failDialog
+ acceptText: qsTr("Ok")
+ headingText: qsTr("Connection failed")
+
+ inline: false
+
+ icon: "image://theme/exclamation-triangle"
+
+ onAccepted: {
+ failDialog.close();
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/wifi/WifiStatus.qml
^
|
@@ -57,10 +57,10 @@
model: ListModel{
id: methodModel
ListElement{
- name: "DHCP"
+ name: qsTr("DHCP")
}
ListElement{
- name: "Manual"
+ name: qsTr("Manual")
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/qml/plugins/wifi/wifi.qml
^
|
@@ -41,6 +41,21 @@
name: "wifi"
property bool sheetOpened
property string networkName
+ onPoweredChanged: {
+ wifiTimer.stop();
+ columnCheckBox.indeterminate = false
+ columnCheckBox.checked = networkingModel.powered
+ }
+ }
+
+ Timer{
+ id: wifiTimer
+ interval: 5000
+ repeat: false
+ onTriggered: {
+ columnCheckBox.indeterminate = false
+ columnCheckBox.checked = networkingModel.powered
+ }
}
SettingsColumn{
@@ -70,6 +85,8 @@
}
onClicked:{
networkingModel.powered = !networkingModel.powered;
+ columnCheckBox.indeterminate = true
+ wifiTimer.start()
}
}
}
@@ -96,7 +113,7 @@
Text{
text: qsTr("Saved")
color: Theme.textColor
- font.pointSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fontSizeLarge
}
Rectangle{
@@ -114,7 +131,7 @@
Text{
text: qsTr("Enabled")
color: Theme.textColor
- font.pointSize: Theme.fontSizeSmall
+ font.pixelSize: Theme.fontSizeLarge
}
Rectangle{
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/src/main.cpp
^
|
@@ -31,7 +31,7 @@
#include <glacierapp.h>
#include "models/settingsmodel.h"
-#include "models/settingsproxymodel.h"
+#include "models/satellitemodel.h"
Q_DECL_EXPORT int main(int argc, char *argv[])
{
@@ -47,7 +47,7 @@
}
qmlRegisterType<SettingsModel>("org.nemomobile.glacier.settings",1,0,"SettingsModel");
- qmlRegisterType<SettingsProxyModel>("org.nemomobile.glacier.settings",1,0,"SettingsProxyModel");
+ qmlRegisterType<SatelliteModel>("org.nemomobile.glacier.settings",1,0,"SatelliteModel");
QQuickWindow *window = GlacierApp::showWindow();
window->setTitle(QObject::tr("Settings"));
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/src/models/satellitemodel.cpp
^
|
@@ -0,0 +1,289 @@
+#include "satellitemodel.h"
+#include <QTimer>
+#include <QDebug>
+#include <QFile>
+
+SatelliteModel::SatelliteModel(QObject *parent) :
+ QAbstractListModel(parent), source(0), m_componentCompleted(false), m_running(false),
+ m_runningRequested(false), demo(false), isSingle(false), singleRequestServed(false)
+{
+ source = QGeoSatelliteInfoSource::createDefaultSource(this);
+ QStringList aS = QGeoSatelliteInfoSource::availableSources();
+ for(int i = 0; i < aS.size(); ++i) {
+ qDebug() << " - " << aS[i];
+ }
+
+
+ if (!demo && !source) {
+ qWarning() << "No satellite data source found. Changing to demo mode.";
+ demo = true;
+ }
+ if (!demo) {
+ source->setUpdateInterval(3000);
+ connect(source, SIGNAL(satellitesInViewUpdated(QList<QGeoSatelliteInfo>)),
+ this, SLOT(satellitesInViewUpdated(QList<QGeoSatelliteInfo>)));
+ connect(source, SIGNAL(satellitesInUseUpdated(QList<QGeoSatelliteInfo>)),
+ this, SLOT(satellitesInUseUpdated(QList<QGeoSatelliteInfo>)));
+ connect(source, SIGNAL(error(QGeoSatelliteInfoSource::Error)),
+ this, SLOT(error(QGeoSatelliteInfoSource::Error)));
+ }
+
+ if (demo) {
+ timer = new QTimer(this);
+ connect(timer, SIGNAL(timeout()), this, SLOT(updateDemoData()));
+ timer->start(3000);
+ }
+}
+
+int SatelliteModel::rowCount(const QModelIndex &parent) const
+{
+ Q_UNUSED(parent);
+ if (!source && !demo)
+ return 0;
+
+ return knownSatellites.count();
+}
+
+QVariant SatelliteModel::data(const QModelIndex &index, int role) const
+{
+ if (!demo && !source)
+ return QVariant();
+
+ if (!index.isValid() || index.row() < 0)
+ return QVariant();
+
+ if (index.row() >= knownSatellites.count()) {
+ qWarning() << "SatelliteModel: Index out of bound";
+ return QVariant();
+ }
+
+ const QGeoSatelliteInfo &info = knownSatellites.at(index.row());
+ switch (role) {
+ case IdentifierRole:
+ return info.satelliteIdentifier();
+ case InUseRole:
+ return satellitesInUse.contains(info.satelliteIdentifier());
+ case SignalStrengthRole:
+ return info.signalStrength();
+ case ElevationRole:
+ if (!info.hasAttribute(QGeoSatelliteInfo::Elevation))
+ return QVariant();
+ return info.attribute(QGeoSatelliteInfo::Elevation);
+ case AzimuthRole:
+ if (!info.hasAttribute(QGeoSatelliteInfo::Azimuth))
+ return QVariant();
+ return info.attribute(QGeoSatelliteInfo::Azimuth);
+ case SatelliteSystem:
+ if(info.satelliteSystem() == QGeoSatelliteInfo::GPS) {
+ return QVariant("GPS");
+ }
+ if(info.satelliteSystem() == QGeoSatelliteInfo::GLONASS) {
+ return QVariant("GNS");
+ }
+ return QVariant("UNK");
+ default:
+ break;
+
+ }
+
+ return QVariant();
+}
+
+QHash<int, QByteArray> SatelliteModel::roleNames() const
+{
+ QHash<int, QByteArray> roleNames;
+ roleNames.insert(IdentifierRole, "satelliteIdentifier");
+ roleNames.insert(InUseRole, "isInUse");
+ roleNames.insert(SignalStrengthRole, "signalStrength");
+ roleNames.insert(ElevationRole, "elevation");
+ roleNames.insert(AzimuthRole, "azimuth");
+ roleNames.insert(SatelliteSystem, "satelliteSystem");
+ return roleNames;
+}
+
+void SatelliteModel::componentComplete()
+{
+ m_componentCompleted = true;
+ if (m_runningRequested)
+ setRunning(true);
+}
+
+bool SatelliteModel::running() const
+{
+ return m_running;
+}
+
+bool SatelliteModel::isSingleRequest() const
+{
+ return isSingle;
+}
+
+void SatelliteModel::setSingleRequest(bool single)
+{
+ if (running()) {
+ qWarning() << "Cannot change single request mode while running";
+ return;
+ }
+
+ if (single != isSingle) { //flag changed
+ isSingle = single;
+ emit singleRequestChanged();
+ }
+}
+
+void SatelliteModel::setRunning(bool isActive)
+{
+ if (!source && !demo)
+ return;
+
+ if (!m_componentCompleted) {
+ m_runningRequested = isActive;
+ return;
+ }
+
+ if (m_running == isActive)
+ return;
+
+ m_running = isActive;
+
+ if (m_running) {
+ clearModel();
+ if (demo)
+ timer->start(2000);
+ else if (isSingleRequest())
+ source->requestUpdate(10000);
+ else
+ source->startUpdates();
+
+ if (demo)
+ singleRequestServed = false;
+ } else {
+ if (demo)
+ timer->stop();
+ else if (!isSingleRequest())
+ source->stopUpdates();
+ }
+
+
+ Q_EMIT runningChanged();
+}
+
+int SatelliteModel::entryCount() const
+{
+ return knownSatellites.count();
+}
+
+bool SatelliteModel::canProvideSatelliteInfo() const
+{
+ return !demo;
+}
+
+void SatelliteModel::clearModel()
+{
+ beginResetModel();
+ knownSatelliteIds.clear();
+ knownSatellites.clear();
+ satellitesInUse.clear();
+ endResetModel();
+}
+
+void SatelliteModel::updateDemoData()
+{
+ static bool flag = true;
+ QList<QGeoSatelliteInfo> satellites;
+ if (flag) {
+ for (int i = 0; i<5; i++) {
+ QGeoSatelliteInfo info;
+ info.setSatelliteIdentifier(i);
+ info.setSignalStrength(20 + 20*i);
+ satellites.append(info);
|
[-]
[+]
|
Added |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/src/models/satellitemodel.h
^
|
@@ -0,0 +1,93 @@
+#ifndef SATELLITEMODEL_H
+#define SATELLITEMODEL_H
+
+#include <QAbstractListModel>
+#include <QSet>
+#include <QTimer>
+#include <QtQml/qqml.h>
+#include <QtQml/QQmlParserStatus>
+#include <QtPositioning/QGeoSatelliteInfoSource>
+
+QT_FORWARD_DECLARE_CLASS(QTimer)
+QT_FORWARD_DECLARE_CLASS(QGeoSatelliteInfoSource)
+
+class SatelliteModel : public QAbstractListModel, public QQmlParserStatus
+{
+ Q_OBJECT
+ Q_PROPERTY(bool running READ running WRITE setRunning NOTIFY runningChanged)
+ Q_PROPERTY(bool satelliteInfoAvailable READ canProvideSatelliteInfo NOTIFY canProvideSatelliteInfoChanged)
+ Q_PROPERTY(int entryCount READ entryCount NOTIFY entryCountChanged)
+ Q_PROPERTY(bool singleRequestMode READ isSingleRequest WRITE setSingleRequest NOTIFY singleRequestChanged)
+ Q_PROPERTY(int usedSattelites READ usedSattelites NOTIFY usedSattelitesChanged)
+ Q_PROPERTY(int avaiableSattelites READ avaiableSattelites NOTIFY avaiableSattelitesChanged)
+ Q_INTERFACES(QQmlParserStatus)
+public:
+ explicit SatelliteModel(QObject *parent = 0);
+
+ enum {
+ IdentifierRole = Qt::UserRole + 1,
+ InUseRole,
+ SignalStrengthRole,
+ ElevationRole,
+ AzimuthRole,
+ SatelliteSystem
+ };
+
+ //From QAbstractListModel
+ int rowCount(const QModelIndex &parent) const;
+ QVariant data(const QModelIndex &index, int role) const;
+ QHash<int, QByteArray> roleNames() const;
+
+ //From QQmlParserStatus
+ void classBegin() {}
+ void componentComplete();
+
+ bool running() const;
+ void setRunning(bool isActive);
+
+ bool isSingleRequest() const;
+ void setSingleRequest(bool single);
+
+ int entryCount() const;
+
+ bool canProvideSatelliteInfo() const;
+
+ int usedSattelites(){return satellitesInUse.count();}
+ int avaiableSattelites(){return knownSatellites.count();}
+
+signals:
+ void runningChanged();
+ void entryCountChanged();
+ void errorFound(int code);
+ void canProvideSatelliteInfoChanged();
+ void singleRequestChanged();
+ void usedSattelitesChanged();
+ void avaiableSattelitesChanged();
+
+public slots:
+ void clearModel();
+ void updateDemoData();
+
+private slots:
+ void error(QGeoSatelliteInfoSource::Error);
+ void satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &infos);
+ void satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &infos);
+
+private:
+ QGeoSatelliteInfoSource *source;
+ bool m_componentCompleted;
+ bool m_running;
+ bool m_runningRequested;
+ QList <QGeoSatelliteInfo> knownSatellites;
+ QSet<int> knownSatelliteIds;
+ QSet<int> satellitesInUse;
+ bool demo;
+ QTimer *timer;
+ bool isSingle;
+ bool singleRequestServed;
+
+};
+
+QML_DECLARE_TYPE(SatelliteModel)
+
+#endif // SATELLITEMODEL_H
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/src/models/settingsmodel.cpp
^
|
@@ -25,7 +25,7 @@
#include <QJsonObject>
/*
- * Orgeding categoty DRAFT
+ * Orgeding category DRAFT
*
* Settings part:
* Personalization
@@ -35,6 +35,8 @@
* - Cellural
* - WiFi
* - NFC
+ * Security
+ * - Device Lock
* Development
* - Devmode
* Info
@@ -42,20 +44,21 @@
* Other
*/
+
const QStringList SettingsModel::defaultCategories = {
- tr("Other")
- , tr("Info")
- , tr("Development")
- , tr("Network")
- , tr("Personalization")
+ "Personalization",
+ "Network",
+ "Security",
+ "Development",
+ "Info",
+ "Other"
};
SettingsModel::SettingsModel(QObject *parent) :
QAbstractListModel(parent)
{
m_roleNames << "title";
- m_roleNames << "category";
- m_roleNames << "path";
+ m_roleNames << "items";
for (const QString &role : m_roleNames) {
hash.insert(Qt::UserRole+hash.count() ,role.toLatin1());
@@ -97,8 +100,6 @@
void SettingsModel::init()
{
- settingsList.clear();
-
QDir pluginsPath = QDir(m_pluginsDir);
qDebug() << "Start scan plugins dir " << pluginsPath.absolutePath();
pluginsPath.setNameFilters(QStringList("*.json"));
@@ -128,7 +129,7 @@
QJsonDocument config = QJsonDocument::fromJson(pluginConfig.readAll());
QJsonObject configObject = config.object();
- foreach (QString role, configObject.keys()) {
+ for (QString role : configObject.keys()) {
if (!m_roleNames.contains(role)) {
m_roleNames << role;
hash.insert(Qt::UserRole+hash.count() ,role.toLatin1());
@@ -137,7 +138,7 @@
if(configObject.contains("title") && configObject.contains("category") && configObject.contains("path"))
{
- addItem(configObject);
+ m_pluginsData.append(configObject);
return true;
}
else
@@ -146,18 +147,33 @@
}
}
-void SettingsModel::addItem(QJsonObject item)
+QVariant SettingsModel::pluginsInCategory(QString category) const
{
+ QVariantList pluginsInCat;
- int count = settingsList.size();
- insertRows(count,1,item);
+ for (const QJsonValue &item : m_pluginsData) {
+ if(item.toObject().value("category").toString() == category) {
+ pluginsInCat.append(item.toObject().toVariantMap());
+ }
+ }
+ return pluginsInCat;
}
-
int SettingsModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
- return settingsList.count();
+ return defaultCategories.count();
+}
+
+
+QVariantMap SettingsModel::get(int idx) const
+{
+ QString title = defaultCategories.at(idx);
+
+ return QVariantMap{
+ {"title", title },
+ {"items", pluginsInCategory(title)}
+ };
}
QVariant SettingsModel::data(const QModelIndex &index, int role) const
@@ -166,60 +182,29 @@
if (!index.isValid())
return QVariant();
- if (index.row() >= settingsList.size())
+ if (index.row() >= defaultCategories.count())
return QVariant();
- QJsonObject item = settingsList.at(index.row());
+ QVariant item = defaultCategories.at(index.row());
if(role == Qt::UserRole)
{
- return item.value("title").toString();
+ return item;
}
else if(role == Qt::UserRole+1)
{
- return item.value("category").toString();
- }
- else if(role == Qt::UserRole+2)
- {
- return item.value("path").toString();
+ return pluginsInCategory(item.toString()) ;
}
return QVariant();
}
-QJsonObject SettingsModel::data(const QModelIndex &index) const
+QVariantMap SettingsModel::data(const QModelIndex &index) const
{
if (!index.isValid())
- return QJsonObject();
+ return QVariantMap();
- if (index.row() >= settingsList.size())
- return QJsonObject();
+ if (index.row() >= defaultCategories.size())
+ return QVariantMap();
- return settingsList.at(index.row());
-}
-
-bool SettingsModel::insertRows(int position, int rows, QJsonObject &item, const QModelIndex &parent)
-{
- Q_UNUSED(parent);
- beginInsertRows(QModelIndex(), position, position+rows-1);
- for (int row = 0; row < rows; ++row) {
- settingsList.insert(position, item);
- }
- endInsertRows();
- return true;
-}
-
-bool SettingsModel::removeRows(int position, int rows, const QModelIndex &index)
-{
- Q_UNUSED(index);
- beginRemoveRows(QModelIndex(), position, position+rows-1);
- for (int row = 0; row < rows; ++row) {
- settingsList.removeAt(position);
- }
- endRemoveRows();
- return true;
-}
-
-void SettingsModel::remove(int idx)
-{
- this->removeRows(idx,1);
+ return get(index.row());
}
|
[-]
[+]
|
Changed |
_service:tar_git:glacier-settings-0.0.11.tar.bz2/src/models/settingsmodel.h
^
|
@@ -22,6 +22,7 @@
#include <QObject>
#include <QAbstractListModel>
#include <QJsonObject>
+#include <QJsonArray>
class SettingsModel : public QAbstractListModel
{
@@ -34,14 +35,9 @@
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
- QJsonObject data(const QModelIndex &index) const;
+ QVariantMap data(const QModelIndex &index) const;
QHash<int, QByteArray> roleNames() const {return hash;}
- bool insertRows(int position, int rows, QJsonObject &item, const QModelIndex &index = QModelIndex());
- bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());
-
- QList<QJsonObject> settingsList;
-
QString path(){return m_pluginsDir;}
void setPath(QString path);
@@ -53,14 +49,15 @@
void pathChanged();
public slots:
- void addItem(QJsonObject item);
- QJsonObject get(int idx){return settingsList[idx];}
- void remove(int idx);
+ QVariantMap get(int idx) const;
private:
QHash<int,QByteArray> hash;
QString m_pluginsDir;
QStringList m_roleNames;
+ QJsonArray m_pluginsData; //plugins list
+
+ QVariant pluginsInCategory(QString category) const;
bool loadConfig(QString configFileName);
};
|