~timchen119/ubuntu/trusty/gnome-bluetooth/lp1035431

« back to all changes in this revision

Viewing changes to lib/bluetooth-chooser.c

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2011-02-27 15:45:22 UTC
  • mfrom: (1.3.2 upstream)
  • mto: (2.2.3 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 53.
  • Revision ID: james.westby@ubuntu.com-20110227154522-dnnoqasv5v3mv42a
Tags: upstream-2.91.5
ImportĀ upstreamĀ versionĀ 2.91.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 *
23
23
 */
24
24
 
 
25
/**
 
26
 * SECTION:bluetooth-chooser
 
27
 * @short_description: a Bluetooth chooser widget
 
28
 * @stability: Stable
 
29
 * @include: bluetooth-plugin.h
 
30
 *
 
31
 * A tree-like widget used to select Bluetooth devices.
 
32
 **/
 
33
 
25
34
#ifdef HAVE_CONFIG_H
26
35
#include <config.h>
27
36
#endif
35
44
#include "bluetooth-chooser.h"
36
45
#include "bluetooth-chooser-private.h"
37
46
#include "gnome-bluetooth-enum-types.h"
38
 
#include "bling-spinner.h"
39
47
#include "bluetooth-filter-widget.h"
40
48
 
41
49
enum {
46
54
static int selection_table_signals[LAST_SIGNAL] = { 0 };
47
55
 
48
56
#define BLUETOOTH_CHOOSER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
49
 
                                                                                 BLUETOOTH_TYPE_CHOOSER, BluetoothChooserPrivate))
 
57
                                                                        BLUETOOTH_TYPE_CHOOSER, BluetoothChooserPrivate))
50
58
 
51
59
typedef struct _BluetoothChooserPrivate BluetoothChooserPrivate;
52
60
 
153
161
 
154
162
        if (priv->show_searching == FALSE) {
155
163
                /* Just making sure */
156
 
                bling_spinner_stop (BLING_SPINNER (priv->spinner));
 
164
                gtk_spinner_stop (GTK_SPINNER (priv->spinner));
157
165
                return;
158
166
        }
159
167
        if (state == FALSE) {
160
 
                bling_spinner_stop (BLING_SPINNER (priv->spinner));
 
168
                gtk_spinner_stop (GTK_SPINNER (priv->spinner));
161
169
                gtk_widget_hide (priv->spinner);
162
170
                gtk_label_set_text (GTK_LABEL (priv->search_label), _("No adapters available"));
163
171
        } else {
164
172
                gtk_widget_show (priv->spinner);
165
 
                bling_spinner_start (BLING_SPINNER (priv->spinner));
 
173
                gtk_spinner_start (GTK_SPINNER (priv->spinner));
166
174
                gtk_label_set_text (GTK_LABEL (priv->search_label), _("Searching for devices..."));
167
175
        }
168
176
}
226
234
 * bluetooth_chooser_get_selected_device:
227
235
 * @self: a #BluetoothChooser widget.
228
236
 *
 
237
 * Returns the Bluetooth address for the currently selected device.
 
238
 *
229
239
 * Return value: the Bluetooth address for the currently selected device, or %NULL.
230
240
 **/
231
241
gchar *
238
248
 * bluetooth_chooser_get_selected_device_name:
239
249
 * @self: a #BluetoothChooser widget.
240
250
 *
 
251
 * Returns the name for the currently selected device.
 
252
 *
241
253
 * Return value: the name for the currently selected device, or %NULL.
242
254
 **/
243
255
gchar *
250
262
 * bluetooth_chooser_get_selected_device_icon:
251
263
 * @self: a #BluetoothChooser widget.
252
264
 *
 
265
 * Returns the icon name to use to represent the currently selected device.
 
266
 *
253
267
 * Return value: the icon name to use to represent the currently selected device, or %NULL.
254
268
 **/
255
269
gchar *
262
276
 * bluetooth_chooser_get_selected_device_type:
263
277
 * @self: a #BluetoothChooser widget.
264
278
 *
 
279
 * Returns the #BluetoothType of the device selected.
 
280
 *
265
281
 * Return value: the #BluetoothType of the device selected, or '0' if unknown.
266
282
 **/
267
283
BluetoothType
284
300
 * bluetooth_chooser_get_selected_device_is_connected:
285
301
 * @self: a #BluetoothChooser widget.
286
302
 *
287
 
 * Return value: whether the selected device is conncted to this computer,
 
303
 * Returns whether the selected device is connected to this computer.
 
304
 *
 
305
 * Return value: whether the selected device is connected to this computer,
288
306
 * will always be %FALSE if no devices are selected.
289
307
 **/
290
308
gboolean
308
326
 * @field: The identifier for the field to get data for.
309
327
 * @value: An empty #GValue to set.
310
328
 *
 
329
 * Returns whether the @value has been set.
 
330
 *
311
331
 * Return value: %TRUE if the @value has been set.
312
332
 **/
313
333
gboolean
371
391
 * bluetooth_chooser_remove_selected_device:
372
392
 * @self: A #BluetoothChooser widget.
373
393
 *
 
394
 * Returns whether the removal was successful.
 
395
 *
374
396
 * Return value: %TRUE if the selected device was correctly removed.
375
397
 **/
376
398
gboolean
414
436
 
415
437
/**
416
438
 * bluetooth_chooser_get_model:
417
 
 * @self: A BluetoothChooser widget.
418
 
 *
419
 
 * Return value: The BluetoothChooser's GtkTreeModel.
 
439
 * @self: A #BluetoothChooser widget.
 
440
 *
 
441
 * Returns the #BluetoothChooser's #GtkTreeModel.
 
442
 *
 
443
 * Return value: a #GtkTreeModel object.
420
444
 **/
421
445
GtkTreeModel *
422
446
bluetooth_chooser_get_model (BluetoothChooser *self)
428
452
 
429
453
/**
430
454
 * bluetooth_chooser_get_type_column:
431
 
 * @self: A BluetoothChooser widget.
432
 
 *
433
 
 * Return value: A GtkTreeViewColumn pointer to the type column of the BluetoothChooser.
 
455
 * @self: A #BluetoothChooser widget.
 
456
 *
 
457
 * Returns a #GtkTreeViewColumn object to the type column of the #BluetoothChooser.
 
458
 *
 
459
 * Return value: a #GtkTreeViewColumn object.
434
460
 **/
435
461
GtkTreeViewColumn *
436
462
bluetooth_chooser_get_type_column (BluetoothChooser *self)
442
468
 
443
469
/**
444
470
 * bluetooth_chooser_get_treeview:
445
 
 * @self: A BluetoothChooser widget.
446
 
 *
447
 
 * Return value: The #GtkTreeView pointer for the #BluetoothChooser.
 
471
 * @self: A #BluetoothChooser widget.
 
472
 *
 
473
 * Returns the #GtkTreeView object for the #BluetoothChooser.
 
474
 *
 
475
 * Return value: a #GtkTreeView object.
448
476
 **/
449
477
GtkWidget *
450
478
bluetooth_chooser_get_treeview (BluetoothChooser *self)
834
862
        /* The searching label */
835
863
        priv->search_hbox = gtk_hbox_new (FALSE, 6);
836
864
        gtk_widget_set_no_show_all (priv->search_hbox, TRUE);
837
 
        priv->spinner = bling_spinner_new ();
 
865
        priv->spinner = gtk_spinner_new ();
838
866
        gtk_container_add (GTK_CONTAINER (priv->search_hbox), priv->spinner);
839
867
        gtk_widget_show (priv->spinner);
840
868
        priv->search_label = gtk_label_new (_("Searching for devices..."));
1162
1190
 * bluetooth_chooser_new:
1163
1191
 * @title: the widget header title, if %NULL, the widget header will be hidden.
1164
1192
 *
 
1193
 * Returns a new #BluetoothChooser widget.
 
1194
 *
1165
1195
 * Return value: A #BluetoothChooser widget
1166
1196
 **/
1167
1197
GtkWidget *