Remove unused components

This commit is contained in:
Devin Lin 2021-12-05 17:28:15 -05:00 committed by Devin Lin
parent dca28b134d
commit 2b1e6f12f8
5 changed files with 0 additions and 393 deletions

View file

@ -19,11 +19,6 @@ Contains components such as:
Dependencies: Dependencies:
* KDE Frameworks 5 setup (plasma-framework and its dependencies) * KDE Frameworks 5 setup (plasma-framework and its dependencies)
* oFono https://git.kernel.org/cgit/network/ofono/ofono.git
* libqofono https://git.merproject.org/mer-core/libqofono
* ofono-phonesim https://git.kernel.org/cgit/network/ofono/phonesim.git/
If you want to test some part specific to telephony, set up ofono-phonesim according to https://docs.plasma-mobile.org/Ofono.html
To start the phone homescreen in a window, run: To start the phone homescreen in a window, run:
``` ```

View file

@ -1,48 +0,0 @@
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
Text {
width: parent.width / parent.columns
height: parent.buttonHeight
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
color: dialer.textColor
font.pixelSize: Math.floor((width - (PlasmaCore.Units.largeSpacing)) / 2)
property alias sub: longHold.text
property var callback
MouseArea {
anchors.fill: parent
onClicked: {
if (callback) {
callback();
} else {
addNumber(parent.text);
}
}
onPressAndHold: {
if (longHold.visible) {
addNumber(longHold.text);
} else {
addNumber(parent.text);
}
}
}
Text {
id: longHold
anchors {
top: parent.top
right: parent.right
}
height: parent.height
width: parent.width / 3
verticalAlignment: Qt.AlignVCenter
visible: text.length > 0
opacity: 0.7
font.pixelSize: parent.pixelSize * .8
color: parent.color
}
}

View file

@ -1,37 +0,0 @@
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
width: parent.width / parent.columns
height: parent.buttonHeight
property var callback
property string text
property string sub
property alias source: icon.source
PlasmaCore.IconItem {
id: icon
width: PlasmaCore.Units.iconSizes.medium
height: width
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: {
if (callback) {
callback();
} else {
addNumber(parent.text);
}
}
onPressAndHold: {
if (parent.sub.length > 0) {
addNumber(parent.sub);
} else {
addNumber(parent.text);
}
}
}
}

View file

@ -13,8 +13,6 @@ import org.kde.plasma.shell 2.0 as Shell
import org.kde.plasma.workspace.components 2.0 as PlasmaWorkspace import org.kde.plasma.workspace.components 2.0 as PlasmaWorkspace
import org.kde.kquickcontrolsaddons 2.0 import org.kde.kquickcontrolsaddons 2.0
import org.kde.activities 0.1 as Activities import org.kde.activities 0.1 as Activities
//import "../components"
Rectangle { Rectangle {
id: root id: root
@ -56,17 +54,6 @@ Rectangle {
} }
} }
Loader {
id: pinOverlay
anchors {
fill: parent
topMargin: containment ? containment.availableScreenRect.y : 0
bottomMargin: parent.height - (containment ? (containment.availableScreenRect.height + containment.availableScreenRect.y) : 0)
}
z: 222
source: Qt.resolvedUrl("Pin.qml")
}
onContainmentChanged: { onContainmentChanged: {
containment.parent = root; containment.parent = root;
containment.visible = true; containment.visible = true;

View file

@ -1,290 +0,0 @@
/*
* SPDX-FileCopyrightText: 2014 Aaron Seigo <aseigo@kde.org>
* SPDX-FileCopyrightText: 2014 Marco Martin <mart@kde.org>
*
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtQuick.Controls 2.5
import org.kde.plasma.core 2.0 as PlasmaCore
import QtGraphicalEffects 1.12
import org.kde.plasma.components 3.0 as PlasmaComponents
import MeeGo.QOfono 0.2
import "../components"
PlasmaCore.ColorScope {
id: root
anchors.fill: parent
visible: simManager.pinRequired != OfonoSimManager.NoPin
property OfonoSimManager simManager: ofonoSimManager
property string pin: ""
property var lastKey: ""
property var puk: ""
property var newPin: ""
property bool pinsNotEqual: false
property color buttonColor: Qt.lighter(PlasmaCore.Theme.backgroundColor, 1.3)
property color buttonPressedColor: Qt.darker(PlasmaCore.Theme.backgroundColor, 1.08)
Connections {
target: simManager
function onEnterPinComplete(error, errorString) {
if(error === 0) root.visible = false
}
}
OfonoManager {
id: ofonoManager
}
OfonoSimManager {
id: ofonoSimManager
modemPath: ofonoManager.modems.length > 0 ? ofonoManager.modems[0] : ""
}
Rectangle {
id: pinScreen
anchors.fill: parent
MouseArea { //Catch input
anchors.fill: parent
}
color: Qt.hsla(PlasmaCore.Theme.backgroundColor.hslHue, PlasmaCore.Theme.backgroundColor.hslSaturation, PlasmaCore.Theme.backgroundColor.hslLightness, 0.85)
function backspace() {
root.lastKey = ""
root.pin = root.pin.substr(0, root.pin.length - 1)
}
function clear() {
root.lastKey = ""
root.pin = ""
}
function enter() {
lastKey = ""
pinsNotEqual = false
if(simManager.pinRequired === 9) {
if(puk === "") {
root.puk = root.pin
root.pin = ""
return
} else if(root.newPin !== "") {
if(root.newPin === root.pin) {
simManager.resetPin(simManager.pinRequired, root.puk, root.pin)
clear()
root.puk = ""
root.newPin = ""
} else {
root.newPin = ""
pinsNotEqual = true
}
} else {
root.newPin = root.pin
root.pin = ""
return
}
}
simManager.enterPin(simManager.pinRequired, root.pin);
clear()
}
function keyPress(data) {
root.lastKey = data;
root.pin += data
letterTimer.restart();
}
Keys.onPressed: {
if (event.modifiers === Qt.NoModifier) {
if (event.key === Qt.Key_Backspace) {
pinScreen.backspace();
} else if (event.key === Qt.Key_Return) {
pinScreen.enter();
} else if("0123456789".includes(event.text)) {
pinScreen.keyPress(event.text);
}
}
}
// trigger turning letter into dot after 500 milliseconds
Timer {
id: letterTimer
interval: 500
running: false
repeat: false
onTriggered: {
root.lastKey = "";
}
}
ColumnLayout {
anchors.fill: parent
anchors.topMargin: 2*PlasmaCore.Units.gridUnit
anchors.bottomMargin: PlasmaCore.Units.gridUnit
spacing: PlasmaCore.Units.gridUnit
// pin dot display
Item {
Layout.alignment: Qt.AlignCenter
Layout.fillWidth: true
// label ("wrong pin", "enter pin")
Label {
id: simLabel
visible: root.pin.length === 0
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pointSize: 18
color: PlasmaCore.Theme.textColor
text: {
switch (simManager.pinRequired) {
case OfonoSimManager.NoPin: return i18n("No pin (error)");
case OfonoSimManager.SimPin: return i18n("Enter Sim PIN");
case OfonoSimManager.SimPin2: return i18n("Enter Sim PIN 2");
case OfonoSimManager.SimPuk: {
if(root.puk === "") return i18n("Enter Sim PUK");
else if(pinsNotEqual) return i18n("Pins don't match. Try again");
else if(root.newPin === "") return i18n("Choose new Pin");
else return i18n("Confirm new Pin");
}
case OfonoSimManager.SimPuk2: return i18n("Enter Sim PUK 2");
default: return i18n("Unknown PIN type: %1", simManager.pinRequired);
}
}
}
Label {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: simLabel.bottom
anchors.topMargin: PlasmaCore.Units.gridUnit
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pointSize: 12
color: PlasmaCore.Theme.textColor
visible: (simManager.pinRequired !== OfonoSimManager.SimPuk) || root.puk === ""
text: simManager.pinRetries && simManager.pinRetries[simManager.pinRequired] ? i18np("%1 attempt left", "%1 attempts left", simManager.pinRetries[simManager.pinRequired]) : ""
}
// dot display and letter
RowLayout {
id: dotDisplay
anchors.centerIn: parent
height: PlasmaCore.Units.gridUnit * 2.5 // maintain height when letter is shown
spacing: 6
Repeater {
model: root.pin.length
delegate: Rectangle { // dot
visible: index !== root.pin.length-1 || root.lastKey === "" // hide dot if number is shown
Layout.preferredWidth: PlasmaCore.Units.gridUnit * 0.5
Layout.preferredHeight: Layout.preferredWidth
Layout.alignment: Qt.AlignVCenter
radius: width
color: PlasmaCore.Theme.textColor
}
}
Label { // number/letter
visible: root.lastKey !== "" // hide label if no label needed
Layout.alignment: Qt.AlignHCenter
color: PlasmaCore.Theme.textColor
text: root.lastKey
font.pointSize: 20
}
}
}
// number keys
GridLayout {
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
Layout.leftMargin: PlasmaCore.Units.gridUnit * 0.5
Layout.rightMargin: PlasmaCore.Units.gridUnit * 0.5
Layout.maximumWidth: PlasmaCore.Units.gridUnit * 22
Layout.maximumHeight: (root.height > root.width) ? PlasmaCore.Units.gridUnit * 17.5 : PlasmaCore.Units.gridUnit * 12.5
columns: 3
Repeater {
model: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "R", "0", "E"]
delegate: Item {
Layout.fillWidth: true
Layout.fillHeight: true
Rectangle {
id: keyRect
anchors.centerIn: parent
width: parent.width
height: parent.height
radius: 5
color: root.buttonColor
visible: modelData.length > 0
AbstractButton {
anchors.fill: parent
onPressed: parent.color = root.buttonPressedColor
onReleased: parent.color = root.buttonColor
onClicked: {
if (modelData === "R") {
pinScreen.backspace();
} else if (modelData === "E") {
pinScreen.enter();
} else {
pinScreen.keyPress(modelData);
}
}
onPressAndHold: {
if (modelData === "R") {
clear();
}
}
}
}
DropShadow {
anchors.fill: keyRect
source: keyRect
cached: true
horizontalOffset: 0
verticalOffset: 1
radius: 4
samples: 6
color: Qt.darker(PlasmaCore.Theme.backgroundColor, 1.2)
}
PlasmaComponents.Label {
visible: modelData !== "R" && modelData !== "E"
text: modelData
anchors.centerIn: parent
font.pointSize: 18
color: PlasmaCore.Theme.textColor
}
PlasmaCore.IconItem {
visible: modelData === "R"
anchors.centerIn: parent
source: "edit-clear"
}
PlasmaCore.IconItem {
visible: modelData === "E"
anchors.centerIn: parent
source: "go-next"
}
}
}
}
Item {
height: PlasmaCore.Units.gridUnit * 0.5
}
}
}
}