Edit WifiPanel.qml

This commit is contained in:
Ly-sec 2025-08-03 18:08:48 +02:00
parent 70c0debe99
commit 9fce72f054

View file

@ -151,17 +151,16 @@ Item {
function replaceQuickshell(ssid: string): string { function replaceQuickshell(ssid: string): string {
const newName = ssid.replace("quickshell-", ""); const newName = ssid.replace("quickshell-", "");
if (!ssid.startsWith("quickshell-")){ if (!ssid.startsWith("quickshell-")) {
return newName; return newName;
} }
if (newName in wifiLogic.networks){ if (wifiLogic.networks && newName in wifiLogic.networks) {
console.log(`Quickshell ${newName} already exists, deleting old profile`) console.log(`Quickshell ${newName} already exists, deleting old profile`)
deleteProfileProcess.connName = ssid; deleteProfileProcess.connName = ssid;
deleteProfileProcess.running = true; deleteProfileProcess.running = true;
} }
console.log(`Changing from ${ssid} to ${newName}`) console.log(`Changing from ${ssid} to ${newName}`)
renameConnectionProcess.oldName = ssid; renameConnectionProcess.oldName = ssid;
renameConnectionProcess.newName = newName; renameConnectionProcess.newName = newName;
@ -256,17 +255,22 @@ Item {
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {
console.log("Renamed connection '" + renameConnectionProcess.oldName + "' to '" + renameConnectionProcess.newName + "'"); console.log("Successfully renamed connection '" +
renameConnectionProcess.oldName + "' to '" +
renameConnectionProcess.newName + "'");
} }
} }
stderr: StdioCollector { stderr: StdioCollector {
onStreamFinished: { onStreamFinished: {
console.error("Error renaming connection '" + renameConnectionProcess.oldName + "':", text); if (text.trim() !== "" && !text.toLowerCase().includes("warning")) {
console.error("Error renaming connection:", text);
}
} }
} }
} }
// Process to rename a connection // Process to rename a connection
Process { Process {
id: deleteProfileProcess id: deleteProfileProcess