Push_modal failure tentative four...

master
xSmurf 7 years ago
parent a739a92eb4
commit 9131da5623

@ -527,8 +527,7 @@ const PromptDialog = new Lang.Class({
Name: 'PromptDialog', Name: 'PromptDialog',
Extends: ModalDialog.ModalDialog, Extends: ModalDialog.ModalDialog,
_init: function(invocation, pid_known, sandboxed, tlsguard, cbClose) { _init: function(invocation, pid_known, sandboxed, tlsguard) {
this.cbClose = cbClose;
this.parent({ styleClass: 'fw-prompt-dialog' }); this.parent({ styleClass: 'fw-prompt-dialog' });
this._invocation = invocation; this._invocation = invocation;
this.header = new PromptDialogHeader(); this.header = new PromptDialogHeader();
@ -603,17 +602,11 @@ const PromptDialog = new Lang.Class({
}, },
onAllow: function() { onAllow: function() {
//if (this.cbClose !== undefined && this.cbClose !== null) {
// this.cbClose();
//}
this.close(); this.close();
this.sendReturnValue(true); this.sendReturnValue(true);
}, },
onDeny: function() { onDeny: function() {
//if (this.cbClose !== undefined && this.cbClose !== null) {
// this.cbClose();
//}
this.close(); this.close();
this.sendReturnValue(false); this.sendReturnValue(false);
}, },

@ -6,6 +6,7 @@ const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Extension = imports.misc.extensionUtils.getCurrentExtension(); const Extension = imports.misc.extensionUtils.getCurrentExtension();
const Convenience = Extension.imports.convenience; const Convenience = Extension.imports.convenience;
@ -176,14 +177,16 @@ const FirewallPromptHandler = new Lang.Class({
try { try {
let params = this._dialogs.shift(); let params = this._dialogs.shift();
let [app, icon, path, address, port, ip, origin, proto, uid, gid, user, group, pid, sandbox, tlsguard, optstring, expanded, expert, action, invocation] = params; let [app, icon, path, address, port, ip, origin, proto, uid, gid, user, group, pid, sandbox, tlsguard, optstring, expanded, expert, action, invocation] = params;
let cbfn = function(self) {
return function() { return self.onCloseDialog(); }
}(this)
this._dialog = new Dialog.PromptDialog(invocation, (pid >= 0), (sandbox != ""), tlsguard, cbfn); this._dialog = new Dialog.PromptDialog(invocation, (pid >= 0), (sandbox != ""), tlsguard);
this._dialog.update(app, icon, path, address, port, ip, origin, uid, gid, user, group, pid, proto, tlsguard, optstring, sandbox, expanded, expert, action); this._dialog.update(app, icon, path, address, port, ip, origin, uid, gid, user, group, pid, proto, tlsguard, optstring, sandbox, expanded, expert, action);
this._dialog.connect("closed", Lang.bind(this, this.onCloseDialog)); this._dialog.connect("closed", Lang.bind(this, this.onCloseDialog));
this._dialog.open(); let dio = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 100, Lang.bind(this, function() {
if (this._dialog.open()) {
GLib.source_remove(dio);
dio = null;
}
}));
} catch (err) { } catch (err) {
log("SGFW: Error while creating prompt: " + err); log("SGFW: Error while creating prompt: " + err);
} }

Loading…
Cancel
Save