[brasero: 4/6] Detect images added to the CD/DVD creator folder in Nautilus
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Subject: [brasero: 4/6] Detect images added to the CD/DVD creator folder in Nautilus
- Date: Mon, 11 May 2009 16:36:57 -0400 (EDT)
commit 459aac447bde5221de7e14be80ffd3c71b368fbe
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Mon May 11 22:27:40 2009 +0200
Detect images added to the CD/DVD creator folder in Nautilus
---
libbrasero-burn/Makefile.am | 13 +-
libbrasero-burn/brasero-burn-options-private.h | 53 --
libbrasero-burn/brasero-burn-options.c | 443 +++++++++--
libbrasero-burn/brasero-data-options.c | 337 ++++++++
...o-disc-copy-dialog.h => brasero-data-options.h} | 46 +-
libbrasero-burn/brasero-data-vfs.c | 80 +-
libbrasero-burn/brasero-disc-copy-dialog.c | 133 ---
libbrasero-burn/brasero-disc-option-dialog.c | 865 --------------------
libbrasero-burn/brasero-disc-option-dialog.h | 65 --
libbrasero-burn/brasero-enums.h | 2 -
libbrasero-burn/brasero-image-option-dialog.c | 118 ---
libbrasero-burn/brasero-image-option-dialog.h | 67 --
libbrasero-burn/brasero-status-dialog.c | 138 +++-
libbrasero-burn/brasero-status-dialog.h | 8 +-
libbrasero-burn/brasero-video-options.c | 566 +++++++++++++
libbrasero-burn/brasero-video-options.h | 58 ++
16 files changed, 1507 insertions(+), 1485 deletions(-)
diff --git a/libbrasero-burn/Makefile.am b/libbrasero-burn/Makefile.am
index ed05879..52a3099 100644
--- a/libbrasero-burn/Makefile.am
+++ b/libbrasero-burn/Makefile.am
@@ -119,14 +119,8 @@ libbrasero_burn_la_SOURCES = \
brasero-burn-options.h \
brasero-dest-selection.c \
brasero-dest-selection.h \
- brasero-disc-copy-dialog.c \
- brasero-disc-copy-dialog.h \
- brasero-disc-option-dialog.c \
- brasero-disc-option-dialog.h \
brasero-drive-properties.c \
brasero-drive-properties.h \
- brasero-image-option-dialog.c \
- brasero-image-option-dialog.h \
brasero-image-properties.c \
brasero-image-properties.h \
brasero-image-type-chooser.c \
@@ -159,7 +153,6 @@ libbrasero_burn_la_SOURCES = \
brasero-track-data.h \
brasero-track-image-cfg.c \
brasero-track-image-cfg.h \
- brasero-burn-options-private.h \
brasero-caps-plugin.c \
brasero-caps-burn.c \
brasero-caps-session.c \
@@ -191,7 +184,11 @@ libbrasero_burn_la_SOURCES = \
brasero-filtered-uri.h \
brasero-track-stream-cfg.c \
brasero-track-stream-cfg.h \
- brasero-tool-dialog-private.h
+ brasero-tool-dialog-private.h \
+ brasero-data-options.c \
+ brasero-data-options.h \
+ brasero-video-options.h \
+ brasero-video-options.c
if BUILD_INOTIFY
libbrasero_burn_la_SOURCES += brasero-file-monitor.c brasero-file-monitor.h
diff --git a/libbrasero-burn/brasero-burn-options-private.h b/libbrasero-burn/brasero-burn-options-private.h
deleted file mode 100644
index 0860f40..0000000
--- a/libbrasero-burn/brasero-burn-options-private.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Libbrasero-burn
- * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
- *
- * Libbrasero-burn is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
- * GStreamer plugins to be used and distributed together with GStreamer
- * and Libbrasero-burn. This permission is above and beyond the permissions granted
- * by the GPL license by which Libbrasero-burn is covered. If you modify this code
- * you may extend this exception to your version of the code, but you are not
- * obligated to do so. If you do not wish to do so, delete this exception
- * statement from your version.
- *
- * Libbrasero-burn is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to:
- * The Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef _BRASERO_BURN_OPTIONS_PRIVATE_H_
-#define _BRASERO_BURN_OPTIONS_PRIVATE_H_
-
-#include "brasero-burn-options.h"
-
-
-void
-brasero_burn_options_add_source (BraseroBurnOptions *self,
- const gchar *title,
- ...);
-
-GtkWidget *
-brasero_burn_options_add_burn_button (BraseroBurnOptions *self,
- const gchar *text,
- const gchar *icon);
-void
-brasero_burn_options_lock_selection (BraseroBurnOptions *self);
-
-void
-brasero_burn_options_set_type_shown (BraseroBurnOptions *self,
- BraseroMediaType type);
-
-#endif
diff --git a/libbrasero-burn/brasero-burn-options.c b/libbrasero-burn/brasero-burn-options.c
index a4bd216..4dc8456 100644
--- a/libbrasero-burn/brasero-burn-options.c
+++ b/libbrasero-burn/brasero-burn-options.c
@@ -46,14 +46,17 @@
#include "brasero-session.h"
#include "brasero-session-helper.h"
#include "brasero-burn-options.h"
-#include "brasero-disc-copy-dialog.h"
-#include "brasero-image-option-dialog.h"
-#include "brasero-disc-option-dialog.h"
+#include "brasero-data-options.h"
+#include "brasero-video-options.h"
+#include "brasero-src-image.h"
+#include "brasero-src-selection.h"
#include "brasero-session-cfg.h"
#include "brasero-dest-selection.h"
#include "brasero-medium-properties.h"
#include "brasero-status-dialog.h"
#include "brasero-track-stream.h"
+#include "brasero-track-data-cfg.h"
+#include "brasero-track-image-cfg.h"
#include "brasero-notify.h"
#include "brasero-misc.h"
@@ -64,21 +67,30 @@ struct _BraseroBurnOptionsPrivate
BraseroSessionCfg *session;
gulong valid_sig;
+ gulong input_sig;
GtkSizeGroup *size_group;
GtkWidget *source;
+ GtkWidget *source_placeholder;
GtkWidget *message_input;
GtkWidget *selection;
GtkWidget *properties;
GtkWidget *message_output;
GtkWidget *options;
+ GtkWidget *options_placeholder;
GtkWidget *button;
guint not_ready_id;
GtkWidget *status_dialog;
guint is_valid:1;
+
+ guint has_image:1;
+ guint has_audio:1;
+ guint has_video:1;
+ guint has_data:1;
+ guint has_disc:1;
};
#define BRASERO_BURN_OPTIONS_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_BURN_OPTIONS, BraseroBurnOptionsPrivate))
@@ -90,14 +102,13 @@ enum {
G_DEFINE_TYPE (BraseroBurnOptions, brasero_burn_options, GTK_TYPE_DIALOG);
-void
+static void
brasero_burn_options_add_source (BraseroBurnOptions *self,
const gchar *title,
...)
{
va_list vlist;
GtkWidget *child;
- GtkWidget *source;
GSList *list = NULL;
BraseroBurnOptionsPrivate *priv;
@@ -126,11 +137,11 @@ brasero_burn_options_add_source (BraseroBurnOptions *self,
}
va_end (vlist);
- source = brasero_utils_pack_properties_list (title, list);
+ priv->source = brasero_utils_pack_properties_list (title, list);
g_slist_free (list);
- gtk_container_add (GTK_CONTAINER (priv->source), source);
- gtk_widget_show (priv->source);
+ gtk_container_add (GTK_CONTAINER (priv->source_placeholder), priv->source);
+ gtk_widget_show (priv->source_placeholder);
brasero_dest_selection_choose_best (BRASERO_DEST_SELECTION (priv->selection));
}
@@ -142,12 +153,11 @@ brasero_burn_options_add_options (BraseroBurnOptions *self,
BraseroBurnOptionsPrivate *priv;
priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
-
gtk_box_pack_start (GTK_BOX (priv->options), options, FALSE, TRUE, 0);
gtk_widget_show (priv->options);
}
-GtkWidget *
+static GtkWidget *
brasero_burn_options_add_burn_button (BraseroBurnOptions *self,
const gchar *text,
const gchar *icon)
@@ -171,7 +181,7 @@ brasero_burn_options_add_burn_button (BraseroBurnOptions *self,
return priv->button;
}
-void
+static void
brasero_burn_options_lock_selection (BraseroBurnOptions *self)
{
BraseroBurnOptionsPrivate *priv;
@@ -182,7 +192,7 @@ brasero_burn_options_lock_selection (BraseroBurnOptions *self)
brasero_dest_selection_lock (BRASERO_DEST_SELECTION (priv->selection), TRUE);
}
-void
+static void
brasero_burn_options_set_type_shown (BraseroBurnOptions *self,
BraseroMediaType type)
{
@@ -192,17 +202,6 @@ brasero_burn_options_set_type_shown (BraseroBurnOptions *self,
brasero_medium_selection_show_media_type (BRASERO_MEDIUM_SELECTION (priv->selection), type);
}
-BraseroBurnSession *
-brasero_burn_options_get_session (BraseroBurnOptions *self)
-{
- BraseroBurnOptionsPrivate *priv;
-
- priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
- g_object_ref (priv->session);
-
- return BRASERO_BURN_SESSION (priv->session);
-}
-
static void
brasero_burn_options_message_response_cb (BraseroDiscMessage *message,
GtkResponseType response,
@@ -252,27 +251,22 @@ brasero_burn_options_update_no_medium_warning (BraseroBurnOptions *self)
BRASERO_BURN_OPTIONS_NO_MEDIUM_WARNING);
}
+static void
+brasero_burn_options_not_ready_dialog_cancel_cb (GtkDialog *dialog,
+ guint response,
+ gpointer data)
+{
+ gtk_dialog_response (GTK_DIALOG (data), GTK_RESPONSE_CANCEL);
+}
+
static gboolean
-brasero_burn_options_not_ready_dialog_cb (gpointer data)
+brasero_burn_options_not_ready_dialog_show_cb (gpointer data)
{
BraseroBurnOptionsPrivate *priv;
- GtkWidget *status_dialog;
- BraseroBurnResult result;
priv = BRASERO_BURN_OPTIONS_PRIVATE (data);
priv->not_ready_id = 0;
-
- status_dialog = brasero_status_dialog_new ();
- result = brasero_status_dialog_wait_for_session (BRASERO_STATUS_DIALOG (status_dialog),
- GTK_WIDGET (data),
- BRASERO_BURN_SESSION (priv->session));
- gtk_widget_destroy (status_dialog);
-
- if (result != BRASERO_BURN_OK)
- gtk_dialog_response (GTK_DIALOG (data), GTK_RESPONSE_CANCEL);
-
- gtk_widget_set_sensitive (GTK_WIDGET (data), TRUE);
-
+ gtk_widget_show (priv->status_dialog);
return FALSE;
}
@@ -303,16 +297,22 @@ brasero_burn_options_update_valid (BraseroBurnOptions *self)
if (valid == BRASERO_SESSION_NOT_READY) {
if (!priv->not_ready_id && !priv->status_dialog) {
gtk_widget_set_sensitive (GTK_WIDGET (self), FALSE);
+ priv->status_dialog = brasero_status_dialog_new (BRASERO_BURN_SESSION (priv->session), GTK_WIDGET (self));
+ g_signal_connect (priv->status_dialog,
+ "response",
+ G_CALLBACK (brasero_burn_options_not_ready_dialog_cancel_cb),
+ self);
priv->not_ready_id = g_timeout_add_seconds (1,
- brasero_burn_options_not_ready_dialog_cb,
+ brasero_burn_options_not_ready_dialog_show_cb,
self);
}
}
else {
gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE);
- if (priv->status_dialog)
- gtk_dialog_response (GTK_DIALOG (priv->status_dialog),
- GTK_RESPONSE_CANCEL);
+ if (priv->status_dialog) {
+ gtk_widget_destroy (priv->status_dialog);
+ priv->status_dialog = NULL;
+ }
if (priv->not_ready_id) {
g_source_remove (priv->not_ready_id);
@@ -505,9 +505,9 @@ brasero_burn_options_build_contents (BraseroBurnOptions *object)
GTK_ICON_SIZE_BUTTON));
/* Create an upper box for sources */
- priv->source = gtk_alignment_new (0.0, 0.5, 1.0, 1.0);
+ priv->source_placeholder = gtk_alignment_new (0.0, 0.5, 1.0, 1.0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox),
- priv->source,
+ priv->source_placeholder,
FALSE,
TRUE,
0);
@@ -563,6 +563,7 @@ brasero_burn_options_build_contents (BraseroBurnOptions *object)
FALSE,
TRUE,
0);
+ priv->options_placeholder = alignment;
priv->options = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (alignment), priv->options);
@@ -587,6 +588,17 @@ brasero_burn_options_finalize (GObject *object)
priv->not_ready_id = 0;
}
+ if (priv->status_dialog) {
+ gtk_widget_destroy (priv->status_dialog);
+ priv->status_dialog = NULL;
+ }
+
+ if (priv->input_sig) {
+ g_signal_handler_disconnect (priv->session,
+ priv->input_sig);
+ priv->input_sig = 0;
+ }
+
if (priv->valid_sig) {
g_signal_handler_disconnect (priv->session,
priv->valid_sig);
@@ -607,6 +619,314 @@ brasero_burn_options_finalize (GObject *object)
}
static void
+brasero_burn_options_reset (BraseroBurnOptions *self)
+{
+ BraseroBurnOptionsPrivate *priv;
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
+
+ priv->has_image = FALSE;
+ priv->has_audio = FALSE;
+ priv->has_video = FALSE;
+ priv->has_data = FALSE;
+ priv->has_disc = FALSE;
+
+ /* reset all the dialog */
+ if (priv->message_input) {
+ gtk_widget_destroy (priv->message_input);
+ priv->message_input = NULL;
+ }
+
+ if (priv->options) {
+ gtk_widget_destroy (priv->options);
+ priv->options = NULL;
+ }
+
+ priv->options = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (priv->options_placeholder), priv->options);
+
+ if (priv->source) {
+ gtk_widget_destroy (priv->source);
+ priv->source = NULL;
+ }
+
+ gtk_widget_hide (priv->source_placeholder);
+}
+
+static void
+brasero_burn_options_setup_audio (BraseroBurnOptions *self)
+{
+ BraseroBurnOptionsPrivate *priv;
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
+
+ brasero_burn_options_reset (self);
+
+ priv->has_audio = TRUE;
+ gtk_window_set_title (GTK_WINDOW (self), _("Disc Burning Setup"));
+ brasero_burn_options_add_burn_button (self,
+ _("_Burn"),
+ "media-optical-burn");
+ brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (self),
+ BRASERO_MEDIA_TYPE_WRITABLE);
+}
+
+static void
+brasero_burn_options_setup_video (BraseroBurnOptions *self)
+{
+ GtkWidget *options;
+ BraseroBurnOptionsPrivate *priv;
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
+
+ brasero_burn_options_reset (self);
+
+ priv->has_video = TRUE;
+ gtk_window_set_title (GTK_WINDOW (self), _("Disc Burning Setup"));
+ brasero_burn_options_add_burn_button (self,
+ _("_Burn"),
+ "media-optical-burn");
+ brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (self),
+ BRASERO_MEDIA_TYPE_WRITABLE|
+ BRASERO_MEDIA_TYPE_FILE);
+
+ /* create the options box */
+ options = brasero_video_options_new (BRASERO_BURN_SESSION (priv->session));
+ gtk_widget_show (options);
+ brasero_burn_options_add_options (self, options);
+}
+
+static BraseroBurnResult
+brasero_status_dialog_uri_has_image (BraseroTrackDataCfg *track,
+ const gchar *uri,
+ BraseroBurnOptions *self)
+{
+ gint answer;
+ gchar *name;
+ gchar *string;
+ GtkWidget *button;
+ GtkWidget *dialog;
+ gboolean was_visible = FALSE;
+ gboolean was_not_ready = FALSE;
+ BraseroTrackImageCfg *track_img;
+ BraseroBurnOptionsPrivate *priv;
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
+
+ name = brasero_utils_get_uri_name (uri);
+ string = g_strdup_printf (_("Do you want to burn \"%s\" to a disc or add it in to the data project?"), name);
+ dialog = gtk_message_dialog_new (GTK_WINDOW (self),
+ GTK_DIALOG_MODAL |
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_NONE,
+ "%s",
+ string);
+ g_free (string);
+ g_free (name);
+
+ gtk_window_set_title (GTK_WINDOW (dialog), "");
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ _("This file is the image of a disc and can therefore be burnt to disc without having to add it to a data project first."));
+
+ gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Add to Project"), GTK_RESPONSE_NO);
+
+ button = brasero_utils_make_button (_("_Burn..."),
+ NULL,
+ "media-optical-burn",
+ GTK_ICON_SIZE_BUTTON);
+ gtk_widget_show (button);
+ gtk_dialog_add_action_widget (GTK_DIALOG (dialog),
+ button,
+ GTK_RESPONSE_YES);
+
+ if (!priv->not_ready_id && priv->status_dialog) {
+ was_visible = TRUE;
+ gtk_widget_hide (GTK_WIDGET (priv->status_dialog));
+ }
+ else if (priv->not_ready_id) {
+ g_source_remove (priv->not_ready_id);
+ priv->not_ready_id = 0;
+ was_not_ready = TRUE;
+ }
+
+ gtk_widget_show_all (dialog);
+ answer = gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+
+ if (answer != GTK_RESPONSE_YES) {
+ if (was_not_ready)
+ priv->not_ready_id = g_timeout_add_seconds (1,
+ brasero_burn_options_not_ready_dialog_show_cb,
+ self);
+ if (was_visible)
+ gtk_widget_show (GTK_WIDGET (priv->status_dialog));
+
+ return BRASERO_BURN_OK;
+ }
+
+ /* Setup a new track and add it to session */
+ track_img = brasero_track_image_cfg_new ();
+ brasero_track_image_cfg_set_source (track_img, uri);
+ brasero_burn_session_add_track (BRASERO_BURN_SESSION (priv->session),
+ BRASERO_TRACK (track_img));
+
+ return BRASERO_BURN_CANCEL;
+}
+
+static void
+brasero_burn_options_setup_data (BraseroBurnOptions *self)
+{
+ GSList *tracks;
+ GtkWidget *options;
+ BraseroBurnOptionsPrivate *priv;
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
+
+ brasero_burn_options_reset (self);
+
+ /* NOTE: we don't need to keep a record of the signal as the track will
+ * be destroyed if the user agrees to burn the image directly */
+ tracks = brasero_burn_session_get_tracks (BRASERO_BURN_SESSION (priv->session));
+ if (BRASERO_IS_TRACK_DATA_CFG (tracks->data))
+ g_signal_connect (tracks->data,
+ "image-uri",
+ G_CALLBACK (brasero_status_dialog_uri_has_image),
+ self);
+
+ priv->has_data = TRUE;
+ gtk_window_set_title (GTK_WINDOW (self), _("Disc Burning Setup"));
+ brasero_burn_options_add_burn_button (self,
+ _("_Burn"),
+ "media-optical-burn");
+ brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (self),
+ BRASERO_MEDIA_TYPE_WRITABLE|
+ BRASERO_MEDIA_TYPE_FILE);
+
+ /* create the options box */
+ options = brasero_data_options_new (BRASERO_BURN_SESSION (priv->session));
+ gtk_widget_show (options);
+ brasero_burn_options_add_options (self, options);
+}
+
+static void
+brasero_burn_options_setup_image (BraseroBurnOptions *self)
+{
+ gchar *string;
+ GtkWidget *file;
+ BraseroBurnOptionsPrivate *priv;
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
+
+ brasero_burn_options_reset (self);
+
+ priv->has_image = TRUE;
+ gtk_window_set_title (GTK_WINDOW (self), _("Image Burning Setup"));
+ brasero_burn_options_add_burn_button (self,
+ _("_Burn"),
+ "media-optical-burn");
+ brasero_burn_options_set_type_shown (self, BRASERO_MEDIA_TYPE_WRITABLE);
+
+ /* Image properties */
+ file = brasero_src_image_new (BRASERO_BURN_SESSION (priv->session));
+ gtk_widget_show (file);
+
+ /* pack everything */
+ string = g_strdup_printf ("<b>%s</b>", _("Select an image to write"));
+ brasero_burn_options_add_source (self,
+ string,
+ file,
+ NULL);
+ g_free (string);
+}
+
+static void
+brasero_burn_options_setup_disc (BraseroBurnOptions *self)
+{
+ gchar *title_str;
+ GtkWidget *source;
+ BraseroBurnOptionsPrivate *priv;
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
+
+ brasero_burn_options_reset (self);
+
+ priv->has_disc = TRUE;
+ gtk_window_set_title (GTK_WINDOW (self), _("CD/DVD Copy Options"));
+ brasero_burn_options_add_burn_button (self,
+ _("_Copy"),
+ "media-optical-copy");
+
+ /* take care of source media */
+ source = brasero_src_selection_new (BRASERO_BURN_SESSION (priv->session));
+ gtk_widget_show (source);
+
+ title_str = g_strdup_printf ("<b>%s</b>", _("Select disc to copy"));
+ brasero_burn_options_add_source (self,
+ title_str,
+ source,
+ NULL);
+ g_free (title_str);
+
+ /* only show media with something to be read on them */
+ brasero_medium_selection_show_media_type (BRASERO_MEDIUM_SELECTION (source),
+ BRASERO_MEDIA_TYPE_AUDIO|
+ BRASERO_MEDIA_TYPE_DATA);
+
+ /* This is a special case. When we're copying, someone may want to read
+ * and burn to the same drive so provided that the drive is a burner
+ * then show its contents. */
+ brasero_burn_options_set_type_shown (self,
+ BRASERO_MEDIA_TYPE_ANY_IN_BURNER|
+ BRASERO_MEDIA_TYPE_FILE);
+}
+
+static void
+brasero_burn_options_setup (BraseroBurnOptions *self)
+{
+ BraseroBurnOptionsPrivate *priv;
+ BraseroTrackType *type;
+
+ priv = BRASERO_BURN_OPTIONS_PRIVATE (self);
+
+ /* add the new widgets */
+ type = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (priv->session), type);
+ if (brasero_track_type_get_has_medium (type)) {
+ if (!priv->has_disc)
+ brasero_burn_options_setup_disc (self);
+ }
+ else if (brasero_track_type_get_has_image (type)) {
+ if (!priv->has_image)
+ brasero_burn_options_setup_image (self);
+ }
+ else if (brasero_track_type_get_has_data (type)) {
+ if (!priv->has_data)
+ brasero_burn_options_setup_data (self);
+ }
+ else if (brasero_track_type_get_has_stream (type)) {
+ if (brasero_track_type_get_stream_format (type) & (BRASERO_VIDEO_FORMAT_UNDEFINED|BRASERO_VIDEO_FORMAT_VCD|BRASERO_VIDEO_FORMAT_VIDEO_DVD)) {
+ if (!priv->has_video)
+ brasero_burn_options_setup_video (self);
+ }
+ else if (!priv->has_audio)
+ 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
+brasero_burn_options_input_changed (BraseroBurnSession *session,
+ BraseroBurnOptions *dialog)
+{
+ brasero_burn_options_setup (dialog);
+}
+
+static void
brasero_burn_options_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -625,7 +945,13 @@ brasero_burn_options_set_property (GObject *object,
g_object_ref (priv->session);
g_object_notify (object, "session");
+ priv->input_sig = g_signal_connect (priv->session,
+ "input-changed",
+ G_CALLBACK (brasero_burn_options_input_changed),
+ object);
+
brasero_burn_options_build_contents (BRASERO_BURN_OPTIONS (object));
+ brasero_burn_options_setup (BRASERO_BURN_OPTIONS (object));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -680,32 +1006,5 @@ brasero_burn_options_class_init (BraseroBurnOptionsClass *klass)
GtkWidget *
brasero_burn_options_new (BraseroSessionCfg *session)
{
- BraseroTrackType *type;
- GtkWidget *options;
-
- type = brasero_track_type_new ();
- brasero_burn_session_get_input_type (BRASERO_BURN_SESSION (session), type);
-
- if (brasero_track_type_get_has_data (type)
- || brasero_track_type_get_has_stream (type)) {
- options = g_object_new (BRASERO_TYPE_DISC_OPTION_DIALOG,
- "session", session,
- NULL);
- }
- else if (brasero_track_type_get_has_medium (type)) {
- options = g_object_new (BRASERO_TYPE_DISC_COPY_DIALOG,
- "session", session,
- NULL);
- }
- else if (brasero_track_type_get_has_image (type)) {
- options = g_object_new (BRASERO_TYPE_IMAGE_OPTION_DIALOG,
- "session", session,
- NULL);
- }
- else
- options = NULL;
-
- brasero_track_type_free (type);
-
- return options;
+ return g_object_new (BRASERO_TYPE_BURN_OPTIONS, "session", session, NULL);
}
diff --git a/libbrasero-burn/brasero-data-options.c b/libbrasero-burn/brasero-data-options.c
new file mode 100644
index 0000000..79988c1
--- /dev/null
+++ b/libbrasero-burn/brasero-data-options.c
@@ -0,0 +1,337 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * Libbrasero-burn
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
+ *
+ * Libbrasero-burn is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-burn. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
+ *
+ * Libbrasero-burn is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+#include <glib-object.h>
+
+#include <gtk/gtk.h>
+
+#include "brasero-misc.h"
+#include "brasero-track-data.h"
+#include "brasero-session.h"
+#include "brasero-data-options.h"
+
+typedef struct _BraseroDataOptionsPrivate BraseroDataOptionsPrivate;
+struct _BraseroDataOptionsPrivate
+{
+ BraseroBurnSession *session;
+
+ GtkWidget *joliet_toggle;
+
+ guint joliet_warning:1;
+ guint joliet_saved:1;
+};
+
+#define BRASERO_DATA_OPTIONS_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_DATA_OPTIONS, BraseroDataOptionsPrivate))
+
+enum {
+ PROP_0,
+ PROP_SESSION
+};
+
+G_DEFINE_TYPE (BraseroDataOptions, brasero_data_options, GTK_TYPE_ALIGNMENT);
+
+static void
+brasero_data_options_set_tracks_image_fs (BraseroBurnSession *session,
+ BraseroImageFS fs_type)
+{
+ GSList *tracks;
+ GSList *iter;
+
+ tracks = brasero_burn_session_get_tracks (session);
+ for (iter = tracks; iter; iter = iter->next) {
+ BraseroTrack *track;
+
+ track = iter->data;
+ if (!BRASERO_IS_TRACK_DATA (track))
+ continue;
+
+ brasero_track_data_add_fs (BRASERO_TRACK_DATA (track), fs_type);
+ }
+}
+
+static gboolean
+brasero_data_options_update_joliet (BraseroDataOptions *dialog)
+{
+ BraseroImageFS fs_type;
+ BraseroBurnResult result;
+ BraseroTrackType *source = NULL;
+ BraseroDataOptionsPrivate *priv;
+
+ priv = BRASERO_DATA_OPTIONS_PRIVATE (dialog);
+ if (!priv->joliet_toggle)
+ return FALSE;
+
+ /* what we want to check Joliet support */
+ source = brasero_track_type_new ();
+ brasero_burn_session_get_input_type (priv->session, source);
+ fs_type = brasero_track_type_get_data_fs (source);
+
+ brasero_track_type_set_data_fs (source,
+ fs_type|
+ BRASERO_IMAGE_FS_JOLIET);
+
+ result = brasero_burn_session_input_supported (priv->session,
+ source,
+ FALSE);
+ brasero_track_type_free (source);
+
+ if (result == BRASERO_BURN_OK) {
+ if (GTK_WIDGET_IS_SENSITIVE (priv->joliet_toggle))
+ return FALSE;
+
+ gtk_widget_set_sensitive (priv->joliet_toggle, TRUE);
+
+ if (!priv->joliet_saved)
+ return FALSE;
+
+ brasero_data_options_set_tracks_image_fs (priv->session, fs_type);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), priv->joliet_saved);
+ return TRUE;
+ }
+
+ if (!GTK_WIDGET_IS_SENSITIVE (priv->joliet_toggle))
+ return FALSE;
+
+ priv->joliet_saved = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle));
+ if (priv->joliet_saved) {
+ fs_type &= (~BRASERO_IMAGE_FS_JOLIET);
+ brasero_data_options_set_tracks_image_fs (priv->session, fs_type);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), FALSE);
+ }
+
+ gtk_widget_set_sensitive (priv->joliet_toggle, FALSE);
+
+ return TRUE;
+}
+
+static void
+brasero_data_options_set_joliet (BraseroDataOptions *dialog)
+{
+ BraseroDataOptionsPrivate *priv;
+ BraseroTrackType *source = NULL;
+ BraseroImageFS fs_type;
+
+ priv = BRASERO_DATA_OPTIONS_PRIVATE (dialog);
+
+ if (!priv->joliet_toggle)
+ return;
+
+ /* NOTE: we don't check for the sensitive property since when
+ * something is compulsory the button is active but insensitive */
+ source = brasero_track_type_new ();
+ if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle)))
+ fs_type = (~BRASERO_IMAGE_FS_JOLIET) & brasero_track_type_get_data_fs (source);
+ else
+ fs_type = BRASERO_IMAGE_FS_JOLIET|brasero_track_type_get_data_fs (source);
+ brasero_track_type_free (source);
+
+ brasero_data_options_set_tracks_image_fs (priv->session, fs_type);
+}
+
+static void
+brasero_data_options_joliet_toggled_cb (GtkToggleButton *toggle,
+ BraseroDataOptions *dialog)
+{
+ BraseroDataOptionsPrivate *priv;
+ GtkResponseType answer;
+ GtkWidget *message;
+ gchar *secondary;
+ gboolean hide;
+
+ priv = BRASERO_DATA_OPTIONS_PRIVATE (dialog);
+
+ if (!GTK_WIDGET_VISIBLE (dialog)) {
+ gtk_widget_show (GTK_WIDGET (dialog));
+ hide = TRUE;
+ }
+
+ if (priv->joliet_warning) {
+ brasero_data_options_set_joliet (dialog);
+ return;
+ }
+
+ priv->joliet_warning = TRUE;
+
+ message = gtk_message_dialog_new (GTK_WINDOW (dialog),
+ GTK_DIALOG_DESTROY_WITH_PARENT|
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_NONE,
+ _("Should files be renamed to be fully Windows-compatible?"));
+
+ secondary = g_strdup_printf ("%s\n%s",
+ _("Some files don't have a suitable name for a fully Windows-compatible CD."),
+ _("Those names should be changed and truncated to 64 characters."));
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message), "%s", secondary);
+ g_free (secondary);
+
+ gtk_dialog_add_button (GTK_DIALOG (message),
+ _("_Disable Full Windows Compatibility"),
+ GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button (GTK_DIALOG (message),
+ _("_Rename for Full Windows Compatibility"),
+ GTK_RESPONSE_YES);
+
+ answer = gtk_dialog_run (GTK_DIALOG (message));
+ gtk_widget_destroy (message);
+
+ if (answer != GTK_RESPONSE_YES)
+ gtk_toggle_button_set_active (toggle, FALSE);
+ else
+ brasero_data_options_set_joliet (dialog);
+
+ priv->joliet_warning = FALSE;
+}
+
+static void
+brasero_data_options_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroDataOptionsPrivate *priv;
+
+ g_return_if_fail (BRASERO_IS_DATA_OPTIONS (object));
+
+ priv = BRASERO_DATA_OPTIONS_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_SESSION: /* Readable and only writable at creation time */
+ priv->session = BRASERO_BURN_SESSION (g_value_get_object (value));
+ g_object_ref (priv->session);
+ brasero_data_options_update_joliet (BRASERO_DATA_OPTIONS(object));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+brasero_data_options_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroDataOptionsPrivate *priv;
+
+ g_return_if_fail (BRASERO_IS_DATA_OPTIONS (object));
+
+ priv = BRASERO_DATA_OPTIONS_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_SESSION:
+ g_value_set_object (value, priv->session);
+ g_object_ref (priv->session);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+brasero_data_options_init (BraseroDataOptions *object)
+{
+ BraseroDataOptionsPrivate *priv;
+ GtkWidget *options;
+ gchar *string;
+
+ priv = BRASERO_DATA_OPTIONS_PRIVATE (object);
+
+ /* general options */
+ priv->joliet_toggle = gtk_check_button_new_with_mnemonic (_("Increase compatibility with _Windows systems"));
+ gtk_widget_set_tooltip_text (priv->joliet_toggle,
+ _("Improve compatibility with Windows systems by allowing to display long filenames (maximum 64 characters)"));
+
+ g_signal_connect (priv->joliet_toggle,
+ "toggled",
+ G_CALLBACK (brasero_data_options_joliet_toggled_cb),
+ object);
+
+ string = g_strdup_printf ("<b>%s</b>", _("Disc options"));
+ options = brasero_utils_pack_properties (string,
+ priv->joliet_toggle,
+ NULL);
+ g_free (string);
+
+ gtk_widget_show_all (options);
+ gtk_container_add (GTK_CONTAINER (object), options);
+}
+
+static void
+brasero_data_options_finalize (GObject *object)
+{
+ BraseroDataOptionsPrivate *priv;
+
+ priv = BRASERO_DATA_OPTIONS_PRIVATE (object);
+ if (priv->session) {
+ g_object_unref (priv->session);
+ priv->session = NULL;
+ }
+
+ G_OBJECT_CLASS (brasero_data_options_parent_class)->finalize (object);
+}
+
+static void
+brasero_data_options_class_init (BraseroDataOptionsClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (BraseroDataOptionsPrivate));
+
+ object_class->finalize = brasero_data_options_finalize;
+ object_class->set_property = brasero_data_options_set_property;
+ object_class->get_property = brasero_data_options_get_property;
+
+ g_object_class_install_property (object_class,
+ PROP_SESSION,
+ g_param_spec_object ("session",
+ "The session",
+ "The session to work with",
+ BRASERO_TYPE_BURN_SESSION,
+ G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
+}
+
+GtkWidget *
+brasero_data_options_new (BraseroBurnSession *session)
+{
+ return g_object_new (BRASERO_TYPE_DATA_OPTIONS, "session", session, NULL);
+}
+
diff --git a/libbrasero-burn/brasero-disc-copy-dialog.h b/libbrasero-burn/brasero-data-options.h
similarity index 55%
rename from libbrasero-burn/brasero-disc-copy-dialog.h
rename to libbrasero-burn/brasero-data-options.h
index 6cbe32a..27c6810 100644
--- a/libbrasero-burn/brasero-disc-copy-dialog.h
+++ b/libbrasero-burn/brasero-data-options.h
@@ -28,40 +28,42 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef DISC_COPY_DIALOG_H
-#define DISC_COPY_DIALOG_H
+#ifndef _BRASERO_DATA_OPTIONS_H_
+#define _BRASERO_DATA_OPTIONS_H_
-#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
-#include "brasero-burn-options.h"
-#include "brasero-drive.h"
+#include "brasero-session.h"
G_BEGIN_DECLS
-#define BRASERO_TYPE_DISC_COPY_DIALOG (brasero_disc_copy_dialog_get_type ())
-#define BRASERO_DISC_COPY_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), BRASERO_TYPE_DISC_COPY_DIALOG, BraseroDiscCopyDialog))
-#define BRASERO_DISC_COPY_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), BRASERO_TYPE_DISC_COPY_DIALOG, BraseroDiscCopyDialogClass))
-#define BRASERO_IS_DISC_COPY_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), BRASERO_TYPE_DISC_COPY_DIALOG))
-#define BRASERO_IS_DISC_COPY_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), BRASERO_TYPE_DISC_COPY_DIALOG))
-#define BRASERO_DISC_COPY_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), BRASERO_TYPE_DISC_COPY_DIALOG, BraseroDiscCopyDialogClass))
+#define BRASERO_TYPE_DATA_OPTIONS (brasero_data_options_get_type ())
+#define BRASERO_DATA_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_DATA_OPTIONS, BraseroDataOptions))
+#define BRASERO_DATA_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_DATA_OPTIONS, BraseroDataOptionsClass))
+#define BRASERO_IS_DATA_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BRASERO_TYPE_DATA_OPTIONS))
+#define BRASERO_IS_DATA_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BRASERO_TYPE_DATA_OPTIONS))
+#define BRASERO_DATA_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BRASERO_TYPE_DATA_OPTIONS, BraseroDataOptionsClass))
-typedef struct {
- BraseroBurnOptions parent;
-} BraseroDiscCopyDialog;
+typedef struct _BraseroDataOptionsClass BraseroDataOptionsClass;
+typedef struct _BraseroDataOptions BraseroDataOptions;
-typedef struct {
- BraseroBurnOptionsClass parent_class;
-} BraseroDiscCopyDialogClass;
+struct _BraseroDataOptionsClass
+{
+ GtkAlignmentClass parent_class;
+};
-GType brasero_disc_copy_dialog_get_type ();
+struct _BraseroDataOptions
+{
+ GtkAlignment parent_instance;
+};
-gboolean
-brasero_disc_copy_dialog_set_drive (BraseroDiscCopyDialog *self,
- BraseroDrive *drive);
+GType brasero_data_options_get_type (void) G_GNUC_CONST;
+
+GtkWidget *
+brasero_data_options_new (BraseroBurnSession *session);
G_END_DECLS
-#endif /* DISC_COPY_DIALOG_H */
+#endif /* _BRASERO_DATA_OPTIONS_H_ */
diff --git a/libbrasero-burn/brasero-data-vfs.c b/libbrasero-burn/brasero-data-vfs.c
index 29306d9..72c69aa 100644
--- a/libbrasero-burn/brasero-data-vfs.c
+++ b/libbrasero-burn/brasero-data-vfs.c
@@ -115,6 +115,41 @@ brasero_data_vfs_is_loading_uri (BraseroDataVFS *self)
return (g_hash_table_size (priv->loading) != 0);
}
+static BraseroBurnResult
+brasero_data_vfs_emit_image_signal (BraseroDataVFS *self,
+ const gchar *uri)
+{
+ GValue instance_and_params [2];
+ GValue return_value;
+ GValue *params;
+
+ /* object which signalled */
+ instance_and_params->g_type = 0;
+ g_value_init (instance_and_params, G_TYPE_FROM_INSTANCE (self));
+ g_value_set_instance (instance_and_params, self);
+
+ /* arguments of signal (name) */
+ params = instance_and_params + 1;
+ params->g_type = 0;
+ g_value_init (params, G_TYPE_STRING);
+ g_value_set_string (params, uri);
+
+ /* default to CANCEL */
+ return_value.g_type = 0;
+ g_value_init (&return_value, G_TYPE_INT);
+ g_value_set_int (&return_value, BRASERO_BURN_CANCEL);
+
+ g_signal_emitv (instance_and_params,
+ brasero_data_vfs_signals [IMAGE_SIGNAL],
+ 0,
+ &return_value);
+
+ g_value_unset (instance_and_params);
+ g_value_unset (params);
+
+ return g_value_get_int (&return_value);
+}
+
static gboolean
brasero_data_vfs_check_uri_result (BraseroDataVFS *self,
const gchar *uri,
@@ -401,6 +436,7 @@ brasero_data_vfs_directory_load_result (GObject *owner,
}
}
+
/* add node for all parents */
nodes = g_hash_table_lookup (priv->directories, parent_uri);
for (iter = nodes; iter; iter = iter->next) {
@@ -412,6 +448,15 @@ brasero_data_vfs_directory_load_result (GObject *owner,
if (!parent)
continue;
+ if (parent->is_root) {
+ /* This may be true in some rare situations (when the root of a
+ * volume has been added like burn:/// */
+ brasero_data_project_add_loading_node (BRASERO_DATA_PROJECT (self),
+ uri,
+ parent);
+ continue;
+ }
+
if (g_file_info_get_is_symlink (info)) {
if (brasero_data_vfs_directory_check_symlink_loop (self, parent, uri, info)) {
brasero_data_project_exclude_uri (BRASERO_DATA_PROJECT (self), uri);
@@ -521,41 +566,6 @@ brasero_data_vfs_loading_node_end (GObject *object,
g_hash_table_size (priv->directories));
}
-static BraseroBurnResult
-brasero_data_vfs_emit_image_signal (BraseroDataVFS *self,
- const gchar *uri)
-{
- GValue instance_and_params [2];
- GValue return_value;
- GValue *params;
-
- /* object which signalled */
- instance_and_params->g_type = 0;
- g_value_init (instance_and_params, G_TYPE_FROM_INSTANCE (self));
- g_value_set_instance (instance_and_params, self);
-
- /* arguments of signal (name) */
- params = instance_and_params + 1;
- params->g_type = 0;
- g_value_init (params, G_TYPE_STRING);
- g_value_set_string (params, uri);
-
- /* default to FALSE */
- return_value.g_type = 0;
- g_value_init (&return_value, G_TYPE_INT);
- g_value_set_int (&return_value, BRASERO_BURN_CANCEL);
-
- g_signal_emitv (instance_and_params,
- brasero_data_vfs_signals [IMAGE_SIGNAL],
- 0,
- &return_value);
-
- g_value_unset (instance_and_params);
- g_value_unset (params);
-
- return g_value_get_int (&return_value);
-}
-
static void
brasero_data_vfs_loading_node_result (GObject *owner,
GError *error,
diff --git a/libbrasero-burn/brasero-disc-copy-dialog.c b/libbrasero-burn/brasero-disc-copy-dialog.c
deleted file mode 100644
index 7486fe2..0000000
--- a/libbrasero-burn/brasero-disc-copy-dialog.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Libbrasero-burn
- * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
- *
- * Libbrasero-burn is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
- * GStreamer plugins to be used and distributed together with GStreamer
- * and Libbrasero-burn. This permission is above and beyond the permissions granted
- * by the GPL license by which Libbrasero-burn is covered. If you modify this code
- * you may extend this exception to your version of the code, but you are not
- * obligated to do so. If you do not wish to do so, delete this exception
- * statement from your version.
- *
- * Libbrasero-burn is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to:
- * The Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301, USA.
- */
-
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-#include <glib.h>
-#include <glib/gi18n-lib.h>
-#include <glib/gstdio.h>
-
-#include <gtk/gtk.h>
-
-#include "burn-basics.h"
-#include "brasero-session.h"
-#include "brasero-medium.h"
-#include "brasero-drive.h"
-#include "brasero-session-cfg.h"
-#include "brasero-disc-copy-dialog.h"
-#include "brasero-dest-selection.h"
-#include "brasero-src-selection.h"
-#include "brasero-burn-options.h"
-#include "brasero-burn-options-private.h"
-
-G_DEFINE_TYPE (BraseroDiscCopyDialog, brasero_disc_copy_dialog, BRASERO_TYPE_BURN_OPTIONS);
-
-struct BraseroDiscCopyDialogPrivate {
- GtkWidget *source;
-};
-typedef struct BraseroDiscCopyDialogPrivate BraseroDiscCopyDialogPrivate;
-
-#define BRASERO_DISC_COPY_DIALOG_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_DISC_COPY_DIALOG, BraseroDiscCopyDialogPrivate))
-
-static GObjectClass *parent_class = NULL;
-
-static void
-brasero_disc_copy_dialog_set_session (BraseroDiscCopyDialog *obj)
-{
- gchar *title_str;
- BraseroBurnSession *session;
- BraseroDiscCopyDialogPrivate *priv;
-
- priv = BRASERO_DISC_COPY_DIALOG_PRIVATE (obj);
-
- brasero_burn_options_add_burn_button (BRASERO_BURN_OPTIONS (obj),
- _("_Copy"),
- "media-optical-burn");
-
- /* take care of source media */
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (obj));
- priv->source = brasero_src_selection_new (session);
- gtk_widget_show (priv->source);
- g_object_unref (session);
-
- title_str = g_strdup_printf ("<b>%s</b>", _("Select disc to copy"));
- brasero_burn_options_add_source (BRASERO_BURN_OPTIONS (obj),
- title_str,
- priv->source,
- NULL);
- g_free (title_str);
-
- /* only show media with something to be read on them */
- brasero_medium_selection_show_media_type (BRASERO_MEDIUM_SELECTION (priv->source),
- BRASERO_MEDIA_TYPE_AUDIO|
- BRASERO_MEDIA_TYPE_DATA);
-
- /* This is a special case. When we're copying, someone may want to read
- * and burn to the same drive so provided that the drive is a burner
- * then show its contents. */
- brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (obj),
- BRASERO_MEDIA_TYPE_ANY_IN_BURNER|
- BRASERO_MEDIA_TYPE_FILE);
-}
-
-static void
-brasero_disc_copy_dialog_init (BraseroDiscCopyDialog *obj)
-{
- gtk_window_set_title (GTK_WINDOW (obj), _("CD/DVD Copy Options"));
- g_signal_connect (obj,
- "notify::session",
- G_CALLBACK (brasero_disc_copy_dialog_set_session),
- NULL);
-}
-
-static void
-brasero_disc_copy_dialog_finalize (GObject *object)
-{
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-brasero_disc_copy_dialog_class_init (BraseroDiscCopyDialogClass * klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- g_type_class_add_private (klass, sizeof (BraseroDiscCopyDialogPrivate));
-
- parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = brasero_disc_copy_dialog_finalize;
-}
-
diff --git a/libbrasero-burn/brasero-disc-option-dialog.c b/libbrasero-burn/brasero-disc-option-dialog.c
deleted file mode 100644
index 1be50e6..0000000
--- a/libbrasero-burn/brasero-disc-option-dialog.c
+++ /dev/null
@@ -1,865 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Libbrasero-burn
- * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
- *
- * Libbrasero-burn is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
- * GStreamer plugins to be used and distributed together with GStreamer
- * and Libbrasero-burn. This permission is above and beyond the permissions granted
- * by the GPL license by which Libbrasero-burn is covered. If you modify this code
- * you may extend this exception to your version of the code, but you are not
- * obligated to do so. If you do not wish to do so, delete this exception
- * statement from your version.
- *
- * Libbrasero-burn is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to:
- * The Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301, USA.
- */
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <glib.h>
-#include <glib/gi18n-lib.h>
-#include <glib-object.h>
-
-#include <gtk/gtk.h>
-
-#include "brasero-drive.h"
-#include "brasero-medium.h"
-#include "brasero-volume.h"
-
-#include "brasero-misc.h"
-
-#include "burn-basics.h"
-#include "brasero-tags.h"
-#include "brasero-session.h"
-#include "brasero-track-data.h"
-#include "burn-plugin-manager.h"
-#include "brasero-disc-option-dialog.h"
-#include "brasero-dest-selection.h"
-#include "brasero-session-cfg.h"
-#include "brasero-session-helper.h"
-#include "brasero-burn-options.h"
-#include "brasero-burn-options-private.h"
-
-G_DEFINE_TYPE (BraseroDiscOptionDialog, brasero_disc_option_dialog, BRASERO_TYPE_BURN_OPTIONS);
-
-struct _BraseroDiscOptionDialogPrivate {
- GtkWidget *joliet_toggle;
-
- GtkWidget *video_options;
- GtkWidget *vcd_label;
- GtkWidget *vcd_button;
- GtkWidget *svcd_button;
-
- GtkWidget *button_4_3;
- GtkWidget *button_16_9;
-
- gulong valid_sig;
-
- guint joliet_warning:1;
- guint joliet_saved:1;
-};
-typedef struct _BraseroDiscOptionDialogPrivate BraseroDiscOptionDialogPrivate;
-
-#define BRASERO_DISC_OPTION_DIALOG_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_DISC_OPTION_DIALOG, BraseroDiscOptionDialogPrivate))
-
-static GtkDialogClass *parent_class = NULL;
-
-
-static void
-brasero_disc_option_audio_AC3 (BraseroDiscOptionDialog *dialog)
-{
- BraseroBurnSession *session;
- GValue *value = NULL;
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-
- value = g_new0 (GValue, 1);
- g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, BRASERO_AUDIO_FORMAT_AC3);
- brasero_burn_session_tag_add (session,
- BRASERO_DVD_STREAM_FORMAT,
- value);
-
- g_object_unref (session);
-}
-
-static void
-brasero_disc_option_audio_MP2 (BraseroDiscOptionDialog *dialog)
-{
- BraseroBurnSession *session;
- GValue *value = NULL;
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-
- value = g_new0 (GValue, 1);
- g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, BRASERO_AUDIO_FORMAT_MP2);
- brasero_burn_session_tag_add (session,
- BRASERO_DVD_STREAM_FORMAT,
- value);
-
- g_object_unref (session);
-}
-
-/**
- * These functions are used when caps-changed event or drive-changed event
- * are generated. They are used to check that flags or fs are valid.
- */
-
-static void
-brasero_disc_option_dialog_set_tracks_image_fs (BraseroBurnSession *session,
- BraseroImageFS fs_type)
-{
- GSList *tracks;
- GSList *iter;
-
- tracks = brasero_burn_session_get_tracks (session);
- for (iter = tracks; iter; iter = iter->next) {
- BraseroTrack *track;
-
- track = iter->data;
- if (!BRASERO_IS_TRACK_DATA (track))
- continue;
-
- brasero_track_data_add_fs (BRASERO_TRACK_DATA (track), fs_type);
- }
-}
-
-static gboolean
-brasero_disc_option_dialog_update_joliet (BraseroDiscOptionDialog *dialog)
-{
- BraseroImageFS fs_type;
- BraseroBurnResult result;
- BraseroBurnSession *session;
- BraseroTrackType *source = NULL;
- BraseroDiscOptionDialogPrivate *priv;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
- if (!priv->joliet_toggle)
- return FALSE;
-
- /* what we want to check Joliet support */
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-
- source = brasero_track_type_new ();
- brasero_burn_session_get_input_type (session, source);
- fs_type = brasero_track_type_get_data_fs (source);
-
- brasero_track_type_set_data_fs (source,
- fs_type|
- BRASERO_IMAGE_FS_JOLIET);
-
- result = brasero_burn_session_input_supported (session,
- source,
- FALSE);
- brasero_track_type_free (source);
-
- if (result == BRASERO_BURN_OK) {
- if (GTK_WIDGET_IS_SENSITIVE (priv->joliet_toggle)) {
- g_object_unref (session);
- return FALSE;
- }
-
- gtk_widget_set_sensitive (priv->joliet_toggle, TRUE);
-
- if (!priv->joliet_saved) {
- g_object_unref (session);
- return FALSE;
- }
-
- brasero_disc_option_dialog_set_tracks_image_fs (session, fs_type);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), priv->joliet_saved);
- g_object_unref (session);
- return TRUE;
- }
-
- if (!GTK_WIDGET_IS_SENSITIVE (priv->joliet_toggle)) {
- g_object_unref (session);
- return FALSE;
- }
-
- priv->joliet_saved = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle));
- if (priv->joliet_saved) {
- fs_type &= (~BRASERO_IMAGE_FS_JOLIET);
- brasero_disc_option_dialog_set_tracks_image_fs (session, fs_type);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), FALSE);
- }
-
- gtk_widget_set_sensitive (priv->joliet_toggle, FALSE);
- g_object_unref (session);
-
- return TRUE;
-}
-
-static void
-brasero_disc_option_dialog_update_video (BraseroDiscOptionDialog *dialog)
-{
- BraseroDiscOptionDialogPrivate *priv;
- BraseroBurnSession *session;
- BraseroMedia media;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
- /* means we haven't initialized yet */
- if (!priv->vcd_label)
- return;
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
- media = brasero_burn_session_get_dest_media (session);
-
- if (media & BRASERO_MEDIUM_DVD) {
- brasero_disc_option_audio_AC3 (dialog);
- gtk_widget_hide (priv->vcd_label);
- gtk_widget_hide (priv->vcd_button);
- gtk_widget_hide (priv->svcd_button);
-
- gtk_widget_set_sensitive (priv->button_4_3, TRUE);
- gtk_widget_set_sensitive (priv->button_16_9, TRUE);
- }
- else if (media & BRASERO_MEDIUM_CD) {
- brasero_disc_option_audio_MP2 (dialog);
- gtk_widget_show (priv->vcd_label);
- gtk_widget_show (priv->vcd_button);
- gtk_widget_show (priv->svcd_button);
-
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->vcd_button))) {
- gtk_widget_set_sensitive (priv->button_4_3, FALSE);
- gtk_widget_set_sensitive (priv->button_16_9, FALSE);
- }
- else {
- gtk_widget_set_sensitive (priv->button_4_3, TRUE);
- gtk_widget_set_sensitive (priv->button_16_9, TRUE);
- }
- }
- else if (media & BRASERO_MEDIUM_FILE) {
- BraseroImageFormat format;
-
- /* if we create a CUE file then that's a (S)VCD */
- format = brasero_burn_session_get_output_format (session);
- if (format == BRASERO_IMAGE_FORMAT_NONE) {
- g_object_unref (session);
- return;
- }
-
- if (format == BRASERO_IMAGE_FORMAT_CUE) {
- brasero_disc_option_audio_MP2 (dialog);
- gtk_widget_show (priv->vcd_label);
- gtk_widget_show (priv->vcd_button);
- gtk_widget_show (priv->svcd_button);
-
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->vcd_button))) {
- gtk_widget_set_sensitive (priv->button_4_3, FALSE);
- gtk_widget_set_sensitive (priv->button_16_9, FALSE);
- }
- else {
- gtk_widget_set_sensitive (priv->button_4_3, TRUE);
- gtk_widget_set_sensitive (priv->button_16_9, TRUE);
- }
- }
- else if (format == BRASERO_IMAGE_FORMAT_BIN) {
- brasero_disc_option_audio_AC3 (dialog);
- gtk_widget_hide (priv->vcd_label);
- gtk_widget_hide (priv->vcd_button);
- gtk_widget_hide (priv->svcd_button);
-
- gtk_widget_set_sensitive (priv->button_4_3, TRUE);
- gtk_widget_set_sensitive (priv->button_16_9, TRUE);
- }
- }
-
- g_object_unref (session);
-}
-
-/**
- * These functions are used to update the session according to the states
- * of the buttons and entry
- */
-
-static void
-brasero_disc_option_dialog_set_joliet (BraseroDiscOptionDialog *dialog)
-{
- BraseroDiscOptionDialogPrivate *priv;
- BraseroTrackType *source = NULL;
- BraseroBurnSession *session;
- BraseroImageFS fs_type;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
- if (!priv->joliet_toggle)
- return;
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-
- /* NOTE: we don't check for the sensitive property since when
- * something is compulsory the button is active but insensitive */
- source = brasero_track_type_new ();
- brasero_burn_session_get_input_type (session, source);
- if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle)))
- fs_type = (~BRASERO_IMAGE_FS_JOLIET) & brasero_track_type_get_data_fs (source);
- else
- fs_type = BRASERO_IMAGE_FS_JOLIET|brasero_track_type_get_data_fs (source);
- brasero_track_type_free (source);
-
- brasero_disc_option_dialog_set_tracks_image_fs (session, fs_type);
- g_object_unref (session);
-}
-
-static void
-brasero_disc_option_dialog_joliet_toggled_cb (GtkToggleButton *toggle,
- BraseroDiscOptionDialog *dialog)
-{
- BraseroDiscOptionDialogPrivate *priv;
- GtkResponseType answer;
- GtkWidget *message;
- gchar *secondary;
- gboolean hide;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
- if (!GTK_WIDGET_VISIBLE (dialog)) {
- gtk_widget_show (GTK_WIDGET (dialog));
- hide = TRUE;
- }
-
- if (priv->joliet_warning) {
- brasero_disc_option_dialog_set_joliet (dialog);
- return;
- }
-
- priv->joliet_warning = TRUE;
-
- message = gtk_message_dialog_new (GTK_WINDOW (dialog),
- GTK_DIALOG_DESTROY_WITH_PARENT|
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_NONE,
- _("Should files be renamed to be fully Windows-compatible?"));
-
- secondary = g_strdup_printf ("%s\n%s",
- _("Some files don't have a suitable name for a fully Windows-compatible CD."),
- _("Those names should be changed and truncated to 64 characters."));
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message), "%s", secondary);
- g_free (secondary);
-
- gtk_dialog_add_button (GTK_DIALOG (message),
- _("_Disable Full Windows Compatibility"),
- GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (GTK_DIALOG (message),
- _("_Rename for Full Windows Compatibility"),
- GTK_RESPONSE_YES);
-
- answer = gtk_dialog_run (GTK_DIALOG (message));
- gtk_widget_destroy (message);
-
- if (answer != GTK_RESPONSE_YES)
- gtk_toggle_button_set_active (toggle, FALSE);
- else
- brasero_disc_option_dialog_set_joliet (dialog);
-
- priv->joliet_warning = FALSE;
-}
-
-static gboolean
-brasero_disc_option_dialog_joliet_widget (BraseroDiscOptionDialog *dialog)
-{
- BraseroDiscOptionDialogPrivate *priv;
- BraseroTrackType *type = NULL;
- BraseroBurnSession *session;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
- priv->joliet_toggle = gtk_check_button_new_with_mnemonic (_("Increase compatibility with _Windows systems"));
- gtk_widget_set_tooltip_text (priv->joliet_toggle,
- _("Improve compatibility with Windows systems by allowing to display long filenames (maximum 64 characters)"));
-
- /* NOTE: we take for granted that if the source does not require
- * to have the joliet extension, it's because it does have some
- * incompatible filenames inside */
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-
- type = brasero_track_type_new ();
- brasero_burn_session_get_input_type (session, type);
- if (brasero_track_type_get_data_fs (type) & BRASERO_IMAGE_FS_JOLIET) {
- priv->joliet_warning = 1;
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->joliet_toggle), TRUE);
- }
- brasero_track_type_free (type);
-
- brasero_disc_option_dialog_update_joliet (dialog);
-
- g_signal_connect (priv->joliet_toggle,
- "toggled",
- G_CALLBACK (brasero_disc_option_dialog_joliet_toggled_cb),
- dialog);
-
- g_object_unref (session);
- return TRUE;
-}
-
-static void
-brasero_disc_option_dialog_add_data_options (BraseroDiscOptionDialog *dialog)
-{
- BraseroDiscOptionDialogPrivate *priv;
- GtkWidget *widget = NULL;
- GtkWidget *options;
- gchar *string;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
- /* create the options box */
- widget = gtk_vbox_new (FALSE, 0);
- brasero_burn_options_add_options (BRASERO_BURN_OPTIONS (dialog), widget);
-
- /* general options */
- brasero_disc_option_dialog_joliet_widget (dialog);
- string = g_strdup_printf ("<b>%s</b>", _("Disc options"));
- options = brasero_utils_pack_properties (string,
- priv->joliet_toggle,
- NULL);
- g_free (string);
-
- gtk_box_pack_start (GTK_BOX (widget), options, FALSE, FALSE, 0);
-
- gtk_widget_show_all (widget);
-}
-
-static void
-brasero_disc_option_dialog_set_tag (BraseroDiscOptionDialog *dialog,
- const gchar *tag,
- gint contents)
-{
- BraseroBurnSession *session;
- GValue *value;
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-
- value = g_new0 (GValue, 1);
- g_value_init (value, G_TYPE_INT);
- g_value_set_int (value, contents);
- brasero_burn_session_tag_add (session,
- tag,
- value);
-
- g_object_unref (session);
-}
-
-static void
-brasero_disc_option_dialog_SVCD (GtkToggleButton *button,
- BraseroDiscOptionDialog *dialog)
-{
- BraseroDiscOptionDialogPrivate *priv;
-
- if (!gtk_toggle_button_get_active (button))
- return;
-
- brasero_disc_option_dialog_set_tag (dialog,
- BRASERO_VCD_TYPE,
- BRASERO_SVCD);
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
- gtk_widget_set_sensitive (priv->button_4_3, TRUE);
- gtk_widget_set_sensitive (priv->button_16_9, TRUE);
-}
-
-static void
-brasero_disc_option_dialog_VCD (GtkToggleButton *button,
- BraseroDiscOptionDialog *dialog)
-{
- BraseroDiscOptionDialogPrivate *priv;
-
- if (!gtk_toggle_button_get_active (button))
- return;
-
- brasero_disc_option_dialog_set_tag (dialog,
- BRASERO_VCD_TYPE,
- BRASERO_VCD_V2);
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
- gtk_widget_set_sensitive (priv->button_4_3, FALSE);
- gtk_widget_set_sensitive (priv->button_16_9, FALSE);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button_4_3), TRUE);
-}
-
-static void
-brasero_disc_option_dialog_NTSC (GtkToggleButton *button,
- BraseroDiscOptionDialog *dialog)
-{
- if (!gtk_toggle_button_get_active (button))
- return;
-
- brasero_disc_option_dialog_set_tag (dialog,
- BRASERO_VIDEO_OUTPUT_FRAMERATE,
- BRASERO_VIDEO_FRAMERATE_NTSC);
-}
-
-static void
-brasero_disc_option_dialog_PAL_SECAM (GtkToggleButton *button,
- BraseroDiscOptionDialog *dialog)
-{
- if (!gtk_toggle_button_get_active (button))
- return;
-
- brasero_disc_option_dialog_set_tag (dialog,
- BRASERO_VIDEO_OUTPUT_FRAMERATE,
- BRASERO_VIDEO_FRAMERATE_PAL_SECAM);
-}
-
-static void
-brasero_disc_option_dialog_native_framerate (GtkToggleButton *button,
- BraseroDiscOptionDialog *dialog)
-{
- BraseroBurnSession *session;
-
- if (!gtk_toggle_button_get_active (button))
- return;
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
- brasero_burn_session_tag_remove (session, BRASERO_VIDEO_OUTPUT_FRAMERATE);
- g_object_unref (session);
-}
-
-static void
-brasero_disc_option_dialog_16_9 (GtkToggleButton *button,
- BraseroDiscOptionDialog *dialog)
-{
- if (!gtk_toggle_button_get_active (button))
- return;
-
- brasero_disc_option_dialog_set_tag (dialog,
- BRASERO_VIDEO_OUTPUT_ASPECT,
- BRASERO_VIDEO_ASPECT_16_9);
-}
-
-static void
-brasero_disc_option_dialog_4_3 (GtkToggleButton *button,
- BraseroDiscOptionDialog *dialog)
-{
- if (!gtk_toggle_button_get_active (button))
- return;
-
- brasero_disc_option_dialog_set_tag (dialog,
- BRASERO_VIDEO_OUTPUT_ASPECT,
- BRASERO_VIDEO_ASPECT_4_3);
-}
-
-static void
-brasero_disc_option_dialog_add_video_options (BraseroDiscOptionDialog *dialog)
-{
- gchar *string;
- GtkWidget *label;
- GtkWidget *table;
- GtkWidget *widget;
- GtkWidget *button1;
- GtkWidget *button2;
- GtkWidget *button3;
- GtkWidget *options;
- BraseroDiscOptionDialogPrivate *priv;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
- widget = gtk_vbox_new (FALSE, 0);
- brasero_burn_options_add_options (BRASERO_BURN_OPTIONS (dialog), widget);
-
- table = gtk_table_new (3, 4, FALSE);
- gtk_table_set_col_spacings (GTK_TABLE (table), 8);
- gtk_table_set_row_spacings (GTK_TABLE (table), 6);
- gtk_widget_show (table);
-
- label = gtk_label_new (_("Video format:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_widget_show (label);
- gtk_table_attach (GTK_TABLE (table),
- label,
- 0, 1,
- 0, 1,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
-
- button1 = gtk_radio_button_new_with_mnemonic (NULL,
- _("_NTSC"));
- gtk_widget_set_tooltip_text (button1, _("Format used mostly on the North American Continent"));
- g_signal_connect (button1,
- "toggled",
- G_CALLBACK (brasero_disc_option_dialog_NTSC),
- dialog);
- gtk_table_attach (GTK_TABLE (table),
- button1,
- 3, 4,
- 0, 1,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
-
- button2 = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button1),
- _("_PAL/SECAM"));
- gtk_widget_set_tooltip_text (button2, _("Format used mostly in Europe"));
- g_signal_connect (button2,
- "toggled",
- G_CALLBACK (brasero_disc_option_dialog_PAL_SECAM),
- dialog);
- gtk_table_attach (GTK_TABLE (table),
- button2,
- 2, 3,
- 0, 1,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
-
- button3 = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button1),
- _("Native _format"));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button3), TRUE);
- g_signal_connect (button3,
- "toggled",
- G_CALLBACK (brasero_disc_option_dialog_native_framerate),
- dialog);
- gtk_table_attach (GTK_TABLE (table),
- button3,
- 1, 2,
- 0, 1,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
-
- label = gtk_label_new (_("Aspect ratio:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_widget_show (label);
- gtk_table_attach (GTK_TABLE (table),
- label,
- 0, 1,
- 1, 2,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
-
- button1 = gtk_radio_button_new_with_mnemonic (NULL,
- _("_4:3"));
- g_signal_connect (button1,
- "toggled",
- G_CALLBACK (brasero_disc_option_dialog_4_3),
- dialog);
- gtk_table_attach (GTK_TABLE (table),
- button1,
- 1, 2,
- 1, 2,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
- priv->button_4_3 = button1;
-
- button2 = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button1),
- _("_16:9"));
- g_signal_connect (button2,
- "toggled",
- G_CALLBACK (brasero_disc_option_dialog_16_9),
- dialog);
- gtk_table_attach (GTK_TABLE (table),
- button2,
- 2, 3,
- 1, 2,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
- priv->button_16_9 = button2;
-
- /* Video options for (S)VCD */
- label = gtk_label_new (_("VCD type:"));
- priv->vcd_label = label;
-
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_widget_show (label);
- gtk_table_attach (GTK_TABLE (table),
- label,
- 0, 1,
- 2, 3,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
-
- button1 = gtk_radio_button_new_with_mnemonic_from_widget (NULL, _("Create a SVCD"));
- priv->svcd_button = button1;
- gtk_table_attach (GTK_TABLE (table),
- button1,
- 1, 2,
- 2, 3,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
-
- g_signal_connect (button1,
- "clicked",
- G_CALLBACK (brasero_disc_option_dialog_SVCD),
- dialog);
-
- button2 = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button1), _("Create a VCD"));
- priv->vcd_button = button2;
- gtk_table_attach (GTK_TABLE (table),
- button2,
- 2, 3,
- 2, 3,
- GTK_FILL,
- GTK_FILL,
- 0, 0);
-
- g_signal_connect (button2,
- "clicked",
- G_CALLBACK (brasero_disc_option_dialog_VCD),
- dialog);
-
- string = g_strdup_printf ("<b>%s</b>", _("Video Options"));
- options = brasero_utils_pack_properties (string,
- table,
- NULL);
- g_free (string);
-
- gtk_box_pack_start (GTK_BOX (widget), options, FALSE, FALSE, 0);
-
- /* NOTE: audio options for DVDs were removed. For SVCD that is MP2 and
- * for Video DVD even if we have a choice AC3 is the most widespread
- * audio format. So use AC3 by default. */
-
- gtk_widget_show_all (widget);
- brasero_disc_option_dialog_update_video (dialog);
-
- priv->video_options = widget;
-
- /* Just to make sure our tags are correct in BraseroBurnSession */
- brasero_disc_option_dialog_set_tag (dialog,
- BRASERO_VCD_TYPE,
- BRASERO_SVCD);
- brasero_disc_option_dialog_set_tag (dialog,
- BRASERO_VIDEO_OUTPUT_ASPECT,
- BRASERO_VIDEO_ASPECT_4_3);
-}
-
-static void
-brasero_disc_option_dialog_valid_media_cb (BraseroSessionCfg *session,
- BraseroDiscOptionDialog *self)
-{
- BraseroDiscOptionDialogPrivate *priv;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (self);
-
- if (priv->video_options)
- gtk_widget_set_sensitive (priv->video_options, BRASERO_SESSION_IS_VALID (brasero_session_cfg_get_error (session)));
-
- /* update the joliet button */
- brasero_disc_option_dialog_update_joliet (self);
-
- /* for video disc see what's the output: CD or DVD */
- brasero_disc_option_dialog_update_video (self);
-}
-
-static void
-brasero_disc_option_dialog_set_session (GObject *dialog,
- GParamSpec *pspec,
- gpointer NULL_data)
-{
- BraseroDiscOptionDialogPrivate *priv;
- BraseroTrackType *type = NULL;
- BraseroBurnSession *session;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (dialog));
-
- type = brasero_track_type_new ();
- brasero_burn_session_get_input_type (session, type);
-
- if (brasero_track_type_get_has_data (type)) {
- brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (dialog),
- BRASERO_MEDIA_TYPE_WRITABLE|
- BRASERO_MEDIA_TYPE_FILE);
- brasero_disc_option_dialog_add_data_options (BRASERO_DISC_OPTION_DIALOG (dialog));
- }
- else if (brasero_track_type_get_has_stream (type)) {
- if (brasero_track_type_get_stream_format (type) & (BRASERO_VIDEO_FORMAT_UNDEFINED|BRASERO_VIDEO_FORMAT_VCD|BRASERO_VIDEO_FORMAT_VIDEO_DVD)) {
- brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (dialog),
- BRASERO_MEDIA_TYPE_WRITABLE|
- BRASERO_MEDIA_TYPE_FILE);
- brasero_disc_option_dialog_add_video_options (BRASERO_DISC_OPTION_DIALOG (dialog));
- }
- else {
- /* No other specific options for audio */
- brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (dialog),
- BRASERO_MEDIA_TYPE_WRITABLE);
- }
- }
- brasero_track_type_free (type);
-
- /* see if we should lock the drive only with MERGE */
- if (brasero_burn_session_get_flags (session) & BRASERO_BURN_FLAG_MERGE)
- brasero_burn_options_lock_selection (BRASERO_BURN_OPTIONS (dialog));
-
- priv->valid_sig = g_signal_connect (session,
- "is-valid",
- G_CALLBACK (brasero_disc_option_dialog_valid_media_cb),
- dialog);
- g_object_unref (session);
-}
-
-static void
-brasero_disc_option_dialog_init (BraseroDiscOptionDialog *obj)
-{
- BraseroDiscOptionDialogPrivate *priv;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (obj);
-
- gtk_window_set_title (GTK_WINDOW (obj), _("Disc Burning Setup"));
- g_signal_connect (obj,
- "notify::session",
- G_CALLBACK (brasero_disc_option_dialog_set_session),
- NULL);
-}
-
-static void
-brasero_disc_option_dialog_finalize (GObject *object)
-{
- BraseroDiscOptionDialogPrivate *priv;
-
- priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (object);
-
- if (priv->valid_sig) {
- BraseroBurnSession *session;
-
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (object));
- g_signal_handler_disconnect (session, priv->valid_sig);
- g_object_unref (session);
-
- priv->valid_sig = 0;
- }
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-brasero_disc_option_dialog_class_init (BraseroDiscOptionDialogClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- g_type_class_add_private (klass, sizeof (BraseroDiscOptionDialogPrivate));
-
- parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = brasero_disc_option_dialog_finalize;
-}
-
diff --git a/libbrasero-burn/brasero-disc-option-dialog.h b/libbrasero-burn/brasero-disc-option-dialog.h
deleted file mode 100644
index f09e41a..0000000
--- a/libbrasero-burn/brasero-disc-option-dialog.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Libbrasero-burn
- * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
- *
- * Libbrasero-burn is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
- * GStreamer plugins to be used and distributed together with GStreamer
- * and Libbrasero-burn. This permission is above and beyond the permissions granted
- * by the GPL license by which Libbrasero-burn is covered. If you modify this code
- * you may extend this exception to your version of the code, but you are not
- * obligated to do so. If you do not wish to do so, delete this exception
- * statement from your version.
- *
- * Libbrasero-burn is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to:
- * The Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef BRASERO_DISC_OPTION_DIALOG_H
-#define BRASERO_DISC_OPTION_DIALOG_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <gtk/gtk.h>
-
-#include "brasero-burn-options.h"
-
-G_BEGIN_DECLS
-
-#define BRASERO_TYPE_DISC_OPTION_DIALOG (brasero_disc_option_dialog_get_type ())
-#define BRASERO_DISC_OPTION_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), BRASERO_TYPE_DISC_OPTION_DIALOG, BraseroDiscOptionDialog))
-#define BRASERO_DISC_OPTION_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), BRASERO_TYPE_DISC_OPTION_DIALOG, BraseroDiscOptionDialogClass))
-#define BRASERO_IS_DISC_OPTION_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), BRASERO_TYPE_DISC_OPTION_DIALOG))
-#define BRASERO_IS_DISC_OPTION_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), BRASERO_TYPE_DISC_OPTION_DIALOG))
-#define BRASERO_DISC_OPTION_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), BRASERO_TYPE_DISC_OPTION_DIALOG, BraseroDiscOptionDialogClass))
-
-typedef struct _BraseroDiscOptionDialog BraseroDiscOptionDialog;
-typedef struct _BraseroDiscOptionDialogClass BraseroDiscOptionDialogClass;
-
-struct _BraseroDiscOptionDialog {
- BraseroBurnOptions parent;
-};
-
-struct _BraseroDiscOptionDialogClass {
- BraseroBurnOptionsClass parent_class;
-};
-
-GType brasero_disc_option_dialog_get_type ();
-
-G_END_DECLS
-
-#endif /* BRASERO_DISC_OPTION_DIALOG_H */
diff --git a/libbrasero-burn/brasero-enums.h b/libbrasero-burn/brasero-enums.h
index 1e2f769..e29e462 100644
--- a/libbrasero-burn/brasero-enums.h
+++ b/libbrasero-burn/brasero-enums.h
@@ -69,8 +69,6 @@ typedef enum {
BRASERO_BURN_FLAG_NO_TMP_FILES = 1 << 8,
BRASERO_BURN_FLAG_DUMMY = 1 << 9,
- /* FIXME! this flag is more or less linked to OVERBURN one can't we do
- * a single one */
BRASERO_BURN_FLAG_OVERBURN = 1 << 10,
BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE = 1 << 11,
diff --git a/libbrasero-burn/brasero-image-option-dialog.c b/libbrasero-burn/brasero-image-option-dialog.c
deleted file mode 100644
index 27f238b..0000000
--- a/libbrasero-burn/brasero-image-option-dialog.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Libbrasero-burn
- * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
- *
- * Libbrasero-burn is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
- * GStreamer plugins to be used and distributed together with GStreamer
- * and Libbrasero-burn. This permission is above and beyond the permissions granted
- * by the GPL license by which Libbrasero-burn is covered. If you modify this code
- * you may extend this exception to your version of the code, but you are not
- * obligated to do so. If you do not wish to do so, delete this exception
- * statement from your version.
- *
- * Libbrasero-burn is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to:
- * The Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301, USA.
- */
-
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <glib.h>
-#include <glib/gi18n-lib.h>
-#include <glib-object.h>
-
-#include <gtk/gtk.h>
-
-#include <gconf/gconf-client.h>
-
-#include "burn-basics.h"
-#include "brasero-drive.h"
-
-#include "brasero-image-option-dialog.h"
-#include "brasero-src-image.h"
-#include "brasero-burn-options.h"
-#include "brasero-burn-options-private.h"
-
-G_DEFINE_TYPE (BraseroImageOptionDialog, brasero_image_option_dialog, BRASERO_TYPE_BURN_OPTIONS);
-
-struct _BraseroImageOptionDialogPrivate {
- GtkWidget *file;
-};
-typedef struct _BraseroImageOptionDialogPrivate BraseroImageOptionDialogPrivate;
-
-#define BRASERO_IMAGE_OPTION_DIALOG_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_IMAGE_OPTION_DIALOG, BraseroImageOptionDialogPrivate))
-
-static GtkDialogClass *parent_class = NULL;
-
-static void
-brasero_image_option_dialog_set_session (BraseroImageOptionDialog *obj)
-{
- gchar *string;
- BraseroBurnSession *session;
- BraseroImageOptionDialogPrivate *priv;
-
- priv = BRASERO_IMAGE_OPTION_DIALOG_PRIVATE (obj);
-
- brasero_burn_options_set_type_shown (BRASERO_BURN_OPTIONS (obj),
- BRASERO_MEDIA_TYPE_WRITABLE);
-
- /* Image properties */
- session = brasero_burn_options_get_session (BRASERO_BURN_OPTIONS (obj));
- priv->file = brasero_src_image_new (session);
- g_object_unref (session);
-
- gtk_widget_show (priv->file);
-
- /* pack everything */
- string = g_strdup_printf ("<b>%s</b>", _("Select an image to write"));
- brasero_burn_options_add_source (BRASERO_BURN_OPTIONS (obj),
- string,
- priv->file,
- NULL);
- g_free (string);
-}
-
-static void
-brasero_image_option_dialog_init (BraseroImageOptionDialog *obj)
-{
- gtk_window_set_title (GTK_WINDOW (obj), _("Image Burning Setup"));
- g_signal_connect (obj,
- "notify::session",
- G_CALLBACK (brasero_image_option_dialog_set_session),
- NULL);
-}
-
-static void
-brasero_image_option_dialog_finalize (GObject *object)
-{
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-brasero_image_option_dialog_class_init (BraseroImageOptionDialogClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- g_type_class_add_private (klass, sizeof (BraseroImageOptionDialogPrivate));
-
- parent_class = g_type_class_peek_parent (klass);
- object_class->finalize = brasero_image_option_dialog_finalize;
-}
-
diff --git a/libbrasero-burn/brasero-image-option-dialog.h b/libbrasero-burn/brasero-image-option-dialog.h
deleted file mode 100644
index 4cdf4b1..0000000
--- a/libbrasero-burn/brasero-image-option-dialog.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/*
- * Libbrasero-burn
- * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
- *
- * Libbrasero-burn is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
- * GStreamer plugins to be used and distributed together with GStreamer
- * and Libbrasero-burn. This permission is above and beyond the permissions granted
- * by the GPL license by which Libbrasero-burn is covered. If you modify this code
- * you may extend this exception to your version of the code, but you are not
- * obligated to do so. If you do not wish to do so, delete this exception
- * statement from your version.
- *
- * Libbrasero-burn is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to:
- * The Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef BRASERO_IMAGE_OPTION_DIALOG_H
-#define BRASERO_IMAGE_OPTION_DIALOG_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <gtk/gtk.h>
-
-#include "brasero-session.h"
-
-#include "brasero-burn-options.h"
-
-G_BEGIN_DECLS
-
-#define BRASERO_TYPE_IMAGE_OPTION_DIALOG (brasero_image_option_dialog_get_type ())
-#define BRASERO_IMAGE_OPTION_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), BRASERO_TYPE_IMAGE_OPTION_DIALOG, BraseroImageOptionDialog))
-#define BRASERO_IMAGE_OPTION_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), BRASERO_TYPE_IMAGE_OPTION_DIALOG, BraseroImageOptionDialogClass))
-#define BRASERO_IS_IMAGE_OPTION_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), BRASERO_TYPE_IMAGE_OPTION_DIALOG))
-#define BRASERO_IS_IMAGE_OPTION_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), BRASERO_TYPE_IMAGE_OPTION_DIALOG))
-#define BRASERO_IMAGE_OPTION_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), BRASERO_TYPE_IMAGE_OPTION_DIALOG, BraseroImageOptionDialogClass))
-
-typedef struct _BraseroImageOptionDialog BraseroImageOptionDialog;
-typedef struct _BraseroImageOptionDialogClass BraseroImageOptionDialogClass;
-
-struct _BraseroImageOptionDialog {
- BraseroBurnOptions parent;
-};
-
-struct _BraseroImageOptionDialogClass {
- BraseroBurnOptionsClass parent_class;
-};
-
-GType brasero_image_option_dialog_get_type ();
-
-G_END_DECLS
-
-#endif /* BRASERO_IMAGE_OPTION_DIALOG_H */
diff --git a/libbrasero-burn/brasero-status-dialog.c b/libbrasero-burn/brasero-status-dialog.c
index 5725301..d2dde01 100644
--- a/libbrasero-burn/brasero-status-dialog.c
+++ b/libbrasero-burn/brasero-status-dialog.c
@@ -38,9 +38,13 @@
#include <gtk/gtk.h>
+#include "brasero-misc.h"
+
#include "brasero-units.h"
#include "brasero-enums.h"
+#include "brasero-track-data-cfg.h"
+#include "brasero-track-image-cfg.h"
#include "brasero-session.h"
#include "brasero-status-dialog.h"
@@ -50,10 +54,17 @@ struct _BraseroStatusDialogPrivate
BraseroBurnSession *session;
GtkWidget *progress;
GtkWidget *action;
+
+ guint id;
};
#define BRASERO_STATUS_DIALOG_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_STATUS_DIALOG, BraseroStatusDialogPrivate))
+enum {
+ PROP_0,
+ PROP_SESSION
+};
+
G_DEFINE_TYPE (BraseroStatusDialog, brasero_status_dialog, GTK_TYPE_MESSAGE_DIALOG);
@@ -132,66 +143,39 @@ brasero_status_dialog_wait_for_ready_state (BraseroStatusDialog *dialog)
if (result != BRASERO_BURN_NOT_READY) {
gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
brasero_status_free (status);
+ priv->id = 0;
return FALSE;
}
brasero_status_dialog_update (dialog, status);
brasero_status_free (status);
-
return TRUE;
}
-BraseroBurnResult
-brasero_status_dialog_wait_for_session (BraseroStatusDialog *dialog,
- GtkWidget *toplevel,
- BraseroBurnSession *session)
+static void
+brasero_status_dialog_wait_for_session (BraseroStatusDialog *dialog)
{
- int id;
- int answer;
BraseroStatus *status;
BraseroBurnResult result;
BraseroStatusDialogPrivate *priv;
+ priv = BRASERO_STATUS_DIALOG_PRIVATE (dialog);
+
/* Make sure we really need to run this dialog */
status = brasero_status_new ();
- result = brasero_burn_session_get_status (session, status);
-
+ result = brasero_burn_session_get_status (priv->session, status);
if (result != BRASERO_BURN_NOT_READY) {
brasero_status_free (status);
- return result;
- }
-
- if (toplevel) {
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (toplevel));
- gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
- gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+ return;
}
- priv = BRASERO_STATUS_DIALOG_PRIVATE (dialog);
- priv->session = g_object_ref (session);
-
- /* we are not ready to use the track presumably because
- * data or audio has not finished to explore a directory
- * or get the metadata of a song or a film */
+ gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
brasero_status_dialog_update (dialog, status);
brasero_status_free (status);
-
- id = g_timeout_add (100,
- (GSourceFunc) brasero_status_dialog_wait_for_ready_state,
- dialog);
-
- answer = gtk_dialog_run (GTK_DIALOG (dialog));
-
- g_source_remove (id);
-
- priv->session = NULL;
- g_object_unref (session);
-
- if (answer == GTK_RESPONSE_OK)
- return BRASERO_BURN_OK;
-
- return brasero_burn_session_get_status (session, NULL);
+ priv->id = g_timeout_add (200,
+ (GSourceFunc) brasero_status_dialog_wait_for_ready_state,
+ dialog);
}
static void
@@ -237,8 +221,70 @@ brasero_status_dialog_init (BraseroStatusDialog *object)
}
static void
+brasero_status_dialog_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroStatusDialogPrivate *priv;
+
+ g_return_if_fail (BRASERO_IS_STATUS_DIALOG (object));
+
+ priv = BRASERO_STATUS_DIALOG_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_SESSION: /* Readable and only writable at creation time */
+ priv->session = BRASERO_BURN_SESSION (g_value_get_object (value));
+ g_object_ref (priv->session);
+ brasero_status_dialog_wait_for_session (BRASERO_STATUS_DIALOG (object));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+brasero_status_dialog_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroStatusDialogPrivate *priv;
+
+ g_return_if_fail (BRASERO_IS_STATUS_DIALOG (object));
+
+ priv = BRASERO_STATUS_DIALOG_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_SESSION:
+ g_value_set_object (value, priv->session);
+ g_object_ref (priv->session);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
brasero_status_dialog_finalize (GObject *object)
{
+ BraseroStatusDialogPrivate *priv;
+
+ priv = BRASERO_STATUS_DIALOG_PRIVATE (object);
+ if (priv->session) {
+ g_object_unref (priv->session);
+ priv->session = NULL;
+ }
+
+ if (priv->id) {
+ g_source_remove (priv->id);
+ priv->id = 0;
+ }
+
G_OBJECT_CLASS (brasero_status_dialog_parent_class)->finalize (object);
}
@@ -250,12 +296,26 @@ brasero_status_dialog_class_init (BraseroStatusDialogClass *klass)
g_type_class_add_private (klass, sizeof (BraseroStatusDialogPrivate));
object_class->finalize = brasero_status_dialog_finalize;
+ object_class->set_property = brasero_status_dialog_set_property;
+ object_class->get_property = brasero_status_dialog_get_property;
+
+ g_object_class_install_property (object_class,
+ PROP_SESSION,
+ g_param_spec_object ("session",
+ "The session",
+ "The session to work with",
+ BRASERO_TYPE_BURN_SESSION,
+ G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
}
GtkWidget *
-brasero_status_dialog_new (void)
+brasero_status_dialog_new (BraseroBurnSession *session,
+ GtkWidget *parent)
{
return g_object_new (BRASERO_TYPE_STATUS_DIALOG,
+ "session", session,
+ "transient-for", parent,
+ "modal", TRUE,
"title", _("Project Size Estimation"),
"message-type", GTK_MESSAGE_OTHER,
"text", _("Please wait until the estimation of the project size is completed."),
diff --git a/libbrasero-burn/brasero-status-dialog.h b/libbrasero-burn/brasero-status-dialog.h
index 56ef71b..2b74e2a 100644
--- a/libbrasero-burn/brasero-status-dialog.h
+++ b/libbrasero-burn/brasero-status-dialog.h
@@ -62,12 +62,8 @@ struct _BraseroStatusDialog
GType brasero_status_dialog_get_type (void) G_GNUC_CONST;
GtkWidget *
-brasero_status_dialog_new (void);
-
-BraseroBurnResult
-brasero_status_dialog_wait_for_session (BraseroStatusDialog *dialog,
- GtkWidget *toplevel,
- BraseroBurnSession *session);
+brasero_status_dialog_new (BraseroBurnSession *session,
+ GtkWidget *parent);
G_END_DECLS
diff --git a/libbrasero-burn/brasero-video-options.c b/libbrasero-burn/brasero-video-options.c
new file mode 100644
index 0000000..e9ba566
--- /dev/null
+++ b/libbrasero-burn/brasero-video-options.c
@@ -0,0 +1,566 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/*
+ * Libbrasero-burn
+ * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app wanadoo fr>
+ *
+ * Libbrasero-burn is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
+ * GStreamer plugins to be used and distributed together with GStreamer
+ * and Libbrasero-burn. This permission is above and beyond the permissions granted
+ * by the GPL license by which Libbrasero-burn is covered. If you modify this code
+ * you may extend this exception to your version of the code, but you are not
+ * obligated to do so. If you do not wish to do so, delete this exception
+ * statement from your version.
+ *
+ * Libbrasero-burn is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <glib.h>
+#include <glib/gi18n-lib.h>
+#include <glib-object.h>
+
+#include <gtk/gtk.h>
+
+#include "brasero-misc.h"
+#include "brasero-tags.h"
+#include "brasero-session.h"
+#include "brasero-session-helper.h"
+#include "brasero-video-options.h"
+
+typedef struct _BraseroVideoOptionsPrivate BraseroVideoOptionsPrivate;
+struct _BraseroVideoOptionsPrivate
+{
+ BraseroBurnSession *session;
+
+ GtkWidget *video_options;
+ GtkWidget *vcd_label;
+ GtkWidget *vcd_button;
+ GtkWidget *svcd_button;
+
+ GtkWidget *button_4_3;
+ GtkWidget *button_16_9;
+};
+
+#define BRASERO_VIDEO_OPTIONS_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_VIDEO_OPTIONS, BraseroVideoOptionsPrivate))
+
+enum {
+ PROP_0,
+ PROP_SESSION
+};
+
+G_DEFINE_TYPE (BraseroVideoOptions, brasero_video_options, GTK_TYPE_ALIGNMENT);
+
+static void
+brasero_video_options_audio_AC3 (BraseroVideoOptions *options)
+{
+ GValue *value = NULL;
+ BraseroVideoOptionsPrivate *priv;
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (options);
+
+ value = g_new0 (GValue, 1);
+ g_value_init (value, G_TYPE_INT);
+ g_value_set_int (value, BRASERO_AUDIO_FORMAT_AC3);
+ brasero_burn_session_tag_add (priv->session,
+ BRASERO_DVD_STREAM_FORMAT,
+ value);
+}
+
+static void
+brasero_video_options_audio_MP2 (BraseroVideoOptions *options)
+{
+ GValue *value = NULL;
+ BraseroVideoOptionsPrivate *priv;
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (options);
+
+ value = g_new0 (GValue, 1);
+ g_value_init (value, G_TYPE_INT);
+ g_value_set_int (value, BRASERO_AUDIO_FORMAT_MP2);
+ brasero_burn_session_tag_add (priv->session,
+ BRASERO_DVD_STREAM_FORMAT,
+ value);
+}
+
+static void
+brasero_video_options_update (BraseroVideoOptions *options)
+{
+ BraseroVideoOptionsPrivate *priv;
+ BraseroMedia media;
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (options);
+
+ /* means we haven't initialized yet */
+ if (!priv->vcd_label)
+ return;
+
+ media = brasero_burn_session_get_dest_media (priv->session);
+ if (media & BRASERO_MEDIUM_DVD) {
+ brasero_video_options_audio_AC3 (options);
+ gtk_widget_hide (priv->vcd_label);
+ gtk_widget_hide (priv->vcd_button);
+ gtk_widget_hide (priv->svcd_button);
+
+ gtk_widget_set_sensitive (priv->button_4_3, TRUE);
+ gtk_widget_set_sensitive (priv->button_16_9, TRUE);
+ }
+ else if (media & BRASERO_MEDIUM_CD) {
+ brasero_video_options_audio_MP2 (options);
+ gtk_widget_show (priv->vcd_label);
+ gtk_widget_show (priv->vcd_button);
+ gtk_widget_show (priv->svcd_button);
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->vcd_button))) {
+ gtk_widget_set_sensitive (priv->button_4_3, FALSE);
+ gtk_widget_set_sensitive (priv->button_16_9, FALSE);
+ }
+ else {
+ gtk_widget_set_sensitive (priv->button_4_3, TRUE);
+ gtk_widget_set_sensitive (priv->button_16_9, TRUE);
+ }
+ }
+ else if (media & BRASERO_MEDIUM_FILE) {
+ BraseroImageFormat format;
+
+ /* if we create a CUE file then that's a (S)VCD */
+ format = brasero_burn_session_get_output_format (priv->session);
+ if (format == BRASERO_IMAGE_FORMAT_NONE)
+ return;
+
+ if (format == BRASERO_IMAGE_FORMAT_CUE) {
+ brasero_video_options_audio_MP2 (options);
+ gtk_widget_show (priv->vcd_label);
+ gtk_widget_show (priv->vcd_button);
+ gtk_widget_show (priv->svcd_button);
+
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->vcd_button))) {
+ gtk_widget_set_sensitive (priv->button_4_3, FALSE);
+ gtk_widget_set_sensitive (priv->button_16_9, FALSE);
+ }
+ else {
+ gtk_widget_set_sensitive (priv->button_4_3, TRUE);
+ gtk_widget_set_sensitive (priv->button_16_9, TRUE);
+ }
+ }
+ else if (format == BRASERO_IMAGE_FORMAT_BIN) {
+ brasero_video_options_audio_AC3 (options);
+ gtk_widget_hide (priv->vcd_label);
+ gtk_widget_hide (priv->vcd_button);
+ gtk_widget_hide (priv->svcd_button);
+
+ gtk_widget_set_sensitive (priv->button_4_3, TRUE);
+ gtk_widget_set_sensitive (priv->button_16_9, TRUE);
+ }
+ }
+}
+
+static void
+brasero_video_options_set_tag (BraseroVideoOptions *options,
+ const gchar *tag,
+ gint contents)
+{
+ GValue *value;
+ BraseroVideoOptionsPrivate *priv;
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (options);
+
+ value = g_new0 (GValue, 1);
+ g_value_init (value, G_TYPE_INT);
+ g_value_set_int (value, contents);
+ brasero_burn_session_tag_add (priv->session,
+ tag,
+ value);
+}
+
+static void
+brasero_video_options_SVCD (GtkToggleButton *button,
+ BraseroVideoOptions *options)
+{
+ BraseroVideoOptionsPrivate *priv;
+
+ if (!gtk_toggle_button_get_active (button))
+ return;
+
+ brasero_video_options_set_tag (options,
+ BRASERO_VCD_TYPE,
+ BRASERO_SVCD);
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (options);
+
+ gtk_widget_set_sensitive (priv->button_4_3, TRUE);
+ gtk_widget_set_sensitive (priv->button_16_9, TRUE);
+}
+
+static void
+brasero_video_options_VCD (GtkToggleButton *button,
+ BraseroVideoOptions *options)
+{
+ BraseroVideoOptionsPrivate *priv;
+
+ if (!gtk_toggle_button_get_active (button))
+ return;
+
+ brasero_video_options_set_tag (options,
+ BRASERO_VCD_TYPE,
+ BRASERO_VCD_V2);
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (options);
+ gtk_widget_set_sensitive (priv->button_4_3, FALSE);
+ gtk_widget_set_sensitive (priv->button_16_9, FALSE);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->button_4_3), TRUE);
+}
+
+static void
+brasero_video_options_NTSC (GtkToggleButton *button,
+ BraseroVideoOptions *options)
+{
+ if (!gtk_toggle_button_get_active (button))
+ return;
+
+ brasero_video_options_set_tag (options,
+ BRASERO_VIDEO_OUTPUT_FRAMERATE,
+ BRASERO_VIDEO_FRAMERATE_NTSC);
+}
+
+static void
+brasero_video_options_PAL_SECAM (GtkToggleButton *button,
+ BraseroVideoOptions *options)
+{
+ if (!gtk_toggle_button_get_active (button))
+ return;
+
+ brasero_video_options_set_tag (options,
+ BRASERO_VIDEO_OUTPUT_FRAMERATE,
+ BRASERO_VIDEO_FRAMERATE_PAL_SECAM);
+}
+
+static void
+brasero_video_options_native_framerate (GtkToggleButton *button,
+ BraseroVideoOptions *options)
+{
+ BraseroVideoOptionsPrivate *priv;
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (options);
+ if (!gtk_toggle_button_get_active (button))
+ return;
+
+ brasero_burn_session_tag_remove (priv->session, BRASERO_VIDEO_OUTPUT_FRAMERATE);
+}
+
+static void
+brasero_video_options_16_9 (GtkToggleButton *button,
+ BraseroVideoOptions *options)
+{
+ if (!gtk_toggle_button_get_active (button))
+ return;
+
+ brasero_video_options_set_tag (options,
+ BRASERO_VIDEO_OUTPUT_ASPECT,
+ BRASERO_VIDEO_ASPECT_16_9);
+}
+
+static void
+brasero_video_options_4_3 (GtkToggleButton *button,
+ BraseroVideoOptions *options)
+{
+ if (!gtk_toggle_button_get_active (button))
+ return;
+
+ brasero_video_options_set_tag (options,
+ BRASERO_VIDEO_OUTPUT_ASPECT,
+ BRASERO_VIDEO_ASPECT_4_3);
+}
+
+static void
+brasero_video_options_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroVideoOptionsPrivate *priv;
+
+ g_return_if_fail (BRASERO_IS_VIDEO_OPTIONS (object));
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_SESSION: /* Readable and only writable at creation time */
+ priv->session = BRASERO_BURN_SESSION (g_value_get_object (value));
+ g_object_ref (priv->session);
+ brasero_video_options_update (BRASERO_VIDEO_OPTIONS(object));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+brasero_video_options_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ BraseroVideoOptionsPrivate *priv;
+
+ g_return_if_fail (BRASERO_IS_VIDEO_OPTIONS (object));
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (object);
+
+ switch (prop_id)
+ {
+ case PROP_SESSION:
+ g_value_set_object (value, priv->session);
+ g_object_ref (priv->session);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+brasero_video_options_init (BraseroVideoOptions *object)
+{
+ gchar *string;
+ GtkWidget *label;
+ GtkWidget *table;
+ GtkWidget *widget;
+ GtkWidget *button1;
+ GtkWidget *button2;
+ GtkWidget *button3;
+ GtkWidget *options;
+ BraseroVideoOptionsPrivate *priv;
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (object);
+
+ widget = gtk_vbox_new (FALSE, 0);
+
+ table = gtk_table_new (3, 4, FALSE);
+ gtk_table_set_col_spacings (GTK_TABLE (table), 8);
+ gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+ gtk_widget_show (table);
+
+ label = gtk_label_new (_("Video format:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_widget_show (label);
+ gtk_table_attach (GTK_TABLE (table),
+ label,
+ 0, 1,
+ 0, 1,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+
+ button1 = gtk_radio_button_new_with_mnemonic (NULL,
+ _("_NTSC"));
+ gtk_widget_set_tooltip_text (button1, _("Format used mostly on the North American Continent"));
+ g_signal_connect (button1,
+ "toggled",
+ G_CALLBACK (brasero_video_options_NTSC),
+ object);
+ gtk_table_attach (GTK_TABLE (table),
+ button1,
+ 3, 4,
+ 0, 1,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+
+ button2 = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button1),
+ _("_PAL/SECAM"));
+ gtk_widget_set_tooltip_text (button2, _("Format used mostly in Europe"));
+ g_signal_connect (button2,
+ "toggled",
+ G_CALLBACK (brasero_video_options_PAL_SECAM),
+ object);
+ gtk_table_attach (GTK_TABLE (table),
+ button2,
+ 2, 3,
+ 0, 1,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+
+ button3 = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button1),
+ _("Native _format"));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button3), TRUE);
+ g_signal_connect (button3,
+ "toggled",
+ G_CALLBACK (brasero_video_options_native_framerate),
+ object);
+ gtk_table_attach (GTK_TABLE (table),
+ button3,
+ 1, 2,
+ 0, 1,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+
+ label = gtk_label_new (_("Aspect ratio:"));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_widget_show (label);
+ gtk_table_attach (GTK_TABLE (table),
+ label,
+ 0, 1,
+ 1, 2,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+
+ button1 = gtk_radio_button_new_with_mnemonic (NULL,
+ _("_4:3"));
+ g_signal_connect (button1,
+ "toggled",
+ G_CALLBACK (brasero_video_options_4_3),
+ object);
+ gtk_table_attach (GTK_TABLE (table),
+ button1,
+ 1, 2,
+ 1, 2,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+ priv->button_4_3 = button1;
+
+ button2 = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button1),
+ _("_16:9"));
+ g_signal_connect (button2,
+ "toggled",
+ G_CALLBACK (brasero_video_options_16_9),
+ object);
+ gtk_table_attach (GTK_TABLE (table),
+ button2,
+ 2, 3,
+ 1, 2,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+ priv->button_16_9 = button2;
+
+ /* Video options for (S)VCD */
+ label = gtk_label_new (_("VCD type:"));
+ priv->vcd_label = label;
+
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_widget_show (label);
+ gtk_table_attach (GTK_TABLE (table),
+ label,
+ 0, 1,
+ 2, 3,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+
+ button1 = gtk_radio_button_new_with_mnemonic_from_widget (NULL, _("Create a SVCD"));
+ priv->svcd_button = button1;
+ gtk_table_attach (GTK_TABLE (table),
+ button1,
+ 1, 2,
+ 2, 3,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+
+ g_signal_connect (button1,
+ "clicked",
+ G_CALLBACK (brasero_video_options_SVCD),
+ object);
+
+ button2 = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button1), _("Create a VCD"));
+ priv->vcd_button = button2;
+ gtk_table_attach (GTK_TABLE (table),
+ button2,
+ 2, 3,
+ 2, 3,
+ GTK_FILL,
+ GTK_FILL,
+ 0, 0);
+
+ g_signal_connect (button2,
+ "clicked",
+ G_CALLBACK (brasero_video_options_VCD),
+ object);
+
+ string = g_strdup_printf ("<b>%s</b>", _("Video Options"));
+ options = brasero_utils_pack_properties (string,
+ table,
+ NULL);
+ g_free (string);
+
+ gtk_box_pack_start (GTK_BOX (widget), options, FALSE, FALSE, 0);
+
+ /* NOTE: audio options for DVDs were removed. For SVCD that is MP2 and
+ * for Video DVD even if we have a choice AC3 is the most widespread
+ * audio format. So use AC3 by default. */
+
+ gtk_widget_show_all (widget);
+ gtk_container_add (GTK_CONTAINER (object), widget);
+
+ /* Just to make sure our tags are correct in BraseroBurnSession */
+ brasero_video_options_set_tag (object,
+ BRASERO_VCD_TYPE,
+ BRASERO_SVCD);
+ brasero_video_options_set_tag (object,
+ BRASERO_VIDEO_OUTPUT_ASPECT,
+ BRASERO_VIDEO_ASPECT_4_3);
+}
+
+static void
+brasero_video_options_finalize (GObject *object)
+{
+ BraseroVideoOptionsPrivate *priv;
+
+ priv = BRASERO_VIDEO_OPTIONS_PRIVATE (object);
+ if (priv->session) {
+ g_object_unref (priv->session);
+ priv->session = NULL;
+ }
+
+ G_OBJECT_CLASS (brasero_video_options_parent_class)->finalize (object);
+}
+
+static void
+brasero_video_options_class_init (BraseroVideoOptionsClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (BraseroVideoOptionsPrivate));
+
+ object_class->finalize = brasero_video_options_finalize;
+ object_class->set_property = brasero_video_options_set_property;
+ object_class->get_property = brasero_video_options_get_property;
+
+ g_object_class_install_property (object_class,
+ PROP_SESSION,
+ g_param_spec_object ("session",
+ "The session",
+ "The session to work with",
+ BRASERO_TYPE_BURN_SESSION,
+ G_PARAM_READWRITE|G_PARAM_CONSTRUCT_ONLY));
+}
+
+GtkWidget *
+brasero_video_options_new (BraseroBurnSession *session)
+{
+ return g_object_new (BRASERO_TYPE_VIDEO_OPTIONS, "session", session, NULL);
+}
diff --git a/libbrasero-burn/brasero-video-options.h b/libbrasero-burn/brasero-video-options.h
new file mode 100644
index 0000000..a5f3ca7
--- /dev/null
+++ b/libbrasero-burn/brasero-video-options.h
@@ -0,0 +1,58 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * brasero-video-options.h
+ * Copyright (C) Philippe Rouquier 2009 <bonfire-app wanadoo fr>
+ *
+ * brasero-video-options.h is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * brasero-video-options.h is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _BRASERO_VIDEO_OPTIONS_H_
+#define _BRASERO_VIDEO_OPTIONS_H_
+
+#include <glib-object.h>
+
+#include <gtk/gtk.h>
+
+#include "brasero-session.h"
+
+G_BEGIN_DECLS
+
+#define BRASERO_TYPE_VIDEO_OPTIONS (brasero_video_options_get_type ())
+#define BRASERO_VIDEO_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_VIDEO_OPTIONS, BraseroVideoOptions))
+#define BRASERO_VIDEO_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_VIDEO_OPTIONS, BraseroVideoOptionsClass))
+#define BRASERO_IS_VIDEO_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BRASERO_TYPE_VIDEO_OPTIONS))
+#define BRASERO_IS_VIDEO_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BRASERO_TYPE_VIDEO_OPTIONS))
+#define BRASERO_VIDEO_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BRASERO_TYPE_VIDEO_OPTIONS, BraseroVideoOptionsClass))
+
+typedef struct _BraseroVideoOptionsClass BraseroVideoOptionsClass;
+typedef struct _BraseroVideoOptions BraseroVideoOptions;
+
+struct _BraseroVideoOptionsClass
+{
+ GtkAlignmentClass parent_class;
+};
+
+struct _BraseroVideoOptions
+{
+ GtkAlignment parent_instance;
+};
+
+GType brasero_video_options_get_type (void) G_GNUC_CONST;
+
+GtkWidget *
+brasero_video_options_new (BraseroBurnSession *session);
+
+G_END_DECLS
+
+#endif /* _BRASERO_VIDEO_OPTIONS_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]