brasero r1525 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1525 - in trunk: . src
- Date: Thu, 13 Nov 2008 22:10:10 +0000 (UTC)
Author: philippr
Date: Thu Nov 13 22:10:10 2008
New Revision: 1525
URL: http://svn.gnome.org/viewvc/brasero?rev=1525&view=rev
Log:
Fix #560525 â Add feedback about performed tasks
* src/brasero-audio-disc.c (brasero_audio_disc_get_status):
* src/brasero-data-disc.c (brasero_data_disc_get_status):
* src/brasero-disc.c (brasero_disc_get_status):
* src/brasero-disc.h:
* src/brasero-project.c (brasero_project_update_project_size),
(_wait_for_ready_state), (brasero_project_check_status),
(brasero_project_contents_changed_cb):
* src/brasero-video-disc.c (brasero_video_disc_get_status):
* src/brasero-video-project.c (brasero_video_project_get_status):
* src/brasero-video-project.h:
* src/burn-basics.c (brasero_burn_action_to_string):
Modified:
trunk/ChangeLog
trunk/src/brasero-audio-disc.c
trunk/src/brasero-data-disc.c
trunk/src/brasero-disc.c
trunk/src/brasero-disc.h
trunk/src/brasero-project.c
trunk/src/brasero-video-disc.c
trunk/src/brasero-video-project.c
trunk/src/brasero-video-project.h
trunk/src/burn-basics.c
Modified: trunk/src/brasero-audio-disc.c
==============================================================================
--- trunk/src/brasero-audio-disc.c (original)
+++ trunk/src/brasero-audio-disc.c Thu Nov 13 22:10:10 2008
@@ -94,7 +94,9 @@
GParamSpec * spec);
static BraseroDiscResult
-brasero_audio_disc_get_status (BraseroDisc *disc);
+brasero_audio_disc_get_status (BraseroDisc *disc,
+ gint *remaining,
+ gchar **current_task);
static BraseroDiscResult
brasero_audio_disc_get_track (BraseroDisc *disc,
@@ -913,15 +915,24 @@
/******************************** activity *************************************/
static BraseroDiscResult
-brasero_audio_disc_get_status (BraseroDisc *disc)
+brasero_audio_disc_get_status (BraseroDisc *disc,
+ gint *remaining,
+ gchar **current_task)
{
GtkTreeModel *model;
if (BRASERO_AUDIO_DISC (disc)->priv->loading)
return BRASERO_DISC_LOADING;
- if (BRASERO_AUDIO_DISC (disc)->priv->activity_counter)
+ if (BRASERO_AUDIO_DISC (disc)->priv->activity_counter) {
+ if (remaining)
+ *remaining = BRASERO_AUDIO_DISC (disc)->priv->activity_counter;
+
+ if (current_task)
+ *current_task = g_strdup (_("Analysing audio files"));
+
return BRASERO_DISC_NOT_READY;
+ }
model = gtk_tree_view_get_model (GTK_TREE_VIEW (BRASERO_AUDIO_DISC (disc)->priv->tree));
if (!gtk_tree_model_iter_n_children (model, NULL))
Modified: trunk/src/brasero-data-disc.c
==============================================================================
--- trunk/src/brasero-data-disc.c (original)
+++ trunk/src/brasero-data-disc.c Thu Nov 13 22:10:10 2008
@@ -1704,7 +1704,9 @@
}
static BraseroDiscResult
-brasero_data_disc_get_status (BraseroDisc *disc)
+brasero_data_disc_get_status (BraseroDisc *disc,
+ gint *remaining,
+ gchar **current_task)
{
BraseroDataDiscPrivate *priv;
@@ -1715,8 +1717,15 @@
/* This one goes before the next since a node may be loading but not
* yet in the project and therefore project will look empty */
- if (brasero_data_vfs_is_active (BRASERO_DATA_VFS (priv->project)))
+ if (brasero_data_vfs_is_active (BRASERO_DATA_VFS (priv->project))) {
+ if (remaining)
+ *remaining = -1;
+
+ if (current_task)
+ *current_task = g_strdup (_("Analysing files"));
+
return BRASERO_DISC_NOT_READY;
+ }
if (brasero_data_project_is_empty (priv->project))
return BRASERO_DISC_ERROR_EMPTY_SELECTION;
Modified: trunk/src/brasero-disc.c
==============================================================================
--- trunk/src/brasero-disc.c (original)
+++ trunk/src/brasero-disc.c Thu Nov 13 22:10:10 2008
@@ -143,23 +143,6 @@
}
BraseroDiscResult
-brasero_disc_can_add_uri (BraseroDisc *disc,
- const gchar *uri)
-{
- BraseroDiscIface *iface;
-
- g_return_val_if_fail (BRASERO_IS_DISC (disc), BRASERO_DISC_ERROR_UNKNOWN);
- g_return_val_if_fail (uri != NULL, BRASERO_DISC_ERROR_UNKNOWN);
-
- iface = BRASERO_DISC_GET_IFACE (disc);
- if (iface->can_add_uri)
- return (* iface->can_add_uri) (disc, uri);
-
- /* default to OK */
- return BRASERO_DISC_OK;
-}
-
-BraseroDiscResult
brasero_disc_add_uri (BraseroDisc *disc,
const gchar *uri)
{
@@ -212,7 +195,9 @@
}
BraseroDiscResult
-brasero_disc_get_status (BraseroDisc *disc)
+brasero_disc_get_status (BraseroDisc *disc,
+ gint *remaining,
+ gchar **current_task)
{
BraseroDiscIface *iface;
@@ -220,7 +205,9 @@
iface = BRASERO_DISC_GET_IFACE (disc);
if (iface->get_status)
- return (* iface->get_status) (disc);
+ return (* iface->get_status) (disc,
+ remaining,
+ current_task);
return BRASERO_DISC_ERROR_UNKNOWN;
}
Modified: trunk/src/brasero-disc.h
==============================================================================
--- trunk/src/brasero-disc.h (original)
+++ trunk/src/brasero-disc.h Thu Nov 13 22:10:10 2008
@@ -111,7 +111,9 @@
BraseroBurnFlag flags);
/* virtual functions */
- BraseroDiscResult (*get_status) (BraseroDisc *disc);
+ BraseroDiscResult (*get_status) (BraseroDisc *disc,
+ gint *remaining,
+ gchar **current_task);
BraseroDiscResult (*load_track) (BraseroDisc *disc,
BraseroDiscTrack *track);
@@ -123,8 +125,6 @@
BraseroDiscResult (*set_session_contents) (BraseroDisc *disc,
BraseroBurnSession *session);
- BraseroDiscResult (*can_add_uri) (BraseroDisc *disc,
- const gchar *uri);
BraseroDiscResult (*add_uri) (BraseroDisc *disc,
const gchar *uri);
@@ -153,9 +153,6 @@
BraseroDiscResult
brasero_disc_add_uri (BraseroDisc *disc, const gchar *escaped_uri);
-BraseroDiscResult
-brasero_disc_can_add_uri (BraseroDisc *disc, const gchar *escaped_uri);
-
gboolean
brasero_disc_get_selected_uri (BraseroDisc *disc, gchar **uri);
@@ -172,7 +169,9 @@
brasero_disc_reset (BraseroDisc *disc);
BraseroDiscResult
-brasero_disc_get_status (BraseroDisc *disc);
+brasero_disc_get_status (BraseroDisc *disc,
+ gint *remaining,
+ gchar **current_task);
BraseroDiscResult
brasero_disc_get_track (BraseroDisc *disc,
Modified: trunk/src/brasero-project.c
==============================================================================
--- trunk/src/brasero-project.c (original)
+++ trunk/src/brasero-project.c Thu Nov 13 22:10:10 2008
@@ -611,6 +611,7 @@
}
else
size = g_strdup_printf (_("Project estimated size: %s"), string);
+
g_free (string);
gtk_statusbar_push (GTK_STATUSBAR (status), project->priv->status_ctx, size);
@@ -696,8 +697,11 @@
static gboolean
_wait_for_ready_state (GtkWidget *dialog)
{
+ gchar *current_task = NULL;
GtkProgressBar *progress;
BraseroProject *project;
+ gint remaining = 0;
+ gint initial;
project = g_object_get_data (G_OBJECT (dialog), "Project");
if (project->priv->oversized) {
@@ -706,9 +710,38 @@
}
progress = g_object_get_data (G_OBJECT (dialog), "ProgressBar");
+ initial = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (dialog), "Remaining"));
+ if (brasero_disc_get_status (project->priv->current, &remaining, ¤t_task) == BRASERO_DISC_NOT_READY) {
+ gchar *string;
+ gchar *size_str;
+
+ if (initial <= 0 || remaining <= 0)
+ gtk_progress_bar_pulse (progress);
+ else
+ gtk_progress_bar_set_fraction (progress, (gdouble) ((gdouble) (initial - remaining) / (gdouble) initial));
+
+ if (current_task) {
+ GtkWidget *current_action;
+
+ current_action = g_object_get_data (G_OBJECT (dialog), "CurrentAction");
+ string = g_strdup_printf ("<i>%s</i>", current_task);
+ g_free (current_task);
+
+ gtk_label_set_markup (GTK_LABEL (current_action), string);
+ g_free (string);
+ }
+
+ string = brasero_utils_get_sectors_string (project->priv->sectors,
+ !BRASERO_IS_DATA_DISC (project->priv->current),
+ TRUE,
+ FALSE);
+
+ size_str = g_strdup_printf (_("Project estimated size: %s"), string);
+ g_free (string);
+
+ gtk_progress_bar_set_text (progress, size_str);
+ g_free (size_str);
- if (brasero_disc_get_status (project->priv->current) == BRASERO_DISC_NOT_READY) {
- gtk_progress_bar_pulse (progress);
return TRUE;
}
@@ -722,12 +755,17 @@
{
int id;
int answer;
+ GtkWidget *box;
GtkWidget *dialog;
+ gchar *current_task;
GtkWidget *progress;
GtkWidget *toplevel;
+ gint remaining = -1;
BraseroDiscResult result;
+ GtkWidget *current_action;
- result = brasero_disc_get_status (disc);
+ current_task = NULL;
+ result = brasero_disc_get_status (disc, &remaining, ¤t_task);
if (result != BRASERO_DISC_NOT_READY)
return result;
@@ -738,46 +776,64 @@
/* This dialog will run as a standalone window when run from nautilus
* to burn burn:// URI contents. */
- if (!brasero_app_is_running (BRASERO_APP (toplevel))) {
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_CANCEL,
- _("Please, wait while initializing."));
+ dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
+ GTK_DIALOG_DESTROY_WITH_PARENT |
+ GTK_DIALOG_MODAL,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CANCEL,
+ _("Please, wait until the estimation of the project size is completed."));
- gtk_window_set_skip_pager_hint (GTK_WINDOW (dialog), FALSE);
- gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE);
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ _("All files from the project need to be analysed to complete this operation."));
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- _("Some tasks are not completed yet."));
- gtk_window_set_title (GTK_WINDOW (dialog), _("Initializing"));
- }
- else {
- dialog = gtk_message_dialog_new (GTK_WINDOW (toplevel),
- GTK_DIALOG_DESTROY_WITH_PARENT |
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_CLOSE,
- _("Please, wait."));
+ gtk_window_set_title (GTK_WINDOW (dialog), _("Project Size Estimation"));
- gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- _("Some tasks are not completed yet."));
- gtk_window_set_title (GTK_WINDOW (dialog), _("Ongoing Tasks"));
+ if (!brasero_app_is_running (BRASERO_APP (toplevel))) {
+ gtk_window_set_skip_pager_hint (GTK_WINDOW (dialog), FALSE);
+ gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), FALSE);
}
- progress = gtk_progress_bar_new ();
- gtk_progress_bar_set_text (GTK_PROGRESS_BAR (progress), " ");
+ box = gtk_vbox_new (FALSE, 4);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- progress,
+ box,
TRUE,
TRUE,
- 10);
+ 0);
+
+ progress = gtk_progress_bar_new ();
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (progress), " ");
+ gtk_box_pack_start (GTK_BOX (box),
+ progress,
+ TRUE,
+ TRUE,
+ 0);
+
+ if (current_task) {
+ gchar *string;
+
+ string = g_strdup_printf ("<i>%s</i>", current_task);
+ g_free (current_task);
+
+ current_action = gtk_label_new (string);
+ g_free (string);
+ }
+ else
+ current_action = gtk_label_new ("");
+
+ gtk_label_set_use_markup (GTK_LABEL (current_action), TRUE);
+ gtk_misc_set_alignment (GTK_MISC (current_action), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (box),
+ current_action,
+ FALSE,
+ TRUE,
+ 0);
gtk_widget_show_all (dialog);
gtk_progress_bar_pulse (GTK_PROGRESS_BAR (progress));
+ g_object_set_data (G_OBJECT (dialog), "CurrentAction", current_action);
g_object_set_data (G_OBJECT (dialog), "ProgressBar", progress);
+ g_object_set_data (G_OBJECT (dialog), "Remaining", GINT_TO_POINTER (remaining));
g_object_set_data (G_OBJECT (dialog), "Project", project);
id = g_timeout_add (100,
@@ -794,7 +850,7 @@
else if (project->priv->oversized)
return BRASERO_DISC_ERROR_SIZE;
- return brasero_disc_get_status (disc);
+ return brasero_disc_get_status (disc, NULL, NULL);
}
/******************************** cover ****************************************/
@@ -1142,7 +1198,7 @@
project->priv->empty = (nb_files == 0);
- if (brasero_disc_get_status (disc) != BRASERO_DISC_LOADING)
+ if (brasero_disc_get_status (disc, NULL, NULL) != BRASERO_DISC_LOADING)
project->priv->modified = 1;
brasero_project_set_remove_button_state (project);
Modified: trunk/src/brasero-video-disc.c
==============================================================================
--- trunk/src/brasero-video-disc.c (original)
+++ trunk/src/brasero-video-disc.c Thu Nov 13 22:10:10 2008
@@ -1295,14 +1295,16 @@
}
static BraseroDiscResult
-brasero_video_disc_get_status (BraseroDisc *self)
+brasero_video_disc_get_status (BraseroDisc *self,
+ gint *remaining,
+ gchar **current_task)
{
BraseroVideoProject *project;
BraseroVideoDiscPrivate *priv;
priv = BRASERO_VIDEO_DISC_PRIVATE (self);
project = BRASERO_VIDEO_PROJECT (gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree)));
- return brasero_video_project_get_status (project);
+ return brasero_video_project_get_status (project, remaining, current_task);
}
BraseroDiscResult
Modified: trunk/src/brasero-video-project.c
==============================================================================
--- trunk/src/brasero-video-project.c (original)
+++ trunk/src/brasero-video-project.c Thu Nov 13 22:10:10 2008
@@ -904,14 +904,23 @@
}
BraseroDiscResult
-brasero_video_project_get_status (BraseroVideoProject *self)
+brasero_video_project_get_status (BraseroVideoProject *self,
+ gint *remaining,
+ gchar **current_task)
{
BraseroVideoProjectPrivate *priv;
priv = BRASERO_VIDEO_PROJECT_PRIVATE (self);
- if (priv->loading)
- return BRASERO_DISC_LOADING;
+ if (priv->loading) {
+ if (remaining)
+ *remaining = priv->loading;
+
+ if (current_task)
+ *current_task = g_strdup (_("Analysing video files"));
+
+ return BRASERO_DISC_NOT_READY;
+ }
if (!priv->first)
return BRASERO_DISC_ERROR_EMPTY_SELECTION;
Modified: trunk/src/brasero-video-project.h
==============================================================================
--- trunk/src/brasero-video-project.h (original)
+++ trunk/src/brasero-video-project.h Thu Nov 13 22:10:10 2008
@@ -159,7 +159,9 @@
gint64 end);
BraseroDiscResult
-brasero_video_project_get_status (BraseroVideoProject *project);
+brasero_video_project_get_status (BraseroVideoProject *project,
+ gint *remaining,
+ gchar **current_task);
GSList *
brasero_video_project_get_contents (BraseroVideoProject *project);
Modified: trunk/src/burn-basics.c
==============================================================================
--- trunk/src/burn-basics.c (original)
+++ trunk/src/burn-basics.c Thu Nov 13 22:10:10 2008
@@ -74,7 +74,7 @@
N_("Creating checksum"),
N_("Copying disc"),
N_("Copying file"),
- N_("Analysing audio information"),
+ N_("Analysing audio files"),
N_("Transcoding song"),
N_("Preparing to write"),
N_("Writing leadin"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]