Update label of window form only if it exists

The update of label was introduced in 89834116fe97 but the label is defined
only when the window form is created with the view type tree.

Closes #13994
This commit is contained in:
Cédric Krier
2025-04-30 17:22:58 +02:00
parent 581ffa80fa
commit 39ddf8b838
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -416,7 +416,9 @@
}
}
let message = name + '/' + Sao.common.humanize(size);
this.label.text(message).attr('title', message);
if (this.label) {
this.label.text(message).attr('title', message);
}
this._set_button_sensitive();
},
record_modified: function() {
+2 -1
View File
@@ -365,7 +365,8 @@ class WinForm(NoModal, InfoBar):
if selected > 1:
name += '#%i' % selected
name = '(%s/%s)' % (name, common.humanize(size))
self.label.set_text(name)
if hasattr(self, 'label'):
self.label.set_text(name)
self._set_button_sensitive()
def record_modified(self, *args):