diff --git a/CHANGELOG b/CHANGELOG index 7056984df6..ebf7b514ed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Display revision on dialog * Execute report asynchronously * Add support for Python 3.9 * Support empty value for timedelta converter diff --git a/tryton/gui/window/form.py b/tryton/gui/window/form.py index ddaea8933d..0da761c1dd 100644 --- a/tryton/gui/window/form.py +++ b/tryton/gui/window/form.py @@ -278,7 +278,7 @@ class Form(SignalEvent, TabContent): else: label = common.ellipsize(self.name, 80) tooltip = self.name - self.title.set_markup(label) + self.title.set_text(label) tooltips.set_tip(self.title, tooltip) self.set_buttons_sensitive(revision) diff --git a/tryton/gui/window/win_form.py b/tryton/gui/window/win_form.py index 593da5a176..d784e280ff 100644 --- a/tryton/gui/window/win_form.py +++ b/tryton/gui/window/win_form.py @@ -107,11 +107,23 @@ class WinForm(NoModal, InfoBar): self.win.set_title(self.title) + revision = self.screen.context.get('_datetime') + if revision and self.screen.model_name in common.MODELHISTORY: + format_ = self.screen.context.get('date_format', '%x') + format_ += ' %H:%M:%S.%f' + revision_label = ' @ %s' % revision.strftime(format_) + label = common.ellipsize( + self.title, 80 - len(revision_label)) + revision_label + tooltip = self.title + revision_label + else: + label = common.ellipsize(self.title, 80) + tooltip = self.title + title = Gtk.Label( - label=common.ellipsize(self.title, 80), + label=label, halign=Gtk.Align.START, margin=5, ellipsize=Pango.EllipsizeMode.END) - tooltips.set_tip(title, self.title) + tooltips.set_tip(title, tooltip) title.set_size_request(0, -1) # Allow overflow title.show()