extensionPrefs: Avoid a runtime warning
Since 5b3fb024be
, the main window is only shown when not launched
with a valid UUID. As GtkDialog isn't meant to be used standalone,
we currently trigger a (harmless but annoying) warning in case
the main window isn't shown; we can avoid the warning by setting
up the preference dialog manually instead of using the GtkDialog
convenience class.
https://bugzilla.gnome.org/show_bug.cgi?id=781545
This commit is contained in:
parent
c7a8c372a1
commit
b0fa5e5696
@ -5,6 +5,7 @@ const GLib = imports.gi.GLib;
|
|||||||
const GObject = imports.gi.GObject;
|
const GObject = imports.gi.GObject;
|
||||||
const Gio = imports.gi.Gio;
|
const Gio = imports.gi.Gio;
|
||||||
const Gtk = imports.gi.Gtk;
|
const Gtk = imports.gi.Gtk;
|
||||||
|
const Gdk = imports.gi.Gdk;
|
||||||
const Pango = imports.gi.Pango;
|
const Pango = imports.gi.Pango;
|
||||||
const Format = imports.format;
|
const Format = imports.format;
|
||||||
|
|
||||||
@ -92,9 +93,11 @@ const Application = new Lang.Class({
|
|||||||
widget = this._buildErrorUI(extension, e);
|
widget = this._buildErrorUI(extension, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
let dialog = new Gtk.Dialog({ use_header_bar: true,
|
let dialog = new Gtk.Window({ modal: !this._skipMainWindow,
|
||||||
modal: true,
|
type_hint: Gdk.WindowTypeHint.DIALOG });
|
||||||
title: extension.metadata.name });
|
dialog.set_titlebar(new Gtk.HeaderBar({ show_close_button: true,
|
||||||
|
title: extension.metadata.name,
|
||||||
|
visible: true }));
|
||||||
|
|
||||||
if (this._skipMainWindow) {
|
if (this._skipMainWindow) {
|
||||||
this.application.add_window(dialog);
|
this.application.add_window(dialog);
|
||||||
@ -107,7 +110,7 @@ const Application = new Lang.Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
dialog.set_default_size(600, 400);
|
dialog.set_default_size(600, 400);
|
||||||
dialog.get_content_area().add(widget);
|
dialog.add(widget);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user