Release v0.6.63: automatic LAN transport fallback and connection help
This commit is contained in:
1 parent
3761b790ae
commit
5a2106899d
16 files changed
+376
-42
No files matched your search
@@ -402,12 +402,28 @@ int main()
|
||||
require(GetDlgItem(lan,711)==nullptr,"obsolete side radios are removed");
|
||||
require(SendDlgItemMessageW(lan,702,LB_GETCOUNT,0,0)==0,"disabled discovery lists no generic network devices");
|
||||
require(!std::filesystem::exists(root/L"lan-pairing.bin"),"opening LAN settings does not enable or save discovery");
|
||||
SendMessageW(lan,WM_COMMAND,722,0);
|
||||
auto help=findTestWindow(L"KSwitcher.LAN.Help",nullptr);
|
||||
require(help&&!IsWindowEnabled(lan),"connection help opens without changing network settings");
|
||||
wchar_t command[4096]{};GetDlgItemTextW(help,723,command,4096);
|
||||
require(std::wstring(command).find(ks::executable())!=std::wstring::npos&&
|
||||
std::wstring(command).find(L"-LocalPort 45884")!=std::wstring::npos&&
|
||||
std::wstring(command).find(L"-LocalPort 45883")!=std::wstring::npos&&
|
||||
std::wstring(command).find(L"-RemoteAddress LocalSubnet")!=std::wstring::npos,
|
||||
"help supplies local-subnet firewall commands for the actual resident executable and both transports");
|
||||
RedrawWindow(help,nullptr,nullptr,RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
|
||||
RECT helpRect{};GetClientRect(help,&helpRect);HDC helpDc=GetDC(help);
|
||||
auto helpImage=ks::screenshotClip(helpDc,helpRect.right,helpRect.bottom,{});ReleaseDC(help,helpDc);
|
||||
ks::atomicWrite(std::filesystem::path(ks::executable()).parent_path()/L"lan-connection-help.png",ks::encodePng(ks::decodeImage(helpImage)));
|
||||
SendMessageW(help,WM_COMMAND,IDCANCEL,0);
|
||||
require(IsWindowEnabled(lan),"closing connection help returns to LAN setup");
|
||||
RedrawWindow(lan,nullptr,nullptr,RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
|
||||
RECT lanRect{};GetClientRect(lan,&lanRect);HDC lanDc=GetDC(lan);
|
||||
auto lanImage=ks::screenshotClip(lanDc,lanRect.right,lanRect.bottom,{});ReleaseDC(lan,lanDc);
|
||||
ks::atomicWrite(std::filesystem::path(ks::executable()).parent_path()/L"lan-pairing.png",ks::encodePng(ks::decodeImage(lanImage)));
|
||||
SendMessageW(lan,WM_COMMAND,IDCANCEL,0);
|
||||
require(IsWindowEnabled(parent)&&!saveEnabled(),"closing discovery restores Settings without false unsaved state");
|
||||
require(status().find(L"Network changes save automatically")!=std::wstring::npos,"Settings explains why network actions do not enable Save");
|
||||
SendMessageW(parent,WM_COMMAND,IDCANCEL,0);
|
||||
}
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user