reviewed by: Darin Adler <darin@eazel.com>

Finished bug 2146 (Properties window for desktop Trash
	should show Trash properties). The last two changes were
	to remove the "accessed" field for all directories, since
	it seems useless, and to fill in the "where" field with
	"on the desktop".

	* libnautilus-extensions/nautilus-file.c:
	(nautilus_file_get_where_string): New function, calls
	virtual function so trash and normal files can report
	different strings.
	(nautilus_file_get_string_attribute): Changed "parent_uri"
	string attribute to "where", since it is not the parent_uri
	in the Trash case.
	* libnautilus-extensions/nautilus-file.h: Virtual function
	pointer for get_where_string.
	* libnautilus-extensions/nautilus-trash-file.c:
	(trash_file_get_where_string),
	(nautilus_trash_file_initialize_class): Supply get_where_string
	function that returns "on the desktop".
	* libnautilus-extensions/nautilus-vfs-file.c:
	(vfs_file_get_where_string), (nautilus_vfs_file_initialize_class):
	Supply get_where_string function that returns parent_uri string.
	* src/file-manager/fm-properties-window.c:
	(should_show_accessed_date): New function, returns FALSE for
	directories and TRUE for other files.
	(create_basic_page): Honor should_show_accessed_date, and use
	"where" instead of "parent_uri" string attribute.
	* src/file-manager/fm-search-list-view.c:
	(real_get_column_specification): Use "where" instead of "parent_uri"
	string attribute.
This commit is contained in:
John Sullivan 2001-01-19 19:14:11 +00:00
parent 773ec652b1
commit d23bb1b5be
11 changed files with 121 additions and 9 deletions

View file

@ -1,3 +1,38 @@
2001-01-19 John Sullivan <sullivan@eazel.com>
reviewed by: Darin Adler <darin@eazel.com>
Finished bug 2146 (Properties window for desktop Trash
should show Trash properties). The last two changes were
to remove the "accessed" field for all directories, since
it seems useless, and to fill in the "where" field with
"on the desktop".
* libnautilus-extensions/nautilus-file.c:
(nautilus_file_get_where_string): New function, calls
virtual function so trash and normal files can report
different strings.
(nautilus_file_get_string_attribute): Changed "parent_uri"
string attribute to "where", since it is not the parent_uri
in the Trash case.
* libnautilus-extensions/nautilus-file.h: Virtual function
pointer for get_where_string.
* libnautilus-extensions/nautilus-trash-file.c:
(trash_file_get_where_string),
(nautilus_trash_file_initialize_class): Supply get_where_string
function that returns "on the desktop".
* libnautilus-extensions/nautilus-vfs-file.c:
(vfs_file_get_where_string), (nautilus_vfs_file_initialize_class):
Supply get_where_string function that returns parent_uri string.
* src/file-manager/fm-properties-window.c:
(should_show_accessed_date): New function, returns FALSE for
directories and TRUE for other files.
(create_basic_page): Honor should_show_accessed_date, and use
"where" instead of "parent_uri" string attribute.
* src/file-manager/fm-search-list-view.c:
(real_get_column_specification): Use "where" instead of "parent_uri"
string attribute.
2001-01-19 Ramiro Estrugo <ramiro@eazel.com>
reviewed by: Darin Adler <darin@eazel.com>

View file

@ -2182,6 +2182,19 @@ nautilus_file_get_date (NautilusFile *file,
get_date, (file, date_type, date));
}
static char *
nautilus_file_get_where_string (NautilusFile *file)
{
if (file == NULL) {
return NULL;
}
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
return NAUTILUS_CALL_VIRTUAL (NAUTILUS_FILE_CLASS, file,
get_where_string, (file));
}
/**
* nautilus_file_get_date_as_string:
*
@ -3488,7 +3501,7 @@ nautilus_file_get_deep_directory_count_as_string (NautilusFile *file)
* @attribute_name: The name of the desired attribute. The currently supported
* set includes "name", "type", "mime_type", "size", "deep_size", "deep_directory_count",
* "deep_file_count", "deep_total_count", "date_modified", "date_changed", "date_accessed",
* "date_permissions", "owner", "group", "permissions", "octal_permissions", "uri", "parent_uri".
* "date_permissions", "owner", "group", "permissions", "octal_permissions", "uri", "where".
*
* Returns: Newly allocated string ready to display to the user, or NULL
* if the value is unknown or @attribute_name is not supported.
@ -3556,8 +3569,8 @@ nautilus_file_get_string_attribute (NautilusFile *file, const char *attribute_na
if (strcmp (attribute_name, "uri") == 0) {
return nautilus_file_get_uri (file);
}
if (strcmp (attribute_name, "parent_uri") == 0) {
return nautilus_file_get_parent_uri_for_display (file);
if (strcmp (attribute_name, "where") == 0) {
return nautilus_file_get_where_string (file);
}
return NULL;

View file

@ -331,6 +331,7 @@ typedef struct {
gboolean (* get_date) (NautilusFile *file,
NautilusDateType type,
time_t *date);
char * (* get_where_string) (NautilusFile *file);
} NautilusFileClass;
#endif /* NAUTILUS_FILE_H */

View file

@ -33,6 +33,8 @@
#include "nautilus-gtk-macros.h"
#include "nautilus-trash-directory.h"
#include <gtk/gtksignal.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
struct NautilusTrashFileDetails {
NautilusTrashDirectory *trash_directory;
@ -583,6 +585,12 @@ trash_file_get_date (NautilusFile *file,
return got_at_least_one && got_all;
}
static char *
trash_file_get_where_string (NautilusFile *file)
{
return g_strdup (_("on the desktop"));
}
static void
remove_all_real_files (NautilusTrashFile *trash)
@ -682,4 +690,5 @@ nautilus_trash_file_initialize_class (gpointer klass)
file_class->get_item_count = trash_file_get_item_count;
file_class->get_deep_counts = trash_file_get_deep_counts;
file_class->get_date = trash_file_get_date;
file_class->get_where_string = trash_file_get_where_string;
}

View file

@ -229,6 +229,12 @@ vfs_file_get_date (NautilusFile *file,
return FALSE;
}
static char *
vfs_file_get_where_string (NautilusFile *file)
{
return nautilus_file_get_parent_uri_for_display (file);
}
static void
nautilus_vfs_file_initialize (gpointer object, gpointer klass)
{
@ -265,4 +271,5 @@ nautilus_vfs_file_initialize_class (gpointer klass)
file_class->get_item_count = vfs_file_get_item_count;
file_class->get_deep_counts = vfs_file_get_deep_counts;
file_class->get_date = vfs_file_get_date;
file_class->get_where_string = vfs_file_get_where_string;
}

View file

@ -2182,6 +2182,19 @@ nautilus_file_get_date (NautilusFile *file,
get_date, (file, date_type, date));
}
static char *
nautilus_file_get_where_string (NautilusFile *file)
{
if (file == NULL) {
return NULL;
}
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
return NAUTILUS_CALL_VIRTUAL (NAUTILUS_FILE_CLASS, file,
get_where_string, (file));
}
/**
* nautilus_file_get_date_as_string:
*
@ -3488,7 +3501,7 @@ nautilus_file_get_deep_directory_count_as_string (NautilusFile *file)
* @attribute_name: The name of the desired attribute. The currently supported
* set includes "name", "type", "mime_type", "size", "deep_size", "deep_directory_count",
* "deep_file_count", "deep_total_count", "date_modified", "date_changed", "date_accessed",
* "date_permissions", "owner", "group", "permissions", "octal_permissions", "uri", "parent_uri".
* "date_permissions", "owner", "group", "permissions", "octal_permissions", "uri", "where".
*
* Returns: Newly allocated string ready to display to the user, or NULL
* if the value is unknown or @attribute_name is not supported.
@ -3556,8 +3569,8 @@ nautilus_file_get_string_attribute (NautilusFile *file, const char *attribute_na
if (strcmp (attribute_name, "uri") == 0) {
return nautilus_file_get_uri (file);
}
if (strcmp (attribute_name, "parent_uri") == 0) {
return nautilus_file_get_parent_uri_for_display (file);
if (strcmp (attribute_name, "where") == 0) {
return nautilus_file_get_where_string (file);
}
return NULL;

View file

@ -331,6 +331,7 @@ typedef struct {
gboolean (* get_date) (NautilusFile *file,
NautilusDateType type,
time_t *date);
char * (* get_where_string) (NautilusFile *file);
} NautilusFileClass;
#endif /* NAUTILUS_FILE_H */

View file

@ -33,6 +33,8 @@
#include "nautilus-gtk-macros.h"
#include "nautilus-trash-directory.h"
#include <gtk/gtksignal.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
struct NautilusTrashFileDetails {
NautilusTrashDirectory *trash_directory;
@ -583,6 +585,12 @@ trash_file_get_date (NautilusFile *file,
return got_at_least_one && got_all;
}
static char *
trash_file_get_where_string (NautilusFile *file)
{
return g_strdup (_("on the desktop"));
}
static void
remove_all_real_files (NautilusTrashFile *trash)
@ -682,4 +690,5 @@ nautilus_trash_file_initialize_class (gpointer klass)
file_class->get_item_count = trash_file_get_item_count;
file_class->get_deep_counts = trash_file_get_deep_counts;
file_class->get_date = trash_file_get_date;
file_class->get_where_string = trash_file_get_where_string;
}

View file

@ -229,6 +229,12 @@ vfs_file_get_date (NautilusFile *file,
return FALSE;
}
static char *
vfs_file_get_where_string (NautilusFile *file)
{
return nautilus_file_get_parent_uri_for_display (file);
}
static void
nautilus_vfs_file_initialize (gpointer object, gpointer klass)
{
@ -265,4 +271,5 @@ nautilus_vfs_file_initialize_class (gpointer klass)
file_class->get_item_count = vfs_file_get_item_count;
file_class->get_deep_counts = vfs_file_get_deep_counts;
file_class->get_date = vfs_file_get_date;
file_class->get_where_string = vfs_file_get_where_string;
}

View file

@ -1169,6 +1169,20 @@ should_show_file_type (FMPropertiesWindow *window)
return TRUE;
}
static gboolean
should_show_accessed_date (FMPropertiesWindow *window)
{
/* Accessed date for directory seems useless. If we some
* day decide that it is useful, we should separately
* consider whether it's useful for "trash:".
*/
if (nautilus_file_is_directory (window->details->file)) {
return FALSE;
}
return TRUE;
}
static gboolean
should_show_mime_type (FMPropertiesWindow *window)
{
@ -1277,7 +1291,7 @@ create_basic_page (FMPropertiesWindow *window)
} else {
append_title_value_pair (table, _("Size:"), file, "size");
}
append_title_value_pair (table, _("Where:"), file, "parent_uri");
append_title_value_pair (table, _("Where:"), file, "where");
if (should_show_mime_type (window)) {
append_title_value_pair (table, _("MIME type:"), file, "mime_type");
}
@ -1286,7 +1300,10 @@ create_basic_page (FMPropertiesWindow *window)
append_title_field (table, "");
append_title_value_pair (table, _("Modified:"), file, "date_modified");
append_title_value_pair (table, _("Accessed:"), file, "date_accessed");
if (should_show_accessed_date (window)) {
append_title_value_pair (table, _("Accessed:"), file, "date_accessed");
}
if (should_show_custom_icon_buttons (window)) {
/* add command buttons for setting and clearing custom icons */

View file

@ -337,7 +337,7 @@ real_get_column_specification (FMListView *view,
break;
case 3:
fm_list_view_column_set (specification,
"parent_uri", _("Where"),
"where", _("Where"),
NAUTILUS_FILE_SORT_BY_DIRECTORY,
30, 120, 500, FALSE);
break;