From: Michael Terry <michael.terry@canonical.com>
To: BlueZ development <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] Wizard patch
Date: Mon, 30 Jun 2008 08:51:51 -0400 [thread overview]
Message-ID: <1214830311.6764.2.camel@bongo> (raw)
In-Reply-To: <1214605438.11537.0.camel@violet.holtmann.net>
[-- Attachment #1.1.1: Type: text/plain, Size: 448 bytes --]
Hi, Marcel!
On Sat, 2008-06-28 at 00:23 +0200, Marcel Holtmann wrote:
> looks nice. However you have to break this up into pieces for. Sent
> small patches and I can quickly review and commit them.
Here's one such piece of my wizard patch. It simply fixes the "device-type-filter" property to do something reasonable when set (namely, you give it a BLUETOOTH_TYPE and it sets the right index in the combo).
More patches coming.
-mt
[-- Attachment #1.1.2: selector.diff --]
[-- Type: text/x-patch, Size: 2231 bytes --]
diff -rupN bluez-gnome-0.27.orig/common/bluetooth-device-selection.c bluez-gnome-0.27/common/bluetooth-device-selection.c
--- bluez-gnome-0.27.orig/common/bluetooth-device-selection.c 2008-06-27 14:12:49.000000000 -0400
+++ bluez-gnome-0.27/common/bluetooth-device-selection.c 2008-06-27 14:13:05.000000000 -0400
@@ -90,6 +90,15 @@ bluetooth_device_category_to_string (int
}
}
+static int
+int_log2(int v)
+{
+ unsigned rv = 0;
+ while (v >>= 1)
+ rv++;
+ return rv;
+}
+
static void
name_to_text (GtkTreeViewColumn *column, GtkCellRenderer *cell,
GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
@@ -591,7 +600,7 @@ bluetooth_device_selection_init(Bluetoot
}
g_signal_connect (G_OBJECT (priv->device_type), "changed",
G_CALLBACK(filter_type_changed_cb), self);
- gtk_combo_box_set_active (GTK_COMBO_BOX(priv->device_type), priv->device_type_filter);
+ gtk_combo_box_set_active (GTK_COMBO_BOX(priv->device_type), int_log2(priv->device_type_filter));
if (priv->show_device_type) {
gtk_widget_show (priv->device_type_label);
gtk_widget_show (priv->device_type);
@@ -665,7 +674,7 @@ bluetooth_device_selection_set_property
break;
case PROP_DEVICE_TYPE_FILTER:
priv->device_type_filter = g_value_get_int (value);
- gtk_combo_box_set_active (GTK_COMBO_BOX(priv->device_type), priv->device_type_filter >> 1);
+ gtk_combo_box_set_active (GTK_COMBO_BOX(priv->device_type), int_log2(priv->device_type_filter));
break;
case PROP_DEVICE_CATEGORY_FILTER:
priv->device_category_filter = g_value_get_int (value);
@@ -751,7 +760,7 @@ bluetooth_device_selection_class_init (B
NULL, NULL, TRUE, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS(klass),
PROP_DEVICE_TYPE_FILTER, g_param_spec_int ("device-type-filter", NULL, NULL,
- 0, BLUETOOTH_TYPE_NUM_TYPES, 0, G_PARAM_READWRITE));
+ 1, 1 << (BLUETOOTH_TYPE_NUM_TYPES-1), 1, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS(klass),
PROP_DEVICE_CATEGORY_FILTER, g_param_spec_int ("device-category-filter", NULL, NULL,
0, BLUETOOTH_CATEGORY_NUM_CATEGORIES, 0, G_PARAM_READWRITE));
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 247 bytes --]
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2008-06-30 12:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-27 19:05 [Bluez-devel] Wizard patch Michael Terry
2008-06-27 19:18 ` Michael Terry
2008-06-27 19:38 ` David Stockwell
2008-06-27 19:42 ` Michael Terry
2008-06-27 22:24 ` Marcel Holtmann
2008-06-27 22:23 ` Marcel Holtmann
2008-06-30 12:51 ` Michael Terry [this message]
2008-06-30 12:57 ` Marcel Holtmann
2008-06-30 13:20 ` Michael Terry
2008-06-30 14:07 ` Marcel Holtmann
2008-06-30 13:15 ` Michael Terry
2008-06-30 14:06 ` Marcel Holtmann
2008-06-30 15:57 ` Michael Terry
2008-06-30 16:03 ` Marcel Holtmann
2008-06-30 18:53 ` Michael Terry
2008-07-01 1:10 ` Marcel Holtmann
2008-07-09 14:28 ` Michael Terry
2008-08-19 17:33 ` Michael Terry
2008-06-30 13:51 ` Michael Terry
2008-06-30 19:58 ` Michael Terry
2008-06-30 20:01 ` Michael Terry
2008-06-30 20:38 ` Bastien Nocera
2008-06-30 20:42 ` Mario Limonciello
2008-07-01 1:16 ` Marcel Holtmann
2008-06-30 15:48 ` Michael Terry
2008-07-01 1:24 ` Marcel Holtmann
2008-06-27 22:44 ` Bastien Nocera
[not found] ` <031301c8da4d$0bce3720$6701a8c0@freqonedev>
[not found] ` <1214813891.4435.149.camel@cookie.hadess.net>
2008-06-30 13:15 ` David Stockwell
2008-06-30 22:27 ` Luiz Augusto von Dentz
2008-07-01 18:56 ` David Stockwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1214830311.6764.2.camel@bongo \
--to=michael.terry@canonical.com \
--cc=bluez-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.