Fix set_cursor if there is not model

This commit is contained in:
Cédric Krier committed 2008-06-02 12:37:51 +02:00
1 parent fcfb8b1989
commit 53685c3b26
1 file changed
+9 -8
+9 -8
View File
@@ -205,15 +205,16 @@ class ViewForm(ParserView):
model = self.screen.current_model
position = len(self.widgets)
focus_widget = None
for widget in self.widgets.values():
modelfield = model.mgroup.mfields.get(widget.widget_name, None)
if not modelfield:
continue
if not modelfield.get_state_attrs(model).get('valid', True):
if widget.widget.position >= position:
if model:
for widget in self.widgets.values():
modelfield = model.mgroup.mfields.get(widget.widget_name, None)
if not modelfield:
continue
position = widget.widget.position
focus_widget = widget
if not modelfield.get_state_attrs(model).get('valid', True):
if widget.widget.position >= position:
continue
position = widget.widget.position
focus_widget = widget
if focus_widget:
for notebook in self.notebooks:
for i in range(notebook.get_n_pages()):