[brasero] Move code to use GtkInfoBar
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [brasero] Move code to use GtkInfoBar
- Date: Wed, 25 Nov 2009 19:48:55 +0000 (UTC)
commit f3bbe64c6788aab8323b4e6f1e45e9a206812b8e
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Wed Nov 25 20:43:54 2009 +0100
Move code to use GtkInfoBar
libbrasero-burn/brasero-burn-options.c | 19 +-
libbrasero-utils/brasero-disc-message.c | 337 +------------------------------
libbrasero-utils/brasero-disc-message.h | 20 +--
libbrasero-utils/brasero-notify.c | 28 +---
libbrasero-utils/brasero-notify.h | 6 -
src/brasero-audio-disc.c | 25 +--
src/brasero-data-disc.c | 47 ++---
src/brasero-project.c | 18 +-
8 files changed, 60 insertions(+), 440 deletions(-)
---
diff --git a/libbrasero-burn/brasero-burn-options.c b/libbrasero-burn/brasero-burn-options.c
index ea86e63..f315380 100644
--- a/libbrasero-burn/brasero-burn-options.c
+++ b/libbrasero-burn/brasero-burn-options.c
@@ -381,11 +381,11 @@ brasero_burn_options_update_valid (BraseroBurnOptions *self)
_("The data size is too large for the disc even with the overburn option."),
-1,
BRASERO_NOTIFY_CONTEXT_SIZE);
- brasero_notify_button_add (BRASERO_NOTIFY (priv->message_output),
- BRASERO_DISC_MESSAGE (message),
- _("_Burn Several Discs"),
- _("Burn the selection of files across several media"),
- GTK_RESPONSE_OK);
+
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("_Burn Several Discs"),
+ GTK_RESPONSE_OK),
+ _("Burn the selection of files across several media"));
g_signal_connect (message,
"response",
@@ -507,11 +507,10 @@ brasero_burn_options_update_valid (BraseroBurnOptions *self)
"\nNOTE: This option might cause failure."),
-1,
BRASERO_NOTIFY_CONTEXT_SIZE);
- brasero_notify_button_add (BRASERO_NOTIFY (priv->message_output),
- BRASERO_DISC_MESSAGE (message),
- _("_Overburn"),
- _("Burn beyond the disc's reported capacity"),
- GTK_RESPONSE_OK);
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("_Overburn"),
+ GTK_RESPONSE_OK),
+ _("Burn beyond the disc's reported capacity"));
g_signal_connect (message,
"response",
diff --git a/libbrasero-utils/brasero-disc-message.c b/libbrasero-utils/brasero-disc-message.c
index c7993b2..95d114b 100644
--- a/libbrasero-utils/brasero-disc-message.c
+++ b/libbrasero-utils/brasero-disc-message.c
@@ -57,10 +57,6 @@ struct _BraseroDiscMessagePrivate
GtkWidget *primary;
GtkWidget *secondary;
- GtkWidget *image;
-
- GtkWidget *main_box;
- GtkWidget *button_box;
GtkWidget *text_box;
guint context;
@@ -68,22 +64,12 @@ struct _BraseroDiscMessagePrivate
guint id;
guint timeout;
- guint changing_style:1;
guint prevent_destruction:1;
};
#define BRASERO_DISC_MESSAGE_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_DISC_MESSAGE, BraseroDiscMessagePrivate))
-enum
-{
- RESPONSE,
- LAST_SIGNAL
-};
-
-
-static guint disc_message_signals[LAST_SIGNAL] = { 0 };
-
-G_DEFINE_TYPE (BraseroDiscMessage, brasero_disc_message, GTK_TYPE_BIN);
+G_DEFINE_TYPE (BraseroDiscMessage, brasero_disc_message, GTK_TYPE_INFO_BAR);
#define RESPONSE_TYPE "ResponseType"
@@ -101,10 +87,7 @@ brasero_disc_message_timeout (gpointer data)
priv->timeout = 0;
priv->prevent_destruction = TRUE;
- g_signal_emit (data,
- disc_message_signals [RESPONSE],
- 0,
- GTK_RESPONSE_DELETE_EVENT);
+ gtk_info_bar_response (data, GTK_RESPONSE_DELETE_EVENT);
priv->prevent_destruction = FALSE;
gtk_widget_destroy (GTK_WIDGET (data));
@@ -234,24 +217,6 @@ brasero_disc_message_remove_errors (BraseroDiscMessage *self)
priv->expander = NULL;
}
-static void
-brasero_disc_message_button_clicked_cb (GtkButton *button,
- BraseroDiscMessage *self)
-{
- BraseroDiscMessagePrivate *priv;
-
- priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
-
- priv->prevent_destruction = TRUE;
- g_signal_emit (self,
- disc_message_signals [RESPONSE],
- 0,
- GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), RESPONSE_TYPE)));
- priv->prevent_destruction = FALSE;
-
- gtk_widget_destroy (GTK_WIDGET (self));
-}
-
void
brasero_disc_message_destroy (BraseroDiscMessage *self)
{
@@ -265,97 +230,13 @@ brasero_disc_message_destroy (BraseroDiscMessage *self)
gtk_widget_destroy (GTK_WIDGET (self));
}
-GtkWidget *
-brasero_disc_message_add_button (BraseroDiscMessage *self,
- GtkSizeGroup *group,
- const gchar *text,
- const gchar *tooltip,
- GtkResponseType response)
-{
- GtkWidget *button;
- PangoLayout *layout;
- BraseroDiscMessagePrivate *priv;
-
- priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
-
- button = gtk_button_new_from_stock (text);
-
- /* only add buttons to group if the text is not wrapped. Otherwise
- * buttons would be too big. */
- layout = gtk_label_get_layout (GTK_LABEL (priv->primary));
- if (!pango_layout_is_wrapped (layout))
- gtk_size_group_add_widget (priv->group, button);
-
- gtk_widget_set_tooltip_text (button, tooltip);
- gtk_widget_show (button);
- g_signal_connect (button,
- "clicked",
- G_CALLBACK (brasero_disc_message_button_clicked_cb),
- self);
-
- g_object_set_data (G_OBJECT (button), RESPONSE_TYPE, GINT_TO_POINTER (response));
-
- gtk_box_pack_start (GTK_BOX (priv->button_box),
- button,
- FALSE,
- TRUE,
- 0);
- gtk_widget_queue_draw (GTK_WIDGET (self));
- return button;
-}
-
-void
-brasero_disc_message_add_close_button (BraseroDiscMessage *self)
-{
- GtkWidget *button;
- PangoLayout *layout;
- GtkWidget *alignment;
- BraseroDiscMessagePrivate *priv;
-
- priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
-
- button = gtk_button_new ();
-
- /* only add buttons to group if the text is not wrapped. Otherwise
- * buttons would be too big. */
- layout = gtk_label_get_layout (GTK_LABEL (priv->primary));
- if (pango_layout_is_wrapped (layout))
- gtk_size_group_add_widget (priv->group, button);
-
- alignment = gtk_alignment_new (1.0, 0.0, 0.0, 0.0);
- gtk_widget_show (alignment);
- gtk_container_add (GTK_CONTAINER (alignment), button);
-
- gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
- gtk_button_set_image (GTK_BUTTON (button),
- gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_BUTTON));
-
- gtk_widget_set_tooltip_text (button, _("Close this notification window"));
- gtk_widget_show (button);
- g_signal_connect (button,
- "clicked",
- G_CALLBACK (brasero_disc_message_button_clicked_cb),
- self);
-
- g_object_set_data (G_OBJECT (button),
- RESPONSE_TYPE,
- GINT_TO_POINTER (GTK_RESPONSE_CLOSE));
-
- gtk_box_pack_start (GTK_BOX (priv->main_box),
- alignment,
- FALSE,
- TRUE,
- 0);
- gtk_widget_queue_draw (GTK_WIDGET (self));
-}
-
void
brasero_disc_message_remove_buttons (BraseroDiscMessage *self)
{
BraseroDiscMessagePrivate *priv;
priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
- gtk_container_foreach (GTK_CONTAINER (priv->button_box),
+ gtk_container_foreach (GTK_CONTAINER (gtk_info_bar_get_action_area (GTK_INFO_BAR (self))),
(GtkCallback) gtk_widget_destroy,
NULL);
}
@@ -423,18 +304,6 @@ brasero_disc_message_set_progress (BraseroDiscMessage *self,
}
void
-brasero_disc_message_set_image (BraseroDiscMessage *self,
- const gchar *stock_id)
-{
- BraseroDiscMessagePrivate *priv;
-
- priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
- gtk_image_set_from_stock (GTK_IMAGE (priv->image),
- stock_id,
- GTK_ICON_SIZE_DIALOG);
-}
-
-void
brasero_disc_message_set_primary (BraseroDiscMessage *self,
const gchar *message)
{
@@ -478,39 +347,6 @@ brasero_disc_message_set_secondary (BraseroDiscMessage *self,
gtk_widget_show (priv->secondary);
}
-/**
- * Two following functions are Cut and Pasted from gedit-message-area.c
- */
-static void
-style_set (GtkWidget *widget,
- GtkStyle *prev_style,
- BraseroDiscMessage *self)
-{
- BraseroDiscMessagePrivate *priv;
- GtkWidget *window;
- GtkStyle *style;
-
- priv = BRASERO_DISC_MESSAGE_PRIVATE (self);
-
- if (priv->changing_style)
- return;
-
- window = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_widget_set_name (window, "gtk-tooltip");
- gtk_widget_ensure_style (window);
- style = gtk_widget_get_style (window);
-
- priv->changing_style = TRUE;
- gtk_widget_set_style (GTK_WIDGET (self), style);
- priv->changing_style = FALSE;
-
- gtk_widget_destroy (window);
-
-// gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
-
- gtk_widget_queue_draw (GTK_WIDGET (self));
-}
-
static void
brasero_disc_message_init (BraseroDiscMessage *object)
{
@@ -520,28 +356,11 @@ brasero_disc_message_init (BraseroDiscMessage *object)
priv = BRASERO_DISC_MESSAGE_PRIVATE (object);
gtk_widget_set_has_window (GTK_WIDGET (object), FALSE);
- main_box = gtk_hbox_new (FALSE, 12);
- priv->main_box = main_box;
- gtk_widget_show (main_box);
- gtk_container_set_border_width (GTK_CONTAINER (main_box), 8);
- gtk_container_add (GTK_CONTAINER (object), main_box);
-
- /* Note that we connect to style-set on one of the internal
- * widgets, not on the message area itself, since gtk does
- * not deliver any further style-set signals for a widget on
- * which the style has been forced with gtk_widget_set_style() */
- g_signal_connect (main_box,
- "style-set",
- G_CALLBACK (style_set),
- object);
+ main_box = gtk_info_bar_get_content_area (GTK_INFO_BAR (object));
+ gtk_container_set_border_width (GTK_CONTAINER (main_box), 0);
priv->group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
- priv->image = gtk_image_new ();
- gtk_widget_show (priv->image);
- gtk_misc_set_alignment (GTK_MISC (priv->image), 0.5, 0.0);
- gtk_box_pack_start (GTK_BOX (main_box), priv->image, FALSE, FALSE, 0);
-
priv->text_box = gtk_vbox_new (FALSE, 6);
gtk_widget_show (priv->text_box);
gtk_box_pack_start (GTK_BOX (main_box), priv->text_box, TRUE, TRUE, 0);
@@ -552,14 +371,6 @@ brasero_disc_message_init (BraseroDiscMessage *object)
gtk_size_group_add_widget (priv->group, priv->primary);
gtk_misc_set_alignment (GTK_MISC (priv->primary), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (priv->text_box), priv->primary, TRUE, TRUE, 0);
-
- priv->button_box = gtk_vbox_new (FALSE, 8);
- gtk_widget_show (priv->button_box);
- gtk_box_pack_start (GTK_BOX (main_box),
- priv->button_box,
- FALSE,
- FALSE,
- 0);
}
static void
@@ -585,151 +396,13 @@ brasero_disc_message_finalize (GObject *object)
}
static void
-brasero_disc_message_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- GtkBin *bin = GTK_BIN (widget);
- GtkWidget *child;
- guint border_width;
-
- border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- requisition->width = border_width * 2;
- requisition->height = border_width * 2;
-
- child = gtk_bin_get_child (bin);
- if (child && gtk_widget_get_visible (child)) {
- GtkRequisition child_requisition;
-
- gtk_widget_size_request (child, &child_requisition);
-
- requisition->width += child_requisition.width;
- requisition->height += child_requisition.height;
- }
-}
-
-static void
-brasero_disc_message_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
-{
- GtkBin *bin;
- GtkWidget *child;
- GtkAllocation child_allocation;
- GdkWindow *window;
- guint border_width;
-
- gtk_widget_set_allocation (widget, allocation);
- bin = GTK_BIN (widget);
-
- child_allocation.x = 0,
- child_allocation.y = 0;
- child_allocation.width = allocation->width;
- child_allocation.height = allocation->height;
-
- window = gtk_widget_get_window (widget);
- if (window) {
- border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
- gdk_window_move_resize (window,
- allocation->x + border_width,
- allocation->y + border_width,
- child_allocation.width,
- child_allocation.height);
- }
-
- child = gtk_bin_get_child (GTK_BIN (widget));
- if (child)
- gtk_widget_size_allocate (child, &child_allocation);
-}
-
-static void
-brasero_disc_message_realize (GtkWidget *widget)
-{
- GtkAllocation allocation;
- GdkWindowAttr attributes;
- GdkWindow *window;
- gint attributes_mask;
-
- attributes.window_type = GDK_WINDOW_CHILD;
- gtk_widget_get_allocation (widget, &allocation);
- attributes.x = allocation.x;
- attributes.y = allocation.y;
- attributes.width = allocation.width;
- attributes.height = allocation.height;
- attributes.wclass = GDK_INPUT_OUTPUT;
- attributes.visual = gtk_widget_get_visual (widget);
- attributes.colormap = gtk_widget_get_colormap (widget);
- attributes.event_mask = gtk_widget_get_events (widget);
- attributes.event_mask |= GDK_EXPOSURE_MASK;
- attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_COLORMAP;
-
- gtk_widget_set_window (widget, gdk_window_new (gtk_widget_get_parent_window (widget),
- &attributes,
- attributes_mask));
- window = gtk_widget_get_window (widget);
- gdk_window_set_user_data (window, widget);
-
- gtk_widget_set_style (widget, gtk_style_attach (gtk_widget_get_style (widget), window));
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
-}
-
-static gboolean
-brasero_disc_message_expose_event (GtkWidget *widget,
- GdkEventExpose *event)
-{
- GtkAllocation allocation;
-
- gtk_widget_get_allocation (widget, &allocation);
- gtk_paint_flat_box (gtk_widget_get_style (widget),
- gtk_widget_get_window (widget),
- GTK_STATE_NORMAL,
- GTK_SHADOW_OUT,
- NULL,
- widget,
- "tooltip",
- 0,
- 0,
- allocation.width,
- allocation.height);
-
- GTK_WIDGET_CLASS (brasero_disc_message_parent_class)->expose_event (widget, event);
-
- return FALSE;
-}
-
-static void
brasero_disc_message_class_init (BraseroDiscMessageClass *klass)
{
- GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass* object_class = G_OBJECT_CLASS (klass);
- GtkBindingSet *binding_set;
g_type_class_add_private (klass, sizeof (BraseroDiscMessagePrivate));
object_class->finalize = brasero_disc_message_finalize;
-
- widget_class->expose_event = brasero_disc_message_expose_event;
- widget_class->realize = brasero_disc_message_realize;
-
- widget_class->size_request = brasero_disc_message_size_request;
- widget_class->size_allocate = brasero_disc_message_size_allocate;
-
- disc_message_signals[RESPONSE] =
- g_signal_new ("response",
- G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_CLEANUP | G_SIGNAL_NO_RECURSE,
- G_STRUCT_OFFSET (BraseroDiscMessageClass, response),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1,
- G_TYPE_INT);
-
- binding_set = gtk_binding_set_by_class (klass);
- gtk_binding_entry_add_signal (binding_set,
- GDK_Escape,
- 0,
- "response",
- 0,
- G_TYPE_INT, GTK_RESPONSE_CLOSE);
}
GtkWidget *
diff --git a/libbrasero-utils/brasero-disc-message.h b/libbrasero-utils/brasero-disc-message.h
index b872877..3e9920a 100644
--- a/libbrasero-utils/brasero-disc-message.h
+++ b/libbrasero-utils/brasero-disc-message.h
@@ -48,16 +48,12 @@ typedef struct _BraseroDiscMessage BraseroDiscMessage;
struct _BraseroDiscMessageClass
{
- GtkBinClass parent_class;
-
- /* Signals */
- void (*response) (BraseroDiscMessage *message,
- GtkResponseType response);
+ GtkInfoBarClass parent_class;
};
struct _BraseroDiscMessage
{
- GtkBin parent_instance;
+ GtkInfoBar parent_instance;
};
GType brasero_disc_message_get_type (void) G_GNUC_CONST;
@@ -74,23 +70,13 @@ brasero_disc_message_set_primary (BraseroDiscMessage *message,
void
brasero_disc_message_set_secondary (BraseroDiscMessage *message,
const gchar *text);
-void
-brasero_disc_message_set_image (BraseroDiscMessage *message,
- const gchar *image);
+
void
brasero_disc_message_set_progress_active (BraseroDiscMessage *message,
gboolean active);
void
brasero_disc_message_set_progress (BraseroDiscMessage *self,
gdouble progress);
-GtkWidget *
-brasero_disc_message_add_button (BraseroDiscMessage *message,
- GtkSizeGroup *group,
- const gchar *text,
- const gchar *tooltip,
- GtkResponseType type);
-void
-brasero_disc_message_add_close_button (BraseroDiscMessage *message);
void
brasero_disc_message_remove_buttons (BraseroDiscMessage *message);
diff --git a/libbrasero-utils/brasero-notify.c b/libbrasero-utils/brasero-notify.c
index 6531742..a97d907 100644
--- a/libbrasero-utils/brasero-notify.c
+++ b/libbrasero-utils/brasero-notify.c
@@ -42,7 +42,6 @@
struct _BraseroNotifyPrivate
{
GtkSizeGroup *message;
- GtkSizeGroup *button;
};
typedef struct _BraseroNotifyPrivate BraseroNotifyPrivate;
@@ -136,10 +135,10 @@ brasero_notify_message_add (BraseroNotify *self,
priv = BRASERO_NOTIFY_PRIVATE (self);
- GDK_THREADS_ENTER ();
-
brasero_notify_message_remove (self, context_id);
+ GDK_THREADS_ENTER ();
+
message = brasero_disc_message_new ();
gtk_size_group_add_widget (priv->message, message);
brasero_disc_message_set_context (BRASERO_DISC_MESSAGE (message), context_id);
@@ -156,30 +155,12 @@ brasero_notify_message_add (BraseroNotify *self,
return message;
}
-GtkWidget *
-brasero_notify_button_add (BraseroNotify *self,
- BraseroDiscMessage *message,
- const gchar *text,
- const gchar *tooltip,
- GtkResponseType response)
-{
- BraseroNotifyPrivate *priv;
-
- priv = BRASERO_NOTIFY_PRIVATE (self);
- return brasero_disc_message_add_button (BRASERO_DISC_MESSAGE (message),
- priv->button,
- text,
- tooltip,
- response);
-}
-
static void
brasero_notify_init (BraseroNotify *object)
{
BraseroNotifyPrivate *priv;
priv = BRASERO_NOTIFY_PRIVATE (object);
- priv->button = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
priv->message = gtk_size_group_new (GTK_SIZE_GROUP_BOTH);
}
@@ -190,11 +171,6 @@ brasero_notify_finalize (GObject *object)
priv = BRASERO_NOTIFY_PRIVATE (object);
- if (priv->button) {
- g_object_unref (priv->button);
- priv->button = NULL;
- }
-
if (priv->message) {
g_object_unref (priv->message);
priv->message = NULL;
diff --git a/libbrasero-utils/brasero-notify.h b/libbrasero-utils/brasero-notify.h
index 26e9a62..cef5f11 100644
--- a/libbrasero-utils/brasero-notify.h
+++ b/libbrasero-utils/brasero-notify.h
@@ -76,12 +76,6 @@ brasero_notify_message_add (BraseroNotify *notify,
const gchar *secondary,
gint timeout,
guint context_id);
-GtkWidget *
-brasero_notify_button_add (BraseroNotify *notify,
- BraseroDiscMessage *message,
- const gchar *text,
- const gchar *tooltip,
- GtkResponseType response);
void
brasero_notify_message_remove (BraseroNotify *notify,
diff --git a/src/brasero-audio-disc.c b/src/brasero-audio-disc.c
index 55d380f..f55d8f4 100644
--- a/src/brasero-audio-disc.c
+++ b/src/brasero-audio-disc.c
@@ -863,20 +863,17 @@ brasero_audio_disc_wav_dts_file_dialog (BraseroAudioDisc *disc)
0,
BRASERO_AUDIO_DISC_CONTEXT);
- brasero_disc_message_set_image (BRASERO_DISC_MESSAGE (message),
- GTK_MESSAGE_INFO);
-
- brasero_notify_button_add (BRASERO_NOTIFY (disc->priv->message),
- BRASERO_DISC_MESSAGE (message),
- _("Create _Regular Tracks"),
- _("Click here to burn all songs as regular tracks"),
- GTK_RESPONSE_NO);
-
- brasero_notify_button_add (BRASERO_NOTIFY (disc->priv->message),
- BRASERO_DISC_MESSAGE (message),
- _("Create _DTS Tracks"),
- _("Click here to burn all suitable songs as DTS tracks"),
- GTK_RESPONSE_OK);
+ gtk_info_bar_set_message_type (GTK_INFO_BAR (message), GTK_MESSAGE_INFO);
+
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("Create _Regular Tracks"),
+ GTK_RESPONSE_NO),
+ _("Click here to burn all songs as regular tracks"));
+
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("Create _DTS Tracks"),
+ GTK_RESPONSE_OK),
+ _("Click here to burn all suitable songs as DTS tracks"));
g_signal_connect (BRASERO_DISC_MESSAGE (message),
"response",
diff --git a/src/brasero-data-disc.c b/src/brasero-data-disc.c
index 0e9ea0e..46b756d 100644
--- a/src/brasero-data-disc.c
+++ b/src/brasero-data-disc.c
@@ -560,18 +560,18 @@ brasero_data_disc_project_loaded_cb (BraseroTrackDataCfg *project,
brasero_disc_message_set_secondary (BRASERO_DISC_MESSAGE (message),
_("Discard the current modified project"));
- brasero_disc_message_set_image (BRASERO_DISC_MESSAGE (message),GTK_STOCK_DIALOG_WARNING);
+ gtk_info_bar_set_message_type (GTK_INFO_BAR (message), GTK_MESSAGE_WARNING);
+
brasero_disc_message_set_progress_active (BRASERO_DISC_MESSAGE (message), FALSE);
- brasero_notify_button_add (BRASERO_NOTIFY (priv->message),
- BRASERO_DISC_MESSAGE (message),
- _("_Discard"),
- _("Discard the current modified project"),
- GTK_RESPONSE_CANCEL);
- brasero_notify_button_add (BRASERO_NOTIFY (priv->message),
- BRASERO_DISC_MESSAGE (message),
- _("_Continue"),
- _("Continue with the current modified project"),
- GTK_RESPONSE_OK);
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("_Discard"),
+ GTK_RESPONSE_CANCEL),
+ _("Discard the current modified project"));
+
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("_Continue"),
+ GTK_RESPONSE_OK),
+ _("Continue with the current modified project"));
brasero_disc_message_add_errors (BRASERO_DISC_MESSAGE (message),
priv->load_errors);
@@ -1117,14 +1117,11 @@ brasero_data_disc_session_available_cb (BraseroTrackDataCfg *session,
g_free (volume_name);
g_free (string);
- brasero_disc_message_set_image (BRASERO_DISC_MESSAGE (message),
- GTK_STOCK_DIALOG_INFO);
-
- brasero_notify_button_add (BRASERO_NOTIFY (priv->message),
- BRASERO_DISC_MESSAGE (message),
- _("I_mport Session"),
- _("Click here to import its contents"),
- GTK_RESPONSE_OK);
+ gtk_info_bar_set_message_type (GTK_INFO_BAR (message), GTK_MESSAGE_INFO);
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("I_mport Session"),
+ GTK_RESPONSE_OK),
+ _("Click here to import its contents"));
/* no need to ref the medium since its removal would cause the
* hiding of the message it's associated with */
@@ -1476,15 +1473,15 @@ brasero_data_disc_set_track (BraseroDataDisc *disc,
-1,
BRASERO_NOTIFY_CONTEXT_LOADING);
- brasero_disc_message_set_image (BRASERO_DISC_MESSAGE (message),GTK_STOCK_DIALOG_INFO);
+ gtk_info_bar_set_message_type (GTK_INFO_BAR (message), GTK_MESSAGE_INFO);
brasero_disc_message_set_progress (BRASERO_DISC_MESSAGE (message),
brasero_status_get_progress (status));
- brasero_notify_button_add (BRASERO_NOTIFY (priv->message),
- BRASERO_DISC_MESSAGE (message),
- _("_Cancel Loading"),
- _("Cancel loading current project"),
- GTK_RESPONSE_CANCEL);
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("_Cancel Loading"),
+ GTK_RESPONSE_CANCEL),
+ _("Cancel loading current project"));
+
g_signal_connect (message,
"response",
G_CALLBACK (brasero_data_disc_message_response_cb),
diff --git a/src/brasero-project.c b/src/brasero-project.c
index c0e562a..a75976f 100644
--- a/src/brasero-project.c
+++ b/src/brasero-project.c
@@ -936,11 +936,10 @@ brasero_project_is_valid (BraseroSessionCfg *session,
_("The project is too large for the disc even with the overburn option."),
-1,
BRASERO_NOTIFY_CONTEXT_SIZE);
- brasero_notify_button_add (BRASERO_NOTIFY (project->priv->message),
- BRASERO_DISC_MESSAGE (message),
- _("_Burn Several Discs"),
- _("Burn the selection of files across several media"),
- GTK_RESPONSE_OK);
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("_Burn Several Discs"),
+ GTK_RESPONSE_OK),
+ _("Burn the selection of files across several media"));
g_signal_connect (message,
"response",
@@ -966,11 +965,10 @@ brasero_project_is_valid (BraseroSessionCfg *session,
"\nNote: This option might cause failure."),
-1,
BRASERO_NOTIFY_CONTEXT_SIZE);
- brasero_notify_button_add (BRASERO_NOTIFY (project->priv->message),
- BRASERO_DISC_MESSAGE (message),
- _("_Overburn"),
- _("Burn beyond the disc's reported capacity"),
- GTK_RESPONSE_OK);
+ gtk_widget_set_tooltip_text (gtk_info_bar_add_button (GTK_INFO_BAR (message),
+ _("_Overburn"),
+ GTK_RESPONSE_OK),
+ _("Burn beyond the disc's reported capacity"));
g_signal_connect (message,
"response",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]