v1.8.12: fix Ctrl+Z undo — manual implementation for tk.Entry
tk.Entry has no built-in undo (unlike tk.Text), so _entry.config(undo=True) crashed. Replaced with custom entry_undo.py that tracks history manually and binds Ctrl+Z/Ctrl+Y (+ Russian layout support). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ from tkinter import messagebox, filedialog
|
||||
import customtkinter as ctk
|
||||
|
||||
from core.i18n import t
|
||||
from gui.widgets.entry_undo import enable_undo
|
||||
from core.ssh_client import SFTPSession
|
||||
from gui.widgets.file_list import FileListWidget
|
||||
|
||||
@@ -131,8 +132,7 @@ class FilesTab(ctk.CTkFrame):
|
||||
self._local_path_entry = ctk.CTkEntry(left_header, height=28)
|
||||
self._local_path_entry.pack(side="left", fill="x", expand=True, padx=(4, 0))
|
||||
self._local_path_entry.bind("<Return>", lambda e: self._local_go_to_path())
|
||||
# Enable undo functionality
|
||||
self._local_path_entry._entry.config(undo=True)
|
||||
enable_undo(self._local_path_entry)
|
||||
|
||||
self._local_list = FileListWidget(
|
||||
left_pane,
|
||||
@@ -179,8 +179,7 @@ class FilesTab(ctk.CTkFrame):
|
||||
self._remote_path_entry = ctk.CTkEntry(right_header, height=28)
|
||||
self._remote_path_entry.pack(side="left", fill="x", expand=True, padx=(4, 0))
|
||||
self._remote_path_entry.bind("<Return>", lambda e: self._remote_go_to_path())
|
||||
# Enable undo functionality
|
||||
self._remote_path_entry._entry.config(undo=True)
|
||||
enable_undo(self._remote_path_entry)
|
||||
|
||||
self._remote_list = FileListWidget(
|
||||
right_pane,
|
||||
|
||||
@@ -6,6 +6,7 @@ Live countdown, one-click copy, per-server secrets.
|
||||
import threading
|
||||
import customtkinter as ctk
|
||||
from core.i18n import t
|
||||
from gui.widgets.entry_undo import enable_undo
|
||||
|
||||
|
||||
class TOTPTab(ctk.CTkFrame):
|
||||
@@ -106,8 +107,7 @@ class TOTPTab(ctk.CTkFrame):
|
||||
font=ctk.CTkFont(family="Consolas", size=12)
|
||||
)
|
||||
self.secret_entry.pack(side="left", fill="x", expand=True, padx=(0, 5))
|
||||
# Enable undo functionality
|
||||
self.secret_entry._entry.config(undo=True)
|
||||
enable_undo(self.secret_entry)
|
||||
|
||||
self.show_secret_btn = ctk.CTkButton(
|
||||
entry_row, text=t("show"), width=70,
|
||||
|
||||
Reference in New Issue
Block a user