Commit b8c2fe20 authored by Pavel Cisler's avatar Pavel Cisler Committed by Pavel Cisler

reviewed by: Seth Nickel <seth@eazel.com>

2001-02-05  Pavel Cisler  <pavel@eazel.com>

	reviewed by: Seth Nickel <seth@eazel.com>

	Fix 5930 (Copy dialog often shows "1" as total number of
		  fields in operation)

	* libnautilus-extensions/nautilus-file-operations-progress.c:
	(nautilus_file_operations_progress_update),
	(nautilus_file_operations_progress_new_file):
	* libnautilus-extensions/nautilus-file-operations.c:
	(create_transfer_dialog):
	Special case the preparing to copy/move phase -- when the
	bytes_total is 0, don't display the count.

	* libnautilus-extensions/nautilus-file-operations-progress.c:
	(nautilus_file_operations_progress_thaw):
	Formatting.

	* HACKING:
	Tiny tweak.
parent 671bec82
2001-02-05 Pavel Cisler <pavel@eazel.com>
reviewed by: Seth Nickel <seth@eazel.com>
Fix 5930 (Copy dialog often shows "1" as total number of
fields in operation)
* libnautilus-extensions/nautilus-file-operations-progress.c:
(nautilus_file_operations_progress_update),
(nautilus_file_operations_progress_new_file):
* libnautilus-extensions/nautilus-file-operations.c:
(create_transfer_dialog):
Special case the preparing to copy/move phase -- when the
bytes_total is 0, don't display the count.
* libnautilus-extensions/nautilus-file-operations-progress.c:
(nautilus_file_operations_progress_thaw):
Formatting.
* HACKING:
Tiny tweak.
2001-02-05 Eskil Heyn Olsen <eskil@eazel.com>
* components/services/install/lib/eazel-install-public.h:
......
......@@ -24,7 +24,7 @@ list: <nautilus-list@lists.eazel.com> (subscriptions should be made to
<nautilus-list-request@lists.eazel.com> with "subscribe" as a
subject).
Patches should be made with 'cvs diff -u >patch' and should conform to
Patches should be made with 'cvs diff -pu >patch' and should conform to
Nautilus coding style as described in docs/style-guide.html Please
read other relevant documents in the docs directory too.
......
......@@ -76,6 +76,13 @@ struct NautilusFileOperationsProgressDetails {
static void
nautilus_file_operations_progress_update (NautilusFileOperationsProgress *dialog)
{
if (dialog->details->bytes_total == 0) {
/* we haven't set up the file count yet, do not update the progress
* bar until we do
*/
return;
}
gtk_progress_configure (GTK_PROGRESS (dialog->details->progress_bar),
dialog->details->total_bytes_copied,
0.0, dialog->details->bytes_total);
......@@ -327,24 +334,28 @@ nautilus_file_operations_progress_new_file (NautilusFileOperationsProgress *dial
dialog->details->from_prefix = from_prefix;
dialog->details->to_prefix = to_prefix;
progress_count = g_strdup_printf (_("%ld of %ld"), dialog->details->file_index,
dialog->details->files_total);
gtk_label_set_text (GTK_LABEL (dialog->details->progress_count_label), progress_count);
g_free (progress_count);
gtk_label_set_text (GTK_LABEL (dialog->details->operation_name_label), progress_verb);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->item_name),
item_name, PATH_TRIM_WIDTH);
gtk_label_set_text (GTK_LABEL (dialog->details->from_label), from_prefix);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->from_path_label),
from_path, PATH_TRIM_WIDTH);
if (dialog->details->to_prefix != NULL && dialog->details->to_path_label != NULL) {
gtk_label_set_text (GTK_LABEL (dialog->details->to_label), to_prefix);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->to_path_label),
to_path, PATH_TRIM_WIDTH);
if (dialog->details->bytes_total > 0) {
/* we haven't set up the file count yet, do not update the progress
* count until we do
*/
gtk_label_set_text (GTK_LABEL (dialog->details->operation_name_label), progress_verb);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->item_name),
item_name, PATH_TRIM_WIDTH);
progress_count = g_strdup_printf (_("%ld of %ld"), dialog->details->file_index,
dialog->details->files_total);
gtk_label_set_text (GTK_LABEL (dialog->details->progress_count_label), progress_count);
g_free (progress_count);
gtk_label_set_text (GTK_LABEL (dialog->details->from_label), from_prefix);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->from_path_label),
from_path, PATH_TRIM_WIDTH);
if (dialog->details->to_prefix != NULL && dialog->details->to_path_label != NULL) {
gtk_label_set_text (GTK_LABEL (dialog->details->to_label), to_prefix);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->to_path_label),
to_path, PATH_TRIM_WIDTH);
}
}
nautilus_file_operations_progress_update (dialog);
......@@ -386,7 +397,8 @@ nautilus_file_operations_progress_freeze (NautilusFileOperationsProgress *dialog
void
nautilus_file_operations_progress_thaw (NautilusFileOperationsProgress *dialog)
{
if (dialog->details->freeze_count > 0)
if (dialog->details->freeze_count > 0) {
dialog->details->freeze_count--;
}
}
......@@ -325,7 +325,7 @@ create_transfer_dialog (const GnomeVFSXferProgressInfo *progress_info,
g_return_if_fail (transfer_info->progress_dialog == NULL);
transfer_info->progress_dialog = nautilus_file_operations_progress_new
(transfer_info->operation_title, "", "", "", 1, 1);
(transfer_info->operation_title, "", "", "", 0, 0);
gtk_signal_connect (GTK_OBJECT (transfer_info->progress_dialog),
"clicked",
......
......@@ -76,6 +76,13 @@ struct NautilusFileOperationsProgressDetails {
static void
nautilus_file_operations_progress_update (NautilusFileOperationsProgress *dialog)
{
if (dialog->details->bytes_total == 0) {
/* we haven't set up the file count yet, do not update the progress
* bar until we do
*/
return;
}
gtk_progress_configure (GTK_PROGRESS (dialog->details->progress_bar),
dialog->details->total_bytes_copied,
0.0, dialog->details->bytes_total);
......@@ -327,24 +334,28 @@ nautilus_file_operations_progress_new_file (NautilusFileOperationsProgress *dial
dialog->details->from_prefix = from_prefix;
dialog->details->to_prefix = to_prefix;
progress_count = g_strdup_printf (_("%ld of %ld"), dialog->details->file_index,
dialog->details->files_total);
gtk_label_set_text (GTK_LABEL (dialog->details->progress_count_label), progress_count);
g_free (progress_count);
gtk_label_set_text (GTK_LABEL (dialog->details->operation_name_label), progress_verb);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->item_name),
item_name, PATH_TRIM_WIDTH);
gtk_label_set_text (GTK_LABEL (dialog->details->from_label), from_prefix);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->from_path_label),
from_path, PATH_TRIM_WIDTH);
if (dialog->details->to_prefix != NULL && dialog->details->to_path_label != NULL) {
gtk_label_set_text (GTK_LABEL (dialog->details->to_label), to_prefix);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->to_path_label),
to_path, PATH_TRIM_WIDTH);
if (dialog->details->bytes_total > 0) {
/* we haven't set up the file count yet, do not update the progress
* count until we do
*/
gtk_label_set_text (GTK_LABEL (dialog->details->operation_name_label), progress_verb);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->item_name),
item_name, PATH_TRIM_WIDTH);
progress_count = g_strdup_printf (_("%ld of %ld"), dialog->details->file_index,
dialog->details->files_total);
gtk_label_set_text (GTK_LABEL (dialog->details->progress_count_label), progress_count);
g_free (progress_count);
gtk_label_set_text (GTK_LABEL (dialog->details->from_label), from_prefix);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->from_path_label),
from_path, PATH_TRIM_WIDTH);
if (dialog->details->to_prefix != NULL && dialog->details->to_path_label != NULL) {
gtk_label_set_text (GTK_LABEL (dialog->details->to_label), to_prefix);
set_text_unescaped_trimmed (GTK_LABEL (dialog->details->to_path_label),
to_path, PATH_TRIM_WIDTH);
}
}
nautilus_file_operations_progress_update (dialog);
......@@ -386,7 +397,8 @@ nautilus_file_operations_progress_freeze (NautilusFileOperationsProgress *dialog
void
nautilus_file_operations_progress_thaw (NautilusFileOperationsProgress *dialog)
{
if (dialog->details->freeze_count > 0)
if (dialog->details->freeze_count > 0) {
dialog->details->freeze_count--;
}
}
......@@ -325,7 +325,7 @@ create_transfer_dialog (const GnomeVFSXferProgressInfo *progress_info,
g_return_if_fail (transfer_info->progress_dialog == NULL);
transfer_info->progress_dialog = nautilus_file_operations_progress_new
(transfer_info->operation_title, "", "", "", 1, 1);
(transfer_info->operation_title, "", "", "", 0, 0);
gtk_signal_connect (GTK_OBJECT (transfer_info->progress_dialog),
"clicked",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment