lazylabel-gui 1.3.1__py3-none-any.whl → 1.3.3__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.
- lazylabel/core/file_manager.py +33 -1
- lazylabel/ui/main_window.py +380 -119
- lazylabel/ui/right_panel.py +29 -2
- lazylabel/utils/fast_file_manager.py +831 -0
- {lazylabel_gui-1.3.1.dist-info → lazylabel_gui-1.3.3.dist-info}/METADATA +1 -1
- {lazylabel_gui-1.3.1.dist-info → lazylabel_gui-1.3.3.dist-info}/RECORD +10 -10
- lazylabel/ui/test_hover.py +0 -48
- {lazylabel_gui-1.3.1.dist-info → lazylabel_gui-1.3.3.dist-info}/WHEEL +0 -0
- {lazylabel_gui-1.3.1.dist-info → lazylabel_gui-1.3.3.dist-info}/entry_points.txt +0 -0
- {lazylabel_gui-1.3.1.dist-info → lazylabel_gui-1.3.3.dist-info}/licenses/LICENSE +0 -0
- {lazylabel_gui-1.3.1.dist-info → lazylabel_gui-1.3.3.dist-info}/top_level.txt +0 -0
lazylabel/ui/right_panel.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
"""Right panel with file explorer and segment management."""
|
2
2
|
|
3
|
+
from pathlib import Path
|
4
|
+
|
3
5
|
from PyQt6.QtCore import Qt, pyqtSignal
|
4
6
|
from PyQt6.QtWidgets import (
|
5
7
|
QComboBox,
|
@@ -14,6 +16,7 @@ from PyQt6.QtWidgets import (
|
|
14
16
|
QWidget,
|
15
17
|
)
|
16
18
|
|
19
|
+
from ..utils.fast_file_manager import FastFileManager
|
17
20
|
from .reorderable_class_table import ReorderableClassTable
|
18
21
|
|
19
22
|
|
@@ -23,6 +26,7 @@ class RightPanel(QWidget):
|
|
23
26
|
# Signals
|
24
27
|
open_folder_requested = pyqtSignal()
|
25
28
|
image_selected = pyqtSignal("QModelIndex")
|
29
|
+
image_path_selected = pyqtSignal(Path) # New signal for path-based selection
|
26
30
|
merge_selection_requested = pyqtSignal()
|
27
31
|
delete_selection_requested = pyqtSignal()
|
28
32
|
segments_selection_changed = pyqtSignal()
|
@@ -109,8 +113,13 @@ class RightPanel(QWidget):
|
|
109
113
|
self.btn_open_folder.setToolTip("Open a directory of images")
|
110
114
|
layout.addWidget(self.btn_open_folder)
|
111
115
|
|
112
|
-
|
113
|
-
|
116
|
+
# Use new FastFileManager instead of QTreeView
|
117
|
+
self.file_manager = FastFileManager()
|
118
|
+
layout.addWidget(self.file_manager)
|
119
|
+
|
120
|
+
# Keep file_tree reference for compatibility
|
121
|
+
self.file_tree = QTreeView() # Hidden, for backward compatibility
|
122
|
+
self.file_tree.hide()
|
114
123
|
|
115
124
|
splitter.addWidget(file_explorer_widget)
|
116
125
|
|
@@ -195,6 +204,8 @@ class RightPanel(QWidget):
|
|
195
204
|
"""Connect internal signals."""
|
196
205
|
self.btn_open_folder.clicked.connect(self.open_folder_requested)
|
197
206
|
self.file_tree.doubleClicked.connect(self.image_selected)
|
207
|
+
# Connect new file manager signal
|
208
|
+
self.file_manager.fileSelected.connect(self.image_path_selected)
|
198
209
|
self.btn_merge_selection.clicked.connect(self.merge_selection_requested)
|
199
210
|
self.btn_delete_selection.clicked.connect(self.delete_selection_requested)
|
200
211
|
self.segment_table.itemSelectionChanged.connect(self.segments_selection_changed)
|
@@ -276,12 +287,28 @@ class RightPanel(QWidget):
|
|
276
287
|
|
277
288
|
def setup_file_model(self, file_model):
|
278
289
|
"""Setup the file model for the tree view."""
|
290
|
+
# Keep for backward compatibility
|
279
291
|
self.file_tree.setModel(file_model)
|
280
292
|
self.file_tree.setColumnWidth(0, 200)
|
281
293
|
|
282
294
|
def set_folder(self, folder_path, file_model):
|
283
295
|
"""Set the folder for file browsing."""
|
296
|
+
# Keep old tree view for compatibility
|
284
297
|
self.file_tree.setRootIndex(file_model.setRootPath(folder_path))
|
298
|
+
# Use new file manager
|
299
|
+
self.file_manager.setDirectory(Path(folder_path))
|
300
|
+
|
301
|
+
def navigate_next_image(self):
|
302
|
+
"""Navigate to next image in the file manager."""
|
303
|
+
self.file_manager.navigateNext()
|
304
|
+
|
305
|
+
def navigate_previous_image(self):
|
306
|
+
"""Navigate to previous image in the file manager."""
|
307
|
+
self.file_manager.navigatePrevious()
|
308
|
+
|
309
|
+
def select_file(self, file_path: Path):
|
310
|
+
"""Select a specific file in the file manager."""
|
311
|
+
self.file_manager.selectFile(file_path)
|
285
312
|
|
286
313
|
def get_selected_segment_indices(self):
|
287
314
|
"""Get indices of selected segments."""
|