extensions-app: Indicate extension errors
Currently there is no indication that an extension had an error except for the sensitivity of the switch (which may have a different cause). This is useful information to users, so add a small error indicator alongside the updates icon and show the actual error in the details. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2337
This commit is contained in:
parent
48e6a58250
commit
9cad7ae975
@ -8,4 +8,5 @@
|
|||||||
-gtk-icon-transform: rotate(-0.25turn);
|
-gtk-icon-transform: rotate(-0.25turn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
image.error { color: @error_color; }
|
||||||
image.warning { color: @warning_color; }
|
image.warning { color: @warning_color; }
|
||||||
|
@ -15,6 +15,15 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImage" id="errorIcon">
|
||||||
|
<property name="no_show_all">True</property>
|
||||||
|
<property name="icon_name">dialog-error-symbolic</property>
|
||||||
|
<style>
|
||||||
|
<class name="error"/>>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkImage" id="updatesIcon">
|
<object class="GtkImage" id="updatesIcon">
|
||||||
<property name="no_show_all">True</property>
|
<property name="no_show_all">True</property>
|
||||||
@ -169,6 +178,38 @@
|
|||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel">
|
||||||
|
<property name="visible"
|
||||||
|
bind-source="errorLabel"
|
||||||
|
bind-property="visible"
|
||||||
|
bind-flags="sync-create"/>
|
||||||
|
<property name="no_show_all">True</property>
|
||||||
|
<property name="label" translatable="yes">Error</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="yalign">0</property>
|
||||||
|
<style>
|
||||||
|
<class name="dim-label"/>
|
||||||
|
</style>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">0</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="errorLabel">
|
||||||
|
<property name="no_show_all">True</property>
|
||||||
|
<property name="selectable">True</property>
|
||||||
|
<property name="wrap">True</property>
|
||||||
|
<property name="max_width_chars">60</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton">
|
<object class="GtkButton">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@ -179,7 +220,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">3</property>
|
<property name="top_attach">4</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@ -200,7 +241,7 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
<property name="top_attach">3</property>
|
<property name="top_attach">4</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@ -209,7 +250,7 @@
|
|||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="width">7</property>
|
<property name="width">8</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
@ -331,6 +331,8 @@ var ExtensionRow = GObject.registerClass({
|
|||||||
'descriptionLabel',
|
'descriptionLabel',
|
||||||
'versionLabel',
|
'versionLabel',
|
||||||
'authorLabel',
|
'authorLabel',
|
||||||
|
'errorLabel',
|
||||||
|
'errorIcon',
|
||||||
'updatesIcon',
|
'updatesIcon',
|
||||||
'switch',
|
'switch',
|
||||||
'revealButton',
|
'revealButton',
|
||||||
@ -429,6 +431,12 @@ var ExtensionRow = GObject.registerClass({
|
|||||||
return this._extension.hasUpdate || false;
|
return this._extension.hasUpdate || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hasError() {
|
||||||
|
const { state } = this._extension;
|
||||||
|
return state === ExtensionState.OUT_OF_DATE ||
|
||||||
|
state === ExtensionState.ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
get type() {
|
get type() {
|
||||||
return this._extension.type;
|
return this._extension.type;
|
||||||
}
|
}
|
||||||
@ -445,6 +453,17 @@ var ExtensionRow = GObject.registerClass({
|
|||||||
return this._extension.metadata.version || '';
|
return this._extension.metadata.version || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get error() {
|
||||||
|
if (!this.hasError)
|
||||||
|
return '';
|
||||||
|
|
||||||
|
if (this._extension.state === ExtensionState.OUT_OF_DATE)
|
||||||
|
return _('The extension is incompatible with the current GNOME version');
|
||||||
|
|
||||||
|
return this._extension.error
|
||||||
|
? this._extension.error : _('The extension had an error');
|
||||||
|
}
|
||||||
|
|
||||||
_updateState() {
|
_updateState() {
|
||||||
let state = this._extension.state === ExtensionState.ENABLED;
|
let state = this._extension.state === ExtensionState.ENABLED;
|
||||||
|
|
||||||
@ -456,6 +475,10 @@ var ExtensionRow = GObject.registerClass({
|
|||||||
this._switch.active = state;
|
this._switch.active = state;
|
||||||
|
|
||||||
this._updatesIcon.visible = this.hasUpdate;
|
this._updatesIcon.visible = this.hasUpdate;
|
||||||
|
this._errorIcon.visible = this.hasError;
|
||||||
|
|
||||||
|
this._errorLabel.label = this.error;
|
||||||
|
this._errorLabel.visible = this.error !== '';
|
||||||
|
|
||||||
this._versionLabel.label = this.version.toString();
|
this._versionLabel.label = this.version.toString();
|
||||||
this._versionLabel.visible = this.version !== '';
|
this._versionLabel.visible = this.version !== '';
|
||||||
|
Loading…
Reference in New Issue
Block a user