Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
glacier-home
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
glacier-home
Commits
61263bc7
Commit
61263bc7
authored
Aug 13, 2017
by
eekkelund
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[StatusBar] Add powersave options to Battery statusbar
parent
575c68d5
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
129 additions
and
25 deletions
+129
-25
MainScreen.qml
src/qml/MainScreen.qml
+11
-10
SwitcherItem.qml
src/qml/SwitcherItem.qml
+0
-9
BatteryPanel.qml
src/qml/statusbar/BatteryPanel.qml
+114
-4
CommonPanel.qml
src/qml/statusbar/CommonPanel.qml
+2
-1
SimPanel.qml
src/qml/statusbar/SimPanel.qml
+1
-1
WifiPanel.qml
src/qml/statusbar/WifiPanel.qml
+1
-0
No files found.
src/qml/MainScreen.qml
View file @
61263bc7
...
...
@@ -161,7 +161,7 @@ Page {
width
:
parent
.
width
height
:
parent
.
height
z
:
200
}
DeviceLockUI
{
id
:
codePad
visible
:
DeviceLock
.
state
==
DeviceLock
.
Locked
&&
codepadVisible
...
...
@@ -173,5 +173,6 @@ Page {
z
:
200
}
}
}
src/qml/SwitcherItem.qml
View file @
61263bc7
...
...
@@ -97,15 +97,6 @@ MouseArea {
script
:
switcherItemRoot
.
close
()
}
}
/* Label {
anchors {
top: parent.top
horizontalCenter: parent.horizontalCenter
topMargin: Theme.itemSpacingHuge
}
font.pointSize: Theme.fontSizeTiny
text: Lipstick.compositor.windowForId(model.window).title
}*/
CloseButton
{
id
:
closeButton
...
...
src/qml/statusbar/BatteryPanel.qml
View file @
61263bc7
...
...
@@ -32,16 +32,126 @@
import
QtQuick
2.1
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
import
QtQuick
.
Layouts
1.0
import
org
.
nemomobile
.
dbus
2.0
Component
{
CommonPanel
{
name
:
qsTr
(
"
Battery
"
);
switcherEnabled
:
false
ColumnLayout
{
anchors.fill
:
parent
spacing
:
Theme
.
itemSpacingSmall
Label
{
id
:
percentageLabel
text
:
qsTr
(
"
Level
"
)
+
"
:
"
+
batteryChargePercentage
.
value
+
"
%
"
font.pixelSize
:
Theme
.
fontSizeMedium
anchors.centerIn
:
parent
font.pixelSize
:
Theme
.
fontSizeSmall
anchors.leftMargin
:
Theme
.
itemSpacingSmall
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
Item
{
id
:
powerSaveWrapper
//Copyright Andrey Kozhevnikov https://github.com/CODeRUS/jolla-settings-powersave/blob/master/settings/mainpage.qml
Layout.fillWidth
:
true
Layout.fillHeight
:
true
property
string
key_threshold_value
:
"
/system/osso/dsm/energymanagement/psm_threshold
"
property
string
key_powersave_enable
:
"
/system/osso/dsm/energymanagement/enable_power_saving
"
property
string
key_powersave_force
:
"
/system/osso/dsm/energymanagement/force_power_saving
"
property
variant
threshold_value
property
variant
powersave_enable
property
variant
powersave_force
property
var
values
:
{
"
/system/osso/dsm/energymanagement/psm_threshold
"
:
50
,
"
/system/osso/dsm/energymanagement/enable_power_saving
"
:
true
,
"
/system/osso/dsm/energymanagement/force_power_saving
"
:
true
}
DBusInterface
{
id
:
mceRequestIface
service
:
'
com.nokia.mce
'
path
:
'
/com/nokia/mce/request
'
iface
:
'
com.nokia.mce.request
'
bus
:
DBus
.
SystemBus
function
setValue
(
key
,
value
)
{
typedCall
(
'
set_config
'
,
[{
"
type
"
:
"
s
"
,
"
value
"
:
key
},
{
"
type
"
:
"
v
"
,
"
value
"
:
value
}])
}
function
getValue
(
key
)
{
typedCall
(
'
get_config
'
,
[{
"
type
"
:
"
s
"
,
"
value
"
:
key
}],
function
(
value
)
{
var
temp
=
powerSaveWrapper
.
values
temp
[
key
]
=
value
powerSaveWrapper
.
values
=
temp
})
}
Component.onCompleted
:
{
getValue
(
powerSaveWrapper
.
key_threshold_value
)
getValue
(
powerSaveWrapper
.
key_powersave_enable
)
getValue
(
powerSaveWrapper
.
key_powersave_force
)
}
}
DBusInterface
{
id
:
mceSignalIface
service
:
'
com.nokia.mce
'
path
:
'
/com/nokia/mce/signal
'
iface
:
'
com.nokia.mce.signal
'
bus
:
DBus
.
SystemBus
signalsEnabled
:
true
function
config_change_ind
(
key
,
value
)
{
if
(
key
in
powerSaveWrapper
.
values
)
{
var
temp
=
powerSaveWrapper
.
values
temp
[
key
]
=
value
powerSaveWrapper
.
values
=
temp
}
}
}
CheckBox
{
id
:
enablePowerSave
property
string
entryPath
:
"
system_settings/info/powersave/powersave_enable
"
checked
:
powerSaveWrapper
.
values
[
powerSaveWrapper
.
key_powersave_enable
]
text
:
qsTr
(
"
Enable powersave mode
"
)
onClicked
:
mceRequestIface
.
setValue
(
powerSaveWrapper
.
key_powersave_enable
,
checked
)
}
Slider
{
id
:
powerSaveSlider
width
:
parent
.
width
-
Theme
.
itemHeightMedium
anchors.top
:
enablePowerSave
.
bottom
anchors.topMargin
:
Theme
.
itemSpacingSmall
property
string
entryPath
:
"
system_settings/info/powersave/powersave_threshold
"
minimumValue
:
1
maximumValue
:
99
//label: "Battery threshold"
showValue
:
true
stepSize
:
1
value
:
powerSaveWrapper
.
values
[
powerSaveWrapper
.
key_threshold_value
]
?
powerSaveWrapper
.
values
[
powerSaveWrapper
.
key_threshold_value
]
:
0
onPressedChanged
:
if
(
!
pressed
)
mceRequestIface
.
typedCall
(
'
set_config
'
,
[{
"
type
"
:
"
s
"
,
"
value
"
:
powerSaveWrapper
.
key_threshold_value
},
{
"
type
"
:
"
v
"
,
"
value
"
:
parseInt
(
value
)}])
}
CheckBox
{
id
:
forcePowerSave
anchors.top
:
powerSaveSlider
.
bottom
anchors.topMargin
:
Theme
.
itemSpacingSmall
property
string
entryPath
:
"
system_settings/info/powersave/powersave_force
"
checked
:
powerSaveWrapper
.
values
[
powerSaveWrapper
.
key_powersave_force
]
onClicked
:
mceRequestIface
.
setValue
(
powerSaveWrapper
.
key_powersave_force
,
checked
)
text
:
qsTr
(
"
Force powersave mode
"
)
}
}
}
}
}
src/qml/statusbar/CommonPanel.qml
View file @
61263bc7
...
...
@@ -83,6 +83,7 @@ Rectangle {
top
:
commonPanel
.
top
topMargin
:
Theme
.
itemSpacingLarge
}
height
:
nameLabel
.
height
width
:
parent
.
width
Label
{
id
:
nameLabel
...
...
@@ -115,7 +116,7 @@ Rectangle {
left
:
parent
.
left
leftMargin
:
Theme
.
itemSpacingLarge
top
:
actionColumn
.
bottom
topMargin
:
Theme
.
itemSpacing
Huge
*
1.5
topMargin
:
Theme
.
itemSpacing
Medium
}
}
//Just placeholder until IconButton will get merged
...
...
src/qml/statusbar/SimPanel.qml
View file @
61263bc7
...
...
@@ -139,7 +139,7 @@ Component {
visible
:
!
needsPin
text
:
qsTr
(
"
No pin required!
"
)
font.pixelSize
:
Theme
.
fontSizeMedium
anchors.
centerIn
:
parent
anchors.
horizontalCenter
:
parent
.
horizontalCenter
}
}
}
src/qml/statusbar/WifiPanel.qml
View file @
61263bc7
...
...
@@ -54,6 +54,7 @@ Component {
]
Repeater
{
anchors.top
:
parent
.
top
model
:
wifimodel
delegate
:
Item
{
width
:
wifiPanel
.
width
...
...
Write
Preview
Markdown
is supported
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