Skip to content

Commit

Permalink
Merge pull request #46 from neochapay/master
Browse files Browse the repository at this point in the history
Code update
  • Loading branch information
locusf authored Dec 2, 2016
2 parents d0e6d6e + 43c6a05 commit fdad8f2
Show file tree
Hide file tree
Showing 15 changed files with 253 additions and 80 deletions.
4 changes: 4 additions & 0 deletions rpm/lipstick-glacier-home-qt5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Requires: qt5-qtquickcontrols-nemo
Requires: nemo-qml-plugin-contextkit-qt5
Requires: connman-qt5
Requires: libqofono-qt5-declarative
Requires: nemo-theme-glacier
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(lipstick-qt5) >= 0.12.0
Expand Down Expand Up @@ -78,3 +79,6 @@ ln -s ../lipstick.service %{buildroot}%{_libdir}/systemd/user/user-session.targe
%{_datadir}/lipstick-glacier-home-qt5/qml
# >> files
# << files

%post
systemctl-user --no-block restart lipstick.service
111 changes: 111 additions & 0 deletions src/i18n/glacer-home.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>AppLauncher</name>
<message>
<location filename="../qml/AppLauncher.qml" line="67"/>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AppLauncher.qml" line="82"/>
<source>Uninstall</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AppSwitcher</name>
<message>
<location filename="../qml/AppSwitcher.qml" line="173"/>
<source>Close
All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/AppSwitcher.qml" line="187"/>
<source>No apps open</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BatteryPanel</name>
<message>
<location filename="../qml/BatteryPanel.qml" line="39"/>
<source>Battery level</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CommonPanel</name>
<message>
<location filename="../qml/CommonPanel.qml" line="42"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LauncherItemDelegate</name>
<message>
<location filename="../qml/LauncherItemDelegate.qml" line="147"/>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LauncherItemDelegate.qml" line="148"/>
<source>Uninstall</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LauncherItemDelegate.qml" line="170"/>
<source>Removing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/LauncherItemDelegate.qml" line="172"/>
<source>Uninstalling</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SimPanel</name>
<message>
<location filename="../qml/SimPanel.qml" line="76"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SimPanel.qml" line="87"/>
<source>Clear</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/SimPanel.qml" line="135"/>
<source>No pin required!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>USBModeSelector</name>
<message>
<location filename="../qml/USBModeSelector.qml" line="82"/>
<source>Current mode: Charging only</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/USBModeSelector.qml" line="98"/>
<source>MTP Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/USBModeSelector.qml" line="118"/>
<source>Mass Storage Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/USBModeSelector.qml" line="138"/>
<source>Developer Mode</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
4 changes: 2 additions & 2 deletions src/qml/AppLauncher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ GridView {
Label {
id: removeLabel
anchors.centerIn: parent
text: "Remove"
text: qsTr("Remove")
font.pointSize: 8
}
}
Expand All @@ -79,7 +79,7 @@ GridView {
Label {
id: uninstallLabel
anchors.centerIn: parent
text: "Uninstall"
text: qsTr("Uninstall")
font.pointSize: 8
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/qml/AppSwitcher.qml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Item {
}
style: ButtonStyle {
label: Label {
text: "Close\nAll"
text: qsTr("Close\nAll")
anchors.margins: 10
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
Expand All @@ -184,7 +184,7 @@ Item {
// Empty switcher indicator
Label {
visible: switcherModel.itemCount === 0
text: "No apps open"
text: qsTr("No apps open")
width: parent.width
fontSizeMode: Text.HorizontalFit
}
Expand Down
2 changes: 1 addition & 1 deletion src/qml/BatteryPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import QtQuick.Controls.Styles.Nemo 1.0
Component {
CommonPanel {
Label {
text: "Battery level: " + batteryChargePercentage.value + "%"
text: qsTr("Battery level")+ ": " + batteryChargePercentage.value + "%"
font.pointSize: 8
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/qml/CommonPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Rectangle {
color: "#313131"
opacity: 0.5
Button {
text: "Close"
text: qsTr("Close")
anchors.bottom: parent.bottom
anchors.right: parent.right
onClicked: {
Expand Down
52 changes: 0 additions & 52 deletions src/qml/DeviceLock.qml

This file was deleted.

86 changes: 86 additions & 0 deletions src/qml/DeviceLockUI.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.Layouts 1.0

import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0

Item {
id: root

property bool shouldAuthenticate: Lipstick.compositor.visible
&& authenticator.availableMethods !== 0
onShouldAuthenticateChanged: {
if (shouldAuthenticate) {
DeviceLock.authorization.requestChallenge()
} else {
authenticator.cancel()
DeviceLock.authorization.relinquishChallenge()
}
}

Component.onCompleted: {
DeviceLock.authorization.requestChallenge()
}

Connections {
target: DeviceLock.authorization
onChallengeIssued: {
authenticator.authenticate(
DeviceLock.authorization.challengeCode,
DeviceLock.authorization.allowedMethods)
}
}


Authenticator {
id: authenticator
onAuthenticated: {
DeviceLock.unlock(authenticationToken)
}
onFeedback: {
console.log('### still locked', feedback, attemptsRemaining)
}
}

ColumnLayout {
anchors.fill: parent
spacing: 40

TextField {
id: lockCodeField
readOnly: true
echoMode: TextInput.PasswordEchoOnEdit
anchors.horizontalCenter: parent.horizontalCenter
}

GridLayout {
height: parent.height
width: parent.width
columns: 3
Repeater {
model: ["1","2","3","4","5","6","7","8","9","Ca","0","OK"]
delegate:
Button {
style: ButtonStyle {}
Layout.fillWidth: true
text: modelData
onClicked: {
if (text !== "Ca" && text !== "OK") {
lockCodeField.insert(lockCodeField.cursorPosition, text)
} else {
if (text === "OK") {
authenticator.enterLockCode(lockCodeField.text)
lockCodeField.text = ""
} else if (text === "Ca"){
lockCodeField.text = ""
}
}
}
}
}
}
}
}
8 changes: 4 additions & 4 deletions src/qml/LauncherItemDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ Item {
reorderItem = null
pager.interactive = true
gridview.onUninstall = false
deleter.remove.text = "Remove"
deleter.uninstall.text = "Uninstall"
deleter.remove.text = qsTr("Remove")
deleter.uninstall.text = qsTr("Uninstall")

reparent(gridview.contentItem)

Expand All @@ -167,9 +167,9 @@ Item {
var delPos = deleter.remove.mapFromItem(launcherItem, width/2, height/2)
var isdel = deleter.childAt(delPos.x, delPos.y)
if (isdel === deleter.remove) {
deleter.remove.text = "Removing " + iconCaption
deleter.remove.text = qsTr("Removing") + " " + iconCaption
} else if (isdel === deleter.uninstall) {
deleter.uninstall.text = "Uninstalling " + iconCaption
deleter.uninstall.text = qsTr("Uninstalling") + " " + iconCaption
}
if (newIndex !== idx) {
reorderTimer.restart()
Expand Down
28 changes: 22 additions & 6 deletions src/qml/Lockscreen.qml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import QtQuick 2.0

import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
import org.nemomobile.configuration 1.0

Image {
id: lockScreen
source: "qrc:/qml/images/graphics-wallpaper-home.jpg"
visible: LipstickSettings.lockscreenVisible || deviceLock.state === 1
source: lockScreenWallpaper.value
fillMode: Image.PreserveAspectCrop

ConfigurationValue{
id: lockScreenWallpaper
key: "/home/glacier/lockScreen/wallpaperImage"
defaultValue: "qrc:/qml/images/graphics-wallpaper-home.jpg"
}

LockscreenClock {
id: clock
Expand All @@ -13,15 +23,21 @@ Image {
right: parent.right
}
}
DeviceLock {
DeviceLockUI {
id: deviceLockUI
anchors.fill: parent
visible: deviceLock.state === 1
anchors {
top: clock.bottom
left: parent.left
}

height: parent.height-clock.height
width: parent.width

//visible:
z: 201
}

MouseArea {
anchors.fill: parent
}
}

Loading

0 comments on commit fdad8f2

Please sign in to comment.