diff --git a/src/common/collection.c b/src/common/collection.c index 96fec51f0ca4..9edde47a013e 100644 --- a/src/common/collection.c +++ b/src/common/collection.c @@ -390,6 +390,14 @@ gchar *dt_collection_get_sort_query(const dt_collection_t *collection) sq = dt_util_dstrcat(sq, ORDER_BY_QUERY, "folder DESC, filename DESC, version DESC"); break; + case DT_COLLECTION_SORT_TITLE: + sq = dt_util_dstrcat(sq, ORDER_BY_QUERY, "caption DESC, filename DESC, version DESC"); + break; + + case DT_COLLECTION_SORT_DESCRIPTION: + sq = dt_util_dstrcat(sq, ORDER_BY_QUERY, "description DESC, filename DESC, version DESC"); + break; + case DT_COLLECTION_SORT_NONE: // shouldn't happen break; @@ -427,6 +435,14 @@ gchar *dt_collection_get_sort_query(const dt_collection_t *collection) sq = dt_util_dstrcat(sq, ORDER_BY_QUERY, "folder, filename, version"); break; + case DT_COLLECTION_SORT_TITLE: + sq = dt_util_dstrcat(sq, ORDER_BY_QUERY, "caption, filename, version"); + break; + + case DT_COLLECTION_SORT_DESCRIPTION: + sq = dt_util_dstrcat(sq, ORDER_BY_QUERY, "description, filename, version"); + break; + case DT_COLLECTION_SORT_NONE: // shouldn't happen break; diff --git a/src/common/collection.h b/src/common/collection.h index fcc6e0018b47..f8bae9d59334 100644 --- a/src/common/collection.h +++ b/src/common/collection.h @@ -65,7 +65,9 @@ typedef enum dt_collection_sort_t DT_COLLECTION_SORT_ID, DT_COLLECTION_SORT_COLOR, DT_COLLECTION_SORT_GROUP, - DT_COLLECTION_SORT_PATH + DT_COLLECTION_SORT_PATH, + DT_COLLECTION_SORT_TITLE, + DT_COLLECTION_SORT_DESCRIPTION } dt_collection_sort_t; typedef enum dt_collection_properties_t diff --git a/src/libs/tools/filter.c b/src/libs/tools/filter.c index abe71568a1f0..51ca628201f5 100644 --- a/src/libs/tools/filter.c +++ b/src/libs/tools/filter.c @@ -137,12 +137,14 @@ void gui_init(dt_lib_module_t *self) d->sort = widget = gtk_combo_box_text_new(); gtk_box_pack_start(GTK_BOX(self->widget), widget, FALSE, FALSE, 0); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("filename")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("time")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("rating")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("id")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("color label")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("group")); - gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("full path")); + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("time")); // DT_COLLECTION_SORT_DATETIME + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("rating")); // DT_COLLECTION_SORT_RATING + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("id")); // DT_COLLECTION_SORT_ID + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("color label")); // DT_COLLECTION_SORT_COLOR + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("group")); // DT_COLLECTION_SORT_GROUP + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("full path")); // DT_COLLECTION_SORT_PAT + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("title")); // DT_COLLECTION_SORT_TITLE + gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widget), _("description")); // DT_COLLECTION_SORT_DESCRIPTION /* select the last selected value */ gtk_combo_box_set_active(GTK_COMBO_BOX(widget), dt_collection_get_sort_field(darktable.collection));