toucan-plot 0.5.2__tar.gz → 0.6.0__tar.gz
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.
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/PKG-INFO +1 -1
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/pyproject.toml +1 -1
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/main.py +42 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/README.md +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/__init__.py +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/__main__.py +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/adjustments-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/adjustments-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-autofit-height-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-autofit-height-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-narrow-left-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-narrow-left-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-narrow-right-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-narrow-right-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/device-floppy-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/device-floppy-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/hand-stop-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/hand-stop-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/home-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/home-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/ico/toucan-plot.ico +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/ico/toucan-plot.png +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/layout-grid-add-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/layout-grid-add-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/math-function-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/math-function-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/ruler-measure-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/ruler-measure-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/zoom-dark.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/zoom-light.svg +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/utils/__init__.py +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/utils/loaders.py +0 -0
- {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/utils/styles.py +0 -0
|
@@ -27,6 +27,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
27
27
|
self.setWindowIcon(QtGui.QIcon(os.path.join(os.path.dirname(__file__), 'assets', 'ico', 'toucan-plot.ico')))
|
|
28
28
|
self.resize(900, 600)
|
|
29
29
|
|
|
30
|
+
# Accept drag-and-drop of files onto the window (acts like File -> Open)
|
|
31
|
+
self.setAcceptDrops(True)
|
|
32
|
+
|
|
30
33
|
# central widget and layout
|
|
31
34
|
central = QtWidgets.QWidget()
|
|
32
35
|
self.setCentralWidget(central)
|
|
@@ -1321,6 +1324,45 @@ class MainWindow(QtWidgets.QMainWindow):
|
|
|
1321
1324
|
paths, _ = QtWidgets.QFileDialog.getOpenFileNames(self, 'Open File', '', file_filter)
|
|
1322
1325
|
self.open_files(paths)
|
|
1323
1326
|
|
|
1327
|
+
# --- Drag & drop support: dropping files behaves like File -> Open ---
|
|
1328
|
+
_SUPPORTED_DROP_EXTS = (
|
|
1329
|
+
'.csv', '.smv', '.blf', '.trc', '.asc', '.dbc',
|
|
1330
|
+
'.mf4', '.mf4z', '.feather',
|
|
1331
|
+
)
|
|
1332
|
+
|
|
1333
|
+
def _extract_dropped_paths(self, mime_data):
|
|
1334
|
+
"""Return a list of local file paths from drop mime data with supported extensions."""
|
|
1335
|
+
if mime_data is None or not mime_data.hasUrls():
|
|
1336
|
+
return []
|
|
1337
|
+
paths = []
|
|
1338
|
+
for url in mime_data.urls():
|
|
1339
|
+
if not url.isLocalFile():
|
|
1340
|
+
continue
|
|
1341
|
+
local_path = url.toLocalFile()
|
|
1342
|
+
if os.path.splitext(local_path)[1].lower() in self._SUPPORTED_DROP_EXTS:
|
|
1343
|
+
paths.append(local_path)
|
|
1344
|
+
return paths
|
|
1345
|
+
|
|
1346
|
+
def dragEnterEvent(self, event):
|
|
1347
|
+
if self._extract_dropped_paths(event.mimeData()):
|
|
1348
|
+
event.acceptProposedAction()
|
|
1349
|
+
else:
|
|
1350
|
+
event.ignore()
|
|
1351
|
+
|
|
1352
|
+
def dragMoveEvent(self, event):
|
|
1353
|
+
if self._extract_dropped_paths(event.mimeData()):
|
|
1354
|
+
event.acceptProposedAction()
|
|
1355
|
+
else:
|
|
1356
|
+
event.ignore()
|
|
1357
|
+
|
|
1358
|
+
def dropEvent(self, event):
|
|
1359
|
+
paths = self._extract_dropped_paths(event.mimeData())
|
|
1360
|
+
if paths:
|
|
1361
|
+
event.acceptProposedAction()
|
|
1362
|
+
self.open_files(paths)
|
|
1363
|
+
else:
|
|
1364
|
+
event.ignore()
|
|
1365
|
+
|
|
1324
1366
|
def _to_bool_str(self, value):
|
|
1325
1367
|
return 'true' if bool(value) else 'false'
|
|
1326
1368
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-autofit-height-dark.svg
RENAMED
|
File without changes
|
{toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-autofit-height-light.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|