mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-18 09:14:01 -04:00
* feat(freebsd): add comprehensive native FreeBSD support * Update BatteryService.qml * Add battery probe completion and fallback updates * Add isVideoSource function and update PwObjectTracker filter * Add isPipewireVideoSource function to AudioService Added a function to check if a Pipewire node is a video source. * Refactor video source check to use AudioService * Remove unnecessary call in BatteryService.qml * Add call to updateFreeBsdBatteryFallback on completion * Simplify AudioService by eliminating redundant bindings Removed unnecessary bindings in the AudioService loader to streamline the loading process. * Improve error handling in CheckUpdates function Handle specific exit error for package upgrade check. * Enhance FreeBSD network detection logic * Implement FreeBSD Wi-Fi hardware discovery in Initialize Added FreeBSD Wi-Fi hardware discovery and updated initialization logic to handle cases where no wpa_supplicant control socket is found. * Implement Ethernet state monitoring in StartMonitoring Added monitoring for Ethernet state updates in StartMonitoring function. * Add Ethernet management functions to backend * Remove unimplemented Ethernet control methods Removed unimplemented Ethernet control methods from WpaSupplicantBackend. * Implement SetWiFiEnabled method for WiFi control Add error handling and state management for WiFi control * Update core/internal/server/network/backend_wpa_ethernet.go Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> * Implement Ethernet monitoring in WpaSupplicantBackend * Refactor startEthernetMonitor and add debounce logic Refactor the startEthernetMonitor function to improve readability and maintainability. Introduce a debounce mechanism for processing relevant FreeBSD route events. * Reorder import statements in backend_pkg.go * Remove unnecessary blank line in backend_wpa_ethernet.go * Implement FreeBSD audio polling based on UI visibility Introduce a polling mechanism for FreeBSD audio device updates based on visibility of UI elements. * Add readonly freeBsdPollingRequested property and optimize polling Introduce a readonly property to determine if FreeBSD polling is requested based on various UI conditions. Update command execution to prioritize polling efficiency. * Simplify freeBsdPollingRequested logic Removed unnecessary conditions from freeBsdPollingRequested property. * Implement reference counting for battery consumers Added reference counting to manage battery information consumers and updated related functions for better battery state handling. --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
109 lines
3.9 KiB
QML
109 lines
3.9 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import Quickshell
|
|
import qs.Common
|
|
import qs.Modules.ControlCenter
|
|
import qs.Modules.ControlCenter.Widgets
|
|
import qs.Services
|
|
import qs.DCommon.Widgets
|
|
import "../../../Common/QmlUtils.js" as QmlUtils
|
|
|
|
Item {
|
|
id: root
|
|
|
|
implicitHeight: column.height
|
|
|
|
LayoutMirroring.enabled: I18n.isRtl
|
|
LayoutMirroring.childrenInherit: true
|
|
|
|
readonly property string title: I18n.tr("Audio Input")
|
|
readonly property var pinnedInputs: QmlUtils.normalizePinList((CacheData.audioInputDevicePins || {})["preferredInput"])
|
|
|
|
readonly property Item headerActions: CcSettingsButton {
|
|
settingsTab: "audio"
|
|
}
|
|
|
|
function togglePin(name) {
|
|
CacheData.set("audioInputDevicePins", QmlUtils.togglePinEntry(CacheData.audioInputDevicePins, "preferredInput", name, CcMetrics.maxPins));
|
|
}
|
|
|
|
function deviceIcon(node) {
|
|
const name = node?.name ?? "";
|
|
return name.includes("bluez") || name.includes("usb") ? "headset" : "mic";
|
|
}
|
|
|
|
DFlickable {
|
|
anchors.fill: parent
|
|
contentHeight: column.height
|
|
clip: true
|
|
|
|
Column {
|
|
id: column
|
|
width: parent.width
|
|
spacing: CcMetrics.detailContentGap
|
|
|
|
CcGroup {
|
|
AudioSliderRow {
|
|
node: AudioService.source
|
|
isInput: true
|
|
}
|
|
}
|
|
|
|
CcSectionLabel {
|
|
text: I18n.tr("Input devices")
|
|
}
|
|
|
|
CcGroup {
|
|
Repeater {
|
|
model: ScriptModel {
|
|
values: {
|
|
const hidden = SessionData.hiddenInputDeviceNames ?? [];
|
|
const nodes = AudioService.allNodes.filter(node => node.audio && !node.isSink && !node.isStream && !hidden.includes(node.name));
|
|
const pinnedList = root.pinnedInputs;
|
|
return nodes.sort((a, b) => {
|
|
const aPinned = pinnedList.indexOf(a.name);
|
|
const bPinned = pinnedList.indexOf(b.name);
|
|
if (aPinned !== -1 || bPinned !== -1) {
|
|
if (aPinned === -1)
|
|
return 1;
|
|
if (bPinned === -1)
|
|
return -1;
|
|
return aPinned - bPinned;
|
|
}
|
|
if (a === AudioService.source && b !== AudioService.source)
|
|
return -1;
|
|
if (b === AudioService.source && a !== AudioService.source)
|
|
return 1;
|
|
return 0;
|
|
});
|
|
}
|
|
}
|
|
|
|
CcListRow {
|
|
id: deviceRow
|
|
|
|
required property var modelData
|
|
|
|
iconName: root.deviceIcon(modelData)
|
|
title: AudioService.displayName(modelData)
|
|
subtitle: active ? I18n.tr("Active") : I18n.tr("Available")
|
|
active: modelData === AudioService.source
|
|
clickable: true
|
|
onClicked: {
|
|
if (modelData?.name)
|
|
AudioService.setDefaultSourceByName(modelData.name);
|
|
}
|
|
|
|
CcPinChip {
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
pinned: root.pinnedInputs.includes(deviceRow.modelData.name)
|
|
onToggled: root.togglePin(deviceRow.modelData.name)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|