[polari] RoomList: Set accessible name for RoomListHeader



commit e4785d06c944501c344e56467643aea220a788a4
Author: Bastian Ilsø <bastianilso src gnome org>
Date:   Tue Sep 1 22:16:05 2015 +0200

    RoomList: Set accessible name for RoomListHeader
    
    Set an accessibility string for the RoomListHeader
    to make it more obvious that the connection
    encountered an error.

 src/roomList.js |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/roomList.js b/src/roomList.js
index 40ff90a..3feb244 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -165,13 +165,21 @@ const RoomListHeader = new Lang.Class({
                 this._errorPopover.hide();
             }));
 
-        this._account.bind_property('display-name', this._label, 'label',
-                                    GObject.BindingFlags.SYNC_CREATE);
+        this._account.connect('notify::display-name',
+                              Lang.bind(this, this._onDisplayNameChanged));
+        this._onDisplayNameChanged();
+
         this._account.connect('notify::connection-status',
                               Lang.bind(this, this._updateConnectionStatusIcon));
         this._updateConnectionStatusIcon();
     },
 
+    _onDisplayNameChanged: function() {
+        this._label.label = this._account.display_name;
+        let accessibleName = _("Connection %s has an error").format(this._account.display_name);
+        this.get_accessible().set_name(accessibleName);
+    },
+
     _updateConnectionStatusIcon: function() {
         let status = this._account.connection_status;
         let reason = this._account.connection_status_reason;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]