mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
WeatherParam: SetData targets the object, and no longer the line index in the tab, which reduces the risk of error with multiple QUndoCommand, and rewrite of the logic for the other UndoCommand
This commit is contained in:
1 parent
7b2c276643
commit
516efb64e8
4 files changed
+91
-76
No files matched your search
@@ -102,6 +102,7 @@ class GeometryWindow(PamhyrWindow):
|
||||
self.setup_plots()
|
||||
self.setup_statusbar()
|
||||
self.setup_connections()
|
||||
self.update_meshing_action()
|
||||
|
||||
def setup_table(self):
|
||||
if self._study.is_read_only():
|
||||
@@ -231,7 +232,16 @@ class GeometryWindow(PamhyrWindow):
|
||||
def update_redraw(self):
|
||||
self._update(redraw=True)
|
||||
|
||||
def update_meshing_action(self):
|
||||
enabled = (
|
||||
not self._study.is_read_only()
|
||||
and self._reach.number_profiles > 0
|
||||
)
|
||||
self.find(QAction, "action_meshing").setEnabled(enabled)
|
||||
|
||||
def _update(self, redraw=False, propagate=True):
|
||||
self.update_meshing_action()
|
||||
|
||||
if redraw:
|
||||
self._plot_xy.redraw(data=self._reach)
|
||||
self._plot_rkc.redraw(data=self._reach)
|
||||
@@ -302,6 +312,9 @@ class GeometryWindow(PamhyrWindow):
|
||||
self.tableView.model().blockSignals(False)
|
||||
|
||||
def edit_meshing(self):
|
||||
if self._reach.number_profiles == 0:
|
||||
return
|
||||
|
||||
rows = list(
|
||||
set(
|
||||
(i.row() for i in self.tableView.selectedIndexes())
|
||||
|
||||
Reference in new issue
Block a user