Skip to content

Commit

Permalink
fix: fixed UI issues with the modem section (#4869)
Browse files Browse the repository at this point in the history
* fix: Cellular tab activation fix

Signed-off-by: MMaiero <[email protected]>

* fix: wrong management of modem gps and diversity

Signed-off-by: MMaiero <[email protected]>

* fix: applied same fixes also to the wi-fi section

Signed-off-by: MMaiero <[email protected]>

* fix: not managed state

Signed-off-by: MMaiero <[email protected]>

---------

Signed-off-by: MMaiero <[email protected]>
  • Loading branch information
MMaiero authored Oct 2, 2023
1 parent ef48678 commit ec2d052
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,14 @@ private void arrangeOptionalTabs() {
InterfaceConfigWrapper wrapper = new InterfaceConfigWrapper(this.netIfConfig);

if (wrapper.isWireless()) {
showWirelessTabs();
showWirelessTabs(isIpv4Disabled || isUnmanagedSelected());
if (!isWirelessAP) {
includeDhcpNat = false;
}
} else if (wrapper.isModem()) {
includeDhcpNat = false;
this.modemGpsTabAnchorItem.setEnabled(wrapper.isGpsSupported() && !isUnmanagedSelected());
showModemTabs();
showModemTabs(isIpv4Disabled || isUnmanagedSelected());
} else {
showEthernetTabs();
if (wrapper.isLoopback()) {
Expand All @@ -339,12 +339,12 @@ private void arrangeOptionalTabs() {
}
}

private void showWirelessTabs() {
private void showWirelessTabs(boolean interfaceNotEnabled) {
removeTab(this.modemTabAnchorItem);
removeTab(this.modemGpsTabAnchorItem);
removeTab(this.modemAntennaTabAnchorItem);

this.wirelessTabAnchorItem.setEnabled(true);
this.wirelessTabAnchorItem.setEnabled(!interfaceNotEnabled);

insertTab(this.wirelessTabAnchorItem);
if (this.isNet2) {
Expand All @@ -354,11 +354,11 @@ private void showWirelessTabs() {
insertTab(this.dhcp4NatTabAnchorItem);
}

private void showModemTabs() {
private void showModemTabs(boolean interfaceNotEnabled) {
removeTab(this.wirelessTabAnchorItem);
removeTab(this.dhcp4NatTabAnchorItem);

this.modemTabAnchorItem.setEnabled(true);
this.modemTabAnchorItem.setEnabled(!interfaceNotEnabled);
this.modemAntennaTabAnchorItem.setEnabled(isModemLTE());

insertTab(this.modemTabAnchorItem);
Expand Down Expand Up @@ -389,8 +389,6 @@ private void removeOptionalTabs() {
this.visibleTabs.remove(this.net8021xTabAnchorItem);
this.visibleTabs.remove(this.dhcp4NatTabAnchorItem);
this.visibleTabs.remove(this.modemTabAnchorItem);
this.visibleTabs.remove(this.modemGpsTabAnchorItem);
this.visibleTabs.remove(this.modemAntennaTabAnchorItem);
}

private void refreshAllVisibleTabs() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,12 @@ public boolean isValid() {

@Override
public void setNetInterface(GwtNetInterfaceConfig config) {
logger.info("Start setNetInterface");

setDirty(true);
if (this.tcpStatus == null || this.selectedNetIfConfig != config) {
this.tcpStatus = this.tcpTab.getStatus();
}
if (config instanceof GwtWifiNetInterfaceConfig) {
this.selectedNetIfConfig = (GwtWifiNetInterfaceConfig) config;
logger.info("Selected ifconfig: " + selectedNetIfConfig.getProperties());

this.activeConfig = this.selectedNetIfConfig.getActiveWifiConfig();
if (Objects.nonNull(this.activeConfig)) {
Expand All @@ -456,8 +453,6 @@ public void setNetInterface(GwtNetInterfaceConfig config) {
}
loadCountryCode();
}

logger.info("Finished setNetInterface");
}

private void updateChanneList(GwtWifiConfig config) {
Expand Down

0 comments on commit ec2d052

Please sign in to comment.