Merge lp://staging/~charlesk/gnome-bluetooth/indicators into lp://staging/~ubuntu-desktop/gnome-bluetooth/ubuntu

Proposed by Charles Kerr
Status: Merged
Merged at revision: 61
Proposed branch: lp://staging/~charlesk/gnome-bluetooth/indicators
Merge into: lp://staging/~ubuntu-desktop/gnome-bluetooth/ubuntu
Diff against target: 310 lines (+182/-31)
3 files modified
debian/patches/01_use_app_indicator.patch (+153/-31)
debian/patches/03_text_changes.patch (+28/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp://staging/~charlesk/gnome-bluetooth/indicators
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Charles Kerr (community) Needs Resubmitting
Review via email: mp+90956@code.staging.launchpad.net

Description of the change

Adds a menubar visibility toggle to 01_use_app_indicator.patch (LP: #829690)

 - Modify the properties panel to add a visibility toggle as spec'ed in
   https://wiki.ubuntu.com/Bluetooth#specification
 - Add a GSettings schema for storing that visibility toggle
 - Modify bluetooth-applet to support the visibility toggle

To post a comment you must log in.
62. By Charles Kerr

Capitalization fixes to text in the popup menu (LP: #906042)

63. By Charles Kerr

replace the three single dots '...' by the unicode symbol U+2026 (…).

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for the work, some comment from a first review:

304 ++ const gchar * const * schemas = g_settings_list_schemas ();
305 ++ for (i=0; !schema_exists && schemas && schemas[i]; i++)
306 ++ if (!g_strcmp0 (schema, schemas[i]))
307 ++ schema_exists = TRUE;

what's the point of checking if the schemas exists when it's part of the same source and we know it's being installed? if the schemas is not there the installation is corrupted and we better let the code error out...

286 ++on_settings_visible_changed (GSettings *settings, gchar *key, CcBluetoothPanel * panel)
287 ++{
288 ++ g_return_if_fail (!g_strcmp0 (key, VISIBLE_KEY));

why do you check the key? is the signal connected on another key than visible_key? that seems not required

289 ++
290 ++ GtkToggleButton *toggle = GTK_TOGGLE_BUTTON(panel->priv->indicator_check);
291 ++ gboolean oldval = gtk_toggle_button_get_active (toggle);
292 ++ gboolean newval = g_settings_get_boolean (settings, key);
293 ++ if (oldval != newval)
294 ++ gtk_toggle_button_set_active (toggle, newval);

do we need those checks? what do you try to avoid? if the visibility changed then it's likely that the checkbox state will change, it's also not obvious that all those checks spare any work over calling set_active in any case.

review: Needs Fixing
Revision history for this message
Sebastien Bacher (seb128) wrote :

note that instead of connecting the callback to the gsettings value you can probably simplify the code using g_settings_bind() to bind the widget state to the key value

64. By Charles Kerr

Improve the schema handling from seb's review feedback.

1. Since the schema is part of this package, don't test to see if it exists before we use it. If the installation is corrupt, better to error out.

2. Simplify tying the togglebutton to the GSettings boolean by using g_settings_bind().

Revision history for this message
Charles Kerr (charlesk) wrote :

Seb, thanks for the useful feedback. Using g_settings_bind() did in fact remove all that extra code.

Likewise, I've removed the test-for-schema code before calling g_settings_new().

Fixed r64

Revision history for this message
Charles Kerr (charlesk) :
review: Needs Resubmitting
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, that looks better, small minor comments,questions though:

> ++ else if ((gsettings != NULL) && !g_settings_get_boolean (gsettings, GSETTINGS_VISIBLE_KEY))

the NULL checking is not needed there, g_settings_new() can't return null, it works or the install is broken it exits

> g_clear_object (&self->priv->indicator_settings);

shouldn't g_object_unref() be used rather there?

> ++++ b/applet/com.canonical.indicator.bluetooth.gschema.xml

you should use a .xml.in with _summary and _description keys and list it in POTFILES.in to make the summary and description translatable and the .xml should be generated at build time

Otherwise the changes look good and seem to work fine, the checkbox seems a bit too close from the ui frame in the capplet though and maybe it would be better with some margin but I will let design comment on that

review: Needs Fixing
Revision history for this message
Charles Kerr (charlesk) wrote :

Seb, thanks for the additional feedback; it's all been helpful.

>> ++ else if ((gsettings != NULL) && !g_settings_get_boolean (gsettings, GSETTINGS_VISIBLE_KEY))
> the NULL checking is not needed there, g_settings_new() can't return null, it works or the install is broken it exits

Fixed in r65

>> g_clear_object (&self->priv->indicator_settings);
> shouldn't g_object_unref() be used rather there?

g_clear_object calls g_object_unref() and NULLs the pointer. I suppose NULLing is unnecessary in _finalize() but IMO it's harmless.

>> ++++ b/applet/com.canonical.indicator.bluetooth.gschema.xml
> you should use a .xml.in with _summary and _description keys and list it in POTFILES.in

Great point; fixed in r65

> the checkbox seems a bit too close from the ui frame in the capplet though and maybe it would be better with some margin

Yeah, I think that's true. Adding a 6-pixel margin between them in r66 looks better.

65. By Charles Kerr

More improvements generated by code review:

 - remove an unnecessary (gsettings==NULL) safeguard -- g_settings_new() can't return NULL

 - insead of bundling a schema.xml directly, use an .xml.in file marked for translation

66. By Charles Kerr

Add a 6 pixel margin between the ui frame and the visibility checkbox.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, that looks great, I will merge it tomorrow. Bonus point if you open a bug on bugzilla.gnome.org about the string changes in case they want to take it.

Small note also, shouldn't gsettingsschema_in_files be added to EXTRA_DIST?

67. By Charles Kerr

Add $(gsettingsschema_in_files) to EXTRA_DIST

Revision history for this message
Charles Kerr (charlesk) wrote :

> Bonus point if you open a bug on bugzilla.gnome.org about the string changes in case they want to take it.

https://bugzilla.gnome.org/show_bug.cgi?id=669284

> also, shouldn't gsettingsschema_in_files be added to EXTRA_DIST?

Yep. r67.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks, I'm merging that

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: