codis 1.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codis-1.1.1.dist-info/METADATA +194 -0
- codis-1.1.1.dist-info/RECORD +329 -0
- codis-1.1.1.dist-info/WHEEL +5 -0
- codis-1.1.1.dist-info/entry_points.txt +5 -0
- codis-1.1.1.dist-info/licenses/LICENSE +21 -0
- codis-1.1.1.dist-info/top_level.txt +2 -0
- run.py +190 -0
- src/__init__.py +1 -0
- src/__main__.py +81 -0
- src/_app_build.py +1507 -0
- src/_app_editor.py +1274 -0
- src/_app_kui.py +825 -0
- src/_app_lsp.py +625 -0
- src/_app_recovery.py +189 -0
- src/_app_settings.py +1385 -0
- src/_app_tools.py +2471 -0
- src/_app_webpreview.py +126 -0
- src/_font_safety.py +127 -0
- src/_shells.py +172 -0
- src/app.py +1488 -0
- src/chat/__init__.py +1 -0
- src/chat/adapters/__init__.py +33 -0
- src/chat/adapters/base.py +209 -0
- src/chat/adapters/discord.py +190 -0
- src/chat/adapters/http.py +78 -0
- src/chat/adapters/irc.py +360 -0
- src/chat/adapters/matrix.py +219 -0
- src/chat/adapters/mattermost.py +178 -0
- src/chat/adapters/mqtt.py +165 -0
- src/chat/adapters/slack.py +204 -0
- src/chat/adapters/telegram.py +117 -0
- src/chat/adapters/ws.py +154 -0
- src/chat/adapters/xmpp.py +337 -0
- src/chat/history.py +76 -0
- src/chat/models.py +207 -0
- src/chat/probe.py +79 -0
- src/chat/session.py +446 -0
- src/chat/util.py +125 -0
- src/collab/__init__.py +1 -0
- src/collab/net.py +411 -0
- src/collab/ot.py +311 -0
- src/collab/session.py +141 -0
- src/collab/tk_adapter.py +134 -0
- src/config.py +335 -0
- src/constants.py +2552 -0
- src/dep_catalog.py +446 -0
- src/diff/__init__.py +1 -0
- src/diff/engine.py +247 -0
- src/dpi.py +30 -0
- src/editor/__init__.py +1 -0
- src/editor/_pane_lsp.py +2937 -0
- src/editor/_pane_utils.py +171 -0
- src/editor/autocomplete.py +607 -0
- src/editor/code_folding.py +836 -0
- src/editor/color_preview.py +382 -0
- src/editor/complexity_lens.py +281 -0
- src/editor/diff_pane.py +623 -0
- src/editor/file_watcher.py +144 -0
- src/editor/focus_block.py +236 -0
- src/editor/heatmap.py +141 -0
- src/editor/inlay_hints.py +366 -0
- src/editor/inline_blame.py +429 -0
- src/editor/kdocs.py +3376 -0
- src/editor/large_file.py +488 -0
- src/editor/ligatures.py +180 -0
- src/editor/line_numbers.py +598 -0
- src/editor/minimap.py +691 -0
- src/editor/multi_cursor.py +269 -0
- src/editor/pane.py +2082 -0
- src/editor/rhythm.py +206 -0
- src/editor/save_hooks.py +43 -0
- src/editor/smart_selection.py +425 -0
- src/editor/smart_tips.py +719 -0
- src/editor/snippets.py +411 -0
- src/editor/sticky_note_gutter.py +410 -0
- src/editor/sticky_scroll.py +385 -0
- src/editor/suggest.py +464 -0
- src/editor/text_transforms.py +310 -0
- src/editor/vim_mode.py +1074 -0
- src/events/__init__.py +84 -0
- src/events/bus.py +427 -0
- src/events/correlator.py +244 -0
- src/events/kinds.py +125 -0
- src/events/pipeline.py +264 -0
- src/events/stream.py +416 -0
- src/events/window.py +204 -0
- src/extcompat/__init__.py +19 -0
- src/extcompat/code/__init__.py +13 -0
- src/extcompat/code/consent.py +162 -0
- src/extcompat/code/host.py +353 -0
- src/extcompat/code/hosts/py_host.py +763 -0
- src/extcompat/code/locate.py +105 -0
- src/extcompat/code/manager.py +325 -0
- src/extcompat/code/permissions.py +154 -0
- src/extcompat/code/sandbox.py +60 -0
- src/extcompat/colors.py +131 -0
- src/extcompat/common.py +184 -0
- src/extcompat/cson.py +269 -0
- src/extcompat/formats/__init__.py +22 -0
- src/extcompat/formats/_tm.py +189 -0
- src/extcompat/formats/_util.py +31 -0
- src/extcompat/formats/base16.py +66 -0
- src/extcompat/formats/brackets.py +172 -0
- src/extcompat/formats/eclipse.py +193 -0
- src/extcompat/formats/emacs.py +361 -0
- src/extcompat/formats/geany.py +147 -0
- src/extcompat/formats/generic.py +184 -0
- src/extcompat/formats/gtksource.py +117 -0
- src/extcompat/formats/helix.py +91 -0
- src/extcompat/formats/jetbrains.py +343 -0
- src/extcompat/formats/kate.py +130 -0
- src/extcompat/formats/micro.py +131 -0
- src/extcompat/formats/nano.py +111 -0
- src/extcompat/formats/notepadpp.py +140 -0
- src/extcompat/formats/pulsar.py +165 -0
- src/extcompat/formats/pyides.py +163 -0
- src/extcompat/formats/sublime.py +340 -0
- src/extcompat/jsonc.py +65 -0
- src/extcompat/lessish.py +128 -0
- src/extcompat/manager.py +122 -0
- src/extcompat/market/__init__.py +63 -0
- src/extcompat/market/sources.py +211 -0
- src/extcompat/model.py +88 -0
- src/extcompat/net.py +228 -0
- src/extcompat/openvsx.py +63 -0
- src/extcompat/readers.py +362 -0
- src/extcompat/registry.py +73 -0
- src/extcompat/safexml.py +63 -0
- src/extcompat/sexp.py +187 -0
- src/extcompat/sources.py +105 -0
- src/extcompat/store.py +276 -0
- src/extcompat/textmate.py +214 -0
- src/extcompat/themes.py +487 -0
- src/extcompat/yamlite.py +294 -0
- src/fileio.py +94 -0
- src/fs_ops.py +106 -0
- src/i18n.py +233 -0
- src/ia/__init__.py +1 -0
- src/ia/actions.py +295 -0
- src/ia/approval_gate.py +672 -0
- src/ia/checkpoints.py +308 -0
- src/ia/context_builder.py +921 -0
- src/ia/dialdiff.py +408 -0
- src/ia/iaspace.py +2078 -0
- src/ia/pair.py +296 -0
- src/ia/providers.py +954 -0
- src/ia/session.py +335 -0
- src/ia/toolbox.py +2524 -0
- src/launcher_actions.py +204 -0
- src/lint/__init__.py +1 -0
- src/lint/manager.py +1058 -0
- src/locales/.translate_manifest.json +64170 -0
- src/locales/de.json +4936 -0
- src/locales/en.json +4936 -0
- src/locales/es.json +4936 -0
- src/locales/fr.json +4936 -0
- src/locales/it.json +4936 -0
- src/locales/ja.json +4936 -0
- src/locales/ko.json +4936 -0
- src/locales/nl.json +4936 -0
- src/locales/pl.json +4936 -0
- src/locales/pt-BR.json +4936 -0
- src/locales/ru.json +4936 -0
- src/locales/tr.json +4936 -0
- src/locales/uk.json +4936 -0
- src/locales/zh-CN.json +4936 -0
- src/lsp/__init__.py +26 -0
- src/lsp/client.py +2300 -0
- src/lsp/dap_client.py +480 -0
- src/lsp/edits.py +84 -0
- src/lsp/framing.py +73 -0
- src/lsp/protocol.py +931 -0
- src/main.py +260 -0
- src/memtrim.py +91 -0
- src/plugins/__init__.py +1 -0
- src/plugins/api.py +1761 -0
- src/plugins/loader.py +571 -0
- src/plugins/process_runner.py +519 -0
- src/plugins/registry.py +342 -0
- src/plugins/safety.py +367 -0
- src/plugins/startup.py +195 -0
- src/plugins/store.py +1178 -0
- src/proc_registry.py +278 -0
- src/pyexec.py +394 -0
- src/recovery.py +259 -0
- src/stall_trace.py +92 -0
- src/standalone.py +1070 -0
- src/startup_profile.py +35 -0
- src/syntax/__init__.py +1 -0
- src/syntax/highlighter.py +776 -0
- src/syntax/patterns.py +584 -0
- src/system_profile.py +430 -0
- src/terminal/backends.py +658 -0
- src/terminal/internal.py +346 -0
- src/terminal/keys.py +138 -0
- src/terminal/palette.py +67 -0
- src/terminal/session.py +283 -0
- src/terminal/shells.py +79 -0
- src/terminal/view.py +489 -0
- src/terminal/vt.py +870 -0
- src/textfmt.py +22 -0
- src/theme/__init__.py +1 -0
- src/theme/base.py +1281 -0
- src/theme/colors.py +49 -0
- src/theme/manager.py +602 -0
- src/theme/utils.py +312 -0
- src/toolbox.py +329 -0
- src/trash_core.py +531 -0
- src/ui/__init__.py +1 -0
- src/ui/_perf_utils.py +285 -0
- src/ui/_persistence_utils.py +93 -0
- src/ui/accessibility.py +843 -0
- src/ui/activity_bar.py +860 -0
- src/ui/app_embed.py +434 -0
- src/ui/archive_panel.py +608 -0
- src/ui/bookmarks.py +314 -0
- src/ui/breadcrumb.py +383 -0
- src/ui/calculator_panel.py +982 -0
- src/ui/calendar_panel.py +1218 -0
- src/ui/chat_panel.py +1271 -0
- src/ui/chat_profile_dialog.py +278 -0
- src/ui/chat_render.py +128 -0
- src/ui/clock_panel.py +810 -0
- src/ui/code_outline.py +364 -0
- src/ui/code_runner.py +729 -0
- src/ui/code_stats.py +546 -0
- src/ui/collab_panel.py +1009 -0
- src/ui/color_picker.py +547 -0
- src/ui/command_palette.py +452 -0
- src/ui/cursor_manager.py +750 -0
- src/ui/custom_keywords_panel.py +413 -0
- src/ui/debug_panel.py +1037 -0
- src/ui/dependency_graph.py +692 -0
- src/ui/diff_panel.py +381 -0
- src/ui/docs_panel.py +514 -0
- src/ui/doom_embed.py +349 -0
- src/ui/dropdown.py +321 -0
- src/ui/easter_eggs.py +979 -0
- src/ui/env_manager.py +666 -0
- src/ui/extcode_bridge.py +215 -0
- src/ui/extcode_dialogs.py +412 -0
- src/ui/extcompat_dialog.py +583 -0
- src/ui/file_timeline.py +319 -0
- src/ui/file_tree.py +1208 -0
- src/ui/find_in_files.py +1355 -0
- src/ui/flowchart_panel.py +727 -0
- src/ui/formatter_panel.py +490 -0
- src/ui/git_auth.py +763 -0
- src/ui/git_clone_dialog.py +487 -0
- src/ui/git_panel.py +1483 -0
- src/ui/grab_safe.py +84 -0
- src/ui/internal_python_dialog.py +98 -0
- src/ui/k_ui/__init__.py +1305 -0
- src/ui/k_ui/_bgrenderer.py +317 -0
- src/ui/k_ui/_colors.py +213 -0
- src/ui/k_ui/_dock.py +545 -0
- src/ui/k_ui/_easter.py +290 -0
- src/ui/k_ui/_engine.py +5448 -0
- src/ui/k_ui/_perf.py +333 -0
- src/ui/k_ui/_tkutil.py +7 -0
- src/ui/k_ui/_tooltip.py +365 -0
- src/ui/k_ui/_widgets.py +1204 -0
- src/ui/k_ui/_world.py +837 -0
- src/ui/key_remapper.py +856 -0
- src/ui/launcher.py +1252 -0
- src/ui/lazy_panel.py +73 -0
- src/ui/macro_recorder.py +610 -0
- src/ui/menu_bar.py +898 -0
- src/ui/output_panel.py +321 -0
- src/ui/paint_canvas.py +1000 -0
- src/ui/paint_engine.py +535 -0
- src/ui/paint_panel.py +888 -0
- src/ui/panel_detach.py +112 -0
- src/ui/performance_panel.py +861 -0
- src/ui/pip_manager.py +1758 -0
- src/ui/plugin_panel.py +1586 -0
- src/ui/pomodoro_panel.py +447 -0
- src/ui/problems.py +566 -0
- src/ui/process_manager.py +1657 -0
- src/ui/project_templates.py +775 -0
- src/ui/recovery_dialog.py +122 -0
- src/ui/regex_playground.py +304 -0
- src/ui/remote_adapters.py +1398 -0
- src/ui/remote_browser.py +1224 -0
- src/ui/remote_profile_dialog.py +342 -0
- src/ui/render_panel.py +1293 -0
- src/ui/rest_client.py +549 -0
- src/ui/scratchpad.py +548 -0
- src/ui/search_bar.py +1274 -0
- src/ui/settings_editor.py +3349 -0
- src/ui/settings_window.py +1554 -0
- src/ui/snippets_panel.py +597 -0
- src/ui/sql_studio.py +1815 -0
- src/ui/status_bar.py +438 -0
- src/ui/tab_bar.py +654 -0
- src/ui/task_manager.py +1773 -0
- src/ui/terminal.py +525 -0
- src/ui/theme_preview_panel.py +851 -0
- src/ui/thread_safe_tk.py +152 -0
- src/ui/time_tracker.py +574 -0
- src/ui/tkbind.py +43 -0
- src/ui/todo_panel.py +358 -0
- src/ui/toolbox_panels.py +658 -0
- src/ui/trash_manager.py +657 -0
- src/ui/ui_scale.py +294 -0
- src/ui/ux_enhancements.py +41 -0
- src/ui/web_preview.py +397 -0
- src/ui/webdev.py +630 -0
- src/ui/welcome.py +567 -0
- src/ui/window_embed.py +1500 -0
- src/ui/wizard.py +1550 -0
- src/ui/workspace_switcher.py +418 -0
- src/ui/workspace_trust.py +370 -0
- src/ui/zen_audio.py +354 -0
- src/ui/zen_media.py +2271 -0
- src/ui/zen_media_client.py +303 -0
- src/ui/zen_media_host.py +329 -0
- src/ui/zen_player.py +907 -0
- src/ui/zen_player_widgets.py +700 -0
- src/updater/__init__.py +11 -0
- src/updater/assets.py +145 -0
- src/updater/backup.py +101 -0
- src/updater/channel.py +221 -0
- src/updater/dialog.py +492 -0
- src/updater/integrity.py +111 -0
- src/updater/manager.py +727 -0
- src/updater/result.py +114 -0
- src/venv_runtime.py +531 -0
- src/workspace_state.py +25 -0
|
@@ -0,0 +1,1554 @@
|
|
|
1
|
+
"""Janela de configuraƧƵes do Codis.
|
|
2
|
+
|
|
3
|
+
Implementa ``SettingsWindow``, a janela principal de preferĆŖncias do
|
|
4
|
+
usuÔrio, organizada em categorias (editor, aparência, atalhos, IA, etc.)
|
|
5
|
+
com aplicação em tempo real das mudanças.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import contextlib
|
|
11
|
+
import logging
|
|
12
|
+
import tkinter as tk
|
|
13
|
+
from collections.abc import Callable
|
|
14
|
+
from tkinter import ttk
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
17
|
+
from src.config import ConfigManager
|
|
18
|
+
from src.constants import CONFIG_FILE, FONT_MONO, FONT_UI
|
|
19
|
+
from src.i18n import _t
|
|
20
|
+
from src.theme.base import Theme
|
|
21
|
+
from src.theme.manager import ThemeManager
|
|
22
|
+
from src.ui._perf_utils import debounce_canvas
|
|
23
|
+
from src.ui.dropdown import DropDown
|
|
24
|
+
from src.ui.settings_editor import SettingsEditor
|
|
25
|
+
|
|
26
|
+
logger = logging.getLogger("Codis")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class SettingsWindow(tk.Toplevel):
|
|
30
|
+
"""Janela flutuante de configuraƧƵes do Codis.
|
|
31
|
+
|
|
32
|
+
Layout: sidebar de categorias à esquerda + painel de conteúdo scrollÔvel
|
|
33
|
+
Ć direita. Suporta busca em tempo real e salva imediatamente ao alterar.
|
|
34
|
+
|
|
35
|
+
Args:
|
|
36
|
+
parent: Janela pai Tkinter.
|
|
37
|
+
tmgr: Instância de ThemeManager.
|
|
38
|
+
cfg: Instância de ConfigManager.
|
|
39
|
+
on_change: Callback(key, value) acionado a cada alteração.
|
|
40
|
+
on_show_settings_panel: Callback para abrir o modo avanƧado inline.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
_CATEGORIES_DEF: list = [
|
|
44
|
+
("editor", "ā", "setting.cat_editor"),
|
|
45
|
+
("advanced_editor", "-", "setting.cat_advanced_editor"),
|
|
46
|
+
("autocomplete", "š¬", "setting.cat_autocomplete"),
|
|
47
|
+
("appearance", "A", "setting.cat_appearance"),
|
|
48
|
+
("cursor", "š±", "setting.cat_cursor"),
|
|
49
|
+
("layout", "š„", "setting.cat_ui"),
|
|
50
|
+
("save", "š¾", "setting.cat_save"),
|
|
51
|
+
("lint", "š", "setting.cat_lint"),
|
|
52
|
+
("lsp", "š¤", "setting.cat_lsp"),
|
|
53
|
+
("git", "šæ", "setting.cat_git"),
|
|
54
|
+
("terminal", "š»", "setting.cat_terminal"),
|
|
55
|
+
("filetree", "š", "setting.cat_filetree"),
|
|
56
|
+
("render", "š", "setting.cat_render"),
|
|
57
|
+
("timeline", "š", "setting.cat_timeline"),
|
|
58
|
+
("flowchart", "š", "setting.cat_flowchart"),
|
|
59
|
+
("pomodoro", "ā±", "setting.cat_pomodoro"),
|
|
60
|
+
("perf", "P", "setting.cat_perf"),
|
|
61
|
+
("security", "š", "setting.cat_security"),
|
|
62
|
+
("advanced", "ā", "setting.cat_advanced"),
|
|
63
|
+
("accessibility", "āæ", "setting.cat_accessibility"),
|
|
64
|
+
("ssh", "š§", "setting.cat_ssh"),
|
|
65
|
+
("collab", "š„", "setting.cat_collab"),
|
|
66
|
+
("plugins_cfg", "š", "setting.cat_plugins_cfg"),
|
|
67
|
+
("custom_syntax", "šØ", "setting.cat_custom_syntax"),
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
_CAT_KEYS: dict[str, list[str]] = {
|
|
71
|
+
"editor": [
|
|
72
|
+
"font_family",
|
|
73
|
+
"font_size",
|
|
74
|
+
"font_ligatures",
|
|
75
|
+
"ligature_mode",
|
|
76
|
+
"tab_size",
|
|
77
|
+
"use_spaces",
|
|
78
|
+
"word_wrap",
|
|
79
|
+
"cursor_style",
|
|
80
|
+
"cursor_blinking",
|
|
81
|
+
"smooth_scroll",
|
|
82
|
+
"scroll_speed",
|
|
83
|
+
"multi_cursor",
|
|
84
|
+
"multicursor_lines",
|
|
85
|
+
"render_whitespace",
|
|
86
|
+
"indent_guides",
|
|
87
|
+
"bracket_matching",
|
|
88
|
+
"highlight_current_line",
|
|
89
|
+
"line_numbers",
|
|
90
|
+
"relative_numbers",
|
|
91
|
+
"breadcrumbs",
|
|
92
|
+
"minimap",
|
|
93
|
+
"encoding",
|
|
94
|
+
"eol",
|
|
95
|
+
],
|
|
96
|
+
"advanced_editor": [
|
|
97
|
+
"sticky_scroll",
|
|
98
|
+
"code_folding",
|
|
99
|
+
"inline_blame",
|
|
100
|
+
"inline_blame_mode",
|
|
101
|
+
"color_preview",
|
|
102
|
+
"inlay_hints",
|
|
103
|
+
"smart_tips",
|
|
104
|
+
"smart_tips_interval",
|
|
105
|
+
"smart_tips_large_file_lines",
|
|
106
|
+
"smart_tips_huge_file_lines",
|
|
107
|
+
"smart_tips_big_function_lines",
|
|
108
|
+
"smart_tips_long_line_chars",
|
|
109
|
+
"smart_tips_deep_nesting",
|
|
110
|
+
"smart_tips_todo_threshold",
|
|
111
|
+
"smart_tips_generic_var_threshold",
|
|
112
|
+
],
|
|
113
|
+
"autocomplete": [
|
|
114
|
+
"autocomplete",
|
|
115
|
+
"autocomplete_delay",
|
|
116
|
+
"snippets",
|
|
117
|
+
"parameter_hints",
|
|
118
|
+
"hover_docs",
|
|
119
|
+
],
|
|
120
|
+
"cursor": [],
|
|
121
|
+
"appearance": [
|
|
122
|
+
"theme",
|
|
123
|
+
"language",
|
|
124
|
+
"ui_font_family",
|
|
125
|
+
"ui_scale",
|
|
126
|
+
"ui_font_size",
|
|
127
|
+
"activity_bar",
|
|
128
|
+
"show_welcome",
|
|
129
|
+
],
|
|
130
|
+
"layout": [
|
|
131
|
+
"startup_screen",
|
|
132
|
+
"sidebar_width",
|
|
133
|
+
"panel_height",
|
|
134
|
+
"minimap_width",
|
|
135
|
+
"minimap_scale",
|
|
136
|
+
"window_width",
|
|
137
|
+
"window_height",
|
|
138
|
+
"max_recent",
|
|
139
|
+
],
|
|
140
|
+
"save": [
|
|
141
|
+
"autosave",
|
|
142
|
+
"autosave_delay",
|
|
143
|
+
"recovery_enabled",
|
|
144
|
+
"recovery_interval",
|
|
145
|
+
"format_on_save",
|
|
146
|
+
"trim_trailing_whitespace",
|
|
147
|
+
"insert_final_newline",
|
|
148
|
+
"session_restore",
|
|
149
|
+
"exit_save_mode",
|
|
150
|
+
"session_save_on_exit",
|
|
151
|
+
"confirm_delete",
|
|
152
|
+
"trash_backend",
|
|
153
|
+
"trash_retention_days",
|
|
154
|
+
"trash_max_mb",
|
|
155
|
+
],
|
|
156
|
+
"lint": [
|
|
157
|
+
"lint_enabled",
|
|
158
|
+
"lint_python",
|
|
159
|
+
"lint_js",
|
|
160
|
+
"lint_html",
|
|
161
|
+
"lint_delay",
|
|
162
|
+
"eslint_path",
|
|
163
|
+
"pylint_path",
|
|
164
|
+
"flake8_path",
|
|
165
|
+
"mypy_path",
|
|
166
|
+
"prettier_path",
|
|
167
|
+
],
|
|
168
|
+
"lsp": [
|
|
169
|
+
"lsp_enabled",
|
|
170
|
+
"lsp_hover_enabled",
|
|
171
|
+
"lsp_format_enabled",
|
|
172
|
+
"lsp_diagnostics",
|
|
173
|
+
],
|
|
174
|
+
"git": [
|
|
175
|
+
"git_enabled",
|
|
176
|
+
"git_decorations",
|
|
177
|
+
"git_auto_fetch",
|
|
178
|
+
"git_fetch_interval",
|
|
179
|
+
"updater_url",
|
|
180
|
+
],
|
|
181
|
+
"terminal": [
|
|
182
|
+
"default_shell",
|
|
183
|
+
"terminal_font_size",
|
|
184
|
+
"terminal_max_lines",
|
|
185
|
+
],
|
|
186
|
+
"filetree": [
|
|
187
|
+
"show_hidden_files",
|
|
188
|
+
"respect_ignore_files",
|
|
189
|
+
],
|
|
190
|
+
"render": [
|
|
191
|
+
"render_internal",
|
|
192
|
+
],
|
|
193
|
+
"timeline": [
|
|
194
|
+
"timeline_max_backups",
|
|
195
|
+
"timeline_max_age_days",
|
|
196
|
+
],
|
|
197
|
+
"flowchart": [
|
|
198
|
+
"flowchart_auto",
|
|
199
|
+
"flowchart_max_depth",
|
|
200
|
+
],
|
|
201
|
+
"pomodoro": [
|
|
202
|
+
"pomodoro_work_min",
|
|
203
|
+
"pomodoro_break_min",
|
|
204
|
+
"pomodoro_long_break_min",
|
|
205
|
+
],
|
|
206
|
+
"perf": [
|
|
207
|
+
"kui_perf",
|
|
208
|
+
"hl_idle_ms",
|
|
209
|
+
"perf_auto_mode",
|
|
210
|
+
"perf_freeze_threshold_ms",
|
|
211
|
+
"perf_mode",
|
|
212
|
+
"perf_native_bindings",
|
|
213
|
+
"perf_kui_fallback",
|
|
214
|
+
"perf_keep_minimap",
|
|
215
|
+
"perf_keep_sticky_scroll",
|
|
216
|
+
"perf_keep_heatmap",
|
|
217
|
+
"perf_keep_rhythm",
|
|
218
|
+
"perf_keep_lint",
|
|
219
|
+
"perf_keep_kui_anim",
|
|
220
|
+
"autocomplete_min_chars",
|
|
221
|
+
"autocomplete_max_items",
|
|
222
|
+
"large_file_mb",
|
|
223
|
+
"search_max_results",
|
|
224
|
+
],
|
|
225
|
+
"security": [
|
|
226
|
+
"workspace_trust",
|
|
227
|
+
],
|
|
228
|
+
"advanced": [
|
|
229
|
+
"font_min",
|
|
230
|
+
"font_max",
|
|
231
|
+
],
|
|
232
|
+
"accessibility": [
|
|
233
|
+
"a11y_high_contrast",
|
|
234
|
+
"a11y_colorblind_mode",
|
|
235
|
+
"a11y_screen_reader",
|
|
236
|
+
"a11y_keyboard_nav",
|
|
237
|
+
"a11y_large_ui_font",
|
|
238
|
+
"a11y_reduce_motion",
|
|
239
|
+
],
|
|
240
|
+
"ssh": [
|
|
241
|
+
"ssh_default_port",
|
|
242
|
+
"ssh_connect_timeout",
|
|
243
|
+
"ssh_keepalive_interval",
|
|
244
|
+
"ssh_agent_forwarding",
|
|
245
|
+
"ssh_strict_host_key",
|
|
246
|
+
"ssh_sftp_buffer_kb",
|
|
247
|
+
"ssh_open_in_editor",
|
|
248
|
+
"debug_dap_enabled",
|
|
249
|
+
"debug_dap_port",
|
|
250
|
+
],
|
|
251
|
+
"collab": [
|
|
252
|
+
"collab_enabled",
|
|
253
|
+
"collab_port",
|
|
254
|
+
"collab_max_peers",
|
|
255
|
+
"collab_show_cursors",
|
|
256
|
+
"collab_show_chat",
|
|
257
|
+
"collab_autosave_sync",
|
|
258
|
+
],
|
|
259
|
+
"plugins_cfg": [
|
|
260
|
+
"plugin_isolation",
|
|
261
|
+
"plugin_timeout_s",
|
|
262
|
+
"plugin_heartbeat_s",
|
|
263
|
+
"plugin_max_restarts",
|
|
264
|
+
"plugin_sandbox_network",
|
|
265
|
+
],
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
@property
|
|
269
|
+
def _categories(self):
|
|
270
|
+
"""Retorna categorias com nomes traduzidos.
|
|
271
|
+
|
|
272
|
+
Returns:
|
|
273
|
+
list: Lista de (id, icone, nome_traduzido).
|
|
274
|
+
"""
|
|
275
|
+
return [
|
|
276
|
+
(cid, icon, _t(key, cid.replace("_", " ").title()))
|
|
277
|
+
for cid, icon, key in self._CATEGORIES_DEF
|
|
278
|
+
]
|
|
279
|
+
|
|
280
|
+
def __init__(
|
|
281
|
+
self,
|
|
282
|
+
parent: tk.Tk,
|
|
283
|
+
tmgr: ThemeManager,
|
|
284
|
+
cfg: ConfigManager,
|
|
285
|
+
on_change: Callable | None = None,
|
|
286
|
+
on_show_settings_panel: Callable | None = None,
|
|
287
|
+
) -> None:
|
|
288
|
+
"""Cria a janela de configuraƧƵes do Codis.
|
|
289
|
+
|
|
290
|
+
Args:
|
|
291
|
+
parent: Janela pai Tkinter.
|
|
292
|
+
tmgr: Instância de ThemeManager.
|
|
293
|
+
cfg: Instância de ConfigManager.
|
|
294
|
+
on_change: Callback(key, value) acionado a cada alteração.
|
|
295
|
+
on_show_settings_panel: Callback para abrir o modo avanƧado inline.
|
|
296
|
+
"""
|
|
297
|
+
t = tmgr.theme
|
|
298
|
+
super().__init__(parent)
|
|
299
|
+
self.title(_t("hc.settings_window.settings", "ConfiguraƧƵes - Codis"))
|
|
300
|
+
self.geometry("980x680")
|
|
301
|
+
self.minsize(640, 480)
|
|
302
|
+
self.config(bg=t.floating_bg)
|
|
303
|
+
self.transient(parent)
|
|
304
|
+
self.focus_set()
|
|
305
|
+
self.resizable(True, True)
|
|
306
|
+
try:
|
|
307
|
+
self.wm_attributes("-zoomed", False)
|
|
308
|
+
except Exception:
|
|
309
|
+
logger.debug(
|
|
310
|
+
"wm_attributes('-zoomed') não suportado nesta plataforma.",
|
|
311
|
+
exc_info=True,
|
|
312
|
+
)
|
|
313
|
+
|
|
314
|
+
self._tmgr = tmgr
|
|
315
|
+
self._cfg = cfg
|
|
316
|
+
self._on_change = on_change
|
|
317
|
+
self._on_show_settings_panel = on_show_settings_panel
|
|
318
|
+
self._schema_map: dict[str, tuple] = {}
|
|
319
|
+
self._current_cat = "editor"
|
|
320
|
+
self._cat_frame_cache: dict[str, tk.Frame] = {}
|
|
321
|
+
self._search_after_id: Any = None
|
|
322
|
+
self._search_trace_name: str | None = None
|
|
323
|
+
self._destroyed: bool = False
|
|
324
|
+
|
|
325
|
+
for schema in SettingsEditor._get_schema():
|
|
326
|
+
key = schema[0]
|
|
327
|
+
if not key.startswith("__"):
|
|
328
|
+
self._schema_map[key] = schema
|
|
329
|
+
|
|
330
|
+
self._build()
|
|
331
|
+
self.bind("<Escape>", lambda _: self.destroy())
|
|
332
|
+
self.update_idletasks()
|
|
333
|
+
sw, sh = self.winfo_screenwidth(), self.winfo_screenheight()
|
|
334
|
+
w, h = 980, 680
|
|
335
|
+
self.geometry(f"{w}x{h}+{(sw - w) // 2}+{(sh - h) // 2}")
|
|
336
|
+
self.update_idletasks()
|
|
337
|
+
self._show_category("editor")
|
|
338
|
+
|
|
339
|
+
def destroy(self) -> None:
|
|
340
|
+
"""Override: cancela afters e remove traces antes de destruir."""
|
|
341
|
+
if self._destroyed:
|
|
342
|
+
return
|
|
343
|
+
self._destroyed = True
|
|
344
|
+
if self._search_after_id:
|
|
345
|
+
with contextlib.suppress(Exception):
|
|
346
|
+
self.after_cancel(self._search_after_id)
|
|
347
|
+
self._search_after_id = None
|
|
348
|
+
if self._search_trace_name is not None:
|
|
349
|
+
with contextlib.suppress(Exception):
|
|
350
|
+
self._search_var.trace_remove("write", self._search_trace_name)
|
|
351
|
+
self._search_trace_name = None
|
|
352
|
+
with contextlib.suppress(Exception):
|
|
353
|
+
super().destroy()
|
|
354
|
+
|
|
355
|
+
def _build(self) -> None:
|
|
356
|
+
"""Constrói todos os widgets da janela de configurações."""
|
|
357
|
+
t = self._tmgr.theme
|
|
358
|
+
|
|
359
|
+
titlebar = tk.Frame(self, bg=t.activity_bg, height=52)
|
|
360
|
+
titlebar.pack(fill="x")
|
|
361
|
+
titlebar.pack_propagate(False)
|
|
362
|
+
tk.Label(
|
|
363
|
+
titlebar,
|
|
364
|
+
text=_t("hc.settings_window.settings", "ConfiguraƧƵes"),
|
|
365
|
+
bg=t.activity_bg,
|
|
366
|
+
fg=t.fg,
|
|
367
|
+
font=(FONT_UI, 15, "bold"),
|
|
368
|
+
).pack(side="left", padx=16, pady=10)
|
|
369
|
+
|
|
370
|
+
search_frame = tk.Frame(titlebar, bg=t.activity_bg)
|
|
371
|
+
search_frame.pack(side="right", padx=16, pady=10)
|
|
372
|
+
tk.Label(
|
|
373
|
+
search_frame, text="š", bg=t.activity_bg, fg=t.fg_muted, font=(FONT_UI, 10)
|
|
374
|
+
).pack(side="left")
|
|
375
|
+
self._search_var = tk.StringVar()
|
|
376
|
+
self._search_after_id: Any = None
|
|
377
|
+
|
|
378
|
+
def _debounced_search(*_: Any) -> None:
|
|
379
|
+
"""Agenda busca com 300ms de debounce para evitar lag ao digitar."""
|
|
380
|
+
if self._destroyed:
|
|
381
|
+
return
|
|
382
|
+
if self._search_after_id:
|
|
383
|
+
with contextlib.suppress(Exception):
|
|
384
|
+
self.after_cancel(self._search_after_id)
|
|
385
|
+
with contextlib.suppress(tk.TclError):
|
|
386
|
+
self._search_after_id = self.after(300, self._on_search)
|
|
387
|
+
|
|
388
|
+
self._search_trace_name = self._search_var.trace_add(
|
|
389
|
+
"write", _debounced_search)
|
|
390
|
+
search_ent = tk.Entry(
|
|
391
|
+
search_frame,
|
|
392
|
+
textvariable=self._search_var,
|
|
393
|
+
bg=t.input_bg,
|
|
394
|
+
fg=t.fg,
|
|
395
|
+
insertbackground=t.cursor,
|
|
396
|
+
relief="flat",
|
|
397
|
+
bd=0,
|
|
398
|
+
font=(FONT_UI, 10),
|
|
399
|
+
highlightthickness=1,
|
|
400
|
+
highlightbackground=t.border,
|
|
401
|
+
width=28,
|
|
402
|
+
)
|
|
403
|
+
search_ent.pack(side="left", padx=6)
|
|
404
|
+
|
|
405
|
+
def _esc_search(_):
|
|
406
|
+
self._search_var.set("")
|
|
407
|
+
return "break"
|
|
408
|
+
|
|
409
|
+
search_ent.bind("<Escape>", _esc_search)
|
|
410
|
+
self.bind(
|
|
411
|
+
"<Control-f>",
|
|
412
|
+
lambda _: (search_ent.focus_set(),
|
|
413
|
+
search_ent.select_range(0, "end")),
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
tk.Frame(self, bg=t.border, height=1).pack(fill="x")
|
|
417
|
+
|
|
418
|
+
body = tk.Frame(self, bg=t.floating_bg)
|
|
419
|
+
body.pack(fill="both", expand=True)
|
|
420
|
+
|
|
421
|
+
sidebar_outer = tk.Frame(body, bg=t.activity_bg, width=220)
|
|
422
|
+
sidebar_outer.pack(side="left", fill="y")
|
|
423
|
+
sidebar_outer.pack_propagate(False)
|
|
424
|
+
tk.Frame(body, bg=t.border, width=1).pack(side="left", fill="y")
|
|
425
|
+
|
|
426
|
+
_sb_canvas = tk.Canvas(
|
|
427
|
+
sidebar_outer, bg=t.activity_bg, highlightthickness=0, width=218
|
|
428
|
+
)
|
|
429
|
+
_sb_vsb = ttk.Scrollbar(
|
|
430
|
+
sidebar_outer,
|
|
431
|
+
orient="vertical",
|
|
432
|
+
command=_sb_canvas.yview,
|
|
433
|
+
style="Thin.Vertical.TScrollbar",
|
|
434
|
+
)
|
|
435
|
+
_sb_vsb.pack(side="right", fill="y")
|
|
436
|
+
_sb_canvas.config(yscrollcommand=_sb_vsb.set)
|
|
437
|
+
_sb_canvas.pack(side="left", fill="both", expand=True)
|
|
438
|
+
|
|
439
|
+
_sb_inner = tk.Frame(_sb_canvas, bg=t.activity_bg)
|
|
440
|
+
_sb_win = _sb_canvas.create_window(
|
|
441
|
+
(0, 0), window=_sb_inner, anchor="nw")
|
|
442
|
+
|
|
443
|
+
debounce_canvas(_sb_canvas, _sb_win, ms=40, extra_widget=_sb_inner)
|
|
444
|
+
|
|
445
|
+
def _sb_wheel(e):
|
|
446
|
+
speed = self._cfg.get("scroll_speed", 3)
|
|
447
|
+
steps = (
|
|
448
|
+
-1 * (e.delta // 120) * speed
|
|
449
|
+
if e.delta
|
|
450
|
+
else (speed if e.num == 5 else -speed)
|
|
451
|
+
)
|
|
452
|
+
_sb_canvas.yview_scroll(int(steps), "units")
|
|
453
|
+
|
|
454
|
+
_sb_canvas.bind("<MouseWheel>", _sb_wheel)
|
|
455
|
+
_sb_canvas.bind("<Button-4>", _sb_wheel)
|
|
456
|
+
_sb_canvas.bind("<Button-5>", _sb_wheel)
|
|
457
|
+
_sb_inner.bind("<MouseWheel>", _sb_wheel)
|
|
458
|
+
_sb_inner.bind("<Button-4>", _sb_wheel)
|
|
459
|
+
_sb_inner.bind("<Button-5>", _sb_wheel)
|
|
460
|
+
|
|
461
|
+
def _bind_sb_children_scroll(w=_sb_inner):
|
|
462
|
+
"""Binda scroll em todos os filhos do sidebar para que o hover funcione."""
|
|
463
|
+
for child in w.winfo_children():
|
|
464
|
+
try:
|
|
465
|
+
child.bind("<MouseWheel>", _sb_wheel, add=True)
|
|
466
|
+
child.bind("<Button-4>", _sb_wheel, add=True)
|
|
467
|
+
child.bind("<Button-5>", _sb_wheel, add=True)
|
|
468
|
+
_bind_sb_children_scroll(child)
|
|
469
|
+
except Exception:
|
|
470
|
+
logger.debug(
|
|
471
|
+
"Falha ao vincular scroll a widget filho.", exc_info=True
|
|
472
|
+
)
|
|
473
|
+
|
|
474
|
+
self._bind_sb_children_scroll = _bind_sb_children_scroll
|
|
475
|
+
|
|
476
|
+
self._sidebar = _sb_inner
|
|
477
|
+
|
|
478
|
+
content_wrap = tk.Frame(body, bg=t.floating_bg)
|
|
479
|
+
content_wrap.pack(side="left", fill="both", expand=True)
|
|
480
|
+
|
|
481
|
+
canvas = tk.Canvas(content_wrap, bg=t.floating_bg,
|
|
482
|
+
highlightthickness=0)
|
|
483
|
+
vsb = ttk.Scrollbar(
|
|
484
|
+
content_wrap,
|
|
485
|
+
orient="vertical",
|
|
486
|
+
command=canvas.yview,
|
|
487
|
+
style="Thin.Vertical.TScrollbar",
|
|
488
|
+
)
|
|
489
|
+
vsb.pack(side="right", fill="y")
|
|
490
|
+
canvas.config(yscrollcommand=vsb.set)
|
|
491
|
+
canvas.pack(fill="both", expand=True)
|
|
492
|
+
|
|
493
|
+
self._content_outer = tk.Frame(canvas, bg=t.floating_bg)
|
|
494
|
+
self._canvas_window = canvas.create_window(
|
|
495
|
+
(0, 0), window=self._content_outer, anchor="nw"
|
|
496
|
+
)
|
|
497
|
+
|
|
498
|
+
debounce_canvas(
|
|
499
|
+
canvas, self._canvas_window, ms=40, extra_widget=self._content_outer
|
|
500
|
+
)
|
|
501
|
+
self._canvas = canvas
|
|
502
|
+
|
|
503
|
+
def _on_wheel(e: Any) -> None:
|
|
504
|
+
speed = self._cfg.get("scroll_speed", 3)
|
|
505
|
+
if e.delta:
|
|
506
|
+
steps = -1 * (e.delta // 120) * speed
|
|
507
|
+
else:
|
|
508
|
+
steps = speed if e.num == 5 else -speed
|
|
509
|
+
canvas.yview_scroll(int(steps), "units")
|
|
510
|
+
|
|
511
|
+
def _bind_scroll(widget: tk.Widget) -> None:
|
|
512
|
+
with contextlib.suppress(tk.TclError):
|
|
513
|
+
widget.bind("<MouseWheel>", _on_wheel, add=True)
|
|
514
|
+
widget.bind("<Button-4>", _on_wheel, add=True)
|
|
515
|
+
widget.bind("<Button-5>", _on_wheel, add=True)
|
|
516
|
+
for child in widget.winfo_children():
|
|
517
|
+
_bind_scroll(child)
|
|
518
|
+
|
|
519
|
+
canvas.bind("<MouseWheel>", _on_wheel)
|
|
520
|
+
canvas.bind("<Button-4>", _on_wheel)
|
|
521
|
+
canvas.bind("<Button-5>", _on_wheel)
|
|
522
|
+
self._content_outer.bind("<MouseWheel>", _on_wheel)
|
|
523
|
+
self._content_outer.bind(
|
|
524
|
+
"<Map>", lambda _: _bind_scroll(self._content_outer), add=True
|
|
525
|
+
)
|
|
526
|
+
self._bind_scroll_fn = _bind_scroll
|
|
527
|
+
|
|
528
|
+
self.bind("<Alt-Up>", lambda _: self._nav_category(-1))
|
|
529
|
+
self.bind("<Alt-Down>", lambda _: self._nav_category(+1))
|
|
530
|
+
|
|
531
|
+
tk.Frame(self, bg=t.border, height=1).pack(fill="x")
|
|
532
|
+
footer = tk.Frame(self, bg=t.activity_bg, height=44)
|
|
533
|
+
footer.pack(fill="x")
|
|
534
|
+
footer.pack_propagate(False)
|
|
535
|
+
|
|
536
|
+
edit_json_btn = tk.Label(
|
|
537
|
+
footer,
|
|
538
|
+
text=_t("hc.settings_window.edit_settings_json",
|
|
539
|
+
"Editar settings.json"),
|
|
540
|
+
bg=t.activity_bg,
|
|
541
|
+
fg=t.t_link,
|
|
542
|
+
font=(FONT_UI, 9),
|
|
543
|
+
cursor="hand2",
|
|
544
|
+
)
|
|
545
|
+
edit_json_btn.pack(side="left", padx=8, pady=8)
|
|
546
|
+
edit_json_btn.bind("<Button-1>", lambda _: self._open_json())
|
|
547
|
+
|
|
548
|
+
classic_btn = tk.Label(
|
|
549
|
+
footer,
|
|
550
|
+
text=_t("hc.settings_window.advanced_view", "Modo AvanƧado"),
|
|
551
|
+
bg=t.activity_bg,
|
|
552
|
+
fg=t.fg_muted,
|
|
553
|
+
font=(FONT_UI, 9),
|
|
554
|
+
cursor="hand2",
|
|
555
|
+
)
|
|
556
|
+
classic_btn.pack(side="left", padx=4, pady=8)
|
|
557
|
+
classic_btn.bind(
|
|
558
|
+
"<Button-1>",
|
|
559
|
+
lambda _: (
|
|
560
|
+
self.destroy(),
|
|
561
|
+
(
|
|
562
|
+
self._on_show_settings_panel()
|
|
563
|
+
if self._on_show_settings_panel
|
|
564
|
+
else None
|
|
565
|
+
),
|
|
566
|
+
),
|
|
567
|
+
)
|
|
568
|
+
|
|
569
|
+
reset_all_btn = tk.Label(
|
|
570
|
+
footer,
|
|
571
|
+
text=_t("hc.settings_window.reset_all", "Restaurar PadrƵes"),
|
|
572
|
+
bg=t.activity_bg,
|
|
573
|
+
fg=t.warn_fg if hasattr(t, "warn_fg") else t.fg_muted,
|
|
574
|
+
font=(FONT_UI, 9),
|
|
575
|
+
cursor="hand2",
|
|
576
|
+
)
|
|
577
|
+
reset_all_btn.pack(side="left", padx=4, pady=8)
|
|
578
|
+
reset_all_btn.bind("<Button-1>", lambda _: self._reset_all())
|
|
579
|
+
|
|
580
|
+
self._count_lbl = tk.Label(
|
|
581
|
+
footer,
|
|
582
|
+
text="",
|
|
583
|
+
bg=t.activity_bg,
|
|
584
|
+
fg=t.fg_muted,
|
|
585
|
+
font=(FONT_UI, 8),
|
|
586
|
+
)
|
|
587
|
+
self._count_lbl.pack(side="left", padx=12)
|
|
588
|
+
|
|
589
|
+
close_btn = tk.Label(
|
|
590
|
+
footer,
|
|
591
|
+
text=_t("hc.settings_window.close", "Fechar"),
|
|
592
|
+
bg=t.btn_primary,
|
|
593
|
+
fg="#000",
|
|
594
|
+
font=(FONT_UI, 9, "bold"),
|
|
595
|
+
cursor="hand2",
|
|
596
|
+
padx=10,
|
|
597
|
+
pady=4,
|
|
598
|
+
)
|
|
599
|
+
close_btn.pack(side="right", padx=12, pady=8)
|
|
600
|
+
close_btn.bind("<Button-1>", lambda _: self.destroy())
|
|
601
|
+
|
|
602
|
+
self._cat_btns: dict[str, tk.Frame] = {}
|
|
603
|
+
|
|
604
|
+
_CAT_GROUPS = [
|
|
605
|
+
("Editor", ["editor", "advanced_editor", "autocomplete"]),
|
|
606
|
+
("Interface", ["appearance", "cursor", "layout"]),
|
|
607
|
+
("Arquivos", ["save", "filetree", "timeline"]),
|
|
608
|
+
("AnƔlise", ["lint", "lsp"]),
|
|
609
|
+
("Ferramentas", ["git", "terminal",
|
|
610
|
+
"render", "flowchart", "pomodoro"]),
|
|
611
|
+
("Sistema", ["perf", "security", "advanced", "accessibility"]),
|
|
612
|
+
("Rede / Remoto", ["ssh", "collab", "plugins_cfg"]),
|
|
613
|
+
]
|
|
614
|
+
_cat_to_group = {}
|
|
615
|
+
for grp, ids in _CAT_GROUPS:
|
|
616
|
+
for cid in ids:
|
|
617
|
+
_cat_to_group[cid] = grp
|
|
618
|
+
|
|
619
|
+
current_group = None
|
|
620
|
+
for cat_id, icon, name in self._categories:
|
|
621
|
+
grp = _cat_to_group.get(cat_id, "")
|
|
622
|
+
if grp and grp != current_group:
|
|
623
|
+
current_group = grp
|
|
624
|
+
tk.Frame(self._sidebar, bg=t.border, height=1).pack(
|
|
625
|
+
fill="x", padx=8, pady=(6, 0)
|
|
626
|
+
)
|
|
627
|
+
tk.Label(
|
|
628
|
+
self._sidebar,
|
|
629
|
+
text=f" {grp.upper()}",
|
|
630
|
+
bg=t.activity_bg,
|
|
631
|
+
fg=t.fg_muted,
|
|
632
|
+
font=(FONT_UI, 7, "bold"),
|
|
633
|
+
anchor="w",
|
|
634
|
+
).pack(fill="x", padx=4, pady=(2, 0))
|
|
635
|
+
|
|
636
|
+
inner = tk.Frame(self._sidebar, bg=t.activity_bg, cursor="hand2")
|
|
637
|
+
inner.pack(fill="x", padx=4, pady=0)
|
|
638
|
+
|
|
639
|
+
indicator = tk.Frame(inner, bg=t.activity_bg, width=3)
|
|
640
|
+
indicator.pack(side="left", fill="y", pady=4)
|
|
641
|
+
|
|
642
|
+
icon_lbl = tk.Label(
|
|
643
|
+
inner,
|
|
644
|
+
text=f" {icon} ",
|
|
645
|
+
bg=t.activity_bg,
|
|
646
|
+
fg=t.fg_muted,
|
|
647
|
+
font=(FONT_UI, 9),
|
|
648
|
+
width=3,
|
|
649
|
+
anchor="center",
|
|
650
|
+
)
|
|
651
|
+
icon_lbl.pack(side="left", pady=4)
|
|
652
|
+
|
|
653
|
+
name_lbl = tk.Label(
|
|
654
|
+
inner,
|
|
655
|
+
text=name,
|
|
656
|
+
bg=t.activity_bg,
|
|
657
|
+
fg=t.fg,
|
|
658
|
+
font=(FONT_UI, 9),
|
|
659
|
+
anchor="w",
|
|
660
|
+
)
|
|
661
|
+
name_lbl.pack(side="left", fill="x", expand=True, padx=4, pady=4)
|
|
662
|
+
|
|
663
|
+
def _enter(_e, f=inner, ic=icon_lbl, nl=name_lbl, ind=indicator):
|
|
664
|
+
hover_bg = getattr(t, "btn_hover", t.sel_bg)
|
|
665
|
+
for w2 in (f, ic, nl, ind):
|
|
666
|
+
with contextlib.suppress(Exception):
|
|
667
|
+
w2.config(bg=hover_bg)
|
|
668
|
+
|
|
669
|
+
def _leave(
|
|
670
|
+
_e, cid=cat_id, f=inner, ic=icon_lbl, nl=name_lbl, ind=indicator
|
|
671
|
+
):
|
|
672
|
+
is_sel = self._current_cat == cid
|
|
673
|
+
bg2 = t.sel_bg if is_sel else t.activity_bg
|
|
674
|
+
acc = getattr(
|
|
675
|
+
t, "accent", t.sel_bg) if is_sel else t.activity_bg
|
|
676
|
+
try:
|
|
677
|
+
f.config(bg=bg2)
|
|
678
|
+
ic.config(bg=bg2)
|
|
679
|
+
nl.config(bg=bg2)
|
|
680
|
+
ind.config(bg=acc)
|
|
681
|
+
except Exception:
|
|
682
|
+
logger.debug(
|
|
683
|
+
"Falha ao aplicar cor de hover na categoria.", exc_info=True
|
|
684
|
+
)
|
|
685
|
+
|
|
686
|
+
for w in (inner, indicator, icon_lbl, name_lbl):
|
|
687
|
+
w.bind("<Button-1>", lambda _,
|
|
688
|
+
cid=cat_id: self._show_category(cid))
|
|
689
|
+
w.bind("<Enter>", _enter)
|
|
690
|
+
w.bind("<Leave>", _leave)
|
|
691
|
+
|
|
692
|
+
self._cat_btns[cat_id] = inner
|
|
693
|
+
|
|
694
|
+
if hasattr(self, "_bind_sb_children_scroll"):
|
|
695
|
+
|
|
696
|
+
def _safe_bind_scroll():
|
|
697
|
+
with contextlib.suppress(tk.TclError):
|
|
698
|
+
if self.winfo_exists():
|
|
699
|
+
self._bind_sb_children_scroll()
|
|
700
|
+
|
|
701
|
+
self.after(50, _safe_bind_scroll)
|
|
702
|
+
|
|
703
|
+
def _nav_category(self, direction: int) -> None:
|
|
704
|
+
"""Navega entre categorias com Alt+Up/Down."""
|
|
705
|
+
cats = [c[0] for c in self._CATEGORIES_DEF]
|
|
706
|
+
try:
|
|
707
|
+
idx = cats.index(self._current_cat)
|
|
708
|
+
except ValueError:
|
|
709
|
+
idx = 0
|
|
710
|
+
new_idx = max(0, min(len(cats) - 1, idx + direction))
|
|
711
|
+
self._show_category(cats[new_idx])
|
|
712
|
+
|
|
713
|
+
def _show_category(self, cat_id: str) -> None:
|
|
714
|
+
"""Exibe as configuraƧƵes de uma categoria - usa cache para evitar rebuild.
|
|
715
|
+
|
|
716
|
+
Args:
|
|
717
|
+
cat_id: Identificador da categoria a exibir.
|
|
718
|
+
"""
|
|
719
|
+
if self._destroyed or not self.winfo_exists():
|
|
720
|
+
return
|
|
721
|
+
t = self._tmgr.theme
|
|
722
|
+
self._current_cat = cat_id
|
|
723
|
+
|
|
724
|
+
accent = getattr(t, "accent", t.sel_bg)
|
|
725
|
+
for cid, btn in self._cat_btns.items():
|
|
726
|
+
is_sel = cid == cat_id
|
|
727
|
+
bg = t.sel_bg if is_sel else t.activity_bg
|
|
728
|
+
try:
|
|
729
|
+
if not btn.winfo_exists():
|
|
730
|
+
continue
|
|
731
|
+
btn.config(bg=bg)
|
|
732
|
+
children = btn.winfo_children()
|
|
733
|
+
for i, child in enumerate(children):
|
|
734
|
+
if i == 0:
|
|
735
|
+
child.config(bg=accent if is_sel else t.activity_bg)
|
|
736
|
+
else:
|
|
737
|
+
try:
|
|
738
|
+
child.config(bg=bg)
|
|
739
|
+
except tk.TclError:
|
|
740
|
+
continue
|
|
741
|
+
except tk.TclError:
|
|
742
|
+
continue
|
|
743
|
+
|
|
744
|
+
for cached_frame in self._cat_frame_cache.values():
|
|
745
|
+
with contextlib.suppress(tk.TclError):
|
|
746
|
+
cached_frame.pack_forget()
|
|
747
|
+
|
|
748
|
+
if cat_id in self._cat_frame_cache:
|
|
749
|
+
frame = self._cat_frame_cache[cat_id]
|
|
750
|
+
with contextlib.suppress(tk.TclError):
|
|
751
|
+
if not frame.winfo_exists():
|
|
752
|
+
del self._cat_frame_cache[cat_id]
|
|
753
|
+
else:
|
|
754
|
+
frame.pack(fill="both", expand=True)
|
|
755
|
+
self._update_canvas_scroll()
|
|
756
|
+
keys = self._CAT_KEYS.get(cat_id, [])
|
|
757
|
+
valid = sum(1 for k in keys if k in self._schema_map)
|
|
758
|
+
with contextlib.suppress(tk.TclError):
|
|
759
|
+
self._count_lbl.config(
|
|
760
|
+
text=f"{valid} configuração(ões)")
|
|
761
|
+
return
|
|
762
|
+
|
|
763
|
+
frame = tk.Frame(self._content_outer, bg=t.floating_bg)
|
|
764
|
+
self._cat_frame_cache[cat_id] = frame
|
|
765
|
+
frame.pack(fill="both", expand=True)
|
|
766
|
+
|
|
767
|
+
if cat_id == "custom_syntax":
|
|
768
|
+
from src.ui.custom_keywords_panel import CustomKeywordsPanel
|
|
769
|
+
|
|
770
|
+
CustomKeywordsPanel(
|
|
771
|
+
frame, self._cfg, self._tmgr, on_change=self._on_change
|
|
772
|
+
).pack(fill="both", expand=True)
|
|
773
|
+
return
|
|
774
|
+
|
|
775
|
+
if cat_id == "cursor":
|
|
776
|
+
from src.ui.cursor_manager import CursorPickerPanel
|
|
777
|
+
|
|
778
|
+
app = getattr(self, "_app_ref", None)
|
|
779
|
+
cursor_mgr = getattr(app, "_cursor_mgr", None) if app else None
|
|
780
|
+
if cursor_mgr is None:
|
|
781
|
+
tk.Label(
|
|
782
|
+
frame,
|
|
783
|
+
text=" š± Cursor Manager nĆ£o disponĆvel nesta janela.",
|
|
784
|
+
bg=t.floating_bg,
|
|
785
|
+
fg=t.fg_muted,
|
|
786
|
+
font=(FONT_UI, 10),
|
|
787
|
+
pady=20,
|
|
788
|
+
anchor="w",
|
|
789
|
+
).pack(fill="x", padx=20)
|
|
790
|
+
else:
|
|
791
|
+
CursorPickerPanel(frame, cursor_mgr, self._tmgr).pack(
|
|
792
|
+
fill="both", expand=True
|
|
793
|
+
)
|
|
794
|
+
return
|
|
795
|
+
|
|
796
|
+
if cat_id == "git":
|
|
797
|
+
self._build_git_panel(frame, t)
|
|
798
|
+
return
|
|
799
|
+
|
|
800
|
+
keys = self._CAT_KEYS.get(cat_id, [])
|
|
801
|
+
icon_name = next(
|
|
802
|
+
((ic, nm) for cid, ic, nm in self._categories if cid == cat_id),
|
|
803
|
+
("ā", cat_id),
|
|
804
|
+
)
|
|
805
|
+
|
|
806
|
+
hdr = tk.Frame(frame, bg=t.floating_bg)
|
|
807
|
+
hdr.pack(fill="x", padx=20, pady=(16, 4))
|
|
808
|
+
tk.Label(
|
|
809
|
+
hdr,
|
|
810
|
+
text=f"{icon_name[0]} {icon_name[1]}",
|
|
811
|
+
bg=t.floating_bg,
|
|
812
|
+
fg=t.fg,
|
|
813
|
+
font=(FONT_UI, 14, "bold"),
|
|
814
|
+
).pack(anchor="w")
|
|
815
|
+
|
|
816
|
+
valid_keys = [k for k in keys if k in self._schema_map]
|
|
817
|
+
tk.Label(
|
|
818
|
+
hdr,
|
|
819
|
+
text=_t("setting.cat_items",
|
|
820
|
+
"{n} configuraƧƵes", n=len(valid_keys)),
|
|
821
|
+
bg=t.floating_bg,
|
|
822
|
+
fg=t.fg_muted,
|
|
823
|
+
font=(FONT_UI, 8),
|
|
824
|
+
).pack(anchor="w")
|
|
825
|
+
tk.Frame(frame, bg=t.border, height=1).pack(
|
|
826
|
+
fill="x", padx=20, pady=(0, 8))
|
|
827
|
+
|
|
828
|
+
for key in keys:
|
|
829
|
+
schema = self._schema_map.get(key)
|
|
830
|
+
if schema is None:
|
|
831
|
+
continue
|
|
832
|
+
skey, label, desc, kind, default, opts = (
|
|
833
|
+
schema[0],
|
|
834
|
+
schema[1],
|
|
835
|
+
schema[2],
|
|
836
|
+
schema[3],
|
|
837
|
+
schema[4],
|
|
838
|
+
schema[5],
|
|
839
|
+
)
|
|
840
|
+
type_hint = schema[6] if len(schema) > 6 else None
|
|
841
|
+
example = schema[7] if len(schema) > 7 else None
|
|
842
|
+
lk, dk = f"setting.{skey}", f"setting.desc.{skey}"
|
|
843
|
+
label = _t(lk) if _t(lk) != lk else label
|
|
844
|
+
desc = _t(dk) if _t(dk) != dk else desc
|
|
845
|
+
self._build_setting_row(
|
|
846
|
+
skey,
|
|
847
|
+
label,
|
|
848
|
+
desc,
|
|
849
|
+
kind,
|
|
850
|
+
default,
|
|
851
|
+
opts,
|
|
852
|
+
type_hint,
|
|
853
|
+
example,
|
|
854
|
+
t,
|
|
855
|
+
parent=frame,
|
|
856
|
+
)
|
|
857
|
+
|
|
858
|
+
with contextlib.suppress(tk.TclError):
|
|
859
|
+
self._bind_scroll_fn(frame)
|
|
860
|
+
|
|
861
|
+
self._update_canvas_scroll()
|
|
862
|
+
with contextlib.suppress(tk.TclError):
|
|
863
|
+
self._count_lbl.config(text=f"{len(valid_keys)} configuração(ões)")
|
|
864
|
+
|
|
865
|
+
def _update_canvas_scroll(self) -> None:
|
|
866
|
+
"""Atualiza o scrollregion e volta ao topo."""
|
|
867
|
+
if self._destroyed:
|
|
868
|
+
return
|
|
869
|
+
with contextlib.suppress(tk.TclError):
|
|
870
|
+
self._content_outer.update_idletasks()
|
|
871
|
+
self._canvas.config(scrollregion=self._canvas.bbox("all"))
|
|
872
|
+
self._canvas.itemconfig(
|
|
873
|
+
self._canvas_window, width=self._canvas.winfo_width()
|
|
874
|
+
)
|
|
875
|
+
self._canvas.yview_moveto(0)
|
|
876
|
+
|
|
877
|
+
def _build_setting_row(
|
|
878
|
+
self,
|
|
879
|
+
key: str,
|
|
880
|
+
label: str,
|
|
881
|
+
desc: str,
|
|
882
|
+
kind: str,
|
|
883
|
+
default: Any,
|
|
884
|
+
opts: Any,
|
|
885
|
+
type_hint: str | None,
|
|
886
|
+
example: str | None,
|
|
887
|
+
t: Theme,
|
|
888
|
+
parent: tk.Widget | None = None,
|
|
889
|
+
) -> None:
|
|
890
|
+
"""Constrói uma linha de configuração individual no painel de conteúdo.
|
|
891
|
+
|
|
892
|
+
Args:
|
|
893
|
+
key: Chave de configuração.
|
|
894
|
+
label: Rótulo traduzido.
|
|
895
|
+
desc: Descrição traduzida.
|
|
896
|
+
kind: Tipo de controle ('toggle', 'slider', 'combo', 'entry').
|
|
897
|
+
default: Valor padrão.
|
|
898
|
+
opts: OpƧƵes do controle (lista ou tupla).
|
|
899
|
+
type_hint: Texto descritivo do tipo de valor.
|
|
900
|
+
example: Exemplo de valor.
|
|
901
|
+
t: Tema visual ativo.
|
|
902
|
+
parent: Frame pai (usa ``self._content_outer`` se None).
|
|
903
|
+
"""
|
|
904
|
+
container = parent if parent is not None else self._content_outer
|
|
905
|
+
row = tk.Frame(container, bg=t.floating_bg)
|
|
906
|
+
row.pack(fill="x", padx=20, pady=6)
|
|
907
|
+
|
|
908
|
+
right = tk.Frame(row, bg=t.floating_bg, width=240)
|
|
909
|
+
right.pack(side="right", fill="y")
|
|
910
|
+
right.pack_propagate(False)
|
|
911
|
+
left = tk.Frame(row, bg=t.floating_bg)
|
|
912
|
+
left.pack(side="left", fill="x", expand=True)
|
|
913
|
+
|
|
914
|
+
tk.Label(
|
|
915
|
+
left,
|
|
916
|
+
text=label,
|
|
917
|
+
bg=t.floating_bg,
|
|
918
|
+
fg=t.fg,
|
|
919
|
+
font=(FONT_UI, 10, "bold"),
|
|
920
|
+
anchor="w",
|
|
921
|
+
).pack(anchor="w")
|
|
922
|
+
if desc:
|
|
923
|
+
tk.Label(
|
|
924
|
+
left,
|
|
925
|
+
text=desc,
|
|
926
|
+
bg=t.floating_bg,
|
|
927
|
+
fg=t.fg_muted,
|
|
928
|
+
font=(FONT_UI, 8),
|
|
929
|
+
anchor="w",
|
|
930
|
+
wraplength=400,
|
|
931
|
+
).pack(anchor="w")
|
|
932
|
+
|
|
933
|
+
meta: list[str] = []
|
|
934
|
+
if type_hint:
|
|
935
|
+
meta.append(f"Type: {type_hint}")
|
|
936
|
+
if example is not None:
|
|
937
|
+
meta.append(f"Ex: {example}")
|
|
938
|
+
if default is not None:
|
|
939
|
+
meta.append(f"Default: {default}")
|
|
940
|
+
if meta:
|
|
941
|
+
tk.Label(
|
|
942
|
+
left,
|
|
943
|
+
text=" " + " | ".join(meta),
|
|
944
|
+
bg=t.floating_bg,
|
|
945
|
+
fg=t.t_comment,
|
|
946
|
+
font=(FONT_UI, 7),
|
|
947
|
+
anchor="w",
|
|
948
|
+
).pack(anchor="w")
|
|
949
|
+
|
|
950
|
+
cur_val = self._cfg.get(key, default)
|
|
951
|
+
|
|
952
|
+
if kind == "toggle":
|
|
953
|
+
var = tk.BooleanVar(value=bool(cur_val))
|
|
954
|
+
sw_f = tk.Frame(right, bg=t.floating_bg)
|
|
955
|
+
sw_f.pack(anchor="e", pady=4)
|
|
956
|
+
state_lbl = tk.Label(
|
|
957
|
+
sw_f,
|
|
958
|
+
text=_t("ui.on", "ON") if var.get() else _t("ui.off", "OFF"),
|
|
959
|
+
bg=t.floating_bg,
|
|
960
|
+
fg=t.accent if var.get() else t.fg_muted,
|
|
961
|
+
font=(FONT_UI, 8, "bold"),
|
|
962
|
+
)
|
|
963
|
+
state_lbl.pack(side="left", padx=4)
|
|
964
|
+
toggle_bg = t.accent if var.get() else t.border
|
|
965
|
+
toggle = tk.Label(
|
|
966
|
+
sw_f,
|
|
967
|
+
text="ā " if var.get() else "ā ",
|
|
968
|
+
bg=toggle_bg,
|
|
969
|
+
fg="#fff" if var.get() else t.fg_muted,
|
|
970
|
+
font=(FONT_UI, 10),
|
|
971
|
+
cursor="hand2",
|
|
972
|
+
relief="flat",
|
|
973
|
+
padx=4,
|
|
974
|
+
width=3,
|
|
975
|
+
)
|
|
976
|
+
toggle.pack(side="left")
|
|
977
|
+
|
|
978
|
+
def _toggle(k=key, v=var, s=state_lbl, tb=toggle):
|
|
979
|
+
"""Alterna o valor do toggle e atualiza o visual."""
|
|
980
|
+
v.set(not v.get())
|
|
981
|
+
val = v.get()
|
|
982
|
+
s.config(
|
|
983
|
+
text=_t("ui.on", "ON") if val else _t("ui.off", "OFF"),
|
|
984
|
+
fg=t.accent if val else t.fg_muted,
|
|
985
|
+
)
|
|
986
|
+
tb.config(
|
|
987
|
+
text="ā " if val else "ā ",
|
|
988
|
+
bg=t.accent if val else t.border,
|
|
989
|
+
fg="#fff" if val else t.fg_muted,
|
|
990
|
+
)
|
|
991
|
+
self._save(k, val)
|
|
992
|
+
|
|
993
|
+
toggle.bind("<Button-1>", lambda _: _toggle())
|
|
994
|
+
state_lbl.bind("<Button-1>", lambda _: _toggle())
|
|
995
|
+
|
|
996
|
+
elif kind == "slider":
|
|
997
|
+
lo, hi = opts
|
|
998
|
+
var = tk.IntVar(value=int(cur_val))
|
|
999
|
+
sf = tk.Frame(right, bg=t.floating_bg)
|
|
1000
|
+
sf.pack(anchor="e", pady=4)
|
|
1001
|
+
val_lbl = tk.Label(
|
|
1002
|
+
sf,
|
|
1003
|
+
text=str(int(cur_val)),
|
|
1004
|
+
bg=t.floating_bg,
|
|
1005
|
+
fg=t.fg,
|
|
1006
|
+
font=(FONT_MONO, 9),
|
|
1007
|
+
width=6,
|
|
1008
|
+
)
|
|
1009
|
+
val_lbl.pack(side="right")
|
|
1010
|
+
ttk.Scale(
|
|
1011
|
+
sf,
|
|
1012
|
+
from_=lo,
|
|
1013
|
+
to=hi,
|
|
1014
|
+
orient="horizontal",
|
|
1015
|
+
variable=var,
|
|
1016
|
+
length=160,
|
|
1017
|
+
command=lambda v, k=key, lbl=val_lbl: (
|
|
1018
|
+
lbl.config(text=str(int(float(v)))),
|
|
1019
|
+
self._save(k, int(float(v))),
|
|
1020
|
+
),
|
|
1021
|
+
).pack(side="left")
|
|
1022
|
+
|
|
1023
|
+
elif kind == "combo":
|
|
1024
|
+
var = tk.StringVar(value=str(cur_val))
|
|
1025
|
+
cb = DropDown(
|
|
1026
|
+
right,
|
|
1027
|
+
textvariable=var,
|
|
1028
|
+
values=opts,
|
|
1029
|
+
width=24,
|
|
1030
|
+
font=(FONT_UI, 9),
|
|
1031
|
+
state="readonly",
|
|
1032
|
+
)
|
|
1033
|
+
cb.pack(anchor="e", pady=4)
|
|
1034
|
+
cb.bind(
|
|
1035
|
+
"<<ComboboxSelected>>", lambda _, k=key, v=var: self._save(
|
|
1036
|
+
k, v.get())
|
|
1037
|
+
)
|
|
1038
|
+
|
|
1039
|
+
elif kind == "entry":
|
|
1040
|
+
var = tk.StringVar(value=str(cur_val))
|
|
1041
|
+
ent = tk.Entry(
|
|
1042
|
+
right,
|
|
1043
|
+
textvariable=var,
|
|
1044
|
+
bg=t.input_bg,
|
|
1045
|
+
fg=t.fg,
|
|
1046
|
+
insertbackground=t.cursor,
|
|
1047
|
+
relief="flat",
|
|
1048
|
+
bd=0,
|
|
1049
|
+
font=(FONT_UI, 9),
|
|
1050
|
+
highlightthickness=1,
|
|
1051
|
+
highlightbackground=t.border,
|
|
1052
|
+
width=26,
|
|
1053
|
+
)
|
|
1054
|
+
ent.pack(anchor="e", pady=4)
|
|
1055
|
+
ent.bind("<FocusOut>", lambda _, k=key,
|
|
1056
|
+
v=var: self._save(k, v.get()))
|
|
1057
|
+
ent.bind("<Return>", lambda _, k=key,
|
|
1058
|
+
v=var: self._save(k, v.get()))
|
|
1059
|
+
|
|
1060
|
+
reset = tk.Label(
|
|
1061
|
+
right,
|
|
1062
|
+
text="āŗ reset",
|
|
1063
|
+
bg=t.floating_bg,
|
|
1064
|
+
fg=t.fg_muted,
|
|
1065
|
+
font=(FONT_UI, 7),
|
|
1066
|
+
cursor="hand2",
|
|
1067
|
+
)
|
|
1068
|
+
reset.pack(anchor="e")
|
|
1069
|
+
reset.bind("<Button-1>", lambda _, k=key, d=default: self._reset(k, d))
|
|
1070
|
+
reset.bind("<Enter>", lambda _, w=reset: w.config(fg=t.accent))
|
|
1071
|
+
reset.bind("<Leave>", lambda _, w=reset: w.config(fg=t.fg_muted))
|
|
1072
|
+
|
|
1073
|
+
tk.Frame(container, bg=t.border, height=1).pack(fill="x", padx=20)
|
|
1074
|
+
|
|
1075
|
+
def _build_git_panel(self, frame: tk.Frame, t) -> None:
|
|
1076
|
+
"""Constrói o painel Git: configurações padrão + credenciais + URL updater."""
|
|
1077
|
+
hdr = tk.Frame(frame, bg=t.floating_bg)
|
|
1078
|
+
hdr.pack(fill="x", padx=20, pady=(16, 4))
|
|
1079
|
+
tk.Label(
|
|
1080
|
+
hdr,
|
|
1081
|
+
text="šæ " + _t("setting.cat_git", "Git"),
|
|
1082
|
+
bg=t.floating_bg,
|
|
1083
|
+
fg=t.fg,
|
|
1084
|
+
font=(FONT_UI, 14, "bold"),
|
|
1085
|
+
).pack(anchor="w")
|
|
1086
|
+
tk.Frame(frame, bg=t.border, height=1).pack(
|
|
1087
|
+
fill="x", padx=20, pady=(0, 8))
|
|
1088
|
+
|
|
1089
|
+
std_keys = [
|
|
1090
|
+
"git_enabled",
|
|
1091
|
+
"git_decorations",
|
|
1092
|
+
"git_auto_fetch",
|
|
1093
|
+
"git_fetch_interval",
|
|
1094
|
+
]
|
|
1095
|
+
for key in std_keys:
|
|
1096
|
+
schema = self._schema_map.get(key)
|
|
1097
|
+
if schema is None:
|
|
1098
|
+
continue
|
|
1099
|
+
skey, label, desc, kind, default, opts = (
|
|
1100
|
+
schema[0],
|
|
1101
|
+
schema[1],
|
|
1102
|
+
schema[2],
|
|
1103
|
+
schema[3],
|
|
1104
|
+
schema[4],
|
|
1105
|
+
schema[5],
|
|
1106
|
+
)
|
|
1107
|
+
type_hint = schema[6] if len(schema) > 6 else None
|
|
1108
|
+
example = schema[7] if len(schema) > 7 else None
|
|
1109
|
+
lk, dk = f"setting.{skey}", f"setting.desc.{skey}"
|
|
1110
|
+
label = _t(lk) if _t(lk) != lk else label
|
|
1111
|
+
desc = _t(dk) if _t(dk) != dk else desc
|
|
1112
|
+
self._build_setting_row(
|
|
1113
|
+
skey,
|
|
1114
|
+
label,
|
|
1115
|
+
desc,
|
|
1116
|
+
kind,
|
|
1117
|
+
default,
|
|
1118
|
+
opts,
|
|
1119
|
+
type_hint,
|
|
1120
|
+
example,
|
|
1121
|
+
t,
|
|
1122
|
+
parent=frame,
|
|
1123
|
+
)
|
|
1124
|
+
|
|
1125
|
+
tk.Frame(frame, bg=t.border, height=1).pack(
|
|
1126
|
+
fill="x", padx=20, pady=(8, 4))
|
|
1127
|
+
sec_upd = tk.Frame(frame, bg=t.floating_bg)
|
|
1128
|
+
sec_upd.pack(fill="x", padx=20, pady=(4, 8))
|
|
1129
|
+
tk.Label(
|
|
1130
|
+
sec_upd,
|
|
1131
|
+
text="⬠"
|
|
1132
|
+
+ _t("setting.updater_url", "URL do Repositório de Atualizações"),
|
|
1133
|
+
bg=t.floating_bg,
|
|
1134
|
+
fg=t.fg,
|
|
1135
|
+
font=(FONT_UI, 10, "bold"),
|
|
1136
|
+
anchor="w",
|
|
1137
|
+
).pack(anchor="w")
|
|
1138
|
+
tk.Label(
|
|
1139
|
+
sec_upd,
|
|
1140
|
+
text=_t(
|
|
1141
|
+
"setting.updater_url_desc",
|
|
1142
|
+
"Owner/repo do GitHub para checagem de atualizações. Padrão: KillovSky/Codis",
|
|
1143
|
+
),
|
|
1144
|
+
bg=t.floating_bg,
|
|
1145
|
+
fg=t.fg_muted,
|
|
1146
|
+
font=(FONT_UI, 8),
|
|
1147
|
+
anchor="w",
|
|
1148
|
+
wraplength=500,
|
|
1149
|
+
).pack(anchor="w")
|
|
1150
|
+
|
|
1151
|
+
url_row = tk.Frame(sec_upd, bg=t.floating_bg)
|
|
1152
|
+
url_row.pack(fill="x", pady=(6, 0))
|
|
1153
|
+
cur_url = self._cfg.get("updater_url", "KillovSky/Codis")
|
|
1154
|
+
url_var = tk.StringVar(value=str(cur_url))
|
|
1155
|
+
url_ent = tk.Entry(
|
|
1156
|
+
url_row,
|
|
1157
|
+
textvariable=url_var,
|
|
1158
|
+
bg=t.input_bg,
|
|
1159
|
+
fg=t.fg,
|
|
1160
|
+
insertbackground=t.cursor,
|
|
1161
|
+
relief="flat",
|
|
1162
|
+
bd=0,
|
|
1163
|
+
font=(FONT_UI, 9),
|
|
1164
|
+
highlightthickness=1,
|
|
1165
|
+
highlightbackground=t.border,
|
|
1166
|
+
width=36,
|
|
1167
|
+
)
|
|
1168
|
+
url_ent.pack(side="left", padx=(0, 8))
|
|
1169
|
+
|
|
1170
|
+
def _save_url():
|
|
1171
|
+
val = url_var.get().strip() or "KillovSky/Codis"
|
|
1172
|
+
url_var.set(val)
|
|
1173
|
+
self._cfg.set("updater_url", val)
|
|
1174
|
+
if self._on_change:
|
|
1175
|
+
self._on_change("updater_url", val)
|
|
1176
|
+
|
|
1177
|
+
tk.Label(
|
|
1178
|
+
url_row,
|
|
1179
|
+
text="Salvar",
|
|
1180
|
+
bg=t.accent,
|
|
1181
|
+
fg="#000",
|
|
1182
|
+
font=(FONT_UI, 9, "bold"),
|
|
1183
|
+
cursor="hand2",
|
|
1184
|
+
padx=10,
|
|
1185
|
+
pady=3,
|
|
1186
|
+
relief="flat",
|
|
1187
|
+
).pack(side="left")
|
|
1188
|
+
url_row.winfo_children()[-1].bind("<Button-1>", lambda _: _save_url())
|
|
1189
|
+
url_ent.bind("<Return>", lambda _: _save_url())
|
|
1190
|
+
url_ent.bind("<FocusOut>", lambda _: _save_url())
|
|
1191
|
+
|
|
1192
|
+
reset_url = tk.Label(
|
|
1193
|
+
url_row,
|
|
1194
|
+
text="āŗ reset",
|
|
1195
|
+
bg=t.floating_bg,
|
|
1196
|
+
fg=t.fg_muted,
|
|
1197
|
+
font=(FONT_UI, 7),
|
|
1198
|
+
cursor="hand2",
|
|
1199
|
+
)
|
|
1200
|
+
reset_url.pack(side="left", padx=8)
|
|
1201
|
+
reset_url.bind(
|
|
1202
|
+
"<Button-1>", lambda _: (url_var.set("KillovSky/Codis"),
|
|
1203
|
+
_save_url())
|
|
1204
|
+
)
|
|
1205
|
+
reset_url.bind("<Enter>", lambda _, w=reset_url: w.config(fg=t.accent))
|
|
1206
|
+
reset_url.bind("<Leave>", lambda _,
|
|
1207
|
+
w=reset_url: w.config(fg=t.fg_muted))
|
|
1208
|
+
|
|
1209
|
+
tk.Frame(frame, bg=t.border, height=1).pack(
|
|
1210
|
+
fill="x", padx=20, pady=(12, 4))
|
|
1211
|
+
sec_cred = tk.Frame(frame, bg=t.floating_bg)
|
|
1212
|
+
sec_cred.pack(fill="x", padx=20, pady=(4, 4))
|
|
1213
|
+
|
|
1214
|
+
tk.Label(
|
|
1215
|
+
sec_cred,
|
|
1216
|
+
text="š " + _t("git.manage_creds", "Credenciais Git (HTTPS)"),
|
|
1217
|
+
bg=t.floating_bg,
|
|
1218
|
+
fg=t.fg,
|
|
1219
|
+
font=(FONT_UI, 10, "bold"),
|
|
1220
|
+
anchor="w",
|
|
1221
|
+
).pack(anchor="w")
|
|
1222
|
+
tk.Label(
|
|
1223
|
+
sec_cred,
|
|
1224
|
+
text=_t(
|
|
1225
|
+
"git.creds_desc",
|
|
1226
|
+
"Gerencie os tokens de acesso pessoal (PAT) salvos para repositórios HTTPS.",
|
|
1227
|
+
),
|
|
1228
|
+
bg=t.floating_bg,
|
|
1229
|
+
fg=t.fg_muted,
|
|
1230
|
+
font=(FONT_UI, 8),
|
|
1231
|
+
anchor="w",
|
|
1232
|
+
wraplength=500,
|
|
1233
|
+
).pack(anchor="w", pady=(0, 8))
|
|
1234
|
+
|
|
1235
|
+
creds_frame = tk.Frame(sec_cred, bg=t.floating_bg)
|
|
1236
|
+
creds_frame.pack(fill="x")
|
|
1237
|
+
|
|
1238
|
+
def _refresh_creds():
|
|
1239
|
+
"""Reconstrói a lista de credenciais salvas."""
|
|
1240
|
+
for child in creds_frame.winfo_children():
|
|
1241
|
+
child.destroy()
|
|
1242
|
+
creds_now: dict = self._cfg.get("git_credentials") or {}
|
|
1243
|
+
if not creds_now:
|
|
1244
|
+
tk.Label(
|
|
1245
|
+
creds_frame,
|
|
1246
|
+
text=_t("git.no_creds_saved", "Nenhuma credencial salva."),
|
|
1247
|
+
bg=t.floating_bg,
|
|
1248
|
+
fg=t.fg_muted,
|
|
1249
|
+
font=(FONT_UI, 9),
|
|
1250
|
+
).pack(anchor="w", pady=4)
|
|
1251
|
+
else:
|
|
1252
|
+
for host in list(creds_now.keys()):
|
|
1253
|
+
row = tk.Frame(
|
|
1254
|
+
creds_frame,
|
|
1255
|
+
bg=t.sidebar_bg,
|
|
1256
|
+
highlightthickness=1,
|
|
1257
|
+
highlightbackground=t.border,
|
|
1258
|
+
)
|
|
1259
|
+
row.pack(fill="x", pady=2, ipady=4)
|
|
1260
|
+
tk.Label(
|
|
1261
|
+
row,
|
|
1262
|
+
text=f"š {host}",
|
|
1263
|
+
bg=t.sidebar_bg,
|
|
1264
|
+
fg=t.fg,
|
|
1265
|
+
font=(FONT_UI, 9),
|
|
1266
|
+
anchor="w",
|
|
1267
|
+
).pack(side="left", padx=12, fill="x", expand=True)
|
|
1268
|
+
|
|
1269
|
+
def _forget(h=host):
|
|
1270
|
+
c: dict = dict(self._cfg.get("git_credentials") or {})
|
|
1271
|
+
c.pop(h, None)
|
|
1272
|
+
self._cfg.set("git_credentials", c)
|
|
1273
|
+
self._cfg.save()
|
|
1274
|
+
_refresh_creds()
|
|
1275
|
+
|
|
1276
|
+
tk.Label(
|
|
1277
|
+
row,
|
|
1278
|
+
text=_t("git.forget_creds", "Remover"),
|
|
1279
|
+
bg=t.btn_bg,
|
|
1280
|
+
fg=t.fg,
|
|
1281
|
+
font=(FONT_UI, 8),
|
|
1282
|
+
cursor="hand2",
|
|
1283
|
+
padx=8,
|
|
1284
|
+
pady=2,
|
|
1285
|
+
relief="flat",
|
|
1286
|
+
).pack(side="right", padx=8)
|
|
1287
|
+
row.winfo_children()[-1].bind(
|
|
1288
|
+
"<Button-1>", lambda _, fn=_forget: fn()
|
|
1289
|
+
)
|
|
1290
|
+
|
|
1291
|
+
_refresh_creds()
|
|
1292
|
+
|
|
1293
|
+
add_row = tk.Frame(sec_cred, bg=t.floating_bg)
|
|
1294
|
+
add_row.pack(fill="x", pady=(10, 4))
|
|
1295
|
+
|
|
1296
|
+
def _add_creds():
|
|
1297
|
+
"""Abre diƔlogo para inserir novas credenciais."""
|
|
1298
|
+
from src.ui.git_auth import _CredentialDialog
|
|
1299
|
+
|
|
1300
|
+
host_win = tk.Toplevel(self)
|
|
1301
|
+
host_win.title(_t("git.add_creds", "Adicionar Credenciais"))
|
|
1302
|
+
host_win.resizable(False, False)
|
|
1303
|
+
host_win.configure(bg=t.floating_bg)
|
|
1304
|
+
host_win.transient(self)
|
|
1305
|
+
host_win.geometry("380x140")
|
|
1306
|
+
fw = tk.Frame(host_win, bg=t.floating_bg, padx=20, pady=16)
|
|
1307
|
+
fw.pack(fill="both", expand=True)
|
|
1308
|
+
tk.Label(
|
|
1309
|
+
fw,
|
|
1310
|
+
text=_t("git.host_label", "Host (ex: github.com):"),
|
|
1311
|
+
bg=t.floating_bg,
|
|
1312
|
+
fg=t.fg,
|
|
1313
|
+
font=(FONT_UI, 9),
|
|
1314
|
+
anchor="w",
|
|
1315
|
+
).pack(fill="x")
|
|
1316
|
+
host_var = tk.StringVar(value="github.com")
|
|
1317
|
+
host_ent = tk.Entry(
|
|
1318
|
+
fw,
|
|
1319
|
+
textvariable=host_var,
|
|
1320
|
+
bg=t.input_bg,
|
|
1321
|
+
fg=t.fg,
|
|
1322
|
+
insertbackground=t.cursor,
|
|
1323
|
+
relief="flat",
|
|
1324
|
+
bd=0,
|
|
1325
|
+
font=(FONT_UI, 10),
|
|
1326
|
+
highlightthickness=1,
|
|
1327
|
+
highlightbackground=t.border,
|
|
1328
|
+
)
|
|
1329
|
+
host_ent.pack(fill="x", pady=(4, 10))
|
|
1330
|
+
btn_row = tk.Frame(fw, bg=t.floating_bg)
|
|
1331
|
+
btn_row.pack(fill="x")
|
|
1332
|
+
|
|
1333
|
+
def _proceed():
|
|
1334
|
+
host = host_var.get().strip()
|
|
1335
|
+
if not host:
|
|
1336
|
+
return
|
|
1337
|
+
host_win.destroy()
|
|
1338
|
+
url = f"https://{host}"
|
|
1339
|
+
dlg = _CredentialDialog(self, t, url, existing=None)
|
|
1340
|
+
self.wait_window(dlg.win)
|
|
1341
|
+
if dlg.confirmed:
|
|
1342
|
+
import base64 as _b64
|
|
1343
|
+
|
|
1344
|
+
c: dict = dict(self._cfg.get("git_credentials") or {})
|
|
1345
|
+
c[host] = {
|
|
1346
|
+
"u": _b64.b64encode(dlg.user.encode()).decode(),
|
|
1347
|
+
"t": _b64.b64encode(dlg.token.encode()).decode(),
|
|
1348
|
+
}
|
|
1349
|
+
self._cfg.set("git_credentials", c)
|
|
1350
|
+
self._cfg.save()
|
|
1351
|
+
_refresh_creds()
|
|
1352
|
+
|
|
1353
|
+
tk.Label(
|
|
1354
|
+
btn_row,
|
|
1355
|
+
text="Continuar",
|
|
1356
|
+
bg=t.accent,
|
|
1357
|
+
fg="#000",
|
|
1358
|
+
font=(FONT_UI, 9, "bold"),
|
|
1359
|
+
cursor="hand2",
|
|
1360
|
+
padx=12,
|
|
1361
|
+
pady=4,
|
|
1362
|
+
relief="flat",
|
|
1363
|
+
).pack(side="right")
|
|
1364
|
+
btn_row.winfo_children(
|
|
1365
|
+
)[-1].bind("<Button-1>", lambda _: _proceed())
|
|
1366
|
+
tk.Label(
|
|
1367
|
+
btn_row,
|
|
1368
|
+
text=_t("ui.cancel", "Cancelar"),
|
|
1369
|
+
bg=t.btn_bg,
|
|
1370
|
+
fg=t.fg,
|
|
1371
|
+
font=(FONT_UI, 9),
|
|
1372
|
+
cursor="hand2",
|
|
1373
|
+
padx=12,
|
|
1374
|
+
pady=4,
|
|
1375
|
+
relief="flat",
|
|
1376
|
+
).pack(side="right", padx=6)
|
|
1377
|
+
btn_row.winfo_children()[-1].bind(
|
|
1378
|
+
"<Button-1>", lambda _: host_win.destroy()
|
|
1379
|
+
)
|
|
1380
|
+
host_ent.bind("<Return>", lambda _: _proceed())
|
|
1381
|
+
host_ent.focus_set()
|
|
1382
|
+
|
|
1383
|
+
add_btn = tk.Label(
|
|
1384
|
+
add_row,
|
|
1385
|
+
text=_t("git.add_creds", "ļ¼ Adicionar / Atualizar credenciais"),
|
|
1386
|
+
bg=t.accent,
|
|
1387
|
+
fg="#000",
|
|
1388
|
+
font=(FONT_UI, 9, "bold"),
|
|
1389
|
+
cursor="hand2",
|
|
1390
|
+
padx=12,
|
|
1391
|
+
pady=5,
|
|
1392
|
+
relief="flat",
|
|
1393
|
+
)
|
|
1394
|
+
add_btn.pack(side="left")
|
|
1395
|
+
add_btn.bind("<Button-1>", lambda _: _add_creds())
|
|
1396
|
+
|
|
1397
|
+
with contextlib.suppress(tk.TclError):
|
|
1398
|
+
self._bind_scroll_fn(frame)
|
|
1399
|
+
self._update_canvas_scroll()
|
|
1400
|
+
|
|
1401
|
+
def _on_search(self) -> None:
|
|
1402
|
+
"""Filtra e exibe configurações de todas as categorias que correspondam à busca."""
|
|
1403
|
+
if self._destroyed or not self.winfo_exists():
|
|
1404
|
+
return
|
|
1405
|
+
q = self._search_var.get().strip().lower()
|
|
1406
|
+
if not q:
|
|
1407
|
+
self._show_category(
|
|
1408
|
+
self._current_cat if self._current_cat != "__search__" else "editor"
|
|
1409
|
+
)
|
|
1410
|
+
return
|
|
1411
|
+
|
|
1412
|
+
t = self._tmgr.theme
|
|
1413
|
+
self._current_cat = "__search__"
|
|
1414
|
+
|
|
1415
|
+
for cached_frame in self._cat_frame_cache.values():
|
|
1416
|
+
with contextlib.suppress(tk.TclError):
|
|
1417
|
+
cached_frame.pack_forget()
|
|
1418
|
+
|
|
1419
|
+
if "__search__" in self._cat_frame_cache:
|
|
1420
|
+
with contextlib.suppress(tk.TclError):
|
|
1421
|
+
self._cat_frame_cache["__search__"].destroy()
|
|
1422
|
+
search_frame = tk.Frame(self._content_outer, bg=t.floating_bg)
|
|
1423
|
+
self._cat_frame_cache["__search__"] = search_frame
|
|
1424
|
+
search_frame.pack(fill="both", expand=True)
|
|
1425
|
+
|
|
1426
|
+
tk.Label(
|
|
1427
|
+
search_frame,
|
|
1428
|
+
text=f'š {_t("setting.search_results", "Resultados para")} "{q}"',
|
|
1429
|
+
bg=t.floating_bg,
|
|
1430
|
+
fg=t.fg,
|
|
1431
|
+
font=(FONT_UI, 12, "bold"),
|
|
1432
|
+
).pack(anchor="w", padx=20, pady=(16, 4))
|
|
1433
|
+
tk.Frame(search_frame, bg=t.border, height=1).pack(
|
|
1434
|
+
fill="x", padx=20, pady=(0, 8)
|
|
1435
|
+
)
|
|
1436
|
+
|
|
1437
|
+
found = 0
|
|
1438
|
+
for schema in SettingsEditor._get_schema():
|
|
1439
|
+
key = schema[0]
|
|
1440
|
+
if key.startswith("__"):
|
|
1441
|
+
continue
|
|
1442
|
+
label, desc, kind = schema[1], schema[2], schema[3]
|
|
1443
|
+
default, opts = schema[4], schema[5]
|
|
1444
|
+
type_hint = schema[6] if len(schema) > 6 else None
|
|
1445
|
+
example = schema[7] if len(schema) > 7 else None
|
|
1446
|
+
lk, dk = f"setting.{key}", f"setting.desc.{key}"
|
|
1447
|
+
label = _t(lk) if _t(lk) != lk else label
|
|
1448
|
+
desc = _t(dk) if _t(dk) != dk else desc
|
|
1449
|
+
if q in key or q in label.lower() or q in desc.lower():
|
|
1450
|
+
self._build_setting_row(
|
|
1451
|
+
key,
|
|
1452
|
+
label,
|
|
1453
|
+
desc,
|
|
1454
|
+
kind,
|
|
1455
|
+
default,
|
|
1456
|
+
opts,
|
|
1457
|
+
type_hint,
|
|
1458
|
+
example,
|
|
1459
|
+
t,
|
|
1460
|
+
parent=search_frame,
|
|
1461
|
+
)
|
|
1462
|
+
found += 1
|
|
1463
|
+
|
|
1464
|
+
if found == 0:
|
|
1465
|
+
tk.Label(
|
|
1466
|
+
search_frame,
|
|
1467
|
+
text=_t(
|
|
1468
|
+
"hc.settings_window.no_settings_found",
|
|
1469
|
+
"Nenhuma configuração encontrada.",
|
|
1470
|
+
),
|
|
1471
|
+
bg=t.floating_bg,
|
|
1472
|
+
fg=t.fg_muted,
|
|
1473
|
+
font=(FONT_UI, 10),
|
|
1474
|
+
).pack(padx=20, pady=20)
|
|
1475
|
+
else:
|
|
1476
|
+
tk.Label(
|
|
1477
|
+
search_frame,
|
|
1478
|
+
text=_t("setting.search_count", "{n} resultado(s)", n=found),
|
|
1479
|
+
bg=t.floating_bg,
|
|
1480
|
+
fg=t.fg_muted,
|
|
1481
|
+
font=(FONT_UI, 8),
|
|
1482
|
+
).pack(anchor="w", padx=20, pady=(0, 8))
|
|
1483
|
+
with contextlib.suppress(tk.TclError):
|
|
1484
|
+
self._count_lbl.config(text=f"{found} resultado(s)")
|
|
1485
|
+
|
|
1486
|
+
with contextlib.suppress(tk.TclError):
|
|
1487
|
+
self._bind_scroll_fn(search_frame)
|
|
1488
|
+
self._update_canvas_scroll()
|
|
1489
|
+
|
|
1490
|
+
def _save(self, key: str, value: Any) -> None:
|
|
1491
|
+
"""Salva uma configuração e notifica o callback.
|
|
1492
|
+
|
|
1493
|
+
Args:
|
|
1494
|
+
key: Chave de configuração.
|
|
1495
|
+
value: Novo valor a salvar.
|
|
1496
|
+
"""
|
|
1497
|
+
self._cfg.set(key, value)
|
|
1498
|
+
if self._on_change:
|
|
1499
|
+
self._on_change(key, value)
|
|
1500
|
+
|
|
1501
|
+
def _reset(self, key: str, default: Any) -> None:
|
|
1502
|
+
"""Restaura uma configuração ao valor padrão e recarrega a categoria atual.
|
|
1503
|
+
|
|
1504
|
+
Args:
|
|
1505
|
+
key: Chave de configuração a resetar.
|
|
1506
|
+
default: Valor padrão a aplicar.
|
|
1507
|
+
"""
|
|
1508
|
+
self._cfg.set(key, default)
|
|
1509
|
+
if self._on_change:
|
|
1510
|
+
self._on_change(key, default)
|
|
1511
|
+
cat = self._current_cat
|
|
1512
|
+
if cat in self._cat_frame_cache:
|
|
1513
|
+
with contextlib.suppress(tk.TclError):
|
|
1514
|
+
self._cat_frame_cache.pop(cat).destroy()
|
|
1515
|
+
self._show_category(cat)
|
|
1516
|
+
|
|
1517
|
+
def _reset_all(self) -> None:
|
|
1518
|
+
"""Restaura todas as configurações da categoria atual aos valores padrão."""
|
|
1519
|
+
import tkinter.messagebox as mb
|
|
1520
|
+
|
|
1521
|
+
cat = self._current_cat
|
|
1522
|
+
if cat in ("__search__",):
|
|
1523
|
+
return
|
|
1524
|
+
keys = self._CAT_KEYS.get(cat, [])
|
|
1525
|
+
if not keys:
|
|
1526
|
+
return
|
|
1527
|
+
cat_name = next(
|
|
1528
|
+
(nm for cid, _, nm in self._categories if cid == cat), cat)
|
|
1529
|
+
if not mb.askyesno(
|
|
1530
|
+
_t("setting.reset_all_title", "Restaurar PadrƵes"),
|
|
1531
|
+
_t(
|
|
1532
|
+
"setting.reset_all_msg",
|
|
1533
|
+
"Restaurar todas as configurações de '{cat}' aos valores padrão?",
|
|
1534
|
+
cat=cat_name,
|
|
1535
|
+
),
|
|
1536
|
+
parent=self,
|
|
1537
|
+
):
|
|
1538
|
+
return
|
|
1539
|
+
for key in keys:
|
|
1540
|
+
schema = self._schema_map.get(key)
|
|
1541
|
+
if schema:
|
|
1542
|
+
default = schema[4]
|
|
1543
|
+
self._cfg.set(key, default)
|
|
1544
|
+
if self._on_change:
|
|
1545
|
+
self._on_change(key, default)
|
|
1546
|
+
if cat in self._cat_frame_cache:
|
|
1547
|
+
with contextlib.suppress(tk.TclError):
|
|
1548
|
+
self._cat_frame_cache.pop(cat).destroy()
|
|
1549
|
+
self._show_category(cat)
|
|
1550
|
+
|
|
1551
|
+
def _open_json(self) -> None:
|
|
1552
|
+
"""Abre o config.json no editor para edição manual."""
|
|
1553
|
+
if self._on_change:
|
|
1554
|
+
self._on_change("_open_json", str(CONFIG_FILE))
|