X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fgnome-ask-password-agent.vala;h=e23aedbfee435e22b1db545a742e4cd091b82920;hp=84f25497309b97c905851839b9d35371230d556e;hb=071fd8c21eb43f9e465309304c6072ba45ee8dd1;hpb=26742b3fd8776c6c64e3c1035adc2599ddeb76d1 diff --git a/src/gnome-ask-password-agent.vala b/src/gnome-ask-password-agent.vala index 84f254973..e23aedbfe 100644 --- a/src/gnome-ask-password-agent.vala +++ b/src/gnome-ask-password-agent.vala @@ -37,13 +37,8 @@ public class PasswordDialog : Dialog { set_default_response(ResponseType.OK); set_icon_name(icon); -#if LIBNOTIFY07 add_button(Stock.CANCEL, ResponseType.CANCEL); add_button(Stock.OK, ResponseType.OK); -#else - add_button(STOCK_CANCEL, ResponseType.CANCEL); - add_button(STOCK_OK, ResponseType.OK); -#endif Container content = (Container) get_content_area(); @@ -89,9 +84,9 @@ public class MyStatusIcon : StatusIcon { public MyStatusIcon() throws GLib.Error { GLib.Object(icon_name : "dialog-password"); - set_title("System Password"); + set_title("System Password Request"); - directory = File.new_for_path("/dev/.systemd/ask-password/"); + directory = File.new_for_path("/run/systemd/ask-password/"); file_monitor = directory.monitor_directory(0); file_monitor.changed.connect(file_monitor_changed); @@ -145,7 +140,6 @@ public class MyStatusIcon : StatusIcon { if (current == null) set_visible(false); - } bool load_password() throws GLib.Error { @@ -166,7 +160,7 @@ public class MyStatusIcon : StatusIcon { if (not_after_as_string.scanf("%llu", out not_after) != 1) return false; - if (not_after < now) + if (not_after > 0 && not_after < now) return false; socket = key_file.get_string("Ask", "Socket"); @@ -179,6 +173,7 @@ public class MyStatusIcon : StatusIcon { } catch (GLib.Error e) { message = "Please Enter System Password!"; } + set_tooltip_text(message); try { @@ -190,12 +185,7 @@ public class MyStatusIcon : StatusIcon { set_visible(true); -#if LIBNOTIFY07 Notification n = new Notification(title, message, icon); -#else - Notification n = new Notification(title, message, icon, null); - n.attach_to_status_icon(this); -#endif n.set_timeout(5000); n.show(); @@ -239,8 +229,7 @@ public class MyStatusIcon : StatusIcon { null); OutputStream stream = new UnixOutputStream(to_process, true); - -#if LIBNOTIFY07 +#if VALA_0_12 stream.write(password.data, null); #else stream.write(password, password.length, null);