mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-11-23 23:10:57 +07:00
remove GTK pieces
They've moved to systemd-ui.
This commit is contained in:
parent
5ebff53375
commit
ee4cbc2c85
58
Makefile.am
58
Makefile.am
@ -177,12 +177,6 @@ bin_PROGRAMS = \
|
||||
dist_bin_SCRIPTS = \
|
||||
src/systemd-analyze
|
||||
|
||||
if HAVE_GTK
|
||||
bin_PROGRAMS += \
|
||||
systemadm \
|
||||
systemd-gnome-ask-password-agent
|
||||
endif
|
||||
|
||||
rootlibexec_PROGRAMS = \
|
||||
systemd \
|
||||
systemd-cgroups-agent \
|
||||
@ -656,7 +650,6 @@ EXTRA_DIST += \
|
||||
MANPAGES = \
|
||||
man/systemd.1 \
|
||||
man/systemctl.1 \
|
||||
man/systemadm.1 \
|
||||
man/systemd-cgls.1 \
|
||||
man/systemd-cgtop.1 \
|
||||
man/systemd-nspawn.1 \
|
||||
@ -1036,52 +1029,6 @@ systemd_stdio_bridge_SOURCES = \
|
||||
systemd_stdio_bridge_LDADD = \
|
||||
libsystemd-basic.la
|
||||
|
||||
systemadm_SOURCES = \
|
||||
src/systemadm.vala \
|
||||
src/systemd-interfaces.vala \
|
||||
src/wraplabel.vala
|
||||
|
||||
systemadm_CFLAGS = \
|
||||
$(AM_CFLAGS) \
|
||||
$(GTK_CFLAGS) \
|
||||
-Wno-unused-variable \
|
||||
-Wno-unused-function \
|
||||
-Wno-shadow \
|
||||
-Wno-format-nonliteral
|
||||
|
||||
systemadm_VALAFLAGS = \
|
||||
--pkg=posix \
|
||||
--pkg=gtk+-2.0 \
|
||||
--pkg=gee-1.0 \
|
||||
-g
|
||||
|
||||
systemadm_LDADD = \
|
||||
$(GTK_LIBS)
|
||||
|
||||
systemd_gnome_ask_password_agent_SOURCES = \
|
||||
src/gnome-ask-password-agent.vala
|
||||
|
||||
systemd_gnome_ask_password_agent_CFLAGS = \
|
||||
$(AM_CFLAGS) \
|
||||
$(LIBNOTIFY_CFLAGS) \
|
||||
$(GTK_CFLAGS) \
|
||||
-Wno-unused-variable \
|
||||
-Wno-unused-function \
|
||||
-Wno-shadow \
|
||||
-Wno-format-nonliteral
|
||||
|
||||
systemd_gnome_ask_password_agent_VALAFLAGS = \
|
||||
--pkg=posix \
|
||||
--pkg=gtk+-2.0 \
|
||||
--pkg=linux \
|
||||
--pkg=gio-unix-2.0 \
|
||||
--pkg=libnotify \
|
||||
-g
|
||||
|
||||
systemd_gnome_ask_password_agent_LDADD = \
|
||||
$(LIBNOTIFY_LIBS) \
|
||||
$(GTK_LIBS)
|
||||
|
||||
systemd_tty_ask_password_agent_SOURCES = \
|
||||
src/tty-ask-password-agent.c \
|
||||
src/ask-password-api.c \
|
||||
@ -2192,11 +2139,6 @@ CLEANFILES += \
|
||||
src/load-fragment-gperf-nulstr.c \
|
||||
src/99-systemd.rules
|
||||
|
||||
if HAVE_VALAC
|
||||
CLEANFILES += \
|
||||
${systemadm_SOURCES:.vala=.c}
|
||||
endif
|
||||
|
||||
if HAVE_XSLTPROC
|
||||
XSLTPROC_FLAGS = \
|
||||
--nonet \
|
||||
|
3
README
3
README
@ -38,17 +38,14 @@ REQUIREMENTS:
|
||||
libudev >= 172
|
||||
dbus >= 1.4.0
|
||||
libcap
|
||||
gtk+ >= 2.20 (optional)
|
||||
PAM >= 1.1.2 (optional)
|
||||
libcryptsetup (optional)
|
||||
libaudit (optional)
|
||||
libselinux (optional)
|
||||
tcpwrappers (optional)
|
||||
libnotify (optional)
|
||||
|
||||
When you build from git you need the following additional dependencies:
|
||||
|
||||
vala >= 0.10
|
||||
docbook-xsl
|
||||
xsltproc
|
||||
automake
|
||||
|
20
configure.ac
20
configure.ac
@ -372,25 +372,6 @@ if test "x$enable_manpages" != "xno"; then
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_MANPAGES, [test "$have_manpages" = "yes"])
|
||||
|
||||
have_gtk=no
|
||||
AC_ARG_ENABLE(gtk, AS_HELP_STRING([--disable-gtk], [disable GTK tools]))
|
||||
if test "x$enable_gtk" != "xno"; then
|
||||
PKG_CHECK_MODULES(GTK, [ gtk+-2.0 glib-2.0 > 2.26 gio-unix-2.0 gee-1.0],
|
||||
[AC_DEFINE(HAVE_GTK, 1, [Define if GTK is available]) have_gtk=yes], have_gtk=no)
|
||||
if test "x$have_gtk" = xno -a "x$enable_gtk" = xyes; then
|
||||
AC_MSG_ERROR([*** gtk support requested but libraries not found])
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GTK, [test "$have_gtk" = "yes"])
|
||||
|
||||
if test "$have_gtk" = "yes"; then
|
||||
PKG_CHECK_MODULES(LIBNOTIFY, [ libnotify ])
|
||||
fi
|
||||
|
||||
AM_PROG_VALAC([0.10])
|
||||
AC_SUBST(VAPIDIR)
|
||||
AM_CONDITIONAL(HAVE_VALAC, test x"$VALAC" != x)
|
||||
|
||||
AC_PATH_PROG([XSLTPROC], [xsltproc])
|
||||
AM_CONDITIONAL(HAVE_XSLTPROC, test x"$XSLTPROC" != x)
|
||||
|
||||
@ -624,7 +605,6 @@ AC_MSG_RESULT([
|
||||
SysV compatibility: ${SYSTEM_SYSV_COMPAT}
|
||||
SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
|
||||
SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}
|
||||
Gtk: ${have_gtk}
|
||||
libcryptsetup: ${have_libcryptsetup}
|
||||
tcpwrap: ${have_tcpwrap}
|
||||
PAM: ${have_pam}
|
||||
|
@ -1,111 +0,0 @@
|
||||
<?xml version='1.0'?> <!--*-nxml-*-->
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
|
||||
|
||||
<!--
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2010 Lennart Poettering
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
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/>.
|
||||
-->
|
||||
|
||||
<refentry id="systemadm">
|
||||
|
||||
<refentryinfo>
|
||||
<title>systemadm</title>
|
||||
<productname>systemd</productname>
|
||||
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Lennart</firstname>
|
||||
<surname>Poettering</surname>
|
||||
<email>lennart@poettering.net</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
|
||||
<refmeta>
|
||||
<refentrytitle>systemadm</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>systemadm</refname>
|
||||
<refpurpose>Graphical frontend for the systemd system
|
||||
and service manager</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>systemadm <arg choice="opt" rep="repeat">OPTIONS</arg></command>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<para><command>systemadm</command> is a graphical
|
||||
frontend for the systemd system and service manager
|
||||
and allows introspection and control of
|
||||
systemd.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Options</title>
|
||||
|
||||
<para>The following options are understood:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><option>--h</option></term>
|
||||
<term><option>--help</option></term>
|
||||
|
||||
<listitem><para>Prints a short help
|
||||
text and exits.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--system</option></term>
|
||||
|
||||
<listitem><para>Connect to the systemd
|
||||
system
|
||||
manager. (Default)</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--user</option></term>
|
||||
|
||||
<listitem><para>Connect to the systemd
|
||||
manager of the calling
|
||||
user.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
<para>In addition to this a number of parameters
|
||||
common to all Gtk+ programs are supported.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||
<citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
@ -1,266 +0,0 @@
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2010 Lennart Poettering
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
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/>.
|
||||
***/
|
||||
|
||||
using Gtk;
|
||||
using GLib;
|
||||
using Linux;
|
||||
using Posix;
|
||||
using Notify;
|
||||
|
||||
[CCode (cheader_filename = "time.h")]
|
||||
extern int clock_gettime(int id, out timespec ts);
|
||||
|
||||
public class PasswordDialog : Dialog {
|
||||
|
||||
public Entry entry;
|
||||
|
||||
public PasswordDialog(string message, string icon) {
|
||||
set_title("System Password");
|
||||
set_has_separator(false);
|
||||
set_border_width(8);
|
||||
set_default_response(ResponseType.OK);
|
||||
set_icon_name(icon);
|
||||
|
||||
add_button(Stock.CANCEL, ResponseType.CANCEL);
|
||||
add_button(Stock.OK, ResponseType.OK);
|
||||
|
||||
Container content = (Container) get_content_area();
|
||||
|
||||
Box hbox = new HBox(false, 16);
|
||||
hbox.set_border_width(8);
|
||||
content.add(hbox);
|
||||
|
||||
Image image = new Image.from_icon_name(icon, IconSize.DIALOG);
|
||||
hbox.pack_start(image, false, false);
|
||||
|
||||
Box vbox = new VBox(false, 8);
|
||||
hbox.pack_start(vbox, true, true);
|
||||
|
||||
Label label = new Label(message);
|
||||
vbox.pack_start(label, false, false);
|
||||
|
||||
entry = new Entry();
|
||||
entry.set_visibility(false);
|
||||
entry.set_activates_default(true);
|
||||
vbox.pack_start(entry, false, false);
|
||||
|
||||
entry.activate.connect(on_entry_activated);
|
||||
|
||||
show_all();
|
||||
}
|
||||
|
||||
public void on_entry_activated() {
|
||||
response(ResponseType.OK);
|
||||
}
|
||||
}
|
||||
|
||||
public class MyStatusIcon : StatusIcon {
|
||||
|
||||
File directory;
|
||||
File current;
|
||||
FileMonitor file_monitor;
|
||||
|
||||
string message;
|
||||
string icon;
|
||||
string socket;
|
||||
|
||||
PasswordDialog password_dialog;
|
||||
|
||||
public MyStatusIcon() throws GLib.Error {
|
||||
GLib.Object(icon_name : "dialog-password");
|
||||
set_title("System Password Request");
|
||||
|
||||
directory = File.new_for_path("/run/systemd/ask-password/");
|
||||
file_monitor = directory.monitor_directory(0);
|
||||
file_monitor.changed.connect(file_monitor_changed);
|
||||
|
||||
current = null;
|
||||
look_for_password();
|
||||
|
||||
activate.connect(status_icon_activate);
|
||||
}
|
||||
|
||||
void file_monitor_changed(GLib.File file, GLib.File? other_file, GLib.FileMonitorEvent event_type) {
|
||||
|
||||
if (!file.get_basename().has_prefix("ask."))
|
||||
return;
|
||||
|
||||
if (event_type == FileMonitorEvent.CREATED ||
|
||||
event_type == FileMonitorEvent.DELETED) {
|
||||
try {
|
||||
look_for_password();
|
||||
} catch (Error e) {
|
||||
show_error(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void look_for_password() throws GLib.Error {
|
||||
|
||||
if (current != null) {
|
||||
if (!current.query_exists()) {
|
||||
current = null;
|
||||
if (password_dialog != null)
|
||||
password_dialog.response(ResponseType.REJECT);
|
||||
}
|
||||
}
|
||||
|
||||
if (current == null) {
|
||||
FileEnumerator enumerator = directory.enumerate_children("standard::name", FileQueryInfoFlags.NOFOLLOW_SYMLINKS);
|
||||
|
||||
FileInfo i;
|
||||
while ((i = enumerator.next_file()) != null) {
|
||||
if (!i.get_name().has_prefix("ask."))
|
||||
continue;
|
||||
|
||||
current = directory.get_child(i.get_name());
|
||||
|
||||
if (load_password())
|
||||
break;
|
||||
|
||||
current = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (current == null)
|
||||
set_visible(false);
|
||||
}
|
||||
|
||||
bool load_password() throws GLib.Error {
|
||||
|
||||
KeyFile key_file = new KeyFile();
|
||||
|
||||
try {
|
||||
timespec ts;
|
||||
|
||||
key_file.load_from_file(current.get_path(), KeyFileFlags.NONE);
|
||||
|
||||
string not_after_as_string = key_file.get_string("Ask", "NotAfter");
|
||||
|
||||
clock_gettime(1, out ts);
|
||||
uint64 now = (ts.tv_sec * 1000000) + (ts.tv_nsec / 1000);
|
||||
|
||||
uint64 not_after;
|
||||
if (not_after_as_string.scanf("%llu", out not_after) != 1)
|
||||
return false;
|
||||
|
||||
if (not_after > 0 && not_after < now)
|
||||
return false;
|
||||
|
||||
socket = key_file.get_string("Ask", "Socket");
|
||||
} catch (GLib.Error e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
message = key_file.get_string("Ask", "Message").compress();
|
||||
} catch (GLib.Error e) {
|
||||
message = "Please Enter System Password!";
|
||||
}
|
||||
|
||||
set_tooltip_text(message);
|
||||
|
||||
try {
|
||||
icon = key_file.get_string("Ask", "Icon");
|
||||
} catch (GLib.Error e) {
|
||||
icon = "dialog-password";
|
||||
}
|
||||
set_from_icon_name(icon);
|
||||
|
||||
set_visible(true);
|
||||
|
||||
Notification n = new Notification(title, message, icon);
|
||||
n.set_timeout(5000);
|
||||
n.show();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void status_icon_activate() {
|
||||
|
||||
if (current == null)
|
||||
return;
|
||||
|
||||
if (password_dialog != null) {
|
||||
password_dialog.present();
|
||||
return;
|
||||
}
|
||||
|
||||
password_dialog = new PasswordDialog(message, icon);
|
||||
|
||||
int result = password_dialog.run();
|
||||
string password = password_dialog.entry.get_text();
|
||||
|
||||
password_dialog.destroy();
|
||||
password_dialog = null;
|
||||
|
||||
if (result == ResponseType.REJECT ||
|
||||
result == ResponseType.DELETE_EVENT)
|
||||
return;
|
||||
|
||||
int to_process;
|
||||
|
||||
try {
|
||||
Process.spawn_async_with_pipes(
|
||||
null,
|
||||
{ "/usr/bin/pkexec", "/lib/systemd/systemd-reply-password", result == ResponseType.OK ? "1" : "0", socket },
|
||||
null,
|
||||
0,
|
||||
null,
|
||||
null,
|
||||
out to_process,
|
||||
null,
|
||||
null);
|
||||
|
||||
OutputStream stream = new UnixOutputStream(to_process, true);
|
||||
#if VALA_0_12
|
||||
stream.write(password.data, null);
|
||||
#else
|
||||
stream.write(password, password.length, null);
|
||||
#endif
|
||||
} catch (Error e) {
|
||||
show_error(e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const OptionEntry entries[] = {
|
||||
{ null }
|
||||
};
|
||||
|
||||
void show_error(string e) {
|
||||
var m = new MessageDialog(null, 0, MessageType.ERROR, ButtonsType.CLOSE, "%s", e);
|
||||
m.run();
|
||||
m.destroy();
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
} catch (GLib.Error e) {
|
||||
show_error(e.message);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
1071
src/systemadm.vala
1071
src/systemadm.vala
File diff suppressed because it is too large
Load Diff
@ -1,167 +0,0 @@
|
||||
/***
|
||||
This file is part of systemd.
|
||||
|
||||
Copyright 2010 Lennart Poettering
|
||||
|
||||
systemd is free software; you can redistribute it and/or modify it
|
||||
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/>.
|
||||
***/
|
||||
|
||||
[DBus (name = "org.freedesktop.systemd1.Manager")]
|
||||
public interface Manager : DBusProxy {
|
||||
|
||||
public struct UnitInfo {
|
||||
string id;
|
||||
string description;
|
||||
string load_state;
|
||||
string active_state;
|
||||
string sub_state;
|
||||
string following;
|
||||
ObjectPath unit_path;
|
||||
uint32 job_id;
|
||||
string job_type;
|
||||
ObjectPath job_path;
|
||||
}
|
||||
|
||||
public struct JobInfo {
|
||||
uint32 id;
|
||||
string name;
|
||||
string type;
|
||||
string state;
|
||||
ObjectPath job_path;
|
||||
ObjectPath unit_path;
|
||||
}
|
||||
|
||||
public abstract string[] environment { owned get; }
|
||||
|
||||
public abstract UnitInfo[] list_units() throws IOError;
|
||||
public abstract JobInfo[] list_jobs() throws IOError;
|
||||
|
||||
public abstract ObjectPath get_unit(string name) throws IOError;
|
||||
public abstract ObjectPath get_unit_by_pid(uint32 pid) throws IOError;
|
||||
public abstract ObjectPath load_unit(string name) throws IOError;
|
||||
public abstract ObjectPath get_job(uint32 id) throws IOError;
|
||||
|
||||
public abstract ObjectPath start_unit(string name, string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath stop_unit(string name, string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath reload_unit(string name, string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath restart_unit(string name, string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath try_restart_unit(string name, string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath reload_or_restart_unit(string name, string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath reload_or_try_restart_unit(string name, string mode = "replace") throws IOError;
|
||||
|
||||
public abstract void reset_failed_unit(string name = "") throws IOError;
|
||||
|
||||
public abstract void clear_jobs() throws IOError;
|
||||
|
||||
public abstract void subscribe() throws IOError;
|
||||
public abstract void unsubscribe() throws IOError;
|
||||
|
||||
public abstract string dump() throws IOError;
|
||||
|
||||
public abstract void reload() throws IOError;
|
||||
public abstract void reexecute() throws IOError;
|
||||
public abstract void exit() throws IOError;
|
||||
public abstract void halt() throws IOError;
|
||||
public abstract void power_off() throws IOError;
|
||||
public abstract void reboot() throws IOError;
|
||||
public abstract void kexec() throws IOError;
|
||||
|
||||
public abstract ObjectPath create_snapshot(string name = "", bool cleanup = false) throws IOError;
|
||||
|
||||
public abstract void set_environment(string[] names) throws IOError;
|
||||
public abstract void unset_environment(string[] names) throws IOError;
|
||||
|
||||
public abstract signal void unit_new(string id, ObjectPath path);
|
||||
public abstract signal void unit_removed(string id, ObjectPath path);
|
||||
public abstract signal void job_new(uint32 id, ObjectPath path);
|
||||
public abstract signal void job_removed(uint32 id, ObjectPath path, string res);
|
||||
}
|
||||
|
||||
[DBus (name = "org.freedesktop.systemd1.Unit")]
|
||||
public interface Unit : DBusProxy {
|
||||
public struct JobLink {
|
||||
uint32 id;
|
||||
ObjectPath path;
|
||||
}
|
||||
|
||||
public abstract string id { owned get; }
|
||||
public abstract string[] names { owned get; }
|
||||
public abstract string following { owned get; }
|
||||
public abstract string[] requires { owned get; }
|
||||
public abstract string[] requires_overridable { owned get; }
|
||||
public abstract string[] requisite { owned get; }
|
||||
public abstract string[] requisite_overridable { owned get; }
|
||||
public abstract string[] wants { owned get; }
|
||||
public abstract string[] required_by { owned get; }
|
||||
public abstract string[] required_by_overridable { owned get; }
|
||||
public abstract string[] wanted_by { owned get; }
|
||||
public abstract string[] conflicts { owned get; }
|
||||
public abstract string[] conflicted_by { owned get; }
|
||||
public abstract string[] before { owned get; }
|
||||
public abstract string[] after { owned get; }
|
||||
public abstract string[] on_failure { owned get; }
|
||||
public abstract string description { owned get; }
|
||||
public abstract string load_state { owned get; }
|
||||
public abstract string active_state { owned get; }
|
||||
public abstract string sub_state { owned get; }
|
||||
public abstract string fragment_path { owned get; }
|
||||
public abstract uint64 inactive_exit_timestamp { owned get; }
|
||||
public abstract uint64 active_enter_timestamp { owned get; }
|
||||
public abstract uint64 active_exit_timestamp { owned get; }
|
||||
public abstract uint64 inactive_enter_timestamp { owned get; }
|
||||
public abstract bool can_start { owned get; }
|
||||
public abstract bool can_stop { owned get; }
|
||||
public abstract bool can_reload { owned get; }
|
||||
public abstract JobLink job { owned get; }
|
||||
public abstract bool recursive_stop { owned get; }
|
||||
public abstract bool stop_when_unneeded { owned get; }
|
||||
public abstract bool refuse_manual_start { owned get; }
|
||||
public abstract bool refuse_manual_stop { owned get; }
|
||||
public abstract bool default_dependencies { owned get; }
|
||||
public abstract string default_control_group { owned get; }
|
||||
public abstract string[] control_groups { owned get; }
|
||||
public abstract bool need_daemon_reload { owned get; }
|
||||
public abstract uint64 job_timeout_usec { owned get; }
|
||||
|
||||
public abstract ObjectPath start(string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath stop(string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath reload(string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath restart(string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath try_restart(string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath reload_or_restart(string mode = "replace") throws IOError;
|
||||
public abstract ObjectPath reload_or_try_restart(string mode = "replace") throws IOError;
|
||||
|
||||
public abstract void reset_failed() throws IOError;
|
||||
}
|
||||
|
||||
[DBus (name = "org.freedesktop.systemd1.Job")]
|
||||
public interface Job : DBusProxy {
|
||||
public struct UnitLink {
|
||||
string id;
|
||||
ObjectPath path;
|
||||
}
|
||||
|
||||
public abstract uint32 id { owned get; }
|
||||
public abstract string state { owned get; }
|
||||
public abstract string job_type { owned get; }
|
||||
public abstract UnitLink unit { owned get; }
|
||||
|
||||
public abstract void cancel() throws IOError;
|
||||
}
|
||||
|
||||
[DBus (name = "org.freedesktop.Properties")]
|
||||
public interface Properties : DBusProxy {
|
||||
public abstract Variant? get(string iface, string property) throws IOError;
|
||||
public abstract signal void properties_changed(string iface, HashTable<string, Variant?> changed_properties, string[] invalidated_properties);
|
||||
}
|
@ -1,73 +0,0 @@
|
||||
// Copyright (c) 2005 VMware, Inc.
|
||||
|
||||
// This is a translation of http://git.gnome.org/browse/meld/tree/meld/ui/wraplabel.py,
|
||||
// which in turn is a translation of WrapLabel from libview.
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
// Python translation from wrapLabel.{cc|h} by Gian Mario Tagliaretti
|
||||
// Vala translation from wraplabel.py by Zbigniew Jędrzejewski-Szmek
|
||||
|
||||
public class WrapLabel : Gtk.Label {
|
||||
private int _wrap_width;
|
||||
|
||||
public WrapLabel(string? text = null) {
|
||||
this._wrap_width = 0;
|
||||
var layout = get_layout();
|
||||
layout.set_wrap(Pango.WrapMode.WORD_CHAR);
|
||||
if (text != null)
|
||||
this.set_text(text);
|
||||
this.set_alignment(0, 0);
|
||||
}
|
||||
|
||||
public override void size_request(out Gtk.Requisition requisition) {
|
||||
int width, height;
|
||||
var layout = get_layout();
|
||||
layout.get_pixel_size(out width, out height);
|
||||
requisition.width = 0;
|
||||
requisition.height = height;
|
||||
}
|
||||
|
||||
public override void size_allocate(Gdk.Rectangle allocation) {
|
||||
base.size_allocate (allocation);
|
||||
this._set_wrap_width(allocation.width);
|
||||
}
|
||||
|
||||
public new void set_text(string str) {
|
||||
base.set_text(str);
|
||||
this._set_wrap_width(this._wrap_width);
|
||||
}
|
||||
|
||||
public new void set_markup(string str) {
|
||||
base.set_markup(str);
|
||||
this._set_wrap_width(this._wrap_width);
|
||||
}
|
||||
|
||||
private void _set_wrap_width(int width) {
|
||||
if (width == 0)
|
||||
return;
|
||||
|
||||
var layout = get_layout();
|
||||
layout.set_width(width * Pango.SCALE);
|
||||
if (_wrap_width != width) {
|
||||
this._wrap_width = width;
|
||||
this.queue_resize();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user