aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-02-17 19:24:51 +0100
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-02-17 19:24:51 +0100
commit66cdfa18d909ad66f376b217047664235ccfc6f8 (patch)
treee1e1aa2b20a583a22b3986ffd8aaab1641587205
parent8ce897a37ffe58051684fba7478a2f076aeec57d (diff)
parent8e95494fc099e27de74fe365f1aba30c6fc83659 (diff)
downloadayatana-indicator-printers-66cdfa18d909ad66f376b217047664235ccfc6f8.tar.gz
ayatana-indicator-printers-66cdfa18d909ad66f376b217047664235ccfc6f8.tar.bz2
ayatana-indicator-printers-66cdfa18d909ad66f376b217047664235ccfc6f8.zip
Import upstream version 0.1.3
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac2
-rw-r--r--data/Makefile.am2
-rw-r--r--data/Makefile.in2
-rw-r--r--data/indicator-printers.service.in (renamed from data/indicator-printers.service)2
-rw-r--r--src/indicator-printers.c20
6 files changed, 34 insertions, 14 deletions
diff --git a/configure b/configure
index 1133832..e1cc35c 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for indicator-printers 0.1.1.
+# Generated by GNU Autoconf 2.68 for indicator-printers 0.1.3.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -567,8 +567,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='indicator-printers'
PACKAGE_TARNAME='indicator-printers'
-PACKAGE_VERSION='0.1.1'
-PACKAGE_STRING='indicator-printers 0.1.1'
+PACKAGE_VERSION='0.1.3'
+PACKAGE_STRING='indicator-printers 0.1.3'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1357,7 +1357,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures indicator-printers 0.1.1 to adapt to many kinds of systems.
+\`configure' configures indicator-printers 0.1.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1428,7 +1428,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of indicator-printers 0.1.1:";;
+ short | recursive ) echo "Configuration of indicator-printers 0.1.3:";;
esac
cat <<\_ACEOF
@@ -1545,7 +1545,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-indicator-printers configure 0.1.1
+indicator-printers configure 0.1.3
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1910,7 +1910,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by indicator-printers $as_me 0.1.1, which was
+It was created by indicator-printers $as_me 0.1.3, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2727,7 +2727,7 @@ fi
# Define the identity of the package.
PACKAGE='indicator-printers'
- VERSION='0.1.1'
+ VERSION='0.1.3'
cat >>confdefs.h <<_ACEOF
@@ -13775,7 +13775,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by indicator-printers $as_me 0.1.1, which was
+This file was extended by indicator-printers $as_me 0.1.3, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -13841,7 +13841,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-indicator-printers config.status 0.1.1
+indicator-printers config.status 0.1.3
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index a5b0c54..033991a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
-AC_INIT(indicator-printers, 0.1.1)
+AC_INIT(indicator-printers, 0.1.3)
AC_PREREQ(2.53)
AM_INIT_AUTOMAKE([])
diff --git a/data/Makefile.am b/data/Makefile.am
index 1ecc4e7..133a853 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -5,7 +5,7 @@ dbus_services_DATA = indicator-printers.service
%.service: %.service.in
sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
-EXTRA_DIST = indicator-printers.service
+EXTRA_DIST = indicator-printers.service.in
CLEANFILES = $(dbus_services_DATA)
diff --git a/data/Makefile.in b/data/Makefile.in
index be9d926..4f07ba6 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -239,7 +239,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
dbus_servicesdir = $(DBUSSERVICEDIR)
dbus_services_DATA = indicator-printers.service
-EXTRA_DIST = indicator-printers.service
+EXTRA_DIST = indicator-printers.service.in
CLEANFILES = $(dbus_services_DATA)
all: all-am
diff --git a/data/indicator-printers.service b/data/indicator-printers.service.in
index 20bd30e..d89bcd2 100644
--- a/data/indicator-printers.service
+++ b/data/indicator-printers.service.in
@@ -1,3 +1,3 @@
[D-BUS Service]
Name=com.canonical.indicator.printers
-Exec=/usr/local/libexec/indicator-printers-service
+Exec=@libexecdir@/indicator-printers-service
diff --git a/src/indicator-printers.c b/src/indicator-printers.c
index bcb0579..b69c093 100644
--- a/src/indicator-printers.c
+++ b/src/indicator-printers.c
@@ -26,6 +26,7 @@
#include <libindicator/indicator.h>
#include <libindicator/indicator-image-helper.h>
+#include <libindicator/indicator-service-manager.h>
#include <libdbusmenu-gtk/menu.h>
#include <libdbusmenu-gtk/menuitem.h>
@@ -40,6 +41,7 @@ G_DEFINE_TYPE (IndicatorPrinters, indicator_printers, INDICATOR_OBJECT_TYPE)
struct _IndicatorPrintersPrivate
{
+ IndicatorServiceManager *service;
IndicatorObjectEntry entry;
};
@@ -48,6 +50,7 @@ static void
dispose (GObject *object)
{
IndicatorPrinters *self = INDICATOR_PRINTERS (object);
+ g_clear_object (&self->priv->service);
g_clear_object (&self->priv->entry.menu);
g_clear_object (&self->priv->entry.image);
G_OBJECT_CLASS (indicator_printers_parent_class)->dispose (object);
@@ -76,6 +79,18 @@ indicator_printers_class_init (IndicatorPrintersClass *klass)
}
+static void
+connection_changed (IndicatorServiceManager *service,
+ gboolean connected,
+ gpointer user_data)
+{
+ IndicatorPrinters *self = INDICATOR_PRINTERS (user_data);
+
+ if (!connected)
+ indicator_object_set_visible (INDICATOR_OBJECT (self), FALSE);
+}
+
+
static GdkPixbuf *
gdk_pixbuf_new_from_encoded_data (guchar *data,
gsize length)
@@ -254,6 +269,11 @@ indicator_printers_init (IndicatorPrinters *self)
IndicatorPrintersPrivate);
self->priv = priv;
+ priv->service = indicator_service_manager_new_version (INDICATOR_PRINTERS_DBUS_NAME,
+ INDICATOR_PRINTERS_DBUS_VERSION);
+ g_signal_connect (priv->service, "connection-change",
+ G_CALLBACK (connection_changed), self);
+
menu = dbusmenu_gtkmenu_new(INDICATOR_PRINTERS_DBUS_NAME,
INDICATOR_PRINTERS_DBUS_OBJECT_PATH);