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
05dfe712
Commit
05dfe712
authored
Oct 19, 2017
by
m2ko
Committed by
eekkelund
Feb 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
broken lockscreen
parent
3eb6ebd9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
256 additions
and
45 deletions
+256
-45
lipstick-glacier-home-qt5.spec
rpm/lipstick-glacier-home-qt5.spec
+1
-0
glacierauthenticationinput.cpp
src/glacierauthenticationinput.cpp
+7
-0
glacierauthenticationinput.h
src/glacierauthenticationinput.h
+15
-0
main.cpp
src/main.cpp
+3
-0
DeviceLockUI.qml
src/qml/DeviceLockUI.qml
+54
-27
Lockscreen.qml
src/qml/Lockscreen.qml
+154
-0
MainScreen.qml
src/qml/MainScreen.qml
+3
-3
compositor.qml
src/qml/compositor.qml
+11
-11
src.pro
src/src.pro
+8
-4
No files found.
rpm/lipstick-glacier-home-qt5.spec
View file @
05dfe712
...
...
@@ -27,6 +27,7 @@ BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(lipstick-qt5) >= 0.12.0
BuildRequires: pkgconfig(Qt5Compositor)
BuildRequires: pkgconfig(nemodevicelock)
Provides: lipstick-colorful-home-qt5
...
...
src/glacierauthenticationinput.cpp
0 → 100644
View file @
05dfe712
#include "glacierauthenticationinput.h"
/*GlacierAuthenticationInput::GlacierAuthenticationInput()
{
}
*/
src/glacierauthenticationinput.h
0 → 100644
View file @
05dfe712
#ifndef GLACIERAUTHENTICATIONINPUT_H
#define GLACIERAUTHENTICATIONINPUT_H
#include <nemo-devicelock/authenticationinput.h>
class
GlacierAuthenticationInput
:
public
NemoDeviceLock
::
AuthenticationInput
{
Q_OBJECT
public:
explicit
GlacierAuthenticationInput
(
QObject
*
parent
=
nullptr
)
:
NemoDeviceLock
::
AuthenticationInput
(
DeviceLock
,
parent
)
{
}
};
#endif // GLACIERAUTHENTICATIONINPUT_H
src/main.cpp
View file @
05dfe712
...
...
@@ -29,6 +29,8 @@
#include <QQmlContext>
#include "glacierwindowmodel.h"
#include <QScreen>
#include "glacierauthenticationinput.h"
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -60,6 +62,7 @@ int main(int argc, char **argv)
nativeOrientation
=
app
.
primaryScreen
()
->
primaryOrientation
();
app
.
engine
()
->
rootContext
()
->
setContextProperty
(
"nativeOrientation"
,
nativeOrientation
);
qmlRegisterType
<
GlacierWindowModel
>
(
"org.nemomobile.glacier"
,
1
,
0
,
"GlacierWindowModel"
);
qmlRegisterType
<
GlacierAuthenticationInput
>
(
"org.nemomobile.glacierauthentication"
,
1
,
0
,
"GlacierAuthenticationInput"
);
app
.
setQmlPath
(
"/usr/share/lipstick-glacier-home-qt5/qml/MainScreen.qml"
);
// Give these to the environment inside the lipstick homescreen
// Fixes a bug where some applications wouldn't launch, eg. terminal or browser
...
...
src/qml/DeviceLockUI.qml
View file @
05dfe712
...
...
@@ -4,6 +4,7 @@ import QtQuick.Controls.Nemo 1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
import
QtQuick
.
Layouts
1.0
import
org
.
nemomobile
.
glacierauthentication
1.0
import
org
.
nemomobile
.
lipstick
0.1
import
org
.
nemomobile
.
devicelock
1.0
...
...
@@ -12,50 +13,51 @@ import "scripts/desktop.js" as Desktop
Item
{
id
:
root
property
bool
shouldAuthenticate
:
Lipstick
.
compositor
.
visible
&&
authenticator
.
availableMethods
!==
0
property
bool
shouldAuthenticate
:
Lipstick
.
compositor
.
visible
//&& asd.availableMethods !== 0
property
int
remainingAttempts
property
AuthenticationInput
authenticationInput
signal
codeEntered
(
string
code
)
onShouldAuthenticateChanged
:
{
if
(
shouldAuthenticate
)
{
DeviceLock
.
authorization
.
requestChallenge
()
//console.log("Requesting security code "+ authenticationInput.status)
//authenticationInput.requestSecurityCode()
//DeviceLock.authorization.requestChallenge()
}
else
{
authenticator
.
cancel
()
DeviceLock
.
authorization
.
relinquishChallenge
()
//
authenticator.cancel()
//
DeviceLock.authorization.relinquishChallenge()
}
}
Component.onCompleted
:
{
DeviceLock
.
authorization
.
requestChallenge
()
}
/*Component.onCompleted: {
console.log("Requesting security code "+ authenticationInput.Status)
authenticationInput.requestSecurityCode()
}*/
Connections
{
/*
Connections {
target: DeviceLock.authorization
onChallengeIssued: {
authenticator.authenticate(
DeviceLock.authorization.challengeCode,
DeviceLock.authorization.allowedMethods)
}
}
}
*/
Authenticator
{
id
:
authenticator
onAuthenticated
:
{
DeviceLock
.
unlock
(
authenticationToken
)
Desktop
.
instance
.
setLockScreen
(
false
)
Desktop
.
instance
.
codepadVisible
=
false
remainingAttempts
=
0
id
:
auth
Component.onCompleted
:
{
console
.
log
(
"
Requesting challenge
"
)
Authorization
.
requestChallege
()
}
onFeedback
:
{
console
.
log
(
'
### still locked
'
,
feedback
,
attemptsRemaining
)
remainingAttempts
=
attemptsRemaining
animation
.
start
()
onAuthenticated
:
{
console
.
log
(
"
Authenticated:
"
+
DeviceLock
.
state
)
}
}
ColumnLayout
{
anchors.fill
:
parent
spacing
:
Theme
.
itemSpacing
ExtraSmall
spacing
:
Theme
.
itemSpacing
Large
SequentialAnimation
{
id
:
animation
;
...
...
@@ -91,18 +93,29 @@ Item {
delegate
:
Button
{
id
:
button
opacity
:
1
Layout.maximumWidth
:
Theme
.
itemWidthSmall
Layout.maximumHeight
:
Theme
.
itemHeightHuge
*
2
Layout.minimumHeight
:
Theme
.
itemHeightHuge
*
1.5
text
:
modelData
Text
{
id
:
numLabel
text
:
modelData
font.pixelSize
:
Theme
.
fontSizeLarge
anchors.centerIn
:
parent
color
:
"
white
"
}
onClicked
:
{
if
(
button
.
text
!==
"
Ca
"
&&
button
.
text
!==
"
OK
"
)
{
lockCodeField
.
insert
(
lockCodeField
.
cursorPosition
,
button
.
text
)
if
(
numLabel
.
text
!==
"
Ca
"
&&
numLabel
.
text
!==
"
OK
"
)
{
//console.log(authenticationInput.Status)
lockCodeField
.
insert
(
lockCodeField
.
cursorPosition
,
numLabel
.
text
)
}
else
{
if
(
button
.
text
===
"
OK
"
)
{
authenticator
.
enterLockCode
(
lockCodeField
.
text
)
if
(
numLabel
.
text
===
"
OK
"
)
{
console
.
log
(
"
DeviceLockUI:
"
+
auth
.
availableMethods
)
auth
.
authenticate
(
Authorization
.
challengeCode
,
auth
.
availableMethods
)
//authenticationInput.enterSecurityCode(lockCodeField.text)
//codeEntered(lockCodeField.text)
lockCodeField
.
text
=
""
}
else
if
(
button
.
text
===
"
Ca
"
){
}
else
if
(
numLabel
.
text
===
"
Ca
"
){
lockCodeField
.
text
=
""
}
}
...
...
@@ -111,4 +124,18 @@ Item {
}
}
}
function
displayFeedback
(
feedback
,
data
)
{
console
.
log
(
"
DisplayFeedBack
"
+
feedback
+
"
"
+
data
)
}
function
displayError
(
error
)
{
console
.
log
(
"
displayError
"
+
error
)
}
Connections
{
target
:
root
.
authenticationInput
onFeedback
:
root
.
displayFeedback
(
feedback
,
data
)
onError
:
root
.
displayError
(
error
)
}
}
src/qml/Lockscreen.qml
View file @
05dfe712
...
...
@@ -3,6 +3,7 @@ import QtQuick 2.6
import
org
.
nemomobile
.
lipstick
0.1
import
org
.
nemomobile
.
devicelock
1.0
import
org
.
nemomobile
.
configuration
1.0
import
org
.
nemomobile
.
glacierauthentication
1.0
import
"
notifications
"
...
...
@@ -27,15 +28,119 @@ Image {
}
}
// Swipes on the lockscreen
MouseArea
{
id
:
mouseArea
property
bool
gestureStarted
:
false
property
string
gesture
:
""
property
int
startX
property
int
threshold
:
Theme
.
itemHeightHuge
*
2
property
int
swipeDistance
property
string
action
:
""
anchors.fill
:
parent
onPressed
:
{
startX
=
mouseX
;
}
onMouseXChanged
:
{
// Checks which swipe
if
(
mouseX
>
(
startX
+
threshold
))
{
gesture
=
"
right
"
gestureStarted
=
true
;
}
else
if
(
mouseX
<
(
startX
+
threshold
))
{
gesture
=
"
left
"
gestureStarted
=
true
;
}
// Makes codepad follow the swipe
if
(
codePad
.
inView
)
{
if
(
gesture
==
"
right
"
)
{
swipeDistance
=
mouseX
-
startX
codePad
.
x
=
swipeDistance
}
if
(
gesture
==
"
left
"
)
{
swipeDistance
=
startX
-
mouseX
codePad
.
x
=
-
swipeDistance
}
}
else
{
if
(
gesture
==
"
right
"
)
{
swipeDistance
=
mouseX
-
startX
codePad
.
x
=
swipeDistance
-
parent
.
width
}
else
if
(
gesture
==
"
left
"
)
{
swipeDistance
=
startX
-
mouseX
codePad
.
x
=
parent
.
width
-
swipeDistance
}
}
}
// Animation to sna codepad into view or out of view
onReleased
:
{
if
(
codePad
.
inView
)
{
if
(
gesture
==
"
right
"
)
{
if
(
swipeDistance
>
threshold
)
{
startCodePadAnimation
(
parent
.
width
)
codePad
.
inView
=
false
}
else
{
startCodePadAnimation
(
0
)
codePad
.
inView
=
true
}
}
else
if
(
gesture
==
"
left
"
)
{
if
(
swipeDistance
>
threshold
)
{
startCodePadAnimation
(
-
parent
.
width
)
codePad
.
inView
=
false
}
else
{
startCodePadAnimation
(
0
)
codePad
.
inView
=
true
}
}
}
else
{
if
(
swipeDistance
>
threshold
)
{
startCodePadAnimation
(
0
)
codePad
.
inView
=
true
}
else
{
if
(
gesture
==
"
right
"
)
{
startCodePadAnimation
(
-
parent
.
width
)
codePad
.
inView
=
false
}
else
{
startCodePadAnimation
(
parent
.
width
)
codePad
.
inView
=
false
}
}
}
gestureStarted
=
false
}
function
startCodePadAnimation
(
value
)
{
snapCodePadAnimation
.
valueTo
=
value
snapCodePadAnimation
.
start
()
}
}
SequentialAnimation
{
id
:
snapCodePadAnimation
property
alias
valueTo
:
codePadAnimation
.
to
NumberAnimation
{
id
:
codePadAnimation
target
:
codePad
property
:
"
x
"
duration
:
200
easing.type
:
Easing
.
OutQuint
}
}
Connections
{
target
:
Lipstick
.
compositor
onDisplayOff
:
{
displayOn
=
false
displayOffTimer
.
stop
()
codePad
.
x
=
-
parent
.
width
codePad
.
inView
=
false
}
onDisplayOn
:{
displayOn
=
true
...
...
@@ -66,7 +171,56 @@ Image {
}
}
}
DeviceLockUI
{
id
:
codePad
property
bool
inView
:
false
property
bool
gestureStarted
:
mouseArea
.
gestureStarted
x
:
1000
visible
:
DeviceLock
.
state
==
DeviceLock
.
Locked
&&
lockscreenVisible
()
width
:
lockScreen
.
width
height
:
lockScreen
.
height
/
2
onCodeEntered
:
{
//authenticationInput.enterSecurityCode(code)
console
.
log
(
"
Security code entered:
"
+
authenticationInput
.
minimumCodeLength
)
}
authenticationInput
:
GlacierAuthenticationInput
{
property
bool
unlocked
:
DeviceLock
.
state
>=
DeviceLock
.
Locked
registered
:
true
//active: lockscreenVisible()
onUnlockedChanged
:
console
.
log
(
"
Unlock
"
)
onStatusChanged
:
{
console
.
log
(
"
Status changed
"
)
}
onAuthenticationUnavailable
:
{
console
.
log
(
"
Authentication unavailable:
"
+
error
)
}
onFeedback
:
{
console
.
log
(
"
Feedback:
"
+
feedback
)
}
onAuthenticationStarted
:
{
console
.
log
(
"
Authentication started
"
)
}
onAuthenticationEnded
:
{
console
.
log
(
"
Ended
"
+
confirmed
)
}
}
anchors
{
verticalCenter
:
lockScreen
.
verticalCenter
}
onGestureStartedChanged
:
{
if
(
gestureStarted
)
{
mouseArea
.
z
=
2
}
else
{
mouseArea
.
z
=
0
}
}
}
ListView
{
id
:
notificationColumn
opacity
:
codePad
.
visible
?
1
-
codePad
.
opacity
:
1
...
...
src/qml/MainScreen.qml
View file @
05dfe712
...
...
@@ -66,9 +66,10 @@ Page {
id
:
desktop
property
alias
lockscreen
:
lockScreen
property
alias
switcher
:
switcher
property
alias
codepad
:
codePad
//
property alias codepad: codePad
property
int
statusBarHeight
:
statusbar
.
height
property
bool
codepadVisible
:
false
property
bool
deviceLocked
:
DeviceLock
.
state
>=
DeviceLock
.
Locked
// Implements back key navigation
...
...
@@ -80,7 +81,6 @@ Page {
}
else
{
Qt
.
quit
();
}
}
}
Statusbar
{
id
:
statusbar
enabled
:
DeviceLock
.
state
!==
DeviceLock
.
Locked
...
...
@@ -165,7 +165,7 @@ Page {
}
Lockscreen
{
id
:
lockScreen
visible
:
lockscreenVisible
()
//DeviceLock.state == DeviceLock.Locked
visible
:
lockscreenVisible
()
width
:
parent
.
width
height
:
parent
.
height
z
:
200
...
...
src/qml/compositor.qml
View file @
05dfe712
...
...
@@ -137,7 +137,7 @@ Compositor {
property
real
lockThreshold
:
0.25
property
int
lockscreenX
property
int
lockscreenY
enabled
:
true
//!Desktop.instance.codepadVisible//
DeviceLock.state != DeviceLock.Locked
enabled
:
DeviceLock
.
state
!=
DeviceLock
.
Locked
onGestureStarted
:
{
swipeAnimation
.
stop
()
...
...
@@ -148,13 +148,13 @@ Compositor {
state
=
"
swipe
"
}
else
if
(
!
root
.
appActive
&&
DeviceLock
.
state
!==
DeviceLock
.
Locked
)
{
state
=
"
lock
"
state
=
"
cover
"
}
else
if
(
Desktop
.
instance
.
lockscreenVisible
()
&&
DeviceLock
.
state
===
DeviceLock
.
Locked
&&
!
Desktop
.
instance
.
codepadVisible
)
{
state
=
"
pullCodepad
"
//
state = "pullCodepad"
}
else
if
(
Desktop
.
instance
.
lockscreenVisible
()
&&
DeviceLock
.
state
===
DeviceLock
.
Locked
&&
Desktop
.
instance
.
codepadVisible
)
{
state
=
"
pushCodepad
"
//
state = "pushCodepad"
}
}
...
...
@@ -182,7 +182,7 @@ Compositor {
if
(
gesture
==
"
down
"
)
{
setDisplayOff
()
}
}
}
/*
// Brings up codepad, only left and right swipes allowed for it for now
else if (Desktop.instance.lockscreenVisible() && !Desktop.instance.codepad.visible && DeviceLock.state == DeviceLock.Locked && (gesture !== "down" && gesture !== "up")) {
Desktop.instance.codepadVisible = true
...
...
@@ -190,7 +190,7 @@ Compositor {
// Hides codepad but does not unlock the code, only left and right swipes allowed for now
else if (Desktop.instance.lockscreenVisible() && Desktop.instance.codepad.visible && DeviceLock.state == DeviceLock.Locked && gesture !== "down" && gesture !== "up") {
Desktop.instance.codepadVisible = false
}
}
*/
// Unlocks if no security code required
else
if
(
DeviceLock
.
state
!==
DeviceLock
.
Locked
&&
Desktop
.
instance
.
lockscreenVisible
())
{
Desktop
.
instance
.
setLockScreen
(
false
)
...
...
@@ -218,9 +218,9 @@ Compositor {
y
:
gestureArea
.
horizontal
?
0
:
gestureArea
.
value
}
},
//
Lock state is for when screen is lock
ed but no security code required, can be swiped from any edge
//
Cover state is for when screen is cover
ed but no security code required, can be swiped from any edge
State
{
name
:
"
lock
"
name
:
"
cover
"
when
:
Desktop
.
instance
.
lockscreenVisible
()
PropertyChanges
{
target
:
Desktop
.
instance
.
lockscreen
...
...
@@ -249,11 +249,11 @@ Compositor {
Desktop
.
instance
.
lockscreen
.
height
:
Desktop
.
instance
.
lockscreen
.
width
)
+
gestureArea
.
value
)
)
)
}
}
,
}
/*
// pullCodepad is when you are pulling codepad into view to enter security code
State {
name: "pullCodepad"
when
:
Desktop
.
instance
.
codepadVisible
when: De
viceLock.state >= DeviceLock.Locked//De
sktop.instance.codepadVisible
PropertyChanges {
target: Desktop.instance
codepadVisible: true
...
...
@@ -306,7 +306,7 @@ Compositor {
opacity: 1 - (gestureArea.horizontal ? (gestureArea.value < 0 ? (gestureArea.value / -Desktop.instance.lockscreen.width) :
gestureArea.value / Desktop.instance.lockscreen.width) : 0)
}
}
}
*/
]
...
...
src/src.pro
View file @
05dfe712
...
...
@@ -99,15 +99,19 @@ CONFIG += qt link_pkgconfig
QT += quick compositor
DEFINES += QT_COMPOSITOR_QUICK
HEADERS += \
glacierwindowmodel.h
glacierwindowmodel.h \
glacierauthenticationinput.h
QT += dbus
LIBS += -lnemodevicelock
MOC_DIR = .moc
SOURCES += \
main.cpp \
glacierwindowmodel.cpp
glacierwindowmodel.cpp \
glacierauthenticationinput.cpp
PKGCONFIG += lipstick-qt5
PKGCONFIG += lipstick-qt5 \
nemodevicelock
OTHER_FILES += qml
/*
.qml \
qml/MainScreen.qml \
...
...
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