Commit 243868f2 authored by Florian Müllner's avatar Florian Müllner Committed by Bastian Ilsø Hougaard

accounts: Add PolariAccount:visible property

Ever since we removed the separate connections dialog in favor of
the room list header popovers in commit 263ff952, it has not been
possible to enable or disable accounts from Polari itself. We would
like to re-expose that functionality again, but nowadays we also
use the disable mechanism to implement undo for account removals.
So in order to "free" the :enabled property, add a separate :visible
property that will be used to show or hide accounts from the UI.

https://bugzilla.gnome.org/show_bug.cgi?id=771889
parent 0201af4f
...@@ -158,6 +158,31 @@ class ClientFactory extends Polari.ClientFactory { ...@@ -158,6 +158,31 @@ class ClientFactory extends Polari.ClientFactory {
} }
}); });
const PolariAccount = GObject.registerClass( const PolariAccount = GObject.registerClass({
class PolariAccount extends Tp.Account { Properties: {
visible: GObject.ParamSpec.boolean('visible',
'visible',
'visible',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.EXPLICIT_NOTIFY,
true)
}
}, class PolariAccount extends Tp.Account {
_init(params) {
this._visible = true;
super._init(params);
}
get visible() {
return this._visible;
}
set visible(value) {
if (this._visible == value)
return;
this._visible = value;
this.notify('visible');
}
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment