Your Android phone and your Windows PC, working as one. Local-first, end-to-end encrypted, no account.
PC: join the phone's hotspot after Instant Hotspot turns it on
Beea9c1ac1b49b8
diff --git a/desktop/app/Cargo.toml b/desktop/app/Cargo.tomlindex abf0054..dc2710b 100644--- a/desktop/app/Cargo.toml+++ b/desktop/app/Cargo.toml@@ -88,6 +88,7 @@ windows = { workspace = true, features = ["Win32_System_Registry","Win32_System_Shutdown","Win32_System_SystemInformation",+ "Win32_NetworkManagement_WiFi","Win32_System_Threading","Win32_System_Time","Win32_System_WinRT",diff --git a/desktop/app/i18n/nectarlink_zh_CN.ts b/desktop/app/i18n/nectarlink_zh_CN.tsindex 4ad82b4..5b130ad 100644--- a/desktop/app/i18n/nectarlink_zh_CN.ts+++ b/desktop/app/i18n/nectarlink_zh_CN.ts@@ -4100,6 +4100,24 @@ What it needs<translation>用外部程序打开</translation></message></context>+<context>+ <name>Hotspot</name>+ <message>+ <location filename="rust_strings.h" line="302"/>+ <source>%1's hotspot didn't show up. Check that it's on, then pick %2 in Windows' Wi-Fi list.</source>+ <translation>没有找到 %1 的热点。请确认热点已开启,然后在 Windows 的 Wi-Fi 列表中选择 %2。</translation>+ </message>+ <message>+ <location filename="rust_strings.h" line="303"/>+ <source>Connected to %1's hotspot.</source>+ <translation>已连接到 %1 的热点。</translation>+ </message>+ <message>+ <location filename="rust_strings.h" line="304"/>+ <source>Couldn't join %1's hotspot. Pick %2 in Windows' Wi-Fi list.</source>+ <translation>无法连接到 %1 的热点。请在 Windows 的 Wi-Fi 列表中选择 %2。</translation>+ </message>+</context><context><name>IslandWindow</name><message>@@ -4198,62 +4216,62 @@ What it needs<context><name>Links</name><message>- <location filename="rust_strings.h" line="302"/>+ <location filename="rust_strings.h" line="305"/><source>%1: tap the notification on your phone to continue watching.</source><translation>%1:轻触手机上的通知以继续观看。</translation></message><message>- <location filename="rust_strings.h" line="303"/>+ <location filename="rust_strings.h" line="306"/><source>%1: tap the notification on your phone to open in Maps.</source><translation>%1:轻触手机上的通知以在地图中打开。</translation></message><message>- <location filename="rust_strings.h" line="304"/>+ <location filename="rust_strings.h" line="307"/><source>Copy a link or address first</source><translation>请先复制链接或地址</translation></message><message>- <location filename="rust_strings.h" line="305"/>+ <location filename="rust_strings.h" line="308"/><source>Copy a web link (https://…), geo: URI, or street address, then choose this again.</source><translation>复制网页链接(https://…)、geo: URI 或街道地址,然后再次选择此项。</translation></message><message>- <location filename="rust_strings.h" line="306"/>+ <location filename="rust_strings.h" line="309"/><source>Copy a web link, video URL, or street address, then choose this again to open it on your phone.</source><translation>复制网页链接、视频网址或街道地址,然后再次选择此项,即可在手机上打开。</translation></message><message>- <location filename="rust_strings.h" line="307"/>+ <location filename="rust_strings.h" line="310"/><source>Couldn't send it</source><translation>无法发送</translation></message><message>- <location filename="rust_strings.h" line="308"/>+ <location filename="rust_strings.h" line="311"/><source>No phone to open it on</source><translation>没有可打开它的手机</translation></message><message>- <location filename="rust_strings.h" line="309"/>+ <location filename="rust_strings.h" line="312"/><source>Pair a phone first, or enable opening links on your phone.</source><translation>请先配对手机,或在手机上启用打开链接。</translation></message><message>- <location filename="rust_strings.h" line="310"/>+ <location filename="rust_strings.h" line="313"/><source>Sent to %1</source><translation>已发送到 %1</translation></message><message>- <location filename="rust_strings.h" line="311"/>+ <location filename="rust_strings.h" line="314"/><source>Tap the notification on your phone to open it.</source><translation>轻触手机上的通知以打开。</translation></message><message>- <location filename="rust_strings.h" line="312"/>+ <location filename="rust_strings.h" line="315"/><source>That's not a link or address</source><translation>这不是链接或地址</translation></message><message>- <location filename="rust_strings.h" line="313"/>+ <location filename="rust_strings.h" line="316"/><source>Update NectarLink on %1.</source><translation>请更新 %1 上的 NectarLink。</translation></message>@@ -4547,17 +4565,17 @@ What it needs<context><name>Media</name><message>- <location filename="rust_strings.h" line="314"/>+ <location filename="rust_strings.h" line="317"/><source>Media is turned off for that device.</source><translation>已为该设备关闭媒体。</translation></message><message>- <location filename="rust_strings.h" line="315"/>+ <location filename="rust_strings.h" line="318"/><source>That player can't do that.</source><translation>该播放器无法执行此操作。</translation></message><message>- <location filename="rust_strings.h" line="316"/>+ <location filename="rust_strings.h" line="319"/><source>That player isn't playing anymore.</source><translation>该播放器已不再播放。</translation></message>@@ -4565,17 +4583,17 @@ What it needs<context><name>Messages</name><message>- <location filename="rust_strings.h" line="317"/>+ <location filename="rust_strings.h" line="320"/><source>Attachment is %1 (MMS supports up to 900 KB)</source><translation>附件大小为 %1(彩信最多支持 900 KB)</translation></message><message>- <location filename="rust_strings.h" line="318"/>+ <location filename="rust_strings.h" line="321"/><source>Group texts can't be sent from the PC yet.</source><translation>暂不支持从电脑发送群组短信。</translation></message><message>- <location filename="rust_strings.h" line="319"/>+ <location filename="rust_strings.h" line="322"/><source>Only image or voice-note audio files can be attached.</source><translation>只能附加图片或语音备忘音频文件。</translation></message>@@ -4896,102 +4914,102 @@ What it needs<context><name>Mirror</name><message>- <location filename="rust_strings.h" line="320"/>+ <location filename="rust_strings.h" line="323"/><source>Couldn't start recording.</source><translation>无法开始录制。</translation></message><message>- <location filename="rust_strings.h" line="321"/>+ <location filename="rust_strings.h" line="324"/><source>Mirror recording</source><translation>镜像录制</translation></message><message>- <location filename="rust_strings.h" line="322"/>+ <location filename="rust_strings.h" line="325"/><source>Mirror screenshot</source><translation>镜像截图</translation></message><message>- <location filename="rust_strings.h" line="323"/>+ <location filename="rust_strings.h" line="326"/><source>Mirroring is turned off for this phone.</source><translation>已为此手机关闭镜像。</translation></message><message>- <location filename="rust_strings.h" line="324"/>+ <location filename="rust_strings.h" line="327"/><source>Recording from %1, saved in Downloads\Nectarlink</source><translation>来自 %1 的录制,已保存到 Downloads\Nectarlink</translation></message><message>- <location filename="rust_strings.h" line="325"/>+ <location filename="rust_strings.h" line="328"/><source>Saved %1</source><translation>已保存 %1</translation></message><message>- <location filename="rust_strings.h" line="326"/>+ <location filename="rust_strings.h" line="329"/><source>Saved %1 to Downloads\Nectarlink.</source><translation>已将 %1 保存到 Downloads\Nectarlink。</translation></message><message>- <location filename="rust_strings.h" line="327"/>+ <location filename="rust_strings.h" line="330"/><source>Screenshot copied to clipboard.</source><translation>截图已复制到剪贴板。</translation></message><message>- <location filename="rust_strings.h" line="328"/>+ <location filename="rust_strings.h" line="331"/><source>Screenshot from %1, saved in Downloads\Nectarlink</source><translation>来自 %1 的截图,已保存到 Downloads\Nectarlink</translation></message><message>- <location filename="rust_strings.h" line="329"/>+ <location filename="rust_strings.h" line="332"/><source>Sending %1 files…</source><translation>正在发送 %1 个文件…</translation></message><message>- <location filename="rust_strings.h" line="330"/>+ <location filename="rust_strings.h" line="333"/><source>Sending %1…</source><translation>正在发送 %1…</translation></message><message>- <location filename="rust_strings.h" line="331"/>+ <location filename="rust_strings.h" line="334"/><source>Set up Wireless debugging in NectarLink on the phone to open its apps here.</source><translation>在手机上的 NectarLink 中设置无线调试,即可在这里打开其应用。</translation></message><message>- <location filename="rust_strings.h" line="332"/>+ <location filename="rust_strings.h" line="335"/><source>Show in folder</source><translation>在文件夹中显示</translation></message><message>- <location filename="rust_strings.h" line="333"/>+ <location filename="rust_strings.h" line="336"/><source>The app didn't open on the phone. Try again, or open NectarLink on the phone to check Wireless debugging.</source><translation>应用未在手机上打开。请重试,或在手机上打开 NectarLink 检查无线调试。</translation></message><message>- <location filename="rust_strings.h" line="334"/>+ <location filename="rust_strings.h" line="337"/><source>The phone isn't connected.</source><translation>手机未连接。</translation></message><message>- <location filename="rust_strings.h" line="335"/>+ <location filename="rust_strings.h" line="338"/><source>The screenshot couldn't be copied to the clipboard.</source><translation>无法将截图复制到剪贴板。</translation></message><message>- <location filename="rust_strings.h" line="336"/>+ <location filename="rust_strings.h" line="339"/><source>The screenshot couldn't be saved.</source><translation>无法保存截图。</translation></message><message>- <location filename="rust_strings.h" line="337"/>+ <location filename="rust_strings.h" line="340"/><source>This PC can't decode the phone's video.</source><translation>此电脑无法解码手机的视频。</translation></message><message>- <location filename="rust_strings.h" line="338"/>+ <location filename="rust_strings.h" line="341"/><source>This phone's app doesn't share its screen yet. Update NectarLink on the phone.</source><translation>此手机上的应用尚不能共享屏幕。请更新手机上的 NectarLink。</translation></message><message>- <location filename="rust_strings.h" line="339"/>+ <location filename="rust_strings.h" line="342"/><source>Wait for the screen to appear first.</source><translation>请等待屏幕先显示出来。</translation></message>@@ -5143,7 +5161,7 @@ What it needs<context><name>Mp4</name><message>- <location filename="rust_strings.h" line="340"/>+ <location filename="rust_strings.h" line="343"/><source>No video frames were recorded yet.</source><translation>尚未录制任何视频帧。</translation></message>@@ -5237,37 +5255,37 @@ What it needs<context><name>Notifications</name><message>- <location filename="rust_strings.h" line="341"/>+ <location filename="rust_strings.h" line="344"/><source>Code copied</source><translation>已复制验证码</translation></message><message>- <location filename="rust_strings.h" line="342"/>+ <location filename="rust_strings.h" line="345"/><source>Copy code</source><translation>复制验证码</translation></message><message>- <location filename="rust_strings.h" line="343"/>+ <location filename="rust_strings.h" line="346"/><source>Dismissed %1 from %2</source><translation>已清除 %2 的 %1 条通知</translation></message><message>- <location filename="rust_strings.h" line="344"/>+ <location filename="rust_strings.h" line="347"/><source>Dismissed %1 notifications</source><translation>已清除 %1 条通知</translation></message><message>- <location filename="rust_strings.h" line="345"/>+ <location filename="rust_strings.h" line="348"/><source>Dismissed from %1</source><translation>已清除来自 %1 的通知</translation></message><message>- <location filename="rust_strings.h" line="346"/>+ <location filename="rust_strings.h" line="349"/><source>Notification dismissed</source><translation>已清除通知</translation></message><message>- <location filename="rust_strings.h" line="347"/>+ <location filename="rust_strings.h" line="350"/><source>That notification is gone from the phone.</source><translation>该通知已不在手机上。</translation></message>@@ -5383,17 +5401,17 @@ What it needs<context><name>Obs</name><message>- <location filename="rust_strings.h" line="348"/>+ <location filename="rust_strings.h" line="351"/><source>OBS isn't reachable on port %1. Turn on its WebSocket server.</source><translation>无法通过端口 %1 连接 OBS。请开启其 WebSocket 服务器。</translation></message><message>- <location filename="rust_strings.h" line="349"/>+ <location filename="rust_strings.h" line="352"/><source>OBS: %1</source><translation>OBS:%1</translation></message><message>- <location filename="rust_strings.h" line="350"/>+ <location filename="rust_strings.h" line="353"/><source>The service on that port isn't OBS.</source><translation>该端口上的服务不是 OBS。</translation></message>@@ -5564,7 +5582,7 @@ What it needs<context><name>PcMirror</name><message>- <location filename="rust_strings.h" line="351"/>+ <location filename="rust_strings.h" line="354"/><source>Can't find the player's window. Play the video on this PC again, then turn on Play on phone.</source><translation>找不到播放器的窗口。请在此电脑上重新播放视频,然后打开“在手机上播放”。</translation></message>@@ -5572,17 +5590,17 @@ What it needs<context><name>PhoneMic</name><message>- <location filename="rust_strings.h" line="352"/>+ <location filename="rust_strings.h" line="355"/><source>Tap Start on %1 to use its microphone.</source><translation>在 %1 上轻触“开始”以使用其麦克风。</translation></message><message>- <location filename="rust_strings.h" line="353"/>+ <location filename="rust_strings.h" line="356"/><source>The microphone is turned off for this PC on %1.</source><translation>%1 上已为此电脑关闭麦克风。</translation></message><message>- <location filename="rust_strings.h" line="354"/>+ <location filename="rust_strings.h" line="357"/><source>Update NectarLink on %1 to use its microphone.</source><translation>请更新 %1 上的 NectarLink 以使用其麦克风。</translation></message>@@ -5590,57 +5608,57 @@ What it needs<context><name>PhotoBackup</name><message>- <location filename="rust_strings.h" line="355"/>+ <location filename="rust_strings.h" line="358"/><source>Can't write to the backup folder.</source><translation>无法写入备份文件夹。</translation></message><message>- <location filename="rust_strings.h" line="356"/>+ <location filename="rust_strings.h" line="359"/><source>Copying, %1 left</source><translation>正在复制,还剩 %1 项</translation></message><message>- <location filename="rust_strings.h" line="357"/>+ <location filename="rust_strings.h" line="360"/><source>Looking for new photos…</source><translation>正在查找新照片…</translation></message><message>- <location filename="rust_strings.h" line="358"/>+ <location filename="rust_strings.h" line="361"/><source>Off</source><translation>已关闭</translation></message><message>- <location filename="rust_strings.h" line="359"/>+ <location filename="rust_strings.h" line="362"/><source>Photos are turned off for this PC on %1.</source><translation>%1 上已为此电脑关闭照片。</translation></message><message>- <location filename="rust_strings.h" line="360"/>+ <location filename="rust_strings.h" line="363"/><source>The backup folder's drive is full.</source><translation>备份文件夹所在的磁盘已满。</translation></message><message>- <location filename="rust_strings.h" line="361"/>+ <location filename="rust_strings.h" line="364"/><source>The backup stopped. It tries again in a few minutes.</source><translation>备份已停止,几分钟后会再试。</translation></message><message>- <location filename="rust_strings.h" line="362"/>+ <location filename="rust_strings.h" line="365"/><source>Up to date</source><translation>已是最新</translation></message><message>- <location filename="rust_strings.h" line="363"/>+ <location filename="rust_strings.h" line="366"/><source>Up to date, %1 backed up</source><translation>已是最新,已备份 %1 项</translation></message><message>- <location filename="rust_strings.h" line="364"/>+ <location filename="rust_strings.h" line="367"/><source>Update NectarLink on %1 to back up its photos.</source><translation>请在 %1 上更新 NectarLink 以备份其照片。</translation></message><message>- <location filename="rust_strings.h" line="365"/>+ <location filename="rust_strings.h" line="368"/><source>Waiting for %1</source><translation>正在等待 %1</translation></message>@@ -5648,67 +5666,67 @@ What it needs<context><name>Photos</name><message>- <location filename="rust_strings.h" line="366"/>+ <location filename="rust_strings.h" line="369"/><source>Copied to clipboard.</source><translation>已复制到剪贴板。</translation></message><message>- <location filename="rust_strings.h" line="367"/>+ <location filename="rust_strings.h" line="370"/><source>From %1</source><translation>来自 %1</translation></message><message>- <location filename="rust_strings.h" line="368"/>+ <location filename="rust_strings.h" line="371"/><source>New photo</source><translation>新照片</translation></message><message>- <location filename="rust_strings.h" line="369"/>+ <location filename="rust_strings.h" line="372"/><source>New screenshot</source><translation>新截图</translation></message><message>- <location filename="rust_strings.h" line="370"/>+ <location filename="rust_strings.h" line="373"/><source>No recent photos found on the phone.</source><translation>手机上没有最近的照片。</translation></message><message>- <location filename="rust_strings.h" line="371"/>+ <location filename="rust_strings.h" line="374"/><source>Opening latest photo…</source><translation>正在打开最新照片…</translation></message><message>- <location filename="rust_strings.h" line="372"/>+ <location filename="rust_strings.h" line="375"/><source>Saved %1 items to %2.</source><translation>已将 %1 个项目保存到 %2。</translation></message><message>- <location filename="rust_strings.h" line="373"/>+ <location filename="rust_strings.h" line="376"/><source>Saved %1 to %2.</source><translation>已将 %1 保存到 %2。</translation></message><message>- <location filename="rust_strings.h" line="374"/>+ <location filename="rust_strings.h" line="377"/><source>That photo isn't on the phone anymore.</source><translation>该照片已不在手机上。</translation></message><message>- <location filename="rust_strings.h" line="375"/>+ <location filename="rust_strings.h" line="378"/><source>The phone doesn't share photos or files with this PC.</source><translation>手机未与此电脑共享照片或文件。</translation></message><message>- <location filename="rust_strings.h" line="376"/>+ <location filename="rust_strings.h" line="379"/><source>The phone isn't connected right now.</source><translation>手机当前未连接。</translation></message><message>- <location filename="rust_strings.h" line="377"/>+ <location filename="rust_strings.h" line="380"/><source>The photo couldn't be copied to the clipboard.</source><translation>无法将照片复制到剪贴板。</translation></message><message>- <location filename="rust_strings.h" line="378"/>+ <location filename="rust_strings.h" line="381"/><source>The photo couldn't be copied. It's in Downloads\Nectarlink.</source><translation>无法复制照片。它在 Downloads\Nectarlink 中。</translation></message>@@ -5988,32 +6006,32 @@ What it needs<context><name>PlayOnPhone</name><message>- <location filename="rust_strings.h" line="379"/>+ <location filename="rust_strings.h" line="382"/><source>Connect your phone to play on it.</source><translation>请连接手机后再在其上播放。</translation></message><message>- <location filename="rust_strings.h" line="380"/>+ <location filename="rust_strings.h" line="383"/><source>Media is turned off for %1.</source><translation>已为 %1 关闭媒体。</translation></message><message>- <location filename="rust_strings.h" line="381"/>+ <location filename="rust_strings.h" line="384"/><source>Opening in %1 on %2. Tap the notification there.</source><translation>正在 %2 上用 %1 打开。请轻触那里的通知。</translation></message><message>- <location filename="rust_strings.h" line="382"/>+ <location filename="rust_strings.h" line="385"/><source>Sent to %1. Tap the notification there.</source><translation>已发送到 %1。请轻触那里的通知。</translation></message><message>- <location filename="rust_strings.h" line="383"/>+ <location filename="rust_strings.h" line="386"/><source>Tap the notification on %1 to watch.</source><translation>轻触 %1 上的通知即可观看。</translation></message><message>- <location filename="rust_strings.h" line="384"/>+ <location filename="rust_strings.h" line="387"/><source>Update NectarLink on %1 to play on it.</source><translation>请更新 %1 上的 NectarLink 以在其上播放。</translation></message>@@ -6021,7 +6039,7 @@ What it needs<context><name>Prefs</name><message>- <location filename="rust_strings.h" line="385"/>+ <location filename="rust_strings.h" line="388"/><source>Connected to OBS.</source><translation>已连接到 OBS。</translation></message>@@ -6029,7 +6047,7 @@ What it needs<context><name>Recordings</name><message>- <location filename="rust_strings.h" line="386"/>+ <location filename="rust_strings.h" line="389"/><source>Recording from %1 saved</source><translation>已保存来自 %1 的录音</translation></message>@@ -6045,57 +6063,57 @@ What it needs<context><name>SendTo</name><message>- <location filename="rust_strings.h" line="387"/>+ <location filename="rust_strings.h" line="390"/><source>Copied to your phone's clipboard.</source><translation>已复制到手机的剪贴板。</translation></message><message>- <location filename="rust_strings.h" line="388"/>+ <location filename="rust_strings.h" line="391"/><source>Couldn't reach %1.</source><translation>无法连接 %1。</translation></message><message>- <location filename="rust_strings.h" line="389"/>+ <location filename="rust_strings.h" line="392"/><source>Couldn't send %1</source><translation>无法发送 %1</translation></message><message>- <location filename="rust_strings.h" line="390"/>+ <location filename="rust_strings.h" line="393"/><source>Couldn't send to %1</source><translation>无法发送到 %1</translation></message><message>- <location filename="rust_strings.h" line="391"/>+ <location filename="rust_strings.h" line="394"/><source>Couldn't share with %1</source><translation>无法与 %1 共享</translation></message><message>- <location filename="rust_strings.h" line="392"/>+ <location filename="rust_strings.h" line="395"/><source>File failed integrity check; partial file kept to resume.</source><translation>文件未通过完整性校验;已保留部分文件以便继续。</translation></message><message>- <location filename="rust_strings.h" line="393"/>+ <location filename="rust_strings.h" line="396"/><source>Send to %1 with NectarLink</source><translation>用 NectarLink 发送到 %1</translation></message><message>- <location filename="rust_strings.h" line="394"/>+ <location filename="rust_strings.h" line="397"/><source>Sending to %1…</source><translation>正在发送到 %1…</translation></message><message>- <location filename="rust_strings.h" line="395"/>+ <location filename="rust_strings.h" line="398"/><source>Sent to %1</source><translation>已发送到 %1</translation></message><message>- <location filename="rust_strings.h" line="396"/>+ <location filename="rust_strings.h" line="399"/><source>The transfer didn't go through.</source><translation>传输未完成。</translation></message><message>- <location filename="rust_strings.h" line="397"/>+ <location filename="rust_strings.h" line="400"/><source>Waiting for %1…</source><translation>正在等待 %1…</translation></message>@@ -6317,7 +6335,7 @@ What it needs</message><message><location filename="../qml/pages/SettingsPage.qml" line="161"/>- <location filename="../qml/pages/SettingsPage.qml" line="2103"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2127"/><source>Voice recordings</source><translation>语音录音</translation></message>@@ -6529,7 +6547,7 @@ What it needs</message><message><location filename="../qml/pages/SettingsPage.qml" line="899"/>- <location filename="../qml/pages/SettingsPage.qml" line="3327"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3406"/><source>Language</source><translation>语言</translation></message>@@ -6694,816 +6712,857 @@ What it needs</message><message><location filename="../qml/pages/SettingsPage.qml" line="1369"/>- <location filename="../qml/pages/SettingsPage.qml" line="3398"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3477"/><source>Unpair</source><translation>取消配对</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1457"/>- <location filename="../qml/pages/SettingsPage.qml" line="1498"/>- <location filename="../qml/pages/SettingsPage.qml" line="2180"/>- <location filename="../qml/pages/SettingsPage.qml" line="2917"/>- <location filename="../qml/pages/SettingsPage.qml" line="3269"/>- <location filename="../qml/pages/SettingsPage.qml" line="3282"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1384"/>+ <source>Join this phone's hotspot</source>+ <translation>连接此手机的热点</translation>+ </message>+ <message>+ <location filename="../qml/pages/SettingsPage.qml" line="1386"/>+ <source>When Instant Hotspot turns it on, this PC joins %1.</source>+ <translation>即时热点开启后,此电脑会连接到 %1。</translation>+ </message>+ <message>+ <location filename="../qml/pages/SettingsPage.qml" line="1387"/>+ <source>Join the phone's hotspot once from Windows' Wi-Fi list, then choose it here.</source>+ <translation>请先在 Windows 的 Wi-Fi 列表中连接一次手机热点,然后在这里选择它。</translation>+ </message>+ <message>+ <location filename="../qml/pages/SettingsPage.qml" line="1392"/>+ <source>Choose network</source>+ <translation>选择网络</translation>+ </message>+ <message>+ <location filename="../qml/pages/SettingsPage.qml" line="1481"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1522"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2204"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2941"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3293"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3306"/><source>Open</source><translation>打开</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1553"/>- <location filename="../qml/pages/SettingsPage.qml" line="1556"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1577"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1580"/><source>Stream PC audio to phone</source><translation>将电脑音频串流到手机</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1554"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1578"/><source>Listen to PC audio through your phone.</source><translation>通过手机收听电脑音频。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1585"/>- <location filename="../qml/pages/SettingsPage.qml" line="1588"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1609"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1612"/><source>Pause media during calls</source><translation>通话时暂停媒体</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1586"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1610"/><source>Auto-pause PC media when phone rings.</source><translation>手机响铃时自动暂停电脑媒体。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1600"/>- <location filename="../qml/pages/SettingsPage.qml" line="1603"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1624"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1627"/><source>Mute this PC while a phone watches</source><translation>手机观看时将此电脑静音</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1601"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1625"/><source>With Play on phone, the phone still gets the sound.</source><translation>使用“在手机上播放”时,手机仍会收到声音。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1616"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1640"/><source>Phone as microphone</source><translation>手机作为麦克风</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1618"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1642"/><source>Live from %1, playing into %2.</source><translation>正在接收 %1,播放到 %2。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1620"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1644"/><source>Tap Start on %1.</source><translation>请在 %1 上轻触“开始”。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1622"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1646"/><source>Plays into %1, so apps can pick its other end as a microphone.</source><translation>播放到 %1,应用可以把它的另一端选作麦克风。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1623"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1647"/><source>Plays into %1. To use it as a microphone in other apps, install a virtual audio cable such as VB-CABLE.</source><translation>播放到 %1。要在其他应用中用作麦克风,请安装虚拟音频线,例如 VB-CABLE。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1629"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1653"/><source>Output</source><translation>输出</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1639"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1663"/><source>Start</source><translation>开始</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1639"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1663"/><source>Stop</source><translation>停止</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1648"/>- <location filename="../qml/pages/SettingsPage.qml" line="1656"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1672"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1680"/><source>Microphone volume</source><translation>麦克风音量</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1649"/>- <location filename="../qml/pages/SettingsPage.qml" line="1657"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1673"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1681"/><source>%1%</source><translation>%1%</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1668"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1692"/><source>Virtual camera add-on</source><translation>虚拟摄像头插件</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1670"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1694"/><source>Registered for Zoom, Teams & Meet.</source><translation>已注册到 Zoom、Teams 与 Meet。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1671"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1695"/><source>One-time setup (admin required) for Zoom, Teams & Meet.</source><translation>为 Zoom、Teams 与 Meet 进行一次性设置(需要管理员权限)。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1690"/>- <location filename="../qml/pages/SettingsPage.qml" line="3116"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1714"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3140"/><source>Ready</source><translation>就绪</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1698"/>- <location filename="../qml/pages/SettingsPage.qml" line="2271"/>- <location filename="../qml/pages/SettingsPage.qml" line="2641"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1722"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2295"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2665"/><source>Remove</source><translation>移除</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1698"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1722"/><source>Set up</source><translation>设置</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1709"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1733"/><source>Phone</source><translation>手机</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1744"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1768"/><source>Camera</source><translation>摄像头</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1747"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1771"/><source>Back</source><translation>后置</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1748"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1772"/><source>Front</source><translation>前置</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1778"/>- <location filename="../qml/pages/SettingsPage.qml" line="1780"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1802"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1804"/><source>Mirror image</source><translation>镜像</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1791"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1815"/><source>Resolution</source><translation>分辨率</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1823"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1847"/><source>Preview · %1</source><translation>预览 · %1</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1824"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1848"/><source>Pair a phone to use its camera as a webcam</source><translation>配对手机即可将其摄像头用作电脑摄像头</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1835"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1859"/><source>Stop webcam</source><translation>停止摄像头</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1836"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1860"/><source>Start webcam</source><translation>启动摄像头</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1892"/>- <location filename="../qml/pages/SettingsPage.qml" line="1895"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1916"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1919"/><source>Follow phone Do not disturb</source><translation>跟随手机免打扰</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1893"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1917"/><source>Mute pop-ups while phone is on DND.</source><translation>手机处于免打扰时静音弹窗。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1924"/>- <location filename="../qml/pages/SettingsPage.qml" line="1927"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1948"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1951"/><source>Forward PC notifications</source><translation>转发电脑通知</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1925"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1949"/><source>Send PC alerts to phone while away.</source><translation>离开时把电脑提醒发送到手机。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1938"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1962"/><source>Quiet hours</source><translation>免打扰时段</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1939"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1963"/><source>Configure automatic DND schedule in Windows.</source><translation>在 Windows 中配置自动免打扰时间表。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1943"/>+ <location filename="../qml/pages/SettingsPage.qml" line="1967"/><source>Set a schedule</source><translation>设置时间表</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1987"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2011"/><source>Show</source><translation>显示</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1988"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2012"/><source>No pop-ups</source><translation>不弹出提示</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="1989"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2013"/><source>Hide</source><translation>隐藏</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2030"/>- <location filename="../qml/pages/SettingsPage.qml" line="2033"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2054"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2057"/><source>File Explorer Send to</source><translation>文件资源管理器“发送到”</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2031"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2055"/><source>Send files from right-click menu.</source><translation>从右键菜单发送文件。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2062"/>- <location filename="../qml/pages/SettingsPage.qml" line="2065"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2086"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2089"/><source>Your PC in your pocket</source><translation>口袋里的电脑</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2063"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2087"/><source>Share Downloads, Documents, Desktop & Pictures.</source><translation>共享下载、文档、桌面和图片文件夹。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2076"/>- <location filename="../qml/pages/SettingsPage.qml" line="2079"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2100"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2103"/><source>LocalSend on local network</source><translation>局域网内的 LocalSend</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2077"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2101"/><source>Share with nearby LocalSend devices without pairing.</source><translation>无需配对即可与附近的 LocalSend 设备共享。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2089"/>- <location filename="../qml/pages/SettingsPage.qml" line="2092"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2113"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2116"/><source>Open files shared from the phone</source><translation>打开手机共享的文件</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2090"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2114"/><source>Opens a shared photo or document as soon as it arrives.</source><translation>手机共享的照片或文档一到就自动打开。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2123"/>- <location filename="../qml/pages/SettingsPage.qml" line="2326"/>- <location filename="../qml/pages/SettingsPage.qml" line="2401"/>- <location filename="../qml/pages/SettingsPage.qml" line="2472"/>- <location filename="../qml/pages/SettingsPage.qml" line="2547"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2147"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2350"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2425"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2496"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2571"/><source>Reset</source><translation>重置</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2130"/>- <location filename="../qml/pages/SettingsPage.qml" line="2187"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2154"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2211"/><source>Choose folder</source><translation>选择文件夹</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2146"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2170"/><source>Photo backup</source><translation>照片备份</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2147"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2171"/><source>Copies new photos from every album into a folder on this PC, by year and month. Nothing is deleted, here or on the phone. Needs only the phone's photos permission.</source><translation>将所有相册中的新照片按年和月复制到此电脑上的文件夹。电脑和手机上的内容都不会被删除。只需要手机的照片权限。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2163"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2187"/><source>Back up photos from %1</source><translation>备份 %1 的照片</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2173"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2197"/><source>Backup folder</source><translation>备份文件夹</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2199"/>- <location filename="../qml/pages/SettingsPage.qml" line="2214"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2223"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2238"/><source>Include videos</source><translation>包括视频</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2200"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2224"/><source>Videos can be large. Copied one at a time, so a lost connection costs at most one file.</source><translation>视频可能很大。逐个复制,因此连接中断最多只影响一个文件。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2208"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2232"/><source>Back up now</source><translation>立即备份</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2232"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2256"/><source>Synced folders</source><translation>同步文件夹</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2233"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2257"/><source>One-way or two-way folder sync between phone and PC.</source><translation>手机与电脑之间的单向或双向文件夹同步。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2240"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2264"/><source>Sync now</source><translation>立即同步</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2247"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2271"/><source>Add DCIM → Pictures</source><translation>添加 DCIM → 图片</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2263"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2287"/><source>Two-way sync · conflict copies kept</source><translation>双向同步 · 保留冲突副本</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2263"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2287"/><source>One-way · phone to PC</source><translation>单向 · 手机到电脑</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2317"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2341"/><source>Command palette</source><translation>命令面板</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2318"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2342"/><source>Open from any app.</source><translation>可在任何应用中打开。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2363"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2387"/><source>Command palette shortcut</source><translation>命令面板快捷键</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2392"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2416"/><source>File shelf</source><translation>文件收纳架</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2393"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2417"/><source>Toggle screen-edge shelf.</source><translation>切换屏幕边缘收纳架。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2438"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2462"/><source>Shelf shortcut</source><translation>收纳架快捷键</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2463"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2487"/><source>Take photo</source><translation>拍照</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2464"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2488"/><source>Capture & paste photo.</source><translation>拍摄并粘贴照片。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2509"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2533"/><source>Take photo shortcut</source><translation>拍照快捷键</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2538"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2562"/><source>Scan document</source><translation>扫描文档</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2539"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2563"/><source>Scan & paste document.</source><translation>扫描并粘贴文档。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2584"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2608"/><source>Scan document shortcut</source><translation>扫描文档快捷键</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2600"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2624"/><source>Trigger-action rules</source><translation>触发-动作规则</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2601"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2625"/><source>Run actions when your phone connects, disconnects, or rings.</source><translation>手机连接、断开或响铃时执行动作。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2608"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2632"/><source>Lock PC on disconnect</source><translation>断开时锁定电脑</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2615"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2639"/><source>Pause media on ring</source><translation>响铃时暂停媒体</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2668"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2692"/><source>OBS Studio</source><translation>OBS Studio</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2669"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2693"/><source>For Deck tiles that run obs: commands. Turn on OBS's WebSocket server in Tools › WebSocket Server Settings.</source><translation>用于运行 obs: 命令的面板磁贴。请在 OBS 的“工具 › WebSocket 服务器设置”中开启 WebSocket 服务器。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2677"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2701"/><source>Port</source><translation>端口</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2701"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2725"/><source>OBS WebSocket port</source><translation>OBS WebSocket 端口</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2708"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2732"/><source>Password</source><translation>密码</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2730"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2754"/><source>OBS WebSocket password</source><translation>OBS WebSocket 密码</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2736"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2760"/><source>Saved</source><translation>已保存</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2736"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2760"/><source>None</source><translation>无</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2745"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2769"/><source>Save</source><translation>保存</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2756"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2780"/><source>Test connection</source><translation>测试连接</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2763"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2787"/><source>Remove password</source><translation>移除密码</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2803"/>- <location filename="../qml/pages/SettingsPage.qml" line="2824"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2827"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2848"/><source>Clipboard history</source><translation>剪贴板历史记录</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2807"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2831"/><source>%1 clips · %2 · kept 7 days</source><translation>%1 条剪贴板记录 · %2 · 保留 7 天</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2816"/>- <location filename="../qml/pages/SettingsPage.qml" line="2871"/>- <location filename="../qml/pages/SettingsPage.qml" line="2907"/>- <location filename="../qml/pages/SettingsPage.qml" line="2964"/>- <location filename="../qml/pages/SettingsPage.qml" line="2995"/>- <location filename="../qml/pages/SettingsPage.qml" line="3032"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2840"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2895"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2931"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2988"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3019"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3056"/><source>Clear</source><translation>清除</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2857"/>- <location filename="../qml/pages/SettingsPage.qml" line="2876"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2881"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2900"/><source>Notification history</source><translation>通知历史记录</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2861"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2885"/><source>%1 alerts · %2 · kept 24h</source><translation>%1 条提醒 · %2 · 保留 24 小时</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2893"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2917"/><source>Cross-device timeline</source><translation>跨设备时间线</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2897"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2921"/><source>1 item stored (max 5,000).</source><translation>已存储 1 个项目(上限 5,000)。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2898"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2922"/><source>%1 items stored (max 5,000).</source><translation>已存储 %1 个项目(上限 5,000)。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2923"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2947"/><source>30d</source><translation>30 天</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2924"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2948"/><source>90d</source><translation>90 天</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2925"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2949"/><source>1y</source><translation>1 年</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2926"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2950"/><source>All</source><translation>全部</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2941"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2965"/><source>Cached messages</source><translation>缓存的消息</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2949"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2973"/><source>1 chat</source><translation>1 个会话</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2949"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2973"/><source>%1 chats</source><translation>%1 个会话</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2950"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2974"/><source>1 message</source><translation>1 条消息</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2950"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2974"/><source>%1 messages</source><translation>%1 条消息</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2951"/>+ <location filename="../qml/pages/SettingsPage.qml" line="2975"/><source>%1 · %2 · %3 · kept 90 days</source><translation>%1 · %2 · %3 · 保留 90 天</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2985"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3009"/><source>Photo thumbnails</source><translation>照片缩略图</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="2989"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3013"/><source>%1 cached · %2 · kept 30 days</source><translation>已缓存 %1 · %2 · 保留 30 天</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3023"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3047"/><source>Transfer history</source><translation>传输历史记录</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3026"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3050"/><source>%1 records · kept with timeline</source><translation>%1 条记录 · 随时间线保留</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3043"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3067"/><source>Clear all local history & caches</source><translation>清除所有本地历史记录和缓存</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3044"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3068"/><source>Wipes local history and caches; keeps paired devices and settings.</source><translation>清除本地历史记录和缓存;保留已配对设备和设置。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3049"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3073"/><source>Clear everything…</source><translation>清除全部…</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3072"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3096"/><source>Connection Doctor</source><translation>连接诊断</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3073"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3097"/><source>Diagnose and fix firewall, network, or VPN issues.</source><translation>诊断并修复防火墙、网络或 VPN 问题。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3077"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3101"/><source>Check</source><translation>检查</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3085"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3109"/><source>Connect over mobile data</source><translation>通过移动数据连接</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3086"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3110"/><source>Stay connected over LTE/5G or relay when away from Wi-Fi.</source><translation>离开 Wi-Fi 时通过 LTE/5G 或中继保持连接。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3096"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3120"/><source>Wake from your phone</source><translation>从手机唤醒</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3101"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3125"/><source>No active network adapter found.</source><translation>未找到可用的网络适配器。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3103"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3127"/><source>%1 · Wake on Magic Packet ready.</source><translation>%1 · Magic Packet 网络唤醒已就绪。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3104"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3128"/><source>%1 · Enable Wake on Magic Packet in Device Manager.</source><translation>%1 · 请在设备管理器中启用 Magic Packet 网络唤醒。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3117"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3141"/><source>Off in Windows</source><translation>在 Windows 中已关闭</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3118"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3142"/><source>Check settings</source><translation>检查设置</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3119"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3143"/><source>No adapter</source><translation>无适配器</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3127"/>- <location filename="../qml/pages/SettingsPage.qml" line="3166"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3151"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3190"/><source>Local automation API</source><translation>本地自动化 API</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3129"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3153"/><source>Listening on 127.0.0.1:%1 · Token in %2</source><translation>正在监听 127.0.0.1:%1 · 令牌位于 %2</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3130"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3154"/><source>Local HTTP/SSE server (127.0.0.1:%1) for scripts and tools.</source><translation>供脚本和工具使用的本地 HTTP/SSE 服务器(127.0.0.1:%1)。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3176"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3200"/><source>NectarLink %1</source><translation>NectarLink %1</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3179"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3203"/><source>This PC: %1</source><translation>本机:%1</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3191"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3215"/><source>Update download</source><translation>更新下载</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3212"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3236"/><source>Update to %1</source><translation>更新到 %1</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3213"/>- <location filename="../qml/pages/SettingsPage.qml" line="3232"/>- <location filename="../qml/pages/SettingsPage.qml" line="3235"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3237"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3256"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3259"/><source>Check for updates</source><translation>检查更新</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3222"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3246"/><source>Open logs</source><translation>打开日志</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3233"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3257"/><source>Looks for a new version on GitHub once a day.</source><translation>每天在 GitHub 上检查一次新版本。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3246"/>- <location filename="../qml/pages/SettingsPage.qml" line="3249"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3270"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3273"/><source>Install updates automatically</source><translation>自动安装更新</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3247"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3271"/><source>When nobody is using the PC and nothing is in progress.</source><translation>在无人使用电脑且没有任务进行时。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3264"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3288"/><source>Setup walkthrough</source><translation>设置引导</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3265"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3289"/><source>Re-open the setup guide.</source><translation>重新打开设置指南。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3277"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3301"/><source>Features guide</source><translation>功能指南</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3278"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3302"/><source>What each feature needs and where to find it.</source><translation>了解各项功能需要什么以及在哪里找到。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3355"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3354"/>+ <source>Phone's hotspot network</source>+ <translation>手机热点网络</translation>+ </message>+ <message>+ <location filename="../qml/pages/SettingsPage.qml" line="3361"/>+ <source>Wi-Fi networks this PC has joined before. Windows keeps their passwords; NectarLink never sees them.</source>+ <translation>此电脑以前连接过的 Wi-Fi 网络。密码由 Windows 保存,NectarLink 不会看到。</translation>+ </message>+ <message>+ <location filename="../qml/pages/SettingsPage.qml" line="3362"/>+ <source>This PC hasn't saved any Wi-Fi networks yet. Join the phone's hotspot once from Windows' Wi-Fi list first.</source>+ <translation>此电脑还没有保存任何 Wi-Fi 网络。请先在 Windows 的 Wi-Fi 列表中连接一次手机热点。</translation>+ </message>+ <message>+ <location filename="../qml/pages/SettingsPage.qml" line="3386"/>+ <source>Don't join</source>+ <translation>不连接</translation>+ </message>+ <message>+ <location filename="../qml/pages/SettingsPage.qml" line="3434"/><source>Play the phone's microphone into</source><translation>将手机麦克风播放到</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3344"/>- <location filename="../qml/pages/SettingsPage.qml" line="3372"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3395"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3423"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3451"/><source>Close</source><translation>关闭</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3385"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3464"/><source>Unpair %1?</source><translation>取消配对 %1?</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3391"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3470"/><source>Both devices forget each other. You can pair them again any time.</source><translation>两台设备将互相遗忘。你可以随时重新配对。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3396"/>- <location filename="../qml/pages/SettingsPage.qml" line="3430"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3475"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3509"/><source>Cancel</source><translation>取消</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3416"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3495"/><source>Clear all local history & caches?</source><translation>清除所有本地历史记录和缓存?</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3425"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3504"/><source>Deletes clipboard history, Timeline, notification history, cached messages, photo thumbnails and transfer history on this PC. Paired devices, settings and downloaded files are kept.</source><translation>删除本机的剪贴板历史记录、时间线、通知历史记录、缓存的消息、照片缩略图和传输历史记录。已配对设备、设置和已下载的文件会保留。</translation></message><message>- <location filename="../qml/pages/SettingsPage.qml" line="3433"/>+ <location filename="../qml/pages/SettingsPage.qml" line="3512"/><source>Clear everything</source><translation>清除全部</translation></message>@@ -7511,22 +7570,22 @@ What it needs<context><name>Setup</name><message>- <location filename="rust_strings.h" line="398"/>+ <location filename="rust_strings.h" line="401"/><source>Couldn't start setup: %1</source><translation>无法启动安装程序:%1</translation></message><message>- <location filename="rust_strings.h" line="399"/>+ <location filename="rust_strings.h" line="402"/><source>Setup is taking too long. Try again after restarting the PC.</source><translation>安装时间过长。请重启电脑后再试。</translation></message><message>- <location filename="rust_strings.h" line="400"/>+ <location filename="rust_strings.h" line="403"/><source>Setup stopped with code %1.</source><translation>安装已停止,代码 %1。</translation></message><message>- <location filename="rust_strings.h" line="401"/>+ <location filename="rust_strings.h" line="404"/><source>The uninstaller is missing. Reinstall NectarLink, then uninstall it.</source><translation>缺少卸载程序。请重新安装 NectarLink,然后再卸载。</translation></message>@@ -7896,147 +7955,147 @@ What it needs<context><name>Timeline</name><message>- <location filename="rust_strings.h" line="402"/>+ <location filename="rust_strings.h" line="405"/><source>App window #%1</source><translation>应用窗口 #%1</translation></message><message>- <location filename="rust_strings.h" line="403"/>+ <location filename="rust_strings.h" line="406"/><source>Clip (removed from clipboard history)</source><translation>剪贴内容(已从剪贴板历史中删除)</translation></message><message>- <location filename="rust_strings.h" line="404"/>+ <location filename="rust_strings.h" line="407"/><source>Copied image</source><translation>已复制的图片</translation></message><message>- <location filename="rust_strings.h" line="405"/>+ <location filename="rust_strings.h" line="408"/><source>Copied link to clipboard.</source><translation>已将链接复制到剪贴板。</translation></message><message>- <location filename="rust_strings.h" line="406"/>+ <location filename="rust_strings.h" line="409"/><source>Copied to clipboard.</source><translation>已复制到剪贴板。</translation></message><message>- <location filename="rust_strings.h" line="407"/>+ <location filename="rust_strings.h" line="410"/><source>From %1</source><translation>来自 %1</translation></message><message>- <location filename="rust_strings.h" line="408"/>+ <location filename="rust_strings.h" line="411"/><source>In progress</source><translation>进行中</translation></message><message>- <location filename="rust_strings.h" line="409"/>+ <location filename="rust_strings.h" line="412"/><source>No phone is paired yet.</source><translation>尚未配对手机。</translation></message><message>- <location filename="rust_strings.h" line="410"/>+ <location filename="rust_strings.h" line="413"/><source>Opened from %1</source><translation>从 %1 打开</translation></message><message>- <location filename="rust_strings.h" line="411"/>+ <location filename="rust_strings.h" line="414"/><source>Opened on %1</source><translation>在 %1 上打开</translation></message><message>- <location filename="rust_strings.h" line="412"/>+ <location filename="rust_strings.h" line="415"/><source>Phone microphone</source><translation>手机麦克风</translation></message><message>- <location filename="rust_strings.h" line="413"/>+ <location filename="rust_strings.h" line="416"/><source>Phone webcam</source><translation>手机摄像头</translation></message><message>- <location filename="rust_strings.h" line="414"/>+ <location filename="rust_strings.h" line="417"/><source>Recorded on %1</source><translation>在 %1 上录制</translation></message><message>- <location filename="rust_strings.h" line="415"/>+ <location filename="rust_strings.h" line="418"/><source>Saved from %1</source><translation>从 %1 保存</translation></message><message>- <location filename="rust_strings.h" line="416"/>+ <location filename="rust_strings.h" line="419"/><source>Screen mirroring</source><translation>屏幕镜像</translation></message><message>- <location filename="rust_strings.h" line="417"/>+ <location filename="rust_strings.h" line="420"/><source>Sending to %1…</source><translation>正在发送到 %1…</translation></message><message>- <location filename="rust_strings.h" line="418"/>+ <location filename="rust_strings.h" line="421"/><source>Sent clip to %1.</source><translation>已将剪贴内容发送到 %1。</translation></message><message>- <location filename="rust_strings.h" line="419"/>+ <location filename="rust_strings.h" line="422"/><source>Sent to %1</source><translation>已发送到 %1</translation></message><message>- <location filename="rust_strings.h" line="420"/>+ <location filename="rust_strings.h" line="423"/><source>Session</source><translation>会话</translation></message><message>- <location filename="rust_strings.h" line="421"/>+ <location filename="rust_strings.h" line="424"/><source>That clip is no longer in clipboard history.</source><translation>该剪贴内容已不在剪贴板历史中。</translation></message><message>- <location filename="rust_strings.h" line="422"/>+ <location filename="rust_strings.h" line="425"/><source>That entry couldn't be removed. Try again.</source><translation>无法删除该条目,请重试。</translation></message><message>- <location filename="rust_strings.h" line="423"/>+ <location filename="rust_strings.h" line="426"/><source>That file was moved or deleted.</source><translation>该文件已被移动或删除。</translation></message><message>- <location filename="rust_strings.h" line="424"/>+ <location filename="rust_strings.h" line="427"/><source>That isn't a web link.</source><translation>这不是网页链接。</translation></message><message>- <location filename="rust_strings.h" line="425"/>+ <location filename="rust_strings.h" line="428"/><source>That photo was moved or deleted.</source><translation>该照片已被移动或删除。</translation></message><message>- <location filename="rust_strings.h" line="426"/>+ <location filename="rust_strings.h" line="429"/><source>The Timeline couldn't be cleared. Try again.</source><translation>无法清除时间线,请重试。</translation></message><message>- <location filename="rust_strings.h" line="427"/>+ <location filename="rust_strings.h" line="430"/><source>The photo couldn't be copied to the clipboard.</source><translation>无法将照片复制到剪贴板。</translation></message><message>- <location filename="rust_strings.h" line="428"/>+ <location filename="rust_strings.h" line="431"/><source>Voice recording</source><translation>录音</translation></message><message>- <location filename="rust_strings.h" line="429"/>+ <location filename="rust_strings.h" line="432"/><source>With %1</source><translation>与 %1</translation></message><message>- <location filename="rust_strings.h" line="430"/>+ <location filename="rust_strings.h" line="433"/><source>device</source><translation>设备</translation></message>@@ -8328,37 +8387,37 @@ What it needs<context><name>Transfers</name><message>- <location filename="rust_strings.h" line="431"/>+ <location filename="rust_strings.h" line="434"/><source>Accept in NectarLink to save to Downloads\Nectarlink</source><translation>在 NectarLink 中接受即可保存到 Downloads\Nectarlink</translation></message><message>- <location filename="rust_strings.h" line="432"/>+ <location filename="rust_strings.h" line="435"/><source>Files are turned off for that device.</source><translation>已为该设备关闭文件。</translation></message><message>- <location filename="rust_strings.h" line="433"/>+ <location filename="rust_strings.h" line="436"/><source>From %1, opened from Downloads\Nectarlink</source><translation>来自 %1,已从 Downloads\Nectarlink 打开</translation></message><message>- <location filename="rust_strings.h" line="434"/>+ <location filename="rust_strings.h" line="437"/><source>From %1, saved in Downloads\Nectarlink</source><translation>来自 %1,已保存到 Downloads\Nectarlink</translation></message><message>- <location filename="rust_strings.h" line="435"/>+ <location filename="rust_strings.h" line="438"/><source>Nearby device</source><translation>附近的设备</translation></message><message>- <location filename="rust_strings.h" line="436"/>+ <location filename="rust_strings.h" line="439"/><source>That's too many files to send at once.</source><translation>文件太多,无法一次发送。</translation></message><message>- <location filename="rust_strings.h" line="437"/>+ <location filename="rust_strings.h" line="440"/><source>There's nothing to send in there.</source><translation>那里没有可发送的内容。</translation></message>@@ -8366,67 +8425,67 @@ What it needs<context><name>Updater</name><message>- <location filename="rust_strings.h" line="438"/>+ <location filename="rust_strings.h" line="441"/><source>Couldn't check for updates. Check your internet connection.</source><translation>无法检查更新。请检查网络连接。</translation></message><message>- <location filename="rust_strings.h" line="439"/>+ <location filename="rust_strings.h" line="442"/><source>NectarLink %1 is available</source><translation>NectarLink %1 已发布</translation></message><message>- <location filename="rust_strings.h" line="440"/>+ <location filename="rust_strings.h" line="443"/><source>NectarLink %1 is available.</source><translation>NectarLink %1 已发布。</translation></message><message>- <location filename="rust_strings.h" line="441"/>+ <location filename="rust_strings.h" line="444"/><source>NectarLink is still on the version you had. Try again from Settings.</source><translation>NectarLink 仍是原来的版本。请在设置中重试。</translation></message><message>- <location filename="rust_strings.h" line="442"/>+ <location filename="rust_strings.h" line="445"/><source>NectarLink is up to date.</source><translation>NectarLink 已是最新版本。</translation></message><message>- <location filename="rust_strings.h" line="443"/>+ <location filename="rust_strings.h" line="446"/><source>NectarLink is updated to %1</source><translation>NectarLink 已更新到 %1</translation></message><message>- <location filename="rust_strings.h" line="444"/>+ <location filename="rust_strings.h" line="447"/><source>The download was damaged, so it wasn't installed. Try again.</source><translation>下载的文件已损坏,因此未安装。请重试。</translation></message><message>- <location filename="rust_strings.h" line="445"/>+ <location filename="rust_strings.h" line="448"/><source>The update couldn't be downloaded. Check your internet connection and try again.</source><translation>无法下载更新。请检查网络连接后重试。</translation></message><message>- <location filename="rust_strings.h" line="446"/>+ <location filename="rust_strings.h" line="449"/><source>The update couldn't be saved. Check that there's free space and try again.</source><translation>无法保存更新。请确认有足够的空间后重试。</translation></message><message>- <location filename="rust_strings.h" line="447"/>+ <location filename="rust_strings.h" line="450"/><source>The update couldn't be started. Try again.</source><translation>无法启动更新。请重试。</translation></message><message>- <location filename="rust_strings.h" line="448"/>+ <location filename="rust_strings.h" line="451"/><source>The update didn't install</source><translation>更新未安装</translation></message><message>- <location filename="rust_strings.h" line="449"/>+ <location filename="rust_strings.h" line="452"/><source>Update now, or later from Settings.</source><translation>立即更新,或稍后在设置中更新。</translation></message><message>- <location filename="rust_strings.h" line="450"/>+ <location filename="rust_strings.h" line="453"/><source>Your phone reconnects on its own.</source><translation>手机会自动重新连接。</translation></message>@@ -8626,12 +8685,12 @@ What it needs<context><name>Webcam</name><message>- <location filename="rust_strings.h" line="451"/>+ <location filename="rust_strings.h" line="454"/><source>Starting camera on %1…</source><translation>正在启动 %1 上的相机…</translation></message><message>- <location filename="rust_strings.h" line="452"/>+ <location filename="rust_strings.h" line="455"/><source>Streaming %1 × %2 · %3 fps from %4</source><translation>正在从 %4 传输 %1 × %2 · %3 fps</translation></message>@@ -8662,17 +8721,17 @@ What it needs<context><name>Widget</name><message>- <location filename="rust_strings.h" line="453"/>+ <location filename="rust_strings.h" line="456"/><source>No phone connected</source><translation>未连接手机</translation></message><message>- <location filename="rust_strings.h" line="454"/>+ <location filename="rust_strings.h" line="457"/><source>No recent clipboard items</source><translation>没有最近的剪贴板内容</translation></message><message>- <location filename="rust_strings.h" line="455"/>+ <location filename="rust_strings.h" line="458"/><source>Not available</source><translation>不可用</translation></message>diff --git a/desktop/app/i18n/rust_strings.h b/desktop/app/i18n/rust_strings.hindex b0f69aa..29ee72c 100644--- a/desktop/app/i18n/rust_strings.h+++ b/desktop/app/i18n/rust_strings.h@@ -299,6 +299,9 @@ static const char *const nectarlink_rust_strings[] = {QT_TRANSLATE_NOOP("Guide", "What it does\nStreams your phone screen into a low-latency desktop window with hardware-accelerated decoding, or opens individual Android apps in their own windows on your PC.\n\nWhere to find it\n- Left navigation rail › Apps.\n- Home › Mirror screen quick action.\n\nWhat it needs\n- Standard mode mirrors the full phone screen after you tap Start now on Android's screen capture prompt.\n- Elevated mode (Wireless debugging or root) skips the prompt and unlocks individual app windows.\n- Assist mode or Elevated mode lets you click, scroll, and type inside the mirrored window."), // desktop/app/src/bridge/app.rsQT_TRANSLATE_NOOP("Guide", "What it does\nSyncs media playback between your phone and PC, switches Windows audio output and microphone devices, and turns your phone into a customizable grid of shortcut tiles, macros, and volume sliders.\n\nWhere to find it\n- Left navigation rail › Deck.\n\nWhat it needs\n- Paired phone over any active connection."), // desktop/app/src/bridge/app.rsQT_TRANSLATE_NOOP("Guide", "What it does\nTriggers your phone camera from any Windows app to snap a photo or scan a document, then copies the result to the Windows clipboard and pastes it into the active window.\n\nWhere to find it\n- Global hotkeys Ctrl+Alt+C (Take photo with phone) and Ctrl+Alt+D (Scan document with phone).\n- Home › Continuity Camera.\n\nWhat it needs\n- Camera permission on your phone."), // desktop/app/src/bridge/app.rs+ QT_TRANSLATE_NOOP("Hotspot", "%1's hotspot didn't show up. Check that it's on, then pick %2 in Windows' Wi-Fi list."), // desktop/app/src/hotspot.rs+ QT_TRANSLATE_NOOP("Hotspot", "Connected to %1's hotspot."), // desktop/app/src/hotspot.rs+ QT_TRANSLATE_NOOP("Hotspot", "Couldn't join %1's hotspot. Pick %2 in Windows' Wi-Fi list."), // desktop/app/src/hotspot.rsQT_TRANSLATE_NOOP("Links", "%1: tap the notification on your phone to continue watching."), // desktop/app/src/links.rsQT_TRANSLATE_NOOP("Links", "%1: tap the notification on your phone to open in Maps."), // desktop/app/src/links.rsQT_TRANSLATE_NOOP("Links", "Copy a link or address first"), // desktop/app/src/links.rsdiff --git a/desktop/app/qml/pages/SettingsPage.qml b/desktop/app/qml/pages/SettingsPage.qmlindex b56468b..8a98171 100644--- a/desktop/app/qml/pages/SettingsPage.qml+++ b/desktop/app/qml/pages/SettingsPage.qml@@ -1374,6 +1374,30 @@ Item {}}}+ // Instant Hotspot: the saved Wi-Fi network the PC joins+ // after this phone turns its hotspot on.+ ListRow {+ id: hotspotRow+ width: parent.width+ property string network: AppController.hotspotNetwork(deviceCard.deviceId)+ iconPath: Icons.wifi+ title: qsTr("Join this phone's hotspot")+ description: hotspotRow.network.length > 0+ ? qsTr("When Instant Hotspot turns it on, this PC joins %1.").arg(hotspotRow.network)+ : qsTr("Join the phone's hotspot once from Windows' Wi-Fi list, then choose it here.")+ Button {+ anchors.verticalCenter: parent.verticalCenter+ variant: "tonal"+ size: "sm"+ text: qsTr("Choose network")+ onClicked: {+ hotspotSheet.deviceId = deviceCard.deviceId+ hotspotSheet.row = hotspotRow+ hotspotSheet.networks = JSON.parse(AppController.wifiNetworks() || "[]")+ hotspotSheet.open()+ }+ }+ }Repeater {model: page.toggleGroupsdelegate: Column {@@ -3318,6 +3342,67 @@ Item {Behavior on opacity { NumberAnimation { duration: Theme.fadeFast } }}+ Sheet {+ id: hotspotSheet+ property string deviceId+ property var row: null+ property var networks: []+ cardWidth: 420+ Column {+ width: parent.width+ spacing: 12+ Txt { width: parent.width; text: qsTr("Phone's hotspot network"); role: "headline"; wrapMode: Text.WordWrap }+ Txt {+ width: parent.width+ wrapMode: Text.WordWrap+ role: "body"+ muted: true+ text: hotspotSheet.networks.length > 0+ ? qsTr("Wi-Fi networks this PC has joined before. Windows keeps their passwords; NectarLink never sees them.")+ : qsTr("This PC hasn't saved any Wi-Fi networks yet. Join the phone's hotspot once from Windows' Wi-Fi list first.")+ }+ // A PC can have saved dozens of networks: the list scrolls.+ ListView {+ width: parent.width+ height: Math.min(contentHeight, 320)+ clip: true+ boundsBehavior: Flickable.StopAtBounds+ spacing: 4+ model: hotspotSheet.networks+ delegate: Button {+ required property var modelData+ width: ListView.view.width+ readonly property bool chosen: hotspotSheet.row !== null && hotspotSheet.row.network === modelData+ variant: chosen ? "tonal" : "text"+ iconPath: chosen ? Icons.check : Icons.wifi+ text: modelData+ onClicked: {+ AppController.setHotspotNetwork(hotspotSheet.deviceId, modelData)+ if (hotspotSheet.row !== null)+ hotspotSheet.row.network = modelData+ hotspotSheet.close()+ }+ }+ }+ Row {+ anchors.right: parent.right+ spacing: 10+ Button {+ variant: "text"+ text: qsTr("Don't join")+ visible: hotspotSheet.row !== null && hotspotSheet.row.network.length > 0+ onClicked: {+ AppController.setHotspotNetwork(hotspotSheet.deviceId, "")+ if (hotspotSheet.row !== null)+ hotspotSheet.row.network = ""+ hotspotSheet.close()+ }+ }+ Button { variant: "text"; text: qsTr("Close"); onClicked: hotspotSheet.close() }+ }+ }+ }+Sheet {id: languageSheetcardWidth: 400diff --git a/desktop/app/src/bridge/app.rs b/desktop/app/src/bridge/app.rsindex f7b9192..9c40593 100644--- a/desktop/app/src/bridge/app.rs+++ b/desktop/app/src/bridge/app.rs@@ -230,6 +230,17 @@ pub mod qobject {/// `[{ name, on }]`: what the user allows this device to do.#[qinvokable]fn device_toggles(self: &AppController, device: &QString) -> QList_QVariant;+ /// The Wi-Fi networks Windows has saved, as a JSON array of names.+ #[qinvokable]+ #[cxx_name = "wifiNetworks"]+ fn wifi_networks(self: &AppController) -> QString;+ /// The saved network the PC joins when this phone turns its hotspot on ("" for none).+ #[qinvokable]+ #[cxx_name = "hotspotNetwork"]+ fn hotspot_network(self: &AppController, device: &QString) -> QString;+ #[qinvokable]+ #[cxx_name = "setHotspotNetwork"]+ fn set_hotspot_network(self: &AppController, device: &QString, network: &QString);#[qinvokable]fn set_device_toggle(self: Pin<&mut AppController>, device: &QString, name: &QString, on: bool);/// Latest quick settings toggles for a phone as JSON (`""` when unknown).@@ -1603,6 +1614,24 @@ impl qobject::AppController {feature_state_map(state)}+ pub fn wifi_networks(&self) -> QString {+ QString::from(+ &serde_json::to_string(&crate::win::wifi::saved_networks()).unwrap_or_else(|_| "[]".into()),+ )+ }++ pub fn hotspot_network(&self, device: &QString) -> QString {+ let network = super::parse_device(device).and_then(crate::hotspot::network_for);+ QString::from(network.as_deref().unwrap_or(""))+ }++ pub fn set_hotspot_network(&self, device: &QString, network: &QString) {+ if let Some(id) = super::parse_device(device) {+ let name = String::from(network);+ crate::hotspot::set_network(id, (!name.trim().is_empty()).then_some(name));+ }+ }+pub fn device_toggles(&self, device: &QString) -> QList<QVariant> {let mut list = QList::default();let (Some(id), Some(node)) = (super::parse_device(device), core_host::node()) else { return list };@@ -1694,11 +1723,17 @@ impl qobject::AppController {}s.set_toggles(device, Some(next))});+ let hotspot_on = id == "hotspot" && val == PhoneToggleValue::Bool(true);core_host::spawn(async move {- if let Err(e) = node.set_phone_toggle(device, id, val).await {- let latest = node.phone_toggles(device);- core_host::host().hub.update(|s| s.set_toggles(device, latest));- show_message(describe(&e));+ match node.set_phone_toggle(device, id, val).await {+ // The phone's hotspot is on: join it, when a network is set for it.+ Ok(()) if hotspot_on => crate::hotspot::hotspot_turned_on(device),+ Ok(()) => {}+ Err(e) => {+ let latest = node.phone_toggles(device);+ core_host::host().hub.update(|s| s.set_toggles(device, latest));+ show_message(describe(&e));+ }}});}diff --git a/desktop/app/src/hotspot.rs b/desktop/app/src/hotspot.rsnew file mode 100644index 0000000..d32061b--- /dev/null+++ b/desktop/app/src/hotspot.rs@@ -0,0 +1,280 @@+// SPDX-License-Identifier: GPL-3.0-or-later+//! Instant Hotspot, the PC's half: after the phone turns its hotspot on (Home's+//! Instant Hotspot, through Elevated), the PC joins it, using the Wi-Fi network+//! the user picked for that phone in Settings. That's a network Windows has+//! saved from when the user joined the hotspot themselves once, so NectarLink+//! never handles its password.++use crate::i18n::tr;+use std::{+ collections::HashMap,+ path::{Path, PathBuf},+ sync::Mutex,+ time::{Duration, Instant},+};++use nectarlink_core::DeviceId;++use crate::{bridge::app::show_message, core_host, state::Changes, win::wifi::Reach};++/// How long the phone's hotspot has to show up.+const APPEAR_WITHIN: Duration = Duration::from_secs(45);+/// How long Windows has to finish joining it.+const JOIN_WITHIN: Duration = Duration::from_secs(20);+const LOOK_EVERY: Duration = Duration::from_secs(2);++static NETWORKS: Mutex<Option<HashMap<DeviceId, String>>> = Mutex::new(None);+/// Phones whose hotspot the PC is joining right now.+static JOINING: Mutex<Vec<DeviceId>> = Mutex::new(Vec::new());++fn file() -> PathBuf {+ core_host::host().data_dir.join("hotspot.json")+}++fn load(path: &Path) -> HashMap<DeviceId, String> {+ std::fs::read(path)+ .ok()+ .and_then(|b| serde_json::from_slice::<HashMap<String, String>>(&b).ok())+ .map(|m| m.into_iter().filter_map(|(k, v)| Some((k.parse().ok()?, v))).collect())+ .unwrap_or_default()+}++fn save(path: &Path, networks: &HashMap<DeviceId, String>) -> std::io::Result<()> {+ let plain: HashMap<String, &String> = networks.iter().map(|(k, v)| (k.to_string(), v)).collect();+ let tmp = path.with_extension("json.tmp");+ std::fs::write(&tmp, serde_json::to_vec(&plain).map_err(std::io::Error::other)?)?;+ std::fs::rename(&tmp, path)+}++fn with_networks<T>(f: impl FnOnce(&mut HashMap<DeviceId, String>) -> T) -> T {+ let mut guard = NETWORKS.lock().unwrap_or_else(|e| e.into_inner());+ let networks = guard.get_or_insert_with(|| load(&file()));+ f(networks)+}++/// The Wi-Fi network the PC joins when `device` turns its hotspot on, if one is set.+pub fn network_for(device: DeviceId) -> Option<String> {+ with_networks(|n| n.get(&device).cloned())+}++/// Sets (or, with `None`, clears) the network for `device`'s hotspot.+pub fn set_network(device: DeviceId, network: Option<String>) {+ let snapshot = with_networks(|n| {+ match network.filter(|s| !s.trim().is_empty()) {+ Some(name) => n.insert(device, name),+ None => n.remove(&device),+ };+ n.clone()+ });+ if let Err(e) = save(&file(), &snapshot) {+ tracing::warn!(error = %e, "can't save the hotspot networks");+ }+ core_host::host().hub.changed(Changes::DEVICES);+}++/// What the PC needs from Wi-Fi, so joining can be tested without changing networks.+pub(crate) trait Wifi {+ fn scan(&self);+ fn reach(&self, profile: &str) -> Reach;+ fn connect(&self, profile: &str) -> Result<(), String>;+ fn wait(&self, d: Duration);+}++struct Windows;++impl Wifi for Windows {+ fn scan(&self) {+ crate::win::wifi::scan();+ }+ fn reach(&self, profile: &str) -> Reach {+ crate::win::wifi::reach(profile)+ }+ fn connect(&self, profile: &str) -> Result<(), String> {+ crate::win::wifi::connect(profile)+ }+ fn wait(&self, d: Duration) {+ std::thread::sleep(d);+ }+}++#[derive(Debug, Clone, PartialEq, Eq)]+pub(crate) enum JoinOutcome {+ Already,+ Joined,+ /// The hotspot never showed up in time.+ NotFound,+ Failed(String),+}++/// Waits for `profile` to come into range, joins it, and waits for Windows to finish.+pub(crate) fn join(+ wifi: &impl Wifi,+ profile: &str,+ appear_within: Duration,+ join_within: Duration,+) -> JoinOutcome {+ if wifi.reach(profile) == Reach::Connected {+ return JoinOutcome::Already;+ }+ let started = Instant::now();+ let mut waited = Duration::ZERO;+ loop {+ wifi.scan();+ wifi.wait(LOOK_EVERY);+ waited += LOOK_EVERY;+ match wifi.reach(profile) {+ Reach::Connected => return JoinOutcome::Joined,+ Reach::InRange => break,+ Reach::NotInRange if waited >= appear_within || started.elapsed() > appear_within * 2 => {+ return JoinOutcome::NotFound;+ }+ Reach::NotInRange => {}+ }+ }+ if let Err(e) = wifi.connect(profile) {+ return JoinOutcome::Failed(e);+ }+ let mut joining = Duration::ZERO;+ while joining < join_within {+ wifi.wait(LOOK_EVERY);+ joining += LOOK_EVERY;+ if wifi.reach(profile) == Reach::Connected {+ return JoinOutcome::Joined;+ }+ }+ JoinOutcome::Failed("Windows didn't finish joining".into())+}++/// The phone just turned its hotspot on: join it, if a network is set for it.+pub fn hotspot_turned_on(device: DeviceId) {+ let Some(profile) = network_for(device) else { return };+ {+ let mut joining = JOINING.lock().unwrap_or_else(|e| e.into_inner());+ if joining.contains(&device) {+ return;+ }+ joining.push(device);+ }+ let name = core_host::host().hub.read(|s| s.name_of(&device)).unwrap_or_else(|| "your phone".into());+ std::thread::Builder::new()+ .name("hotspot-join".into())+ .spawn(move || {+ let outcome = join(&Windows, &profile, APPEAR_WITHIN, JOIN_WITHIN);+ JOINING.lock().unwrap_or_else(|e| e.into_inner()).retain(|d| *d != device);+ match outcome {+ JoinOutcome::Already => {}+ JoinOutcome::Joined => show_message(tr!("Hotspot", "Connected to %1's hotspot.", name)),+ JoinOutcome::NotFound => show_message(tr!(+ "Hotspot",+ "%1's hotspot didn't show up. Check that it's on, then pick %2 in Windows' Wi-Fi list.",+ name,+ profile+ )),+ JoinOutcome::Failed(e) => {+ tracing::warn!(error = e, "couldn't join the phone's hotspot");+ show_message(tr!(+ "Hotspot",+ "Couldn't join %1's hotspot. Pick %2 in Windows' Wi-Fi list.",+ name,+ profile+ ));+ }+ }+ })+ .ok();+}++#[cfg(test)]+mod tests {+ use super::*;+ use std::cell::{Cell, RefCell};++ /// Wi-Fi that shows the hotspot after `appears` looks and joins it on connect.+ struct Fake {+ appears_after: u32,+ looks: Cell<u32>,+ connected: Cell<bool>,+ connect_works: bool,+ log: RefCell<Vec<&'static str>>,+ }++ impl Fake {+ fn new(appears_after: u32, connect_works: bool) -> Fake {+ Fake {+ appears_after,+ looks: Cell::new(0),+ connected: Cell::new(false),+ connect_works,+ log: RefCell::new(Vec::new()),+ }+ }+ }++ impl Wifi for Fake {+ fn scan(&self) {+ self.looks.set(self.looks.get() + 1);+ }+ fn reach(&self, _profile: &str) -> Reach {+ if self.connected.get() {+ Reach::Connected+ } else if self.looks.get() >= self.appears_after {+ Reach::InRange+ } else {+ Reach::NotInRange+ }+ }+ fn connect(&self, _profile: &str) -> Result<(), String> {+ self.log.borrow_mut().push("connect");+ if self.connect_works {+ self.connected.set(true);+ Ok(())+ } else {+ Err("refused".into())+ }+ }+ fn wait(&self, _d: Duration) {}+ }++ const APPEAR: Duration = Duration::from_secs(10);+ const JOIN: Duration = Duration::from_secs(6);++ #[test]+ fn joins_once_the_hotspot_shows_up() {+ let wifi = Fake::new(3, true);+ assert_eq!(join(&wifi, "Pixel", APPEAR, JOIN), JoinOutcome::Joined);+ assert_eq!(*wifi.log.borrow(), ["connect"], "connects exactly once");+ assert_eq!(wifi.looks.get(), 3);+ }++ #[test]+ fn already_on_it_does_nothing() {+ let wifi = Fake::new(0, true);+ wifi.connected.set(true);+ assert_eq!(join(&wifi, "Pixel", APPEAR, JOIN), JoinOutcome::Already);+ assert!(wifi.log.borrow().is_empty());+ }++ #[test]+ fn gives_up_when_it_never_shows_up_without_connecting() {+ let wifi = Fake::new(u32::MAX, true);+ assert_eq!(join(&wifi, "Pixel", APPEAR, JOIN), JoinOutcome::NotFound);+ assert!(wifi.log.borrow().is_empty(), "never connects to a network that isn't there");+ assert_eq!(wifi.looks.get(), 5, "looked for 10 s, every 2 s");+ }++ #[test]+ fn says_so_when_windows_refuses() {+ assert!(matches!(join(&Fake::new(1, false), "Pixel", APPEAR, JOIN), JoinOutcome::Failed(_)));+ }++ #[test]+ fn networks_round_trip_by_phone() {+ let dir = tempfile::tempdir().unwrap();+ let path = dir.path().join("hotspot.json");+ let mut networks = HashMap::new();+ networks.insert(DeviceId([3; 32]), "Pixel 9 hotspot".to_owned());+ save(&path, &networks).unwrap();+ assert_eq!(load(&path), networks);+ assert!(load(&dir.path().join("missing.json")).is_empty());+ }+}diff --git a/desktop/app/src/main.rs b/desktop/app/src/main.rsindex 6935a56..b9cfd29 100644--- a/desktop/app/src/main.rs+++ b/desktop/app/src/main.rs@@ -19,6 +19,7 @@ mod core_host;mod deck;mod doctor;mod folder_sync;+mod hotspot;mod i18n;mod icons;mod input_share;diff --git a/desktop/app/src/win/mod.rs b/desktop/app/src/win/mod.rsindex de54002..f708759 100644--- a/desktop/app/src/win/mod.rs+++ b/desktop/app/src/win/mod.rs@@ -34,6 +34,7 @@ pub mod tray;pub mod vcam;pub mod wallpaper;pub mod widget;+pub mod wifi;pub mod window_capture;pub mod wol;diff --git a/desktop/app/src/win/wifi.rs b/desktop/app/src/win/wifi.rsnew file mode 100644index 0000000..ea688b4--- /dev/null+++ b/desktop/app/src/win/wifi.rs@@ -0,0 +1,226 @@+// SPDX-License-Identifier: GPL-3.0-or-later+//! Wi-Fi through the Native Wifi API (`wlanapi.dll`): the networks Windows has+//! saved, whether one is in range, and joining one with its saved profile.+//! NectarLink never sees or stores a Wi-Fi password: joining uses the profile+//! Windows keeps from when the user joined that network themselves.++use windows::{+ Win32::{+ Foundation::{ERROR_SUCCESS, HANDLE},+ NetworkManagement::WiFi::{+ WLAN_API_VERSION_2_0, WLAN_AVAILABLE_NETWORK, WLAN_AVAILABLE_NETWORK_CONNECTED,+ WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES, WLAN_AVAILABLE_NETWORK_LIST,+ WLAN_CONNECTION_PARAMETERS, WLAN_INTERFACE_INFO, WLAN_INTERFACE_INFO_LIST, WLAN_PROFILE_INFO,+ WLAN_PROFILE_INFO_LIST, WlanCloseHandle, WlanConnect, WlanEnumInterfaces, WlanFreeMemory,+ WlanGetAvailableNetworkList, WlanGetProfileList, WlanOpenHandle, WlanScan,+ dot11_BSS_type_infrastructure, wlan_connection_mode_profile,+ },+ },+ core::{GUID, PCWSTR},+};++/// A network in range, as Windows lists it for a Wi-Fi adapter.+#[derive(Debug, Clone, PartialEq, Eq)]+pub struct InRange {+ /// The saved profile it matches ("" when Windows has none for it).+ pub profile: String,+ pub connectable: bool,+ pub connected: bool,+}++/// An open WLAN client handle, closed when dropped.+struct Client(HANDLE);++impl Client {+ fn open() -> Option<Client> {+ let mut negotiated = 0u32;+ let mut handle = HANDLE::default();+ // SAFETY: out pointers to locals; the handle is closed in Drop.+ let rc = unsafe { WlanOpenHandle(WLAN_API_VERSION_2_0, None, &mut negotiated, &mut handle) };+ (rc == ERROR_SUCCESS.0).then_some(Client(handle))+ }++ /// The Wi-Fi adapters' GUIDs.+ fn interfaces(&self) -> Vec<GUID> {+ let mut list: *mut WLAN_INTERFACE_INFO_LIST = std::ptr::null_mut();+ // SAFETY: a valid client handle and an out pointer; the list is freed below.+ if unsafe { WlanEnumInterfaces(self.0, None, &mut list) } != ERROR_SUCCESS.0 || list.is_null() {+ return Vec::new();+ }+ // SAFETY: `list` points to a WLAN_INTERFACE_INFO_LIST with `dwNumberOfItems`+ // entries laid out from `InterfaceInfo`, valid until WlanFreeMemory.+ let guids = unsafe {+ let count = (*list).dwNumberOfItems as usize;+ let first = std::ptr::addr_of!((*list).InterfaceInfo).cast::<WLAN_INTERFACE_INFO>();+ (0..count).map(|i| (*first.add(i)).InterfaceGuid).collect()+ };+ // SAFETY: memory WlanEnumInterfaces allocated.+ unsafe { WlanFreeMemory(list.cast()) };+ guids+ }+}++impl Drop for Client {+ fn drop(&mut self) {+ // SAFETY: the handle WlanOpenHandle returned, closed once.+ unsafe { WlanCloseHandle(self.0, None) };+ }+}++fn wide_to_string(wide: &[u16]) -> String {+ let len = wide.iter().position(|&c| c == 0).unwrap_or(wide.len());+ String::from_utf16_lossy(&wide[..len])+}++/// The Wi-Fi networks Windows has saved, by profile name, sorted, without repeats.+pub fn saved_networks() -> Vec<String> {+ let Some(client) = Client::open() else { return Vec::new() };+ let mut names = Vec::new();+ for guid in client.interfaces() {+ let mut list: *mut WLAN_PROFILE_INFO_LIST = std::ptr::null_mut();+ // SAFETY: a valid handle and adapter GUID; the list is freed below.+ if unsafe { WlanGetProfileList(client.0, &guid, None, &mut list) } != ERROR_SUCCESS.0+ || list.is_null()+ {+ continue;+ }+ // SAFETY: as in Client::interfaces, for WLAN_PROFILE_INFO_LIST.+ unsafe {+ let count = (*list).dwNumberOfItems as usize;+ let first = std::ptr::addr_of!((*list).ProfileInfo).cast::<WLAN_PROFILE_INFO>();+ names.extend((0..count).map(|i| wide_to_string(&(*first.add(i)).strProfileName)));+ WlanFreeMemory(list.cast());+ }+ }+ tidy(names)+}++/// Sorted case-insensitively, empty names and repeats left out.+fn tidy(mut names: Vec<String>) -> Vec<String> {+ names.retain(|n| !n.trim().is_empty());+ names.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase()).then_with(|| a.cmp(b)));+ names.dedup();+ names+}++/// Asks every Wi-Fi adapter to look for networks again (results come within a few seconds).+pub fn scan() {+ let Some(client) = Client::open() else { return };+ for guid in client.interfaces() {+ // SAFETY: a valid handle and adapter GUID; no SSID or IE data.+ unsafe { WlanScan(client.0, &guid, None, None, None) };+ }+}++/// The networks in range on the first adapter that lists any.+fn in_range(client: &Client) -> Option<(GUID, Vec<InRange>)> {+ for guid in client.interfaces() {+ let mut list: *mut WLAN_AVAILABLE_NETWORK_LIST = std::ptr::null_mut();+ let flags = WLAN_AVAILABLE_NETWORK_INCLUDE_ALL_MANUAL_HIDDEN_PROFILES;+ // SAFETY: a valid handle and adapter GUID; the list is freed below.+ let rc = unsafe { WlanGetAvailableNetworkList(client.0, &guid, flags, None, &mut list) };+ if rc != ERROR_SUCCESS.0 || list.is_null() {+ continue;+ }+ // SAFETY: as in Client::interfaces, for WLAN_AVAILABLE_NETWORK_LIST.+ let networks: Vec<InRange> = unsafe {+ let count = (*list).dwNumberOfItems as usize;+ let first = std::ptr::addr_of!((*list).Network).cast::<WLAN_AVAILABLE_NETWORK>();+ let items = (0..count)+ .map(|i| {+ let n = &*first.add(i);+ InRange {+ profile: wide_to_string(&n.strProfileName),+ connectable: n.bNetworkConnectable.as_bool(),+ connected: n.dwFlags & WLAN_AVAILABLE_NETWORK_CONNECTED != 0,+ }+ })+ .collect();+ WlanFreeMemory(list.cast());+ items+ };+ return Some((guid, networks));+ }+ None+}++/// Where a saved network stands right now.+#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub enum Reach {+ NotInRange,+ InRange,+ Connected,+}++pub fn reach(profile: &str) -> Reach {+ let Some(client) = Client::open() else { return Reach::NotInRange };+ let Some((_, networks)) = in_range(&client) else { return Reach::NotInRange };+ reach_in(&networks, profile)+}++fn reach_in(networks: &[InRange], profile: &str) -> Reach {+ let mine = networks.iter().filter(|n| n.profile == profile);+ if mine.clone().any(|n| n.connected) {+ Reach::Connected+ } else if mine.clone().any(|n| n.connectable) {+ Reach::InRange+ } else {+ Reach::NotInRange+ }+}++/// Joins the saved network `profile` (Windows uses its stored settings and password).+/// Returns once Windows has started connecting; check [`reach`] for the result.+pub fn connect(profile: &str) -> Result<(), String> {+ let client = Client::open().ok_or("Wi-Fi isn't available")?;+ let (guid, _) = in_range(&client).ok_or("no Wi-Fi adapter")?;+ let wide: Vec<u16> = profile.encode_utf16().chain(std::iter::once(0)).collect();+ let params = WLAN_CONNECTION_PARAMETERS {+ wlanConnectionMode: wlan_connection_mode_profile,+ strProfile: PCWSTR(wide.as_ptr()),+ pDot11Ssid: std::ptr::null_mut(),+ pDesiredBssidList: std::ptr::null_mut(),+ dot11BssType: dot11_BSS_type_infrastructure,+ dwFlags: 0,+ };+ // SAFETY: valid handle and GUID; `params` and the profile name outlive the call.+ let rc = unsafe { WlanConnect(client.0, &guid, ¶ms, None) };+ if rc == ERROR_SUCCESS.0 { Ok(()) } else { Err(format!("WlanConnect failed ({rc})")) }+}++#[cfg(test)]+mod tests {+ use super::*;++ fn net(profile: &str, connectable: bool, connected: bool) -> InRange {+ InRange { profile: profile.into(), connectable, connected }+ }++ #[test]+ fn saved_network_names_are_tidied() {+ let names =+ vec!["home".into(), "Pixel 9".into(), "".into(), "Home".into(), "home".into(), " ".into()];+ assert_eq!(tidy(names), ["Home", "home", "Pixel 9"]);+ }++ #[test]+ fn a_saved_network_is_connected_in_range_or_not() {+ // Windows lists a network once per profile and once without: only the profile counts.+ let list = [net("Home", true, true), net("", true, false), net("Pixel 9", true, false)];+ assert_eq!(reach_in(&list, "Home"), Reach::Connected);+ assert_eq!(reach_in(&list, "Pixel 9"), Reach::InRange);+ assert_eq!(reach_in(&list, "Office"), Reach::NotInRange);+ assert_eq!(+ reach_in(&[net("Pixel 9", false, false)], "Pixel 9"),+ Reach::NotInRange,+ "seen, can't connect"+ );+ }++ /// Reads the real saved networks: nothing changes on this PC.+ #[test]+ fn lists_saved_networks_without_failing() {+ let names = saved_networks();+ assert!(names.iter().all(|n| !n.trim().is_empty()));+ }+}