Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed UI issues with the modem section #4869

Merged
merged 4 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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