Edit WifiPanel.qml
This commit is contained in:
parent
70c0debe99
commit
9fce72f054
1 changed files with 9 additions and 5 deletions
|
|
@ -151,17 +151,16 @@ Item {
|
|||
function replaceQuickshell(ssid: string): string {
|
||||
const newName = ssid.replace("quickshell-", "");
|
||||
|
||||
if (!ssid.startsWith("quickshell-")){
|
||||
if (!ssid.startsWith("quickshell-")) {
|
||||
return newName;
|
||||
}
|
||||
|
||||
if (newName in wifiLogic.networks){
|
||||
if (wifiLogic.networks && newName in wifiLogic.networks) {
|
||||
console.log(`Quickshell ${newName} already exists, deleting old profile`)
|
||||
deleteProfileProcess.connName = ssid;
|
||||
deleteProfileProcess.running = true;
|
||||
}
|
||||
|
||||
|
||||
console.log(`Changing from ${ssid} to ${newName}`)
|
||||
renameConnectionProcess.oldName = ssid;
|
||||
renameConnectionProcess.newName = newName;
|
||||
|
|
@ -256,17 +255,22 @@ Item {
|
|||
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
console.log("Renamed connection '" + renameConnectionProcess.oldName + "' to '" + renameConnectionProcess.newName + "'");
|
||||
console.log("Successfully renamed connection '" +
|
||||
renameConnectionProcess.oldName + "' to '" +
|
||||
renameConnectionProcess.newName + "'");
|
||||
}
|
||||
}
|
||||
stderr: StdioCollector {
|
||||
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 {
|
||||
id: deleteProfileProcess
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue