summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-09-17 02:32:48 +0200
committerLennart Poettering <lennart@poettering.net>2010-09-17 02:32:48 +0200
commitefb3237ee69bc593b11bc828791ee48ba6cc4f5c (patch)
tree18000ae417b4d437a8b9b350e9ea382387b33856 /src
parentad6ab0af1ed38e342aeeae1c5f7c1503fab11935 (diff)
ask-password: popup notification when we ask for a password
Diffstat (limited to 'src')
-rw-r--r--src/ask-password-agent.vala12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ask-password-agent.vala b/src/ask-password-agent.vala
index 5355bb4694..1523e2e3be 100644
--- a/src/ask-password-agent.vala
+++ b/src/ask-password-agent.vala
@@ -22,6 +22,7 @@ using GLib;
using DBus;
using Linux;
using Posix;
+using Notify;
[CCode (cheader_filename = "time.h")]
extern int clock_gettime(int id, out timespec ts);
@@ -84,7 +85,7 @@ public class MyStatusIcon : StatusIcon {
public MyStatusIcon() throws GLib.Error {
GLib.Object(icon_name : "dialog-password");
- set_title("System Password Agent");
+ set_title("System Password");
directory = File.new_for_path("/dev/.systemd/ask-password/");
file_monitor = directory.monitor_directory(0);
@@ -138,7 +139,7 @@ public class MyStatusIcon : StatusIcon {
}
- bool load_password() {
+ bool load_password() throws GLib.Error {
KeyFile key_file = new KeyFile();
@@ -179,6 +180,12 @@ public class MyStatusIcon : StatusIcon {
set_from_icon_name(icon);
set_visible(true);
+
+ Notification n = new Notification(title, message, icon, null);
+ n.attach_to_status_icon(this);
+ n.set_timeout(5000);
+ n.show();
+
return true;
}
@@ -236,6 +243,7 @@ void show_error(string e) {
int main(string[] args) {
try {
Gtk.init_with_args(ref args, "[OPTION...]", entries, "systemd-ask-password-agent");
+ Notify.init("Password Agent");
MyStatusIcon i = new MyStatusIcon();
Gtk.main();