After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 682831 - gtkmodelmenu: expose API for action namespace
gtkmodelmenu: expose API for action namespace
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Class: GtkApplication
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2012-08-27 21:30 UTC by Lars Karlitski
Modified: 2012-09-17 16:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkmodelmenu: add "with-separators" attribute (4.28 KB, patch)
2012-08-27 21:30 UTC, Lars Karlitski
reviewed Details | Review
gtkmodelmenu: simplify logic, expose namespace API (8.49 KB, patch)
2012-09-11 15:43 UTC, Allison Karlitskaya (desrt)
reviewed Details | Review
gtkmodelmenu: simplify logic, expose bind API (14.78 KB, patch)
2012-09-13 16:42 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Lars Karlitski 2012-08-27 21:30:54 UTC
When a section (or submenu) item has a boolean property
"with-separators", separators will be shown between items of that
section (or submenu).
Comment 1 Lars Karlitski 2012-08-27 21:30:57 UTC
Created attachment 222588 [details] [review]
gtkmodelmenu: add "with-separators" attribute
Comment 2 Allison Karlitskaya (desrt) 2012-09-11 15:43:00 UTC
Created attachment 224028 [details] [review]
gtkmodelmenu: simplify logic, expose namespace API

Simplify some of the code for creating GtkMenu/GtkMenuBar instances from
GMenuModel and expose the with-action-namespace variant of the API with
a new name.

Remove the private header file.
Comment 3 Allison Karlitskaya (desrt) 2012-09-11 15:45:30 UTC
The patch has to be applied after the patch here: https://bugzilla.gnome.org/show_bug.cgi?id=683738#c1
Comment 4 Matthias Clasen 2012-09-12 03:38:20 UTC
Review of attachment 224028 [details] [review]:

I'd like to see an example for how we expect all the new namespacing stuff to be used.
Currently, it is a bit unmotivated.
Comment 5 Matthias Clasen 2012-09-12 03:40:35 UTC
Review of attachment 222588 [details] [review]:

Docs ? Where do we document all these random new gmenu attributes ?
Comment 6 Allison Karlitskaya (desrt) 2012-09-13 16:42:23 UTC
Created attachment 224242 [details] [review]
gtkmodelmenu: simplify logic, expose bind API

Make the main (and only) entry-point to gtkmodelmenu.c the now-public
gtk_menu_shell_bind_model().

Move the convenience constructors (gtk_menu_new_from_model() and
gtk_menu_bar_new_from_model()) to their proper files.

Remove the private header file.

Simplify the code a bit by making the initial populate part of the
bind() call.
Comment 7 Matthias Clasen 2012-09-17 03:16:48 UTC
Review of attachment 224242 [details] [review]:

Looks good, except for cosmetics. 
Feel free to commit with the fixes mentioned below.

::: gtk/gtk.symbols
@@ -1609,3 @@
 gtk_menu_popdown
 gtk_menu_popup
 gtk_menu_popup_for_device

Missing gtk_menu_shell_bind_model here

::: gtk/gtkmenushell.h
@@ +115,3 @@
+                                        GMenuModel   *model,
+                                        const gchar  *action_namespace,
+                                        gboolean      with_separators);

Missing GDK_AVAILABLE_IN_3_6 here