gnome-ask-password-agent.vala revision bb29785e0df6a7cf07db0259a60bc1f3b4814cb4
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
public class PasswordDialog : Dialog {
set_title("System Password");
set_has_separator(false);
set_border_width(8);
#if LIBNOTIFY07
#else
entry.set_visibility(false);
entry.set_activates_default(true);
show_all();
}
public void on_entry_activated() {
}
}
public class MyStatusIcon : StatusIcon {
set_title("System Password Request");
}
void file_monitor_changed(GLib.File file, GLib.File? other_file, GLib.FileMonitorEvent event_type) {
return;
try {
} catch (Error e) {
show_error(e.message);
}
}
}
if (!current.query_exists()) {
if (password_dialog != null)
}
}
FileEnumerator enumerator = directory.enumerate_children("standard::name", FileQueryInfoFlags.NOFOLLOW_SYMLINKS);
FileInfo i;
continue;
if (load_password())
break;
}
}
set_visible(false);
}
try {
return false;
return false;
return false;
}
try {
message = "Please Enter System Password!";
}
try {
icon = "dialog-password";
}
set_visible(true);
#if LIBNOTIFY07
#else
n.attach_to_status_icon(this);
n.set_timeout(5000);
n.show();
return true;
}
void status_icon_activate() {
return;
if (password_dialog != null) {
return;
}
return;
int to_process;
try {
null,
{ "/usr/bin/pkexec", "/lib/systemd/systemd-reply-password", result == ResponseType.OK ? "1" : "0", socket },
null,
0,
null,
null,
null,
null);
#if VALA_0_12
#else
} catch (Error e) {
show_error(e.message);
}
}
}
static const OptionEntry entries[] = {
{ null }
};
void show_error(string e) {
m.run();
m.destroy();
}
try {
MyStatusIcon i = new MyStatusIcon();
show_error(e.message);
}
return 0;
}