Compare commits
2 Commits
citadel
...
wip/fmuell
Author | SHA1 | Date | |
---|---|---|---|
|
ac3b3533d5 | ||
|
087f290ff7 |
@ -374,6 +374,7 @@ StScrollBar {
|
||||
border: 3px solid $_bubble_borders_color;
|
||||
|
||||
.message-dialog-main-layout { spacing: 24px; padding: 10px; }
|
||||
.message-dialog-icon { -st-icon-style: symbolic; }
|
||||
.message-dialog-content { spacing: 16px; }
|
||||
.message-dialog-title { color: darken($osd_fg_color,25%); }
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ var AuthenticationDialog = new Lang.Class({
|
||||
Name: 'AuthenticationDialog',
|
||||
Extends: ModalDialog.ModalDialog,
|
||||
|
||||
_init(actionId, body, cookie, userNames) {
|
||||
_init(actionId, body, cookie, app, userNames) {
|
||||
this.parent({ styleClass: 'prompt-dialog' });
|
||||
|
||||
this.actionId = actionId;
|
||||
@ -44,8 +44,11 @@ var AuthenticationDialog = new Lang.Class({
|
||||
this._group.visible = !Main.sessionMode.isLocked;
|
||||
});
|
||||
|
||||
let icon = new Gio.ThemedIcon({ name: 'dialog-password-symbolic' });
|
||||
let title = _("Authentication Required");
|
||||
let appInfo = app ? app.app_info : null;
|
||||
let icon = appInfo ? appInfo.get_icon()
|
||||
: new Gio.ThemedIcon({ name: 'dialog-password' });
|
||||
let title = appInfo ? _("%s Requires Authentication").format(appInfo.get_name())
|
||||
: _("Authentication Required");
|
||||
|
||||
let content = new Dialog.MessageDialogContent({ icon, title, body });
|
||||
this.contentLayout.add_actor(content);
|
||||
@ -362,6 +365,8 @@ var AuthenticationAgent = new Lang.Class({
|
||||
this._native.connect('initiate', this._onInitiate.bind(this));
|
||||
this._native.connect('cancel', this._onCancel.bind(this));
|
||||
this._sessionUpdatedId = 0;
|
||||
|
||||
this._windowTracker = Shell.WindowTracker.get_default();
|
||||
},
|
||||
|
||||
enable() {
|
||||
@ -380,7 +385,7 @@ var AuthenticationAgent = new Lang.Class({
|
||||
}
|
||||
},
|
||||
|
||||
_onInitiate(nativeAgent, actionId, message, iconName, cookie, userNames) {
|
||||
_onInitiate(nativeAgent, actionId, message, iconName, cookie, subjectPid, userNames) {
|
||||
// Don't pop up a dialog while locked
|
||||
if (Main.sessionMode.isLocked) {
|
||||
this._sessionUpdatedId = Main.sessionMode.connect('updated', () => {
|
||||
@ -392,7 +397,10 @@ var AuthenticationAgent = new Lang.Class({
|
||||
return;
|
||||
}
|
||||
|
||||
this._currentDialog = new AuthenticationDialog(actionId, message, cookie, userNames);
|
||||
let pid = parseInt(subjectPid);
|
||||
let app = pid != NaN ? this._windowTracker.get_app_from_pid(pid) : null;
|
||||
|
||||
this._currentDialog = new AuthenticationDialog(actionId, message, cookie, app, userNames);
|
||||
|
||||
// We actually don't want to open the dialog until we know for
|
||||
// sure that we're going to interact with the user. For
|
||||
|
@ -162,7 +162,8 @@ shell_polkit_authentication_agent_class_init (ShellPolkitAuthenticationAgentClas
|
||||
NULL, /* accumulator data */
|
||||
NULL, /* marshaller */
|
||||
G_TYPE_NONE,
|
||||
5,
|
||||
6,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
@ -267,6 +268,7 @@ auth_request_initiate (AuthRequest *request)
|
||||
request->message,
|
||||
request->icon_name,
|
||||
request->cookie,
|
||||
polkit_details_lookup (request->details, "polkit.subject-pid"),
|
||||
user_names);
|
||||
g_strfreev (user_names);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user