Index: common/bluetooth-device-selection.c =================================================================== RCS file: /cvsroot/bluez/gnome/common/bluetooth-device-selection.c,v retrieving revision 1.20 diff -u -p -r1.20 bluetooth-device-selection.c --- common/bluetooth-device-selection.c 12 Mar 2008 21:03:38 -0000 1.20 +++ common/bluetooth-device-selection.c 24 Jun 2008 11:57:01 -0000 @@ -207,6 +207,22 @@ bluetooth_device_selection_get_selected_ return address; } +gchar * +bluetooth_device_selection_get_selected_device_name (BluetoothDeviceSelection *self) +{ + BluetoothDeviceSelectionPrivate *priv = BLUETOOTH_DEVICE_SELECTION_GET_PRIVATE(self); + GtkTreeIter iter; + gchar *name; + gboolean selected; + + selected = gtk_tree_selection_get_selected (priv->selection, NULL, &iter); + if (selected == FALSE) + return NULL; + + gtk_tree_model_get (priv->filter, &iter, COLUMN_NAME, &name, -1); + return name; +} + static void search_button_clicked (GtkButton *button, gpointer user_data) { @@ -617,6 +633,7 @@ enum { PROP_0, PROP_TITLE, PROP_DEVICE_SELECTED, + PROP_DEVICE_SELECTED_NAME, PROP_SHOW_BONDING, PROP_SHOW_SEARCH, PROP_SHOW_DEVICE_TYPE, @@ -688,6 +705,9 @@ bluetooth_device_selection_get_property case PROP_DEVICE_SELECTED: g_value_set_string (value, bluetooth_device_selection_get_selected_device (self)); break; + case PROP_DEVICE_SELECTED_NAME: + g_value_set_string (value, bluetooth_device_selection_get_selected_device_name (self)); + break; case PROP_SHOW_BONDING: g_value_set_boolean (value, priv->show_bonded); break; @@ -738,6 +758,9 @@ bluetooth_device_selection_class_init (B PROP_DEVICE_SELECTED, g_param_spec_string ("device-selected", NULL, NULL, NULL, G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS(klass), + PROP_DEVICE_SELECTED_NAME, g_param_spec_string ("device-selected-name", + NULL, NULL, NULL, G_PARAM_READABLE)); + g_object_class_install_property (G_OBJECT_CLASS(klass), PROP_SHOW_BONDING, g_param_spec_boolean ("show-bonding", NULL, NULL, FALSE, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS(klass),