[gnome-shell/benzea/systemd-user-units: 4/12] extensionPrefs: Add ability to warn about extensions being disabled
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/benzea/systemd-user-units: 4/12] extensionPrefs: Add ability to warn about extensions being disabled
- Date: Fri, 2 Aug 2019 09:20:19 +0000 (UTC)
commit 426ae8641088f77217388b9aa2aa33663d4ec950
Author: Benjamin Berg <bberg redhat com>
Date: Mon Apr 15 11:39:50 2019 +0200
extensionPrefs: Add ability to warn about extensions being disabled
If we disable extensions after a gnome-shell failure, then we should
warn the user about this happening. The old concept was to do so in the
fail-whale, but we can't even show the fail-whale when running on
wayland.
Adding this option allows starting up the preference dialog on the next
log in and telling the user what happened then. This means we can both
tell the user what is going on and enable them to solve the issue at the
same time.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/507
js/extensionPrefs/main.js | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
---
diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js
index d8c51bfa5..158ab1a5b 100644
--- a/js/extensionPrefs/main.js
+++ b/js/extensionPrefs/main.js
@@ -216,10 +216,33 @@ var Application = GObject.registerClass({
Gio.SettingsBindFlags.DEFAULT |
Gio.SettingsBindFlags.INVERT_BOOLEAN);
+ let vbox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL });
+ this._window.add(vbox);
+
+ this.disabledInfobar = new Gtk.InfoBar({
+ message_type: Gtk.MessageType.ERROR,
+ revealed: false,
+ show_close_button: true
+ });
+ this.disabledInfobar.connect('response', () => {
+ this.disabledInfobar.revealed = false;
+ });
+ let contentArea = this.disabledInfobar.get_content_area();
+ let label = new Gtk.Label({
+ label: _('A problem was detected and extensions were automatically disabled. It is recommended
to disable or reconfigure any extensions that may have caused the issue before re-enabling them at the top.'),
+ ellipsize: Pango.EllipsizeMode.END,
+ wrap: true,
+ lines: 2,
+ xalign: 0,
+ margin: 6
+ });
+ contentArea.add(label);
+ vbox.add(this.disabledInfobar);
+
this._mainStack = new Gtk.Stack({
transition_type: Gtk.StackTransitionType.CROSSFADE
});
- this._window.add(this._mainStack);
+ vbox.add(this._mainStack);
let scroll = new Gtk.ScrolledWindow({ hscrollbar_policy: Gtk.PolicyType.NEVER });
@@ -335,6 +358,14 @@ var Application = GObject.registerClass({
let args = commandLine.get_arguments();
if (args.length) {
+ if (args[0] == '--disabled-warning') {
+ if (!this._settings.is_writable('disable-user-extensions'))
+ this.quit();
+
+ this.disabledInfobar.set_revealed(true);
+ return 0;
+ }
+
let uuid = args[0];
this._skipMainWindow = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]