Watch
1
0
Fork
You've already forked souveraine
0
souveraine/surfaces/quickshell/ii-base/modules/waffle/polkit/WPolkitContent.qml
Fimeg 8f42fc953d publish: the public projection begins here
This is a projection, not a development branch. The tree above was constructed
from the internal source named below under a manifest that decides which paths
may leave, then scanned as a whole tree rather than as a series of patches, and
only then published.

Public history starts here because the history before it was not admissible,
and neither was the tree. What used to stand in this repository included a
rescue copy of another machine, a directory of phone handoffs, deployment
wired to one house, and a submodule pointing at a forge no stranger can reach.
None of that was ever the product. It stays in the private forge, which is
allowed to hold the whole working organism, and this is what was deliberately
sent out instead.

Three mechanisms produced this tree, in decreasing order of trust. A top-level
path the manifest does not name never arrives at all, which is the one that
catches directories nobody has thought of yet. Named internal files inside
admitted roots are dropped. A short, reviewed table replaces deployment
defaults that a public build must not carry -- an endpoint aimed at one LAN, a
VPN profile belonging to one phone, packaging built from one checkout path.

Everything after this commit is an ordinary publication with the same three
trailers, so a force push stops being routine and starts meaning that
something deliberate happened. The trailers bind the projection to its source
without pretending the public SHA is the private one: same lineage, different
tree, and the record says so.

Source-Sha: 8f27b1e76a8fef560a336aba18e6990713ff1047
Policy-Sha: 6b261d2f3e6e1fb19874846ba4bb1dfe15565d25b8618c1c1afba0419c101d27
Tree-Digest: 18ec3563c5e5ef9a414993a9f6734b251ff9ed3cd56eebdd6cac01e45c6e3067
2026-09-04 15:55:48 -04:00

208 lines
7.4 KiB
QML

import QtQuick
import QtQuick.Layouts
import Quickshell
import qs.services
import qs.modules.common
import qs.modules.common.functions
import qs.modules.common.widgets
import qs.modules.waffle.looks
Rectangle {
id: root
color: "#000000"
readonly property bool usePasswordChars: !PolkitService.flow?.responseVisible ?? true
Keys.onPressed: event => { // Esc to close
if (event.key === Qt.Key_Escape) {
PolkitService.cancel();
}
}
StyledImage {
anchors.fill: parent
source: Config.options.background.wallpaperPath
fillMode: Image.PreserveAspectCrop
Rectangle {
anchors.fill: parent
color: ColorUtils.transparentize("#000000", 0.31)
PolkitDialog {
id: dialog
DragHandler {
target: null
property real startX: dialog.x
property real startY: dialog.y
onActiveChanged: {
if (!active) return;
startX = dialog.x;
startY = dialog.y;
}
xAxis.onActiveValueChanged: {
dialog.x = Math.round(startX + xAxis.activeValue);
}
yAxis.onActiveValueChanged: {
dialog.y = Math.round(startY + yAxis.activeValue);
}
}
x: Math.round((parent.width - width) / 2)
y: Math.round((parent.height - height) / 2)
}
}
}
component PolkitDialog: WPane {
borderColor: Looks.colors.ambientShadow
contentItem: WPanelPageColumn {
PolkitDialogHeader {
Layout.fillWidth: true
}
BodyRectangle {
id: dialogBody
implicitHeight: bodyContent.implicitHeight + 48
implicitWidth: 434
color: Looks.colors.bg1Base
ColumnLayout {
id: bodyContent
anchors.fill: parent
anchors.margins: 24
spacing: 20
RowLayout {
Layout.fillWidth: true
spacing: 15
WAppIcon {
iconName: PolkitService.flow?.iconName ?? "window-shield"
fallback: PolkitService.flow?.iconName == "" ? `${Looks.iconsPath}/window-shield` : PolkitService.flow.iconName
isMask: PolkitService.flow?.iconName === ""
tryCustomIcon: false
}
WText {
Layout.fillWidth: true
horizontalAlignment: Text.AlignLeft
font.pixelSize: Looks.font.pixelSize.larger
font.weight: Looks.font.weight.strongest
text: {
const iconName = PolkitService.flow?.iconName ?? "";
if (iconName === "")
return Translation.tr("Command-line-invoked Action");
const desktopEntry = DesktopEntries.applications.values.find(entry => {
return entry.icon == iconName;
});
return desktopEntry ? desktopEntry.name : Translation.tr("Unknown Application");
}
}
}
WText {
Layout.fillWidth: true
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignLeft
text: PolkitService.cleanMessage
}
WTextField {
id: inputField
Layout.fillWidth: true
focus: true
enabled: PolkitService.interactionAvailable
placeholderText: PolkitService.cleanPrompt
echoMode: root.usePasswordChars ? TextInput.Password : TextInput.Normal
onAccepted: PolkitService.submit(inputField.text)
Keys.onPressed: event => { // Esc to close
if (event.key === Qt.Key_Escape) {
PolkitService.cancel();
}
}
Component.onCompleted: forceActiveFocus()
Connections {
target: PolkitService
function onInteractionAvailableChanged() {
if (!PolkitService.interactionAvailable)
return;
inputField.text = "";
inputField.forceActiveFocus();
}
}
}
}
}
BodyRectangle {
implicitHeight: 80
color: Looks.colors.bgPanelFooterBackground
RowLayout {
anchors.fill: parent
anchors.margins: 24
spacing: 8
uniformCellSizes: true
WButton {
Layout.fillWidth: true
implicitHeight: 32
colBackground: Looks.colors.bg1
horizontalAlignment: Text.AlignHCenter
text: Translation.tr("Yes")
onClicked: PolkitService.submit(inputField.text)
}
WButton {
Layout.fillWidth: true
implicitHeight: 32
horizontalAlignment: Text.AlignHCenter
checked: true
text: Translation.tr("No")
onClicked: PolkitService.cancel()
}
}
}
}
}
component PolkitDialogHeader: BodyRectangle {
implicitHeight: headerContent.implicitHeight
color: Looks.colors.bg2Base
CloseButton {
anchors {
top: parent.top
right: parent.right
}
radius: 0
implicitWidth: 32
implicitHeight: 32
onClicked: {
PolkitService.cancel();
}
}
ColumnLayout {
id: headerContent
anchors.fill: parent
anchors.leftMargin: 24
anchors.rightMargin: 24
spacing: 18
WText {
Layout.topMargin: 20
Layout.fillWidth: true
horizontalAlignment: Text.AlignLeft
text: Translation.tr("Polkit")
}
WText {
Layout.fillWidth: true
Layout.bottomMargin: 12
horizontalAlignment: Text.AlignLeft
wrapMode: Text.Wrap
text: Translation.tr("Do you want to allow this app to make changes to your device?")
font.pixelSize: Looks.font.pixelSize.xlarger
font.weight: Looks.font.weight.strongest
}
}
}
}