From 06c4ce60b971180c6204a875c3570a706ce957ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sun, 29 Apr 2018 23:47:30 +0200 Subject: [PATCH] Show correct account lable in tooltip Fixes #9065 --- gajim/common/helpers.py | 9 +++++++-- gajim/tooltips.py | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gajim/common/helpers.py b/gajim/common/helpers.py index 0ff4dcbe5..b460c4517 100644 --- a/gajim/common/helpers.py +++ b/gajim/common/helpers.py @@ -1247,8 +1247,13 @@ def get_accounts_info(): message = message.strip() if message != '': single_line += ': ' + message - accounts.append({'name': account, 'status_line': single_line, - 'show': status, 'message': message}) + account_label = app.config.get_per( + 'accounts', account, 'account_label') + accounts.append({'name': account, + 'account_label': account_label or account, + 'status_line': single_line, + 'show': status, + 'message': message}) return accounts def get_current_show(account): diff --git a/gajim/tooltips.py b/gajim/tooltips.py index f6116ee8d..bad2f21e1 100644 --- a/gajim/tooltips.py +++ b/gajim/tooltips.py @@ -150,11 +150,11 @@ class NotificationAreaTooltip(StatusTable): show_lock = False if message: self.add_status_row(file_path, acct['show'], - GLib.markup_escape_text(acct['name']) + ' - ' + message, + GLib.markup_escape_text(acct['account_label']) + ' - ' + message, show_lock=show_lock, indent=False) else: self.add_status_row(file_path, acct['show'], - GLib.markup_escape_text(acct['name']), show_lock=show_lock, + GLib.markup_escape_text(acct['account_label']), show_lock=show_lock, indent=False) for line in acct['event_lines']: self.add_text_row(' ' + line, 1)