Commit 0ecf10f3 authored by Philippe Rouquier's avatar Philippe Rouquier

Various fixes and improvements

svn path=/trunk/; revision=323
parent e73df744
2007-08-30 Rouquier Philippe <bonfire-app@wanadoo.fr>
- improved overall progress/action reporting (also fix some bugs)
- changed/improved the way jobs are started in a task and the way they interact
- added the possibility for a job to deactivate itself
- rework and improved libisofs plugins (backport patches from stable branch)
- added the size of the free space for temporary location
- grey burn/blank/copy buttons in dialogs when action is not possible
- some UI improvements/fixes here and there
- added file missing for translation
2007-09-01 Luis Medinas <lmedinas@svn.gnome.org>
* MAINTAINERS:
......
......@@ -103,28 +103,48 @@ BRASERO_LIBS="$BRASERO_BASE_LIBS $BRASERO_BASE_LIBS $BRASERO_GNOMEVFS_LIBS $BRAS
dnl ****************check for libburn (optional)**************
LIBBURN_REQUIRED=0.3.4
LIBISOFS_REQUIRED=0.2.5
LIBISOFS_REQUIRED=0.2.8
AC_ARG_ENABLE(libburn,
[ --enable-libburn use libburn if available [[default = yes]]],,
[enable_libburn="yes"])
if test x"$enable_libburn" = "xyes"; then
PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED libisofs-1 >= $LIBISOFS_REQUIRED, build_libburn=yes, build_libburn=no)
PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED, build_libburn=yes, build_libburn=no)
else
build_libburn="no"
fi
if test x"$build_libburn" = "xyes"; then
AC_SUBST(BRASERO_LIBBURNIA_CFLAGS)
AC_SUBST(BRASERO_LIBBURNIA_LIBS)
AC_SUBST(BRASERO_LIBBURN_CFLAGS)
AC_SUBST(BRASERO_LIBBURN_LIBS)
BRASERO_LIBBURNIA_CFLAGS="$LIBBURN_CFLAGS"
BRASERO_LIBBURNIA_LIBS="$LIBBURN_LIBS"
BRASERO_LIBBURN_CFLAGS="$LIBBURN_CFLAGS"
BRASERO_LIBBURN_LIBS="$LIBBURN_LIBS"
AC_DEFINE(HAVE_LIBBURN, 1, [define if you want to use with libburn support])
fi
AM_CONDITIONAL(HAVE_LIBBURN, test x"$build_libburn" = "xyes")
AC_ARG_ENABLE(libisofs,
[ --enable-libisofs use libisofs if available [[default = yes]]],,
[enable_libisofs="yes"])
if test x"$enable_libisofs" = "xyes"; then
PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED, build_libisofs=yes, build_libisofs=no)
else
build_libisofs="no"
fi
if test x"$build_libisofs" = "xyes"; then
AC_SUBST(BRASERO_LIBISOFS_CFLAGS)
AC_SUBST(BRASERO_LIBISOFS_LIBS)
BRASERO_LIBISOFS_CFLAGS="$LIBISOFS_CFLAGS"
BRASERO_LIBISOFS_LIBS="$LIBISOFS_LIBS"
AC_DEFINE(HAVE_LIBISOFS, 1, [define if you want to use with libisofs support])
fi
AM_CONDITIONAL(HAVE_LIBISOFS, test x"$build_libisofs" = "xyes")
dnl ****************check for libnotify (optional)**************
dnl maybe it will be re-enabled later if I can find a use for it
LIBNOTIFY_REQUIRED=0.3.0
......@@ -304,6 +324,7 @@ echo "Version: $BRASERO_VERSION
Build Preview pane : ${enable_preview}
Build libnotify support : ${build_libnotify}
Use libburn : ${build_libburn}
Use libisofs : ${build_libisofs}
"
echo
echo
......@@ -3,6 +3,7 @@
data/brasero.desktop.in
data/brasero.schemas.in
data/brasero.xml.in
src/brasero-dest-selection.c
src/brasero-audio-disc.c
src/brasero-blank-dialog.c
src/brasero-disc-copy-dialog.c
......
......@@ -132,6 +132,9 @@ brasero_blank_dialog_device_opts_setup (BraseroBlankDialog *self)
&supported,
&compulsory);
brasero_tool_dialog_set_valid (BRASERO_TOOL_DIALOG (self),
(brasero_burn_caps_can_blank (priv->caps, priv->session) == BRASERO_BURN_OK));
priv->fast_saved = brasero_blank_dialog_set_button (priv->session,
priv->fast_saved,
priv->fast,
......@@ -344,6 +347,11 @@ brasero_blank_dialog_init (BraseroBlankDialog *obj)
priv = BRASERO_BLANK_DIALOG_PRIVATE (obj);
brasero_tool_dialog_set_button (BRASERO_TOOL_DIALOG (obj),
_("Blank"),
NULL,
"media-optical-blank");
drive = brasero_tool_dialog_get_drive (BRASERO_TOOL_DIALOG (obj));
priv->session = brasero_burn_session_new ();
......@@ -382,11 +390,6 @@ brasero_blank_dialog_init (BraseroBlankDialog *obj)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->fast), TRUE);
brasero_blank_dialog_device_opts_setup (obj);
brasero_tool_dialog_set_button (BRASERO_TOOL_DIALOG (obj),
_("Blank"),
NULL,
"media-optical-blank");
}
GtkWidget *
......
......@@ -86,7 +86,7 @@ brasero_burn_dialog_tray_close_after_cb (BraseroTrayIcon *tray,
struct BraseroBurnDialogPrivate {
BraseroBurn *burn;
BraseroTrackDataType input;
BraseroTrackType input;
BraseroBurnSession *session;
GtkWidget *close_check;
......@@ -490,19 +490,19 @@ brasero_burn_dialog_insert_disc_cb (BraseroBurn *burn,
gtk_widget_destroy (message);
/* see if we should update the infos */
if (dialog->priv->input == BRASERO_TRACK_TYPE_DISC) {
if (dialog->priv->input.type == BRASERO_TRACK_TYPE_DISC) {
NautilusBurnDrive *src;
/* see if the drive is the source */
src = brasero_burn_session_get_src_drive (dialog->priv->session);
if (nautilus_burn_drive_equal (src, drive))
brasero_burn_dialog_update_info (dialog,
dialog->priv->input,
dialog->priv->input.type,
NCB_MEDIA_GET_STATUS (drive));
}
else
brasero_burn_dialog_update_info (dialog,
dialog->priv->input,
dialog->priv->input.type,
NCB_MEDIA_GET_STATUS (drive));
if (hide)
......@@ -1323,20 +1323,18 @@ brasero_burn_dialog_success_run (BraseroBurnDialog *dialog)
static void
brasero_burn_dialog_notify_success (BraseroBurnDialog *dialog)
{
BraseroMedia media;
gchar *primary = NULL;
gchar *secondary = NULL;
BraseroTrackType source;
BraseroMedia media;
NautilusBurnDrive *drive;
drive = brasero_burn_session_get_burner (dialog->priv->session);
brasero_burn_session_get_input_type (dialog->priv->session, &source);
if (source.type != BRASERO_TRACK_TYPE_DISC)
if (dialog->priv->input.type != BRASERO_TRACK_TYPE_DISC)
media = brasero_burn_session_get_dest_media (dialog->priv->session);
else
media = source.subtype.media;
media = dialog->priv->input.subtype.media;
switch (source.type) {
switch (dialog->priv->input.type) {
case BRASERO_TRACK_TYPE_AUDIO:
primary = g_strdup (_("Audio CD successfully burnt"));
secondary = g_strdup_printf (_("\"%s\" is now ready for use"),
......@@ -1447,10 +1445,10 @@ brasero_burn_dialog_run (BraseroBurnDialog *dialog,
g_object_ref (session);
/* update what we should display */
dialog->priv->input = brasero_burn_session_get_input_type (session, NULL);
brasero_burn_session_get_input_type (session, &dialog->priv->input);
if (brasero_burn_session_is_dest_file (session))
media = BRASERO_MEDIUM_FILE;
else if (dialog->priv->input != BRASERO_TRACK_TYPE_DISC)
else if (dialog->priv->input.type != BRASERO_TRACK_TYPE_DISC)
media = brasero_burn_session_get_dest_media (session);
else {
NautilusBurnDrive *drive;
......@@ -1459,7 +1457,7 @@ brasero_burn_dialog_run (BraseroBurnDialog *dialog,
media = NCB_MEDIA_GET_STATUS (drive);
}
brasero_burn_dialog_update_info (dialog, dialog->priv->input, media);
brasero_burn_dialog_update_info (dialog, dialog->priv->input.type, media);
/* start the recording session */
brasero_burn_dialog_activity_start (dialog);
......
......@@ -90,6 +90,12 @@ G_DEFINE_TYPE (BraseroDestSelection, brasero_dest_selection, BRASERO_TYPE_DRIVE_
#define BRASERO_DRIVE_PROPERTIES_KEY "/apps/brasero/drives"
enum {
VALID_MEDIA_SIGNAL,
LAST_SIGNAL
};
static guint brasero_dest_selection_signals [LAST_SIGNAL] = { 0 };
static gchar *
brasero_dest_selection_get_config_key (BraseroTrackDataType input,
NautilusBurnDrive *drive,
......@@ -636,8 +642,8 @@ brasero_dest_selection_set_image_properties (BraseroDestSelection *self)
if (output.type == BRASERO_TRACK_TYPE_NONE
|| output.subtype.img_format == BRASERO_IMAGE_FORMAT_NONE) {
brasero_burn_session_set_image_output (priv->session,
BRASERO_IMAGE_FORMAT_NONE,
NULL);
BRASERO_IMAGE_FORMAT_NONE,
NULL);
return;
}
......@@ -667,8 +673,8 @@ brasero_dest_selection_set_image_properties (BraseroDestSelection *self)
};
brasero_burn_session_set_image_output (priv->session,
output.subtype.img_format,
path);
output.subtype.img_format,
path);
brasero_drive_selection_set_image_path (BRASERO_DRIVE_SELECTION (self),
path);
g_free (path);
......@@ -706,10 +712,9 @@ brasero_dest_selection_check_image_settings (BraseroDestSelection *self)
path = brasero_dest_selection_get_output_path (self);
brasero_dest_selection_get_default_output_format (self, &output);
brasero_burn_session_set_image_output (priv->session,
output.subtype.img_format,
path);
output.subtype.img_format,
path);
g_free (path);
}
else
......@@ -745,6 +750,12 @@ brasero_dest_selection_check_drive_settings (BraseroDestSelection *self,
&supported,
&compulsory);
/* send a signal to tell whether we support this disc or not */
g_signal_emit (self,
brasero_dest_selection_signals [VALID_MEDIA_SIGNAL],
0,
(result == BRASERO_BURN_OK));
if (priv->button) {
if (result != BRASERO_BURN_OK)
gtk_widget_set_sensitive (priv->button, FALSE);
......@@ -842,11 +853,14 @@ brasero_dest_selection_output_changed (BraseroBurnSession *session,
brasero_dest_selection_check_drive_settings (self, burner);
gtk_widget_set_sensitive (priv->copies_box, TRUE);
gtk_widget_show (priv->copies_box);
numcopies = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (priv->copies_spin));
brasero_burn_session_set_num_copies (priv->session, numcopies);
}
else {
gtk_widget_set_sensitive (priv->copies_box, FALSE);
gtk_widget_hide (priv->copies_box);
brasero_burn_session_set_num_copies (priv->session, 1);
/* Make sure there is an output path/type in case that's an image;
......@@ -922,6 +936,8 @@ brasero_dest_selection_init (BraseroDestSelection *object)
"value-changed",
G_CALLBACK (brasero_dest_selection_copies_num_changed_cb),
object);
priv->default_path = 1;
}
static void
......@@ -1035,6 +1051,15 @@ brasero_dest_selection_class_init (BraseroDestSelectionClass *klass)
select_class->drive_changed = brasero_dest_selection_drive_changed;
brasero_dest_selection_signals [VALID_MEDIA_SIGNAL] =
g_signal_new ("valid_media",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST|G_SIGNAL_NO_RECURSE,
0,
NULL, NULL,
g_cclosure_marshal_VOID__BOOLEAN,
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
g_object_class_install_property (object_class,
PROP_SESSION,
g_param_spec_object ("session",
......
......@@ -54,6 +54,8 @@ struct BraseroDiscCopyDialogPrivate {
GtkWidget *selection;
GtkWidget *source;
GtkWidget *button;
BraseroBurnSession *session;
};
typedef struct BraseroDiscCopyDialogPrivate BraseroDiscCopyDialogPrivate;
......@@ -73,6 +75,23 @@ brasero_disc_copy_dialog_get_session (BraseroDiscCopyDialog *self)
return priv->session;
}
static void
brasero_disc_copy_dialog_valid_media_cb (BraseroDestSelection *selection,
gboolean valid,
BraseroDiscCopyDialog *self)
{
BraseroDiscCopyDialogPrivate *priv;
priv = BRASERO_DISC_COPY_DIALOG_PRIVATE (self);
if (brasero_burn_session_same_src_dest_drive (priv->session)) {
gtk_widget_set_sensitive (priv->button, TRUE);
return;
}
gtk_widget_set_sensitive (priv->button, valid);
}
static void
brasero_disc_copy_dialog_init (BraseroDiscCopyDialog *obj)
{
......@@ -89,12 +108,12 @@ brasero_disc_copy_dialog_init (BraseroDiscCopyDialog *obj)
button,
GTK_RESPONSE_CANCEL);
button = brasero_utils_make_button (_("Copy"),
NULL,
"media-optical-burn",
GTK_ICON_SIZE_LARGE_TOOLBAR);
priv->button = brasero_utils_make_button (_("Copy"),
NULL,
"media-optical-burn",
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_dialog_add_action_widget (GTK_DIALOG (obj),
button,
priv->button,
GTK_RESPONSE_OK);
/* create a session and add some default sane flags */
......@@ -125,6 +144,11 @@ brasero_disc_copy_dialog_init (BraseroDiscCopyDialog *obj)
/* destination drive */
priv->selection = brasero_dest_selection_new (priv->session);
g_signal_connect (priv->selection,
"valid-media",
G_CALLBACK (brasero_disc_copy_dialog_valid_media_cb),
obj);
brasero_drive_selection_show_file_drive (BRASERO_DRIVE_SELECTION (priv->selection), TRUE);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (obj)->vbox),
brasero_utils_pack_properties (_("<b>Select a drive to write to</b>"),
......
......@@ -67,6 +67,8 @@ struct _BraseroDiscOptionDialogPrivate {
GtkWidget *selection;
GtkWidget *label;
GtkWidget *button;
guint label_modified:1;
guint joliet_warning:1;
......@@ -665,17 +667,13 @@ brasero_disc_option_dialog_add_data_options (BraseroDiscOptionDialog *dialog)
/* video toggle */
brasero_disc_option_dialog_video_widget (dialog);
options = brasero_utils_pack_properties (_("<b>Disc options</b>"),
priv->joliet_toggle,
priv->video_toggle,
NULL);
gtk_box_pack_start (GTK_BOX (widget), options, FALSE, FALSE, 0);
/* multisession options */
brasero_disc_option_dialog_multi_widget (dialog);
options = brasero_utils_pack_properties (_("<b>Multisession</b>"),
options = brasero_utils_pack_properties (_("<b>Disc options</b>"),
priv->multi_toggle,
priv->joliet_toggle,
priv->video_toggle,
NULL);
gtk_box_pack_start (GTK_BOX (widget), options, FALSE, FALSE, 0);
......@@ -707,7 +705,7 @@ brasero_disc_option_dialog_add_audio_options (BraseroDiscOptionDialog *dialog)
gtk_widget_set_tooltip_text (priv->multi_toggle,
_("Allow create what is called an enhanced CD or CD+"));
options = brasero_utils_pack_properties (_("<b>Multisession</b>"),
options = brasero_utils_pack_properties (_("<b>Disc options</b>"),
priv->multi_toggle,
NULL);
gtk_box_pack_start (GTK_BOX (widget), options, FALSE, FALSE, 0);
......@@ -765,6 +763,17 @@ brasero_disc_option_dialog_set_disc (BraseroDiscOptionDialog *dialog,
}
}
static void
brasero_disc_option_dialog_valid_media_cb (BraseroDestSelection *selection,
gboolean valid,
BraseroDiscOptionDialog *self)
{
BraseroDiscOptionDialogPrivate *priv;
priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (self);
gtk_widget_set_sensitive (priv->button, valid);
}
BraseroBurnSession *
brasero_disc_option_dialog_get_session (BraseroDiscOptionDialog *dialog)
{
......@@ -795,13 +804,13 @@ brasero_disc_option_dialog_init (BraseroDiscOptionDialog *obj)
button,
GTK_RESPONSE_CANCEL);
button = brasero_utils_make_button (_("Burn"),
NULL,
"media-optical-burn",
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_widget_show (button);
priv->button = brasero_utils_make_button (_("Burn"),
NULL,
"media-optical-burn",
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_widget_show (priv->button);
gtk_dialog_add_action_widget (GTK_DIALOG (obj),
button,
priv->button,
GTK_RESPONSE_OK);
priv->caps = brasero_burn_caps_get_default ();
......@@ -822,10 +831,15 @@ brasero_disc_option_dialog_init (BraseroDiscOptionDialog *obj)
/* first box */
priv->selection = brasero_dest_selection_new (priv->session);
g_signal_connect (priv->selection,
"valid-media",
G_CALLBACK (brasero_disc_option_dialog_valid_media_cb),
obj);
brasero_drive_selection_select_default_drive (BRASERO_DRIVE_SELECTION (priv->selection),
BRASERO_MEDIUM_WRITABLE);
gtk_widget_set_tooltip_text (priv->selection,
_("Choose which drive holds the disc to write to"));
_("Choose which drive holds the disc to write to"));
options = brasero_utils_pack_properties (_("<b>Select a drive to write to</b>"),
priv->selection,
......
......@@ -347,6 +347,7 @@ brasero_drive_info_init (BraseroDriveInfo *object)
label = gtk_label_new (_("<b><i>The drive that holds the source media will also be the one used to record.\n\n</i></b>"
"<i>A new recordable media will be required once the one currently loaded has been copied.</i>"));
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
......
......@@ -43,8 +43,11 @@
#include <nautilus-burn-drive.h>
#include <libgnomevfs/gnome-vfs.h>
#include "burn-basics.h"
#include "burn-medium.h"
#include "burn-debug.h"
#include "brasero-ncb.h"
#include "brasero-utils.h"
#include "brasero-drive-properties.h"
......@@ -56,8 +59,10 @@ struct _BraseroDrivePropertiesPrivate
GtkWidget *dummy;
GtkWidget *burnproof;
GtkWidget *notmp;
GtkWidget *tmpdir;
GtkWidget *eject;
GtkWidget *tmpdir;
GtkWidget *tmpdir_size;
};
#define BRASERO_DRIVE_PROPERTIES_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_DRIVE_PROPERTIES, BraseroDrivePropertiesPrivate))
......@@ -130,6 +135,12 @@ void
brasero_drive_properties_set_tmpdir (BraseroDriveProperties *self,
const gchar *path)
{
gchar *string;
gchar *uri_str;
gchar *directory;
GnomeVFSURI *uri;
BraseroBurnResult result;
GnomeVFSFileSize vol_size = 0;
BraseroDrivePropertiesPrivate *priv;
priv = BRASERO_DRIVE_PROPERTIES_PRIVATE (self);
......@@ -140,6 +151,33 @@ brasero_drive_properties_set_tmpdir (BraseroDriveProperties *self,
else
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (priv->tmpdir),
path);
/* get the volume free space */
directory = g_path_get_dirname (path);
uri_str = gnome_vfs_get_uri_from_local_path (directory);
g_free (directory);
uri = gnome_vfs_uri_new (uri_str);
g_free (uri_str);
if (uri == NULL) {
BRASERO_BURN_LOG ("impossible to retrieve size for %s", path);
gtk_label_set_text (GTK_LABEL (priv->tmpdir_size), _("unknown"));
return;
}
result = gnome_vfs_get_volume_free_space (uri, &vol_size);
if (result != GNOME_VFS_OK) {
BRASERO_BURN_LOG ("impossible to retrieve size for %s", path);
gtk_label_set_text (GTK_LABEL (priv->tmpdir_size), _("unknown"));
return;
}
gnome_vfs_uri_unref (uri);
string = brasero_utils_get_size_string (vol_size, TRUE, TRUE);
gtk_label_set_text (GTK_LABEL (priv->tmpdir_size), string);
g_free (string);
}
static void
......@@ -271,6 +309,8 @@ brasero_drive_properties_init (BraseroDriveProperties *object)
BraseroDrivePropertiesPrivate *priv;
GtkCellRenderer *renderer;
GtkTreeModel *model;
GtkWidget *label;
GtkWidget *box;
priv = BRASERO_DRIVE_PROPERTIES_PRIVATE (object);
......@@ -301,7 +341,6 @@ brasero_drive_properties_init (BraseroDriveProperties *object)
priv->burnproof = gtk_check_button_new_with_label (_("Use burnproof (decrease the risk of failures)"));
priv->eject = gtk_check_button_new_with_label (_("Eject after burning"));
priv->notmp = gtk_check_button_new_with_label (_("Burn the image directly without saving it to disc"));
priv->tmpdir = gtk_file_chooser_button_new (_("Directory for temporary files"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox),
brasero_utils_pack_properties (_("<b>Options</b>"),
......@@ -313,8 +352,23 @@ brasero_drive_properties_init (BraseroDriveProperties *object)
FALSE,
FALSE, 0);
priv->tmpdir = gtk_file_chooser_button_new (_("Directory for temporary files"),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
box = gtk_hbox_new (FALSE, 6);
gtk_widget_show (box);
label = gtk_label_new (_("Temporary directory free space:"));
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
priv->tmpdir_size = gtk_label_new ("");
gtk_widget_show (priv->tmpdir_size);
gtk_box_pack_start (GTK_BOX (box), priv->tmpdir_size, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (object)->vbox),
brasero_utils_pack_properties (_("<b>Temporary files</b>"),
box,
priv->tmpdir,
NULL),
FALSE,
......
......@@ -61,6 +61,7 @@ struct _BraseroImageOptionDialogPrivate {
GtkWidget *selection;
GtkWidget *format;
GtkWidget *file;
GtkWidget *button;
};
typedef struct _BraseroImageOptionDialogPrivate BraseroImageOptionDialogPrivate;
......@@ -409,6 +410,23 @@ brasero_image_option_dialog_get_session (BraseroImageOptionDialog *dialog)
return priv->session;
}
static void
brasero_image_option_dialog_valid_media_cb (BraseroDestSelection *selection,
gboolean valid,
BraseroImageOptionDialog *self)
{
BraseroImageOptionDialogPrivate *priv;
priv = BRASERO_IMAGE_OPTION_DIALOG_PRIVATE (self);
if (brasero_burn_session_same_src_dest_drive (priv->session)) {
gtk_widget_set_sensitive (priv->button, TRUE);
return;
}
gtk_widget_set_sensitive (priv->button, valid);
}
static void
brasero_image_option_dialog_init (BraseroImageOptionDialog *obj)
{
......@@ -428,13 +446,13 @@ brasero_image_option_dialog_init (BraseroImageOptionDialog *obj)
button,
GTK_RESPONSE_CANCEL);
button = brasero_utils_make_button (_("Burn"),
NULL,
"media-optical-burn",
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_widget_show (button);
priv->button = brasero_utils_make_button (_("Burn"),
NULL,
"media-optical-burn",
GTK_ICON_SIZE_LARGE_TOOLBAR);
gtk_widget_show (priv->button);
gtk_dialog_add_action_widget (GTK_DIALOG (obj),
button,
priv->button,
GTK_RESPONSE_OK);
priv->caps = brasero_burn_caps_get_default ();
......@@ -459,6 +477,10 @@ brasero_image_option_dialog_init (BraseroImageOptionDialog *obj)
"drive-changed",
G_CALLBACK (brasero_image_option_dialog_media_changed),
obj);
g_signal_connect (priv->selection,
"valid-media",
G_CALLBACK (brasero_image_option_dialog_valid_media_cb),
obj);
options = brasero_utils_pack_properties (_("<b>Select a drive to write to</b>"),
priv->selection,
......
......@@ -371,10 +371,10 @@ brasero_plugin_option_init (BraseroPluginOption *object)
0);
gtk_dialog_set_has_separator (GTK_DIALOG (object), FALSE);
gtk_dialog_add_button (GTK_DIALOG (object),
GTK_STOCK_APPLY, GTK_RESPONSE_OK);
gtk_dialog_add_button (GTK_DIALOG (object),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG (object),
GTK_STOCK_APPLY, GTK_RESPONSE_OK);
}
static void
......
......@@ -305,6 +305,23 @@ brasero_burn_progress_new ()
return GTK_WIDGET (obj);
}
static gboolean
brasero_burn_progress_pulse_cb (BraseroBurnProgress *self)
{
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (self->priv->progress));
return TRUE;
}
static void
brasero_burn_progress_start_blinking (BraseroBurnProgress *self)
{
self->priv->current_progress = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (self->priv->progress));
if (!self->priv->pulse_id)
self->priv->pulse_id = g_timeout_add (150,
(GSourceFunc) brasero_burn_progress_pulse_cb,
self);
}
void
brasero_burn_progress_set_status (BraseroBurnProgress *self,
gboolean is_DVD,
......@@ -317,25 +334,12 @@ brasero_burn_progress_set_status (BraseroBurnProgress *self,
{
gchar *text;
if (!self->priv->pulse_id && action_progress >= 0.0)
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (self->priv->progress),
action_progress);
if (action_progress < 0.0) {
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (self->priv->progress), " ");
brasero_burn_progress_start_blinking (self);
return;
}
if (self->priv->current == BRASERO_BURN_ACTION_BLANKING) {
/* growisofs /libburn in particular when they blanks DVD RW+
* or a CD can report the progress so no need for blinking */
brasero_burn_progress_stop_blinking (self);
}
text = g_strdup_printf ("%i%%", (gint) (action_progress * 100));
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (self->priv->progress), text);
g_free (text);
if (self->priv->current == BRASERO_BURN_ACTION_NONE) {
if (self->priv->time)
gtk_label_set_text (GTK_LABEL (self->priv->time), " ");
......@@ -347,6 +351,16 @@ brasero_burn_progress_set_status (BraseroBurnProgress *self,
return;
}
if (self->priv->pulse_id)
brasero_burn_progress_stop_blinking (self);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (self->priv->progress),
action_progress);
text = g_strdup_printf ("%i%%", (gint) (action_progress * 100));
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (self->priv->progress), text);
g_free (text);
if (remaining >= 0 && self->priv->time) {
int hrs, mn, sec;
......@@ -401,23 +415,6 @@ brasero_burn_progress_set_status (BraseroBurnProgress *self,
gtk_label_set_text (GTK_LABEL (self->priv->bytes_written), " ");
}
static gboolean
brasero_burn_progress_pulse_cb (BraseroBurnProgress *self)
{
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (self->priv->progress));
return TRUE;
}
static void
brasero_burn_progress_start_blinking (BraseroBurnProgress *self)
{
self->priv->current_progress = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (self->priv->progress));
if (!self->priv->pulse_id)
self->priv->pulse_id = g_timeout_add (150,
(GSourceFunc) brasero_burn_progress_pulse_cb,
self);
}
void
brasero_burn_progress_set_action (BraseroBurnProgress *self,