[brasero] Make the selection combo lock automatically if MERGE/APPEND flags are set
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Subject: [brasero] Make the selection combo lock automatically if MERGE/APPEND flags are set
- Date: Sun, 21 Jun 2009 17:07:18 -0400 (EDT)
commit c8411ca883b937adfc5c6068fe7e7c6d128aea0e
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Fri Jun 5 08:57:49 2009 +0200
Make the selection combo lock automatically if MERGE/APPEND flags are set
libbrasero-burn/brasero-burn-options.c | 15 ---
libbrasero-burn/brasero-dest-selection.c | 48 ++++++++-
libbrasero-burn/brasero-dest-selection.h | 4 -
libbrasero-burn/brasero-session-cfg.c | 121 +++++++++++++++++++++--
libbrasero-burn/brasero-session.c | 156 ++++++++++++++++++++----------
libbrasero-burn/brasero-session.h | 10 ++-
src/brasero-data-disc.c | 21 ++--
src/brasero-project.c | 4 +-
src/brasero-video-project.c | 1 +
src/brasero-video-project.h | 1 +
10 files changed, 279 insertions(+), 102 deletions(-)
---
diff --git a/libbrasero-burn/brasero-burn-options.c b/libbrasero-burn/brasero-burn-options.c
index 9090f1c..2635f52 100644
--- a/libbrasero-burn/brasero-burn-options.c
+++ b/libbrasero-burn/brasero-burn-options.c
@@ -181,17 +181,6 @@ brasero_burn_options_add_burn_button (BraseroBurnOptions *self,
}
static void
-brasero_burn_options_lock_selection (BraseroBurnOptions *self)
-{
- BraseroBurnOptionsPrivate *priv;
-
- priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
- brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (priv->selection),
- brasero_drive_get_medium (brasero_burn_session_get_burner (BRASERO_BURN_SESSION (priv->session))));
- brasero_dest_selection_lock (BRASERO_DEST_SELECTION (priv->selection), TRUE);
-}
-
-static void
brasero_burn_options_set_type_shown (BraseroBurnOptions *self,
BraseroMediaType type)
{
@@ -935,10 +924,6 @@ brasero_burn_options_setup (BraseroBurnOptions *self)
brasero_burn_options_setup_audio (self);
}
brasero_track_type_free (type);
-
- /* see if we should lock the drive only with MERGE */
- if (brasero_burn_session_get_flags (BRASERO_BURN_SESSION (priv->session)) & BRASERO_BURN_FLAG_MERGE)
- brasero_burn_options_lock_selection (self);
}
static void
diff --git a/libbrasero-burn/brasero-dest-selection.c b/libbrasero-burn/brasero-dest-selection.c
index be3121a..8188eac 100644
--- a/libbrasero-burn/brasero-dest-selection.c
+++ b/libbrasero-burn/brasero-dest-selection.c
@@ -75,7 +75,7 @@ enum {
G_DEFINE_TYPE (BraseroDestSelection, brasero_dest_selection, BRASERO_TYPE_MEDIUM_SELECTION);
-void
+static void
brasero_dest_selection_lock (BraseroDestSelection *self,
gboolean locked)
{
@@ -83,12 +83,16 @@ brasero_dest_selection_lock (BraseroDestSelection *self,
priv = BRASERO_DEST_SELECTION_PRIVATE (self);
- gtk_widget_set_sensitive (GTK_WIDGET (self), (locked != TRUE));
+ if (locked == (priv->locked_drive != NULL))
+ return;
+ gtk_widget_set_sensitive (GTK_WIDGET (self), (locked != TRUE));
gtk_widget_queue_draw (GTK_WIDGET (self));
+
if (priv->locked_drive) {
brasero_drive_unlock (priv->locked_drive);
g_object_unref (priv->locked_drive);
+ priv->locked_drive = NULL;
}
if (locked) {
@@ -113,6 +117,14 @@ static void
brasero_dest_selection_valid_session (BraseroSessionCfg *session,
BraseroDestSelection *self)
{
+ brasero_medium_selection_update_media_string (BRASERO_MEDIUM_SELECTION (self));
+}
+
+static void
+brasero_dest_selection_output_changed (BraseroSessionCfg *session,
+ BraseroMedium *former,
+ BraseroDestSelection *self)
+{
BraseroDestSelectionPrivate *priv;
BraseroMedium *medium;
BraseroDrive *burner;
@@ -123,12 +135,22 @@ brasero_dest_selection_valid_session (BraseroSessionCfg *session,
burner = brasero_burn_session_get_burner (priv->session);
medium = brasero_medium_selection_get_active (BRASERO_MEDIUM_SELECTION (self));
if (burner != brasero_medium_get_drive (medium))
- brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (self), medium);
+ brasero_medium_selection_set_active (BRASERO_MEDIUM_SELECTION (self),
+ brasero_drive_get_medium (burner));
if (medium)
g_object_unref (medium);
+}
- brasero_medium_selection_update_media_string (BRASERO_MEDIUM_SELECTION (self));
+static void
+brasero_dest_selection_flags_changed (BraseroBurnSession *session,
+ BraseroDestSelection *self)
+{
+ BraseroDestSelectionPrivate *priv;
+
+ priv = BRASERO_DEST_SELECTION_PRIVATE (self);
+
+ brasero_dest_selection_lock (self, (brasero_burn_session_get_flags (BRASERO_BURN_SESSION (priv->session)) & BRASERO_BURN_FLAG_MERGE) != 0);
}
static void
@@ -191,6 +213,12 @@ brasero_dest_selection_finalize (GObject *object)
priv->valid_sig = 0;
}
+ g_signal_handlers_disconnect_by_func (priv->session,
+ brasero_dest_selection_output_changed,
+ object);
+ g_signal_handlers_disconnect_by_func (priv->session,
+ brasero_dest_selection_flags_changed,
+ object);
if (priv->session) {
g_object_unref (priv->session);
priv->session = NULL;
@@ -232,8 +260,8 @@ brasero_dest_selection_foreach_medium (BraseroMedium *medium,
gpointer callback_data)
{
BraseroBurnSession *session;
- goffset session_blocks;
- goffset burner_blocks;
+ goffset session_blocks = 0;
+ goffset burner_blocks = 0;
goffset medium_blocks;
BraseroDrive *burner;
@@ -362,6 +390,14 @@ brasero_dest_selection_set_property (GObject *object,
"is-valid",
G_CALLBACK (brasero_dest_selection_valid_session),
object);
+ g_signal_connect (session,
+ "output-changed",
+ G_CALLBACK (brasero_dest_selection_output_changed),
+ object);
+ g_signal_connect (session,
+ "flags-changed",
+ G_CALLBACK (brasero_dest_selection_flags_changed),
+ object);
brasero_medium_selection_update_media_string (BRASERO_MEDIUM_SELECTION (object));
break;
diff --git a/libbrasero-burn/brasero-dest-selection.h b/libbrasero-burn/brasero-dest-selection.h
index b952273..d649862 100644
--- a/libbrasero-burn/brasero-dest-selection.h
+++ b/libbrasero-burn/brasero-dest-selection.h
@@ -66,10 +66,6 @@ GtkWidget *
brasero_dest_selection_new (BraseroBurnSession *selection);
void
-brasero_dest_selection_lock (BraseroDestSelection *selection,
- gboolean locked);
-
-void
brasero_dest_selection_choose_best (BraseroDestSelection *selection);
G_END_DECLS
diff --git a/libbrasero-burn/brasero-session-cfg.c b/libbrasero-burn/brasero-session-cfg.c
index 5184b3e..14e7d53 100644
--- a/libbrasero-burn/brasero-session-cfg.c
+++ b/libbrasero-burn/brasero-session-cfg.c
@@ -49,6 +49,7 @@
#include "brasero-tags.h"
#include "brasero-track-image.h"
+#include "brasero-track-data-cfg.h"
#include "brasero-session-cfg.h"
#include "brasero-burn-lib.h"
#include "brasero-session-helper.h"
@@ -117,7 +118,7 @@ brasero_session_cfg_get_gconf_key (BraseroSessionCfg *self,
else
display_name = g_strdup ("File");
- display_name = display_name ? display_name : "";
+ display_name = display_name ? display_name : g_strdup ("");
disc_type = gconf_escape_key (brasero_medium_get_type_string (medium), -1);
if (!disc_type) {
@@ -248,7 +249,7 @@ brasero_session_cfg_save_drive_properties (BraseroSessionCfg *self,
}
static void
-brasero_session_cfg_add_drive_properties_flags (BraseroSessionCfg *self,
+brasero_session_cfg_set_drive_properties_flags (BraseroSessionCfg *self,
BraseroBurnFlag flags)
{
BraseroMedia media;
@@ -270,8 +271,6 @@ brasero_session_cfg_add_drive_properties_flags (BraseroSessionCfg *self,
media = brasero_medium_get_status (medium);
- /* add flags then wipe out flags from session to check them one by one */
- flags |= brasero_burn_session_get_flags (BRASERO_BURN_SESSION (self));
brasero_burn_session_remove_flag (BRASERO_BURN_SESSION (self), flags);
priv->supported = BRASERO_BURN_FLAG_NONE;
@@ -376,6 +375,24 @@ brasero_session_cfg_add_drive_properties_flags (BraseroSessionCfg *self,
}
static void
+brasero_session_cfg_add_drive_properties_flags (BraseroSessionCfg *self,
+ BraseroBurnFlag flags)
+{
+ /* add flags then wipe out flags from session to check them one by one */
+ flags |= brasero_burn_session_get_flags (BRASERO_BURN_SESSION (self));
+ brasero_session_cfg_set_drive_properties_flags (self, flags);
+}
+
+static void
+brasero_session_cfg_rm_drive_properties_flags (BraseroSessionCfg *self,
+ BraseroBurnFlag flags)
+{
+ /* add flags then wipe out flags from session to check them one by one */
+ flags = brasero_burn_session_get_flags (BRASERO_BURN_SESSION (self)) & (~flags);
+ brasero_session_cfg_set_drive_properties_flags (self, flags);
+}
+
+static void
brasero_session_cfg_set_drive_properties (BraseroSessionCfg *self)
{
BraseroSessionCfgPrivate *priv;
@@ -392,10 +409,7 @@ brasero_session_cfg_set_drive_properties (BraseroSessionCfg *self)
priv = BRASERO_SESSION_CFG_PRIVATE (self);
/* The next two must work as they were checked earlier */
- source = brasero_track_type_new ();
- brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (self), source);
drive = brasero_burn_session_get_burner (BRASERO_BURN_SESSION (self));
-
medium = brasero_drive_get_medium (drive);
if (!medium || brasero_medium_get_status (medium) == BRASERO_MEDIUM_NONE)
return;
@@ -438,6 +452,8 @@ brasero_session_cfg_set_drive_properties (BraseroSessionCfg *self)
g_object_unref (client);
+ source = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (self), source);
if (brasero_burn_session_same_src_dest_drive (BRASERO_BURN_SESSION (self))) {
/* Special case */
if (value) {
@@ -466,6 +482,7 @@ brasero_session_cfg_set_drive_properties (BraseroSessionCfg *self)
flags = gconf_value_get_int (value) & BRASERO_DEST_SAVED_FLAGS;
gconf_value_free (value);
}
+ brasero_track_type_free (source);
brasero_session_cfg_add_drive_properties_flags (self, flags);
}
@@ -847,7 +864,79 @@ brasero_session_cfg_update (BraseroSessionCfg *self,
}
static void
-brasero_session_cfg_input_changed (BraseroBurnSession *session)
+brasero_session_cfg_session_loaded (BraseroTrackDataCfg *track,
+ BraseroMedium *medium,
+ gboolean is_loaded,
+ BraseroSessionCfg *session)
+{
+ if (is_loaded) {
+ /* Set the correct medium and add the flag */
+ brasero_burn_session_set_burner (BRASERO_BURN_SESSION (session),
+ brasero_medium_get_drive (medium));
+
+ brasero_session_cfg_add_drive_properties_flags (session, BRASERO_BURN_FLAG_MERGE);
+ }
+ else
+ brasero_session_cfg_rm_drive_properties_flags (session, BRASERO_BURN_FLAG_MERGE);
+}
+
+static void
+brasero_session_cfg_track_added (BraseroBurnSession *session,
+ BraseroTrack *track)
+{
+ BraseroSessionCfgPrivate *priv;
+
+ priv = BRASERO_SESSION_CFG_PRIVATE (session);
+ if (priv->disabled)
+ return;
+
+ g_signal_connect (track,
+ "session-loaded",
+ G_CALLBACK (brasero_session_cfg_session_loaded),
+ session);
+
+ /* when that happens it's mostly because a medium source changed, or
+ * a new image was set.
+ * - reload saved flags
+ * - check if all flags are thereafter supported
+ * - check available formats for path
+ * - set one path
+ */
+ brasero_session_cfg_update (BRASERO_SESSION_CFG (session),
+ TRUE,
+ FALSE);
+}
+
+static void
+brasero_session_cfg_track_removed (BraseroBurnSession *session,
+ BraseroTrack *track)
+{
+ BraseroSessionCfgPrivate *priv;
+
+ priv = BRASERO_SESSION_CFG_PRIVATE (session);
+ if (priv->disabled)
+ return;
+
+ /* Just in case */
+ g_signal_handlers_disconnect_by_func (track,
+ brasero_session_cfg_session_loaded,
+ session);
+
+ /* when that happens it's mostly because a medium source changed, or
+ * a new image was set.
+ * - reload saved flags
+ * - check if all flags are thereafter supported
+ * - check available formats for path
+ * - set one path
+ */
+ brasero_session_cfg_update (BRASERO_SESSION_CFG (session),
+ TRUE,
+ FALSE);
+}
+
+static void
+brasero_session_cfg_track_changed (BraseroBurnSession *session,
+ BraseroTrack *track)
{
BraseroSessionCfgPrivate *priv;
@@ -917,7 +1006,6 @@ brasero_session_cfg_add_flags (BraseroSessionCfg *self,
BraseroDrive *drive;
priv = BRASERO_SESSION_CFG_PRIVATE (self);
-
if ((priv->supported & flags) != flags)
return;
@@ -1007,6 +1095,7 @@ brasero_session_cfg_finalize (GObject *object)
{
BraseroSessionCfgPrivate *priv;
BraseroDrive *drive;
+ GSList *tracks;
priv = BRASERO_SESSION_CFG_PRIVATE (object);
@@ -1015,6 +1104,16 @@ brasero_session_cfg_finalize (GObject *object)
brasero_session_cfg_save_drive_properties (BRASERO_SESSION_CFG (object),
brasero_drive_get_medium (drive));
+ tracks = brasero_burn_session_get_tracks (BRASERO_BURN_SESSION (object));
+ for (; tracks; tracks = tracks->next) {
+ BraseroTrack *track;
+
+ track = tracks->data;
+ g_signal_handlers_disconnect_by_func (track,
+ brasero_session_cfg_session_loaded,
+ object);
+ }
+
if (priv->caps_sig) {
BraseroPluginManager *manager;
@@ -1036,7 +1135,9 @@ brasero_session_cfg_class_init (BraseroSessionCfgClass *klass)
object_class->finalize = brasero_session_cfg_finalize;
- session_class->input_changed = brasero_session_cfg_input_changed;
+ session_class->track_added = brasero_session_cfg_track_added;
+ session_class->track_removed = brasero_session_cfg_track_removed;
+ session_class->track_changed = brasero_session_cfg_track_changed;
session_class->output_changed = brasero_session_cfg_output_changed;
session_cfg_signals[IS_VALID_SIGNAL] =
diff --git a/libbrasero-burn/brasero-session.c b/libbrasero-burn/brasero-session.c
index f5876e7..99576c4 100644
--- a/libbrasero-burn/brasero-session.c
+++ b/libbrasero-burn/brasero-session.c
@@ -107,7 +107,10 @@ typedef struct _BraseroBurnSessionPrivate BraseroBurnSessionPrivate;
#define BRASERO_STR_EQUAL(a, b) ((!(a) && !(b)) || ((a) && (b) && !strcmp ((a), (b))))
typedef enum {
- INPUT_CHANGED_SIGNAL,
+ FLAGS_CHANGED_SIGNAL,
+ TRACK_ADDED_SIGNAL,
+ TRACK_REMOVED_SIGNAL,
+ TRACK_CHANGED_SIGNAL,
OUTPUT_CHANGED_SIGNAL,
LAST_SIGNAL
} BraseroBurnSessionSignalType;
@@ -159,12 +162,13 @@ brasero_session_settings_free (BraseroSessionSetting *settings)
}
static void
-brasero_burn_session_track_changed (BraseroDrive *drive,
+brasero_burn_session_track_changed (BraseroTrack *track,
BraseroBurnSession *self)
{
g_signal_emit (self,
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
- 0);
+ brasero_burn_session_signals [TRACK_CHANGED_SIGNAL],
+ 0,
+ track);
}
static void
@@ -202,6 +206,8 @@ static void
brasero_burn_session_free_tracks (BraseroBurnSession *self)
{
BraseroBurnSessionPrivate *priv;
+ GSList *iter;
+ GSList *next;
g_return_if_fail (BRASERO_IS_BURN_SESSION (self));
@@ -209,13 +215,18 @@ brasero_burn_session_free_tracks (BraseroBurnSession *self)
brasero_burn_session_stop_tracks_monitoring (self);
- g_slist_foreach (priv->tracks, (GFunc) g_object_unref, NULL);
- g_slist_free (priv->tracks);
- priv->tracks = NULL;
+ for (iter = priv->tracks; iter; iter = next) {
+ BraseroTrack *track;
- g_signal_emit (self,
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
- 0);
+ track = iter->data;
+ next = iter->next;
+ priv->tracks = g_slist_remove (priv->tracks, track);
+ g_signal_emit (self,
+ brasero_burn_session_signals [TRACK_REMOVED_SIGNAL],
+ 0,
+ track);
+ g_object_unref (track);
+ }
}
BraseroBurnResult
@@ -239,39 +250,31 @@ brasero_burn_session_add_track (BraseroBurnSession *self,
g_object_ref (new_track);
if (!priv->tracks) {
/* we only need to emit the signal here since if there are
- * multiple tracks they must be exactly of the same time */
+ * multiple tracks they must be exactly of the same type */
priv->tracks = g_slist_prepend (NULL, new_track);
brasero_burn_session_start_track_monitoring (self, new_track);
/* if (!brasero_track_type_equal (priv->input, &new_type)) */
g_signal_emit (self,
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
- 0);
+ brasero_burn_session_signals [TRACK_ADDED_SIGNAL],
+ 0,
+ new_track);
return BRASERO_BURN_OK;
}
/* if there is already a track, then we replace it on condition that it
* has the same type and it's not AUDIO (only one allowed to have many) */
- if (!BRASERO_IS_TRACK_STREAM (new_track)) {
- brasero_burn_session_stop_tracks_monitoring (self);
-
- g_slist_foreach (priv->tracks, (GFunc) g_object_unref, NULL);
- g_slist_free (priv->tracks);
-
- priv->tracks = g_slist_prepend (NULL, new_track);
- brasero_burn_session_start_track_monitoring (self, new_track);
- }
- else {
- brasero_burn_session_start_track_monitoring (self, new_track);
- priv->tracks = g_slist_append (priv->tracks, new_track);
- }
+ if (!BRASERO_IS_TRACK_STREAM (new_track)
+ || !BRASERO_IS_TRACK_STREAM (priv->tracks->data))
+ brasero_burn_session_free_tracks (self);
- /* Always emit the signal even when adding another BraseroTrackStream
- * since the size has probably changed. */
+ brasero_burn_session_start_track_monitoring (self, new_track);
+ priv->tracks = g_slist_append (priv->tracks, new_track);
g_signal_emit (self,
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
- 0);
+ brasero_burn_session_signals [TRACK_ADDED_SIGNAL],
+ 0,
+ new_track);
return BRASERO_BURN_OK;
}
@@ -978,7 +981,13 @@ brasero_burn_session_set_flags (BraseroBurnSession *self,
g_return_if_fail (BRASERO_IS_BURN_SESSION (self));
priv = BRASERO_BURN_SESSION_PRIVATE (self);
+ if (priv->settings->flags == flags)
+ return;
+
priv->settings->flags = flags;
+ g_signal_emit (self,
+ brasero_burn_session_signals [FLAGS_CHANGED_SIGNAL],
+ 0);
}
void
@@ -990,7 +999,13 @@ brasero_burn_session_add_flag (BraseroBurnSession *self,
g_return_if_fail (BRASERO_IS_BURN_SESSION (self));
priv = BRASERO_BURN_SESSION_PRIVATE (self);
+ if ((priv->settings->flags & flag) == flag)
+ return;
+
priv->settings->flags |= flag;
+ g_signal_emit (self,
+ brasero_burn_session_signals [FLAGS_CHANGED_SIGNAL],
+ 0);
}
void
@@ -1002,7 +1017,13 @@ brasero_burn_session_remove_flag (BraseroBurnSession *self,
g_return_if_fail (BRASERO_IS_BURN_SESSION (self));
priv = BRASERO_BURN_SESSION_PRIVATE (self);
+ if ((priv->settings->flags & flag) == 0)
+ return;
+
priv->settings->flags &= ~flag;
+ g_signal_emit (self,
+ brasero_burn_session_signals [FLAGS_CHANGED_SIGNAL],
+ 0);
}
BraseroBurnFlag
@@ -1218,6 +1239,7 @@ void
brasero_burn_session_push_tracks (BraseroBurnSession *self)
{
BraseroBurnSessionPrivate *priv;
+ GSList *iter;
g_return_if_fail (BRASERO_IS_BURN_SESSION (self));
@@ -1226,11 +1248,18 @@ brasero_burn_session_push_tracks (BraseroBurnSession *self)
brasero_burn_session_stop_tracks_monitoring (self);
priv->pile_tracks = g_slist_prepend (priv->pile_tracks, priv->tracks);
+ iter = priv->tracks;
priv->tracks = NULL;
- g_signal_emit (self,
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
- 0);
+ for (; iter; iter = iter->next) {
+ BraseroTrack *track;
+
+ track = iter->data;
+ g_signal_emit (self,
+ brasero_burn_session_signals [TRACK_REMOVED_SIGNAL],
+ 0,
+ track);
+ }
}
void
@@ -1248,18 +1277,9 @@ brasero_burn_session_pop_tracks (BraseroBurnSession *self)
return;
if (priv->tracks) {
- brasero_burn_session_stop_tracks_monitoring (self);
-
- g_slist_foreach (priv->tracks, (GFunc) g_object_unref, NULL);
- g_slist_free (priv->tracks);
- priv->tracks = NULL;
-
- if (!priv->pile_tracks) {
- g_signal_emit (self,
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
- 0);
+ brasero_burn_session_free_tracks (self);
+ if (!priv->pile_tracks)
return;
- }
}
sources = priv->pile_tracks->data;
@@ -1271,11 +1291,11 @@ brasero_burn_session_pop_tracks (BraseroBurnSession *self)
track = sources->data;
brasero_burn_session_start_track_monitoring (self, track);
+ g_signal_emit (self,
+ brasero_burn_session_signals [TRACK_ADDED_SIGNAL],
+ 0,
+ track);
}
-
- g_signal_emit (self,
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL],
- 0);
}
/**
@@ -1737,12 +1757,44 @@ brasero_burn_session_class_init (BraseroBurnSessionClass *klass)
G_TYPE_NONE,
1,
BRASERO_TYPE_MEDIUM);
-
- brasero_burn_session_signals [INPUT_CHANGED_SIGNAL] =
- g_signal_new ("input_changed",
+ brasero_burn_session_signals [TRACK_ADDED_SIGNAL] =
+ g_signal_new ("track_added",
+ BRASERO_TYPE_BURN_SESSION,
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (BraseroBurnSessionClass, track_added),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE,
+ 1,
+ BRASERO_TYPE_TRACK);
+ brasero_burn_session_signals [TRACK_REMOVED_SIGNAL] =
+ g_signal_new ("track_removed",
+ BRASERO_TYPE_BURN_SESSION,
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (BraseroBurnSessionClass, track_removed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE,
+ 1,
+ BRASERO_TYPE_TRACK);
+ brasero_burn_session_signals [TRACK_CHANGED_SIGNAL] =
+ g_signal_new ("track_changed",
+ BRASERO_TYPE_BURN_SESSION,
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (BraseroBurnSessionClass, track_changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE,
+ 1,
+ BRASERO_TYPE_TRACK);
+ brasero_burn_session_signals [FLAGS_CHANGED_SIGNAL] =
+ g_signal_new ("flags_changed",
BRASERO_TYPE_BURN_SESSION,
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (BraseroBurnSessionClass, input_changed),
+ G_STRUCT_OFFSET (BraseroBurnSessionClass, flags_changed),
NULL,
NULL,
g_cclosure_marshal_VOID__VOID,
diff --git a/libbrasero-burn/brasero-session.h b/libbrasero-burn/brasero-session.h
index 05eef0d..d21c239 100644
--- a/libbrasero-burn/brasero-session.h
+++ b/libbrasero-burn/brasero-session.h
@@ -66,9 +66,15 @@ struct _BraseroBurnSessionClass {
* it's better to have one global signal and dialogs asking for
* the session properties they are interested in.
*/
- void (*input_changed) (BraseroBurnSession *session);
+ void (*flags_changed) (BraseroBurnSession *session);
+ void (*track_added) (BraseroBurnSession *session,
+ BraseroTrack *track);
+ void (*track_removed) (BraseroBurnSession *session,
+ BraseroTrack *track);
+ void (*track_changed) (BraseroBurnSession *session,
+ BraseroTrack *track);
void (*output_changed) (BraseroBurnSession *session,
- BraseroMedium *medium);
+ BraseroMedium *former_medium);
};
GType brasero_burn_session_get_type ();
diff --git a/src/brasero-data-disc.c b/src/brasero-data-disc.c
index 06b49c4..44a625d 100644
--- a/src/brasero-data-disc.c
+++ b/src/brasero-data-disc.c
@@ -52,6 +52,7 @@
#include "burn-basics.h"
+#include "brasero-session-cfg.h"
#include "brasero-tags.h"
#include "brasero-track.h"
#include "brasero-track-data.h"
@@ -2152,6 +2153,14 @@ brasero_data_disc_init (BraseroDataDisc *object)
"deep-directory",
G_CALLBACK (brasero_data_disc_deep_directory_cb),
object);
+ g_signal_connect (priv->project,
+ "name-collision",
+ G_CALLBACK (brasero_data_disc_name_collision_cb),
+ object);
+ g_signal_connect (priv->project,
+ "joliet-rename",
+ G_CALLBACK (brasero_data_disc_joliet_rename_cb),
+ object);
g_signal_connect (priv->project,
"source-loading",
@@ -2162,19 +2171,12 @@ brasero_data_disc_init (BraseroDataDisc *object)
G_CALLBACK (brasero_data_disc_project_loaded_cb),
object);
- /* Use the BraseroTrack "changed" signal */
+ /* Use the BraseroTrack "changed" signal for size changes */
g_signal_connect (priv->project,
"changed",
G_CALLBACK (brasero_data_disc_size_changed_cb),
object);
- g_signal_connect (priv->project,
- "name-collision",
- G_CALLBACK (brasero_data_disc_name_collision_cb),
- object);
- g_signal_connect (priv->project,
- "joliet-rename",
- G_CALLBACK (brasero_data_disc_joliet_rename_cb),
- object);
+
g_signal_connect (priv->project,
"row-inserted",
G_CALLBACK (brasero_data_disc_contents_added_cb),
@@ -2209,7 +2211,6 @@ brasero_data_disc_init (BraseroDataDisc *object)
"session-available",
G_CALLBACK (brasero_data_disc_session_available_cb),
object);
-
g_signal_connect (priv->project,
"session-loaded",
G_CALLBACK (brasero_data_disc_session_loaded_cb),
diff --git a/src/brasero-project.c b/src/brasero-project.c
index e37ab89..8c3875d 100644
--- a/src/brasero-project.c
+++ b/src/brasero-project.c
@@ -666,11 +666,9 @@ brasero_project_is_valid (BraseroSessionCfg *session,
brasero_notify_message_add (BRASERO_NOTIFY (project->priv->message),
_("Please insert a recordable CD or DVD if you don't want to write to an image file."),
NULL,
- -1,
+ 10000,
BRASERO_NOTIFY_CONTEXT_SIZE);
}
-
-
}
static void
diff --git a/src/brasero-video-project.c b/src/brasero-video-project.c
index 5bc09ee..c1cc8c9 100644
--- a/src/brasero-video-project.c
+++ b/src/brasero-video-project.c
@@ -30,6 +30,7 @@
#include "brasero-file-monitor.h"
#include "brasero-io.h"
#include "brasero-marshal.h"
+#include "brasero-session.h"
typedef struct _BraseroVideoProjectPrivate BraseroVideoProjectPrivate;
struct _BraseroVideoProjectPrivate
diff --git a/src/brasero-video-project.h b/src/brasero-video-project.h
index 7bdebee..c783eb2 100644
--- a/src/brasero-video-project.h
+++ b/src/brasero-video-project.h
@@ -128,6 +128,7 @@ GType brasero_video_project_get_type (void) G_GNUC_CONST;
void
brasero_video_file_free (BraseroVideoFile *file);
+/* This should go away as it is returned by BraseroBurnSession */
guint64
brasero_video_project_get_size (BraseroVideoProject *project);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]