diff options
author | William Jon McCann <jmccann@redhat.com> | 2012-07-20 17:05:33 -0400 |
---|---|---|
committer | William Jon McCann <jmccann@redhat.com> | 2012-07-20 19:07:09 -0400 |
commit | 988e33f3af5ec2b9fe6fd85259dcf916700536b3 (patch) | |
tree | 28be3ed5b4ee9db8619d2bfe030031b6bdbd59d4 /libnautilus-extension/nautilus-column.c | |
parent | 88ae6601e7e2e28d2278441ca90f113fd593a0cc (diff) | |
download | nautilus-988e33f3af5ec2b9fe6fd85259dcf916700536b3.tar.gz |
Make time columns default to descending sort order
Diffstat (limited to 'libnautilus-extension/nautilus-column.c')
-rw-r--r-- | libnautilus-extension/nautilus-column.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libnautilus-extension/nautilus-column.c b/libnautilus-extension/nautilus-column.c index 646e64ef4..f1fed65c1 100644 --- a/libnautilus-extension/nautilus-column.c +++ b/libnautilus-extension/nautilus-column.c @@ -23,6 +23,7 @@ */ #include <config.h> +#include <gtk/gtk.h> #include "nautilus-column.h" #include "nautilus-extension-i18n.h" @@ -34,6 +35,7 @@ enum { PROP_LABEL, PROP_DESCRIPTION, PROP_XALIGN, + PROP_DEFAULT_SORT_ORDER, LAST_PROP }; @@ -43,6 +45,7 @@ struct _NautilusColumnDetails { char *label; char *description; float xalign; + GtkSortType default_sort_order; }; G_DEFINE_TYPE (NautilusColumn, nautilus_column, G_TYPE_OBJECT); @@ -110,6 +113,9 @@ nautilus_column_get_property (GObject *object, case PROP_XALIGN : g_value_set_float (value, column->details->xalign); break; + case PROP_DEFAULT_SORT_ORDER : + g_value_set_enum (value, column->details->default_sort_order); + break; default : G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); break; @@ -151,6 +157,10 @@ nautilus_column_set_property (GObject *object, column->details->xalign = g_value_get_float (value); g_object_notify (object, "xalign"); break; + case PROP_DEFAULT_SORT_ORDER : + column->details->default_sort_order = g_value_get_enum (value); + g_object_notify (object, "default-sort-order"); + break; default : G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec); break; @@ -232,5 +242,13 @@ nautilus_column_class_init (NautilusColumnClass *class) 1.0, 0.0, G_PARAM_READWRITE)); + g_object_class_install_property (G_OBJECT_CLASS (class), + PROP_DEFAULT_SORT_ORDER, + g_param_spec_enum ("default-sort-order", + "Default sort order", + "Default sort order", + GTK_TYPE_SORT_TYPE, + GTK_SORT_ASCENDING, + G_PARAM_READWRITE)); } |