mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 21:45:38 -05:00
fix context menus and general stuff
This commit is contained in:
@@ -49,8 +49,8 @@ Rectangle {
|
||||
name: {
|
||||
if (!NetworkService.wifiEnabled) {
|
||||
return "wifi_off";
|
||||
} else if (WifiService.currentWifiSSID !== "") {
|
||||
return getWiFiSignalIcon(WifiService.wifiSignalStrength);
|
||||
} else if (NetworkService.currentWifiSSID !== "") {
|
||||
return getWiFiSignalIcon(NetworkService.wifiSignalStrength);
|
||||
} else {
|
||||
return "wifi";
|
||||
}
|
||||
@@ -64,8 +64,8 @@ Rectangle {
|
||||
text: {
|
||||
if (!NetworkService.wifiEnabled) {
|
||||
return "WiFi is off";
|
||||
} else if (NetworkService.wifiEnabled && WifiService.currentWifiSSID) {
|
||||
return WifiService.currentWifiSSID || "Connected";
|
||||
} else if (NetworkService.wifiEnabled && NetworkService.currentWifiSSID) {
|
||||
return NetworkService.currentWifiSSID || "Connected";
|
||||
} else {
|
||||
return "Not Connected";
|
||||
}
|
||||
@@ -82,7 +82,7 @@ Rectangle {
|
||||
text: {
|
||||
if (!NetworkService.wifiEnabled) {
|
||||
return "Turn on WiFi to see networks";
|
||||
} else if (NetworkService.wifiEnabled && WifiService.currentWifiSSID) {
|
||||
} else if (NetworkService.wifiEnabled && NetworkService.currentWifiSSID) {
|
||||
return NetworkService.wifiIP || "Connected";
|
||||
} else {
|
||||
return "Select a network below";
|
||||
@@ -130,13 +130,13 @@ Rectangle {
|
||||
onClicked: {
|
||||
if (NetworkService.wifiEnabled) {
|
||||
// When turning WiFi off, clear all cached WiFi data
|
||||
WifiService.currentWifiSSID = "";
|
||||
WifiService.wifiSignalStrength = "excellent";
|
||||
WifiService.wifiNetworks = [];
|
||||
WifiService.savedWifiNetworks = [];
|
||||
WifiService.connectionStatus = "";
|
||||
WifiService.connectingSSID = "";
|
||||
WifiService.isScanning = false;
|
||||
NetworkService.currentWifiSSID = "";
|
||||
NetworkService.wifiSignalStrength = "excellent";
|
||||
NetworkService.wifiNetworks = [];
|
||||
NetworkService.savedWifiNetworks = [];
|
||||
NetworkService.connectionStatus = "";
|
||||
NetworkService.connectingSSID = "";
|
||||
NetworkService.isScanning = false;
|
||||
NetworkService.refreshNetworkStatus();
|
||||
}
|
||||
NetworkService.toggleWifiRadio();
|
||||
|
||||
@@ -118,10 +118,10 @@ Rectangle {
|
||||
onClicked: {
|
||||
if (wifiContextMenuWindow.networkData) {
|
||||
if (wifiContextMenuWindow.networkData.connected) {
|
||||
WifiService.disconnectWifi();
|
||||
NetworkService.disconnectWifi();
|
||||
} else {
|
||||
if (wifiContextMenuWindow.networkData.saved) {
|
||||
WifiService.connectToWifi(wifiContextMenuWindow.networkData.ssid);
|
||||
NetworkService.connectToWifi(wifiContextMenuWindow.networkData.ssid);
|
||||
} else if (wifiContextMenuWindow.networkData.secured) {
|
||||
if (wifiPasswordModalRef) {
|
||||
wifiPasswordModalRef.wifiPasswordSSID = wifiContextMenuWindow.networkData.ssid;
|
||||
@@ -129,7 +129,7 @@ Rectangle {
|
||||
wifiPasswordModalRef.wifiPasswordModalVisible = true;
|
||||
}
|
||||
} else {
|
||||
WifiService.connectToWifi(wifiContextMenuWindow.networkData.ssid);
|
||||
NetworkService.connectToWifi(wifiContextMenuWindow.networkData.ssid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ Rectangle {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (wifiContextMenuWindow.networkData) {
|
||||
WifiService.forgetWifiNetwork(wifiContextMenuWindow.networkData.ssid);
|
||||
NetworkService.forgetWifiNetwork(wifiContextMenuWindow.networkData.ssid);
|
||||
}
|
||||
wifiContextMenuWindow.hide();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ Column {
|
||||
width: 28
|
||||
height: 28
|
||||
radius: 14
|
||||
color: refreshAreaSpan.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : WifiService.isScanning ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.06) : "transparent"
|
||||
color: refreshAreaSpan.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : NetworkService.isScanning ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.06) : "transparent"
|
||||
|
||||
DankIcon {
|
||||
id: refreshIconSpan
|
||||
@@ -63,12 +63,12 @@ Column {
|
||||
name: "refresh"
|
||||
size: Theme.iconSize - 6
|
||||
color: refreshAreaSpan.containsMouse ? Theme.primary : Theme.surfaceText
|
||||
rotation: WifiService.isScanning ? refreshIconSpan.rotation : 0
|
||||
rotation: NetworkService.isScanning ? refreshIconSpan.rotation : 0
|
||||
|
||||
RotationAnimation {
|
||||
target: refreshIconSpan
|
||||
property: "rotation"
|
||||
running: WifiService.isScanning
|
||||
running: NetworkService.isScanning
|
||||
from: 0
|
||||
to: 360
|
||||
duration: 1000
|
||||
@@ -89,10 +89,10 @@ Column {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (!WifiService.isScanning) {
|
||||
if (!NetworkService.isScanning) {
|
||||
// Immediate visual feedback
|
||||
refreshIconSpan.rotation += 30;
|
||||
WifiService.scanWifi();
|
||||
NetworkService.scanWifi();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,9 +164,9 @@ Column {
|
||||
text: {
|
||||
if (modelData.connected)
|
||||
return "Connected";
|
||||
if (WifiService.connectionStatus === "connecting" && WifiService.connectingSSID === modelData.ssid)
|
||||
if (NetworkService.connectionStatus === "connecting" && NetworkService.connectingSSID === modelData.ssid)
|
||||
return "Connecting...";
|
||||
if (WifiService.connectionStatus === "invalid_password" && WifiService.connectingSSID === modelData.ssid)
|
||||
if (NetworkService.connectionStatus === "invalid_password" && NetworkService.connectingSSID === modelData.ssid)
|
||||
return "Invalid password";
|
||||
if (modelData.saved)
|
||||
return "Saved" + (modelData.secured ? " • Secured" : " • Open");
|
||||
@@ -174,9 +174,9 @@ Column {
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall - 1
|
||||
color: {
|
||||
if (WifiService.connectionStatus === "connecting" && WifiService.connectingSSID === modelData.ssid)
|
||||
if (NetworkService.connectionStatus === "connecting" && NetworkService.connectingSSID === modelData.ssid)
|
||||
return Theme.primary;
|
||||
if (WifiService.connectionStatus === "invalid_password" && WifiService.connectingSSID === modelData.ssid)
|
||||
if (NetworkService.connectionStatus === "invalid_password" && NetworkService.connectingSSID === modelData.ssid)
|
||||
return Theme.error;
|
||||
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.7);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ Column {
|
||||
return;
|
||||
|
||||
if (modelData.saved) {
|
||||
WifiService.connectToWifi(modelData.ssid);
|
||||
NetworkService.connectToWifi(modelData.ssid);
|
||||
} else if (modelData.secured) {
|
||||
if (wifiPasswordModalRef) {
|
||||
wifiPasswordModalRef.wifiPasswordSSID = modelData.ssid;
|
||||
@@ -261,7 +261,7 @@ Column {
|
||||
wifiPasswordModalRef.wifiPasswordModalVisible = true;
|
||||
}
|
||||
} else {
|
||||
WifiService.connectToWifi(modelData.ssid);
|
||||
NetworkService.connectToWifi(modelData.ssid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user