gnome-bluetooth r399 - trunk/common
- From: hadess svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-bluetooth r399 - trunk/common
- Date: Fri, 27 Feb 2009 19:37:34 +0000 (UTC)
Author: hadess
Date: Fri Feb 27 19:37:33 2009
New Revision: 399
URL: http://svn.gnome.org/viewvc/gnome-bluetooth?rev=399&view=rev
Log:
Don't set button sensitive when no name
Just like in the wizard, wait for the device name to be available before
making the default response sensitive.
Modified:
trunk/common/test-deviceselection.c
Modified: trunk/common/test-deviceselection.c
==============================================================================
--- trunk/common/test-deviceselection.c (original)
+++ trunk/common/test-deviceselection.c Fri Feb 27 19:37:33 2009
@@ -32,12 +32,36 @@
#include "bluetooth-chooser-button.h"
#include "bluetooth-client.h"
+static void select_device_changed(BluetoothChooser *sel,
+ gchar *address, gpointer user_data)
+{
+ GtkDialog *dialog = user_data;
+ char *name;
+
+ g_object_get (G_OBJECT (sel), "device-selected-name", &name, NULL);
+ gtk_dialog_set_response_sensitive(dialog,
+ GTK_RESPONSE_ACCEPT, (address != NULL && name != NULL));
+ g_free (name);
+}
+
static void device_selected_cb(GObject *object,
GParamSpec *spec, gpointer user_data)
{
g_message ("Property \"device-selected\" changed");
}
+static void device_selected_name_cb(GObject *object,
+ GParamSpec *spec, gpointer user_data)
+{
+ char *address;
+
+ g_message ("Property \"device-selected-name\" changed");
+
+ g_object_get (G_OBJECT (object), "device-selected", &address, NULL);
+ select_device_changed (BLUETOOTH_CHOOSER (object), address, user_data);
+ g_free (address);
+}
+
static void device_type_filter_selected_cb(GObject *object,
GParamSpec *spec, gpointer user_data)
{
@@ -50,15 +74,6 @@
g_message ("Property \"device-category-filter\" changed");
}
-static void select_device_changed(BluetoothChooser *sel,
- gchar *address, gpointer user_data)
-{
- GtkDialog *dialog = user_data;
-
- gtk_dialog_set_response_sensitive(dialog,
- GTK_RESPONSE_ACCEPT, address != NULL);
-}
-
/* Phone chooser */
static void
@@ -149,6 +164,8 @@
G_CALLBACK(select_device_changed), dialog);
g_signal_connect(selector, "notify::device-selected",
G_CALLBACK(device_selected_cb), dialog);
+ g_signal_connect(selector, "notify::device-selected-name",
+ G_CALLBACK(device_selected_name_cb), dialog);
g_signal_connect(selector, "notify::device-type-filter",
G_CALLBACK(device_type_filter_selected_cb), dialog);
g_signal_connect(selector, "notify::device-category-filter",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]