Winport wifi cleanups after 9d05935
. Removes interface for setting wifi mode along with removing redundant code.
This commit is contained in:
parent
620048c43c
commit
c640e5c480
|
@ -2234,7 +2234,6 @@ int _main()
|
||||||
Piano.Enabled = (slot2_device_type == NDS_SLOT2_EASYPIANO)?true:false;
|
Piano.Enabled = (slot2_device_type == NDS_SLOT2_EASYPIANO)?true:false;
|
||||||
Paddle.Enabled = (slot2_device_type == NDS_SLOT2_PADDLE)?true:false;
|
Paddle.Enabled = (slot2_device_type == NDS_SLOT2_PADDLE)?true:false;
|
||||||
|
|
||||||
CommonSettings.wifi.mode = (WifiCommInterfaceID)GetPrivateProfileInt("Wifi", "Mode", WifiCommInterfaceID_AdHoc, IniName);
|
|
||||||
CommonSettings.wifi.infraBridgeAdapter = GetPrivateProfileInt("Wifi", "BridgeAdapter", 0, IniName);
|
CommonSettings.wifi.infraBridgeAdapter = GetPrivateProfileInt("Wifi", "BridgeAdapter", 0, IniName);
|
||||||
|
|
||||||
osd = new OSDCLASS(-1);
|
osd = new OSDCLASS(-1);
|
||||||
|
@ -6210,8 +6209,6 @@ LRESULT CALLBACK MicrophoneSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam,
|
||||||
|
|
||||||
LRESULT CALLBACK WifiSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK WifiSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
const bool isSocketsSupported = wifiHandler->IsSocketsSupported();
|
|
||||||
const bool isPCapSupported = wifiHandler->IsPCapSupported();
|
|
||||||
const WifiEmulationLevel emulationLevel = wifiHandler->GetSelectedEmulationLevel();
|
const WifiEmulationLevel emulationLevel = wifiHandler->GetSelectedEmulationLevel();
|
||||||
|
|
||||||
switch(uMsg)
|
switch(uMsg)
|
||||||
|
@ -6235,12 +6232,6 @@ LRESULT CALLBACK WifiSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_WIFI_ENABLED), FALSE);
|
EnableWindow(GetDlgItem(hDlg, IDC_WIFI_ENABLED), FALSE);
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_WIFI_COMPAT), FALSE);
|
EnableWindow(GetDlgItem(hDlg, IDC_WIFI_COMPAT), FALSE);
|
||||||
#endif
|
#endif
|
||||||
if (isSocketsSupported && isPCapSupported)
|
|
||||||
CheckRadioButton(hDlg, IDC_WIFIMODE0, IDC_WIFIMODE1, IDC_WIFIMODE0 + CommonSettings.wifi.mode);
|
|
||||||
else if(isSocketsSupported)
|
|
||||||
CheckRadioButton(hDlg, IDC_WIFIMODE0, IDC_WIFIMODE1, IDC_WIFIMODE0);
|
|
||||||
else
|
|
||||||
CheckRadioButton(hDlg, IDC_WIFIMODE0, IDC_WIFIMODE1, IDC_WIFIMODE1);
|
|
||||||
|
|
||||||
HWND deviceMenu = GetDlgItem(hDlg, IDC_BRIDGEADAPTER);
|
HWND deviceMenu = GetDlgItem(hDlg, IDC_BRIDGEADAPTER);
|
||||||
int menuItemCount = ComboBox_GetCount(deviceMenu);
|
int menuItemCount = ComboBox_GetCount(deviceMenu);
|
||||||
|
@ -6252,15 +6243,6 @@ LRESULT CALLBACK WifiSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
ComboBox_DeleteString(deviceMenu, 0);
|
ComboBox_DeleteString(deviceMenu, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isPCapSupported)
|
|
||||||
{
|
|
||||||
deviceCount = wifiHandler->GetBridgeDeviceList(&deviceStringList);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetDlgItemText(hDlg, IDC_WIFIMODE1, "Infrastructure (winpcap not loaded)");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (deviceCount < 0)
|
if (deviceCount < 0)
|
||||||
{
|
{
|
||||||
ComboBox_AddString(deviceMenu, "Error: Cannot find any devices.");
|
ComboBox_AddString(deviceMenu, "Error: Cannot find any devices.");
|
||||||
|
@ -6283,9 +6265,6 @@ LRESULT CALLBACK WifiSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
ComboBox_SetCurSel(deviceMenu, CommonSettings.wifi.infraBridgeAdapter);
|
ComboBox_SetCurSel(deviceMenu, CommonSettings.wifi.infraBridgeAdapter);
|
||||||
EnableWindow(deviceMenu, TRUE);
|
EnableWindow(deviceMenu, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isSocketsSupported)
|
|
||||||
EnableWindow(GetDlgItem(hDlg, IDC_WIFIMODE0), FALSE);
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@ -6318,12 +6297,6 @@ LRESULT CALLBACK WifiSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||||
wifiHandler->SetEmulationLevel(WifiEmulationLevel_Off);
|
wifiHandler->SetEmulationLevel(WifiEmulationLevel_Off);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (IsDlgButtonChecked(hDlg, IDC_WIFIMODE0))
|
|
||||||
CommonSettings.wifi.mode = WifiCommInterfaceID_AdHoc;
|
|
||||||
else
|
|
||||||
CommonSettings.wifi.mode = WifiCommInterfaceID_Infrastructure;
|
|
||||||
WritePrivateProfileInt("Wifi", "Mode", CommonSettings.wifi.mode, IniName);
|
|
||||||
|
|
||||||
cur = GetDlgItem(hDlg, IDC_BRIDGEADAPTER);
|
cur = GetDlgItem(hDlg, IDC_BRIDGEADAPTER);
|
||||||
CommonSettings.wifi.infraBridgeAdapter = ComboBox_GetCurSel(cur);
|
CommonSettings.wifi.infraBridgeAdapter = ComboBox_GetCurSel(cur);
|
||||||
wifiHandler->SetBridgeDeviceIndex(CommonSettings.wifi.infraBridgeAdapter);
|
wifiHandler->SetBridgeDeviceIndex(CommonSettings.wifi.infraBridgeAdapter);
|
||||||
|
|
|
@ -320,10 +320,8 @@
|
||||||
#define IDC_GGREEN 1005
|
#define IDC_GGREEN 1005
|
||||||
#define IDC_ROTATE270 1006
|
#define IDC_ROTATE270 1006
|
||||||
#define IDC_GRED 1006
|
#define IDC_GRED 1006
|
||||||
#define IDC_WIFIMODE0 1006
|
|
||||||
#define IDC_ARM7BIOSBROWSE 1007
|
#define IDC_ARM7BIOSBROWSE 1007
|
||||||
#define IDC_GYELLOW 1007
|
#define IDC_GYELLOW 1007
|
||||||
#define IDC_WIFIMODE1 1007
|
|
||||||
#define IDC_MEMVIEWBOX 1008
|
#define IDC_MEMVIEWBOX 1008
|
||||||
#define IDC_GBLUE 1008
|
#define IDC_GBLUE 1008
|
||||||
#define IDC_ADHOC_SERVER 1008
|
#define IDC_ADHOC_SERVER 1008
|
||||||
|
|
|
@ -1237,21 +1237,18 @@ BEGIN
|
||||||
LTEXT "frames",IDC_STATIC,428,167,16,8
|
LTEXT "frames",IDC_STATIC,428,167,16,8
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_WIFISETTINGS DIALOGEX 0, 0, 331, 158
|
IDD_WIFISETTINGS DIALOGEX 0, 0, 331, 114
|
||||||
STYLE DS_SETFONT | DS_CENTER | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_CENTER | WS_CAPTION | WS_SYSMENU
|
||||||
CAPTION "Wifi settings"
|
CAPTION "Wifi settings"
|
||||||
FONT 8, "Ms Shell Dlg", 0, 0, 0x0
|
FONT 8, "Ms Shell Dlg", 0, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "OK",IDOK,222,136,50,14
|
DEFPUSHBUTTON "OK",IDOK,220,93,50,14
|
||||||
PUSHBUTTON "Cancel",IDCANCEL,276,136,50,14
|
PUSHBUTTON "Cancel",IDCANCEL,275,93,50,14
|
||||||
GROUPBOX "Infrastructure settings",IDC_STATIC,6,76,319,54
|
GROUPBOX "Infrastructure settings",IDC_STATIC,6,33,319,55
|
||||||
LTEXT "Bridge network adapter:",IDC_STATIC,12,94,306,8
|
LTEXT "Bridge network adapter:",IDC_STATIC,12,52,306,8
|
||||||
COMBOBOX IDC_BRIDGEADAPTER,12,106,306,45,CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
COMBOBOX IDC_BRIDGEADAPTER,12,68,306,45,CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||||
GROUPBOX "Wifi mode",IDC_STATIC,6,22,318,48
|
CONTROL "Enable WiFi Emulation",IDC_WIFI_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,84,10
|
||||||
CONTROL "Ad-hoc",IDC_WIFIMODE0,"Button",BS_AUTORADIOBUTTON,12,40,306,10
|
CONTROL "Compatibility Mode",IDC_WIFI_COMPAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,13,84,10
|
||||||
CONTROL "Infrastructure",IDC_WIFIMODE1,"Button",BS_AUTORADIOBUTTON,12,52,306,10
|
|
||||||
CONTROL "Enable WiFi Emulation",IDC_WIFI_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,150,10
|
|
||||||
CONTROL "Compatibility Mode",IDC_WIFI_COMPAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,170,6,150,10
|
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_INPUTCONFIG DIALOGEX 0, 0, 339, 148
|
IDD_INPUTCONFIG DIALOGEX 0, 0, 339, 148
|
||||||
|
@ -1923,7 +1920,7 @@ BEGIN
|
||||||
|
|
||||||
IDD_WIFISETTINGS, DIALOG
|
IDD_WIFISETTINGS, DIALOG
|
||||||
BEGIN
|
BEGIN
|
||||||
BOTTOMMARGIN, 156
|
BOTTOMMARGIN, 112
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_INPUTCONFIG, DIALOG
|
IDD_INPUTCONFIG, DIALOG
|
||||||
|
|
Loading…
Reference in New Issue