mirror of
https://github.com/andrey271192/ssh-manage.git
synced 2026-09-21 12:02:01 +00:00
fix: SSL skip verify on Windows, fix Mac Cmd+V paste
SSL: always unverified on win32/frozen (missing root certs). Paste: bind Command+Control+Meta modifiers for all Tk versions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -493,7 +493,6 @@ def agent_search(query):
|
|||||||
|
|
||||||
def setup_entry_clipboard(entry):
|
def setup_entry_clipboard(entry):
|
||||||
"""Add clipboard support (Ctrl/Cmd+C/V/X/A) and right-click menu to tk.Entry."""
|
"""Add clipboard support (Ctrl/Cmd+C/V/X/A) and right-click menu to tk.Entry."""
|
||||||
mod = "Command" if sys.platform == "darwin" else "Control"
|
|
||||||
|
|
||||||
def _paste(e=None):
|
def _paste(e=None):
|
||||||
try:
|
try:
|
||||||
@@ -532,14 +531,17 @@ def setup_entry_clipboard(entry):
|
|||||||
menu.add_command(label="Выделить всё", command=_select_all)
|
menu.add_command(label="Выделить всё", command=_select_all)
|
||||||
menu.tk_popup(event.x_root, event.y_root)
|
menu.tk_popup(event.x_root, event.y_root)
|
||||||
|
|
||||||
entry.bind(f"<{mod}-v>", _paste)
|
# Bind all possible modifier combos for macOS and Windows
|
||||||
entry.bind(f"<{mod}-V>", _paste)
|
for mod in ("Command", "Control", "Meta"):
|
||||||
entry.bind(f"<{mod}-c>", _copy)
|
for key, func in [("v", _paste), ("V", _paste),
|
||||||
entry.bind(f"<{mod}-C>", _copy)
|
("c", _copy), ("C", _copy),
|
||||||
entry.bind(f"<{mod}-x>", _cut)
|
("x", _cut), ("X", _cut),
|
||||||
entry.bind(f"<{mod}-X>", _cut)
|
("a", _select_all), ("A", _select_all)]:
|
||||||
entry.bind(f"<{mod}-a>", _select_all)
|
try:
|
||||||
entry.bind(f"<{mod}-A>", _select_all)
|
entry.bind(f"<{mod}-{key}>", func)
|
||||||
|
except tk.TclError:
|
||||||
|
pass
|
||||||
|
|
||||||
entry.bind("<Button-3>", _context_menu)
|
entry.bind("<Button-3>", _context_menu)
|
||||||
if sys.platform == "darwin":
|
if sys.platform == "darwin":
|
||||||
entry.bind("<Button-2>", _context_menu)
|
entry.bind("<Button-2>", _context_menu)
|
||||||
@@ -1019,19 +1021,13 @@ class AISettingsDialog(tk.Toplevel):
|
|||||||
# ── AI API Caller ─────────────────────────────────────────────
|
# ── AI API Caller ─────────────────────────────────────────────
|
||||||
|
|
||||||
def _ssl_context():
|
def _ssl_context():
|
||||||
"""Create SSL context that works on Windows without certifi."""
|
"""Create SSL context — skip verify on Windows/frozen (often missing certs)."""
|
||||||
try:
|
if sys.platform == "win32" or getattr(sys, "frozen", False):
|
||||||
ctx = ssl.create_default_context()
|
ctx = ssl.create_default_context()
|
||||||
# Test if default certs work
|
ctx.check_hostname = False
|
||||||
ctx.check_hostname = True
|
ctx.verify_mode = ssl.CERT_NONE
|
||||||
return ctx
|
return ctx
|
||||||
except Exception:
|
return None # use default on macOS/Linux
|
||||||
pass
|
|
||||||
# Fallback: unverified context (Windows without certs)
|
|
||||||
ctx = ssl.create_default_context()
|
|
||||||
ctx.check_hostname = False
|
|
||||||
ctx.verify_mode = ssl.CERT_NONE
|
|
||||||
return ctx
|
|
||||||
|
|
||||||
|
|
||||||
def call_claude_api(api_key, query):
|
def call_claude_api(api_key, query):
|
||||||
|
|||||||
Reference in New Issue
Block a user