[brasero] Fix for 631957 - drop status icon use
- From: Philippe Rouquier <philippr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [brasero] Fix for 631957 - drop status icon use
- Date: Mon, 10 Jan 2011 15:46:36 +0000 (UTC)
commit c6b1595725482467433b7b4c505cb0ca9c988c1a
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Mon Jan 10 16:48:06 2011 +0100
Fix for 631957 - drop status icon use
configure.in | 10 ++++++
libbrasero-burn/Makefile.am | 2 +
libbrasero-burn/brasero-burn-dialog.c | 53 +++++++++++++++++++++++++++++++-
3 files changed, 63 insertions(+), 2 deletions(-)
---
diff --git a/configure.in b/configure.in
index 0c7078d..f0930d7 100644
--- a/configure.in
+++ b/configure.in
@@ -230,6 +230,16 @@ AC_SUBST(BRASERO_GTK_CFLAGS)
AC_SUBST(BRASERO_GTK_LIBS)
#
+# libnotify check
+#
+
+LIBNOTIFY_REQUIRED=0.6.1
+
+PKG_CHECK_MODULES([BRASERO_LIBNOTIFY],[libnotify >= $LIBNOTIFY_REQUIRED])
+AC_SUBST(BRASERO_LIBNOTIFY_CFLAGS)
+AC_SUBST(BRASERO_LIBNOTIFY_LIBS)
+
+#
# Canberra
#
diff --git a/libbrasero-burn/Makefile.am b/libbrasero-burn/Makefile.am
index 7be80e6..3840796 100644
--- a/libbrasero-burn/Makefile.am
+++ b/libbrasero-burn/Makefile.am
@@ -17,6 +17,7 @@ INCLUDES = \
$(BRASERO_GLIB_CFLAGS) \
$(BRASERO_GIO_CFLAGS) \
$(BRASERO_GTK_CFLAGS) \
+ $(BRASERO_LIBNOTIFY_CFLAGS) \
$(BRASERO_GSTREAMER_CFLAGS) \
$(BRASERO_CANBERRA_CFLAGS)
@@ -65,6 +66,7 @@ libbrasero_burn BRASERO_LIBRARY_SUFFIX@_la_LIBADD = \
$(BRASERO_GIO_LIBS) \
$(BRASERO_GTK_LIBS) \
$(BRASERO_GSTREAMER_LIBS) \
+ $(BRASERO_LIBNOTIFY_LIBS) \
$(BRASERO_CANBERRA_LIBS)
libbrasero_burn BRASERO_LIBRARY_SUFFIX@_la_LDFLAGS = \
diff --git a/libbrasero-burn/brasero-burn-dialog.c b/libbrasero-burn/brasero-burn-dialog.c
index b0e8052..90bab0a 100644
--- a/libbrasero-burn/brasero-burn-dialog.c
+++ b/libbrasero-burn/brasero-burn-dialog.c
@@ -46,6 +46,7 @@
#include <gtk/gtk.h>
#include <canberra-gtk.h>
+#include <libnotify/notify.h>
#include "brasero-burn-dialog.h"
@@ -135,6 +136,52 @@ brasero_burn_dialog_update_media (BraseroBurnDialog *dialog)
priv->media = media;
}
+static void
+brasero_burn_dialog_notify_daemon_close (NotifyNotification *notification,
+ BraseroBurnDialog *dialog)
+{
+ g_object_unref (notification);
+}
+
+static gboolean
+brasero_burn_dialog_notify_daemon (BraseroBurnDialog *dialog,
+ const char *message)
+{
+ BraseroBurnDialogPrivate *priv;
+ NotifyNotification *notification;
+ GError *error = NULL;
+ gboolean result;
+
+ priv = BRASERO_BURN_DIALOG_PRIVATE (dialog);
+
+ if (!notify_is_initted ()) {
+ notify_init (_("Brasero notification"));
+ }
+
+ notification = notify_notification_new (primary,
+ NULL,
+ GTK_STOCK_CDROM);
+
+ if (!notification)
+ return FALSE;
+
+ g_signal_connect (notification,
+ "closed",
+ G_CALLBACK (brasero_burn_dialog_notify_daemon_close),
+ dialog);
+
+ notify_notification_set_timeout (notification, 10000);
+ notify_notification_set_urgency (notification, NOTIFY_URGENCY_NORMAL);
+
+ result = notify_notification_show (notification, &error);
+ if (error) {
+ g_warning ("Error showing notification");
+ g_error_free (error);
+ }
+
+ return result;
+}
+
static GtkWidget *
brasero_burn_dialog_create_message (BraseroBurnDialog *dialog,
GtkMessageType type,
@@ -1721,6 +1768,8 @@ brasero_burn_dialog_notify_error (BraseroBurnDialog *dialog,
GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE);
+ brasero_burn_dialog_notify_daemon (dialog, _("Error while burning."));
+
response = gtk_dialog_run (GTK_DIALOG (message));
while (response == GTK_RESPONSE_OK) {
brasero_burn_dialog_save_log (dialog);
@@ -1751,7 +1800,6 @@ brasero_burn_dialog_get_success_message (BraseroBurnDialog *dialog)
else
return g_strdup (_("Audio CD successfully burned"));
}
-
return g_strdup (_("Image successfully created"));
}
else if (brasero_track_type_get_has_medium (&priv->input)) {
@@ -1783,7 +1831,6 @@ brasero_burn_dialog_get_success_message (BraseroBurnDialog *dialog)
else
return g_strdup (_("Data CD successfully burned"));
}
-
return g_strdup (_("Image successfully created"));
}
@@ -1865,6 +1912,7 @@ brasero_burn_dialog_notify_copy_finished (BraseroBurnDialog *dialog,
NULL);
g_free (main_message);
+ brasero_burn_dialog_notify_daemon (dialog, main_message);
response = gtk_dialog_run (GTK_DIALOG (message));
g_signal_handler_disconnect (drive, added_id);
@@ -1943,6 +1991,7 @@ brasero_burn_dialog_notify_success (BraseroBurnDialog *dialog)
g_free (primary);
+ brasero_burn_dialog_notify_daemon (dialog, primary);
res = brasero_burn_dialog_success_run (dialog);
if (make_another)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]