Use buttons in notification popups
PATCH 1/1 Use buttons in notification popups
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
Index: main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/main.c,v
retrieving revision 1.87
main.c +16 -22
@@ -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 gchanotify_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(Paconfirm_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(Pasauth_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); }
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Bastien,
Quoted 11 lines
As reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=407551notification-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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Quoted 11 lines · Marcel Holtmann
Hi Bastien,
Quoted 9 lines
As reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=407551notification-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
)
Quoted 5 lines
Quoted 2 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Bastien,
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
As reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=407551notification-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.
Quoted 6 lines
Quoted 2 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Quoted 21 lines · Marcel Holtmann
Hi Bastien,
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
As reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=407551notification-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.
Quoted 6 lines
Quoted 2 lines
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).
Quoted 5 lines
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 withN(). It confuses me, but you are a better expert in this area.
Attached patch fixes that.
Cheers
Index: main.c
===================================================================
RCS file: /cvsroot/bluez/gnome/applet/main.c,v
retrieving revision 1.88
main.c +3 -3
@@ -686,7 +686,7 @@ static void show_notification(const gchanotify_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(Pag_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(Pag_free (device);show_notification (adapter ? adapter :_ ("Bluetooth device" ), - line,N_ ("Confirm pairing" ),0 , + line,_ ("Confirm pairing" ),0 ,G_CALLBACK (notification_closed));g_free (line);
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Bastien,
Quoted 5 lines
Quoted 3 lines
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 withN(). 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel