[netspeed/unstable] Move menu.xml into it's own file



commit edc62f514a46b13a533abb7a83e667b73692f512
Author: Jörgen Scheibengruber <mfcn gmx de>
Date:   Tue Jun 29 01:04:29 2010 +0300

    Move menu.xml into it's own file

 Makefile.am                                        |   20 +++------------
 configure.in                                       |    1 +
 .../GNOME_NetspeedApplet.server.in.in              |    0
 data/Makefile.am                                   |   17 +++++++++++++
 data/menu.xml                                      |   11 ++++++++
 po/POTFILES.in                                     |    6 +++-
 src/netspeed.c                                     |   26 ++++----------------
 7 files changed, 42 insertions(+), 39 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index ad38d72..0844782 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,32 +1,20 @@
-SUBDIRS = help icons po src
-
-serverdir = $(libdir)/bonobo/servers
-server_DATA = GNOME_NetspeedApplet.server
-server_in_files = $(server_DATA:=.in)
-server_in_in_files = $(server_in_files:=.in)
- INTLTOOL_SERVER_RULE@
+SUBDIRS = data help icons po src
 
 distuninstallcheck_listfiles = find . -type f -print | grep -v scrollkeeper
 
 spec = $(PACKAGE).spec
-EXTRA_DIST = GNOME_NetspeedApplet.server.in.in \
-             $(spec) \
+EXTRA_DIST = $(spec) \
              gnome-doc-utils.make \
              intltool-update.in \
              intltool-merge.in \
              intltool-extract.in
 
-all-local: $(spec) $(server_DATA)
-
-$(server_in_files): $(server_in_in_files) Makefile
-	sed s,@LIBEXECDIR@,$(libexecdir),g <$< >$@
+all-local: $(spec)
 
-CLEANFILES = $(server_DATA)
 DISTCLEANFILES = \
                  gnome-doc-utils.make \
                  intltool-extract \
                  intltool-merge \
-                 intltool-update \
-                 $(server_in_files)
+                 intltool-update
 
 DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper
diff --git a/configure.in b/configure.in
index 2035c5d..4ce57ba 100644
--- a/configure.in
+++ b/configure.in
@@ -64,4 +64,5 @@ icons/scalable/apps/Makefile
 src/Makefile
 po/Makefile.in
 help/Makefile
+data/Makefile
 ])
diff --git a/GNOME_NetspeedApplet.server.in.in b/data/GNOME_NetspeedApplet.server.in.in
similarity index 100%
rename from GNOME_NetspeedApplet.server.in.in
rename to data/GNOME_NetspeedApplet.server.in.in
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..c3467f0
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1,17 @@
+uidir = $(datadir)/netspeed/
+ui_DATA = menu.xml
+
+serverdir = $(libdir)/bonobo/servers
+server_DATA = GNOME_NetspeedApplet.server
+server_in_files = $(server_DATA:=.in)
+server_in_in_files = $(server_in_files:=.in)
+
+$(server_in_files): $(server_in_in_files) Makefile
+	sed s,@LIBEXECDIR@,$(libexecdir),g <$< >$@
+
+EXTRA_DIST = GNOME_NetspeedApplet.server.in.in
+
+CLEANFILES = $(server_DATA) $(server_in_files)
+
+ INTLTOOL_SERVER_RULE@
+
diff --git a/data/menu.xml b/data/menu.xml
new file mode 100644
index 0000000..4f251cb
--- /dev/null
+++ b/data/menu.xml
@@ -0,0 +1,11 @@
+<Root>
+  <popups>
+    <popup name="button3">
+    <menuitem name="Details Item" verb="NetspeedAppletDetails" _label="Device _Details" pixtype="stock" pixname="gtk-info"/>
+    <separator/>
+    <menuitem name="Properties Item" verb="NetspeedAppletProperties" _label="_Preferences..." pixtype="stock" pixname="gtk-properties"/>
+    <menuitem name="Help Item" verb="NetspeedAppletHelp" _label="_Help" pixtype="stock" pixname="gtk-help"/>
+    <menuitem name="About Item" verb="NetspeedAppletAbout" _label="_About..." pixtype="stock" pixname="gtk-about"/>
+    </popup>
+  </popups>
+</Root>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 2d8dd09..c8ec631 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,3 +1,5 @@
-GNOME_NetspeedApplet.server.in.in
+data/menu.xml
+data/GNOME_NetspeedApplet.server.in.in
 src/netspeed.c
-
+src/info-dialog.c
+src/settings-dialog.c
diff --git a/src/netspeed.c b/src/netspeed.c
index ce508df..39639fe 100644
--- a/src/netspeed.c
+++ b/src/netspeed.c
@@ -135,21 +135,6 @@ struct _NetspeedApplet
 	gboolean device_has_changed;
 };
 
-static const char 
-netspeed_applet_menu_xml [] =
-	"<popup name=\"button3\">\n"
-	"   <menuitem name=\"Properties Item\" verb=\"NetspeedAppletDetails\" label=\"%s\"\n"
-	"             pixtype=\"stock\" pixname=\"gtk-info\"/>\n"
-	"   <separator/>\n"
-	"   <menuitem name=\"Properties Item\" verb=\"NetspeedAppletProperties\" label=\"%s\"\n"
-	"             pixtype=\"stock\" pixname=\"gtk-properties\"/>\n"
-	"   <menuitem name=\"Help Item\" verb=\"NetspeedAppletHelp\" label=\"%s\"\n"
-	"             pixtype=\"stock\" pixname=\"gtk-help\"/>\n"
-	"   <menuitem name=\"About Item\" verb=\"NetspeedAppletAbout\" label=\"%s\"\n"
-	"             pixtype=\"stock\" pixname=\"gtk-about\"/>\n"
-	"</popup>\n";
-
-
 static void
 update_tooltip(Netspeed* applet);
 
@@ -642,7 +627,6 @@ static gboolean
 netspeed_factory (PanelApplet *applet, const gchar *iid, gpointer data)
 {
 	NetspeedPrivate *priv;
-	char* menu_string;
 	char* dummy_key, *dummy;
 	char* gconf_path;
 	char* device;
@@ -660,11 +644,11 @@ netspeed_factory (PanelApplet *applet, const gchar *iid, gpointer data)
 	if (strcmp (iid, "OAFIID:GNOME_NetspeedApplet"))
 		return FALSE;
 
-	menu_string = g_strdup_printf(netspeed_applet_menu_xml, _("Device _Details"), _("_Preferences..."), _("_Help"), _("_About..."));
-	panel_applet_setup_menu(applet, menu_string,
-                            netspeed_applet_menu_verbs,
-                            applet);
-	g_free (menu_string);
+	panel_applet_setup_menu_from_file (applet,
+			DATADIR"/netspeed/",
+			"menu.xml", NULL,
+			netspeed_applet_menu_verbs,
+			applet);
 
 	dummy_key = panel_applet_gconf_get_full_key (applet, "dummy");
 	dummy = dummy_key ? strstr (dummy_key, "dummy") : NULL;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]