View | Details | Raw Unified | Return to bug 55932
Collapse All | Expand All

(-)a/js/ui/status/network.js (-7 / +14 lines)
Lines 1375-1381 const NMVpnConnectionItem = GObject.registerClass({ Link Here
1375
1375
1376
const NMToggle = GObject.registerClass({
1376
const NMToggle = GObject.registerClass({
1377
    Signals: {
1377
    Signals: {
1378
        'activation-failed': {},
1378
        'activation-failed': {
1379
            param_types: [GObject.TYPE_INT],
1380
        },
1379
    },
1381
    },
1380
}, class NMToggle extends QuickMenuToggle {
1382
}, class NMToggle extends QuickMenuToggle {
1381
    constructor() {
1383
    constructor() {
Lines 1614-1620 class NMVpnToggle extends NMToggle { Link Here
1614
1616
1615
        const item = new NMVpnConnectionItem(this, connection);
1617
        const item = new NMVpnConnectionItem(this, connection);
1616
        item.connectObject(
1618
        item.connectObject(
1617
            'activation-failed', () => this.emit('activation-failed'),
1619
            'activation-failed', () => this.emit('activation-failed', NM.DeviceStateReason.NONE),
1618
            this);
1620
            this);
1619
        this._addItem(connection, item);
1621
        this._addItem(connection, item);
1620
1622
Lines 1731-1737 class NMDeviceToggle extends NMToggle { Link Here
1731
           cancelled the agent dialog */
1733
           cancelled the agent dialog */
1732
        if (newState === NM.DeviceState.FAILED &&
1734
        if (newState === NM.DeviceState.FAILED &&
1733
            reason !== NM.DeviceStateReason.NO_SECRETS)
1735
            reason !== NM.DeviceStateReason.NO_SECRETS)
1734
            this.emit('activation-failed');
1736
            this.emit('activation-failed', reason);
1735
    }
1737
    }
1736
1738
1737
    _createDeviceMenuItem(_device) {
1739
    _createDeviceMenuItem(_device) {
Lines 2098-2104 class Indicator extends SystemIndicator { Link Here
2098
2100
2099
        this.quickSettingsItems.forEach(toggle => {
2101
        this.quickSettingsItems.forEach(toggle => {
2100
            toggle.connectObject(
2102
            toggle.connectObject(
2101
                'activation-failed', () => this._onActivationFailed(),
2103
                'activation-failed', (_, reason) => this._onActivationFailed(reason),
2102
                this);
2104
                this);
2103
        });
2105
        });
2104
2106
Lines 2162-2175 class Indicator extends SystemIndicator { Link Here
2162
        }
2164
        }
2163
    }
2165
    }
2164
2166
2165
    _onActivationFailed() {
2167
    _onActivationFailed(reason) {
2166
        this._notification?.destroy();
2168
        this._notification?.destroy();
2167
2169
2168
        const source = MessageTray.getSystemSource();
2170
        const source = MessageTray.getSystemSource();
2169
        this._notification = new MessageTray.Notification({
2171
        this._notification = new MessageTray.Notification({
2170
            source,
2172
            source,
2171
            title: _('Connection failed'),
2173
            title: _('Connection failed'),
2172
            body: _('Activation of network connection failed'),
2174
            body: this._reasonToLocalizedString(reason),
2173
            iconName: 'network-error-symbolic',
2175
            iconName: 'network-error-symbolic',
2174
            urgency: MessageTray.Urgency.HIGH,
2176
            urgency: MessageTray.Urgency.HIGH,
2175
            isTransient: true,
2177
            isTransient: true,
Lines 2180-2185 class Indicator extends SystemIndicator { Link Here
2180
        source.addNotification(this._notification);
2182
        source.addNotification(this._notification);
2181
    }
2183
    }
2182
2184
2185
    _reasonToLocalizedString(reason) {
2186
        if (reason === NM.DeviceStateReason.IP_CONFIG_UNAVAILABLE)
2187
            return _('IP configuration failed');
2188
        return _('Activation of network connection failed');
2189
    }
2190
2183
    _syncMainConnection() {
2191
    _syncMainConnection() {
2184
        this._mainConnection?.disconnectObject(this);
2192
        this._mainConnection?.disconnectObject(this);
2185
2193
2186
- 

Return to bug 55932