Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
9bddc259
Commit
9bddc259
authored
Mar 06, 2021
by
Volker Krause
Browse files
Show vehicle load information also in the journey summary
parent
ee1f583e
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/app/JourneyQueryPage.qml
View file @
9bddc259
...
...
@@ -56,6 +56,7 @@ Kirigami.ScrollablePage {
App.JourneySummaryDelegate
{
journey
:
top
.
journey
visible
:
journeyView
.
currentIndex
!=
index
width
:
parent
.
width
}
QQC2.Button
{
text
:
i18n
(
"
Save
"
)
...
...
src/app/JourneySummaryDelegate.qml
View file @
9bddc259
...
...
@@ -13,8 +13,30 @@ import org.kde.itinerary 1.0
import
"
.
"
as
App
RowLayout
{
id
:
root
property
var
journey
function
maxLoad
(
loadInformation
)
{
var
load
=
Load
.
Unknown
;
for
(
var
i
=
0
;
i
<
loadInformation
.
length
;
++
i
)
{
load
=
Math
.
max
(
load
,
loadInformation
[
i
].
load
);
}
return
load
;
}
readonly
property
int
sectionWithMaxLoad
:
{
var
loadMax
=
Load
.
Unknown
;
var
loadMaxIdx
=
-
1
;
for
(
var
i
=
0
;
journey
!=
undefined
&&
i
<
journey
.
sections
.
length
;
++
i
)
{
var
l
=
maxLoad
(
journey
.
sections
[
i
].
loadInformation
);
if
(
l
>
loadMax
)
{
loadMax
=
l
;
loadMaxIdx
=
i
;
}
}
return
loadMaxIdx
;
}
Repeater
{
model
:
journey
.
sections
delegate
:
Kirigami.Icon
{
...
...
@@ -40,5 +62,10 @@ RowLayout {
}
QQC2.Label
{
text
:
i18np
(
"
One change
"
,
"
%1 changes
"
,
journey
.
numberOfChanges
)
Layout.fillWidth
:
true
}
App.VehicleLoadIndicator
{
loadInformation
:
sectionWithMaxLoad
<
0
?
undefined
:
root
.
journey
.
sections
[
sectionWithMaxLoad
].
loadInformation
}
}
src/app/TransferDelegate.qml
View file @
9bddc259
...
...
@@ -72,6 +72,7 @@ Kirigami.AbstractCard {
App.JourneySummaryDelegate
{
journey
:
transfer
.
journey
visible
:
transfer
.
state
==
Transfer
.
Selected
&&
!
journeyDetailsExpanded
width
:
parent
.
width
}
QQC2.Button
{
text
:
i18n
(
"
Select...
"
)
...
...
src/app/TransferPage.qml
View file @
9bddc259
...
...
@@ -88,6 +88,7 @@ Kirigami.ScrollablePage {
App.JourneySummaryDelegate
{
journey
:
top
.
journey
visible
:
journeyView
.
currentIndex
!=
index
width
:
parent
.
width
}
QQC2.Button
{
text
:
i18n
(
"
Select
"
)
...
...
src/app/VehicleLoadIndicator.qml
View file @
9bddc259
...
...
@@ -18,7 +18,7 @@ Item {
readonly
property
var
maxLoad
:
{
var
load
=
Load
.
Unknown
;
for
(
var
i
=
0
;
i
<
loadInformation
.
length
;
++
i
)
{
for
(
var
i
=
0
;
loadInformation
!=
undefined
&&
i
<
loadInformation
.
length
;
++
i
)
{
load
=
Math
.
max
(
load
,
loadInformation
[
i
].
load
);
}
return
load
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment