Commit 8d8fa8e7 authored by Stephane Mankowski's avatar Stephane Mankowski

Remove warning due to QML dashboard

parent 9f8485fb
......@@ -10,6 +10,7 @@ skrooge (2.22.0)
*Correction: With last version of KDE, KMessageWidget are sometimes empty
*Correction: Add missing "Full screen" menu
*Correction: Fix "coinmarketcap" source (need an API key)
*Correction: Remove warning due to QML dashboard
*Feature: Add new source "cryptocompare" (need an API key)
-- Stephane MANKOWSKI <stephane@mankowski.fr>
......
......@@ -24,12 +24,13 @@ Label {
property var bold: false
property var url: ""
property var backgroundColor: "#FF0000"
property var point_size: 10
color: '#' + (value == null || max != null ? color_normaltext : (value < 0 ? color_negativetext : color_positivetext))
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
font.pixelSize: report.point_size
font.pixelSize: pixel_size
font.bold: bold
MouseArea {
......
......@@ -20,7 +20,8 @@ import QtQuick.Layouts 1.0
RowLayout {
id: grid
property var m: report.account_table
property var m: report==null ? null : report.account_table
property var pixel_size: report==null ? 0 : report.point_size
spacing: 2
function maxValues(m, id) {
......@@ -41,7 +42,7 @@ RowLayout {
Label {
Layout.fillWidth: true
font.bold: index == 0 || modelData[0]
font.pixelSize: report.point_size
font.pixelSize: pixel_size
text: modelData[1]
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignLeft
}
......@@ -58,6 +59,7 @@ RowLayout {
Repeater {
model: m
SKGValue {
font.pixelSize: pixel_size
Layout.fillWidth: true
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignRight
font.bold: index == 0 || modelData[0]
......
......@@ -20,7 +20,8 @@ import QtQuick.Layouts 1.0
RowLayout {
id: grid
property var m: report.alarms
property var m: report==null ? null : report.alarms
property var pixel_size: report==null ? 0 : report.point_size
spacing: 2
ColumnLayout {
......@@ -30,6 +31,7 @@ RowLayout {
Repeater {
model: m
SKGValue {
font.pixelSize: pixel_size
horizontalAlignment: Text.AlignHCenter
value: modelData[1]
max: modelData[2]
......
......@@ -20,7 +20,8 @@ import QtQuick.Layouts 1.0
RowLayout {
id: grid
property var m: report.bank_table
property var m: report==null ? null : report.bank_table
property var pixel_size: report==null ? 0 : report.point_size
spacing: 2
function maxValues(m, id) {
......@@ -41,7 +42,7 @@ RowLayout {
Label {
Layout.fillWidth: true
font.bold: index == 0 || modelData[0]
font.pixelSize: report.point_size
font.pixelSize: pixel_size
text: modelData[1]
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignLeft
}
......@@ -58,6 +59,7 @@ RowLayout {
Repeater {
model: m
SKGValue {
font.pixelSize: pixel_size
Layout.fillWidth: true
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignRight
font.bold: index == 0 || modelData[0]
......
......@@ -20,7 +20,8 @@ import QtQuick.Layouts 1.0
RowLayout {
id: grid
property var m: report.bank_table
property var m: report==null ? null : report.bank_table
property var pixel_size: report==null ? 0 : report.point_size
spacing: 2
function maxValues(m, id) {
......@@ -41,7 +42,7 @@ RowLayout {
Label {
Layout.fillWidth: true
font.bold: index == 0 || modelData[0]
font.pixelSize: report.point_size
font.pixelSize: pixel_size
text: modelData[1]
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignLeft
}
......@@ -55,6 +56,7 @@ RowLayout {
Repeater {
model: m
SKGValue {
font.pixelSize: pixel_size
Layout.fillWidth: true
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignRight
font.bold: index == 0 || modelData[0]
......
......@@ -20,7 +20,8 @@ import QtQuick.Layouts 1.0
RowLayout {
id: grid
property var m: report.budget_table
property var m: report==null ? null : report.budget_table
property var pixel_size: report==null ? 0 : report.point_size
spacing: 2
ColumnLayout {
......@@ -32,7 +33,7 @@ RowLayout {
Label {
Layout.fillWidth: true
font.bold: index == 0 || modelData[0]
font.pixelSize: report.point_size
font.pixelSize: pixel_size
text: modelData[1]
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignLeft
}
......@@ -49,6 +50,7 @@ RowLayout {
Repeater {
model: m
SKGValue {
font.pixelSize: pixel_size
Layout.fillWidth: true
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignRight
font.bold: index == 0 || modelData[0]
......
......@@ -20,13 +20,14 @@ import QtQuick.Layouts 1.0
RowLayout {
id: grid
property var m: report.categories_period
property var m: report==null ? null : report.categories_period
property var pixel_size: report==null ? 0 : report.point_size
property var max: maxValues(m)
spacing: 2
function maxValues(m) {
var output = -1
for (var i = 1; i < m.length; i++) {
for (var i = 1; i < (m==null ? 0 : m.length); i++) {
if (m[i][2] > output)
output = m[i][2]
}
......@@ -42,7 +43,7 @@ RowLayout {
Label {
Layout.fillWidth: true
font.bold: index == 0
font.pixelSize: report.point_size
font.pixelSize: pixel_size
text: index == 0 ? modelData[1] : index + ": " + modelData[1]
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignLeft
}
......@@ -56,6 +57,7 @@ RowLayout {
Repeater {
model: m
SKGValue {
font.pixelSize: pixel_size
Layout.fillWidth: true
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignRight
font.bold: index == 0
......
......@@ -18,11 +18,13 @@ import QtQuick 2.0
import QtQuick.Controls 1.0
Column {
property var pixel_size: report==null ? 0 : report==null ? null : report.point_size
Repeater {
model: report.categories_variations
model: report==null ? null : report.categories_variations
Label {
text: modelData
font.pixelSize: report.point_size
font.pixelSize: pixel_size
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
......
......@@ -18,11 +18,13 @@ import QtQuick 2.0
import QtQuick.Controls 1.0
Column {
property var pixel_size: report==null ? 0 : report.point_size
Repeater {
model: report.categories_variations_issues
model: report==null ? null : report.categories_variations_issues
Label {
text: modelData
font.pixelSize: report.point_size
font.pixelSize: pixel_size
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
......
......@@ -19,6 +19,8 @@ import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0
GridLayout {
property var pixel_size: report==null ? 0 : report.point_size
id: widget
columns: 2
......@@ -37,19 +39,20 @@ GridLayout {
id: label1
text: period1Widget.text
font.bold: true
font.pixelSize: report.point_size
font.pixelSize: pixel_size
Layout.columnSpan: 2
}
Label{
text: qsTr("Incomes:")
font.pixelSize: report.point_size
font.pixelSize: pixel_size
}
SKGValue {
font.pixelSize: pixel_size
id: incomes1Bar
max: parent.maxValue
value: totrigger*report.getIncomeVsExpenditure(suboperationsWidget.checked, groupedWidget.checked, transferWidget.checked, trackerWidget.checked, period1Widget.whereClause, period2Widget.whereClause)[1][3]
value: totrigger*(report==null ? 0 : report.getIncomeVsExpenditure(suboperationsWidget.checked, groupedWidget.checked, transferWidget.checked, trackerWidget.checked, period1Widget.whereClause, period2Widget.whereClause)[1][3])
text: document.formatPrimaryMoney(value)
horizontalAlignment: Text.AlignHCenter
backgroundColor: '#' + color_positivetext
......@@ -62,13 +65,14 @@ GridLayout {
Label{
text: qsTr("Expenditures:")
font.pixelSize: report.point_size
font.pixelSize: pixel_size
}
SKGValue {
font.pixelSize: pixel_size
id: expenditures1Bar
max: parent.maxValue
value: totrigger*report.getIncomeVsExpenditure(suboperationsWidget.checked, groupedWidget.checked, transferWidget.checked, trackerWidget.checked, period1Widget.whereClause, period2Widget.whereClause)[2][3]
value: totrigger*(report==null ? 0 : report.getIncomeVsExpenditure(suboperationsWidget.checked, groupedWidget.checked, transferWidget.checked, trackerWidget.checked, period1Widget.whereClause, period2Widget.whereClause)[2][3])
text: document.formatPrimaryMoney(value)
horizontalAlignment: Text.AlignHCenter
backgroundColor: '#' + color_negativetext
......@@ -81,10 +85,11 @@ GridLayout {
Label{
text: qsTr("Savings:")
font.pixelSize: report.point_size
font.pixelSize: pixel_size
}
SKGValue {
font.pixelSize: pixel_size
id: savings1Bar
max: parent.maxValue
value: Math.abs(incomes1Bar.value - expenditures1Bar.value)
......@@ -103,19 +108,20 @@ GridLayout {
id: label2
text: period2Widget.text
font.bold: true
font.pixelSize: report.point_size
font.pixelSize: pixel_size
Layout.columnSpan: 2
}
Label{
text: qsTr("Incomes:")
font.pixelSize: report.point_size
font.pixelSize: pixel_size
}
SKGValue {
font.pixelSize: pixel_size
id: incomes2Bar
max: parent.maxValue
value: totrigger*report.getIncomeVsExpenditure(suboperationsWidget.checked, groupedWidget.checked, transferWidget.checked, trackerWidget.checked, period1Widget.whereClause, period2Widget.whereClause)[1][2]
value: totrigger*(report==null ? 0 : report.getIncomeVsExpenditure(suboperationsWidget.checked, groupedWidget.checked, transferWidget.checked, trackerWidget.checked, period1Widget.whereClause, period2Widget.whereClause)[1][2])
text: document.formatPrimaryMoney(value)
horizontalAlignment: Text.AlignHCenter
backgroundColor: '#' + color_positivetext
......@@ -128,13 +134,14 @@ GridLayout {
Label{
text: qsTr("Expenditures:")
font.pixelSize: report.point_size
font.pixelSize: pixel_size
}
SKGValue {
font.pixelSize: pixel_size
id: expenditures2Bar
max: parent.maxValue
value: totrigger*report.getIncomeVsExpenditure(suboperationsWidget.checked, groupedWidget.checked, transferWidget.checked, trackerWidget.checked, period1Widget.whereClause, period2Widget.whereClause)[2][2]
value: totrigger*(report==null ? 0 : report.getIncomeVsExpenditure(suboperationsWidget.checked, groupedWidget.checked, transferWidget.checked, trackerWidget.checked, period1Widget.whereClause, period2Widget.whereClause)[2][2])
text: document.formatPrimaryMoney(value)
horizontalAlignment: Text.AlignHCenter
backgroundColor: '#' + color_negativetext
......@@ -147,7 +154,7 @@ GridLayout {
Label{
text: qsTr("Savings:")
font.pixelSize: report.point_size
font.pixelSize: pixel_size
}
SKGValue {
......
......@@ -20,7 +20,8 @@ import QtQuick.Layouts 1.0
RowLayout {
id: grid
property var m: report.interests
property var m: report==null ? null : report.interests
property var pixel_size: report==null ? 0 : report.point_size
spacing: 2
function maxValues(m, id) {
......@@ -41,7 +42,7 @@ RowLayout {
Label {
Layout.fillWidth: true
font.bold: index == 0 || modelData[0]
font.pixelSize: report.point_size
font.pixelSize: pixel_size
text: modelData[1]
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignLeft
}
......@@ -55,6 +56,7 @@ RowLayout {
Repeater {
model: m
SKGValue {
font.pixelSize: pixel_size
Layout.fillWidth: true
horizontalAlignment: index == 0 ? Text.AlignHCenter : Text.AlignRight
font.bold: index == 0 || modelData[0]
......
......@@ -19,17 +19,18 @@ import QtQuick.Controls 1.0
Row {
spacing: 5
property var pixel_size: report==null ? 0 : report.point_size
Rectangle {
id: rect1
width: 50
height: width
color: "#" + report.personal_finance_score_details.color
color: "#" + (report==null ? "red" : report.personal_finance_score_details.color)
radius: width / 10
Label {
id: pfstext
text: report.personal_finance_score_details.value.toFixed(2)
text: report==null ? null : report.personal_finance_score_details.value.toFixed(2)
fontSizeMode: Text.Fit
minimumPixelSize: 10
font.pixelSize: 72
......@@ -54,7 +55,7 @@ Row {
id: t2
width: t1.width
height: t1.height
text: '=' + document.formatPrimaryMoney(report.networth) + ' / ' + document.formatPrimaryMoney(report.annual_spending)
text: '=' + document.formatPrimaryMoney(report==null ? 0 : report.networth) + ' / ' + document.formatPrimaryMoney(report==null ? 0 : report.annual_spending)
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap
......@@ -63,7 +64,7 @@ Row {
id: msg
width: t1.width
height: t1.height
text: report.personal_finance_score_details.message
text: report==null ? null : report.personal_finance_score_details.message
fontSizeMode: Text.Fit
minimumPixelSize: 10
font.pixelSize: 72
......
......@@ -20,7 +20,8 @@ import QtQuick.Layouts 1.0
RowLayout {
id: grid
property var m: report.portfolio
property var m: report==null ? null : report.portfolio
property var pixel_size: report==null ? 0 : report.point_size
spacing: 2
function maxValues(m, id) {
......@@ -42,6 +43,7 @@ RowLayout {
Repeater {
model: m
SKGValue {
font.pixelSize: pixel_size
Layout.fillWidth: true
horizontalAlignment: index == 0 ? Text.AlignHCenter :(parent.modelId <=2 ? Text.AlignLeft : Text.AlignRight)
font.bold: index == 0
......
......@@ -20,13 +20,15 @@ import QtQuick.Layouts 1.0
ColumnLayout {
id: grid
property var m: report.scheduled_operations
property var m: report==null ? null : report.scheduled_operations
property var pixel_size: report==null ? 0 : report.point_size
spacing: 0
Repeater {
model: m
Row {
SKGValue {
font.pixelSize: pixel_size
id: l
text: modelData[1]
url: modelData[2]!="" ? "skg://skrooge_scheduled_plugin/?selection="+modelData[2] : ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment