supervertaler 1.9.153__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.
Potentially problematic release.
This version of supervertaler might be problematic. Click here for more details.
- Supervertaler.py +47886 -0
- modules/__init__.py +10 -0
- modules/ai_actions.py +964 -0
- modules/ai_attachment_manager.py +343 -0
- modules/ai_file_viewer_dialog.py +210 -0
- modules/autofingers_engine.py +466 -0
- modules/cafetran_docx_handler.py +379 -0
- modules/config_manager.py +469 -0
- modules/database_manager.py +1878 -0
- modules/database_migrations.py +417 -0
- modules/dejavurtf_handler.py +779 -0
- modules/document_analyzer.py +427 -0
- modules/docx_handler.py +689 -0
- modules/encoding_repair.py +319 -0
- modules/encoding_repair_Qt.py +393 -0
- modules/encoding_repair_ui.py +481 -0
- modules/feature_manager.py +350 -0
- modules/figure_context_manager.py +340 -0
- modules/file_dialog_helper.py +148 -0
- modules/find_replace.py +164 -0
- modules/find_replace_qt.py +457 -0
- modules/glossary_manager.py +433 -0
- modules/image_extractor.py +188 -0
- modules/keyboard_shortcuts_widget.py +571 -0
- modules/llm_clients.py +1211 -0
- modules/llm_leaderboard.py +737 -0
- modules/llm_superbench_ui.py +1401 -0
- modules/local_llm_setup.py +1104 -0
- modules/model_update_dialog.py +381 -0
- modules/model_version_checker.py +373 -0
- modules/mqxliff_handler.py +638 -0
- modules/non_translatables_manager.py +743 -0
- modules/pdf_rescue_Qt.py +1822 -0
- modules/pdf_rescue_tkinter.py +909 -0
- modules/phrase_docx_handler.py +516 -0
- modules/project_home_panel.py +209 -0
- modules/prompt_assistant.py +357 -0
- modules/prompt_library.py +689 -0
- modules/prompt_library_migration.py +447 -0
- modules/quick_access_sidebar.py +282 -0
- modules/ribbon_widget.py +597 -0
- modules/sdlppx_handler.py +874 -0
- modules/setup_wizard.py +353 -0
- modules/shortcut_manager.py +932 -0
- modules/simple_segmenter.py +128 -0
- modules/spellcheck_manager.py +727 -0
- modules/statuses.py +207 -0
- modules/style_guide_manager.py +315 -0
- modules/superbench_ui.py +1319 -0
- modules/superbrowser.py +329 -0
- modules/supercleaner.py +600 -0
- modules/supercleaner_ui.py +444 -0
- modules/superdocs.py +19 -0
- modules/superdocs_viewer_qt.py +382 -0
- modules/superlookup.py +252 -0
- modules/tag_cleaner.py +260 -0
- modules/tag_manager.py +333 -0
- modules/term_extractor.py +270 -0
- modules/termbase_entry_editor.py +842 -0
- modules/termbase_import_export.py +488 -0
- modules/termbase_manager.py +1060 -0
- modules/termview_widget.py +1172 -0
- modules/theme_manager.py +499 -0
- modules/tm_editor_dialog.py +99 -0
- modules/tm_manager_qt.py +1280 -0
- modules/tm_metadata_manager.py +545 -0
- modules/tmx_editor.py +1461 -0
- modules/tmx_editor_qt.py +2784 -0
- modules/tmx_generator.py +284 -0
- modules/tracked_changes.py +900 -0
- modules/trados_docx_handler.py +430 -0
- modules/translation_memory.py +715 -0
- modules/translation_results_panel.py +2134 -0
- modules/translation_services.py +282 -0
- modules/unified_prompt_library.py +659 -0
- modules/unified_prompt_manager_qt.py +3951 -0
- modules/voice_commands.py +920 -0
- modules/voice_dictation.py +477 -0
- modules/voice_dictation_lite.py +249 -0
- supervertaler-1.9.153.dist-info/METADATA +896 -0
- supervertaler-1.9.153.dist-info/RECORD +85 -0
- supervertaler-1.9.153.dist-info/WHEEL +5 -0
- supervertaler-1.9.153.dist-info/entry_points.txt +2 -0
- supervertaler-1.9.153.dist-info/licenses/LICENSE +21 -0
- supervertaler-1.9.153.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Quick Access Sidebar - memoQ-style left navigation panel
|
|
3
|
+
|
|
4
|
+
Provides quick access to common actions, recent files, and project navigation.
|
|
5
|
+
|
|
6
|
+
Author: Michael Beijer
|
|
7
|
+
License: MIT
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from PyQt6.QtWidgets import (
|
|
11
|
+
QWidget, QVBoxLayout, QPushButton, QLabel, QFrame,
|
|
12
|
+
QScrollArea, QSizePolicy, QListWidget, QListWidgetItem
|
|
13
|
+
)
|
|
14
|
+
from PyQt6.QtCore import Qt, pyqtSignal, QSize
|
|
15
|
+
from PyQt6.QtGui import QFont
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class QuickActionButton(QPushButton):
|
|
19
|
+
"""A button for quick actions in the sidebar"""
|
|
20
|
+
|
|
21
|
+
def __init__(self, icon: str, text: str, parent=None):
|
|
22
|
+
super().__init__(parent)
|
|
23
|
+
|
|
24
|
+
self.setText(f"{icon} {text}")
|
|
25
|
+
self.setMinimumHeight(36)
|
|
26
|
+
self.setMaximumHeight(40)
|
|
27
|
+
self.setCursor(Qt.CursorShape.PointingHandCursor)
|
|
28
|
+
|
|
29
|
+
# Styling
|
|
30
|
+
self.setStyleSheet("""
|
|
31
|
+
QPushButton {
|
|
32
|
+
text-align: left;
|
|
33
|
+
padding: 8px 12px;
|
|
34
|
+
border: none;
|
|
35
|
+
border-radius: 4px;
|
|
36
|
+
background: transparent;
|
|
37
|
+
font-size: 11pt;
|
|
38
|
+
}
|
|
39
|
+
QPushButton:hover {
|
|
40
|
+
background: rgba(255, 255, 255, 0.1);
|
|
41
|
+
}
|
|
42
|
+
QPushButton:pressed {
|
|
43
|
+
background: rgba(0, 0, 0, 0.1);
|
|
44
|
+
}
|
|
45
|
+
""")
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class SidebarSection(QFrame):
|
|
49
|
+
"""A collapsible section in the sidebar"""
|
|
50
|
+
|
|
51
|
+
def __init__(self, title: str, parent=None):
|
|
52
|
+
super().__init__(parent)
|
|
53
|
+
|
|
54
|
+
self.title = title
|
|
55
|
+
self.is_collapsed = False
|
|
56
|
+
|
|
57
|
+
# Main layout
|
|
58
|
+
layout = QVBoxLayout(self)
|
|
59
|
+
layout.setSpacing(4)
|
|
60
|
+
layout.setContentsMargins(8, 4, 8, 8)
|
|
61
|
+
|
|
62
|
+
# Section header (clickable to collapse/expand)
|
|
63
|
+
self.header = QPushButton(f"▼ {title}")
|
|
64
|
+
self.header.setStyleSheet("""
|
|
65
|
+
QPushButton {
|
|
66
|
+
text-align: left;
|
|
67
|
+
padding: 6px 8px;
|
|
68
|
+
border: none;
|
|
69
|
+
background: rgba(255, 255, 255, 0.05);
|
|
70
|
+
border-radius: 3px;
|
|
71
|
+
font-weight: bold;
|
|
72
|
+
font-size: 10pt;
|
|
73
|
+
}
|
|
74
|
+
QPushButton:hover {
|
|
75
|
+
background: rgba(255, 255, 255, 0.1);
|
|
76
|
+
}
|
|
77
|
+
""")
|
|
78
|
+
self.header.setCursor(Qt.CursorShape.PointingHandCursor)
|
|
79
|
+
self.header.clicked.connect(self.toggle_collapsed)
|
|
80
|
+
layout.addWidget(self.header)
|
|
81
|
+
|
|
82
|
+
# Content area
|
|
83
|
+
self.content_widget = QWidget()
|
|
84
|
+
self.content_layout = QVBoxLayout(self.content_widget)
|
|
85
|
+
self.content_layout.setSpacing(2)
|
|
86
|
+
self.content_layout.setContentsMargins(4, 4, 4, 4)
|
|
87
|
+
layout.addWidget(self.content_widget)
|
|
88
|
+
|
|
89
|
+
# Styling
|
|
90
|
+
self.setStyleSheet("""
|
|
91
|
+
SidebarSection {
|
|
92
|
+
background: transparent;
|
|
93
|
+
border: 1px solid rgba(200, 200, 200, 0.2);
|
|
94
|
+
border-radius: 4px;
|
|
95
|
+
margin: 2px;
|
|
96
|
+
}
|
|
97
|
+
""")
|
|
98
|
+
|
|
99
|
+
def add_button(self, button: QuickActionButton):
|
|
100
|
+
"""Add a quick action button to this section"""
|
|
101
|
+
self.content_layout.addWidget(button)
|
|
102
|
+
|
|
103
|
+
def toggle_collapsed(self):
|
|
104
|
+
"""Toggle section collapsed state"""
|
|
105
|
+
self.is_collapsed = not self.is_collapsed
|
|
106
|
+
self.content_widget.setVisible(not self.is_collapsed)
|
|
107
|
+
arrow = "▶" if self.is_collapsed else "▼"
|
|
108
|
+
self.header.setText(f"{arrow} {self.title}")
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class QuickAccessSidebar(QWidget):
|
|
112
|
+
"""Left sidebar with quick access to common functions"""
|
|
113
|
+
|
|
114
|
+
# Signals
|
|
115
|
+
action_triggered = pyqtSignal(str) # Emits action name
|
|
116
|
+
file_selected = pyqtSignal(str) # Emits file path
|
|
117
|
+
project_home_clicked = pyqtSignal() # Emits when Project Home button clicked
|
|
118
|
+
|
|
119
|
+
def __init__(self, parent=None):
|
|
120
|
+
super().__init__(parent)
|
|
121
|
+
|
|
122
|
+
self.setMinimumWidth(200)
|
|
123
|
+
self.setMaximumWidth(250)
|
|
124
|
+
self.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Expanding)
|
|
125
|
+
|
|
126
|
+
# Main layout
|
|
127
|
+
layout = QVBoxLayout(self)
|
|
128
|
+
layout.setSpacing(6)
|
|
129
|
+
layout.setContentsMargins(4, 4, 4, 4)
|
|
130
|
+
|
|
131
|
+
# Title
|
|
132
|
+
title = QLabel("Quick Access")
|
|
133
|
+
title_font = QFont()
|
|
134
|
+
title_font.setPointSize(11)
|
|
135
|
+
title_font.setBold(True)
|
|
136
|
+
title.setFont(title_font)
|
|
137
|
+
title.setAlignment(Qt.AlignmentFlag.AlignCenter)
|
|
138
|
+
layout.addWidget(title)
|
|
139
|
+
|
|
140
|
+
# Scroll area for sections
|
|
141
|
+
scroll = QScrollArea()
|
|
142
|
+
scroll.setWidgetResizable(True)
|
|
143
|
+
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
|
144
|
+
scroll.setFrameShape(QFrame.Shape.NoFrame)
|
|
145
|
+
|
|
146
|
+
scroll_content = QWidget()
|
|
147
|
+
self.sections_layout = QVBoxLayout(scroll_content)
|
|
148
|
+
self.sections_layout.setSpacing(6)
|
|
149
|
+
self.sections_layout.setContentsMargins(0, 0, 0, 0)
|
|
150
|
+
|
|
151
|
+
scroll.setWidget(scroll_content)
|
|
152
|
+
layout.addWidget(scroll)
|
|
153
|
+
|
|
154
|
+
# Styling
|
|
155
|
+
self.setStyleSheet("""
|
|
156
|
+
QuickAccessSidebar {
|
|
157
|
+
background: rgba(0, 0, 0, 0.1);
|
|
158
|
+
border-right: 1px solid rgba(200, 200, 200, 0.3);
|
|
159
|
+
}
|
|
160
|
+
""")
|
|
161
|
+
|
|
162
|
+
# Build default sections
|
|
163
|
+
self.build_default_sections()
|
|
164
|
+
|
|
165
|
+
def build_default_sections(self):
|
|
166
|
+
"""Build default sidebar sections"""
|
|
167
|
+
# Project Home button (top, always visible)
|
|
168
|
+
project_home_btn = QuickActionButton("🏠", "Project Home")
|
|
169
|
+
project_home_btn.clicked.connect(self.project_home_clicked.emit)
|
|
170
|
+
project_home_btn.setStyleSheet("""
|
|
171
|
+
QPushButton {
|
|
172
|
+
text-align: left;
|
|
173
|
+
padding: 8px 12px;
|
|
174
|
+
border: none;
|
|
175
|
+
border-radius: 4px;
|
|
176
|
+
background: rgba(59, 130, 246, 0.15);
|
|
177
|
+
font-size: 11pt;
|
|
178
|
+
font-weight: bold;
|
|
179
|
+
border-left: 3px solid #3B82F6;
|
|
180
|
+
}
|
|
181
|
+
QPushButton:hover {
|
|
182
|
+
background: rgba(59, 130, 246, 0.25);
|
|
183
|
+
}
|
|
184
|
+
QPushButton:pressed {
|
|
185
|
+
background: rgba(59, 130, 246, 0.35);
|
|
186
|
+
}
|
|
187
|
+
""")
|
|
188
|
+
|
|
189
|
+
# Get the main layout and add Project Home button at top
|
|
190
|
+
main_layout = self.layout()
|
|
191
|
+
# Find where to insert (after title)
|
|
192
|
+
main_layout.insertWidget(1, project_home_btn)
|
|
193
|
+
|
|
194
|
+
# Add separator
|
|
195
|
+
separator = QFrame()
|
|
196
|
+
separator.setFrameShape(QFrame.Shape.HLine)
|
|
197
|
+
separator.setFrameShadow(QFrame.Shadow.Sunken)
|
|
198
|
+
main_layout.insertWidget(2, separator)
|
|
199
|
+
|
|
200
|
+
# Quick Actions section
|
|
201
|
+
quick_actions = SidebarSection("Quick Actions")
|
|
202
|
+
|
|
203
|
+
new_btn = QuickActionButton("📄", "New Project")
|
|
204
|
+
new_btn.clicked.connect(lambda: self.action_triggered.emit("new"))
|
|
205
|
+
quick_actions.add_button(new_btn)
|
|
206
|
+
|
|
207
|
+
open_btn = QuickActionButton("📂", "Open Project")
|
|
208
|
+
open_btn.clicked.connect(lambda: self.action_triggered.emit("open"))
|
|
209
|
+
quick_actions.add_button(open_btn)
|
|
210
|
+
|
|
211
|
+
save_btn = QuickActionButton("💾", "Save Project")
|
|
212
|
+
save_btn.clicked.connect(lambda: self.action_triggered.emit("save"))
|
|
213
|
+
quick_actions.add_button(save_btn)
|
|
214
|
+
|
|
215
|
+
self.add_section(quick_actions)
|
|
216
|
+
|
|
217
|
+
# Translation Tools section
|
|
218
|
+
tools_section = SidebarSection("Translation Tools")
|
|
219
|
+
|
|
220
|
+
lookup_btn = QuickActionButton("🔍", "Universal Lookup")
|
|
221
|
+
lookup_btn.clicked.connect(lambda: self.action_triggered.emit("universal_lookup"))
|
|
222
|
+
tools_section.add_button(lookup_btn)
|
|
223
|
+
|
|
224
|
+
autofingers_btn = QuickActionButton("✋", "AutoFingers")
|
|
225
|
+
autofingers_btn.clicked.connect(lambda: self.action_triggered.emit("autofingers"))
|
|
226
|
+
tools_section.add_button(autofingers_btn)
|
|
227
|
+
|
|
228
|
+
tm_btn = QuickActionButton("🗂️", "TM Manager")
|
|
229
|
+
tm_btn.clicked.connect(lambda: self.action_triggered.emit("tm_manager"))
|
|
230
|
+
tools_section.add_button(tm_btn)
|
|
231
|
+
|
|
232
|
+
self.add_section(tools_section)
|
|
233
|
+
|
|
234
|
+
# Recent Files section
|
|
235
|
+
self.recent_section = SidebarSection("Recent Files")
|
|
236
|
+
self.recent_list = QListWidget()
|
|
237
|
+
self.recent_list.setMaximumHeight(150)
|
|
238
|
+
self.recent_list.setStyleSheet("""
|
|
239
|
+
QListWidget {
|
|
240
|
+
background: transparent;
|
|
241
|
+
border: none;
|
|
242
|
+
font-size: 9pt;
|
|
243
|
+
}
|
|
244
|
+
QListWidget::item {
|
|
245
|
+
padding: 4px;
|
|
246
|
+
border-radius: 2px;
|
|
247
|
+
}
|
|
248
|
+
QListWidget::item:hover {
|
|
249
|
+
background: rgba(255, 255, 255, 0.1);
|
|
250
|
+
}
|
|
251
|
+
QListWidget::item:selected {
|
|
252
|
+
background: rgba(100, 150, 255, 0.3);
|
|
253
|
+
}
|
|
254
|
+
""")
|
|
255
|
+
self.recent_list.itemDoubleClicked.connect(self.on_recent_file_clicked)
|
|
256
|
+
self.recent_section.content_layout.addWidget(self.recent_list)
|
|
257
|
+
self.add_section(self.recent_section)
|
|
258
|
+
|
|
259
|
+
# Add stretch at bottom
|
|
260
|
+
self.sections_layout.addStretch()
|
|
261
|
+
|
|
262
|
+
def add_section(self, section: SidebarSection):
|
|
263
|
+
"""Add a section to the sidebar"""
|
|
264
|
+
self.sections_layout.addWidget(section)
|
|
265
|
+
|
|
266
|
+
def update_recent_files(self, file_paths: list):
|
|
267
|
+
"""Update recent files list"""
|
|
268
|
+
self.recent_list.clear()
|
|
269
|
+
for path in file_paths:
|
|
270
|
+
# Show only filename, store full path
|
|
271
|
+
import os
|
|
272
|
+
filename = os.path.basename(path)
|
|
273
|
+
item = QListWidgetItem(filename)
|
|
274
|
+
item.setData(Qt.ItemDataRole.UserRole, path)
|
|
275
|
+
item.setToolTip(path)
|
|
276
|
+
self.recent_list.addItem(item)
|
|
277
|
+
|
|
278
|
+
def on_recent_file_clicked(self, item: QListWidgetItem):
|
|
279
|
+
"""Handle recent file double-click"""
|
|
280
|
+
file_path = item.data(Qt.ItemDataRole.UserRole)
|
|
281
|
+
if file_path:
|
|
282
|
+
self.file_selected.emit(file_path)
|