GSettings bindings works properly with GtkCheckMenuItem but get unidirectional binding for GtkRadioMenuItem

Bug #1024811 reported by Aurélien RIVIERE
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTK+
New
Undecided
Unassigned
libappindicator (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hello, I have a problem with the libappindicator3 and GTK3. It's maybe a bug.
I set up synchronization for a gtk_check_menu_item. It works.
Then I set up synchronisation for two GTK_RADIO_MENU_ITEM in a same group. But it doesn't work properly.
When I change the selected item, the group is changed, but GSettings doesn't get the new value.
When I change the value using the GTK interface which propose the whole set of options for this software, or using dconf-editor, the active GTK_RADIO_MENU_ITEM of the group is changed.

In a nutshell, we can say that in my code, G_SETTINGS_BIND_DEFAULT works well for the checkbox, but for the radio_menu_item, it works like G_SETTINGS_BIND_GET.
I tried to replace it with G_SETTINGS_BIND_SET|G_SETTINGS_BIND_GET but I got the same result so the #define is right.

Here a part of my code with the bindings between GSettings and the widgets (not actual code, but easier than the newer one so I give you this one) :

 menu = gtk_menu_new ();

 /* Live Wallpaper checkbutton */
 ctl = gtk_check_menu_item_new_with_label (_("LiveWallpaper"));
 g_settings_bind ( g_settings_new ("apps.livewallpapers.livewallpaper"),
       "active", ctl, "active", G_SETTINGS_BIND_DEFAULT);
 gtk_menu_shell_append (GTK_MENU_SHELL (menu), ctl);

    /* Separator */
    gtk_menu_shell_append ( GTK_MENU_SHELL (menu),
       gtk_separator_menu_item_new ());

    /* Galaxy Plugins */
    ctl = gtk_radio_menu_item_new_with_label (group, _("Galaxy"));
  g_settings_bind ( g_settings_new ("apps.livewallpapers.galaxy"),
      "active", ctl, "active", G_SETTINGS_BIND_DEFAULT);
  group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (ctl));
  gtk_menu_shell_append (GTK_MENU_SHELL (menu), ctl);

    /* Nexus Plugins */
    ctl = gtk_radio_menu_item_new_with_label (group, _("Nexus"));
  g_settings_bind ( g_settings_new ("apps.livewallpapers.nexus"),
      "active", ctl, "active", G_SETTINGS_BIND_DEFAULT);
  group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (ctl));
  gtk_menu_shell_append (GTK_MENU_SHELL (menu), ctl);

Thank you for helping me.
Yours faithfully.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.