Commit fb65f036 authored by Darin Adler's avatar Darin Adler

Remove code that fills the progress bar to the end. The callback from

	* libnautilus-extensions/nautilus-file-operations-progress.c:
	(nautilus_file_operations_progress_done): Remove code that fills
	the progress bar to the end. The callback from gnome-vfs now takes
	care of this (need the new gnome-vfs with bug fixes).

	* libnautilus-extensions/nautilus-file-operations.c:
	(handle_close_callback), (create_transfer_dialog): Handle the
	cancel button in a cleaner way. Just make it close the dialog and
	fall into the code already there to handle cases where the dialog
	is closed directly.

	* src/file-manager/fm-icon-view.c: (get_default_zoom_level): Fixed
	a strangely named variable.
	(fm_icon_view_begin_loading): Don't set the zoom level if the view
	does not support zooming (desktop view anyone?).
	(default_zoom_level_changed_callback): Don't set the zoom level if
	the view does not support zooming (desktop view anyone?).

	* src/nautilus-window.c: (handle_view_as_item_from_bonobo_menu):
	Use eel_strcmp, because the container path can be NULL in some
	cases.
parent b1dc1476
2001-04-13 Darin Adler <darin@eazel.com>
* libnautilus-extensions/nautilus-file-operations-progress.c:
(nautilus_file_operations_progress_done): Remove code that fills
the progress bar to the end. The callback from gnome-vfs now takes
care of this (need the new gnome-vfs with bug fixes).
* libnautilus-extensions/nautilus-file-operations.c:
(handle_close_callback), (create_transfer_dialog): Handle the
cancel button in a cleaner way. Just make it close the dialog and
fall into the code already there to handle cases where the dialog
is closed directly.
* src/file-manager/fm-icon-view.c: (get_default_zoom_level): Fixed
a strangely named variable.
(fm_icon_view_begin_loading): Don't set the zoom level if the view
does not support zooming (desktop view anyone?).
(default_zoom_level_changed_callback): Don't set the zoom level if
the view does not support zooming (desktop view anyone?).
* src/nautilus-window.c: (handle_view_as_item_from_bonobo_menu):
Use eel_strcmp, because the container path can be NULL in some
cases.
2001-04-13 Pavel Cisler <pavel@eazel.com>
* src/file-manager/fm-list-view.c: (real_get_link_column),
......
......@@ -99,7 +99,8 @@ nautilus_file_operations_progress_update (NautilusFileOperationsProgress *progre
gtk_progress_configure (GTK_PROGRESS (progress->details->progress_bar),
progress->details->bytes_copied,
0.0, progress->details->bytes_total);
0.0,
progress->details->bytes_total);
}
static void
......@@ -359,7 +360,8 @@ nautilus_file_operations_progress_new_file (NautilusFileOperationsProgress *prog
(EEL_ELLIPSIZING_LABEL (progress->details->item_name),
item_name);
progress_count = g_strdup_printf (_("%ld of %ld"), file_index,
progress_count = g_strdup_printf (_("%ld of %ld"),
file_index,
progress->details->files_total);
gtk_label_set_text (GTK_LABEL (progress->details->progress_count_label), progress_count);
g_free (progress_count);
......@@ -434,10 +436,8 @@ nautilus_file_operations_progress_done (NautilusFileOperationsProgress *progress
return;
}
/* Make dialog look "done". */
/* No cancel button once the operation is done. */
gnome_dialog_set_sensitive (GNOME_DIALOG (progress), 0, FALSE);
gtk_progress_configure (GTK_PROGRESS (progress->details->progress_bar),
1.0, 0.0, 1.0);
progress->details->delayed_close_timeout_id = gtk_timeout_add
(MINIMUM_TIME_UP - time_up,
......
......@@ -279,17 +279,6 @@ parent_for_error_dialog (TransferInfo *transfer_info)
return transfer_info->parent_view;
}
static void
transfer_dialog_clicked_callback (NautilusFileOperationsProgress *dialog,
int button_number,
gpointer data)
{
TransferInfo *info;
info = (TransferInfo *) data;
info->cancelled = TRUE;
}
static void
fit_rect_on_screen (GdkRectangle *rect)
{
......@@ -343,16 +332,13 @@ center_dialog_over_window (GtkWindow *window, GtkWindow *over)
center_dialog_over_rect (window, rect);
}
static gboolean
handle_close_callback (GnomeDialog *dialog, TransferInfo *tranfer_info)
{
tranfer_info->cancelled = TRUE;
return FALSE;
}
static void
create_transfer_dialog (const GnomeVFSXferProgressInfo *progress_info,
TransferInfo *transfer_info)
......@@ -366,15 +352,18 @@ create_transfer_dialog (const GnomeVFSXferProgressInfo *progress_info,
transfer_info->progress_dialog = nautilus_file_operations_progress_new
(transfer_info->operation_title, "", "", "", 0, 0);
/* Treat clicking on the close box or use of the escape key
* the same as clicking cancel.
*/
gtk_signal_connect (GTK_OBJECT (transfer_info->progress_dialog),
"clicked",
GTK_SIGNAL_FUNC (transfer_dialog_clicked_callback),
GTK_SIGNAL_FUNC (gnome_dialog_close),
NULL);
gtk_signal_connect (GTK_OBJECT (transfer_info->progress_dialog),
"close",
GTK_SIGNAL_FUNC (handle_close_callback),
transfer_info);
/* Capture clicking on the close box or use of the escape key */
gtk_signal_connect (GTK_OBJECT (transfer_info->progress_dialog), "close",
(GtkSignalFunc) handle_close_callback, transfer_info);
gtk_widget_show (GTK_WIDGET (transfer_info->progress_dialog));
/* Make the progress dialog show up over the window we are copying into */
......@@ -524,10 +513,8 @@ handle_transfer_ok (const GnomeVFSXferProgressInfo *progress_info,
case GNOME_VFS_XFER_PHASE_OPENSOURCE:
case GNOME_VFS_XFER_PHASE_OPENTARGET:
/* fall through */
case GNOME_VFS_XFER_PHASE_COPYING:
if (transfer_info->progress_dialog != NULL) {
if (progress_info->bytes_copied == 0) {
progress_dialog_set_to_from_item_text
(transfer_info->progress_dialog,
......
......@@ -99,7 +99,8 @@ nautilus_file_operations_progress_update (NautilusFileOperationsProgress *progre
gtk_progress_configure (GTK_PROGRESS (progress->details->progress_bar),
progress->details->bytes_copied,
0.0, progress->details->bytes_total);
0.0,
progress->details->bytes_total);
}
static void
......@@ -359,7 +360,8 @@ nautilus_file_operations_progress_new_file (NautilusFileOperationsProgress *prog
(EEL_ELLIPSIZING_LABEL (progress->details->item_name),
item_name);
progress_count = g_strdup_printf (_("%ld of %ld"), file_index,
progress_count = g_strdup_printf (_("%ld of %ld"),
file_index,
progress->details->files_total);
gtk_label_set_text (GTK_LABEL (progress->details->progress_count_label), progress_count);
g_free (progress_count);
......@@ -434,10 +436,8 @@ nautilus_file_operations_progress_done (NautilusFileOperationsProgress *progress
return;
}
/* Make dialog look "done". */
/* No cancel button once the operation is done. */
gnome_dialog_set_sensitive (GNOME_DIALOG (progress), 0, FALSE);
gtk_progress_configure (GTK_PROGRESS (progress->details->progress_bar),
1.0, 0.0, 1.0);
progress->details->delayed_close_timeout_id = gtk_timeout_add
(MINIMUM_TIME_UP - time_up,
......
......@@ -279,17 +279,6 @@ parent_for_error_dialog (TransferInfo *transfer_info)
return transfer_info->parent_view;
}
static void
transfer_dialog_clicked_callback (NautilusFileOperationsProgress *dialog,
int button_number,
gpointer data)
{
TransferInfo *info;
info = (TransferInfo *) data;
info->cancelled = TRUE;
}
static void
fit_rect_on_screen (GdkRectangle *rect)
{
......@@ -343,16 +332,13 @@ center_dialog_over_window (GtkWindow *window, GtkWindow *over)
center_dialog_over_rect (window, rect);
}
static gboolean
handle_close_callback (GnomeDialog *dialog, TransferInfo *tranfer_info)
{
tranfer_info->cancelled = TRUE;
return FALSE;
}
static void
create_transfer_dialog (const GnomeVFSXferProgressInfo *progress_info,
TransferInfo *transfer_info)
......@@ -366,15 +352,18 @@ create_transfer_dialog (const GnomeVFSXferProgressInfo *progress_info,
transfer_info->progress_dialog = nautilus_file_operations_progress_new
(transfer_info->operation_title, "", "", "", 0, 0);
/* Treat clicking on the close box or use of the escape key
* the same as clicking cancel.
*/
gtk_signal_connect (GTK_OBJECT (transfer_info->progress_dialog),
"clicked",
GTK_SIGNAL_FUNC (transfer_dialog_clicked_callback),
GTK_SIGNAL_FUNC (gnome_dialog_close),
NULL);
gtk_signal_connect (GTK_OBJECT (transfer_info->progress_dialog),
"close",
GTK_SIGNAL_FUNC (handle_close_callback),
transfer_info);
/* Capture clicking on the close box or use of the escape key */
gtk_signal_connect (GTK_OBJECT (transfer_info->progress_dialog), "close",
(GtkSignalFunc) handle_close_callback, transfer_info);
gtk_widget_show (GTK_WIDGET (transfer_info->progress_dialog));
/* Make the progress dialog show up over the window we are copying into */
......@@ -524,10 +513,8 @@ handle_transfer_ok (const GnomeVFSXferProgressInfo *progress_info,
case GNOME_VFS_XFER_PHASE_OPENSOURCE:
case GNOME_VFS_XFER_PHASE_OPENTARGET:
/* fall through */
case GNOME_VFS_XFER_PHASE_COPYING:
if (transfer_info->progress_dialog != NULL) {
if (progress_info->bytes_copied == 0) {
progress_dialog_set_to_from_item_text
(transfer_info->progress_dialog,
......
......@@ -888,10 +888,10 @@ static NautilusZoomLevel default_zoom_level = NAUTILUS_ZOOM_LEVEL_STANDARD;
static NautilusZoomLevel
get_default_zoom_level (void)
{
static gboolean auto_storaged_added = FALSE;
static gboolean auto_storage_added = FALSE;
if (auto_storaged_added == FALSE) {
auto_storaged_added = TRUE;
if (!auto_storage_added) {
auto_storage_added = TRUE;
nautilus_preferences_add_auto_integer (NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
(int *) &default_zoom_level);
}
......@@ -929,11 +929,13 @@ fm_icon_view_begin_loading (FMDirectoryView *view)
}
/* Set up the zoom level from the metadata. */
level = nautilus_file_get_integer_metadata
(file,
NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL,
get_default_zoom_level ());
fm_icon_view_set_zoom_level (icon_view, level, TRUE);
if (fm_directory_view_supports_zooming (FM_DIRECTORY_VIEW (icon_view))) {
level = nautilus_file_get_integer_metadata
(file,
NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL,
get_default_zoom_level ());
fm_icon_view_set_zoom_level (icon_view, level, TRUE);
}
/* Set the sort mode.
* It's OK not to resort the icons because the
......@@ -972,7 +974,7 @@ fm_icon_view_end_loading (FMDirectoryView *view)
static NautilusZoomLevel
fm_icon_view_get_zoom_level (FMIconView *view)
{
g_return_val_if_fail (FM_IS_ICON_VIEW (view), get_default_zoom_level ());
g_return_val_if_fail (FM_IS_ICON_VIEW (view), NAUTILUS_ZOOM_LEVEL_STANDARD);
return nautilus_icon_container_get_zoom_level (get_icon_container (view));
}
......@@ -2095,12 +2097,14 @@ default_zoom_level_changed_callback (gpointer callback_data)
icon_view = FM_ICON_VIEW (callback_data);
file = fm_directory_view_get_directory_as_file (FM_DIRECTORY_VIEW (icon_view));
level = nautilus_file_get_integer_metadata (file,
NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL,
get_default_zoom_level ());
fm_icon_view_set_zoom_level (icon_view, level, TRUE);
if (fm_directory_view_supports_zooming (FM_DIRECTORY_VIEW (icon_view))) {
file = fm_directory_view_get_directory_as_file (FM_DIRECTORY_VIEW (icon_view));
level = nautilus_file_get_integer_metadata (file,
NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL,
get_default_zoom_level ());
fm_icon_view_set_zoom_level (icon_view, level, TRUE);
}
fm_icon_view_update_icon_container_font_size_table (icon_view);
}
......@@ -2260,7 +2264,6 @@ fm_icon_view_update_icon_container_fonts (FMIconView *icon_view)
g_assert (icon_container != NULL);
for (i = 0; i <= NAUTILUS_ZOOM_LEVEL_LARGEST; i++) {
font = nautilus_font_factory_get_font_from_preferences (font_size_table[i]);
g_assert (font != NULL);
nautilus_icon_container_set_label_font_for_zoom_level (icon_container, i, font);
......
......@@ -1129,11 +1129,11 @@ handle_view_as_item_from_bonobo_menu (NautilusWindow *window, const char *id)
container_path = nautilus_bonobo_get_numbered_menu_item_container_path_from_command (id);
if (strcmp (container_path, NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER) == 0) {
if (eel_strcmp (container_path, NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER) == 0) {
activate_nth_short_list_item
(window,
nautilus_bonobo_get_numbered_menu_item_index_from_command (id));
} else if (strcmp (container_path, NAUTILUS_MENU_PATH_EXTRA_VIEWER_PLACEHOLDER) == 0) {
} else if (eel_strcmp (container_path, NAUTILUS_MENU_PATH_EXTRA_VIEWER_PLACEHOLDER) == 0) {
g_return_if_fail
(nautilus_bonobo_get_numbered_menu_item_index_from_command (id) == 0);
activate_extra_viewer (window);
......
......@@ -1129,11 +1129,11 @@ handle_view_as_item_from_bonobo_menu (NautilusWindow *window, const char *id)
container_path = nautilus_bonobo_get_numbered_menu_item_container_path_from_command (id);
if (strcmp (container_path, NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER) == 0) {
if (eel_strcmp (container_path, NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER) == 0) {
activate_nth_short_list_item
(window,
nautilus_bonobo_get_numbered_menu_item_index_from_command (id));
} else if (strcmp (container_path, NAUTILUS_MENU_PATH_EXTRA_VIEWER_PLACEHOLDER) == 0) {
} else if (eel_strcmp (container_path, NAUTILUS_MENU_PATH_EXTRA_VIEWER_PLACEHOLDER) == 0) {
g_return_if_fail
(nautilus_bonobo_get_numbered_menu_item_index_from_command (id) == 0);
activate_extra_viewer (window);
......
......@@ -1129,11 +1129,11 @@ handle_view_as_item_from_bonobo_menu (NautilusWindow *window, const char *id)
container_path = nautilus_bonobo_get_numbered_menu_item_container_path_from_command (id);
if (strcmp (container_path, NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER) == 0) {
if (eel_strcmp (container_path, NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER) == 0) {
activate_nth_short_list_item
(window,
nautilus_bonobo_get_numbered_menu_item_index_from_command (id));
} else if (strcmp (container_path, NAUTILUS_MENU_PATH_EXTRA_VIEWER_PLACEHOLDER) == 0) {
} else if (eel_strcmp (container_path, NAUTILUS_MENU_PATH_EXTRA_VIEWER_PLACEHOLDER) == 0) {
g_return_if_fail
(nautilus_bonobo_get_numbered_menu_item_index_from_command (id) == 0);
activate_extra_viewer (window);
......
......@@ -1129,11 +1129,11 @@ handle_view_as_item_from_bonobo_menu (NautilusWindow *window, const char *id)
container_path = nautilus_bonobo_get_numbered_menu_item_container_path_from_command (id);
if (strcmp (container_path, NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER) == 0) {
if (eel_strcmp (container_path, NAUTILUS_MENU_PATH_SHORT_LIST_PLACEHOLDER) == 0) {
activate_nth_short_list_item
(window,
nautilus_bonobo_get_numbered_menu_item_index_from_command (id));
} else if (strcmp (container_path, NAUTILUS_MENU_PATH_EXTRA_VIEWER_PLACEHOLDER) == 0) {
} else if (eel_strcmp (container_path, NAUTILUS_MENU_PATH_EXTRA_VIEWER_PLACEHOLDER) == 0) {
g_return_if_fail
(nautilus_bonobo_get_numbered_menu_item_index_from_command (id) == 0);
activate_extra_viewer (window);
......
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