From 72ddc78d74a6022c62d1928f6777dc85b3cde28a Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Wed, 29 Feb 2012 19:22:36 +0100 Subject: Set "Since: 0.5" in the inline documentation for the new set_title and get_title functions --- src/app-indicator.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app-indicator.c b/src/app-indicator.c index 6c693e8..2a49586 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -2201,6 +2201,9 @@ app_indicator_set_secondary_activate_target (AppIndicator *self, GtkWidget *menu * the title as the first part of the line for the menu items. * * Setting @title to %NULL removes the title. + * + * Since: 0.5 + * */ void app_indicator_set_title (AppIndicator *self, const gchar * title) @@ -2350,6 +2353,9 @@ app_indicator_get_attention_icon_desc (AppIndicator *self) * app_indicator_set_title() for information on the title. * * Return value: The current title. + * + * Since: 0.5 + * */ const gchar * app_indicator_get_title (AppIndicator *self) -- cgit v1.2.3 From 63331bc7d84c4d4cf11b0746293c7264b057de0d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Mar 2012 15:57:24 -0600 Subject: Sets the title of the status icon to the title of the appindicator and the name to the ID --- src/app-indicator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app-indicator.c b/src/app-indicator.c index 6c693e8..1e24bd1 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -1510,7 +1510,8 @@ fallback (AppIndicator * self) { GtkStatusIcon * icon = gtk_status_icon_new(); - gtk_status_icon_set_title(icon, app_indicator_get_id(self)); + gtk_status_icon_set_name(icon, app_indicator_get_id(self)); + gtk_status_icon_set_title(icon, app_indicator_get_title(self)); g_signal_connect(G_OBJECT(self), APP_INDICATOR_SIGNAL_NEW_STATUS, G_CALLBACK(status_icon_status_wrapper), icon); -- cgit v1.2.3 -- cgit v1.2.3 From 002c16bd0b040dfb39468898eb904f035ea2b97c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Mar 2012 16:00:36 -0600 Subject: Handle the title changing at runtime --- src/app-indicator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app-indicator.c b/src/app-indicator.c index 1e24bd1..92aae3b 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -897,6 +897,10 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu if (oldtitle != NULL) { g_free(oldtitle); } + + if (priv->status_icon != NULL) { + gtk_status_icon_set_title(priv->status_icon, priv->title); + } break; } case PROP_LABEL_GUIDE: { -- cgit v1.2.3 From fafea8adaeafdfb79e5a5df29433a9af0b199adc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Mar 2012 16:03:37 -0600 Subject: Protecting from NULL titles, which apparently status_icon can't take :-/ --- src/app-indicator.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app-indicator.c b/src/app-indicator.c index 92aae3b..f3d0b65 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -899,7 +899,7 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu } if (priv->status_icon != NULL) { - gtk_status_icon_set_title(priv->status_icon, priv->title); + gtk_status_icon_set_title(priv->status_icon, priv->title ? priv->title : ""); } break; } @@ -1515,7 +1515,10 @@ fallback (AppIndicator * self) GtkStatusIcon * icon = gtk_status_icon_new(); gtk_status_icon_set_name(icon, app_indicator_get_id(self)); - gtk_status_icon_set_title(icon, app_indicator_get_title(self)); + const gchar * title = app_indicator_get_title(self); + if (title != NULL) { + gtk_status_icon_set_title(icon, title); + } g_signal_connect(G_OBJECT(self), APP_INDICATOR_SIGNAL_NEW_STATUS, G_CALLBACK(status_icon_status_wrapper), icon); -- cgit v1.2.3 From e2ec05db6ca4361bc6423c84edd9e2eab048c764 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 2 Mar 2012 16:30:53 -0600 Subject: Rework the icon setting function so that it can handle images that are file paths by checking to see if the files exist --- src/app-indicator.c | 84 ++++++++++++++++++++++++++--------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/app-indicator.c b/src/app-indicator.c index 6c693e8..c2ed7d0 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -1582,60 +1582,60 @@ static void status_icon_changes (AppIndicator * self, gpointer data) { GtkStatusIcon * icon = GTK_STATUS_ICON(data); - gchar *longname = NULL; - - /* add the icon_theme_path once if needed */ - GtkIconTheme *icon_theme = gtk_icon_theme_get_default(); - if (self->priv->icon_theme_path != NULL) - { - gchar **path; - gint n_elements, i; - gboolean found=FALSE; - gtk_icon_theme_get_search_path(icon_theme, &path, &n_elements); - for (i=0; i< n_elements || path[i] == NULL; i++) - { - if(g_strcmp0(path[i], self->priv->icon_theme_path) == 0) - { - found=TRUE; - break; - } - } - if(!found) - gtk_icon_theme_append_search_path(icon_theme, self->priv->icon_theme_path); - g_strfreev (path); - } + /* add the icon_theme_path once if needed */ + GtkIconTheme *icon_theme = gtk_icon_theme_get_default(); + if (self->priv->icon_theme_path != NULL) { + gchar **path; + gint n_elements, i; + gboolean found=FALSE; + gtk_icon_theme_get_search_path(icon_theme, &path, &n_elements); + for (i=0; i< n_elements || path[i] == NULL; i++) { + if(g_strcmp0(path[i], self->priv->icon_theme_path) == 0) { + found=TRUE; + break; + } + } + if(!found) { + gtk_icon_theme_append_search_path(icon_theme, self->priv->icon_theme_path); + } + g_strfreev (path); + } + + const gchar * icon_name = NULL; switch (app_indicator_get_status(self)) { case APP_INDICATOR_STATUS_PASSIVE: - /* hide first to avoid that the change is visible to the user */ - gtk_status_icon_set_visible(icon, FALSE); - longname = append_panel_icon_suffix(app_indicator_get_icon(self)); - if (gtk_icon_theme_has_icon (icon_theme, longname)) - gtk_status_icon_set_from_icon_name(icon, longname); - else - gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self)); + /* hide first to avoid that the change is visible to the user */ + gtk_status_icon_set_visible(icon, FALSE); + icon_name = app_indicator_get_icon(self); break; case APP_INDICATOR_STATUS_ACTIVE: - longname = append_panel_icon_suffix(app_indicator_get_icon(self)); - if (gtk_icon_theme_has_icon (icon_theme, longname)) - gtk_status_icon_set_from_icon_name(icon, longname); - else - gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self)); + icon_name = app_indicator_get_icon(self); gtk_status_icon_set_visible(icon, TRUE); break; case APP_INDICATOR_STATUS_ATTENTION: - /* get the _attention_ icon here */ - longname = append_panel_icon_suffix(app_indicator_get_attention_icon(self)); - if (gtk_icon_theme_has_icon (icon_theme, longname)) - gtk_status_icon_set_from_icon_name(icon, longname); - else - gtk_status_icon_set_from_icon_name(icon, app_indicator_get_icon(self)); + /* get the _attention_ icon here */ + icon_name = app_indicator_get_attention_icon(self); gtk_status_icon_set_visible(icon, TRUE); break; }; - if (longname) { - g_free(longname); + if (icon_name != NULL) { + if (g_file_test(icon_name, G_FILE_TEST_EXISTS)) { + gtk_status_icon_set_from_file(icon, icon_name); + } else { + gchar *longname = append_panel_icon_suffix(icon_name); + + if (longname != NULL && gtk_icon_theme_has_icon (icon_theme, longname)) { + gtk_status_icon_set_from_icon_name(icon, longname); + } else { + gtk_status_icon_set_from_icon_name(icon, icon_name); + } + + if (longname) { + g_free(longname); + } + } } return; -- cgit v1.2.3 -- cgit v1.2.3 From be2eef52dad67332388bb47b75b2918d58025211 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Mar 2012 16:52:50 -0600 Subject: Removing unneeded NULL check --- src/app-indicator.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/app-indicator.c b/src/app-indicator.c index c2ed7d0..41f0a05 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -1632,9 +1632,7 @@ status_icon_changes (AppIndicator * self, gpointer data) gtk_status_icon_set_from_icon_name(icon, icon_name); } - if (longname) { - g_free(longname); - } + g_free(longname); } } -- cgit v1.2.3 From 5ab2da4018b3709f48f6688dcbda728f096ffc18 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 6 Mar 2012 19:14:42 -0600 Subject: generate app-indicator.sources.xml (for mono bindings) and appindicator.override (for python bindings) at configure time so that they can take into account top_builddir vs top_srcdir differences. --- bindings/mono/Makefile.am | 6 +-- bindings/mono/app-indicator.sources.xml | 12 ------ bindings/mono/app-indicator.sources.xml.in | 12 ++++++ bindings/python/Makefile.am | 9 ++--- bindings/python/appindicator.override | 65 ------------------------------ bindings/python/appindicator.override.in | 65 ++++++++++++++++++++++++++++++ configure.ac | 2 + 7 files changed, 86 insertions(+), 85 deletions(-) delete mode 100644 bindings/mono/app-indicator.sources.xml create mode 100644 bindings/mono/app-indicator.sources.xml.in delete mode 100644 bindings/python/appindicator.override create mode 100644 bindings/python/appindicator.override.in diff --git a/bindings/mono/Makefile.am b/bindings/mono/Makefile.am index f4a59a8..6f8e8a9 100644 --- a/bindings/mono/Makefile.am +++ b/bindings/mono/Makefile.am @@ -66,7 +66,7 @@ EXTRA_DIST = \ $(METADATA) \ appindicator-sharp-0.1.pc.in \ appindicator-sharp.dll.config.in \ - app-indicator.sources.xml \ + app-indicator.sources.xml.in \ $(ASSEMBLY_NAME).snk \ $(POLICY).config.in \ $(POLICY1).config.in \ @@ -85,13 +85,13 @@ test_references = $(GTK_SHARP_LIBS) $(NUNIT_LIBS) $(MONO_NUNIT_LIBS) -r:$(ASSEMB endif $(RAW_API): app-indicator.sources.xml $(WRAPPER_FREE_BINDING) - $(GAPI_PARSER) $(srcdir)/app-indicator.sources.xml + $(GAPI_PARSER) app-indicator.sources.xml $(WRAPPER_FREE_BINDING): $(WRAPPER_FREE_BINDING_SRC) sed '/signals\[X_NEW_LABEL\] /,+6d' $(WRAPPER_FREE_BINDING_SRC) > $(WRAPPER_FREE_BINDING) $(MIDDLE_API): $(METADATA) $(RAW_API) - cp $(srcdir)/$(RAW_API) $(MIDDLE_API) + cp $(RAW_API) $(MIDDLE_API) chmod u+w $(MIDDLE_API) @if test -n '$(METADATA)'; then \ echo "$(GAPI_FIXUP) --api=$(MIDDLE_API) --metadata=$(srcdir)/$(METADATA)"; \ diff --git a/bindings/mono/app-indicator.sources.xml b/bindings/mono/app-indicator.sources.xml deleted file mode 100644 index 6cf28e9..0000000 --- a/bindings/mono/app-indicator.sources.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - app-indicator.c - ../../src/app-indicator-enum-types.c - ../../src/app-indicator-enum-types.h - ../../src/app-indicator.h - - - - diff --git a/bindings/mono/app-indicator.sources.xml.in b/bindings/mono/app-indicator.sources.xml.in new file mode 100644 index 0000000..7f8e869 --- /dev/null +++ b/bindings/mono/app-indicator.sources.xml.in @@ -0,0 +1,12 @@ + + + + + @top_builddir@/bindings/mono/app-indicator.c + @top_builddir@/src/app-indicator-enum-types.c + @top_builddir@/src/app-indicator-enum-types.h + @top_srcdir@/src/app-indicator.h + + + + diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am index 7febc11..fe95c02 100644 --- a/bindings/python/Makefile.am +++ b/bindings/python/Makefile.am @@ -25,16 +25,15 @@ _appindicator_la_SOURCES = appindicatormodule.c nodist__appindicator_la_SOURCES = appindicator.c CLEANFILES = appindicator.c -EXTRA_DIST = appindicator.override appindicator-arg-types.py $(defs_DATA) +EXTRA_DIST = appindicator.override.in appindicator-arg-types.py $(defs_DATA) appindicator.c: $(defs_DATA) appindicator.override %.c: %.defs - (cd $(srcdir) \ - && $(PYGTK_CODEGEN) \ + ($(PYGTK_CODEGEN) \ --register $(PYGTK_DEFSDIR)/gtk-types.defs \ --register $(PYGTK_DEFSDIR)/gdk-types.defs \ - --load-types appindicator-arg-types.py \ + --load-types $(srcdir)/appindicator-arg-types.py \ --override $*.override \ - --prefix py$* $*.defs) > gen-$*.c \ + --prefix py$* $(srcdir)/$*.defs) > gen-$*.c \ && cp gen-$*.c $*.c \ && rm -f gen-$*.c diff --git a/bindings/python/appindicator.override b/bindings/python/appindicator.override deleted file mode 100644 index b252994..0000000 --- a/bindings/python/appindicator.override +++ /dev/null @@ -1,65 +0,0 @@ -/* -Python bindings for libappindicator. - -Copyright 2009 Canonical Ltd. - -Authors: - Eitan Isaacson (original) - Neil Jagdish Patel - -This program is free software: you can redistribute it and/or modify it -under the terms of either or both of the following licenses: - -1) the GNU Lesser General Public License version 3, as published by the -Free Software Foundation; and/or -2) the GNU Lesser General Public License version 2.1, as published by -the Free Software Foundation. - -This program is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranties of -MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR -PURPOSE. See the applicable version of the GNU Lesser General Public -License for more details. - -You should have received a copy of both the GNU Lesser General Public -License version 3 and version 2.1 along with this program. If not, see - -*/ -%% -headers -#include -#include "../src/app-indicator.h" -#include "../src/app-indicator-enum-types.h" -#include -#include "pygobject.h" -#include "pyglib.h" -#include - -typedef PyObject* (*to_pyobject_func) (gpointer data); - -#define APP_TYPE_INDICATOR APP_INDICATOR_TYPE - -void -_appindicator_add_constants(PyObject *module, const gchar *strip_prefix) -{ -#ifdef VERSION - PyModule_AddStringConstant(module, "__version__", VERSION); -#endif - pyg_enum_add(module, - "IndicatorCategory", - strip_prefix, - APP_INDICATOR_TYPE_INDICATOR_CATEGORY); - - pyg_enum_add(module, - "IndicatorStatus", - strip_prefix, - APP_INDICATOR_TYPE_INDICATOR_STATUS); - - if (PyErr_Occurred()) - PyErr_Print(); -} -%% -modulename appindicator -%% -import gobject.GObject as PyGObject_Type -import gtk.Menu as PyGtkMenu_Type diff --git a/bindings/python/appindicator.override.in b/bindings/python/appindicator.override.in new file mode 100644 index 0000000..84d3159 --- /dev/null +++ b/bindings/python/appindicator.override.in @@ -0,0 +1,65 @@ +/* +Python bindings for libappindicator. + +Copyright 2009 Canonical Ltd. + +Authors: + Eitan Isaacson (original) + Neil Jagdish Patel + +This program is free software: you can redistribute it and/or modify it +under the terms of either or both of the following licenses: + +1) the GNU Lesser General Public License version 3, as published by the +Free Software Foundation; and/or +2) the GNU Lesser General Public License version 2.1, as published by +the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR +PURPOSE. See the applicable version of the GNU Lesser General Public +License for more details. + +You should have received a copy of both the GNU Lesser General Public +License version 3 and version 2.1 along with this program. If not, see + +*/ +%% +headers +#include +#include "@top_srcdir@/src/app-indicator.h" +#include "@top_builddir@/src/app-indicator-enum-types.h" +#include +#include "pygobject.h" +#include "pyglib.h" +#include + +typedef PyObject* (*to_pyobject_func) (gpointer data); + +#define APP_TYPE_INDICATOR APP_INDICATOR_TYPE + +void +_appindicator_add_constants(PyObject *module, const gchar *strip_prefix) +{ +#ifdef VERSION + PyModule_AddStringConstant(module, "__version__", VERSION); +#endif + pyg_enum_add(module, + "IndicatorCategory", + strip_prefix, + APP_INDICATOR_TYPE_INDICATOR_CATEGORY); + + pyg_enum_add(module, + "IndicatorStatus", + strip_prefix, + APP_INDICATOR_TYPE_INDICATOR_STATUS); + + if (PyErr_Occurred()) + PyErr_Print(); +} +%% +modulename appindicator +%% +import gobject.GObject as PyGObject_Type +import gtk.Menu as PyGtkMenu_Type diff --git a/configure.ac b/configure.ac index 127307e..7c067e9 100644 --- a/configure.ac +++ b/configure.ac @@ -228,9 +228,11 @@ bindings/Makefile bindings/mono/Makefile bindings/mono/appindicator-sharp.dll.config bindings/mono/appindicator-sharp-0.1.pc +bindings/mono/app-indicator.sources.xml bindings/mono/examples/Makefile bindings/mono/examples/indicator-example bindings/python/Makefile +bindings/python/appindicator.override bindings/vala/Makefile bindings/vala/examples/Makefile tests/Makefile -- cgit v1.2.3 From ef62b5307867f1c0891c67e459c6ccb0e96d1c8e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Mar 2012 11:52:58 -0600 Subject: Include an index for 0.5 --- docs/reference/libappindicator-docs.sgml.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/reference/libappindicator-docs.sgml.in b/docs/reference/libappindicator-docs.sgml.in index 67c7cc6..b6f8009 100644 --- a/docs/reference/libappindicator-docs.sgml.in +++ b/docs/reference/libappindicator-docs.sgml.in @@ -25,6 +25,10 @@ API Index + + API 0.5 Index + + Deprecated API Index -- cgit v1.2.3 From 244c4362451efb697bd33db8a6cd76a947be631b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Mar 2012 12:01:32 -0600 Subject: Update to new actions format in libindicator --- configure.ac | 2 +- tests/test-libappindicator.desktop | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 7c067e9..5c5c52b 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,7 @@ GTK_REQUIRED_VERSION=2.18 GTK3_REQUIRED_VERSION=2.91 GLIB_REQUIRED_VERSION=2.26 GIO_REQUIRED_VERSION=2.26 -INDICATOR_REQUIRED_VERSION=0.3.5 +INDICATOR_REQUIRED_VERSION=0.4.93 DBUSMENUGTK_REQUIRED_VERSION=0.5.90 DBUS_GLIB_REQUIRED_VERSION=0.82 diff --git a/tests/test-libappindicator.desktop b/tests/test-libappindicator.desktop index f8a72f3..4747030 100644 --- a/tests/test-libappindicator.desktop +++ b/tests/test-libappindicator.desktop @@ -5,20 +5,19 @@ Comment=This is only a test Exec=/usr/bin/false Terminal=false Type=Application -X-Ayatana-Desktop-Shortcuts=Short1;Short2;Short3; -TargetEnvironment=Test Program; +Actions=Short1;Short2;Short3; -[Short1 Shortcut Group] +[Desktop Action Short1] Name=Shortcut 1 Exec=/usr/bin/true -TargetEnvironment=Test Program; +OnlyShowIn=Test Program; -[Short2 Shortcut Group] +[Desktop Action Short2] Name=Shortcut 2 Exec=/usr/bin/true -TargetEnvironment=Test Program; +OnlyShowIn=Test Program; -[Short3 Shortcut Group] +[Desktop Action Short3] Name=Shortcut 3 Exec=/usr/bin/true -TargetEnvironment=Test Program; +OnlyShowIn=Test Program; -- cgit v1.2.3 From f95bf78035fd4e550a67b74e902c0c2ba7df15bc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 9 Mar 2012 12:01:42 -0600 Subject: 0.4.91 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5c5c52b..054c0a7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([libappindicator], - [0.4.90], + [0.4.91], [http://bugs.launchpad.net/libappindicator], [libappindicator], [http://launchpad.net/libappindicator]) -- cgit v1.2.3