summaryrefslogtreecommitdiff
path: root/libnautilus-extension
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2012-07-20 17:05:33 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2012-07-20 19:07:09 -0400
commit988e33f3af5ec2b9fe6fd85259dcf916700536b3 (patch)
tree28be3ed5b4ee9db8619d2bfe030031b6bdbd59d4 /libnautilus-extension
parent88ae6601e7e2e28d2278441ca90f113fd593a0cc (diff)
downloadnautilus-988e33f3af5ec2b9fe6fd85259dcf916700536b3.tar.gz
Make time columns default to descending sort order
Diffstat (limited to 'libnautilus-extension')
-rw-r--r--libnautilus-extension/nautilus-column.c18
-rw-r--r--libnautilus-extension/nautilus-column.h1
2 files changed, 19 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));
}
diff --git a/libnautilus-extension/nautilus-column.h b/libnautilus-extension/nautilus-column.h
index 8ad627a9b..06cc4dd2c 100644
--- a/libnautilus-extension/nautilus-column.h
+++ b/libnautilus-extension/nautilus-column.h
@@ -64,6 +64,7 @@ NautilusColumn * nautilus_column_new (const char *name,
* label (string) - the user-visible label for the column
* description (string) - a user-visible description of the column
* xalign (float) - x-alignment of the column
+ * default-sort-order (GtkSortType) - default sort order of the column
*/
G_END_DECLS