Skip to content
Snippets Groups Projects
Commit cc69073f authored by Thomas Holene Løkkeborg's avatar Thomas Holene Løkkeborg
Browse files

#54 inline edit view is now notified on reorg of SOI

parent 7f50e7e7
No related branches found
No related tags found
1 merge request!28#54 Rectpack for reorganisering av moduler + litt black
Pipeline #74129 passed
......@@ -35,12 +35,14 @@ class InlineEditableSOIView(QScrollArea):
"""Reorganize modules when pressed.
This is a temporary way to activate reorganization of widgets. Note
that will not be triggered by clicks on modules in the scene
"""
self.reorganize_soi_and_update_pages()
that will not be triggered by clicks on modules in the scene.
def reorganize_soi_and_update_pages(self):
"""Reorganize SOI and update pages in one go."""
If reorganization cannot occur because a module is too large the user
will be informed. It's worth noting that with the current
implementation this is the only way the user will be informed of this,
so reorganization that is not triggered here will not give feedback to
the user.
"""
try:
self.soi.reorganize()
except ModuleLargerThanBinError:
......@@ -51,7 +53,6 @@ class InlineEditableSOIView(QScrollArea):
"for deg. Se igjennom modulene og sjekk at "
"alle moduler er mindre enn én enkelt side.",
)
self.update_pages()
def __init__(self, soi):
super().__init__()
......@@ -74,6 +75,9 @@ class InlineEditableSOIView(QScrollArea):
self.ensure_proxies()
self.update_pages()
# update pages after SOI is reorganized
self.soi.add_reorganization_listener(self.update_pages)
# self.launch_auto_zoom()
def produce_pdf(self, filename):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment