aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-22 15:43:25 -0500
committerTed Gould <ted@canonical.com>2009-04-22 15:43:25 -0500
commita9d6d59ab9520edf6e95cb19c149275d80623c36 (patch)
treed39322c2e12b619aae16bfedd22a09ed21b919b7
parent86658a122376eb330152cb68c2f8612d415f79e0 (diff)
parent7021ff0eee6d989be93175a567065db7cde08343 (diff)
downloadayatana-indicator-messages-a9d6d59ab9520edf6e95cb19c149275d80623c36.tar.gz
ayatana-indicator-messages-a9d6d59ab9520edf6e95cb19c149275d80623c36.tar.bz2
ayatana-indicator-messages-a9d6d59ab9520edf6e95cb19c149275d80623c36.zip
* Upstream release
* Bug fixes * Update API to new libindicator
-rwxr-xr-xautogen.sh2
-rw-r--r--configure.ac14
-rw-r--r--debian/changelog8
-rw-r--r--src/Makefile.am2
-rw-r--r--src/app-menu-item.c31
-rw-r--r--src/indicator-messages.c32
6 files changed, 69 insertions, 20 deletions
diff --git a/autogen.sh b/autogen.sh
index f0cc344..1abf3a7 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-PKG_NAME="indicator-applet"
+PKG_NAME="indicator-messages"
which gnome-autogen.sh || {
echo "You need gnome-common from GNOME SVN"
diff --git a/configure.ac b/configure.ac
index 9363693..183fec8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,7 +4,7 @@ AC_INIT(src/indicator-messages.c)
AC_PREREQ(2.53)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(indicator-messages, 0.1.6)
+AM_INIT_AUTOMAKE(indicator-messages, 0.2.0dev)
AM_MAINTAINER_MODE
@@ -24,15 +24,24 @@ AC_CONFIG_MACRO_DIR([m4])
GTK_REQUIRED_VERSION=2.12
GIO_UNIX_REQUIRED_VERSION=2.18
PANEL_REQUIRED_VERSION=2.0.0
-INDICATE_REQUIRED_VERSION=0.1.5
+INDICATE_REQUIRED_VERSION=0.2.0
+INDICATOR_REQUIRED_VERSION=0.2.0
PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
+ indicator >= $INDICATOR_REQUIRED_VERSION
indicate >= $INDICATE_REQUIRED_VERSION)
AC_SUBST(APPLET_CFLAGS)
AC_SUBST(APPLET_LIBS)
###########################
+# Indicator Info
+###########################
+
+INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator`
+AC_SUBST(INDICATORDIR)
+
+###########################
# Files
###########################
@@ -64,4 +73,5 @@ AC_MSG_NOTICE([
Messaging Indicator Configuration:
Prefix: $prefix
+ Indicator Dir: $INDICATORDIR
])
diff --git a/debian/changelog b/debian/changelog
index 4a16997..64bbfd2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+indicator-messages (0.2.0~bzr116-0ubuntu1) UNRELEASED; urgency=low
+
+ * Upstream release
+ * Bug fixes
+ * Update API to new libindicator
+
+ -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 15:42:37 -0500
+
indicator-messages (0.1.6-0ubuntu1) jaunty; urgency=low
* New upstream version
diff --git a/src/Makefile.am b/src/Makefile.am
index eb6ba12..986e89d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,5 @@
-messaginglibdir = $(libdir)/indicators/1
+messaginglibdir = $(INDICATORDIR)
messaginglib_LTLIBRARIES = libmessaging.la
libmessaging_la_SOURCES = indicator-messages.c im-menu-item.c im-menu-item.h app-menu-item.c app-menu-item.h
libmessaging_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Wl,-Bsymbolic-functions -Wl,-z,defs -Wl,--as-needed
diff --git a/src/app-menu-item.c b/src/app-menu-item.c
index c769d47..7dc0f9e 100644
--- a/src/app-menu-item.c
+++ b/src/app-menu-item.c
@@ -119,6 +119,14 @@ app_menu_item_init (AppMenuItem *self)
static void
app_menu_item_dispose (GObject *object)
{
+ AppMenuItem * self = APP_MENU_ITEM(object);
+ AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
+
+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_added_cb), self);
+ g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_removed_cb), self);
+
+ g_object_unref(priv->listener);
+
G_OBJECT_CLASS (app_menu_item_parent_class)->dispose (object);
}
@@ -128,8 +136,13 @@ app_menu_item_finalize (GObject *object)
AppMenuItem * self = APP_MENU_ITEM(object);
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
- g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_added_cb), self);
- g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), G_CALLBACK(indicator_removed_cb), self);
+ if (priv->type != NULL) {
+ g_free(priv->type);
+ }
+
+ if (priv->appinfo != NULL) {
+ g_object_unref(priv->appinfo);
+ }
G_OBJECT_CLASS (app_menu_item_parent_class)->finalize (object);
@@ -144,7 +157,9 @@ app_menu_item_new (IndicateListener * listener, IndicateListenerServer * server)
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
priv->listener = listener;
+ g_object_ref(G_OBJECT(listener));
priv->server = server;
+ /* Can not ref as not real GObject */
g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added_cb), self);
g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_INDICATOR_REMOVED, G_CALLBACK(indicator_removed_cb), self);
@@ -174,8 +189,14 @@ type_cb (IndicateListener * listener, IndicateListenerServer * server, gchar * v
if (priv->type != NULL) {
g_free(priv->type);
+ priv->type = NULL;
}
+ if (value == NULL) {
+ g_warning("Type value is NULL, that shouldn't really happen");
+ return;
+ }
+
priv->type = g_strdup(value);
if (!(!g_strcmp0(priv->type, "message.instant") || !g_strcmp0(priv->type, "message.micro") || !g_strcmp0(priv->type, "message.im"))) {
@@ -200,11 +221,11 @@ update_label (AppMenuItem * self)
if (priv->count_on_label && !priv->unreadcount < 1) {
/* TRANSLATORS: This is the name of the program and the number of indicators. So it
would read something like "Mail Client (5)" */
- gchar * label = g_strdup_printf(_("%s (%d)"), g_app_info_get_name(priv->appinfo), priv->unreadcount);
+ gchar * label = g_strdup_printf(_("%s (%d)"), app_menu_item_get_name(self), priv->unreadcount);
gtk_label_set_text(GTK_LABEL(priv->name), label);
g_free(label);
} else {
- gtk_label_set_text(GTK_LABEL(priv->name), g_app_info_get_name(priv->appinfo));
+ gtk_label_set_text(GTK_LABEL(priv->name), app_menu_item_get_name(self));
}
return;
@@ -228,7 +249,7 @@ desktop_cb (IndicateListener * listener, IndicateListenerServer * server, gchar
g_return_if_fail(priv->appinfo != NULL);
update_label(self);
- g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, g_app_info_get_name(priv->appinfo), TRUE);
+ g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, app_menu_item_get_name(self), TRUE);
return;
}
diff --git a/src/indicator-messages.c b/src/indicator-messages.c
index 3df1329..e2140e3 100644
--- a/src/indicator-messages.c
+++ b/src/indicator-messages.c
@@ -24,6 +24,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <gtk/gtk.h>
#include <libindicate/listener.h>
+#include <libindicator/indicator.h>
+INDICATOR_SET_VERSION
+
#include "im-menu-item.h"
#include "app-menu-item.h"
@@ -468,23 +471,30 @@ indicator_removed (IndicateListener * listener, IndicateListenerServer * server,
return;
}
-GtkWidget *
-get_menu_item (void)
+GtkLabel *
+get_label (void)
{
- design_team_size = gtk_icon_size_register("design-team-size", 22, 22);
-
- listener = indicate_listener_new();
- serverList = NULL;
+ return NULL;
+}
- main_menu = gtk_menu_item_new();
- gtk_widget_set_name(main_menu, "fast-user-switch-menuitem");
+GtkImage *
+get_icon (void)
+{
+ design_team_size = gtk_icon_size_register("design-team-size", 22, 22);
main_image = gtk_image_new_from_icon_name("indicator-messages", DESIGN_TEAM_SIZE);
gtk_widget_show(main_image);
- gtk_container_add(GTK_CONTAINER(main_menu), main_image);
+
+ return GTK_IMAGE(main_image);
+}
+
+GtkMenu *
+get_menu (void)
+{
+ listener = indicate_listener_new();
+ serverList = NULL;
GtkWidget * submenu = gtk_menu_new();
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(main_menu), submenu);
gtk_widget_show(submenu);
g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_INDICATOR_ADDED, G_CALLBACK(indicator_added), submenu);
@@ -492,6 +502,6 @@ get_menu_item (void)
g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_ADDED, G_CALLBACK(server_added), submenu);
g_signal_connect(listener, INDICATE_LISTENER_SIGNAL_SERVER_REMOVED, G_CALLBACK(server_removed), submenu);
- return main_menu;
+ return GTK_MENU(submenu);
}