All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] [patch] Use buttons in notification popups
@ 2007-12-03 10:24 Bastien Nocera
  2007-12-03 16:26 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien Nocera @ 2007-12-03 10:24 UTC (permalink / raw
  To: BlueZ Hackers

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

Heya,

As reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=407551

notification-daemon kind of sucks and doesn't allow for long messages
(it will clip the messages, see those screenshots:
https://bugzilla.redhat.com/attachment.cgi?id=274901
https://bugzilla.redhat.com/attachment.cgi?id=274911
)

Attached patch removes the extra lines, and adds a button to the popup
instead. It looks better, and still pops up the dialogues as expected.

Cheers

[-- Attachment #2: bluez-gnome-use-notify-button.patch --]
[-- Type: text/x-patch, Size: 4164 bytes --]

Index: main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/main.c,v
retrieving revision 1.87
diff -u -p -r1.87 main.c
--- main.c	29 Aug 2007 20:42:18 -0000	1.87
+++ main.c	3 Dec 2007 10:20:18 -0000
@@ -653,7 +653,7 @@ static void notify_action(NotifyNotifica
 #endif
 
 static void show_notification(const gchar *summary, const gchar *message,
-					gint timeout, GCallback handler)
+			      const gchar *action, gint timeout, GCallback handler)
 {
 #ifdef HAVE_LIBNOTIFY
 	NotifyActionCallback callback;
@@ -685,6 +685,9 @@ static void show_notification(const gcha
 
 	notify_notification_add_action(notify, "default", "action",
 						callback, NULL, NULL);
+	if (action != NULL)
+		notify_notification_add_action(notify, "button", _(action),
+					       callback, NULL, NULL);
 
 	notify_notification_show(notify, NULL);
 #endif
@@ -761,7 +764,7 @@ static gboolean passkey_agent_request(Pa
 {
 	DBusGProxy *object;
 	const char *adapter = NULL, *name = NULL;
-	gchar *device, *text, *line;
+	gchar *device, *line;
 
 	object = dbus_g_proxy_new_for_name(conn, "org.bluez",
 						path, "org.bluez.Adapter");
@@ -786,15 +789,12 @@ static gboolean passkey_agent_request(Pa
 	/* translators: this is a popup telling you a particular device
 	 * has asked for pairing */
 	line = g_strdup_printf(_("Pairing request for '%s'"), device);
-	text = g_strconcat(line, "\n\n",
-			_("Click to open passkey entry dialog"), NULL);
-	g_free(line);
 	g_free(device);
 
 	show_notification(adapter ? adapter : _("Bluetooth device"),
-				text, 0, G_CALLBACK(notification_closed));
+				line, N_("Enter passkey"), 0, G_CALLBACK(notification_closed));
 
-	g_free(text);
+	g_free(line);
 
 	return TRUE;
 }
@@ -805,7 +805,7 @@ static gboolean passkey_agent_confirm(Pa
 {
 	DBusGProxy *object;
 	const char *adapter = NULL, *name = NULL;
-	gchar *device, *text, *line;
+	gchar *device, *line;
 
 	object = dbus_g_proxy_new_for_name(conn, "org.bluez",
 						path, "org.bluez.Adapter");
@@ -828,15 +828,12 @@ static gboolean passkey_agent_confirm(Pa
 	confirm_dialog(path, address, value, device, context);
 
 	line = g_strdup_printf(_("Pairing request for '%s'"), device);
-	text = g_strconcat(line, "\n\n",
-			_("Click to open confirmation dialog"), NULL);
-	g_free(line);
 	g_free(device);
 
 	show_notification(adapter ? adapter : _("Bluetooth device"),
-				text, 0, G_CALLBACK(notification_closed));
+				line, N_("Confirm pairing"), 0, G_CALLBACK(notification_closed));
 
-	g_free(text);
+	g_free (line);
 
 	return TRUE;
 }
@@ -940,7 +937,7 @@ static gboolean auth_agent_authorize(Pas
 {
 	DBusGProxy *object;
 	const char *adapter = NULL, *name = NULL;
-	gchar *device, *profile, *text, *line;
+	gchar *device, *profile, *line;
 
 	if (auto_authorize == TRUE) {
 		dbus_g_method_return(context);
@@ -974,15 +971,12 @@ static gboolean auth_agent_authorize(Pas
 	auth_dialog(path, address, service, uuid, device, profile, context);
 
 	line = g_strdup_printf(_("Authorization request for %s"), device);
-	text = g_strconcat(line, "\n\n",
-			_("Click to open authorization dialog"), NULL);
-	g_free(line);
 	g_free(device);
 
 	show_notification(adapter ? adapter : _("Bluetooth device"),
-				text, 0, G_CALLBACK(notification_closed));
+				line, _("Check authorization"), 0, G_CALLBACK(notification_closed));
 
-	g_free(text);
+	g_free(line);
 
 	return TRUE;
 }
@@ -1105,7 +1099,7 @@ static void bonding_created(DBusGProxy *
 	g_free(device);
 
 	show_notification(adapter ? adapter : _("Bluetooth device"),
-							text, 6000, NULL);
+							text, NULL, 6000, NULL);
 
 	g_free(text);
 }
@@ -1136,7 +1130,7 @@ static void bonding_removed(DBusGProxy *
 	g_free(device);
 
 	show_notification(adapter ? adapter : _("Bluetooth device"),
-							text, 6000, NULL);
+							text, NULL, 6000, NULL);
 
 	g_free(text);
 }
@@ -1199,7 +1193,7 @@ static void mode_changed(DBusGProxy *obj
 				G_TYPE_STRING, &adapter_name, G_TYPE_INVALID);
 
 	show_notification(adapter_name ? adapter_name : _("Bluetooth device"),
-							_(text), 3000, NULL);
+							_(text), NULL, 3000, NULL);
 
 	set_new_mode(adapter, mode);
 }

[-- Attachment #3: pairing-notification.png --]
[-- Type: image/png, Size: 15388 bytes --]

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

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] [patch] Use buttons in notification popups
  2007-12-03 10:24 [Bluez-devel] [patch] Use buttons in notification popups Bastien Nocera
@ 2007-12-03 16:26 ` Marcel Holtmann
  2007-12-03 16:32   ` Bastien Nocera
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2007-12-03 16:26 UTC (permalink / raw
  To: BlueZ development

Hi Bastien,

> As reported here:
> https://bugzilla.redhat.com/show_bug.cgi?id=407551
> 
> notification-daemon kind of sucks and doesn't allow for long messages
> (it will clip the messages, see those screenshots:
> https://bugzilla.redhat.com/attachment.cgi?id=274901
> https://bugzilla.redhat.com/attachment.cgi?id=274911
> )
> 
> Attached patch removes the extra lines, and adds a button to the popup
> instead. It looks better, and still pops up the dialogues as expected.

look good to me. Any special requirements on the version of libnotify to
make this work?

Regards

Marcel



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] [patch] Use buttons in notification popups
  2007-12-03 16:26 ` Marcel Holtmann
@ 2007-12-03 16:32   ` Bastien Nocera
  2007-12-03 17:04     ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien Nocera @ 2007-12-03 16:32 UTC (permalink / raw
  To: BlueZ development


On Mon, 2007-12-03 at 17:26 +0100, Marcel Holtmann wrote:
> Hi Bastien,
> 
> > As reported here:
> > https://bugzilla.redhat.com/show_bug.cgi?id=407551
> > 
> > notification-daemon kind of sucks and doesn't allow for long messages
> > (it will clip the messages, see those screenshots:
> > https://bugzilla.redhat.com/attachment.cgi?id=274901
> > https://bugzilla.redhat.com/attachment.cgi?id=274911
> > )
> > 
> > Attached patch removes the extra lines, and adds a button to the popup
> > instead. It looks better, and still pops up the dialogues as expected.
> 
> look good to me. Any special requirements on the version of libnotify to
> make this work?

I don't think so, but this seems to work on any recent version of
libnotify I've seen. And it's the same API you've used (just the
"action" is different).


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] [patch] Use buttons in notification popups
  2007-12-03 16:32   ` Bastien Nocera
@ 2007-12-03 17:04     ` Marcel Holtmann
  2007-12-04 14:03       ` Bastien Nocera
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2007-12-03 17:04 UTC (permalink / raw
  To: BlueZ development

Hi Bastien,

> > > As reported here:
> > > https://bugzilla.redhat.com/show_bug.cgi?id=407551
> > > 
> > > notification-daemon kind of sucks and doesn't allow for long messages
> > > (it will clip the messages, see those screenshots:
> > > https://bugzilla.redhat.com/attachment.cgi?id=274901
> > > https://bugzilla.redhat.com/attachment.cgi?id=274911
> > > )
> > > 
> > > Attached patch removes the extra lines, and adds a button to the popup
> > > instead. It looks better, and still pops up the dialogues as expected.
> > 
> > look good to me. Any special requirements on the version of libnotify to
> > make this work?
> 
> I don't think so, but this seems to work on any recent version of
> libnotify I've seen. And it's the same API you've used (just the
> "action" is different).

I gonna double check, but otherwise the patch is fine and committed.

About the _(action). I don't think we should do the translation this
way. Lets translate the string where there actually are an not mask them
with N(). It confuses me, but you are a better expert in this area.

Regards

Marcel



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] [patch] Use buttons in notification popups
  2007-12-03 17:04     ` Marcel Holtmann
@ 2007-12-04 14:03       ` Bastien Nocera
  2007-12-04 15:31         ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Bastien Nocera @ 2007-12-04 14:03 UTC (permalink / raw
  To: BlueZ development

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


On Mon, 2007-12-03 at 18:04 +0100, Marcel Holtmann wrote:
> Hi Bastien,
> 
> > > > As reported here:
> > > > https://bugzilla.redhat.com/show_bug.cgi?id=407551
> > > > 
> > > > notification-daemon kind of sucks and doesn't allow for long messages
> > > > (it will clip the messages, see those screenshots:
> > > > https://bugzilla.redhat.com/attachment.cgi?id=274901
> > > > https://bugzilla.redhat.com/attachment.cgi?id=274911
> > > > )
> > > > 
> > > > Attached patch removes the extra lines, and adds a button to the popup
> > > > instead. It looks better, and still pops up the dialogues as expected.
> > > 
> > > look good to me. Any special requirements on the version of libnotify to
> > > make this work?
> > 
> > I don't think so, but this seems to work on any recent version of
> > libnotify I've seen. And it's the same API you've used (just the
> > "action" is different).
> 
> I gonna double check, but otherwise the patch is fine and committed.
> 
> About the _(action). I don't think we should do the translation this
> way. Lets translate the string where there actually are an not mask them
> with N(). It confuses me, but you are a better expert in this area.

Attached patch fixes that.

Cheers

[-- Attachment #2: bluez-gnome-remove-gettext-noop.patch --]
[-- Type: text/x-patch, Size: 1187 bytes --]

Index: main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/main.c,v
retrieving revision 1.88
diff -u -p -r1.88 main.c
--- main.c	3 Dec 2007 17:03:31 -0000	1.88
+++ main.c	4 Dec 2007 14:02:19 -0000
@@ -686,7 +686,7 @@ static void show_notification(const gcha
 	notify_notification_add_action(notify, "default", "action",
 						callback, NULL, NULL);
 	if (action != NULL)
-		notify_notification_add_action(notify, "button", _(action),
+		notify_notification_add_action(notify, "button", action,
 					       callback, NULL, NULL);
 
 	notify_notification_show(notify, NULL);
@@ -792,7 +792,7 @@ static gboolean passkey_agent_request(Pa
 	g_free(device);
 
 	show_notification(adapter ? adapter : _("Bluetooth device"),
-					line, N_("Enter passkey"), 0,
+					line, _("Enter passkey"), 0,
 					G_CALLBACK(notification_closed));
 
 	g_free(line);
@@ -832,7 +832,7 @@ static gboolean passkey_agent_confirm(Pa
 	g_free(device);
 
 	show_notification(adapter ? adapter : _("Bluetooth device"),
-					line, N_("Confirm pairing"), 0,
+					line, _("Confirm pairing"), 0,
 					G_CALLBACK(notification_closed));
 
 	g_free (line);

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

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

[-- 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] [patch] Use buttons in notification popups
  2007-12-04 14:03       ` Bastien Nocera
@ 2007-12-04 15:31         ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2007-12-04 15:31 UTC (permalink / raw
  To: BlueZ development

Hi Bastien,

> > About the _(action). I don't think we should do the translation this
> > way. Lets translate the string where there actually are an not mask them
> > with N(). It confuses me, but you are a better expert in this area.
> 
> Attached patch fixes that.

committed to the CVS. Thanks.

Regards

Marcel



-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-04 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-03 10:24 [Bluez-devel] [patch] Use buttons in notification popups Bastien Nocera
2007-12-03 16:26 ` Marcel Holtmann
2007-12-03 16:32   ` Bastien Nocera
2007-12-03 17:04     ` Marcel Holtmann
2007-12-04 14:03       ` Bastien Nocera
2007-12-04 15:31         ` Marcel Holtmann

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.