extensionSystem: Show an icon in the install dialog
https://bugzilla.gnome.org/show_bug.cgi?id=676837
This commit is contained in:
parent
96396163cf
commit
3f942302d1
@ -65,7 +65,7 @@ function installExtensionFromUUID(uuid) {
|
|||||||
_httpSession.queue_message(message,
|
_httpSession.queue_message(message,
|
||||||
function(session, message) {
|
function(session, message) {
|
||||||
let info = JSON.parse(message.response_body.data);
|
let info = JSON.parse(message.response_body.data);
|
||||||
let dialog = new InstallExtensionDialog(uuid, info.name);
|
let dialog = new InstallExtensionDialog(uuid, info);
|
||||||
dialog.open(global.get_current_time());
|
dialog.open(global.get_current_time());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -366,11 +366,11 @@ const InstallExtensionDialog = new Lang.Class({
|
|||||||
Name: 'InstallExtensionDialog',
|
Name: 'InstallExtensionDialog',
|
||||||
Extends: ModalDialog.ModalDialog,
|
Extends: ModalDialog.ModalDialog,
|
||||||
|
|
||||||
_init: function(uuid, name) {
|
_init: function(uuid, info) {
|
||||||
this.parent({ styleClass: 'extension-dialog' });
|
this.parent({ styleClass: 'extension-dialog' });
|
||||||
|
|
||||||
this._uuid = uuid;
|
this._uuid = uuid;
|
||||||
this._name = name;
|
this._info = info;
|
||||||
|
|
||||||
this.setButtons([{ label: _("Cancel"),
|
this.setButtons([{ label: _("Cancel"),
|
||||||
action: Lang.bind(this, this._onCancelButtonPressed),
|
action: Lang.bind(this, this._onCancelButtonPressed),
|
||||||
@ -380,13 +380,17 @@ const InstallExtensionDialog = new Lang.Class({
|
|||||||
action: Lang.bind(this, this._onInstallButtonPressed)
|
action: Lang.bind(this, this._onInstallButtonPressed)
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
let message = _("Download and install '%s' from extensions.gnome.org?").format(name);
|
let message = _("Download and install '%s' from extensions.gnome.org?").format(info.name);
|
||||||
|
|
||||||
this._descriptionLabel = new St.Label({ text: message });
|
let box = new St.BoxLayout();
|
||||||
|
this.contentLayout.add(box);
|
||||||
|
|
||||||
this.contentLayout.add(this._descriptionLabel,
|
let gicon = new Gio.FileIcon({ file: Gio.File.new_for_uri(REPOSITORY_URL_BASE + info.icon) })
|
||||||
{ y_fill: true,
|
let icon = new St.Icon({ gicon: gicon });
|
||||||
y_align: St.Align.START });
|
box.add(icon);
|
||||||
|
|
||||||
|
let label = new St.Label({ text: message });
|
||||||
|
box.add(label);
|
||||||
},
|
},
|
||||||
|
|
||||||
_onCancelButtonPressed: function(button, event) {
|
_onCancelButtonPressed: function(button, event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user