Skip to content

Commit 911aaf7

Browse files
committed
Add Remote Desktop GUI tab with host and viewer sub-modes
Two sub-tabs share the new Remote Desktop window: - Host: token field with a 'Generate' button that emits 24 random URL-safe bytes, a security warning about the bind address, and start / stop controls plus a refreshing status line that shows port and current viewer count. - Viewer: address / port / token form, Connect / Disconnect, and a custom _FrameDisplay widget that paints incoming JPEG frames scaled with KeepAspectRatio. Mouse / wheel / key events on the display are remapped from widget coordinates back to the remote screen's pixel space using the latest frame's dimensions, then forwarded as INPUT messages. Frame and error callbacks marshal cross-thread via Signals so the receiver thread never touches Qt widgets directly. Translations added for English, Traditional Chinese, Simplified Chinese, and Japanese.
1 parent b7c8320 commit 911aaf7

6 files changed

Lines changed: 631 additions & 0 deletions

File tree

je_auto_control/gui/language_wrapper/english.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"tab_ocr_reader": "OCR Reader",
3131
"tab_variables": "Variables",
3232
"tab_llm_planner": "LLM Planner",
33+
"tab_remote_desktop": "Remote Desktop",
3334

3435
# Auto Click Tab
3536
"interval_time": "Interval (ms):",
@@ -378,6 +379,36 @@
378379
"llm_running": "Running...",
379380
"llm_run_done": "Done",
380381

382+
# Remote Desktop Tab
383+
"rd_host_tab": "Host (this machine)",
384+
"rd_viewer_tab": "Viewer (control another)",
385+
"rd_host_security_warning": (
386+
"WARNING: anyone with the host:port and token gets full mouse / "
387+
"keyboard control of this machine. Default bind is 127.0.0.1; "
388+
"expose to a network only via SSH tunnel or trusted VPN."
389+
),
390+
"rd_host_config_group": "Host configuration",
391+
"rd_viewer_config_group": "Connect to a remote host",
392+
"rd_token_label": "Token:",
393+
"rd_token_placeholder": "shared secret (HMAC key)",
394+
"rd_token_generate": "Generate",
395+
"rd_bind_label": "Address:",
396+
"rd_port_label": "Port:",
397+
"rd_fps_label": "FPS:",
398+
"rd_quality_label": "JPEG quality:",
399+
"rd_host_start": "Start host",
400+
"rd_host_stop": "Stop host",
401+
"rd_host_status_running": "Running on port {port} — {n} viewer(s)",
402+
"rd_host_status_stopped": "Host is stopped",
403+
"rd_viewer_connect": "Connect",
404+
"rd_viewer_disconnect": "Disconnect",
405+
"rd_viewer_required_fields": (
406+
"Address, port, and token are all required."
407+
),
408+
"rd_viewer_status_connected": "Connected — receiving frames",
409+
"rd_viewer_status_idle": "Not connected",
410+
"rd_viewer_error": "Remote desktop error",
411+
381412
# Menu bar
382413
"menu_file": "File",
383414
"menu_file_open_script": "Open Script...",

je_auto_control/gui/language_wrapper/japanese.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"tab_ocr_reader": "OCR リーダー",
3131
"tab_variables": "実行時変数",
3232
"tab_llm_planner": "LLM プランナー",
33+
"tab_remote_desktop": "リモートデスクトップ",
3334

3435
# Auto Click Tab
3536
"interval_time": "間隔 (ms):",
@@ -378,6 +379,34 @@
378379
"llm_running": "実行中...",
379380
"llm_run_done": "完了",
380381

382+
# Remote Desktop Tab
383+
"rd_host_tab": "ホスト(このマシン)",
384+
"rd_viewer_tab": "ビューア(他マシンを操作)",
385+
"rd_host_security_warning": (
386+
"警告:host:port と token を知る相手は、このマシンのマウス/キーボードを"
387+
"完全に操作できます。既定は 127.0.0.1。外部公開は SSH トンネルか"
388+
"信頼できる VPN 経由で行ってください。"
389+
),
390+
"rd_host_config_group": "ホスト設定",
391+
"rd_viewer_config_group": "リモートホストへ接続",
392+
"rd_token_label": "トークン:",
393+
"rd_token_placeholder": "共有シークレット(HMAC キー)",
394+
"rd_token_generate": "生成",
395+
"rd_bind_label": "アドレス:",
396+
"rd_port_label": "ポート:",
397+
"rd_fps_label": "FPS:",
398+
"rd_quality_label": "JPEG 品質:",
399+
"rd_host_start": "ホスト開始",
400+
"rd_host_stop": "ホスト停止",
401+
"rd_host_status_running": "稼働中 ポート {port} — ビューア {n} 名",
402+
"rd_host_status_stopped": "ホストは停止中",
403+
"rd_viewer_connect": "接続",
404+
"rd_viewer_disconnect": "切断",
405+
"rd_viewer_required_fields": "アドレス・ポート・トークンはすべて必須です。",
406+
"rd_viewer_status_connected": "接続中 — フレーム受信中",
407+
"rd_viewer_status_idle": "未接続",
408+
"rd_viewer_error": "リモートデスクトップエラー",
409+
381410
# Menu bar
382411
"menu_file": "ファイル",
383412
"menu_file_open_script": "スクリプトを開く...",

je_auto_control/gui/language_wrapper/simplified_chinese.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"tab_ocr_reader": "OCR 读取",
2626
"tab_variables": "运行期变量",
2727
"tab_llm_planner": "LLM 脚本规划",
28+
"tab_remote_desktop": "远程桌面",
2829

2930
# Auto Click Tab
3031
"interval_time": "间隔时间 (ms):",
@@ -373,6 +374,33 @@
373374
"llm_running": "执行中...",
374375
"llm_run_done": "完成",
375376

377+
# Remote Desktop Tab
378+
"rd_host_tab": "被远程(本机)",
379+
"rd_viewer_tab": "远程他人(控制他机)",
380+
"rd_host_security_warning": (
381+
"警告:取得本机 host:port 与 token 的人,可以完全控制本机的鼠标/键盘。"
382+
"默认仅绑 127.0.0.1;要对外请透过 SSH tunnel 或可信的 VPN。"
383+
),
384+
"rd_host_config_group": "Host 设置",
385+
"rd_viewer_config_group": "连接到远程 Host",
386+
"rd_token_label": "Token:",
387+
"rd_token_placeholder": "共享密钥(HMAC key)",
388+
"rd_token_generate": "生成",
389+
"rd_bind_label": "地址:",
390+
"rd_port_label": "端口:",
391+
"rd_fps_label": "FPS:",
392+
"rd_quality_label": "JPEG 质量:",
393+
"rd_host_start": "启动 Host",
394+
"rd_host_stop": "停止 Host",
395+
"rd_host_status_running": "运行中 端口 {port} — {n} 个 viewer",
396+
"rd_host_status_stopped": "Host 已停止",
397+
"rd_viewer_connect": "连接",
398+
"rd_viewer_disconnect": "断开",
399+
"rd_viewer_required_fields": "地址、端口、token 都必须填写。",
400+
"rd_viewer_status_connected": "已连接 — 正在接收画面",
401+
"rd_viewer_status_idle": "未连接",
402+
"rd_viewer_error": "远程桌面错误",
403+
376404
# Menu bar
377405
"menu_file": "文件",
378406
"menu_file_open_script": "打开脚本...",

je_auto_control/gui/language_wrapper/traditional_chinese.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"tab_ocr_reader": "OCR 讀取",
2727
"tab_variables": "執行期變數",
2828
"tab_llm_planner": "LLM 腳本規劃",
29+
"tab_remote_desktop": "遠端桌面",
2930

3031
# Auto Click Tab
3132
"interval_time": "間隔時間 (ms):",
@@ -374,6 +375,33 @@
374375
"llm_running": "執行中...",
375376
"llm_run_done": "完成",
376377

378+
# Remote Desktop Tab
379+
"rd_host_tab": "被遠端(本機)",
380+
"rd_viewer_tab": "遠端他人(控制他機)",
381+
"rd_host_security_warning": (
382+
"警告:取得本機 host:port 與 token 的人,可以完全控制本機的滑鼠/鍵盤。"
383+
"預設只綁 127.0.0.1;要對外請透過 SSH tunnel 或可信的 VPN。"
384+
),
385+
"rd_host_config_group": "Host 設定",
386+
"rd_viewer_config_group": "連線到遠端 Host",
387+
"rd_token_label": "Token:",
388+
"rd_token_placeholder": "共用密鑰(HMAC key)",
389+
"rd_token_generate": "產生",
390+
"rd_bind_label": "位址:",
391+
"rd_port_label": "Port:",
392+
"rd_fps_label": "FPS:",
393+
"rd_quality_label": "JPEG 品質:",
394+
"rd_host_start": "啟動 Host",
395+
"rd_host_stop": "停止 Host",
396+
"rd_host_status_running": "運行中 port {port} — {n} 個 viewer",
397+
"rd_host_status_stopped": "Host 已停止",
398+
"rd_viewer_connect": "連線",
399+
"rd_viewer_disconnect": "中斷連線",
400+
"rd_viewer_required_fields": "位址、port、token 都必須填寫。",
401+
"rd_viewer_status_connected": "已連線 — 正在接收畫面",
402+
"rd_viewer_status_idle": "尚未連線",
403+
"rd_viewer_error": "遠端桌面錯誤",
404+
377405
# Menu bar
378406
"menu_file": "檔案",
379407
"menu_file_open_script": "開啟腳本...",

je_auto_control/gui/main_widget.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from je_auto_control.gui.ocr_tab import OCRReaderTab
2121
from je_auto_control.gui.plugins_tab import PluginsTab
2222
from je_auto_control.gui.recording_editor_tab import RecordingEditorTab
23+
from je_auto_control.gui.remote_desktop_tab import RemoteDesktopTab
2324
from je_auto_control.gui.run_history_tab import RunHistoryTab
2425
from je_auto_control.gui.scheduler_tab import SchedulerTab
2526
from je_auto_control.gui.script_builder import ScriptBuilderTab
@@ -96,6 +97,7 @@ def __init__(self, parent=None):
9697
self._add_tab("ocr_reader", "tab_ocr_reader", OCRReaderTab())
9798
self._add_tab("variables", "tab_variables", VariablesTab())
9899
self._add_tab("llm_planner", "tab_llm_planner", LLMPlannerTab())
100+
self._add_tab("remote_desktop", "tab_remote_desktop", RemoteDesktopTab())
99101
self._add_tab("plugins", "tab_plugins", PluginsTab())
100102
layout.addWidget(self.tabs)
101103

0 commit comments

Comments
 (0)