Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jul 10, 2024
1 parent 5d56ff0 commit 1d27f5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/channel_config_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pymmcore_widgets import OpticalConfigDialog

core = CMMCorePlus().instance()
core.loadSystemConfiguration(r"c:\Users\Admin\Desktop\test.cfg")
core.loadSystemConfiguration()
app = QApplication([])
ocd = OpticalConfigDialog()
ocd.load_group("Channel")
Expand Down
9 changes: 6 additions & 3 deletions src/pymmcore_widgets/_oc_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
QVBoxLayout,
QWidget,
)
from superqt.utils import signals_blocked

from pymmcore_widgets._device_property_table import DevicePropertyTable
from pymmcore_widgets._objective_widget import ObjectivesWidget
Expand All @@ -31,6 +32,7 @@ def __init__(
) -> None:
super().__init__(parent)
self._core = mmcore or CMMCorePlus.instance()
self._model = ConfigGroup("")

Check warning on line 35 in src/pymmcore_widgets/_oc_dialog.py

View check run for this annotation

Codecov / codecov/patch

src/pymmcore_widgets/_oc_dialog.py#L33-L35

Added lines #L33 - L35 were not covered by tests

self.groups = QComboBox(self)
self.groups.addItems(self._core.getAvailableConfigGroups())
Expand Down Expand Up @@ -154,9 +156,10 @@ def _activate_oc(self) -> None:
def load_group(self, group: str) -> None:
self.groups.setCurrentText(group)

Check warning on line 157 in src/pymmcore_widgets/_oc_dialog.py

View check run for this annotation

Codecov / codecov/patch

src/pymmcore_widgets/_oc_dialog.py#L157

Added line #L157 was not covered by tests

self._name_list.clear()
for n in self._core.getAvailableConfigs(group):
self._add_editable_item(n)
with signals_blocked(self._name_list):
self._name_list.clear()
for n in self._core.getAvailableConfigs(group):
self._add_editable_item(n)

Check warning on line 162 in src/pymmcore_widgets/_oc_dialog.py

View check run for this annotation

Codecov / codecov/patch

src/pymmcore_widgets/_oc_dialog.py#L159-L162

Added lines #L159 - L162 were not covered by tests

self._model = ConfigGroup.create_from_core(self._core, group)
self._name_list.setCurrentRow(0)

Check warning on line 165 in src/pymmcore_widgets/_oc_dialog.py

View check run for this annotation

Codecov / codecov/patch

src/pymmcore_widgets/_oc_dialog.py#L164-L165

Added lines #L164 - L165 were not covered by tests
Expand Down

0 comments on commit 1d27f5e

Please sign in to comment.