[byzanz] Port to libpanel-applet-3
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [byzanz] Port to libpanel-applet-3
- Date: Fri, 23 Jul 2010 17:38:27 +0000 (UTC)
commit 908521bc87e6bc1dca8a3b257f98d8945b3e9257
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Fri Jul 23 17:30:07 2010 +0200
Port to libpanel-applet-3
configure.ac | 4 +-
po/POTFILES.in | 2 +-
src/ByzanzApplet.server.in.in | 36 --------------------
src/Makefile.am | 31 ++++++++++++-----
src/byzanzapplet.c | 35 ++++++++++++++-----
src/byzanzapplet.xml | 10 +----
src/org.gnome.ByzanzApplet.panel-applet.in.in | 16 +++++++++
...ome.panel.applet.ByzanzAppletFactory.service.in | 3 ++
8 files changed, 72 insertions(+), 65 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 331e780..9be3737 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,7 +66,7 @@ dnl ====================================
CAIRO_REQ="1.8.10"
GTK_REQ="2.17.10"
GTHREAD_REQ="2.6.0"
-APPLET_REQ="2.10.0"
+APPLET_REQ="2.31.2"
XDAMAGE_REQ="1.0"
GST_REQ="0.10.24"
@@ -74,7 +74,7 @@ PKG_CHECK_MODULES(GTK, cairo >= $CAIRO_REQ gtk+-2.0 >= $GTK_REQ x11 gio-2.0)
PKG_CHECK_MODULES(GTHREAD, xdamage >= $XDAMAGE_REQ gthread-2.0 >= $GTHREAD_REQ)
-PKG_CHECK_MODULES(APPLET, libpanelapplet-2.0 >= $APPLET_REQ)
+PKG_CHECK_MODULES(APPLET, libpanelapplet-3.0 >= $APPLET_REQ)
PKG_CHECK_MODULES(GST, gstreamer-app-0.10 >= $GST_REQ gstreamer-0.10 >= $GST_REQ)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 784c341..48d4e84 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -15,7 +15,7 @@ src/byzanzrecorder.c
src/byzanzselect.c
src/byzanzserialize.c
src/byzanzsession.c
-src/ByzanzApplet.server.in.in
+src/org.gnome.ByzanzApplet.panel-applet.in.in
src/paneltogglebutton.c
src/playback.c
src/record.c
diff --git a/src/Makefile.am b/src/Makefile.am
index 9ce716d..151a970 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -68,7 +68,7 @@ byzanz_applet_SOURCES = \
paneltogglebutton.c \
screenshot-utils.c
-byzanz_applet_CFLAGS = $(APPLET_CFLAGS)
+byzanz_applet_CFLAGS = -DBYZANZ_MENU_UI_DIR=\""$(uidir)"\" $(APPLET_CFLAGS)
byzanz_applet_LDADD = $(APPLET_LIBS) ./libbyzanz.la
@@ -91,24 +91,37 @@ install-data-local:
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schemas_DATA) ;
endif
-serverdir = $(libdir)/bonobo/servers
-server_in_files = ByzanzApplet.server.in
-server_DATA = $(server_in_files:.server.in=.server)
+appletdir = $(datadir)/gnome-panel/applets
+applet_in_files = org.gnome.ByzanzApplet.panel-applet.in
+applet_DATA = $(applet_in_files:.panel-applet.in=.panel-applet)
-$(server_in_files): $(server_in_files:.server.in=.server.in.in)
- sed -e "s|\ LIBEXECDIR\@|$(libexecdir)|" $< > $@
+$(applet_in_files): $(applet_in_files).in Makefile
+ sed \
+ -e "s|\ LIBEXECDIR\@|$(libexecdir)|" \
+ -e "s|\ VERSION\@|$(PACKAGE_VERSION)|" \
+ $< > $@
+
+%.panel-applet: %.panel-applet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
+
+servicedir = $(datadir)/dbus-1/services
+service_in_files = org.gnome.panel.applet.ByzanzAppletFactory.service.in
+service_DATA = $(service_in_files:.service.in=.service)
+
+org.gnome.panel.applet.ByzanzAppletFactory.service: $(service_in_files)
+ sed \
+ -e "s|\ LIBEXECDIR\@|$(libexecdir)|" \
+ $< > $@
uidir = $(datadir)/gnome-2.0/ui
ui_DATA = byzanzapplet.xml
-CLEANFILES = $(server_in_files) $(server_DATA) $(schemas_DATA) $(BUILT_SOURCES)
+CLEANFILES = $(applet_DATA) $(applet_DATA).in $(service_DATA) $(schemas_DATA) $(BUILT_SOURCES)
EXTRA_DIST = \
byzanzmarshal.list \
- ByzanzApplet.server.in.in \
+ org.gnome.ByzanzApplet.panel-applet.in.in \
$(man_MANS) \
$(ui_DATA) \
$(schemas_in_files)
- INTLTOOL_SERVER_RULE@
diff --git a/src/byzanzapplet.c b/src/byzanzapplet.c
index 2041a35..44ceaaa 100644
--- a/src/byzanzapplet.c
+++ b/src/byzanzapplet.c
@@ -357,7 +357,7 @@ destroy_applet (GtkWidget *widget, AppletPrivate *priv)
}
static void
-byzanz_about_cb (BonoboUIComponent *uic, AppletPrivate *priv, const char *verb)
+byzanz_about_cb (GtkAction *action, AppletPrivate *priv)
{
const gchar *authors[] = {
"Benjamin Otte <otte gnome org>",
@@ -374,15 +374,18 @@ byzanz_about_cb (BonoboUIComponent *uic, AppletPrivate *priv, const char *verb)
NULL );
}
-static const BonoboUIVerb byzanz_menu_verbs [] = {
- BONOBO_UI_UNSAFE_VERB ("ByzanzAbout", byzanz_about_cb),
- BONOBO_UI_VERB_END
+static const GtkActionEntry byzanz_menu_actions [] = {
+ { "ByzanzAbout", GTK_STOCK_ABOUT, N_("_About"),
+ NULL, NULL,
+ G_CALLBACK (byzanz_about_cb) }
};
static gboolean
byzanz_applet_fill (PanelApplet *applet, const gchar *iid, gpointer data)
{
AppletPrivate *priv;
+ GtkActionGroup *action_group;
+ char *ui_path;
char *method;
if (!index_quark)
@@ -401,8 +404,19 @@ byzanz_applet_fill (PanelApplet *applet, const gchar *iid, gpointer data)
panel_applet_add_preferences (applet, "/schemas/apps/byzanz-applet/prefs",
NULL);
panel_applet_set_flags (applet, PANEL_APPLET_EXPAND_MINOR);
- panel_applet_setup_menu_from_file (PANEL_APPLET (applet),
- DATADIR, "byzanzapplet.xml", NULL, byzanz_menu_verbs, priv);
+ action_group = gtk_action_group_new ("Byzanz Applet Actions");
+#ifdef GETTEXT_PACKAGE
+ gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE);
+#endif
+ gtk_action_group_add_actions (action_group,
+ byzanz_menu_actions,
+ G_N_ELEMENTS (byzanz_menu_actions),
+ priv);
+ ui_path = g_build_filename (BYZANZ_MENU_UI_DIR, "byzanzapplet.xml", NULL);
+ panel_applet_setup_menu_from_file (PANEL_APPLET (applet),
+ ui_path, action_group);
+ g_free (ui_path);
+ g_object_unref (action_group);
priv->tooltips = gtk_tooltips_new ();
@@ -425,7 +439,10 @@ byzanz_applet_fill (PanelApplet *applet, const gchar *iid, gpointer data)
return TRUE;
}
-PANEL_APPLET_BONOBO_FACTORY ("OAFIID:ByzanzApplet_Factory",
- PANEL_TYPE_APPLET, "ByzanzApplet", "0",
- byzanz_applet_fill, NULL);
+PANEL_APPLET_OUT_PROCESS_FACTORY ("ByzanzAppletFactory",
+ PANEL_TYPE_APPLET,
+ "ByzanzApplet",
+ byzanz_applet_fill,
+ NULL)
+
diff --git a/src/byzanzapplet.xml b/src/byzanzapplet.xml
index c817977..d3a6d6c 100644
--- a/src/byzanzapplet.xml
+++ b/src/byzanzapplet.xml
@@ -1,8 +1,2 @@
-<Root>
- <popups>
- <popup name="button3">
- <menuitem name="Byzanz About Item" verb="ByzanzAbout" _label="_About"
- pixtype="stock" pixname="gnome-stock-about"/>
- </popup>
- </popups>
-</Root>
+<menuitem name="Byzanz About Item" action="ByzanzAbout"/>
+
diff --git a/src/org.gnome.ByzanzApplet.panel-applet.in.in b/src/org.gnome.ByzanzApplet.panel-applet.in.in
new file mode 100644
index 0000000..bc611c9
--- /dev/null
+++ b/src/org.gnome.ByzanzApplet.panel-applet.in.in
@@ -0,0 +1,16 @@
+[Applet Factory]
+Id=ByzanzAppletFactory
+Location= LIBEXECDIR@/byzanz-applet
+_Name=Byzanz Factory
+_Description=Byzanz Factory
+
+[ByzanzApplet]
+_Name=Desktop Recorder
+_Description=Record what's happening on your desktop
+Icon=byzanz-record-desktop.png
+BonoboId=OAFIID:ByzanzApplet
+X-GNOME-Bugzilla-Bugzilla=GNOME
+X-GNOME-Bugzilla-Product=byzanz
+X-GNOME-Bugzilla-Component=applet
+X-GNOME-Bugzilla-Version= VERSION@
+X-GNOME-Bugzilla-OtherBinaries=byzanz-applet
diff --git a/src/org.gnome.panel.applet.ByzanzAppletFactory.service.in b/src/org.gnome.panel.applet.ByzanzAppletFactory.service.in
new file mode 100644
index 0000000..492be10
--- /dev/null
+++ b/src/org.gnome.panel.applet.ByzanzAppletFactory.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.panel.applet.ByzanzAppletFactory
+Exec= LIBEXECDIR@/byzanz-applet
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]