Commit 140b9c15 authored by Darin Adler's avatar Darin Adler
Browse files

reviewed by: Michael Engber <engber@eazel.com>

	Fix bug 6192 ("mapped before underway" warning when clicking on
	any sidebar tab).

	* src/nautilus-view-frame.c: (nautilus_view_frame_map): Remove
	inappropriate check of state, and replace it with a simple NULL
	check that handles the failed case.

	* libnautilus-extensions/nautilus-directory-background.c:
	(nautilus_file_background_is_set): Fixed backwards logic by
	removing an erroneous "!".

	* libnautilus-extensions/nautilus-icon-factory.c: Formatting
	tweaks.
	* src/file-manager/fm-directory-view.c: Formatting tweak.
	* src/nautilus-application.c: (nautilus_application_startup):
	Fixed comment.
	(check_for_and_run_as_super_user): Formatting tweak.
parent 17955b15
2001-01-31 Darin Adler <darin@eazel.com>
reviewed by: Michael Engber <engber@eazel.com>
Fix bug 6192 ("mapped before underway" warning when clicking on
any sidebar tab).
* src/nautilus-view-frame.c: (nautilus_view_frame_map): Remove
inappropriate check of state, and replace it with a simple NULL
check that handles the failed case.
* libnautilus-extensions/nautilus-directory-background.c:
(nautilus_file_background_is_set): Fixed backwards logic by
removing an erroneous "!".
* libnautilus-extensions/nautilus-icon-factory.c: Formatting
tweaks.
* src/file-manager/fm-directory-view.c: Formatting tweak.
* src/nautilus-application.c: (nautilus_application_startup):
Fixed comment.
(check_for_and_run_as_super_user): Formatting tweak.
2001-01-31 Pavel Cisler <pavel@eazel.com>
reviewed by: Gene Z. Ragan <gzr@eazel.com>
......
......@@ -761,10 +761,10 @@ nautilus_file_background_is_set (NautilusBackground *background)
nautilus_file_background_peek_theme_source (background),
&default_color, &default_image, &default_placement, &default_combine);
matches = !nautilus_file_background_matches_default_settings (color, default_color,
image, default_image,
placement, default_placement,
combine, default_combine);
matches = nautilus_file_background_matches_default_settings (color, default_color,
image, default_image,
placement, default_placement,
combine, default_combine);
g_free (color);
g_free (image);
......
......@@ -1006,7 +1006,9 @@ get_themed_icon_file_path (const char *theme_name,
* check out the user's home directory, since it might be an emblem
* that they've added there.
*/
if (path == NULL && icon_size == NAUTILUS_ICON_SIZE_STANDARD && nautilus_str_has_prefix (icon_name, EMBLEM_NAME_PREFIX)) {
if (path == NULL
&& icon_size == NAUTILUS_ICON_SIZE_STANDARD
&& nautilus_str_has_prefix (icon_name, EMBLEM_NAME_PREFIX)) {
for (i = 0; i < NAUTILUS_N_ELEMENTS (icon_file_name_suffixes); i++) {
user_directory = nautilus_get_user_directory ();
path = g_strdup_printf ("%s/emblems/%s%s",
......@@ -1301,7 +1303,8 @@ should_display_image_file_as_itself (NautilusFile *file, gboolean anti_aliased)
{
NautilusSpeedTradeoffValue preference_value;
preference_value = nautilus_preferences_get_integer (NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS);
preference_value = nautilus_preferences_get_integer
(NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS);
/* see if there's a proxy thumbnail to indicate that thumbnailing
* failed, in which case we shouldn't use the thumbnail.
......@@ -1355,11 +1358,12 @@ nautilus_icon_factory_get_icon_for_file (NautilusFile *file, const char *modifie
mime_type = nautilus_file_get_mime_type (file);
file_size = nautilus_file_get_size (file);
if (nautilus_istr_has_prefix (mime_type, "image/") &&
should_display_image_file_as_itself (file, anti_aliased)) {
if (nautilus_istr_has_prefix (mime_type, "image/")
&& should_display_image_file_as_itself (file, anti_aliased)) {
if (file_size < SELF_THUMBNAIL_SIZE_THRESHOLD && is_local) {
uri = nautilus_file_get_uri (file);
} else if (strstr (file_uri, "/.thumbnails/") == NULL && file_size < INHIBIT_THUMBNAIL_SIZE_THRESHOLD) {
} else if (strstr (file_uri, "/.thumbnails/") == NULL
&& file_size < INHIBIT_THUMBNAIL_SIZE_THRESHOLD) {
uri = nautilus_get_thumbnail_uri (file, anti_aliased);
if (uri == NULL) {
uri = get_icon_file_path
......
......@@ -761,10 +761,10 @@ nautilus_file_background_is_set (NautilusBackground *background)
nautilus_file_background_peek_theme_source (background),
&default_color, &default_image, &default_placement, &default_combine);
matches = !nautilus_file_background_matches_default_settings (color, default_color,
image, default_image,
placement, default_placement,
combine, default_combine);
matches = nautilus_file_background_matches_default_settings (color, default_color,
image, default_image,
placement, default_placement,
combine, default_combine);
g_free (color);
g_free (image);
......
......@@ -1006,7 +1006,9 @@ get_themed_icon_file_path (const char *theme_name,
* check out the user's home directory, since it might be an emblem
* that they've added there.
*/
if (path == NULL && icon_size == NAUTILUS_ICON_SIZE_STANDARD && nautilus_str_has_prefix (icon_name, EMBLEM_NAME_PREFIX)) {
if (path == NULL
&& icon_size == NAUTILUS_ICON_SIZE_STANDARD
&& nautilus_str_has_prefix (icon_name, EMBLEM_NAME_PREFIX)) {
for (i = 0; i < NAUTILUS_N_ELEMENTS (icon_file_name_suffixes); i++) {
user_directory = nautilus_get_user_directory ();
path = g_strdup_printf ("%s/emblems/%s%s",
......@@ -1301,7 +1303,8 @@ should_display_image_file_as_itself (NautilusFile *file, gboolean anti_aliased)
{
NautilusSpeedTradeoffValue preference_value;
preference_value = nautilus_preferences_get_integer (NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS);
preference_value = nautilus_preferences_get_integer
(NAUTILUS_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS);
/* see if there's a proxy thumbnail to indicate that thumbnailing
* failed, in which case we shouldn't use the thumbnail.
......@@ -1355,11 +1358,12 @@ nautilus_icon_factory_get_icon_for_file (NautilusFile *file, const char *modifie
mime_type = nautilus_file_get_mime_type (file);
file_size = nautilus_file_get_size (file);
if (nautilus_istr_has_prefix (mime_type, "image/") &&
should_display_image_file_as_itself (file, anti_aliased)) {
if (nautilus_istr_has_prefix (mime_type, "image/")
&& should_display_image_file_as_itself (file, anti_aliased)) {
if (file_size < SELF_THUMBNAIL_SIZE_THRESHOLD && is_local) {
uri = nautilus_file_get_uri (file);
} else if (strstr (file_uri, "/.thumbnails/") == NULL && file_size < INHIBIT_THUMBNAIL_SIZE_THRESHOLD) {
} else if (strstr (file_uri, "/.thumbnails/") == NULL
&& file_size < INHIBIT_THUMBNAIL_SIZE_THRESHOLD) {
uri = nautilus_get_thumbnail_uri (file, anti_aliased);
if (uri == NULL) {
uri = get_icon_file_path
......
......@@ -3214,7 +3214,8 @@ real_update_menus (FMDirectoryView *view)
background = fm_directory_view_get_background (view);
nautilus_bonobo_set_sensitive (view->details->ui,
FM_DIRECTORY_VIEW_COMMAND_RESET_BACKGROUND,
background && nautilus_file_background_is_set (background));
background != NULL
&& nautilus_file_background_is_set (background));
nautilus_bonobo_set_label_for_menu_item_and_command
(view->details->ui,
......
......@@ -371,7 +371,7 @@ nautilus_application_startup (NautilusApplication *application,
case OAF_REG_SUCCESS:
/* We are registered with OAF and all is right with the world. */
case OAF_REG_ALREADY_ACTIVE:
/* Another copy of . */
/* Another copy of nautilus already is running and registered. */
message = NULL;
detailed_message = NULL;
break;
......@@ -583,24 +583,25 @@ check_for_and_run_as_super_user (void)
{
GtkWidget *warning_dlg;
gint result;
if (geteuid () != 0) {
return TRUE;
}
warning_dlg = gnome_message_box_new (
_("You are running Nautilus as root.\n\n"
"As root, you can damage your system if you are not careful, and\n"
"Nautilus will not stop you from doing it."),
GNOME_MESSAGE_BOX_WARNING,
GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL);
warning_dlg = gnome_message_box_new
(_("You are running Nautilus as root.\n\n"
"As root, you can damage your system if you are not careful, and\n"
"Nautilus will not stop you from doing it."),
GNOME_MESSAGE_BOX_WARNING,
GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL);
result = gnome_dialog_run_and_close (GNOME_DIALOG (warning_dlg));
/* If they pressed cancel, quit the application */
if (result == 1) {
return FALSE;
}
return TRUE;
}
......
......@@ -1195,7 +1195,12 @@ nautilus_view_frame_set_label (NautilusViewFrame *view,
view->details->label = g_strdup (label);
}
/* Calls activate on the underlying control frame. */
/* Activate the underlying control frame whenever the view is mapped.
* This causes the view to merge its menu items, for example. For
* sidebar panels, it might be a little late to merge them at map
* time, especially since we don't unmerge them at unmap time (not
* until destroy time).
*/
static void
nautilus_view_frame_map (GtkWidget *view_as_widget)
{
......@@ -1205,20 +1210,9 @@ nautilus_view_frame_map (GtkWidget *view_as_widget)
NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, map, (view_as_widget));
switch (view->details->state) {
case VIEW_FRAME_EMPTY:
case VIEW_FRAME_NO_LOCATION:
case VIEW_FRAME_WAITING:
g_warning ("a view frame was mapped before it was underway");
break;
case VIEW_FRAME_FAILED:
return;
case VIEW_FRAME_UNDERWAY:
case VIEW_FRAME_LOADED:
break;
if (view->details->control_frame != NULL) {
bonobo_control_frame_control_activate (view->details->control_frame);
}
bonobo_control_frame_control_activate (view->details->control_frame);
}
static Nautilus_History *
......
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