diff --git a/Orange/widgets/utils/owlearnerwidget.py b/Orange/widgets/utils/owlearnerwidget.py index 8b9e5a44af7..02028917b03 100644 --- a/Orange/widgets/utils/owlearnerwidget.py +++ b/Orange/widgets/utils/owlearnerwidget.py @@ -199,6 +199,16 @@ def settings_changed(self, *args, **kwargs): self.Warning.outdated_learner(shown=not self.auto_apply) self.apply() + def _change_name(self, instance, signal_name): + if instance: + instance.name = self.learner_name + if self.auto_apply: + self.send(signal_name, instance) + + def learner_name_changed(self): + self._change_name(self.learner, "Learner") + self._change_name(self.model, self.OUTPUT_MODEL_NAME) + def send_report(self): self.report_items((("Name", self.learner_name),)) @@ -227,7 +237,7 @@ def add_learner_name_widget(self): self.name_line_edit = gui.lineEdit( self.controlArea, self, 'learner_name', box='Name', tooltip='The name will identify this model in other widgets', - orientation=Qt.Horizontal, callback=lambda: self.apply()) + orientation=Qt.Horizontal, callback=self.learner_name_changed) def add_bottom_buttons(self): box = gui.hBox(self.controlArea, True)