[gnome-applets/wip/dont-use-deprecated] invest-applet: moved context menu xml file to new format and location - also renamed the file to the



commit 51a353a621528fbf4b7bcbe2a7976db53f5b9cdb
Author: Enrico Minack <enrico-minack gmx de>
Date:   Fri Apr 22 13:50:22 2011 +0200

    invest-applet: moved context menu xml file to new format and location
    - also renamed the file to the scheme used by other applets
    - applet.py uses pkgdatadir to find that menu file

 configure.in                              |    2 ++
 invest-applet/data/Invest_Applet.xml      |   10 ----------
 invest-applet/data/Makefile.am            |    4 ++--
 invest-applet/data/invest-applet-menu.xml |    5 +++++
 invest-applet/invest/applet.py            |    2 +-
 invest-applet/invest/defs.py.in           |    1 +
 6 files changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/configure.in b/configure.in
index 114fa63..778abe8 100644
--- a/configure.in
+++ b/configure.in
@@ -638,11 +638,13 @@ AC_DEFINE_DIR(LIBDIR, "${libdir}", [libdir])
 AC_DEFINE_DIR(PREFIX, "$prefix", [install prefix])
 
 AS_AC_EXPAND(DATADIR, "${datadir}")
+AS_AC_EXPAND(PKGDATADIR, "${pkgdatadir}")
 AS_AC_EXPAND(PYTHONDIR, $pythondir)
 AS_AC_EXPAND(BUILDERDIR, $builderdir)
 
 AC_SUBST(VERSION)
 AC_SUBST(PACKAGE)
+AC_SUBST(PKGDATADIR)
 AC_SUBST(DATADIR)
 AC_SUBST(LIBDIR)
 AC_SUBST(PYTHONDIR)
diff --git a/invest-applet/data/Makefile.am b/invest-applet/data/Makefile.am
index 9716b94..d1ac0c0 100644
--- a/invest-applet/data/Makefile.am
+++ b/invest-applet/data/Makefile.am
@@ -28,9 +28,9 @@ $(applet_in_files): $(applet_in_files).in Makefile
 # ******************************************************************************
 # Misc data
 # ******************************************************************************
-uidir = $(datadir)/gnome-2.0/ui
+uidir = $(pkgdatadir)/ui
 ui_DATA = \
-	Invest_Applet.xml
+       invest-applet-menu.xml
 builder_DATA = \
 	prefs-dialog.ui \
 	financialchart.ui
diff --git a/invest-applet/data/invest-applet-menu.xml b/invest-applet/data/invest-applet-menu.xml
new file mode 100644
index 0000000..d4a3e61
--- /dev/null
+++ b/invest-applet/data/invest-applet-menu.xml
@@ -0,0 +1,5 @@
+<menuitem name="Refresh" action="Refresh" />
+<menuitem name="Prefs" action="Prefs" />
+<separator/>
+<menuitem name="About" action="About" />
+<menuitem name="Help" action="Help" />
diff --git a/invest-applet/invest/applet.py b/invest-applet/invest/applet.py
index a73dece..0425746 100644
--- a/invest-applet/invest/applet.py
+++ b/invest-applet/invest/applet.py
@@ -37,7 +37,7 @@ class InvestApplet(PanelApplet.Applet):
 		actiongroup.add_actions(menu_actions, None)
 
 		invest.debug("setting up menu from file");
-		self.applet.setup_menu_from_file ("/home/enrico/git/gnome-applets/invest-applet/data/Invest_Applet.xml", actiongroup);
+		self.applet.setup_menu_from_file (join(invest.defs.PKGDATADIR, "ui/invest-applet-menu.xml"), actiongroup);
 
 		invest.debug("creating icon");
 		evbox = Gtk.HBox()
diff --git a/invest-applet/invest/defs.py.in b/invest-applet/invest/defs.py.in
index 6bca4c7..5a2e732 100644
--- a/invest-applet/invest/defs.py.in
+++ b/invest-applet/invest/defs.py.in
@@ -2,6 +2,7 @@ DATA_DIR = "@DATADIR@"
 LIB_DIR = "@LIBDIR@"
 VERSION = "@VERSION@"
 PACKAGE = "@PACKAGE@"
+PKGDATADIR = "@PKGDATADIR@"
 PYTHONDIR = "@PYTHONDIR@"
 GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"
 GNOMELOCALEDIR = "@GNOMELOCALEDIR@"



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