summaryrefslogtreecommitdiff
path: root/netspeed
diff options
context:
space:
mode:
Diffstat (limited to 'netspeed')
-rw-r--r--netspeed/data/Makefile.am29
-rw-r--r--netspeed/data/org.mate.applets.NetspeedApplet.mate-panel-applet.desktop.in.in2
-rw-r--r--netspeed/data/org.mate.panel.applet.NetspeedAppletFactory.service.in3
-rw-r--r--netspeed/src/Makefile.am41
-rw-r--r--netspeed/src/netspeed.c70
5 files changed, 94 insertions, 51 deletions
diff --git a/netspeed/data/Makefile.am b/netspeed/data/Makefile.am
index e8bec0e1..b6cb4875 100644
--- a/netspeed/data/Makefile.am
+++ b/netspeed/data/Makefile.am
@@ -1,26 +1,44 @@
NULL =
-APPLET_LOCATION = $(libdir)/mate-applets/libmate-netspeed-applet.so
+applet_in_files = org.mate.applets.NetspeedApplet.mate-panel-applet.desktop.in
+service_in_files = org.mate.panel.applet.NetspeedAppletFactory.service.in
+gschema_in_files = org.mate.panel.applet.netspeed.gschema.xml.in
+
+if ENABLE_IN_PROCESS
+APPLET_LOCATION = $(pkglibdir)/libmate-netspeed-applet.so
+else !ENABLE_IN_PROCESS
+APPLET_LOCATION = $(libexecdir)/mate-netspeed-applet
+endif !ENABLE_IN_PROCESS
appletdir = $(datadir)/mate-panel/applets
-applet_in_files = org.mate.applets.NetspeedApplet.mate-panel-applet.desktop.in
applet_DATA = $(applet_in_files:.mate-panel-applet.desktop.in=.mate-panel-applet)
$(applet_in_files): $(applet_in_files).in Makefile
$(AM_V_GEN)sed \
-e "s|\@APPLET_LOCATION\@|$(APPLET_LOCATION)|" \
+ -e "s|\@APPLET_IN_PROCESS\@|$(APPLET_IN_PROCESS)|" \
$< > $@
$(applet_DATA): $(applet_in_files) Makefile
$(AM_V_GEN) $(MSGFMT) --desktop --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po -o $@
-netspeed_gschema_in_files = org.mate.panel.applet.netspeed.gschema.xml.in
-gsettings_SCHEMAS = $(netspeed_gschema_in_files:.xml.in=.xml)
+if !ENABLE_IN_PROCESS
+servicedir = $(datadir)/dbus-1/services
+service_DATA = $(service_in_files:.service.in=.service)
+
+$(service_DATA): $(service_in_files) Makefile
+ $(AM_V_GEN)sed \
+ -e "s|\@APPLET_LOCATION\@|$(APPLET_LOCATION)|" \
+ $< > $@
+endif !ENABLE_IN_PROCESS
+
+gsettings_SCHEMAS = $(gschema_in_files:.xml.in=.xml)
@GSETTINGS_RULES@
EXTRA_DIST = \
$(applet_in_files).in \
- $(netspeed_gschema_in_files) \
+ $(service_in_files) \
+ $(gschema_in_files) \
netspeed-details.ui \
netspeed-menu.xml \
netspeed-preferences.ui \
@@ -29,6 +47,7 @@ EXTRA_DIST = \
CLEANFILES = \
$(gsettings_SCHEMAS) \
+ $(service_DATA) \
$(applet_in_files) \
$(applet_DATA)
diff --git a/netspeed/data/org.mate.applets.NetspeedApplet.mate-panel-applet.desktop.in.in b/netspeed/data/org.mate.applets.NetspeedApplet.mate-panel-applet.desktop.in.in
index 5b63e7c2..2d156785 100644
--- a/netspeed/data/org.mate.applets.NetspeedApplet.mate-panel-applet.desktop.in.in
+++ b/netspeed/data/org.mate.applets.NetspeedApplet.mate-panel-applet.desktop.in.in
@@ -1,7 +1,7 @@
[Applet Factory]
Id=NetspeedAppletFactory
Location=@APPLET_LOCATION@
-InProcess=true
+InProcess=@APPLET_IN_PROCESS@
Name=Netspeed Applet Factory
Description=Netspeed Applet
diff --git a/netspeed/data/org.mate.panel.applet.NetspeedAppletFactory.service.in b/netspeed/data/org.mate.panel.applet.NetspeedAppletFactory.service.in
new file mode 100644
index 00000000..49f7ff15
--- /dev/null
+++ b/netspeed/data/org.mate.panel.applet.NetspeedAppletFactory.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.mate.panel.applet.NetspeedAppletFactory
+Exec=@APPLET_LOCATION@
diff --git a/netspeed/src/Makefile.am b/netspeed/src/Makefile.am
index e91c1b34..ceec7342 100644
--- a/netspeed/src/Makefile.am
+++ b/netspeed/src/Makefile.am
@@ -1,8 +1,5 @@
NULL =
-mate_netspeed_applet_libdir= $(pkglibdir)
-mate_netspeed_applet_lib_LTLIBRARIES=libmate-netspeed-applet.la
-
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(includedir) \
@@ -16,35 +13,54 @@ if HAVE_NL
AM_CPPFLAGS += $(NL_CFLAGS)
endif
-libmate_netspeed_applet_la_SOURCES = \
+BUILT_SOURCES = \
+ netspeed-resources.c \
+ netspeed-resources.h \
+ $(NULL)
+APPLET_SOURCES = \
backend.h \
backend.c \
netspeed.c \
netspeed.h \
netspeed-preferences.c \
netspeed-preferences.h \
- netspeed-resources.c \
- netspeed-resources.h \
$(NULL)
if HAVE_NL
-libmate_netspeed_applet_la_SOURCES += \
+APPLET_SOURCES += \
nl80211.h \
ieee80211.h \
$(NULL)
endif
-libmate_netspeed_applet_la_LIBADD = $(GIO_LIBS) $(GTOP_APPLETS_LIBS) \
- $(MATE_APPLETS4_LIBS) \
- $(INTLLIBS) -lm
+APPLET_LIBS = \
+ $(GIO_LIBS) \
+ $(GTOP_APPLETS_LIBS) \
+ $(MATE_APPLETS4_LIBS) \
+ $(INTLLIBS) -lm
if HAVE_IW
-libmate_netspeed_applet_la_LIBADD += $(IW_LIBS)
+APPLET_LIBS += $(IW_LIBS)
endif
if HAVE_NL
-libmate_netspeed_applet_la_LIBADD += $(NL_LIBS)
+APPLET_LIBS += $(NL_LIBS)
endif
+if ENABLE_IN_PROCESS
+pkglib_LTLIBRARIES = libmate-netspeed-applet.la
+nodist_libmate_netspeed_applet_la_SOURCES = $(BUILT_SOURCES)
+libmate_netspeed_applet_la_SOURCES = $(APPLET_SOURCES)
+libmate_netspeed_applet_la_CFLAGS = $(AM_CFLAGS)
+libmate_netspeed_applet_la_LDFLAGS = -module -avoid-version
+libmate_netspeed_applet_la_LIBADD = $(APPLET_LIBS)
+else !ENABLE_IN_PROCESS
+libexec_PROGRAMS = mate-netspeed-applet
+nodist_mate_netspeed_applet_SOURCES = $(BUILT_SOURCES)
+mate_netspeed_applet_SOURCES = $(APPLET_SOURCES)
+mate_netspeed_applet_CFLAGS = $(AM_CFLAGS)
+mate_netspeed_applet_LDADD = $(APPLET_LIBS)
+endif !ENABLE_IN_PROCESS
+
netspeed-resources.c: $(srcdir)/../data/netspeed-resources.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/../data --generate-dependencies $(srcdir)/../data/netspeed-resources.gresource.xml)
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data --generate --c-name netspeed $<
@@ -52,6 +68,7 @@ netspeed-resources.h: $(srcdir)/../data/netspeed-resources.gresource.xml $(shell
$(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/../data --generate --c-name netspeed $<
CLEANFILES = \
+ $(BUILT_SOURCES) \
$(NULL)
-include $(top_srcdir)/git.mk
diff --git a/netspeed/src/netspeed.c b/netspeed/src/netspeed.c
index 441f314f..73185abd 100644
--- a/netspeed/src/netspeed.c
+++ b/netspeed/src/netspeed.c
@@ -1575,6 +1575,10 @@ netspeed_applet_factory (MatePanelApplet *applet,
glibtop_init ();
+#ifndef ENABLE_IN_PROCESS
+ g_set_application_name (_("MATE Netspeed"));
+#endif
+
netspeed = NETSPEED_APPLET (applet);
netspeed->icon_theme = gtk_icon_theme_get_default ();
@@ -1680,60 +1684,60 @@ netspeed_applet_factory (MatePanelApplet *applet,
(GSourceFunc)timeout_function,
netspeed);
g_signal_connect_object (applet, "change-size",
- G_CALLBACK (applet_change_size_or_orient),
- netspeed, 0);
+ G_CALLBACK (applet_change_size_or_orient),
+ netspeed, 0);
g_signal_connect_object (netspeed->icon_theme, "changed",
- G_CALLBACK (icon_theme_changed_cb),
- netspeed, 0);
+ G_CALLBACK (icon_theme_changed_cb),
+ netspeed, 0);
g_signal_connect_object (applet, "change-orient",
- G_CALLBACK (applet_change_size_or_orient),
- netspeed, 0);
+ G_CALLBACK (applet_change_size_or_orient),
+ netspeed, 0);
g_signal_connect_object (netspeed->in_label, "size-allocate",
- G_CALLBACK (label_size_allocate_cb),
- netspeed, 0);
+ G_CALLBACK (label_size_allocate_cb),
+ netspeed, 0);
g_signal_connect_object (netspeed->out_label, "size-allocate",
- G_CALLBACK (label_size_allocate_cb),
- netspeed, 0);
+ G_CALLBACK (label_size_allocate_cb),
+ netspeed, 0);
g_signal_connect_object (netspeed->sum_label, "size-allocate",
- G_CALLBACK (label_size_allocate_cb),
- netspeed, 0);
+ G_CALLBACK (label_size_allocate_cb),
+ netspeed, 0);
g_signal_connect_object (netspeed->settings, "changed::auto-change-device",
- G_CALLBACK (auto_change_device_settings_changed),
- netspeed, 0);
+ G_CALLBACK (auto_change_device_settings_changed),
+ netspeed, 0);
g_signal_connect_object (netspeed->settings, "changed::device",
- G_CALLBACK (device_settings_changed),
- netspeed, 0);
+ G_CALLBACK (device_settings_changed),
+ netspeed, 0);
g_signal_connect_object (netspeed->settings, "changed::show-all-addresses",
- G_CALLBACK (showalladdresses_settings_changed),
- netspeed, 0);
+ G_CALLBACK (showalladdresses_settings_changed),
+ netspeed, 0);
g_signal_connect_object (netspeed->settings, "changed::show-sum",
- G_CALLBACK (showsum_settings_changed),
- netspeed, 0);
+ G_CALLBACK (showsum_settings_changed),
+ netspeed, 0);
g_signal_connect_object (netspeed->settings, "changed::show-bits",
- G_CALLBACK (showbits_settings_changed),
- netspeed, 0);
+ G_CALLBACK (showbits_settings_changed),
+ netspeed, 0);
g_signal_connect_object (netspeed->settings, "changed::change-icon",
- G_CALLBACK (changeicon_settings_changed),
- netspeed, 0);
+ G_CALLBACK (changeicon_settings_changed),
+ netspeed, 0);
g_signal_connect_object (netspeed->settings, "changed::show-icon",
- G_CALLBACK (showicon_settings_changed),
- netspeed, 0);
+ G_CALLBACK (showicon_settings_changed),
+ netspeed, 0);
g_signal_connect_object (netspeed->settings, "changed::show-quality-icon",
- G_CALLBACK (showqualityicon_settings_changed),
- netspeed, 0);
+ G_CALLBACK (showqualityicon_settings_changed),
+ netspeed, 0);
action_group = gtk_action_group_new ("Netspeed Applet Actions");
gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
@@ -1759,8 +1763,8 @@ netspeed_applet_factory (MatePanelApplet *applet,
return TRUE;
}
-MATE_PANEL_APPLET_IN_PROCESS_FACTORY ("NetspeedAppletFactory",
- NETSPEED_TYPE_APPLET,
- "NetspeedApplet",
- netspeed_applet_factory,
- NULL)
+PANEL_APPLET_FACTORY ("NetspeedAppletFactory",
+ NETSPEED_TYPE_APPLET,
+ "NetspeedApplet",
+ netspeed_applet_factory,
+ NULL)