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.
Files changed (33) hide show
  1. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/PKG-INFO +1 -1
  2. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/pyproject.toml +1 -1
  3. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/main.py +42 -0
  4. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/README.md +0 -0
  5. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/__init__.py +0 -0
  6. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/__main__.py +0 -0
  7. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/adjustments-dark.svg +0 -0
  8. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/adjustments-light.svg +0 -0
  9. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-autofit-height-dark.svg +0 -0
  10. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-autofit-height-light.svg +0 -0
  11. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-narrow-left-dark.svg +0 -0
  12. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-narrow-left-light.svg +0 -0
  13. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-narrow-right-dark.svg +0 -0
  14. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/arrow-narrow-right-light.svg +0 -0
  15. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/device-floppy-dark.svg +0 -0
  16. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/device-floppy-light.svg +0 -0
  17. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/hand-stop-dark.svg +0 -0
  18. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/hand-stop-light.svg +0 -0
  19. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/home-dark.svg +0 -0
  20. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/home-light.svg +0 -0
  21. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/ico/toucan-plot.ico +0 -0
  22. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/ico/toucan-plot.png +0 -0
  23. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/layout-grid-add-dark.svg +0 -0
  24. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/layout-grid-add-light.svg +0 -0
  25. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/math-function-dark.svg +0 -0
  26. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/math-function-light.svg +0 -0
  27. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/ruler-measure-dark.svg +0 -0
  28. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/ruler-measure-light.svg +0 -0
  29. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/zoom-dark.svg +0 -0
  30. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/assets/zoom-light.svg +0 -0
  31. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/utils/__init__.py +0 -0
  32. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/utils/loaders.py +0 -0
  33. {toucan_plot-0.5.2 → toucan_plot-0.6.0}/src/toucan_plot/utils/styles.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: toucan-plot
3
- Version: 0.5.2
3
+ Version: 0.6.0
4
4
  Summary: A versatile PySide6 and Matplotlib-based plotting tool for CSV and SMV data files.
5
5
  License-Expression: MIT
6
6
  Requires-Dist: pyside6>=6.0
@@ -4,7 +4,7 @@ requires = ["uv-build>=0.11.14,<0.12"]
4
4
 
5
5
  [project]
6
6
  name = "toucan-plot"
7
- version = "0.5.2"
7
+ version = "0.6.0"
8
8
  requires-python = ">=3.13"
9
9
  description = "A versatile PySide6 and Matplotlib-based plotting tool for CSV and SMV data files."
10
10
  license = "MIT"
@@ -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