Skip to content

Commit

Permalink
rfkill: Add RFKill support plugin on Linux systems
Browse files Browse the repository at this point in the history
Based on a patch by Jasper St. Pierre <jstpierre@mecheye.net>

https://bugzilla.gnome.org/show_bug.cgi?id=703410
  • Loading branch information
hadess committed Jul 5, 2013
1 parent 10895a8 commit 444af32
Show file tree
Hide file tree
Showing 13 changed files with 1,087 additions and 1 deletion.
18 changes: 17 additions & 1 deletion configure.ac
Expand Up @@ -387,6 +387,21 @@ fi

AM_CONDITIONAL(BUILD_PRINT_NOTIFICATIONS, [test x"$enable_cups" = x"yes"])

# ---------------------------------------------------------------------------
# Rfkill
# ---------------------------------------------------------------------------

AC_ARG_ENABLE(rfkill,
AS_HELP_STRING([--disable-rfkill], [disable rfkill support (default: enabled)]),,
enable_rfkill=yes, enabled_rfkill=no)

if test x"$enable_rfkill" != x"no" ; then
AC_CHECK_HEADERS([linux/rfkill.h],,
AC_MSG_ERROR([RFKill headers not found but rfkill support requested]))
fi

AM_CONDITIONAL(BUILD_RFKILL, [test x"$enable_rfkill" = x"yes"])

# ---------------------------------------------------------------------------
# Enable Profiling
# ---------------------------------------------------------------------------
Expand All @@ -398,7 +413,6 @@ if test "x$enable_profiling" = "xyes"; then
AC_DEFINE(ENABLE_PROFILING,1,[enable profiling])
fi


# ---------------------------------------------------------------------------
# Plugins
# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -505,6 +519,7 @@ plugins/mouse/Makefile
plugins/orientation/Makefile
plugins/print-notifications/Makefile
plugins/remote-display/Makefile
plugins/rfkill/Makefile
plugins/screensaver-proxy/Makefile
plugins/smartcard/Makefile
plugins/sound/Makefile
Expand Down Expand Up @@ -564,6 +579,7 @@ echo "
Smartcard support: ${have_smartcard_support}
Cups support: ${enable_cups}
Wacom support: ${have_wacom}
RFKill support: ${enable_rfkill}
${NSS_DATABASE:+\
System nssdb: ${NSS_DATABASE}
}\
Expand Down
12 changes: 12 additions & 0 deletions data/org.gnome.settings-daemon.plugins.gschema.xml.in.in
Expand Up @@ -102,6 +102,18 @@
<_description>Priority to use for this plugin in gnome-settings-daemon startup queue</_description>
</key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.settings-daemon.plugins.rfkill" path="/org/gnome/settings-daemon/plugins/rfkill/">
<key name="active" type="b">
<default>true</default>
<_summary>Activation of this plugin</_summary>
<_description>Whether this plugin would be activated by gnome-settings-daemon or not</_description>
</key>
<key name="priority" type="i">
<default>0</default>
<_summary>Priority to use for this plugin</_summary>
<_description>Priority to use for this plugin in gnome-settings-daemon startup queue</_description>
</key>
</schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.settings-daemon.plugins.screensaver-proxy" path="/org/gnome/settings-daemon/plugins/screensaver-proxy/">
<key name="active" type="b">
<default>true</default>
Expand Down
6 changes: 6 additions & 0 deletions plugins/Makefile.am
Expand Up @@ -51,5 +51,11 @@ else
disabled_plugins += print-notifications
endif

if BUILD_RFKILL
enabled_plugins += rfkill
else
disabled_plugins += rfkill
endif

SUBDIRS = common $(enabled_plugins)
DIST_SUBDIRS = $(SUBDIRS) $(disabled_plugins)
64 changes: 64 additions & 0 deletions plugins/rfkill/Makefile.am
@@ -0,0 +1,64 @@
plugin_name = rfkill

libexec_PROGRAMS = gsd-test-rfkill

gsd_test_rfkill_SOURCES = \
gsd-rfkill-manager.h \
gsd-rfkill-manager.c \
rfkill-glib.c \
rfkill-glib.h \
rfkill.h \
test-rfkill.c

gsd_test_rfkill_CFLAGS = \
-I$(top_srcdir)/gnome-settings-daemon \
-I$(top_srcdir)/plugins/common \
-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
$(PLUGIN_CFLAGS) \
$(SETTINGS_PLUGIN_CFLAGS) \
$(AM_CFLAGS)

gsd_test_rfkill_LDADD = \
$(top_builddir)/gnome-settings-daemon/libgsd.la \
$(top_builddir)/plugins/common/libcommon.la \
$(SETTINGS_PLUGIN_LIBS)

plugin_LTLIBRARIES = librfkill.la

librfkill_la_SOURCES = \
gsd-rfkill-plugin.c \
gsd-rfkill-manager.h \
gsd-rfkill-manager.c \
rfkill-glib.c \
rfkill-glib.h \
rfkill.h

librfkill_la_CPPFLAGS = \
-I$(top_srcdir)/gnome-settings-daemon \
-I$(top_srcdir)/data/ \
-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
$(AM_CPPFLAGS)

librfkill_la_CFLAGS = \
$(PLUGIN_CFLAGS) \
$(RFKILL_CFLAGS) \
$(SETTINGS_PLUGIN_CFLAGS) \
$(AM_CFLAGS)

librfkill_la_LDFLAGS = \
$(GSD_PLUGIN_LDFLAGS)

librfkill_la_LIBADD = \
$(RFKILL_LIBS) \
$(SETTINGS_PLUGIN_LIBS)

plugin_in_files = rfkill.gnome-settings-plugin.in

plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)

EXTRA_DIST = $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)

@GSD_INTLTOOL_PLUGIN_RULE@

0 comments on commit 444af32

Please sign in to comment.