|
38 | 38 | from qgis.PyQt.QtCore import Qt |
39 | 39 |
|
40 | 40 | from ThRasE.core.navigation import Navigation |
41 | | -from ThRasE.gui.navigation_dialog import NavigationDialog |
42 | 41 | from ThRasE.core.registry import Registry |
43 | 42 | from ThRasE.utils.others_utils import get_xml_style |
44 | 43 | from ThRasE.utils.qgis_utils import get_file_path_of_layer, apply_symbology |
@@ -90,7 +89,7 @@ def __init__(self, layer, band): |
90 | 89 | self.bounds = layer.extent().toRectF().getCoords() # (xmin , ymin, xmax, ymax) |
91 | 90 | # navigation |
92 | 91 | self.navigation = Navigation(self) |
93 | | - self.navigation_dialog = NavigationDialog(layer_to_edit=self) |
| 92 | + self.navigation_dialog = None # Created only when navigation is explicitly enabled |
94 | 93 | # store pixels: value, color, new_value, on/off |
95 | 94 | # -> [{"value": int, "color": {"R", "G", "B", "A"}, "new_value": int, "s/h": bool}, ...] |
96 | 95 | self.pixels_backup = None # backup for save the original values |
@@ -488,7 +487,7 @@ def setup_path(_path): |
488 | 487 | # navigation |
489 | 488 | data["navigation"] = {} |
490 | 489 |
|
491 | | - if not ThRasE.dialog.QPBtn_EnableNavigation.isChecked() or not self.navigation.is_valid: |
| 490 | + if self.navigation_dialog is None or not ThRasE.dialog.QPBtn_EnableNavigation.isChecked() or not self.navigation.is_valid: |
492 | 491 | data["navigation"]["type"] = "free" |
493 | 492 | else: |
494 | 493 | data["navigation"]["type"] = self.navigation_dialog.QCBox_BuildNavType.currentText() |
|
0 commit comments