mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 08:22:51 -05:00
i18n: general term cleanup, add missing terms, interpolate some
This commit is contained in:
@@ -12,7 +12,7 @@ PluginComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ccWidgetIcon: DMSNetworkService.isBusy ? "sync" : (DMSNetworkService.connected ? "vpn_lock" : "vpn_key_off")
|
ccWidgetIcon: DMSNetworkService.isBusy ? "sync" : (DMSNetworkService.connected ? "vpn_lock" : "vpn_key_off")
|
||||||
ccWidgetPrimaryText: "VPN"
|
ccWidgetPrimaryText: I18n.tr("VPN")
|
||||||
ccWidgetSecondaryText: {
|
ccWidgetSecondaryText: {
|
||||||
if (!DMSNetworkService.connected)
|
if (!DMSNetworkService.connected)
|
||||||
return I18n.tr("Disconnected");
|
return I18n.tr("Disconnected");
|
||||||
|
|||||||
@@ -51,13 +51,13 @@ Rectangle {
|
|||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
||||||
Typography {
|
Typography {
|
||||||
text: UserInfoService.fullName || UserInfoService.username || "User"
|
text: UserInfoService.fullName || UserInfoService.username || I18n.tr("User")
|
||||||
style: Typography.Style.Subtitle
|
style: Typography.Style.Subtitle
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
}
|
}
|
||||||
|
|
||||||
Typography {
|
Typography {
|
||||||
text: DgopService.uptime || "Unknown"
|
text: DgopService.uptime || I18n.tr("Unknown")
|
||||||
style: Typography.Style.Caption
|
style: Typography.Style.Caption
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData === AudioService.source ? "Active" : "Available"
|
text: modelData === AudioService.source ? I18n.tr("Active") : I18n.tr("Available")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
@@ -241,7 +241,7 @@ Rectangle {
|
|||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name;
|
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name;
|
||||||
return isThisDevicePinned ? "Pinned" : "Pin";
|
return isThisDevicePinned ? I18n.tr("Pinned") : I18n.tr("Pin");
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: {
|
color: {
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData === AudioService.sink ? "Active" : "Available"
|
text: modelData === AudioService.sink ? I18n.tr("Active") : I18n.tr("Available")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
@@ -251,7 +251,7 @@ Rectangle {
|
|||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name;
|
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name;
|
||||||
return isThisDevicePinned ? "Pinned" : "Pin";
|
return isThisDevicePinned ? I18n.tr("Pinned") : I18n.tr("Pin");
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: {
|
color: {
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Services.UPower
|
import Quickshell.Services.UPower
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
@@ -66,7 +64,7 @@ Rectangle {
|
|||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: BatteryService.batteryAvailable ? `${BatteryService.batteryLevel}%` : "Power"
|
text: BatteryService.batteryAvailable ? `${BatteryService.batteryLevel}%` : I18n.tr("Power")
|
||||||
font.pixelSize: Theme.fontSizeXLarge
|
font.pixelSize: Theme.fontSizeXLarge
|
||||||
color: {
|
color: {
|
||||||
if (BatteryService.isLowBattery && !BatteryService.isCharging) {
|
if (BatteryService.isLowBattery && !BatteryService.isCharging) {
|
||||||
@@ -81,7 +79,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: BatteryService.batteryAvailable ? BatteryService.batteryStatus : "Management"
|
text: BatteryService.batteryAvailable ? BatteryService.batteryStatus : I18n.tr("Management")
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
color: {
|
color: {
|
||||||
if (BatteryService.isLowBattery && !BatteryService.isCharging) {
|
if (BatteryService.isLowBattery && !BatteryService.isCharging) {
|
||||||
@@ -100,10 +98,10 @@ Rectangle {
|
|||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (!BatteryService.batteryAvailable)
|
if (!BatteryService.batteryAvailable)
|
||||||
return "Power profile management available";
|
return I18n.tr("Power profile management available");
|
||||||
const time = BatteryService.formatTimeRemaining();
|
const time = BatteryService.formatTimeRemaining();
|
||||||
if (time !== "Unknown") {
|
if (time !== "Unknown") {
|
||||||
return BatteryService.isCharging ? `Time until full: ${time}` : `Time remaining: ${time}`;
|
return BatteryService.isCharging ? I18n.tr("Time until full: %1").arg(time) : I18n.tr("Time remaining: %1").arg(time);
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -176,7 +174,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: BatteryService.batteryCapacity > 0 ? `${BatteryService.batteryCapacity.toFixed(1)} Wh` : "Unknown"
|
text: BatteryService.batteryCapacity > 0 ? `${BatteryService.batteryCapacity.toFixed(1)} Wh` : I18n.tr("Unknown")
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Io
|
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
@@ -85,8 +82,12 @@ Item {
|
|||||||
propagateComposedEvents: false
|
propagateComposedEvents: false
|
||||||
|
|
||||||
onClicked: root.hide()
|
onClicked: root.hide()
|
||||||
onWheel: (wheel) => { wheel.accepted = true }
|
onWheel: wheel => {
|
||||||
onPositionChanged: (mouse) => { mouse.accepted = true }
|
wheel.accepted = true;
|
||||||
|
}
|
||||||
|
onPositionChanged: mouse => {
|
||||||
|
mouse.accepted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -111,8 +112,8 @@ Item {
|
|||||||
enabled: root.visible
|
enabled: root.visible
|
||||||
|
|
||||||
Keys.onEscapePressed: {
|
Keys.onEscapePressed: {
|
||||||
root.hide()
|
root.hide();
|
||||||
event.accepted = true
|
event.accepted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,9 +134,15 @@ Item {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
preventStealing: true
|
preventStealing: true
|
||||||
propagateComposedEvents: false
|
propagateComposedEvents: false
|
||||||
onClicked: (mouse) => { mouse.accepted = true }
|
onClicked: mouse => {
|
||||||
onWheel: (wheel) => { wheel.accepted = true }
|
mouse.accepted = true;
|
||||||
onPositionChanged: (mouse) => { mouse.accepted = true }
|
}
|
||||||
|
onWheel: wheel => {
|
||||||
|
wheel.accepted = true;
|
||||||
|
}
|
||||||
|
onPositionChanged: mouse => {
|
||||||
|
mouse.accepted = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@@ -174,9 +181,7 @@ Item {
|
|||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceTextMedium
|
color: Theme.surfaceTextMedium
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -186,7 +191,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: isLoading ? "Loading codecs..." : `Current: ${currentCodec}`
|
text: isLoading ? I18n.tr("Loading codecs...") : I18n.tr("Current: %1").arg(currentCodec)
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: isLoading ? Theme.primary : Theme.surfaceTextMedium
|
color: isLoading ? Theme.primary : Theme.surfaceTextMedium
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
@@ -245,9 +250,7 @@ Item {
|
|||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceTextMedium
|
color: Theme.surfaceTextMedium
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
@@ -271,14 +274,9 @@ Item {
|
|||||||
selectCodec(modelData.profile);
|
selectCodec(modelData.profile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
@@ -286,7 +284,6 @@ Item {
|
|||||||
duration: Theme.mediumDuration
|
duration: Theme.mediumDuration
|
||||||
easing.type: Theme.emphasizedEasing
|
easing.type: Theme.emphasizedEasing
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
@@ -294,8 +291,6 @@ Item {
|
|||||||
duration: Theme.mediumDuration
|
duration: Theme.mediumDuration
|
||||||
easing.type: Theme.emphasizedEasing
|
easing.type: Theme.emphasizedEasing
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: BluetoothService.adapter && BluetoothService.adapter.discovering ? "Scanning" : "Scan"
|
text: BluetoothService.adapter && BluetoothService.adapter.discovering ? I18n.tr("Scanning") : I18n.tr("Scan")
|
||||||
color: BluetoothService.adapter && BluetoothService.adapter.enabled ? Theme.primary : Theme.surfaceVariantText
|
color: BluetoothService.adapter && BluetoothService.adapter.enabled ? Theme.primary : Theme.surfaceVariantText
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
@@ -231,7 +231,7 @@ Rectangle {
|
|||||||
width: 200
|
width: 200
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData.name || modelData.deviceName || "Unknown Device"
|
text: modelData.name || modelData.deviceName || I18n.tr("Unknown Device")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
font.weight: modelData.connected ? Font.Medium : Font.Normal
|
font.weight: modelData.connected ? Font.Medium : Font.Normal
|
||||||
@@ -245,15 +245,15 @@ Rectangle {
|
|||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (modelData.state === BluetoothDeviceState.Connecting)
|
if (modelData.state === BluetoothDeviceState.Connecting)
|
||||||
return "Connecting..."
|
return I18n.tr("Connecting...")
|
||||||
if (modelData.connected) {
|
if (modelData.connected) {
|
||||||
let status = "Connected"
|
let status = I18n.tr("Connected")
|
||||||
if (currentCodec) {
|
if (currentCodec) {
|
||||||
status += " • " + currentCodec
|
status += " • " + currentCodec
|
||||||
}
|
}
|
||||||
return status
|
return status
|
||||||
}
|
}
|
||||||
return "Paired"
|
return I18n.tr("Paired")
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: {
|
color: {
|
||||||
@@ -320,7 +320,7 @@ Rectangle {
|
|||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
||||||
return isThisDevicePinned ? "Pinned" : "Pin"
|
return isThisDevicePinned ? I18n.tr("Pinned") : I18n.tr("Pin")
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: {
|
color: {
|
||||||
@@ -458,7 +458,7 @@ Rectangle {
|
|||||||
width: 200
|
width: 200
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData.name || modelData.deviceName || "Unknown Device"
|
text: modelData.name || modelData.deviceName || I18n.tr("Unknown Device")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
@@ -470,8 +470,8 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (modelData.pairing || isBusy) return "Pairing..."
|
if (modelData.pairing || isBusy) return I18n.tr("Pairing...")
|
||||||
if (modelData.blocked) return "Blocked"
|
if (modelData.blocked) return I18n.tr("Blocked")
|
||||||
return BluetoothService.getSignalStrength(modelData)
|
return BluetoothService.getSignalStrength(modelData)
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
@@ -493,9 +493,9 @@ Rectangle {
|
|||||||
anchors.rightMargin: Theme.spacingM
|
anchors.rightMargin: Theme.spacingM
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: {
|
text: {
|
||||||
if (isBusy) return "Pairing..."
|
if (isBusy) return I18n.tr("Pairing...")
|
||||||
if (!canConnect) return "Cannot pair"
|
if (!canConnect) return I18n.tr("Cannot pair")
|
||||||
return "Pair"
|
return I18n.tr("Pair")
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: (canConnect && !isBusy) ? Theme.primary : Theme.surfaceVariantText
|
color: (canConnect && !isBusy) ? Theme.primary : Theme.surfaceVariantText
|
||||||
@@ -546,7 +546,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: bluetoothContextMenu.currentDevice && bluetoothContextMenu.currentDevice.connected ? "Disconnect" : "Connect"
|
text: bluetoothContextMenu.currentDevice && bluetoothContextMenu.currentDevice.connected ? I18n.tr("Disconnect") : I18n.tr("Connect")
|
||||||
height: 32
|
height: 32
|
||||||
|
|
||||||
contentItem: StyledText {
|
contentItem: StyledText {
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
text: DisplayService.brightnessAvailable ? "No brightness devices available" : "Brightness control not available"
|
text: DisplayService.brightnessAvailable ? I18n.tr("No brightness devices available") : I18n.tr("Brightness control not available")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
@@ -173,7 +173,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: root.getScreenPinKey() || "Unknown Monitor"
|
text: root.getScreenPinKey() || I18n.tr("Unknown Monitor")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -201,7 +201,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: isPinnedToScreen ? "Pinned" : "Pin"
|
text: isPinnedToScreen ? I18n.tr("Pinned") : I18n.tr("Pin")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: isPinnedToScreen ? Theme.primary : Theme.surfaceText
|
color: isPinnedToScreen ? Theme.primary : Theme.surfaceText
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -317,11 +317,11 @@ Rectangle {
|
|||||||
text: {
|
text: {
|
||||||
const deviceClass = modelData.class || "";
|
const deviceClass = modelData.class || "";
|
||||||
if (deviceClass === "backlight")
|
if (deviceClass === "backlight")
|
||||||
return "Backlight device";
|
return I18n.tr("Backlight device");
|
||||||
if (deviceClass === "ddc")
|
if (deviceClass === "ddc")
|
||||||
return "DDC/CI monitor";
|
return I18n.tr("DDC/CI monitor");
|
||||||
if (deviceClass === "leds")
|
if (deviceClass === "leds")
|
||||||
return "LED device";
|
return I18n.tr("LED device");
|
||||||
return deviceClass;
|
return deviceClass;
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
@@ -430,7 +430,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: SessionData.getBrightnessExponential(modelData.name) ? "Exponential" : "Linear"
|
text: SessionData.getBrightnessExponential(modelData.name) ? I18n.tr("Exponential") : I18n.tr("Linear")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: SessionData.getBrightnessExponential(modelData.name) ? Theme.primary : Theme.surfaceText
|
color: SessionData.getBrightnessExponential(modelData.name) ? Theme.primary : Theme.surfaceText
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
@@ -20,11 +18,11 @@ Rectangle {
|
|||||||
border.width: 0
|
border.width: 0
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DgopService.addRef(["diskmounts"])
|
DgopService.addRef(["diskmounts"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DgopService.removeRef(["diskmounts"])
|
DgopService.removeRef(["diskmounts"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
DankFlickable {
|
DankFlickable {
|
||||||
@@ -61,7 +59,7 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
text: DgopService.dgopAvailable ? "No disk data available" : "dgop not available"
|
text: DgopService.dgopAvailable ? I18n.tr("No disk data available") : I18n.tr("dgop not available")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
@@ -96,20 +94,22 @@ Rectangle {
|
|||||||
name: "storage"
|
name: "storage"
|
||||||
size: Theme.iconSize
|
size: Theme.iconSize
|
||||||
color: {
|
color: {
|
||||||
const percentStr = modelData.percent?.replace("%", "") || "0"
|
const percentStr = modelData.percent?.replace("%", "") || "0";
|
||||||
const percent = parseFloat(percentStr) || 0
|
const percent = parseFloat(percentStr) || 0;
|
||||||
if (percent > 90) return Theme.error
|
if (percent > 90)
|
||||||
if (percent > 75) return Theme.warning
|
return Theme.error;
|
||||||
return modelData.mount === currentMountPath ? Theme.primary : Theme.surfaceText
|
if (percent > 75)
|
||||||
|
return Theme.warning;
|
||||||
|
return modelData.mount === currentMountPath ? Theme.primary : Theme.surfaceText;
|
||||||
}
|
}
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
const percentStr = modelData.percent?.replace("%", "") || "0"
|
const percentStr = modelData.percent?.replace("%", "") || "0";
|
||||||
const percent = parseFloat(percentStr) || 0
|
const percent = parseFloat(percentStr) || 0;
|
||||||
return percent.toFixed(0) + "%"
|
return percent.toFixed(0) + "%";
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
@@ -122,7 +122,7 @@ Rectangle {
|
|||||||
width: parent.parent.width - parent.parent.anchors.leftMargin - parent.spacing - 50 - Theme.spacingM
|
width: parent.parent.width - parent.parent.anchors.leftMargin - parent.spacing - 50 - Theme.spacingM
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData.mount === "/" ? "Root Filesystem" : modelData.mount
|
text: modelData.mount === "/" ? I18n.tr("Root Filesystem") : modelData.mount
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
font.weight: modelData.mount === currentMountPath ? Font.Medium : Font.Normal
|
font.weight: modelData.mount === currentMountPath ? Font.Medium : Font.Normal
|
||||||
@@ -154,11 +154,10 @@ Rectangle {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
currentMountPath = modelData.mount
|
currentMountPath = modelData.mount;
|
||||||
mountPathChanged(modelData.mount)
|
mountPathChanged(modelData.mount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ Rectangle {
|
|||||||
buttonHeight: 28
|
buttonHeight: 28
|
||||||
textSize: Theme.fontSizeSmall
|
textSize: Theme.fontSizeSmall
|
||||||
|
|
||||||
model: ["Ethernet", "WiFi"]
|
model: [I18n.tr("Ethernet"), I18n.tr("WiFi")]
|
||||||
currentIndex: currentPreferenceIndex
|
currentIndex: currentPreferenceIndex
|
||||||
selectionMode: "single"
|
selectionMode: "single"
|
||||||
onSelectionChanged: (index, selected) => {
|
onSelectionChanged: (index, selected) => {
|
||||||
@@ -173,7 +173,7 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
text: NetworkService.wifiEnabled ? "Disabling WiFi..." : "Enabling WiFi..."
|
text: NetworkService.wifiEnabled ? I18n.tr("Disabling WiFi...") : I18n.tr("Enabling WiFi...")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
@@ -303,7 +303,7 @@ Rectangle {
|
|||||||
width: 200
|
width: 200
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData.id || "Unknown Config"
|
text: modelData.id || I18n.tr("Unknown Config")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: modelData.isActive ? Theme.primary : Theme.surfaceText
|
color: modelData.isActive ? Theme.primary : Theme.surfaceText
|
||||||
font.weight: modelData.isActive ? Font.Medium : Font.Normal
|
font.weight: modelData.isActive ? Font.Medium : Font.Normal
|
||||||
@@ -549,7 +549,7 @@ Rectangle {
|
|||||||
width: 200
|
width: 200
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData.ssid || "Unknown Network"
|
text: modelData.ssid || I18n.tr("Unknown Network")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
font.weight: modelData.ssid === NetworkService.currentWifiSSID ? Font.Medium : Font.Normal
|
font.weight: modelData.ssid === NetworkService.currentWifiSSID ? Font.Medium : Font.Normal
|
||||||
@@ -561,13 +561,13 @@ Rectangle {
|
|||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData.ssid === NetworkService.currentWifiSSID ? "Connected •" : (modelData.secured ? "Secured •" : "Open •")
|
text: modelData.ssid === NetworkService.currentWifiSSID ? I18n.tr("Connected") + " •" : (modelData.secured ? I18n.tr("Secured") + " •" : I18n.tr("Open") + " •")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: modelData.saved ? "Saved" : ""
|
text: modelData.saved ? I18n.tr("Saved") : ""
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.primary
|
color: Theme.primary
|
||||||
visible: text.length > 0
|
visible: text.length > 0
|
||||||
@@ -635,7 +635,7 @@ Rectangle {
|
|||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid;
|
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid;
|
||||||
return isThisNetworkPinned ? "Pinned" : "Pin";
|
return isThisNetworkPinned ? I18n.tr("Pinned") : I18n.tr("Pin");
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: {
|
color: {
|
||||||
@@ -714,7 +714,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: networkContextMenu.currentConnected ? "Disconnect" : "Connect"
|
text: networkContextMenu.currentConnected ? I18n.tr("Disconnect") : I18n.tr("Connect")
|
||||||
height: 32
|
height: 32
|
||||||
|
|
||||||
contentItem: StyledText {
|
contentItem: StyledText {
|
||||||
|
|||||||
@@ -65,141 +65,141 @@ QtObject {
|
|||||||
readonly property var coreWidgetDefinitions: [
|
readonly property var coreWidgetDefinitions: [
|
||||||
{
|
{
|
||||||
"id": "nightMode",
|
"id": "nightMode",
|
||||||
"text": "Night Mode",
|
"text": I18n.tr("Night Mode"),
|
||||||
"description": "Blue light filter",
|
"description": I18n.tr("Blue light filter"),
|
||||||
"icon": "nightlight",
|
"icon": "nightlight",
|
||||||
"type": "toggle",
|
"type": "toggle",
|
||||||
"enabled": DisplayService.automationAvailable,
|
"enabled": DisplayService.automationAvailable,
|
||||||
"warning": !DisplayService.automationAvailable ? "Requires night mode support" : undefined
|
"warning": !DisplayService.automationAvailable ? I18n.tr("Requires night mode support") : undefined
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "darkMode",
|
"id": "darkMode",
|
||||||
"text": "Dark Mode",
|
"text": I18n.tr("Dark Mode"),
|
||||||
"description": "System theme toggle",
|
"description": I18n.tr("System theme toggle"),
|
||||||
"icon": "contrast",
|
"icon": "contrast",
|
||||||
"type": "toggle",
|
"type": "toggle",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "doNotDisturb",
|
"id": "doNotDisturb",
|
||||||
"text": "Do Not Disturb",
|
"text": I18n.tr("Do Not Disturb"),
|
||||||
"description": "Block notifications",
|
"description": I18n.tr("Block notifications"),
|
||||||
"icon": "do_not_disturb_on",
|
"icon": "do_not_disturb_on",
|
||||||
"type": "toggle",
|
"type": "toggle",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "idleInhibitor",
|
"id": "idleInhibitor",
|
||||||
"text": "Keep Awake",
|
"text": I18n.tr("Keep Awake"),
|
||||||
"description": "Prevent screen timeout",
|
"description": I18n.tr("Prevent screen timeout"),
|
||||||
"icon": "motion_sensor_active",
|
"icon": "motion_sensor_active",
|
||||||
"type": "toggle",
|
"type": "toggle",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "wifi",
|
"id": "wifi",
|
||||||
"text": "Network",
|
"text": I18n.tr("Network"),
|
||||||
"description": "Wi-Fi and Ethernet connection",
|
"description": I18n.tr("Wi-Fi and Ethernet connection"),
|
||||||
"icon": "wifi",
|
"icon": "wifi",
|
||||||
"type": "connection",
|
"type": "connection",
|
||||||
"enabled": NetworkService.wifiAvailable,
|
"enabled": NetworkService.wifiAvailable,
|
||||||
"warning": !NetworkService.wifiAvailable ? "Wi-Fi not available" : undefined
|
"warning": !NetworkService.wifiAvailable ? I18n.tr("Wi-Fi not available") : undefined
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "bluetooth",
|
"id": "bluetooth",
|
||||||
"text": "Bluetooth",
|
"text": I18n.tr("Bluetooth"),
|
||||||
"description": "Device connections",
|
"description": I18n.tr("Device connections"),
|
||||||
"icon": "bluetooth",
|
"icon": "bluetooth",
|
||||||
"type": "connection",
|
"type": "connection",
|
||||||
"enabled": BluetoothService.available,
|
"enabled": BluetoothService.available,
|
||||||
"warning": !BluetoothService.available ? "Bluetooth not available" : undefined
|
"warning": !BluetoothService.available ? I18n.tr("Bluetooth not available") : undefined
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "audioOutput",
|
"id": "audioOutput",
|
||||||
"text": "Audio Output",
|
"text": I18n.tr("Audio Output"),
|
||||||
"description": "Speaker settings",
|
"description": I18n.tr("Speaker settings"),
|
||||||
"icon": "volume_up",
|
"icon": "volume_up",
|
||||||
"type": "connection",
|
"type": "connection",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "audioInput",
|
"id": "audioInput",
|
||||||
"text": "Audio Input",
|
"text": I18n.tr("Audio Input"),
|
||||||
"description": "Microphone settings",
|
"description": I18n.tr("Microphone settings"),
|
||||||
"icon": "mic",
|
"icon": "mic",
|
||||||
"type": "connection",
|
"type": "connection",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "volumeSlider",
|
"id": "volumeSlider",
|
||||||
"text": "Volume Slider",
|
"text": I18n.tr("Volume Slider"),
|
||||||
"description": "Audio volume control",
|
"description": I18n.tr("Audio volume control"),
|
||||||
"icon": "volume_up",
|
"icon": "volume_up",
|
||||||
"type": "slider",
|
"type": "slider",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "brightnessSlider",
|
"id": "brightnessSlider",
|
||||||
"text": "Brightness Slider",
|
"text": I18n.tr("Brightness Slider"),
|
||||||
"description": "Display brightness control",
|
"description": I18n.tr("Display brightness control"),
|
||||||
"icon": "brightness_6",
|
"icon": "brightness_6",
|
||||||
"type": "slider",
|
"type": "slider",
|
||||||
"enabled": DisplayService.brightnessAvailable,
|
"enabled": DisplayService.brightnessAvailable,
|
||||||
"warning": !DisplayService.brightnessAvailable ? "Brightness control not available" : undefined,
|
"warning": !DisplayService.brightnessAvailable ? I18n.tr("Brightness control not available") : undefined,
|
||||||
"allowMultiple": true
|
"allowMultiple": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "inputVolumeSlider",
|
"id": "inputVolumeSlider",
|
||||||
"text": "Input Volume Slider",
|
"text": I18n.tr("Input Volume Slider"),
|
||||||
"description": "Microphone volume control",
|
"description": I18n.tr("Microphone volume control"),
|
||||||
"icon": "mic",
|
"icon": "mic",
|
||||||
"type": "slider",
|
"type": "slider",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "battery",
|
"id": "battery",
|
||||||
"text": "Battery",
|
"text": I18n.tr("Battery"),
|
||||||
"description": "Battery and power management",
|
"description": I18n.tr("Battery and power management"),
|
||||||
"icon": "battery_std",
|
"icon": "battery_std",
|
||||||
"type": "action",
|
"type": "action",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "diskUsage",
|
"id": "diskUsage",
|
||||||
"text": "Disk Usage",
|
"text": I18n.tr("Disk Usage"),
|
||||||
"description": "Filesystem usage monitoring",
|
"description": I18n.tr("Filesystem usage monitoring"),
|
||||||
"icon": "storage",
|
"icon": "storage",
|
||||||
"type": "action",
|
"type": "action",
|
||||||
"enabled": DgopService.dgopAvailable,
|
"enabled": DgopService.dgopAvailable,
|
||||||
"warning": !DgopService.dgopAvailable ? "Requires 'dgop' tool" : undefined,
|
"warning": !DgopService.dgopAvailable ? I18n.tr("Requires 'dgop' tool") : undefined,
|
||||||
"allowMultiple": true
|
"allowMultiple": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "colorPicker",
|
"id": "colorPicker",
|
||||||
"text": "Color Picker",
|
"text": I18n.tr("Color Picker"),
|
||||||
"description": "Choose colors from palette",
|
"description": I18n.tr("Choose colors from palette"),
|
||||||
"icon": "palette",
|
"icon": "palette",
|
||||||
"type": "action",
|
"type": "action",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "builtin_vpn",
|
"id": "builtin_vpn",
|
||||||
"text": "VPN",
|
"text": I18n.tr("VPN"),
|
||||||
"description": "VPN connections",
|
"description": I18n.tr("VPN connections"),
|
||||||
"icon": "vpn_key",
|
"icon": "vpn_key",
|
||||||
"type": "builtin_plugin",
|
"type": "builtin_plugin",
|
||||||
"enabled": DMSNetworkService.available,
|
"enabled": DMSNetworkService.available,
|
||||||
"warning": !DMSNetworkService.available ? "VPN not available" : undefined,
|
"warning": !DMSNetworkService.available ? I18n.tr("VPN not available") : undefined,
|
||||||
"isBuiltinPlugin": true
|
"isBuiltinPlugin": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "builtin_cups",
|
"id": "builtin_cups",
|
||||||
"text": "Printers",
|
"text": I18n.tr("Printers"),
|
||||||
"description": "Print Server Management",
|
"description": I18n.tr("Print Server Management"),
|
||||||
"icon": "Print",
|
"icon": "Print",
|
||||||
"type": "builtin_plugin",
|
"type": "builtin_plugin",
|
||||||
"enabled": CupsService.available,
|
"enabled": CupsService.available,
|
||||||
"warning": !CupsService.available ? "CUPS not available" : undefined,
|
"warning": !CupsService.available ? I18n.tr("CUPS not available") : undefined,
|
||||||
"isBuiltinPlugin": true
|
"isBuiltinPlugin": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -235,7 +235,7 @@ QtObject {
|
|||||||
plugins.push({
|
plugins.push({
|
||||||
"id": "plugin_" + plugin.id,
|
"id": "plugin_" + plugin.id,
|
||||||
"pluginId": plugin.id,
|
"pluginId": plugin.id,
|
||||||
"text": plugin.name || "Plugin",
|
"text": plugin.name || I18n.tr("Plugin"),
|
||||||
"description": plugin.description || "",
|
"description": plugin.description || "",
|
||||||
"icon": plugin.icon || "extension",
|
"icon": plugin.icon || "extension",
|
||||||
"type": "plugin",
|
"type": "plugin",
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Widgets
|
import qs.Modules.ControlCenter.Widgets
|
||||||
|
|
||||||
CompoundPill {
|
CompoundPill {
|
||||||
@@ -14,35 +12,35 @@ CompoundPill {
|
|||||||
|
|
||||||
primaryText: {
|
primaryText: {
|
||||||
if (!BatteryService.batteryAvailable) {
|
if (!BatteryService.batteryAvailable) {
|
||||||
return "No battery"
|
return I18n.tr("No battery");
|
||||||
}
|
}
|
||||||
return "Battery"
|
return I18n.tr("Battery");
|
||||||
}
|
}
|
||||||
|
|
||||||
secondaryText: {
|
secondaryText: {
|
||||||
if (!BatteryService.batteryAvailable) {
|
if (!BatteryService.batteryAvailable) {
|
||||||
return "Not available"
|
return I18n.tr("Not available");
|
||||||
}
|
}
|
||||||
if (BatteryService.isCharging) {
|
if (BatteryService.isCharging) {
|
||||||
return `${BatteryService.batteryLevel}% • Charging`
|
return `${BatteryService.batteryLevel}% • ` + I18n.tr("Charging");
|
||||||
}
|
}
|
||||||
if (BatteryService.isPluggedIn) {
|
if (BatteryService.isPluggedIn) {
|
||||||
return `${BatteryService.batteryLevel}% • Plugged in`
|
return `${BatteryService.batteryLevel}% • ` + I18n.tr("Plugged in");
|
||||||
}
|
}
|
||||||
return `${BatteryService.batteryLevel}%`
|
return `${BatteryService.batteryLevel}%`;
|
||||||
}
|
}
|
||||||
|
|
||||||
iconColor: {
|
iconColor: {
|
||||||
if (BatteryService.isLowBattery && !BatteryService.isCharging) {
|
if (BatteryService.isLowBattery && !BatteryService.isCharging) {
|
||||||
return Theme.error
|
return Theme.error;
|
||||||
}
|
}
|
||||||
if (BatteryService.isCharging || BatteryService.isPluggedIn) {
|
if (BatteryService.isCharging || BatteryService.isPluggedIn) {
|
||||||
return Theme.primary
|
return Theme.primary;
|
||||||
}
|
}
|
||||||
return Theme.surfaceText
|
return Theme.surfaceText;
|
||||||
}
|
}
|
||||||
|
|
||||||
onToggled: {
|
onToggled: {
|
||||||
expandClicked()
|
expandClicked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Widgets
|
import qs.Modules.ControlCenter.Widgets
|
||||||
|
|
||||||
CompoundPill {
|
CompoundPill {
|
||||||
@@ -14,20 +10,20 @@ CompoundPill {
|
|||||||
isActive: true
|
isActive: true
|
||||||
iconName: "palette"
|
iconName: "palette"
|
||||||
iconColor: Theme.primary
|
iconColor: Theme.primary
|
||||||
primaryText: "Color Picker"
|
primaryText: I18n.tr("Color Picker")
|
||||||
secondaryText: "Choose a color"
|
secondaryText: I18n.tr("Choose a color")
|
||||||
|
|
||||||
onToggled: {
|
onToggled: {
|
||||||
console.log("ColorPickerPill toggled, modal:", colorPickerModal)
|
console.log("ColorPickerPill toggled, modal:", colorPickerModal);
|
||||||
if (colorPickerModal) {
|
if (colorPickerModal) {
|
||||||
colorPickerModal.show()
|
colorPickerModal.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onExpandClicked: {
|
onExpandClicked: {
|
||||||
console.log("ColorPickerPill expandClicked, modal:", colorPickerModal)
|
console.log("ColorPickerPill expandClicked, modal:", colorPickerModal);
|
||||||
if (colorPickerModal) {
|
if (colorPickerModal) {
|
||||||
colorPickerModal.show()
|
colorPickerModal.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
|
||||||
import qs.Modules.ControlCenter.Widgets
|
import qs.Modules.ControlCenter.Widgets
|
||||||
|
|
||||||
CompoundPill {
|
CompoundPill {
|
||||||
@@ -15,64 +13,64 @@ CompoundPill {
|
|||||||
|
|
||||||
property var selectedMount: {
|
property var selectedMount: {
|
||||||
if (!DgopService.diskMounts || DgopService.diskMounts.length === 0) {
|
if (!DgopService.diskMounts || DgopService.diskMounts.length === 0) {
|
||||||
return null
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetMount = DgopService.diskMounts.find(mount => mount.mount === mountPath)
|
const targetMount = DgopService.diskMounts.find(mount => mount.mount === mountPath);
|
||||||
return targetMount || DgopService.diskMounts.find(mount => mount.mount === "/") || DgopService.diskMounts[0]
|
return targetMount || DgopService.diskMounts.find(mount => mount.mount === "/") || DgopService.diskMounts[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
property real usagePercent: {
|
property real usagePercent: {
|
||||||
if (!selectedMount || !selectedMount.percent) {
|
if (!selectedMount || !selectedMount.percent) {
|
||||||
return 0
|
return 0;
|
||||||
}
|
}
|
||||||
const percentStr = selectedMount.percent.replace("%", "")
|
const percentStr = selectedMount.percent.replace("%", "");
|
||||||
return parseFloat(percentStr) || 0
|
return parseFloat(percentStr) || 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
isActive: DgopService.dgopAvailable && selectedMount !== null
|
isActive: DgopService.dgopAvailable && selectedMount !== null
|
||||||
|
|
||||||
primaryText: {
|
primaryText: {
|
||||||
if (!DgopService.dgopAvailable) {
|
if (!DgopService.dgopAvailable) {
|
||||||
return "Disk Usage"
|
return I18n.tr("Disk Usage");
|
||||||
}
|
}
|
||||||
if (!selectedMount) {
|
if (!selectedMount) {
|
||||||
return "No disk data"
|
return I18n.tr("No disk data");
|
||||||
}
|
}
|
||||||
return selectedMount.mount
|
return selectedMount.mount;
|
||||||
}
|
}
|
||||||
|
|
||||||
secondaryText: {
|
secondaryText: {
|
||||||
if (!DgopService.dgopAvailable) {
|
if (!DgopService.dgopAvailable) {
|
||||||
return "dgop not available"
|
return I18n.tr("dgop not available");
|
||||||
}
|
}
|
||||||
if (!selectedMount) {
|
if (!selectedMount) {
|
||||||
return "No disk data available"
|
return I18n.tr("No disk data available");
|
||||||
}
|
}
|
||||||
return `${selectedMount.used} / ${selectedMount.size} (${usagePercent.toFixed(0)}%)`
|
return `${selectedMount.used} / ${selectedMount.size} (${usagePercent.toFixed(0)}%)`;
|
||||||
}
|
}
|
||||||
|
|
||||||
iconColor: {
|
iconColor: {
|
||||||
if (!DgopService.dgopAvailable || !selectedMount) {
|
if (!DgopService.dgopAvailable || !selectedMount) {
|
||||||
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.5)
|
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.5);
|
||||||
}
|
}
|
||||||
if (usagePercent > 90) {
|
if (usagePercent > 90) {
|
||||||
return Theme.error
|
return Theme.error;
|
||||||
}
|
}
|
||||||
if (usagePercent > 75) {
|
if (usagePercent > 75) {
|
||||||
return Theme.warning
|
return Theme.warning;
|
||||||
}
|
}
|
||||||
return Theme.surfaceText
|
return Theme.surfaceText;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DgopService.addRef(["diskmounts"])
|
DgopService.addRef(["diskmounts"]);
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DgopService.removeRef(["diskmounts"])
|
DgopService.removeRef(["diskmounts"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
onToggled: {
|
onToggled: {
|
||||||
expandClicked()
|
expandClicked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ Item {
|
|||||||
DMSService.sendRequest("clipboard.setConfig", params, response => {
|
DMSService.sendRequest("clipboard.setConfig", params, response => {
|
||||||
saving = false;
|
saving = false;
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to save clipboard setting"));
|
ToastService.showError(I18n.tr("Failed to save clipboard setting"), response.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loadConfig();
|
loadConfig();
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ Item {
|
|||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Available Screens (") + Quickshell.screens.length + ")"
|
text: I18n.tr("Available Screens (%1)").arg(Quickshell.screens.length)
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
|
|||||||
@@ -333,10 +333,10 @@ Item {
|
|||||||
visible: warningBox.showError || warningBox.showSetup
|
visible: warningBox.showError || warningBox.showSetup
|
||||||
text: {
|
text: {
|
||||||
if (KeybindsService.fixing)
|
if (KeybindsService.fixing)
|
||||||
return I18n.tr("Fixing...")
|
return I18n.tr("Fixing...");
|
||||||
if (warningBox.showSetup)
|
if (warningBox.showSetup)
|
||||||
return I18n.tr("Setup")
|
return I18n.tr("Setup");
|
||||||
return I18n.tr("Fix Now")
|
return I18n.tr("Fix Now");
|
||||||
}
|
}
|
||||||
backgroundColor: Theme.primary
|
backgroundColor: Theme.primary
|
||||||
textColor: Theme.primaryText
|
textColor: Theme.primaryText
|
||||||
@@ -510,7 +510,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: KeybindsService.loading ? I18n.tr("Shortcuts") : I18n.tr("Shortcuts") + " (" + keybindsTab._filteredBinds.length + ")"
|
text: KeybindsService.loading ? I18n.tr("Shortcuts") : I18n.tr("Shortcuts (%1)").arg(keybindsTab._filteredBinds.length)
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
|
|||||||
@@ -1182,7 +1182,7 @@ Item {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
forgetNetworkConfirm.showWithOptions({
|
forgetNetworkConfirm.showWithOptions({
|
||||||
title: I18n.tr("Forget Network"),
|
title: I18n.tr("Forget Network"),
|
||||||
message: I18n.tr("Forget \"") + modelData.ssid + "\"?",
|
message: I18n.tr("Forget \"%1\"?").arg(modelData.ssid),
|
||||||
confirmText: I18n.tr("Forget"),
|
confirmText: I18n.tr("Forget"),
|
||||||
confirmColor: Theme.error,
|
confirmColor: Theme.error,
|
||||||
onConfirm: () => NetworkService.forgetWifiNetwork(modelData.ssid)
|
onConfirm: () => NetworkService.forgetWifiNetwork(modelData.ssid)
|
||||||
@@ -1674,7 +1674,7 @@ Item {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
deleteVpnConfirm.showWithOptions({
|
deleteVpnConfirm.showWithOptions({
|
||||||
title: I18n.tr("Delete VPN"),
|
title: I18n.tr("Delete VPN"),
|
||||||
message: I18n.tr("Delete \"") + modelData.name + "\"?",
|
message: I18n.tr("Delete \"%1\"?").arg(modelData.name),
|
||||||
confirmText: I18n.tr("Delete"),
|
confirmText: I18n.tr("Delete"),
|
||||||
confirmColor: Theme.error,
|
confirmColor: Theme.error,
|
||||||
onConfirm: () => VPNService.deleteVpn(modelData.uuid)
|
onConfirm: () => VPNService.deleteVpn(modelData.uuid)
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ StyledRect {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: {
|
onEntered: {
|
||||||
if (root.sharedTooltip)
|
if (root.sharedTooltip)
|
||||||
root.sharedTooltip.show(I18n.tr("Requires DMS") + " " + root.requiresDms, parent, 0, 0, "top");
|
root.sharedTooltip.show(I18n.tr("Requires DMS %1").arg(root.requiresDms), parent, 0, 0, "top");
|
||||||
}
|
}
|
||||||
onExited: {
|
onExited: {
|
||||||
if (root.sharedTooltip)
|
if (root.sharedTooltip)
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ FocusScope {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: I18n.tr("No plugins found.") + "\n" + I18n.tr("Place plugins in") + " " + PluginService.pluginDirectory
|
text: I18n.tr("No plugins found.") + "\n" + I18n.tr("Place plugins in %1").arg(PluginService.pluginDirectory)
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.pausePrinter", params, response => {
|
DMSService.sendRequest("cups.pausePrinter", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to pause printer") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to pause printer"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getState();
|
getState();
|
||||||
}
|
}
|
||||||
@@ -400,7 +400,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.resumePrinter", params, response => {
|
DMSService.sendRequest("cups.resumePrinter", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to resume printer") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to resume printer"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getState();
|
getState();
|
||||||
}
|
}
|
||||||
@@ -417,7 +417,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.cancelJob", params, response => {
|
DMSService.sendRequest("cups.cancelJob", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to cancel selected job") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to cancel selected job"), response.error);
|
||||||
} else {
|
} else {
|
||||||
fetchJobsForPrinter(printerName);
|
fetchJobsForPrinter(printerName);
|
||||||
}
|
}
|
||||||
@@ -433,7 +433,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.purgeJobs", params, response => {
|
DMSService.sendRequest("cups.purgeJobs", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to cancel all jobs") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to cancel all jobs"), response.error);
|
||||||
} else {
|
} else {
|
||||||
fetchJobsForPrinter(printerName);
|
fetchJobsForPrinter(printerName);
|
||||||
}
|
}
|
||||||
@@ -499,7 +499,7 @@ Singleton {
|
|||||||
DMSService.sendRequest("cups.createPrinter", params, response => {
|
DMSService.sendRequest("cups.createPrinter", params, response => {
|
||||||
creatingPrinter = false;
|
creatingPrinter = false;
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to create printer") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to create printer"), response.error);
|
||||||
} else {
|
} else {
|
||||||
ToastService.showInfo(I18n.tr("Printer created successfully"));
|
ToastService.showInfo(I18n.tr("Printer created successfully"));
|
||||||
getState();
|
getState();
|
||||||
@@ -516,7 +516,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.deletePrinter", params, response => {
|
DMSService.sendRequest("cups.deletePrinter", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to delete printer") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to delete printer"), response.error);
|
||||||
} else {
|
} else {
|
||||||
ToastService.showInfo(I18n.tr("Printer deleted"));
|
ToastService.showInfo(I18n.tr("Printer deleted"));
|
||||||
if (selectedPrinter === printerName) {
|
if (selectedPrinter === printerName) {
|
||||||
@@ -536,7 +536,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.acceptJobs", params, response => {
|
DMSService.sendRequest("cups.acceptJobs", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to enable job acceptance") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to enable job acceptance"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getState();
|
getState();
|
||||||
}
|
}
|
||||||
@@ -552,7 +552,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.rejectJobs", params, response => {
|
DMSService.sendRequest("cups.rejectJobs", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to disable job acceptance") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to disable job acceptance"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getState();
|
getState();
|
||||||
}
|
}
|
||||||
@@ -569,7 +569,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.setPrinterShared", params, response => {
|
DMSService.sendRequest("cups.setPrinterShared", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to update sharing") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to update sharing"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getState();
|
getState();
|
||||||
}
|
}
|
||||||
@@ -586,7 +586,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.setPrinterLocation", params, response => {
|
DMSService.sendRequest("cups.setPrinterLocation", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to update location") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to update location"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getState();
|
getState();
|
||||||
}
|
}
|
||||||
@@ -603,7 +603,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.setPrinterInfo", params, response => {
|
DMSService.sendRequest("cups.setPrinterInfo", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to update description") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to update description"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getState();
|
getState();
|
||||||
}
|
}
|
||||||
@@ -619,7 +619,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.printTestPage", params, response => {
|
DMSService.sendRequest("cups.printTestPage", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to print test page") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to print test page"), response.error);
|
||||||
} else {
|
} else {
|
||||||
ToastService.showInfo(I18n.tr("Test page sent to printer"));
|
ToastService.showInfo(I18n.tr("Test page sent to printer"));
|
||||||
fetchJobsForPrinter(printerName);
|
fetchJobsForPrinter(printerName);
|
||||||
@@ -637,7 +637,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.moveJob", params, response => {
|
DMSService.sendRequest("cups.moveJob", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to move job") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to move job"), response.error);
|
||||||
} else {
|
} else {
|
||||||
fetchAllJobs();
|
fetchAllJobs();
|
||||||
}
|
}
|
||||||
@@ -653,7 +653,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.restartJob", params, response => {
|
DMSService.sendRequest("cups.restartJob", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to restart job") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to restart job"), response.error);
|
||||||
} else {
|
} else {
|
||||||
fetchAllJobs();
|
fetchAllJobs();
|
||||||
}
|
}
|
||||||
@@ -672,7 +672,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.holdJob", params, response => {
|
DMSService.sendRequest("cups.holdJob", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to hold job") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to hold job"), response.error);
|
||||||
} else {
|
} else {
|
||||||
fetchAllJobs();
|
fetchAllJobs();
|
||||||
}
|
}
|
||||||
@@ -689,7 +689,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.addPrinterToClass", params, response => {
|
DMSService.sendRequest("cups.addPrinterToClass", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to add printer to class") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to add printer to class"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getClasses();
|
getClasses();
|
||||||
}
|
}
|
||||||
@@ -706,7 +706,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.removePrinterFromClass", params, response => {
|
DMSService.sendRequest("cups.removePrinterFromClass", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to remove printer from class") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to remove printer from class"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getClasses();
|
getClasses();
|
||||||
}
|
}
|
||||||
@@ -722,7 +722,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("cups.deleteClass", params, response => {
|
DMSService.sendRequest("cups.deleteClass", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to delete class") + " - " + response.error);
|
ToastService.showError(I18n.tr("Failed to delete class"), response.error);
|
||||||
} else {
|
} else {
|
||||||
getClasses();
|
getClasses();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ Singleton {
|
|||||||
pendingConnectionSSID = "";
|
pendingConnectionSSID = "";
|
||||||
} else {
|
} else {
|
||||||
if (connectionError) {
|
if (connectionError) {
|
||||||
ToastService.showError(I18n.tr("Failed to connect to ") + pendingConnectionSSID);
|
ToastService.showError(I18n.tr("Failed to connect to %1").arg(pendingConnectionSSID));
|
||||||
}
|
}
|
||||||
connectionStatus = "failed";
|
connectionStatus = "failed";
|
||||||
pendingConnectionSSID = "";
|
pendingConnectionSSID = "";
|
||||||
@@ -382,7 +382,7 @@ Singleton {
|
|||||||
connectionError = response.error;
|
connectionError = response.error;
|
||||||
lastConnectionError = response.error;
|
lastConnectionError = response.error;
|
||||||
connectionStatus = "failed";
|
connectionStatus = "failed";
|
||||||
ToastService.showError(I18n.tr("Failed to activate configuration"));
|
ToastService.showError(I18n.tr("Failed to activate configuration"), response.error);
|
||||||
} else {
|
} else {
|
||||||
connectionError = "";
|
connectionError = "";
|
||||||
connectionStatus = "connected";
|
connectionStatus = "connected";
|
||||||
@@ -461,7 +461,7 @@ Singleton {
|
|||||||
lastConnectionError = response.error;
|
lastConnectionError = response.error;
|
||||||
pendingConnectionSSID = "";
|
pendingConnectionSSID = "";
|
||||||
connectionStatus = "failed";
|
connectionStatus = "failed";
|
||||||
ToastService.showError(I18n.tr("Failed to start connection to ") + ssid);
|
ToastService.showError(I18n.tr("Failed to start connection to %1").arg(ssid));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -474,7 +474,7 @@ Singleton {
|
|||||||
} : null;
|
} : null;
|
||||||
DMSService.sendRequest("network.wifi.disconnect", params, response => {
|
DMSService.sendRequest("network.wifi.disconnect", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to disconnect WiFi"));
|
ToastService.showError(I18n.tr("Failed to disconnect WiFi"), response.error);
|
||||||
} else {
|
} else {
|
||||||
ToastService.showInfo(I18n.tr("Disconnected from WiFi"));
|
ToastService.showInfo(I18n.tr("Disconnected from WiFi"));
|
||||||
currentWifiSSID = "";
|
currentWifiSSID = "";
|
||||||
@@ -534,7 +534,7 @@ Singleton {
|
|||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.warn("Failed to forget network:", response.error);
|
console.warn("Failed to forget network:", response.error);
|
||||||
} else {
|
} else {
|
||||||
ToastService.showInfo(I18n.tr("Forgot network ") + ssid);
|
ToastService.showInfo(I18n.tr("Forgot network %1").arg(ssid));
|
||||||
|
|
||||||
savedConnections = savedConnections.filter(s => s.ssid !== ssid);
|
savedConnections = savedConnections.filter(s => s.ssid !== ssid);
|
||||||
savedWifiNetworks = savedWifiNetworks.filter(s => s.ssid !== ssid);
|
savedWifiNetworks = savedWifiNetworks.filter(s => s.ssid !== ssid);
|
||||||
@@ -577,7 +577,7 @@ Singleton {
|
|||||||
return;
|
return;
|
||||||
DMSService.sendRequest("network.wifi.enable", null, response => {
|
DMSService.sendRequest("network.wifi.enable", null, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to enable WiFi"));
|
ToastService.showError(I18n.tr("Failed to enable WiFi"), response.error);
|
||||||
} else {
|
} else {
|
||||||
ToastService.showInfo(I18n.tr("WiFi enabled"));
|
ToastService.showInfo(I18n.tr("WiFi enabled"));
|
||||||
}
|
}
|
||||||
@@ -826,7 +826,7 @@ Singleton {
|
|||||||
vpnIsBusy = false;
|
vpnIsBusy = false;
|
||||||
pendingVpnUuid = "";
|
pendingVpnUuid = "";
|
||||||
vpnBusyStartTime = 0;
|
vpnBusyStartTime = 0;
|
||||||
ToastService.showError(I18n.tr("Failed to connect VPN"));
|
ToastService.showError(I18n.tr("Failed to connect VPN"), response.error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -850,7 +850,7 @@ Singleton {
|
|||||||
if (response.error) {
|
if (response.error) {
|
||||||
vpnIsBusy = false;
|
vpnIsBusy = false;
|
||||||
vpnBusyStartTime = 0;
|
vpnBusyStartTime = 0;
|
||||||
ToastService.showError(I18n.tr("Failed to disconnect VPN"));
|
ToastService.showError(I18n.tr("Failed to disconnect VPN"), response.error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -868,7 +868,7 @@ Singleton {
|
|||||||
DMSService.sendRequest("network.vpn.disconnectAll", null, response => {
|
DMSService.sendRequest("network.vpn.disconnectAll", null, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
vpnIsBusy = false;
|
vpnIsBusy = false;
|
||||||
ToastService.showError(I18n.tr("Failed to disconnect VPNs"));
|
ToastService.showError(I18n.tr("Failed to disconnect VPNs"), response.error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -933,7 +933,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("network.wifi.setAutoconnect", params, response => {
|
DMSService.sendRequest("network.wifi.setAutoconnect", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to update autoconnect"));
|
ToastService.showError(I18n.tr("Failed to update autoconnect"), response.error);
|
||||||
} else {
|
} else {
|
||||||
ToastService.showInfo(autoconnect ? I18n.tr("Autoconnect enabled") : I18n.tr("Autoconnect disabled"));
|
ToastService.showInfo(autoconnect ? I18n.tr("Autoconnect enabled") : I18n.tr("Autoconnect disabled"));
|
||||||
Qt.callLater(() => getState());
|
Qt.callLater(() => getState());
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ Singleton {
|
|||||||
DMSService.sendRequest("brightness.setBrightness", params, response => {
|
DMSService.sendRequest("brightness.setBrightness", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error("DisplayService: Failed to set brightness:", response.error);
|
console.error("DisplayService: Failed to set brightness:", response.error);
|
||||||
ToastService.showError("Failed to set brightness: " + response.error, "", "", "brightness");
|
ToastService.showError(I18n.tr("Failed to set brightness"), response.error, "", "brightness");
|
||||||
} else {
|
} else {
|
||||||
ToastService.dismissCategory("brightness");
|
ToastService.dismissCategory("brightness");
|
||||||
}
|
}
|
||||||
@@ -453,7 +453,7 @@ Singleton {
|
|||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error("DisplayService: Failed to enable gamma control:", response.error);
|
console.error("DisplayService: Failed to enable gamma control:", response.error);
|
||||||
ToastService.showError("Failed to enable night mode: " + response.error, "", "", "night-mode");
|
ToastService.showError(I18n.tr("Failed to enable night mode"), response.error, "", "night-mode");
|
||||||
nightModeEnabled = false;
|
nightModeEnabled = false;
|
||||||
SessionData.setNightModeEnabled(false);
|
SessionData.setNightModeEnabled(false);
|
||||||
return;
|
return;
|
||||||
@@ -481,7 +481,7 @@ Singleton {
|
|||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error("DisplayService: Failed to disable gamma control:", response.error);
|
console.error("DisplayService: Failed to disable gamma control:", response.error);
|
||||||
ToastService.showError("Failed to disable night mode: " + response.error, "", "", "night-mode");
|
ToastService.showError(I18n.tr("Failed to disable night mode"), response.error, "", "night-mode");
|
||||||
} else {
|
} else {
|
||||||
ToastService.dismissCategory("night-mode");
|
ToastService.dismissCategory("night-mode");
|
||||||
}
|
}
|
||||||
@@ -522,7 +522,7 @@ Singleton {
|
|||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error("DisplayService: Failed to set temperature:", response.error);
|
console.error("DisplayService: Failed to set temperature:", response.error);
|
||||||
ToastService.showError("Failed to set night mode temperature: " + response.error, "", "", "night-mode");
|
ToastService.showError(I18n.tr("Failed to set night mode temperature"), response.error, "", "night-mode");
|
||||||
} else {
|
} else {
|
||||||
ToastService.dismissCategory("night-mode");
|
ToastService.dismissCategory("night-mode");
|
||||||
}
|
}
|
||||||
@@ -573,7 +573,7 @@ Singleton {
|
|||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error("DisplayService: Failed to set temperature:", response.error);
|
console.error("DisplayService: Failed to set temperature:", response.error);
|
||||||
ToastService.showError("Failed to set night mode temperature: " + response.error, "", "", "night-mode");
|
ToastService.showError(I18n.tr("Failed to set night mode temperature"), response.error, "", "night-mode");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,7 +583,7 @@ Singleton {
|
|||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error("DisplayService: Failed to set manual times:", response.error);
|
console.error("DisplayService: Failed to set manual times:", response.error);
|
||||||
ToastService.showError("Failed to set night mode schedule: " + response.error, "", "", "night-mode");
|
ToastService.showError(I18n.tr("Failed to set night mode schedule"), response.error, "", "night-mode");
|
||||||
} else {
|
} else {
|
||||||
ToastService.dismissCategory("night-mode");
|
ToastService.dismissCategory("night-mode");
|
||||||
}
|
}
|
||||||
@@ -611,7 +611,7 @@ Singleton {
|
|||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error("DisplayService: Failed to set temperature:", response.error);
|
console.error("DisplayService: Failed to set temperature:", response.error);
|
||||||
ToastService.showError("Failed to set night mode temperature: " + response.error, "", "", "night-mode");
|
ToastService.showError(I18n.tr("Failed to set night mode temperature"), response.error, "", "night-mode");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -621,7 +621,7 @@ Singleton {
|
|||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error("DisplayService: Failed to enable IP location:", response.error);
|
console.error("DisplayService: Failed to enable IP location:", response.error);
|
||||||
ToastService.showError("Failed to enable IP location: " + response.error, "", "", "night-mode");
|
ToastService.showError(I18n.tr("Failed to enable IP location"), response.error, "", "night-mode");
|
||||||
} else {
|
} else {
|
||||||
ToastService.dismissCategory("night-mode");
|
ToastService.dismissCategory("night-mode");
|
||||||
}
|
}
|
||||||
@@ -641,7 +641,7 @@ Singleton {
|
|||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.error("DisplayService: Failed to set location:", response.error);
|
console.error("DisplayService: Failed to set location:", response.error);
|
||||||
ToastService.showError("Failed to set night mode location: " + response.error, "", "", "night-mode");
|
ToastService.showError(I18n.tr("Failed to set night mode location"), response.error, "", "night-mode");
|
||||||
} else {
|
} else {
|
||||||
ToastService.dismissCategory("night-mode");
|
ToastService.dismissCategory("night-mode");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
pragma Singleton
|
pragma Singleton
|
||||||
|
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
@@ -22,161 +21,157 @@ Singleton {
|
|||||||
|
|
||||||
readonly property string socketPath: Quickshell.env("DMS_SOCKET")
|
readonly property string socketPath: Quickshell.env("DMS_SOCKET")
|
||||||
|
|
||||||
function init() {}
|
function init() {
|
||||||
|
}
|
||||||
|
|
||||||
function getSystemProfileImage() {
|
function getSystemProfileImage() {
|
||||||
if (!freedeskAvailable)
|
if (!freedeskAvailable)
|
||||||
return
|
return;
|
||||||
|
const username = Quickshell.env("USER");
|
||||||
const username = Quickshell.env("USER")
|
|
||||||
if (!username)
|
if (!username)
|
||||||
return
|
return;
|
||||||
|
|
||||||
DMSService.sendRequest("freedesktop.accounts.getUserIconFile", {
|
DMSService.sendRequest("freedesktop.accounts.getUserIconFile", {
|
||||||
"username": username
|
"username": username
|
||||||
}, response => {
|
}, response => {
|
||||||
if (response.result && response.result.success) {
|
if (response.result && response.result.success) {
|
||||||
const iconFile = response.result.value || ""
|
const iconFile = response.result.value || "";
|
||||||
if (iconFile && iconFile !== "" && iconFile !== "/var/lib/AccountsService/icons/") {
|
if (iconFile && iconFile !== "" && iconFile !== "/var/lib/AccountsService/icons/") {
|
||||||
systemProfileImage = iconFile
|
systemProfileImage = iconFile;
|
||||||
if (!profileImage || profileImage === "") {
|
if (!profileImage || profileImage === "") {
|
||||||
profileImage = iconFile
|
profileImage = iconFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserProfileImage(username) {
|
function getUserProfileImage(username) {
|
||||||
if (!username) {
|
if (!username) {
|
||||||
profileImage = ""
|
profileImage = "";
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if (Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true") {
|
if (Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true") {
|
||||||
profileImage = ""
|
profileImage = "";
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!freedeskAvailable) {
|
if (!freedeskAvailable) {
|
||||||
profileImage = ""
|
profileImage = "";
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DMSService.sendRequest("freedesktop.accounts.getUserIconFile", {
|
DMSService.sendRequest("freedesktop.accounts.getUserIconFile", {
|
||||||
"username": username
|
"username": username
|
||||||
}, response => {
|
}, response => {
|
||||||
if (response.result && response.result.success) {
|
if (response.result && response.result.success) {
|
||||||
const icon = response.result.value || ""
|
const icon = response.result.value || "";
|
||||||
if (icon && icon !== "" && icon !== "/var/lib/AccountsService/icons/") {
|
if (icon && icon !== "" && icon !== "/var/lib/AccountsService/icons/") {
|
||||||
profileImage = icon
|
profileImage = icon;
|
||||||
} else {
|
} else {
|
||||||
profileImage = ""
|
profileImage = "";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
profileImage = ""
|
profileImage = "";
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setProfileImage(imagePath) {
|
function setProfileImage(imagePath) {
|
||||||
if (accountsServiceAvailable) {
|
if (accountsServiceAvailable) {
|
||||||
pendingProfileImage = imagePath
|
pendingProfileImage = imagePath;
|
||||||
setSystemProfileImage(imagePath || "")
|
setSystemProfileImage(imagePath || "");
|
||||||
} else {
|
} else {
|
||||||
profileImage = imagePath
|
profileImage = imagePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSystemColorScheme() {
|
function getSystemColorScheme() {
|
||||||
if (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal === false) {
|
if (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal === false) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if (!freedeskAvailable)
|
if (!freedeskAvailable)
|
||||||
return
|
return;
|
||||||
|
|
||||||
DMSService.sendRequest("freedesktop.settings.getColorScheme", null, response => {
|
DMSService.sendRequest("freedesktop.settings.getColorScheme", null, response => {
|
||||||
if (response.result) {
|
if (response.result) {
|
||||||
systemColorScheme = response.result.value || 0
|
systemColorScheme = response.result.value || 0;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setLightMode(isLightMode) {
|
function setLightMode(isLightMode) {
|
||||||
if (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal === false) {
|
if (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal === false) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
setSystemColorScheme(isLightMode)
|
setSystemColorScheme(isLightMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSystemColorScheme(isLightMode) {
|
function setSystemColorScheme(isLightMode) {
|
||||||
if (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal === false) {
|
if (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal === false) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetScheme = isLightMode ? "default" : "prefer-dark"
|
const targetScheme = isLightMode ? "default" : "prefer-dark";
|
||||||
|
|
||||||
if (colorSchemeCommand === "gsettings") {
|
if (colorSchemeCommand === "gsettings") {
|
||||||
Quickshell.execDetached(["gsettings", "set", "org.gnome.desktop.interface", "color-scheme", targetScheme])
|
Quickshell.execDetached(["gsettings", "set", "org.gnome.desktop.interface", "color-scheme", targetScheme]);
|
||||||
}
|
}
|
||||||
if (colorSchemeCommand === "dconf") {
|
if (colorSchemeCommand === "dconf") {
|
||||||
Quickshell.execDetached(["dconf", "write", "/org/gnome/desktop/interface/color-scheme", `'${targetScheme}'`])
|
Quickshell.execDetached(["dconf", "write", "/org/gnome/desktop/interface/color-scheme", `'${targetScheme}'`]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSystemIconTheme(themeName) {
|
function setSystemIconTheme(themeName) {
|
||||||
if (!settingsPortalAvailable || !freedeskAvailable)
|
if (!settingsPortalAvailable || !freedeskAvailable)
|
||||||
return
|
return;
|
||||||
|
|
||||||
DMSService.sendRequest("freedesktop.settings.setIconTheme", {
|
DMSService.sendRequest("freedesktop.settings.setIconTheme", {
|
||||||
"iconTheme": themeName
|
"iconTheme": themeName
|
||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.warn("PortalService: Failed to set icon theme:", response.error)
|
console.warn("PortalService: Failed to set icon theme:", response.error);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSystemProfileImage(imagePath) {
|
function setSystemProfileImage(imagePath) {
|
||||||
if (!accountsServiceAvailable || !freedeskAvailable)
|
if (!accountsServiceAvailable || !freedeskAvailable)
|
||||||
return
|
return;
|
||||||
|
|
||||||
DMSService.sendRequest("freedesktop.accounts.setIconFile", {
|
DMSService.sendRequest("freedesktop.accounts.setIconFile", {
|
||||||
"path": imagePath || ""
|
"path": imagePath || ""
|
||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
console.warn("PortalService: Failed to set icon file:", response.error)
|
console.warn("PortalService: Failed to set icon file:", response.error);
|
||||||
|
|
||||||
const errorMsg = response.error.toString()
|
const errorMsg = response.error.toString();
|
||||||
let userMessage = I18n.tr("Failed to set profile image")
|
let userMessage = I18n.tr("Failed to set profile image");
|
||||||
|
|
||||||
if (errorMsg.includes("too large")) {
|
if (errorMsg.includes("too large")) {
|
||||||
userMessage = I18n.tr("Profile image is too large. Please use a smaller image.")
|
userMessage = I18n.tr("Profile image is too large. Please use a smaller image.");
|
||||||
} else if (errorMsg.includes("permission")) {
|
} else if (errorMsg.includes("permission")) {
|
||||||
userMessage = I18n.tr("Permission denied to set profile image.")
|
userMessage = I18n.tr("Permission denied to set profile image.");
|
||||||
} else if (errorMsg.includes("not found") || errorMsg.includes("does not exist")) {
|
} else if (errorMsg.includes("not found") || errorMsg.includes("does not exist")) {
|
||||||
userMessage = I18n.tr("Selected image file not found.")
|
userMessage = I18n.tr("Selected image file not found.");
|
||||||
} else {
|
} else {
|
||||||
userMessage = I18n.tr("Failed to set profile image: ") + errorMsg.split(":").pop().trim()
|
userMessage = I18n.tr("Failed to set profile image: %1").arg(errorMsg.split(":").pop().trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
Quickshell.execDetached(["notify-send", "-u", "normal", "-a", "DMS", "-i", "error", I18n.tr("Profile Image Error"), userMessage])
|
Quickshell.execDetached(["notify-send", "-u", "normal", "-a", "DMS", "-i", "error", I18n.tr("Profile Image Error"), userMessage]);
|
||||||
|
|
||||||
pendingProfileImage = ""
|
pendingProfileImage = "";
|
||||||
} else {
|
} else {
|
||||||
profileImage = pendingProfileImage
|
profileImage = pendingProfileImage;
|
||||||
pendingProfileImage = ""
|
pendingProfileImage = "";
|
||||||
Qt.callLater(() => getSystemProfileImage())
|
Qt.callLater(() => getSystemProfileImage());
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (socketPath && socketPath.length > 0) {
|
if (socketPath && socketPath.length > 0) {
|
||||||
checkDMSCapabilities()
|
checkDMSCapabilities();
|
||||||
} else {
|
} else {
|
||||||
console.info("PortalService: DMS_SOCKET not set")
|
console.info("PortalService: DMS_SOCKET not set");
|
||||||
}
|
}
|
||||||
colorSchemeDetector.running = true
|
colorSchemeDetector.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
@@ -184,7 +179,7 @@ Singleton {
|
|||||||
|
|
||||||
function onConnectionStateChanged() {
|
function onConnectionStateChanged() {
|
||||||
if (DMSService.isConnected) {
|
if (DMSService.isConnected) {
|
||||||
checkDMSCapabilities()
|
checkDMSCapabilities();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,63 +189,61 @@ Singleton {
|
|||||||
enabled: DMSService.isConnected
|
enabled: DMSService.isConnected
|
||||||
|
|
||||||
function onCapabilitiesChanged() {
|
function onCapabilitiesChanged() {
|
||||||
checkDMSCapabilities()
|
checkDMSCapabilities();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkDMSCapabilities() {
|
function checkDMSCapabilities() {
|
||||||
if (!DMSService.isConnected) {
|
if (!DMSService.isConnected) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DMSService.capabilities.length === 0) {
|
if (DMSService.capabilities.length === 0) {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
freedeskAvailable = DMSService.capabilities.includes("freedesktop")
|
freedeskAvailable = DMSService.capabilities.includes("freedesktop");
|
||||||
if (freedeskAvailable) {
|
if (freedeskAvailable) {
|
||||||
checkAccountsService()
|
checkAccountsService();
|
||||||
checkSettingsPortal()
|
checkSettingsPortal();
|
||||||
} else {
|
} else {
|
||||||
console.info("PortalService: freedesktop capability not available in DMS")
|
console.info("PortalService: freedesktop capability not available in DMS");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkAccountsService() {
|
function checkAccountsService() {
|
||||||
if (!freedeskAvailable)
|
if (!freedeskAvailable)
|
||||||
return
|
return;
|
||||||
|
|
||||||
DMSService.sendRequest("freedesktop.getState", null, response => {
|
DMSService.sendRequest("freedesktop.getState", null, response => {
|
||||||
if (response.result && response.result.accounts) {
|
if (response.result && response.result.accounts) {
|
||||||
accountsServiceAvailable = response.result.accounts.available || false
|
accountsServiceAvailable = response.result.accounts.available || false;
|
||||||
if (accountsServiceAvailable) {
|
if (accountsServiceAvailable) {
|
||||||
getSystemProfileImage()
|
getSystemProfileImage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkSettingsPortal() {
|
function checkSettingsPortal() {
|
||||||
if (!freedeskAvailable)
|
if (!freedeskAvailable)
|
||||||
return
|
return;
|
||||||
|
|
||||||
DMSService.sendRequest("freedesktop.getState", null, response => {
|
DMSService.sendRequest("freedesktop.getState", null, response => {
|
||||||
if (response.result && response.result.settings) {
|
if (response.result && response.result.settings) {
|
||||||
settingsPortalAvailable = response.result.settings.available || false
|
settingsPortalAvailable = response.result.settings.available || false;
|
||||||
if (settingsPortalAvailable && SettingsData.syncModeWithPortal) {
|
if (settingsPortalAvailable && SettingsData.syncModeWithPortal) {
|
||||||
getSystemColorScheme()
|
getSystemColorScheme();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGreeterUserProfileImage(username) {
|
function getGreeterUserProfileImage(username) {
|
||||||
if (!username) {
|
if (!username) {
|
||||||
profileImage = ""
|
profileImage = "";
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
userProfileCheckProcess.command = ["bash", "-c", `uid=$(id -u ${username} 2>/dev/null) && [ -n "$uid" ] && dbus-send --system --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User$uid org.freedesktop.DBus.Properties.Get string:org.freedesktop.Accounts.User string:IconFile 2>/dev/null | grep -oP 'string "\\K[^"]+' || echo ""`]
|
userProfileCheckProcess.command = ["bash", "-c", `uid=$(id -u ${username} 2>/dev/null) && [ -n "$uid" ] && dbus-send --system --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User$uid org.freedesktop.DBus.Properties.Get string:org.freedesktop.Accounts.User string:IconFile 2>/dev/null | grep -oP 'string "\\K[^"]+' || echo ""`];
|
||||||
userProfileCheckProcess.running = true
|
userProfileCheckProcess.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
@@ -260,18 +253,18 @@ Singleton {
|
|||||||
|
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
const trimmed = text.trim()
|
const trimmed = text.trim();
|
||||||
if (trimmed && trimmed !== "" && !trimmed.includes("Error") && trimmed !== "/var/lib/AccountsService/icons/") {
|
if (trimmed && trimmed !== "" && !trimmed.includes("Error") && trimmed !== "/var/lib/AccountsService/icons/") {
|
||||||
root.profileImage = trimmed
|
root.profileImage = trimmed;
|
||||||
} else {
|
} else {
|
||||||
root.profileImage = ""
|
root.profileImage = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onExited: exitCode => {
|
onExited: exitCode => {
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
root.profileImage = ""
|
root.profileImage = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -283,11 +276,11 @@ Singleton {
|
|||||||
|
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
const cmd = text.trim()
|
const cmd = text.trim();
|
||||||
if (cmd.includes("gsettings")) {
|
if (cmd.includes("gsettings")) {
|
||||||
root.colorSchemeCommand = "gsettings"
|
root.colorSchemeCommand = "gsettings";
|
||||||
} else if (cmd.includes("dconf")) {
|
} else if (cmd.includes("dconf")) {
|
||||||
root.colorSchemeCommand = "dconf"
|
root.colorSchemeCommand = "dconf";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,27 +290,27 @@ Singleton {
|
|||||||
target: "profile"
|
target: "profile"
|
||||||
|
|
||||||
function getImage(): string {
|
function getImage(): string {
|
||||||
return root.profileImage
|
return root.profileImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setImage(path: string): string {
|
function setImage(path: string): string {
|
||||||
if (!path) {
|
if (!path) {
|
||||||
return "ERROR: No path provided"
|
return "ERROR: No path provided";
|
||||||
}
|
}
|
||||||
|
|
||||||
const absolutePath = path.startsWith("/") ? path : `${StandardPaths.writableLocation(StandardPaths.HomeLocation)}/${path}`
|
const absolutePath = path.startsWith("/") ? path : `${StandardPaths.writableLocation(StandardPaths.HomeLocation)}/${path}`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
root.setProfileImage(absolutePath)
|
root.setProfileImage(absolutePath);
|
||||||
return "SUCCESS: Profile image set to " + absolutePath
|
return "SUCCESS: Profile image set to " + absolutePath;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return "ERROR: Failed to set profile image: " + e.toString()
|
return "ERROR: Failed to set profile image: " + e.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearImage(): string {
|
function clearImage(): string {
|
||||||
root.setProfileImage("")
|
root.setProfileImage("");
|
||||||
return "SUCCESS: Profile image cleared"
|
return "SUCCESS: Profile image cleared";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,14 +81,14 @@ Singleton {
|
|||||||
|
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
importError = response.error;
|
importError = response.error;
|
||||||
ToastService.showError(I18n.tr("Failed to import VPN"));
|
ToastService.showError(I18n.tr("Failed to import VPN"), response.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!response.result)
|
if (!response.result)
|
||||||
return;
|
return;
|
||||||
if (response.result.success) {
|
if (response.result.success) {
|
||||||
ToastService.showInfo(I18n.tr("VPN imported: ") + (response.result.name || ""));
|
ToastService.showInfo(I18n.tr("VPN imported: %1").arg(response.result.name || ""));
|
||||||
DMSNetworkService.refreshVpnProfiles();
|
DMSNetworkService.refreshVpnProfiles();
|
||||||
importComplete(response.result.uuid || "", response.result.name || "");
|
importComplete(response.result.uuid || "", response.result.name || "");
|
||||||
return;
|
return;
|
||||||
@@ -111,7 +111,7 @@ Singleton {
|
|||||||
configLoading = false;
|
configLoading = false;
|
||||||
|
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to load VPN config"));
|
ToastService.showError(I18n.tr("Failed to load VPN config"), response.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ Singleton {
|
|||||||
|
|
||||||
DMSService.sendRequest("network.vpn.updateConfig", params, response => {
|
DMSService.sendRequest("network.vpn.updateConfig", params, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to update VPN"));
|
ToastService.showError(I18n.tr("Failed to update VPN"), response.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ToastService.showInfo(I18n.tr("VPN configuration updated"));
|
ToastService.showInfo(I18n.tr("VPN configuration updated"));
|
||||||
@@ -153,7 +153,7 @@ Singleton {
|
|||||||
uuid: uuidOrName
|
uuid: uuidOrName
|
||||||
}, response => {
|
}, response => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
ToastService.showError(I18n.tr("Failed to delete VPN"));
|
ToastService.showError(I18n.tr("Failed to delete VPN"), response.error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ToastService.showInfo(I18n.tr("VPN deleted"));
|
ToastService.showInfo(I18n.tr("VPN deleted"));
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ Rectangle {
|
|||||||
return I18n.tr("Active: None");
|
return I18n.tr("Active: None");
|
||||||
const names = DMSNetworkService.activeNames || [];
|
const names = DMSNetworkService.activeNames || [];
|
||||||
if (names.length <= 1)
|
if (names.length <= 1)
|
||||||
return I18n.tr("Active: ") + (names[0] || "VPN");
|
return I18n.tr("Active: %1").arg(names[0] || "VPN");
|
||||||
return I18n.tr("Active: ") + names[0] + " +" + (names.length - 1);
|
return I18n.tr("Active: %1 +%2").arg(names[0]).arg(names.length - 1);
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
@@ -214,7 +214,7 @@ Rectangle {
|
|||||||
onDeleteRequested: {
|
onDeleteRequested: {
|
||||||
deleteConfirm.showWithOptions({
|
deleteConfirm.showWithOptions({
|
||||||
"title": I18n.tr("Delete VPN"),
|
"title": I18n.tr("Delete VPN"),
|
||||||
"message": I18n.tr("Delete \"") + modelData.name + "\"?",
|
"message": I18n.tr("Delete \"%1\"?").arg(modelData.name),
|
||||||
"confirmText": I18n.tr("Delete"),
|
"confirmText": I18n.tr("Delete"),
|
||||||
"confirmColor": Theme.error,
|
"confirmColor": Theme.error,
|
||||||
"onConfirm": () => VPNService.deleteVpn(modelData.uuid)
|
"onConfirm": () => VPNService.deleteVpn(modelData.uuid)
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ def save_sync_state():
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
error("Usage: i18nsync.py [check|sync|test]")
|
error("Usage: i18nsync.py [check|sync|test|local]")
|
||||||
|
|
||||||
command = sys.argv[1]
|
command = sys.argv[1]
|
||||||
|
|
||||||
@@ -315,6 +315,39 @@ def main():
|
|||||||
save_sync_state()
|
save_sync_state()
|
||||||
info("Already in sync")
|
info("Already in sync")
|
||||||
|
|
||||||
|
elif command == "local":
|
||||||
|
info("Updating en.json locally (no POEditor sync)")
|
||||||
|
|
||||||
|
old_en = normalize_json(EN_JSON)
|
||||||
|
old_terms = {entry['term']: entry for entry in old_en} if isinstance(old_en, list) else {}
|
||||||
|
|
||||||
|
extract_strings()
|
||||||
|
|
||||||
|
new_en = normalize_json(EN_JSON)
|
||||||
|
new_terms = {entry['term']: entry for entry in new_en} if isinstance(new_en, list) else {}
|
||||||
|
|
||||||
|
added = set(new_terms.keys()) - set(old_terms.keys())
|
||||||
|
removed = set(old_terms.keys()) - set(new_terms.keys())
|
||||||
|
|
||||||
|
if added:
|
||||||
|
info(f"\n+{len(added)} new terms:")
|
||||||
|
for term in sorted(added)[:20]:
|
||||||
|
print(f" + {term[:60]}...")
|
||||||
|
if len(added) > 20:
|
||||||
|
print(f" ... and {len(added) - 20} more")
|
||||||
|
|
||||||
|
if removed:
|
||||||
|
info(f"\n-{len(removed)} removed terms:")
|
||||||
|
for term in sorted(removed)[:20]:
|
||||||
|
print(f" - {term[:60]}...")
|
||||||
|
if len(removed) > 20:
|
||||||
|
print(f" ... and {len(removed) - 20} more")
|
||||||
|
|
||||||
|
success(f"\n✓ {len(new_en)} total terms")
|
||||||
|
|
||||||
|
if not added and not removed:
|
||||||
|
info("No changes detected")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
error(f"Unknown command: {command}")
|
error(f"Unknown command: {command}")
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -7,23 +7,26 @@ from collections import defaultdict
|
|||||||
|
|
||||||
def extract_qstr_strings(root_dir):
|
def extract_qstr_strings(root_dir):
|
||||||
translations = defaultdict(lambda: {'contexts': set(), 'occurrences': []})
|
translations = defaultdict(lambda: {'contexts': set(), 'occurrences': []})
|
||||||
qstr_pattern = re.compile(r'qsTr\(["\']([^"\']+)["\']\)')
|
qstr_pattern_double = re.compile(r'qsTr\("([^"]+)"\)')
|
||||||
i18n_pattern_with_context = re.compile(r'I18n\.tr\(["\']([^"\']+)["\']\s*,\s*["\']([^"\']+)["\']\)')
|
qstr_pattern_single = re.compile(r"qsTr\('([^']+)'\)")
|
||||||
i18n_pattern_simple = re.compile(r'I18n\.tr\(["\']([^"\']+)["\']\)')
|
i18n_pattern_with_context_double = re.compile(r'I18n\.tr\("([^"]+)"\s*,\s*"([^"]+)"\)')
|
||||||
|
i18n_pattern_with_context_single = re.compile(r"I18n\.tr\('([^']+)'\s*,\s*'([^']+)'\)")
|
||||||
|
i18n_pattern_simple_double = re.compile(r'I18n\.tr\("([^"]+)"\)')
|
||||||
|
i18n_pattern_simple_single = re.compile(r"I18n\.tr\('([^']+)'\)")
|
||||||
|
|
||||||
for qml_file in Path(root_dir).rglob('*.qml'):
|
for qml_file in Path(root_dir).rglob('*.qml'):
|
||||||
relative_path = qml_file.relative_to(root_dir)
|
relative_path = qml_file.relative_to(root_dir)
|
||||||
|
|
||||||
with open(qml_file, 'r', encoding='utf-8') as f:
|
with open(qml_file, 'r', encoding='utf-8') as f:
|
||||||
for line_num, line in enumerate(f, 1):
|
for line_num, line in enumerate(f, 1):
|
||||||
qstr_matches = qstr_pattern.findall(line)
|
qstr_matches = qstr_pattern_double.findall(line) + qstr_pattern_single.findall(line)
|
||||||
for match in qstr_matches:
|
for match in qstr_matches:
|
||||||
translations[match]['occurrences'].append({
|
translations[match]['occurrences'].append({
|
||||||
'file': str(relative_path),
|
'file': str(relative_path),
|
||||||
'line': line_num
|
'line': line_num
|
||||||
})
|
})
|
||||||
|
|
||||||
i18n_with_context = i18n_pattern_with_context.findall(line)
|
i18n_with_context = i18n_pattern_with_context_double.findall(line) + i18n_pattern_with_context_single.findall(line)
|
||||||
for term, context in i18n_with_context:
|
for term, context in i18n_with_context:
|
||||||
translations[term]['contexts'].add(context)
|
translations[term]['contexts'].add(context)
|
||||||
translations[term]['occurrences'].append({
|
translations[term]['occurrences'].append({
|
||||||
@@ -31,9 +34,10 @@ def extract_qstr_strings(root_dir):
|
|||||||
'line': line_num
|
'line': line_num
|
||||||
})
|
})
|
||||||
|
|
||||||
i18n_simple = i18n_pattern_simple.findall(line)
|
has_context = i18n_pattern_with_context_double.search(line) or i18n_pattern_with_context_single.search(line)
|
||||||
|
if not has_context:
|
||||||
|
i18n_simple = i18n_pattern_simple_double.findall(line) + i18n_pattern_simple_single.findall(line)
|
||||||
for match in i18n_simple:
|
for match in i18n_simple:
|
||||||
if not i18n_pattern_with_context.search(line):
|
|
||||||
translations[match]['occurrences'].append({
|
translations[match]['occurrences'].append({
|
||||||
'file': str(relative_path),
|
'file': str(relative_path),
|
||||||
'line': line_num
|
'line': line_num
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user