[nautilus] Always show the name column because we're worthless without it
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Always show the name column because we're worthless without it
- Date: Wed, 5 Sep 2012 19:05:27 +0000 (UTC)
commit 32a5fc7c444c0dd17486aadb4c814909931a4730
Author: William Jon McCann <jmccann redhat com>
Date: Wed Sep 5 13:31:47 2012 -0400
Always show the name column because we're worthless without it
https://bugzilla.gnome.org/show_bug.cgi?id=683439
libnautilus-private/nautilus-column-chooser.c | 30 ++++++++++++++++++------
src/nautilus-list-view.c | 2 +
2 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/libnautilus-private/nautilus-column-chooser.c b/libnautilus-private/nautilus-column-chooser.c
index ec28d9b..dfe9ba0 100644
--- a/libnautilus-private/nautilus-column-chooser.c
+++ b/libnautilus-private/nautilus-column-chooser.c
@@ -47,6 +47,7 @@ enum {
COLUMN_VISIBLE,
COLUMN_LABEL,
COLUMN_NAME,
+ COLUMN_SENSITIVE,
NUM_COLUMNS
};
@@ -232,7 +233,8 @@ add_tree_view (NautilusColumnChooser *chooser)
store = gtk_list_store_new (NUM_COLUMNS,
G_TYPE_BOOLEAN,
G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_STRING,
+ G_TYPE_BOOLEAN);
gtk_tree_view_set_model (GTK_TREE_VIEW (view),
GTK_TREE_MODEL (store));
@@ -251,16 +253,18 @@ add_tree_view (NautilusColumnChooser *chooser)
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),
-1, NULL,
- cell,
+ cell,
"active", COLUMN_VISIBLE,
+ "sensitive", COLUMN_SENSITIVE,
NULL);
cell = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view),
-1, NULL,
- cell,
+ cell,
"text", COLUMN_LABEL,
+ "sensitive", COLUMN_SENSITIVE,
NULL);
chooser->details->view = GTK_TREE_VIEW (view);
@@ -413,18 +417,26 @@ populate_tree (NautilusColumnChooser *chooser)
NautilusColumn *column;
char *name;
char *label;
-
+ gboolean visible = FALSE;
+ gboolean sensitive = TRUE;
+
column = NAUTILUS_COLUMN (l->data);
-
- g_object_get (G_OBJECT (column),
- "name", &name, "label", &label,
+
+ g_object_get (G_OBJECT (column),
+ "name", &name, "label", &label,
NULL);
+ if (strcmp (name, "name") == 0) {
+ visible = TRUE;
+ sensitive = FALSE;
+ }
+
gtk_list_store_append (chooser->details->store, &iter);
gtk_list_store_set (chooser->details->store, &iter,
- COLUMN_VISIBLE, FALSE,
+ COLUMN_VISIBLE, visible,
COLUMN_LABEL, label,
COLUMN_NAME, name,
+ COLUMN_SENSITIVE, sensitive,
-1);
g_free (name);
@@ -471,6 +483,8 @@ set_visible_columns (NautilusColumnChooser *chooser,
int i;
visible_columns_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ /* always show the name column */
+ g_hash_table_insert (visible_columns_hash, "name", "name");
for (i = 0; visible_columns[i] != NULL; ++i) {
g_hash_table_insert (visible_columns_hash,
visible_columns[i],
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index e1d8e34..c482831 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -1249,6 +1249,8 @@ apply_columns_settings (NautilusListView *list_view,
g_str_equal,
(GDestroyNotify) g_free,
(GDestroyNotify) g_free);
+ /* always show name column */
+ g_hash_table_insert (visible_columns_hash, g_strdup ("name"), g_strdup ("name"));
if (visible_columns != NULL) {
for (i = 0; visible_columns[i] != NULL; ++i) {
g_hash_table_insert (visible_columns_hash,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]