Merge lp:~seb128/unity-control-center/bluetooth-backport-commit into lp:unity-control-center

Proposed by Sebastien Bacher
Status: Merged
Approved by: Robert Ancell
Approved revision: 12713
Merged at revision: 12718
Proposed branch: lp:~seb128/unity-control-center/bluetooth-backport-commit
Merge into: lp:unity-control-center
Diff against target: 174 lines (+41/-16)
4 files modified
panels/bluetooth/Makefile.am (+13/-6)
panels/bluetooth/bluetooth.gresource.xml (+6/-0)
panels/bluetooth/bluetooth.ui (+2/-2)
panels/bluetooth/cc-bluetooth-panel.c (+20/-8)
To merge this branch: bzr merge lp:~seb128/unity-control-center/bluetooth-backport-commit
Reviewer Review Type Date Requested Status
Robert Ancell Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+207323@code.launchpad.net

Commit message

[bluetooth] backport some upstream changes

Description of the change

[bluetooth] backport some upstream changes

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
12713. By Sebastien Bacher

[bluetooth] backport some upstream changes

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Missing bluetooth.gresource.xml

Revision history for this message
Robert Ancell (robert-ancell) wrote :

Hmm, no it's there. I'll get Jenkins to retry.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) :
review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

> Hmm, no it's there. I'll get Jenkins to retry.

yeah, sorry, I pushed --overwrite over the version that was missign it, should probably have added it in another commit to be less confusing ;-)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panels/bluetooth/Makefile.am'
2--- panels/bluetooth/Makefile.am 2013-11-29 06:28:37 +0000
3+++ panels/bluetooth/Makefile.am 2014-02-19 23:36:47 +0000
4@@ -8,26 +8,33 @@
5 $(PANEL_CFLAGS) \
6 $(BLUETOOTH_CFLAGS) \
7 -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
8- -DPKGDATADIR="\"$(pkgdatadir)\"" \
9 $(NULL)
10
11+BUILT_SOURCES = \
12+ cc-bluetooth-resources.h \
13+ cc-bluetooth-resources.c
14+
15 libbluetooth_la_SOURCES = \
16+ $(BUILT_SOURCES) \
17 cc-bluetooth-panel.c \
18 cc-bluetooth-panel.h
19
20 libbluetooth_la_LIBADD = $(PANEL_LIBS) $(BLUETOOTH_LIBS)
21 libbluetooth_la_LDFLAGS = $(PANEL_LDFLAGS)
22
23+resource_files = $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/bluetooth.gresource.xml)
24+cc-bluetooth-resources.c: bluetooth.gresource.xml $(resource_files)
25+ $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source --c-name cc_bluetooth $<
26+cc-bluetooth-resources.h: bluetooth.gresource.xml $(resource_files)
27+ $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-header --c-name cc_bluetooth $<
28+
29 desktopdir = $(datadir)/applications
30 desktop_in_in_files = untiy-bluetooth-panel.desktop.in.in
31 desktop_in_files = unity-bluetooth-panel.desktop.in
32 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
33 @INTLTOOL_DESKTOP_RULE@
34
35-ui_DATA = bluetooth.ui
36-uidir = $(pkgdatadir)
37-
38-CLEANFILES = $(desktop_DATA)
39-EXTRA_DIST = $(man_MANS) $(desktop_in_in_files) $(ui_DATA)
40+CLEANFILES = $(desktop_DATA) $(BUILT_SOURCES)
41+EXTRA_DIST = $(man_MANS) $(desktop_in_in_files) $(resource_files) bluetooth.gresource.xml
42
43 -include $(top_srcdir)/git.mk
44
45=== added file 'panels/bluetooth/bluetooth.gresource.xml'
46--- panels/bluetooth/bluetooth.gresource.xml 1970-01-01 00:00:00 +0000
47+++ panels/bluetooth/bluetooth.gresource.xml 2014-02-19 23:36:47 +0000
48@@ -0,0 +1,6 @@
49+<?xml version="1.0" encoding="UTF-8"?>
50+<gresources>
51+ <gresource prefix="/org/gnome/control-center/bluetooth">
52+ <file preprocess="xml-stripblanks">bluetooth.ui</file>
53+ </gresource>
54+</gresources>
55
56=== modified file 'panels/bluetooth/bluetooth.ui'
57--- panels/bluetooth/bluetooth.ui 2014-02-12 18:58:26 +0000
58+++ panels/bluetooth/bluetooth.ui 2014-02-19 23:36:47 +0000
59@@ -526,7 +526,7 @@
60 </child>
61 <child>
62 <object class="GtkButton" id="send_button">
63- <property name="label" translatable="yes">Send Files...</property>
64+ <property name="label" translatable="yes">Send Files…</property>
65 <property name="can_focus">True</property>
66 <property name="receives_default">True</property>
67 <property name="use_action_appearance">False</property>
68@@ -554,7 +554,7 @@
69 </child>
70 <child>
71 <object class="GtkButton" id="browse_button">
72- <property name="label" translatable="yes">Browse Files...</property>
73+ <property name="label" translatable="yes">Browse Files…</property>
74 <property name="can_focus">True</property>
75 <property name="receives_default">True</property>
76 <property name="use_action_appearance">False</property>
77
78=== modified file 'panels/bluetooth/cc-bluetooth-panel.c'
79--- panels/bluetooth/cc-bluetooth-panel.c 2014-02-18 03:09:04 +0000
80+++ panels/bluetooth/cc-bluetooth-panel.c 2014-02-19 23:36:47 +0000
81@@ -29,6 +29,7 @@
82 #include <shell/cc-shell.h>
83
84 #include "cc-bluetooth-panel.h"
85+#include "cc-bluetooth-resources.h"
86
87 #include <bluetooth-client.h>
88 #include <bluetooth-utils.h>
89@@ -55,6 +56,7 @@
90 BluetoothKillswitch *killswitch;
91 gboolean debug;
92 GHashTable *connecting_devices;
93+ GCancellable *cancellable;
94 };
95
96 static void cc_bluetooth_panel_finalize (GObject *object);
97@@ -100,6 +102,9 @@
98 bluetooth_plugin_manager_cleanup ();
99
100 self = CC_BLUETOOTH_PANEL (object);
101+ g_cancellable_cancel (self->priv->cancellable);
102+ g_clear_object (&self->priv->cancellable);
103+
104 g_clear_object (&self->priv->builder);
105 g_clear_object (&self->priv->killswitch);
106 g_clear_object (&self->priv->client);
107@@ -163,10 +168,13 @@
108 CcBluetoothPanel *self;
109 char *bdaddr;
110 gboolean success;
111+ GError *error = NULL;
112 ConnectData *data = (ConnectData *) user_data;
113
114 success = bluetooth_client_connect_service_finish (BLUETOOTH_CLIENT (source_object),
115- res, NULL);
116+ res, &error);
117+ if (!success && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
118+ goto out;
119
120 self = data->self;
121
122@@ -185,7 +193,9 @@
123 remove_connecting (self, data->bdaddr);
124
125 g_free (bdaddr);
126- g_object_unref (data->self);
127+
128+out:
129+ g_clear_error (&error);
130 g_free (data->bdaddr);
131 g_free (data);
132 }
133@@ -219,12 +229,12 @@
134
135 data = g_new0 (ConnectData, 1);
136 data->bdaddr = bdaddr;
137- data->self = g_object_ref (self);
138+ data->self = self;
139
140 bluetooth_client_connect_service (self->priv->client,
141 proxy,
142 gtk_switch_get_active (button),
143- NULL,
144+ self->priv->cancellable,
145 connect_done,
146 data);
147
148@@ -796,8 +806,10 @@
149 GtkStyleContext *context;
150
151 self->priv = BLUETOOTH_PANEL_PRIVATE (self);
152+ g_resources_register (cc_bluetooth_get_resource ());
153
154 bluetooth_plugin_manager_init ();
155+ self->priv->cancellable = g_cancellable_new ();
156 self->priv->killswitch = bluetooth_killswitch_new ();
157 self->priv->client = bluetooth_client_new ();
158 self->priv->connecting_devices = g_hash_table_new_full (g_str_hash,
159@@ -808,11 +820,11 @@
160
161 self->priv->builder = gtk_builder_new ();
162 gtk_builder_set_translation_domain (self->priv->builder, GETTEXT_PACKAGE);
163- gtk_builder_add_from_file (self->priv->builder,
164- PKGDATADIR "/bluetooth.ui",
165- &error);
166+ gtk_builder_add_from_resource (self->priv->builder,
167+ "/org/gnome/control-center/bluetooth/bluetooth.ui",
168+ &error);
169 if (error != NULL) {
170- g_warning ("Failed to load '%s': %s", PKGDATADIR "/bluetooth.ui", error->message);
171+ g_warning ("Could not load ui: %s", error->message);
172 g_error_free (error);
173 return;
174 }

Subscribers

People subscribed via source and target branches