Re: [Ayatana] Sound Menu

2010-11-11 Thread frederik.nn...@gmail.com
Thanks Conor,

On Wed, Nov 10, 2010 at 17:12, Conor Curran conor.cur...@canonical.comwrote:

  Hey folks,


   It might be specced, but it's not implemented. I didn't find a bug for
 that yet, so here's a new one:
 no visible focus on horizontal controls
 https://bugs.launchpad.net/indicator-sound/+bug/673185

  the keyboard controls don't work for me, yet, i guess that's still in the
 making, is it?


 Conor is the right person to ask on this!

  Yes the keyboard handling and hover behaviour of the play/skip button has
 yes to be implemented.
 I did make an attempt late in the Maverick cycle to get this done but was
 unhappy with results.
 I do hope to get this into Natty for Alpha1 (3 weeks!)


looking forward to an even better experience .. yeah!

Since this is about horizontal control elements, how about using the same
concept for the Output Volume Item, too?
The spec says (about the volume to zero button):

A borderless, mouseover-less button that sets the volume to zero (as
 distinct from muting it). The icon for the button should
 be audio-volume-low-zero(in the default theme, a speaker with no sound
 waves).


Does this mean that the entire Output Volume Item will receive visible
focus on hover?
Spec says the following about the entire row:

The item should highlight when navigated to, or on mouseover, just as normal
 menu items do, but the item should not be activatable (clicking it or
 pressing Enter should not close the menu)


Semantically correct would be to light up the Output Volume to Zero item
briefly upon CTRL+LEFT, equivalently the same for CTRL+RIGHT, if i'm not
completely mistaken.. And of course to highlight only the fader at first
when the Output Volume Item is navigated to.

My shot at this is that the Spec needs to be updated for consistency in this
little place..
Thoughts?
___
Mailing list: https://launchpad.net/~ayatana
Post to : ayatana@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana] Sound Menu

2010-11-11 Thread frederik.nn...@gmail.com
and yeah.. the speaker icons to the left and to the right of the volume
slider should receive visual focus on hover, according to how i understand
consistency in the careful treatment of threefold horizontal control
elements in Sound Menu.. What do you think?

On Thu, Nov 11, 2010 at 13:18, frederik.nn...@gmail.com 
frederik.nn...@gmail.com wrote:

 Thanks Conor,

 On Wed, Nov 10, 2010 at 17:12, Conor Curran conor.cur...@canonical.comwrote:

  Hey folks,


   It might be specced, but it's not implemented. I didn't find a bug for
 that yet, so here's a new one:
 no visible focus on horizontal controls
 https://bugs.launchpad.net/indicator-sound/+bug/673185

  the keyboard controls don't work for me, yet, i guess that's still in
 the making, is it?


 Conor is the right person to ask on this!

  Yes the keyboard handling and hover behaviour of the play/skip button has
 yes to be implemented.
 I did make an attempt late in the Maverick cycle to get this done but was
 unhappy with results.
 I do hope to get this into Natty for Alpha1 (3 weeks!)


 looking forward to an even better experience .. yeah!

 Since this is about horizontal control elements, how about using the same
 concept for the Output Volume Item, too?
 The spec says (about the volume to zero button):

 A borderless, mouseover-less button that sets the volume to zero (as
 distinct from muting it). The icon for the button should
 be audio-volume-low-zero(in the default theme, a speaker with no sound
 waves).


 Does this mean that the entire Output Volume Item will receive visible
 focus on hover?
 Spec says the following about the entire row:

 The item should highlight when navigated to, or on mouseover, just as
 normal menu items do, but the item should not be activatable (clicking it or
 pressing Enter should not close the menu)


 Semantically correct would be to light up the Output Volume to Zero item
 briefly upon CTRL+LEFT, equivalently the same for CTRL+RIGHT, if i'm not
 completely mistaken.. And of course to highlight only the fader at first
 when the Output Volume Item is navigated to.

 My shot at this is that the Spec needs to be updated for consistency in
 this little place..
 Thoughts?

___
Mailing list: https://launchpad.net/~ayatana
Post to : ayatana@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana] File menu

2010-11-11 Thread frederik.nn...@gmail.com
On Wed, Nov 10, 2010 at 13:20, Matthew Paul Thomas m...@canonical.comwrote:


 Arian van Gend wrote on 09/11/10 12:16:
 
   Besides, the File menu has been overloaded with actions that have
  nothing to do with files anyway, and should therefore at least be
  cleaned up.

 As a menu title, File is not a noun. It's a verb, just like Edit,
 View, Go, Insert, and Format are.


I agree.
At least that's what makes sense. Unfortunately the capitalization doesn't
support this interpretation in the mist of ambiguity..
Not only translators but also users ( English, French, German, Lithuanian,
Russian) and most programmers i ever spoke to (in German) misinterpret the
word for naturally being meant as a noun.

(to) file makes more sense in interpretation, then again i don't see how
this menu deserves to have this sort of a pole position in many non-office
apps, while the more important features of these respective apps are hidden
in a fourth, fifth or even sixth menu, way behind File, Edit, View.

I think consistency is important in the first menu, the second, third and
fourth menu should be context driven / per app. Some apps e.g. don't need an
Edit menu, some don't need a View menu, most don't need a Go menu etc..
only browsers and document readers need a Bookmarks menu.

I have a lot of stuff to say about the Edit and View menus, but i think its
better to focus the File menu as well as possible in here. Cracking that nut
will solve a lot of design problems to me.

(to) file something makes sense for editable office documents, rather less
for movies, single audiofiles etc.
In case of non editable none office documents (perhaps someone can correct
me a little here), file would suffice as a button which offers only save
as. For an editable document:
*save
*save as
*close (i.e. close application)
*open (recent, [Pinned Item1, Pinned Item2])
*print

even if so, i would still prefer calling the menu by what it actually
encompasses:
either Document or [document type], i.e. Song, Movie, Image,
Animation or Design.. File or (to) file wouldn't be so helpful titles
here imo, especially considering the fileless paradigm we are trying to
introduce into userland.

The great thing i like most about testing Indicator Appmenu is that
sometimes all i get for a menu is File, nothing more. This gives me a
glimpse at how lean and simple application menus could become one day, of
course with a more meaningful title then! Best example remains Calculator,
with its Calculator menu instead of File.
This is a noun and it makes sense.
___
Mailing list: https://launchpad.net/~ayatana
Post to : ayatana@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana] Sound Menu

2010-11-11 Thread Mark Shuttleworth
On 11/11/10 12:21, frederik.nn...@gmail.com wrote:
 and yeah.. the speaker icons to the left and to the right of the
 volume slider should receive visual focus on hover, according to how i
 understand consistency in the careful treatment of threefold
 horizontal control elements in Sound Menu.. What do you think?

Some sort of indication that the volume slider is active would be good, yes.



signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~ayatana
Post to : ayatana@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana
More help   : https://help.launchpad.net/ListHelp


[Ayatana] hearphones indicator?

2010-11-11 Thread dani
today ubuntu indicators probably replace the old notification area, and
this is great!!. But we must to do it indicators more intelligent. We
must ensure that it can do anything humans need.

One of the shortcomings i can find is that heardphones not indicates. i
create some mockups of how it could fix, hope you like them. 

https://wiki.ubuntu.com/Artwork/Incoming/Maverick/heardphones%
20indicator%20%28daniel%20planas%29

PD: i write on maverick incoming because natty isn't open yet.
-- 
daniel planas.a 
www.lightgraphite.com


___
Mailing list: https://launchpad.net/~ayatana
Post to : ayatana@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana] hearphones indicator?

2010-11-11 Thread dani
https://wiki.ubuntu.com/Artwork/Incoming/Maverick/heardphones%20indicator%20%28daniel%20planas%29

PD: sorry for the bad link
 --
 daniel planas.a
 www.lightgraphite.com


___
Mailing list: https://launchpad.net/~ayatana
Post to : ayatana@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana] hearphones indicator?

2010-11-11 Thread Thorsten Wilms
On Thu, 2010-11-11 at 20:11 +0100, dani wrote:

 https://wiki.ubuntu.com/Artwork/Incoming/Maverick/heardphones%
 20indicator%20%28daniel%20planas%29

The headphone icon replacing the speaker, if headphones are plugged in
and other output muted because of that, looks like a good idea.


 PD: i write on maverick incoming because natty isn't open yet.

You mean there is no Artwork/Incoming/Natty. That's because none of the
few people who took care of that for previous cycles did this time.
Personally, I won't do it, as collecting stuff there wasn't of much use
in the Maverick cycle. Mid to long term, we need something better than
the wiki to manage assets (screenshots, sketches, mockups, videos ...).

You could move your stuff over to 
https://wiki.ubuntu.com/Ayatana
seeing how you post here and not in ubuntu-art, but that's a bit of a
mess, too :}

I feel bad about this wiki situation, but I had to give up on
organizing /Ayatana and /Artwork, as it eats too much time and returns
so little.


-- 
Thorsten Wilms

thorwil's design for free software:
http://thorwil.wordpress.com/


___
Mailing list: https://launchpad.net/~ayatana
Post to : ayatana@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana
More help   : https://help.launchpad.net/ListHelp


[Ayatana] fileless paradigm (was: File menu)

2010-11-11 Thread fain182
2010/11/11 frederik.nn...@gmail.com frederik.nn...@gmail.com:
 here imo, especially considering the fileless paradigm we are trying to
 introduce into userland.
What is it? can i find it in a document?
( BTW defining something by negation, puzzles me )

-- 
pietro

___
Mailing list: https://launchpad.net/~ayatana
Post to : ayatana@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana
More help   : https://help.launchpad.net/ListHelp


Re: [Ayatana] fileless paradigm (was: File menu)

2010-11-11 Thread Martin Owens
On Thu, 2010-11-11 at 23:25 +0100, fain182 wrote:
 2010/11/11 frederik.nn...@gmail.com frederik.nn...@gmail.com:
  here imo, especially considering the fileless paradigm we are
 trying to
  introduce into userland.
 What is it? can i find it in a document?
 ( BTW defining something by negation, puzzles me 

I would be careful with how you introduce a file-less paradigm. In order
to do so you'll need a cast-iron items and collections system with all
sorts of concept access systems like tagging, event access and cross
linking with user items.

In Ubuntu we have no developers working on these systems, and I didn't
see enough UDS time devoted to solving any of those problems either.
Even android and iphone's systems which are a thousand times stronger
than Ubuntu's are too weak to support real file-less paradigms.

I remain very unconvinced that we are in any shape to offer this feature
and I fear that people are looking at a dream before they can see the
path that leads us there.

Until we spend time adding in all the required features, removal of file
access will equate with removal of functionality which will cripple
workflows and destroy rich data access for many use cases.

2 cents.

Martin,


___
Mailing list: https://launchpad.net/~ayatana
Post to : ayatana@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~cjcurran/indicator-sound/metadata-widget-blank-maverick into lp:indicator-sound/sound-menu-v2

2010-11-11 Thread noreply
The proposal to merge 
lp:~cjcurran/indicator-sound/metadata-widget-blank-maverick into 
lp:indicator-sound/sound-menu-v2 has been updated.

Status: Approved = Merged
-- 
https://code.launchpad.net/~cjcurran/indicator-sound/metadata-widget-blank-maverick/+merge/40621
Your team ayatana-commits is subscribed to branch 
lp:indicator-sound/sound-menu-v2.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Branch ~dbusmenu-team/dbusmenu/trunk] Rev 169: Merging in configurable GTK build option

2010-11-11 Thread noreply
Merge authors:
  Michael Terry (mterry)
  Michael Terry (mterry)
Related merge proposals:
  https://code.launchpad.net/~mterry/dbusmenu/gtk3/+merge/27992
  proposed by: Michael Terry (mterry)

revno: 169 [merge]
committer: Ted Gould t...@gould.cx
branch nick: trunk
timestamp: Thu 2010-11-11 08:15:20 -0600
message:
  Merging in configurable GTK build option
added:
  libdbusmenu-gtk/dbusmenu-gtk3.pc.in
modified:
  .bzrignore
  configure.ac
  libdbusmenu-gtk/Makefile.am
  libdbusmenu-gtk/client.c
  libdbusmenu-gtk/genericmenuitem.c
  libdbusmenu-gtk/menu.c
  libdbusmenu-gtk/menuitem.c
  tools/testapp/Makefile.am


--
lp:dbusmenu
https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk

Your team ayatana-commits is subscribed to branch lp:dbusmenu.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk/+edit-subscription
=== modified file '.bzrignore'
--- .bzrignore	2010-08-27 19:31:44 +
+++ .bzrignore	2010-11-11 14:15:20 +
@@ -49,8 +49,8 @@
 tests/test-gtk-reorder-server
 tests/test-gtk-reorder
 tools/dbusmenu-dumper
-libdbusmenu-[0-9].[0-9].[0-9].tar.gz
-libdbusmenu-[0-9].[0-9].[0-9].tar.gz.asc
+libdbusmenu-[0-9]*.[0-9]*.[0-9]*.tar.gz
+libdbusmenu-[0-9]*.[0-9]*.[0-9]*.tar.gz.asc
 tests/test-mago
 tests/*.bustle
 libdbusmenu-gtk/libdbusmenu_gtk_la-genericmenuitem.lo
@@ -194,3 +194,12 @@
 tests/test-glib-events
 tests/test-glib-events-client
 tests/test-glib-events-server
+libdbusmenu-gtk/DbusmenuGtk3-0.2.gir
+libdbusmenu-gtk/DbusmenuGtk3-0.2.tmp.gir
+libdbusmenu-gtk/DbusmenuGtk3-0.2.typelib
+libdbusmenu-gtk/dbusmenu-gtk3.pc
+libdbusmenu-gtk/libdbusmenu-gtk3.la
+libdbusmenu-gtk/libdbusmenu_gtk3_la-client.lo
+libdbusmenu-gtk/libdbusmenu_gtk3_la-genericmenuitem.lo
+libdbusmenu-gtk/libdbusmenu_gtk3_la-menu.lo
+libdbusmenu-gtk/libdbusmenu_gtk3_la-menuitem.lo

=== modified file 'configure.ac'
--- configure.ac	2010-10-12 18:00:25 +
+++ configure.ac	2010-11-11 14:15:20 +
@@ -48,14 +48,33 @@
 ###
 
 GTK_REQUIRED_VERSION=2.16
-
-PKG_CHECK_MODULES(DBUSMENUGTK,  gtk+-2.0 = $GTK_REQUIRED_VERSION
-glib-2.0 = $GLIB_REQUIRED_VERSION
-dbus-glib-1 = $DBUS_REQUIRED_VERSION
-libxml-2.0 = $XML_REQUIRED_VERSION)
-
-AC_SUBST(DBUSMENUGTK_CFLAGS)
-AC_SUBST(DBUSMENUGTK_LIBS)
+GTK3_REQUIRED_VERSION=2.91
+
+AC_ARG_WITH([gtk],
+  [AS_HELP_STRING([--with-gtk],
+[Which version of gtk to use @:@default=2@:@])],
+  [],
+  [with_gtk=2])
+AS_IF([test x$with_gtk = x3],
+[PKG_CHECK_MODULES(DBUSMENUGTK,  gtk+-3.0 = $GTK3_REQUIRED_VERSION
+ glib-2.0 = $GLIB_REQUIRED_VERSION
+ dbus-glib-1 = $DBUS_REQUIRED_VERSION
+ libxml-2.0 = $XML_REQUIRED_VERSION)
+ AC_SUBST(DBUSMENUGTK_CFLAGS)
+ AC_SUBST(DBUSMENUGTK_LIBS)
+ AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available])
+],
+  [test x$with_gtk = x2],
+[PKG_CHECK_MODULES(DBUSMENUGTK,  gtk+-2.0 = $GTK_REQUIRED_VERSION
+ glib-2.0 = $GLIB_REQUIRED_VERSION
+ dbus-glib-1 = $DBUS_REQUIRED_VERSION
+ libxml-2.0 = $XML_REQUIRED_VERSION)
+ AC_SUBST(DBUSMENUGTK_CFLAGS)
+ AC_SUBST(DBUSMENUGTK_LIBS)
+],
+  [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])]
+)
+AM_CONDITIONAL(USE_GTK3, [test x$with_gtk = x3])
 
 ###
 # Dependencies - dumper
@@ -137,6 +156,7 @@
 libdbusmenu-glib/dbusmenu-glib.pc
 libdbusmenu-gtk/Makefile
 libdbusmenu-gtk/dbusmenu-gtk.pc
+libdbusmenu-gtk/dbusmenu-gtk3.pc
 tools/Makefile
 tools/testapp/Makefile
 tests/Makefile
@@ -160,5 +180,6 @@
 
 	Prefix: $prefix
 	Massive Debugging:  $with_massivedebugging
+	GTK+ Version:   $with_gtk
 ])
 

=== modified file 'libdbusmenu-gtk/Makefile.am'
--- libdbusmenu-gtk/Makefile.am	2010-05-20 16:09:29 +
+++ libdbusmenu-gtk/Makefile.am	2010-10-13 12:42:42 +
@@ -1,13 +1,23 @@
 
 CLEANFILES = 
 
+if USE_GTK3
+VER=3
+GTKGIR=Gtk-3.0
+GTKVALA=gtk+-3.0
+lib_LTLIBRARIES = libdbusmenu-gtk3.la
+else
+VER=
+GTKGIR=Gtk-2.0
+GTKVALA=gtk+-2.0
+lib_LTLIBRARIES = libdbusmenu-gtk.la
+endif
+
 EXTRA_DIST = \
-	dbusmenu-gtk.pc.in
-
-lib_LTLIBRARIES = \
-	libdbusmenu-gtk.la
-
-libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu-0.1/libdbusmenu-gtk/
+	dbusmenu-gtk.pc.in \
+	dbusmenu-gtk3.pc.in
+
+libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu-0.1/libdbusmenu-gtk$(VER)/
 
 libdbusmenu_gtkinclude_HEADERS = \
 	client.h \
@@ -36,7 +46,18 @@
 	../libdbusmenu-glib/libdbusmenu-glib.la \
 	$(DBUSMENUGTK_LIBS)
 
-pkgconfig_DATA = dbusmenu-gtk.pc
+# We duplicate these here because Automake won't let us use $(VER) on the left hand side.
+# Since we carefully use $(VER) 

[Ayatana-commits] [Merge] lp:~mterry/dbusmenu/gtk3 into lp:dbusmenu

2010-11-11 Thread noreply
The proposal to merge lp:~mterry/dbusmenu/gtk3 into lp:dbusmenu has been 
updated.

Status: Work in progress = Merged
-- 
https://code.launchpad.net/~mterry/dbusmenu/gtk3/+merge/27992
Your team ayatana-commits is subscribed to branch lp:dbusmenu.

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Branch ~dbusmenu-team/dbusmenu/trunk] Rev 171: 0.3.90

2010-11-11 Thread noreply

revno: 171
tags: 0.3.90
committer: Ted Gould t...@gould.cx
branch nick: trunk
timestamp: Thu 2010-11-11 11:23:00 -0600
message:
  0.3.90
modified:
  configure.ac


--
lp:dbusmenu
https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk

Your team ayatana-commits is subscribed to branch lp:dbusmenu.
To unsubscribe from this branch go to 
https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk/+edit-subscription
=== modified file 'configure.ac'
--- configure.ac	2010-11-11 14:26:35 +
+++ configure.ac	2010-11-11 17:23:00 +
@@ -1,11 +1,11 @@
 
-AC_INIT(libdbusmenu, 0.3.16, t...@canonical.com)
+AC_INIT(libdbusmenu, 0.3.90, t...@canonical.com)
 AC_COPYRIGHT([Copyright 2009,2010 Canonical])
 
 AC_PREREQ(2.62)
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(libdbusmenu, 0.3.16, [-Wno-portability])
+AM_INIT_AUTOMAKE(libdbusmenu, 0.3.90, [-Wno-portability])
 
 AM_MAINTAINER_MODE
 

___
Mailing list: https://launchpad.net/~ayatana-commits
Post to : ayatana-commits@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ayatana-commits
More help   : https://help.launchpad.net/ListHelp


[Ayatana-commits] [Merge] lp:~ted/indicator-application/property-for-dbus-stuff into lp:indicator-application

2010-11-11 Thread Ted Gould
Ted Gould has proposed merging 
lp:~ted/indicator-application/property-for-dbus-stuff into 
lp:indicator-application.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)


Adding a property to get the dbusmenu server so we can use it for testing.  Oh, 
and a test to prove that it can be used for testing :)
-- 
https://code.launchpad.net/~ted/indicator-application/property-for-dbus-stuff/+merge/40688
Your team ayatana-commits is subscribed to branch lp:indicator-application.
=== modified file 'src/app-indicator.c'
--- src/app-indicator.c	2010-10-20 19:22:46 +
+++ src/app-indicator.c	2010-11-12 04:40:04 +
@@ -34,6 +34,7 @@
 #include dbus/dbus-glib.h
 #include dbus/dbus-glib-bindings.h
 
+#include libdbusmenu-glib/menuitem.h
 #include libdbusmenu-glib/server.h
 #include libdbusmenu-gtk/client.h
 
@@ -121,7 +122,8 @@
 	PROP_X_LABEL,
 	PROP_X_LABEL_GUIDE,
 	PROP_ORDERING_INDEX,
-	PROP_X_ORDERING_INDEX
+	PROP_X_ORDERING_INDEX,
+	PROP_DBUS_MENU_SERVER
 };
 
 /* The strings so that they can be slowly looked up. */
@@ -139,6 +141,7 @@
 #define PROP_X_LABEL_GUIDE_S (x-ayatana- PROP_LABEL_GUIDE_S)
 #define PROP_ORDERING_INDEX_Sordering-index
 #define PROP_X_ORDERING_INDEX_S  (x-ayatana- PROP_ORDERING_INDEX_S)
+#define PROP_DBUS_MENU_SERVER_S  dbus-menu-server
 
 /* Private macro, s! */
 #define APP_INDICATOR_GET_PRIVATE(o) \
@@ -406,6 +409,19 @@
 	 A wrapper, please don't use.,
 	 NULL,
 	 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+	/**
+		AppIndicator:dbus-menu-server:
+
+		A way to get the internal dbusmenu server if it is available.
+		This should only be used for testing.
+	*/
+	g_object_class_install_property(object_class,
+	PROP_DBUS_MENU_SERVER,
+	g_param_spec_object (PROP_DBUS_MENU_SERVER_S,
+	 The internal DBusmenu Server,
+	 DBusmenu server which is available for testing the application indicators.,
+	 DBUSMENU_TYPE_SERVER,
+	 G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
 	/* Signals */
 
@@ -794,6 +810,14 @@
 		  priv-ordering_index = g_value_get_uint(value);
 		  break;
 
+		case PROP_DBUS_MENU_SERVER:
+			if (priv-menuservice != NULL) {
+g_object_unref (priv-menuservice);
+			}
+			gpointer val = g_value_dup_object(value);
+			priv-menuservice = DBUSMENU_SERVER(val);
+			break;
+
 default:
   G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
   break;
@@ -866,6 +890,10 @@
 		  g_value_set_uint(value, priv-ordering_index);
 		  break;
 
+		case PROP_DBUS_MENU_SERVER:
+			g_value_set_object(value, priv-menuservice);
+			break;
+
 default:
   G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
   break;

=== modified file 'tests/test-libappindicator.c'
--- tests/test-libappindicator.c	2010-08-04 02:13:34 +
+++ tests/test-libappindicator.c	2010-11-12 04:40:04 +
@@ -25,6 +25,9 @@
 
 #include app-indicator.h
 
+#include libdbusmenu-glib/menuitem.h
+#include libdbusmenu-glib/server.h
+
 void
 test_libappindicator_prop_signals_status_helper (AppIndicator * ci, gchar * status, gboolean * signalactivated)
 {
@@ -225,6 +228,57 @@
 }
 
 void
+test_libappindicator_set_menu (void)
+{
+	AppIndicator * ci = app_indicator_new (my-id,
+	   my-name,
+	   APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
+
+	g_assert(ci != NULL);
+
+	GtkMenu * menu = GTK_MENU(gtk_menu_new());
+
+	GtkMenuItem * item = GTK_MENU_ITEM(gtk_menu_item_new_with_label(Test Label));
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu), GTK_WIDGET(item));
+	gtk_widget_show(GTK_WIDGET(item));
+
+	app_indicator_set_menu(ci, menu);
+
+	g_assert(app_indicator_get_menu(ci) != NULL);
+
+	GValue serverval = {0};
+	g_value_init(serverval, DBUSMENU_TYPE_SERVER);
+	g_object_get_property(G_OBJECT(ci), dbus-menu-server, serverval);
+
+	DbusmenuServer * server = DBUSMENU_SERVER(g_value_get_object(serverval));
+	g_assert(server != NULL);
+
+	GValue rootval = {0};
+	g_value_init(rootval, DBUSMENU_TYPE_MENUITEM);
+	g_object_get_property(G_OBJECT(server), DBUSMENU_SERVER_PROP_ROOT_NODE, rootval);
+	DbusmenuMenuitem * root = DBUSMENU_MENUITEM(g_value_get_object(rootval));
+	g_assert(root != NULL);
+
+	GList * children = dbusmenu_menuitem_get_children(root);
+	g_assert(children != NULL);
+	g_assert(g_list_length(children) == 1);
+
+	const gchar * label = dbusmenu_menuitem_property_get(DBUSMENU_MENUITEM(children-data), DBUSMENU_MENUITEM_PROP_LABEL);
+	g_assert(label != NULL);
+	g_assert(g_strcmp0(label, Test Label) == 0);
+
+	/* Interesting, eh?  

[Ayatana-commits] [Merge] lp:~ted/indicator-application/build-menu-from-desktop into lp:indicator-application

2010-11-11 Thread Ted Gould
Ted Gould has proposed merging 
lp:~ted/indicator-application/build-menu-from-desktop into 
lp:indicator-application with 
lp:~ted/indicator-application/property-for-dbus-stuff as a prerequisite.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)


A function to pull the desktop file entries and make them into a menu so that 
applications can easily replace their static items with dynamic ones if they 
don't want them to change.
-- 
https://code.launchpad.net/~ted/indicator-application/build-menu-from-desktop/+merge/40689
Your team ayatana-commits is subscribed to branch lp:indicator-application.
=== modified file 'configure.ac'
--- configure.ac	2010-09-22 16:13:14 +
+++ configure.ac	2010-11-12 04:42:06 +
@@ -52,6 +52,14 @@
 AC_SUBST(INDICATOR_CFLAGS)
 AC_SUBST(INDICATOR_LIBS)
 
+PKG_CHECK_MODULES(LIBRARY, gtk+-2.0 = $GTK_REQUIRED_VERSION
+   indicator = $INDICATOR_REQUIRED_VERSION
+   dbus-glib-1 = $DBUS_GLIB_REQUIRED_VERSION
+   dbusmenu-gtk = $DBUSMENUGTK_REQUIRED_VERSION)
+
+AC_SUBST(LIBRARY_CFLAGS)
+AC_SUBST(LIBRARY_LIBS)
+
 ###
 # GObject Introspection
 ###

=== modified file 'docs/reference/libappindicator-sections.txt'
--- docs/reference/libappindicator-sections.txt	2010-08-10 20:33:09 +
+++ docs/reference/libappindicator-sections.txt	2010-11-12 04:42:06 +
@@ -38,5 +38,6 @@
 app_indicator_get_label
 app_indicator_get_label_guide
 app_indicator_get_ordering_index
+app_indicator_build_menu_from_desktop
 /SECTION
 

=== modified file 'src/Makefile.am'
--- src/Makefile.am	2010-08-10 21:59:25 +
+++ src/Makefile.am	2010-11-12 04:42:06 +
@@ -108,12 +108,12 @@
 	-export-symbols-regex ^[^_d].*
 
 libappindicator_la_CFLAGS = \
-	$(INDICATOR_CFLAGS) \
+	$(LIBRARY_CFLAGS) \
 	-Wall -Werror \
 	-DG_LOG_DOMAIN=\libappindicator\
 
 libappindicator_la_LIBADD = \
-	$(INDICATOR_LIBS)
+	$(LIBRARY_LIBS)
 
 ##
 # DBus Specs

=== modified file 'src/app-indicator.c'
--- src/app-indicator.c	2010-11-12 04:42:06 +
+++ src/app-indicator.c	2010-11-12 04:42:06 +
@@ -38,6 +38,8 @@
 #include libdbusmenu-glib/server.h
 #include libdbusmenu-gtk/client.h
 
+#include libindicator/indicator-desktop-shortcuts.h
+
 #include app-indicator.h
 #include app-indicator-enum-types.h
 #include application-service-marshal.h
@@ -89,6 +91,9 @@
 	DBusGProxy   *watcher_proxy;
 	DBusGConnection  *connection;
 	DBusGProxy *  dbus_proxy;
+
+	/* Might be used */
+	IndicatorDesktopShortcuts * shorties;
 };
 
 /* Signals Stuff */
@@ -566,6 +571,8 @@
 	priv-status_icon = NULL;
 	priv-fallback_timer = 0;
 
+	priv-shorties = NULL;
+
 	/* Put the object on DBus */
 	GError * error = NULL;
 	priv-connection = dbus_g_bus_get(DBUS_BUS_SESSION, error);
@@ -592,6 +599,11 @@
 	AppIndicator *self = APP_INDICATOR (object);
 	AppIndicatorPrivate *priv = self-priv;
 
+	if (priv-shorties != NULL) {
+		g_object_unref(G_OBJECT(priv-shorties));
+		priv-shorties = NULL;
+	}
+
 	if (priv-status != APP_INDICATOR_STATUS_PASSIVE) {
 		app_indicator_set_status(self, APP_INDICATOR_STATUS_PASSIVE);
 	}
@@ -2134,3 +2146,82 @@
 	}
 }
 
+#define APP_INDICATOR_SHORTY_NICK app-indicator-shorty-nick
+
+/* Callback when an item from the desktop shortcuts gets
+   called. */
+static void
+shorty_activated_cb (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data)
+{
+	gchar * nick = g_object_get_data(G_OBJECT(mi), APP_INDICATOR_SHORTY_NICK);
+	g_return_if_fail(nick != NULL);
+
+	g_return_if_fail(IS_APP_INDICATOR(user_data));
+	AppIndicator * self = APP_INDICATOR(user_data);
+	AppIndicatorPrivate *priv = self-priv;
+
+	g_return_if_fail(priv-shorties != NULL);
+
+	indicator_desktop_shortcuts_nick_exec(priv-shorties, nick);
+
+	return;
+}
+
+/**
+	app_indicator_build_menu_from_desktop:
+	@self: The #AppIndicator object to use
+	@desktop_file: A path to the desktop file to build the menu from
+	@desktop_profile: Which entries should be used from the desktop file
+
+	This function allows for building the Application Indicator menu
+	from a static desktop file.
+*/
+void
+app_indicator_build_menu_from_desktop (AppIndicator * self, const gchar * desktop_file, const gchar * desktop_profile)
+{
+	g_return_if_fail(IS_APP_INDICATOR(self));
+	AppIndicatorPrivate *priv = self-priv;
+
+	/* Build a new shortcuts object */
+	if (priv-shorties != NULL) {
+		g_object_unref(priv-shorties);
+		priv-shorties = NULL;
+	}
+	priv-shorties = indicator_desktop_shortcuts_new(desktop_file, desktop_profile);
+	g_return_if_fail(priv-shorties != NULL);
+
+	const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(priv-shorties);
+	int nick_num;
+
+	/* Place the items on a dbusmenu */
+	DbusmenuMenuitem * root = dbusmenu_menuitem_new();
+
+	for (nick_num = 0; nicks[nick_num] != NULL; nick_num++) {
+		DbusmenuMenuitem * item = dbusmenu_menuitem_new();
+