public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: BlueZ Hackers <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] [BlueZ-Announce] Release of bluez-gnome-0.26
Date: Tue, 08 Apr 2008 17:28:57 +0100	[thread overview]
Message-ID: <1207672137.3396.52.camel@cookie.hadess.net> (raw)
In-Reply-To: <1207446435.26353.1.camel@californication>

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

On Sun, 2008-04-06 at 03:47 +0200, Marcel Holtmann wrote:
> Hi Folks,
> 
> this is the twenty-sixth release of the gnome package for BlueZ. It
> contains a new version of the sendto application and translation
> updates.
> 
> The sources can be found at http://www.bluez.org/download.html

Another patch. This one gives you a better error message when you have a
Palm device, as well as changing the "ETA" message to match that of
Nautilus.

Cheers

[-- Attachment #2: bluez-gnome-sendto-palm.patch --]
[-- Type: text/x-patch, Size: 3032 bytes --]

Index: sendto/dialog.h
===================================================================
RCS file: /cvsroot/bluez/gnome/sendto/dialog.h,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 dialog.h
--- sendto/dialog.h	5 Apr 2008 23:59:11 -0000	1.2
+++ sendto/dialog.h	8 Apr 2008 15:53:07 -0000
@@ -21,5 +21,7 @@
  *
  */
 
+#include <glib.h>
+
 gchar *show_browse_dialog(void);
 gchar **show_select_dialog(void);
Index: sendto/main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/sendto/main.c,v
retrieving revision 1.27
diff -u -p -u -p -r1.27 main.c
--- sendto/main.c	6 Apr 2008 01:26:23 -0000	1.27
+++ sendto/main.c	8 Apr 2008 15:53:08 -0000
@@ -78,6 +78,13 @@ static void response_callback(GtkWidget 
 	gtk_main_quit();
 }
 
+static gboolean is_palm_device(const gchar *bdaddr)
+{
+	return (g_str_has_prefix(bdaddr, "00:04:6B")
+		|| g_str_has_prefix(bdaddr, "00:07:E0")
+		|| g_str_has_prefix(bdaddr, "00:0E:20"));
+}
+
 static void create_window(void)
 {
 	GtkWidget *vbox;
@@ -260,15 +267,15 @@ static void transfer_progress(DBusGProxy
 	remaining_time = (total_size - current_sent) / transfer_rate;
 
 	if (remaining_time >= 3600)
-		time = g_strdup_printf(_("ETA %d:%02d:%02d"),
+		time = g_strdup_printf(_("%d:%02d:%02d Remaining"),
 					remaining_time / 3600,
 					(remaining_time % 3600) / 60,
 					(remaining_time % 3600) % 60);
 	else
-		time = g_strdup_printf(_("ETA %d:%02d"),
+		time = g_strdup_printf(_("%d:%02d Remaining"),
 				remaining_time / 60, remaining_time % 60);
 
-	if (transfer_rate >= 1000)
+	if (transfer_rate >= 3000)
 		rate = g_strdup_printf(_("%d KB/s"), transfer_rate / 1000);
 	else
 		rate = g_strdup_printf(_("%d B/s"), transfer_rate);
@@ -312,6 +319,29 @@ static void session_connected(DBusGProxy
 	send_file(proxy);
 }
 
+static gchar *get_error_message(GError *error)
+{
+	char *message;
+
+	if (error != NULL) {
+		const gchar *error_name;
+
+		if (error && error->code == DBUS_GERROR_REMOTE_EXCEPTION)
+			error_name = dbus_g_error_get_name(error);
+		else
+			error_name = NULL;
+
+		if (error_name && !strcmp(error_name, "org.openobex.Error.ConnectionAttemptFailed") && is_palm_device(option_device)) {
+			message = g_strdup (_("Make sure that remote device is on and that it accepts Bluetooth connections."));
+		} else {
+			message = g_strdup(error->message);
+		}
+	} else
+		message = g_strdup(_("An unknown error occured"));
+
+	return message;
+}
+
 static void create_notify(DBusGProxy *proxy,
 				DBusGProxyCall *call, void *user_data)
 {
@@ -323,12 +353,9 @@ static void create_notify(DBusGProxy *pr
 						G_TYPE_INVALID) == FALSE) {
 		gchar *text, *message;
 
-		if (error != NULL) {
-			message = g_strdup(error->message);
+		message = get_error_message(error);
+		if (error != NULL)
 			g_error_free(error);
-		} else
-			message = g_strdup(_("An unknown error occured"));
-
 		text = g_strdup_printf("<span foreground=\"red\">%s</span>",
 								message);
 		gtk_label_set_markup(GTK_LABEL(label_status), text);

[-- Attachment #3: Type: text/plain, Size: 325 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

       reply	other threads:[~2008-04-08 16:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1207446435.26353.1.camel@californication>
2008-04-08 16:28 ` Bastien Nocera [this message]
2008-04-11 10:31   ` [Bluez-devel] [BlueZ-Announce] Release of bluez-gnome-0.26 Marcel Holtmann

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=1207672137.3396.52.camel@cookie.hadess.net \
    --to=hadess@hadess.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox