diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2007-09-21 19:11:35 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2007-09-21 19:11:35 +0800 |
commit | 004e5e331b89484f2448ab81d0e97cfc3b47af18 (patch) | |
tree | 4eea8d5349942d490b4ef9fac9c6c62d91177a20 /nothere | |
parent | 1382956b87b5114aa35f4357d7edcf9d5507a2c0 (diff) | |
download | gsoc2013-empathy-004e5e331b89484f2448ab81d0e97cfc3b47af18.tar gsoc2013-empathy-004e5e331b89484f2448ab81d0e97cfc3b47af18.tar.gz gsoc2013-empathy-004e5e331b89484f2448ab81d0e97cfc3b47af18.tar.bz2 gsoc2013-empathy-004e5e331b89484f2448ab81d0e97cfc3b47af18.tar.lz gsoc2013-empathy-004e5e331b89484f2448ab81d0e97cfc3b47af18.tar.xz gsoc2013-empathy-004e5e331b89484f2448ab81d0e97cfc3b47af18.tar.zst gsoc2013-empathy-004e5e331b89484f2448ab81d0e97cfc3b47af18.zip |
Fix ref count error for account objects.
2007-09-21 Xavier Claessens <xclaesse@gmail.com>
* libempathy-gtk/empathy-contact-list-view.c: Fix ref count error for
account objects.
* libempathy/empathy-contact-manager.c: Disconnect signals from
MissionControl object when finalising the contact manager.
* configure.ac:
* megaphone/src/megaphone-applet.c:
* megaphone/src/Makefile.am:
* megaphone/src/megaphone-applet.h:
* megaphone/data/GNOME_Megaphone_Applet.schemas.in:
* megaphone/data/Makefile.am:
* megaphone/data/GNOME_Megaphone_Applet.server.in.in:
* megaphone/data/GNOME_Megaphone_Applet.xml:
* megaphone/Makefile.am:
* nothere/src/nothere-applet.c:
* nothere/src/Makefile.am:
* nothere/src/nothere-applet.h:
* nothere/data/Makefile.am:
* nothere/data/GNOME_NotHere_Applet.server.in.in:
* nothere/data/GNOME_NotHere_Applet.xml:
* nothere/Makefile.am:
* Makefile.am:
* po/POTFILES.in:
* po/POTFILES.skip: Add Megaphone and Nothere applets. Fixes bug
#464954 (Raphael Slinckx, Xavier Claessens).
svn path=/trunk/; revision=303
Diffstat (limited to 'nothere')
-rw-r--r-- | nothere/Makefile.am | 2 | ||||
-rw-r--r-- | nothere/data/GNOME_NotHere_Applet.server.in.in | 25 | ||||
-rw-r--r-- | nothere/data/GNOME_NotHere_Applet.xml | 7 | ||||
-rw-r--r-- | nothere/data/Makefile.am | 35 | ||||
-rw-r--r-- | nothere/src/Makefile.am | 17 | ||||
-rw-r--r-- | nothere/src/nothere-applet.c | 120 | ||||
-rw-r--r-- | nothere/src/nothere-applet.h | 52 |
7 files changed, 258 insertions, 0 deletions
diff --git a/nothere/Makefile.am b/nothere/Makefile.am new file mode 100644 index 000000000..85d5f7528 --- /dev/null +++ b/nothere/Makefile.am @@ -0,0 +1,2 @@ +SUBDIRS = src data + diff --git a/nothere/data/GNOME_NotHere_Applet.server.in.in b/nothere/data/GNOME_NotHere_Applet.server.in.in new file mode 100644 index 000000000..e76ad14d2 --- /dev/null +++ b/nothere/data/GNOME_NotHere_Applet.server.in.in @@ -0,0 +1,25 @@ +<oaf_info> + +<oaf_server iid="OAFIID:GNOME_NotHere_Applet_Factory" type="exe" location="@LIBEXECDIR@/nothere-applet"> + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:Bonobo/GenericFactory:1.0"/> + <item value="IDL:Bonobo/Unknown:1.0"/> + </oaf_attribute> + <oaf_attribute name="name" type="string" _value="Presence"/> + <oaf_attribute name="description" type="string" _value="Set your own presence"/> +</oaf_server> + +<oaf_server iid="OAFIID:GNOME_NotHere_Applet" type="factory" location="OAFIID:GNOME_NotHere_Applet_Factory"> + + <oaf_attribute name="repo_ids" type="stringv"> + <item value="IDL:GNOME/Vertigo/PanelAppletShell:1.0"/> + <item value="IDL:Bonobo/Control:1.0"/> + <item value="IDL:Bonobo/Unknown:1.0"/> + </oaf_attribute> + <oaf_attribute name="name" type="string" _value="Presence"/> + <oaf_attribute name="description" type="string" _value="Set your own presence"/> + <oaf_attribute name="panel:category" type="string" value="Internet"/> + <oaf_attribute name="panel:icon" type="string" value="empathy.png"/> +</oaf_server> + +</oaf_info> diff --git a/nothere/data/GNOME_NotHere_Applet.xml b/nothere/data/GNOME_NotHere_Applet.xml new file mode 100644 index 000000000..5d425f108 --- /dev/null +++ b/nothere/data/GNOME_NotHere_Applet.xml @@ -0,0 +1,7 @@ +<Root> + <popups> + <popup name="button3"> + <menuitem name="About" verb="about" _label="_About" pixtype="stock" pixname="gtk-about"/> + </popup> + </popups> +</Root> diff --git a/nothere/data/Makefile.am b/nothere/data/Makefile.am new file mode 100644 index 000000000..4aa92147f --- /dev/null +++ b/nothere/data/Makefile.am @@ -0,0 +1,35 @@ +# Panel applet bonobo stuff +serverdir = $(libdir)/bonobo/servers +server_in_files = GNOME_NotHere_Applet.server.in +server_DATA = $(server_in_files:.server.in=.server) + + +# GConf Schemas +#schemadir = $(GCONF_SCHEMA_FILE_DIR) +#schema_in_files = GNOME_NotHere_Applet.schemas.in +#schema_DATA = $(schema_in_files:.schemas.in=.schemas) + +# Misc data +resourcesdir = $(pkgdatadir) +resources_DATA = \ + GNOME_NotHere_Applet.xml +# nothere-applet.glade + +notherebindir = $(libexecdir) + +# Build rules +@INTLTOOL_SERVER_RULE@ +@INTLTOOL_SCHEMAS_RULE@ + +$(server_in_files): $(server_in_files:.server.in=.server.in.in) + sed -e "s|\@LIBEXECDIR\@|$(notherebindir)|" $< > $@ + +DISTCLEANFILES = \ + $(server_DATA) \ + $(server_in_files) +# $(schema_DATA) + +EXTRA_DIST = \ + GNOME_NotHere_Applet.server.in.in \ + $(resources_DATA) +# $(schema_in_files) diff --git a/nothere/src/Makefile.am b/nothere/src/Makefile.am new file mode 100644 index 000000000..b4b016afc --- /dev/null +++ b/nothere/src/Makefile.am @@ -0,0 +1,17 @@ +AM_CPPFLAGS = \ + -I$(top_srcdir) \ + -DPKGDATADIR=\""$(pkgdatadir)"\" \ + -DGNOMELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \ + -DIMAGEDIR=\"$(datadir)/empathy\" \ + $(NOTHERE_CFLAGS) $(WARN_CFLAGS) + +libexec_PROGRAMS = nothere-applet +nothere_applet_SOURCES = \ + nothere-applet.c nothere-applet.h + +nothere_applet_LDFLAGS = \ + $(NOTHERE_LIBS) + +nothere_applet_LDADD = \ + $(top_builddir)/libempathy/libempathy.la \ + $(top_builddir)/libempathy-gtk/libempathy-gtk.la diff --git a/nothere/src/nothere-applet.c b/nothere/src/nothere-applet.c new file mode 100644 index 000000000..5d225698b --- /dev/null +++ b/nothere/src/nothere-applet.c @@ -0,0 +1,120 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2007 Raphaël Slinckx <raphael@slinckx.net> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Authors: Raphaël Slinckx <raphael@slinckx.net> + */ + +#include "config.h" + +#include <string.h> + +#include <glib/gi18n.h> +#include <gtk/gtk.h> +#include <bonobo/bonobo-ui-component.h> + +#include <libmissioncontrol/mission-control.h> +#include <libempathy-gtk/empathy-presence-chooser.h> + +#include "nothere-applet.h" + +G_DEFINE_TYPE(NotHereApplet, nothere_applet, PANEL_TYPE_APPLET) + +static void nothere_applet_destroy (GtkObject *object); +static void nothere_applet_about_cb (BonoboUIComponent *uic, + NotHereApplet *applet, + const gchar *verb_name); + +static const BonoboUIVerb nothere_applet_menu_verbs [] = { + BONOBO_UI_UNSAFE_VERB ("about", nothere_applet_about_cb), + BONOBO_UI_VERB_END +}; + +static const char* authors[] = { + "Raphaël Slinckx <raphael@slinckx.net>", + NULL +}; + +static void +nothere_applet_class_init (NotHereAppletClass *class) +{ + GTK_OBJECT_CLASS (class)->destroy = nothere_applet_destroy; +} + +static void +nothere_applet_init (NotHereApplet *applet) +{ + applet->presence_chooser = empathy_presence_chooser_new (); + gtk_widget_show (applet->presence_chooser); + + gtk_container_add (GTK_CONTAINER (applet), applet->presence_chooser); + + panel_applet_set_flags (PANEL_APPLET (applet), PANEL_APPLET_EXPAND_MINOR); + panel_applet_set_background_widget (PANEL_APPLET (applet), GTK_WIDGET (applet)); +} + +static void +nothere_applet_destroy (GtkObject *object) +{ + NotHereApplet *applet = NOTHERE_APPLET (object); + + applet->presence_chooser = NULL; + + (* GTK_OBJECT_CLASS (nothere_applet_parent_class)->destroy) (object); +} + +static void +nothere_applet_about_cb (BonoboUIComponent *uic, + NotHereApplet *applet, + const gchar *verb_name) +{ + gtk_show_about_dialog (NULL, + "name", "Presence", + "version", PACKAGE_VERSION, + "copyright", "Copyright \xc2\xa9 2007 Raphaël Slinckx", + "comments", _("Set your own presence"), + "authors", authors, + "logo-icon-name", "stock_people", + NULL); +} + +static gboolean +nothere_applet_factory (PanelApplet *applet, + const gchar *iid, + gpointer data) +{ + if (strcmp (iid, "OAFIID:GNOME_NotHere_Applet") != 0) { + return FALSE; + } + + /* Set up the menu */ + panel_applet_setup_menu_from_file (applet, + PKGDATADIR, + "GNOME_NotHere_Applet.xml", + NULL, + nothere_applet_menu_verbs, + applet); + + gtk_widget_show (GTK_WIDGET (applet)); + return TRUE; +} + +PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_NotHere_Applet_Factory", + NOTHERE_TYPE_APPLET, + "Presence", PACKAGE_VERSION, + nothere_applet_factory, + NULL); diff --git a/nothere/src/nothere-applet.h b/nothere/src/nothere-applet.h new file mode 100644 index 000000000..37e5d91a6 --- /dev/null +++ b/nothere/src/nothere-applet.h @@ -0,0 +1,52 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2007 Raphaël Slinckx <raphael@slinckx.net> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Authors: Raphaël Slinckx <raphael@slinckx.net> + */ + +#ifndef __NOTHERE_APPLET_H__ +#define __NOTHERE_APPLET_H__ + +#include <panel-applet.h> + +G_BEGIN_DECLS + +#define NOTHERE_TYPE_APPLET (nothere_applet_get_type ()) +#define NOTHERE_APPLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NOTHERE_TYPE_APPLET, NotHereApplet)) +#define NOTHERE_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NOTHERE_TYPE_APPLET, NotHereAppletClass)) +#define NOTHERE_IS_APPLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NOTHERE_TYPE_APPLET)) +#define NOTHERE_IS_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NOTHERE_TYPE_APPLET)) +#define NOTHERE_APPLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NOTHERE_TYPE_APPLET, NotHereAppletClass)) + +typedef struct _NotHereApplet NotHereApplet; +typedef struct _NotHereAppletClass NotHereAppletClass; + +struct _NotHereApplet { + PanelApplet applet; + GtkWidget *presence_chooser; +}; + +struct _NotHereAppletClass { + PanelAppletClass parent_class; +}; + +GType nothere_applet_get_type (void); + +G_END_DECLS + +#endif /* __NOTHERE_APPLET_H__ */ |